fix(scoreability): wire duplicate-risk collisions into score preview blockers#386
Open
jonathanchang31 wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
@JSONbored Could you plz review my PR? |
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
This PR fixes issue #385.
The
duplicate_riskscoreability blocker already existed inbuildScorePreview, but production code did not passduplicateRiskCount, so the blocker could only fire in direct unit tests.This change wires high-risk duplicate/overlap collision counts into score preview inputs from production paths:
Now, when high-risk duplicate or overlapping work is detected, private scoreability surfaces include the
duplicate_riskreducer blocker.Related Issue
Closes: #385
Change Type
Real Behavior Proof
Before this change:
buildScorePreviewconsumedduplicateRiskCount.duplicateRiskCount.duplicate_riskcould not fire in real local-branch or reward-risk flows.After this change:
A high-risk duplicate collision in local branch analysis produces:
scorePreview.blockedBy[].code === "duplicate_risk"A high-risk duplicate collision in reward-risk analysis produces:
currentPreview.blockedBy[].code === "duplicate_risk"Validation
Ran locally on Node 22:
npx vitest run test/unit/local-branch.test.ts test/unit/signals-coverage.test.ts test/unit/scenario-blockers.test.ts58/58npm run typechecknpm run test:unit1007/1007npm run test:integration35/35npx wrangler dev --local --ip 127.0.0.1 --port 8792Ready on http://127.0.0.1:8792Checklist
duplicateRiskCountwas consumed but not produced