fix(review): fail closed on sparse duplicate claims - #1843
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1843 +/- ##
=======================================
Coverage 95.62% 95.62%
=======================================
Files 214 214
Lines 23274 23274
Branches 8402 8404 +2
=======================================
Hits 22255 22255
Misses 422 422
Partials 597 597
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-06-30 08:30:30 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 3 non-blocking
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.
|
Motivation
linkedIssueClaimedAtmetadata from arbitrarily electing a low-number PR as the duplicate-winner via PR-number fallback, which can suppress duplicate evidence and alter gate/agent outcomes.Description
isDuplicateClusterWinnerByClaimso anullor unparsablelinkedIssueClaimedAton the subject PR or any open sibling returnsfalse(fail closed) instead of falling back toisDuplicateClusterWinnerby PR number, leaving tie-by-claim behavior intact for equal-known timestamps. (file:src/signals/duplicate-winner.ts)src/rules/advisory.ts,src/queue/processors.ts,src/signals/engine.ts)test/unit/duplicate-winner.test.tsto assert that missing or invalid claim timestamps cause the cluster election to fail closed while preserving PR-number tie-break behavior for equal known timestamps.Testing
vitest:test/unit/duplicate-winner.test.ts,test/unit/rules.test.ts, andtest/unit/agent-actions.test.ts(pattern"dup-winner|duplicate risk|duplicate cause") and the selected tests passed.npm run typecheckwhich completed successfully.npm run test:coverageandnpm audit --audit-level=moderatein this environment, but the full coverage run did not complete due to unrelated long-running test shards/timeouts andnpm auditreturned403 Forbiddenfrom the registry; these are environmental and unrelated to the focused unit/regression tests exercised above.Codex Task