fix(review): prevent backdated duplicate-winner claims - #3956
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 651a236 | Commit Preview URL Branch Preview URL |
Jul 07 2026, 07:42 AM |
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - fixes requiredReview updated: 2026-07-07 08:55:56 UTC
🛑 Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Why this is blocked
CI checks failing
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Three independent test/doc mismatches accumulated on main from recently merged PRs, each blocking every subsequent PR's validate-code: - queue.test.ts: 4 disposition-metric assertions predated #3946's repo label redaction and still expected the unredacted literal repo name. - predicted-gate-engine-coverage.test.ts: 3 duplicate-winner assertions predated #3956's anti-backdating fix and asserted the old createdAt- based ordering instead of the new claim-time-only, fail-closed one. - gittensory.full.yml: missing the review.shared_config (#2046) doc section that .gittensory.yml.example already had, breaking their required byte-identical-from-marker sync.
Three independent test/doc mismatches accumulated on main from recently merged PRs, each blocking every subsequent PR's validate-code: - queue.test.ts: 4 disposition-metric assertions predated #3946's repo label redaction and still expected the unredacted literal repo name. - predicted-gate-engine-coverage.test.ts: 3 duplicate-winner assertions predated #3956's anti-backdating fix and asserted the old createdAt- based ordering instead of the new claim-time-only, fail-closed one. - gittensory.full.yml: missing the review.shared_config (#2046) doc section that .gittensory.yml.example already had, breaking their required byte-identical-from-marker sync.
…4019) Three independent test/doc mismatches accumulated on main from recently merged PRs, each blocking every subsequent PR's validate-code: - queue.test.ts: 4 disposition-metric assertions predated #3946's repo label redaction and still expected the unredacted literal repo name. - predicted-gate-engine-coverage.test.ts: 3 duplicate-winner assertions predated #3956's anti-backdating fix and asserted the old createdAt- based ordering instead of the new claim-time-only, fail-closed one. - gittensory.full.yml: missing the review.shared_config (#2046) doc section that .gittensory.yml.example already had, breaking their required byte-identical-from-marker sync.
Three independent test/doc mismatches accumulated on main from recently merged PRs, each blocking every subsequent PR's validate-code: - queue.test.ts: 4 disposition-metric assertions predated #3946's repo label redaction and still expected the unredacted literal repo name. - predicted-gate-engine-coverage.test.ts: 3 duplicate-winner assertions predated #3956's anti-backdating fix and asserted the old createdAt- based ordering instead of the new claim-time-only, fail-closed one. - gittensory.full.yml: missing the review.shared_config (#2046) doc section that .gittensory.yml.example already had, breaking their required byte-identical-from-marker sync.
) packages/gittensory-engine's own test script (tsconfig.test.json + node --test) was broken and silently ungated -- test:ci never invoked it, only the narrower root-level typecheck/test:engine-parity/test:coverage. Three independent issues, all pre-existing: - test/ai-policy-map.test.ts: a fixture was missing the required repoFullName field AiPolicyFatigueInput has always required. - test/gate-verdict-calibration.test.ts: two tests deliberately pass malformed/extra-field input to verify the sanitizer strips it, but typed the fixture as the strict output type instead of casting through unknown first -- TypeScript's excess-property/enum checks correctly rejected the literals. Cast via `as unknown as GateVerdictCalibrationIngestion`, matching what "untrusted external input" actually looks like at this boundary. - test/duplicate-winner.test.ts: three tests asserted createdAt-based election ordering that #3956 deliberately removed (anti-backdating fix, since an older PR could otherwise steal winner credit by editing its body later) -- root test/unit/duplicate-winner.test.ts was updated in that same commit, this parallel copy wasn't, because nothing runs it. Replaced with the equivalent claim-time-only assertions; the file already had adequate non-createdAt coverage for the rest. Adds `npm run test --workspace @jsonbored/gittensory-engine` to test:ci so this can't silently drift again.
Motivation
createdAt(GitHub PR creation time) could override the observedlinkedIssueClaimedAt, letting older placeholder PRs that later edit in an issue steal winner credit from the PR that actually claimed the issue first.Description
linkedIssueClaimedAtexclusively for winner comparisons and deliberately ignorecreatedAtwhen deciding cluster winners.createdAtfield onDuplicateClaimMemberfor caller compatibility but document it is not used for winner ordering.packages/gittensory-engine/src/duplicate-winner.ts,packages/gittensory-engine/src/signals/duplicate-winner.ts,src/signals/duplicate-winner.ts, andtest/unit/duplicate-winner.test.ts.Testing
git diff --checkwhich produced no issues and is clean.npm run typecheckwhich passed with no TypeScript errors.npx vitest run test/unit/duplicate-winner.test.tsand all tests passed (39tests passed).npm run build:minerwhich completed successfully.npm run test:coverage -- test/unit/duplicate-winner.test.ts; the tests executed successfully but coverage remapping failed withTypeError: jsTokens is not a functionfrom the local coverage provider (tests themselves passed).npm audit --audit-level=moderatebut the audit endpoint returned403 Forbidden, so the dependency-review step could not complete locally.Codex Task