fix(signals): wire open-PR pressure scenarios into the branch scenario summary (#348) - #923
Conversation
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 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. |
|
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
This comment has been minimized.
This comment has been minimized.
…o summary (JSONbored#348) `simulateOpenPrPressure` (open-pr-pressure-scenarios.ts, JSONbored#348) and the `renderPublicScenarioSummary` `options`/headline rendering for it were both implemented and tested, but the only production caller — buildLocalBranchAnalysis — never built or passed `pressureSimulation`. As a result `scenarioSummary.options` was ALWAYS empty in analyze-branch / preflight / local-diff, and the strategy guidance (open new work / wait / clean up first) never reached contributors. Build the simulation at the call site (roleContext is already in scope; derive queueHealth via buildCollisionReport + buildQueueHealth, and the contributor's own open-PR count) and pass it through. Pure/read-only and public-safe — the renderer already sanitizes every line. Test: local-branch.test.ts now asserts scenarioSummary.options is populated (3 ranked options, exactly one recommended, non-empty label + nextStep). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7e575b7 to
77aceb4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #923 +/- ##
=======================================
Coverage 96.60% 96.61%
=======================================
Files 109 109
Lines 14895 14898 +3
Branches 5384 5385 +1
=======================================
+ Hits 14390 14393 +3
Misses 104 104
Partials 401 401 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🔍 Maintainer reviewReviewed 2 file(s) — ✅ all CI green. Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · No blocking issues spotted. |
The bug
The open-PR pressure strategy feature from #348 is dark in production.
simulateOpenPrPressure(src/services/open-pr-pressure-scenarios.ts) computes a contributor strategy comparison — open another PR now / wait / clean up existing work first — ranked by repo queue pressure and miner-vs-maintainer lane. Its output is rendered byrenderPublicScenarioSummary(src/scenarios/scenario-summary.ts), which fills the scenariooptionsand headline from it.Both halves are implemented and unit-tested — but the only production caller,
buildLocalBranchAnalysis(src/signals/local-branch.ts), never built or passedpressureSimulation. So:scenarioSummary.optionswas always[]inanalyze-branch/preflight/local-diff,simulateOpenPrPressurehad zero production callers (only its test referenced it).The fix
Build the simulation at the existing call site and pass it through:
roleContextis already in scope (built a few lines above),queueHealthis derived with the samebuildCollisionReport→buildQueueHealthpair the pr-status route uses,contributorOpenPrCountis the contributor's own open PRs.Pure and read-only; the renderer already runs every line through
sanitizePublicComment, so output stays public-safe.Test
test/unit/local-branch.test.tsnow assertsscenarioSummary.optionsis populated — 3 ranked options, exactly onerecommended, each with a non-emptylabelandnextStep— the regression that was silently empty before. Fullnpm run test:coveragestays green (branches 97.09%).🤖 Generated with Claude Code