feat(miner-manage): add a proactive decision-pack rebuild trigger on pr_outcome write (#4283) - #4478
Conversation
…pr_outcome write (JSONbored#4283) Today a contributor's decision pack only rebuilds when next REQUESTED and found older than DECISION_PACK_MAX_AGE_MS (~6h passive check). This wires recordPrOutcome (the pull_request.closed handler) to proactively enqueue a rebuild for the PR author the moment a real outcome is recorded, so the pack refreshes within seconds instead of up to 6h later. - outcomes-wire.ts: after the pr_outcome row is written, call tryEnqueueDecisionPackRebuild (src/services/decision-pack.ts) for the already-extracted authorLogin. Best-effort + non-blocking (.catch) so an enqueue failure never affects outcome recording; the non-authoritative self-close already returned above; empty author login is skipped. The ~6h passive check stays as the fallback ceiling — this only ADDS a proactive trigger. - Tests: merged close enqueues for the author (lowercased); self-close does NOT; a ghost/no-author-login PR does NOT; an enqueue failure never throws. Verified locally: preflight (secret-scan+typecheck) pass; codecov lcov new block fully covered (lines+branches); full suite 12815 passed, 0 failed.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4478 +/- ##
=======================================
Coverage 94.02% 94.02%
=======================================
Files 420 420
Lines 37479 37482 +3
Branches 13692 13693 +1
=======================================
+ Hits 35240 35243 +3
Misses 1583 1583
Partials 656 656
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-09 21:36:36 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 non-blocking
Linked issue satisfactionAddressed 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.
|
Closes #4283.
A contributor's decision pack currently only rebuilds when it's next requested and found older than
DECISION_PACK_MAX_AGE_MS(~6h passive staleness check) — a PR closing doesn't trigger anything. This wiresrecordPrOutcome(thepull_request.closedhandler behindpr_outcome) to proactively enqueue a rebuild for the PR author the moment a real outcome is recorded, so the pack refreshes within seconds instead of up to 6h later.What's here
src/review/outcomes-wire.ts— after thepr_outcomerow is written, calltryEnqueueDecisionPackRebuild(env, authorLogin)(src/services/decision-pack.ts:390) for the already-extractedauthorLogin:.catch) — an enqueue failure never affectspr_outcomerecording (mirrors the caller's own.catchatprocessors.ts).Validation (all confirmed locally)