fix(signals): wire duplicate-risk collision count into the duplicate_risk score blocker#387
Open
galuis116 wants to merge 1 commit into
Open
fix(signals): wire duplicate-risk collision count into the duplicate_risk score blocker#387galuis116 wants to merge 1 commit into
galuis116 wants to merge 1 commit into
Conversation
…te_risk reducer fires
20 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The score-preview gate emits a
duplicate_riskreducer wheninput.duplicateRiskCount > 0(src/scoring/preview.ts), but no production code ever setduplicateRiskCount— a grep acrosssrc/returned only the type declaration and the consumer. So the reducer was dead code on every path; onlytest/unit/scenario-blockers.test.tsexercised it by passing the field directly tobuildScorePreview.The sibling reducer right above it,
stale_work, is fed (buildLocalScoreInputsetsobservedStalePrCount). The two reducers were added together but only stale-work was wired to a producer. The duplicate-risk data the reducer needs is already computed on both producing paths and is even rendered into the contributor-facing "Overlap/WIP Check" packet — it was simply never converted intoduplicateRiskCountfor the score input. Closes #385.Scope
src/signals/local-branch.ts— threadduplicateRiskCountintobuildLocalScoreInput(new param + returned field), derived from the already-availablepreflight.collisionsas the count of high-risk overlap clusters relevant to the branch.src/signals/reward-risk.ts— addduplicateRiskCount: collisions.summary.highRiskCounttocommonPreviewInput(the count already drivesriskPenalty).test/unit/local-branch.test.ts— fail-on-revert test: a branch colliding with a high-risk overlap cluster now yields aduplicate_riskreducer inblockedBy.No behavior change to any path where there is no high-risk collision:
duplicateRiskCountresolves to 0 there, exactly as before.Validation
npx tsc --noEmit— clean.npx vitest runfor the producer + consumer suites (local-branch, scenario-blockers, signals, signals-v2, decision-pack, agent-orchestrator) — all pass; the new test fails on revert.Safety
Notes
Scoped to the two producing paths called out in the issue. Exposing
duplicateRiskCounton the publicscorePreviewSchema/ MCP input (so external callers can supply it) is left out to keep this minimal and low-risk.