Skip to content

fix(scoreability): wire duplicate-risk collisions into score preview blockers#386

Closed
jonathanchang31 wants to merge 1 commit into
JSONbored:mainfrom
jonathanchang31:fix/no-production-code-produce-it
Closed

fix(scoreability): wire duplicate-risk collisions into score preview blockers#386
jonathanchang31 wants to merge 1 commit into
JSONbored:mainfrom
jonathanchang31:fix/no-production-code-produce-it

Conversation

@jonathanchang31
Copy link
Copy Markdown
Contributor

Summary

This PR fixes issue #385.
The duplicate_risk scoreability blocker already existed in buildScorePreview, but production code did not pass duplicateRiskCount, 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:

  • local branch analysis
  • repo reward-risk analysis

Now, when high-risk duplicate or overlapping work is detected, private scoreability surfaces include the duplicate_risk reducer blocker.

Related Issue

Closes: #385

Change Type

  • Bug fix
  • Scoreability logic
  • Private signal correctness
  • Regression tests
  • Feature
  • Refactor only

Real Behavior Proof

Before this change:

  • buildScorePreview consumed duplicateRiskCount.
  • No production producer set duplicateRiskCount.
  • duplicate_risk could 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.ts

    • Passed: 58/58
  • npm run typecheck

    • Passed
  • npm run test:unit

    • Passed: 1007/1007
  • npm run test:integration

    • Passed: 35/35
  • npx wrangler dev --local --ip 127.0.0.1 --port 8792

    • Worker started successfully
    • Observed: Ready on http://127.0.0.1:8792

Checklist

  • Verified duplicateRiskCount was consumed but not produced
  • Wired production local-branch path
  • Wired production reward-risk path
  • Added regression tests for production builders
  • Typecheck passes
  • Unit tests pass
  • Integration tests pass
  • Local worker startup validated
  • No dependency installation needed

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 4, 2026
@github-actions github-actions Bot added the bug Something isn't working label Jun 4, 2026
@jonathanchang31
Copy link
Copy Markdown
Contributor Author

@JSONbored Could you plz review my PR?

@JSONbored
Copy link
Copy Markdown
Owner

@jonathanchang31 thanks for picking this up.

A few notes:

Required changes:

Validation expected:

@JSONbored JSONbored closed this Jun 4, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: The duplicate_risk scoreability blocker can never fire — duplicateRiskCount is consumed (and tested) but no production code ever produces it

2 participants