feat(miner): wire real reputationHistory into the Governor's self-reputation throttle - #5685
Conversation
…utation throttle buildAttemptGovernorContext always left governor.reputationHistory undefined, so the chokepoint's self-reputation throttle (already built + tested in the engine) never saw a real track record and was silently skipped. Now that JSONbored#5678 landed the recordOwnSubmission write path, wire the real data: - WRITE: on a resolved terminal PR outcome (loop-cli.js's disposition poll), update governor-state.js's reputation history -- decided always increments, unfavorable only on a closed-without-merge (rejection-state-machine.js's isRejectedPr, matching JSONbored#5655's own-rejection classification). - READ: attempt-cli.js reads the per-repo loadReputationHistory and passes it into buildAttemptGovernorContext, which forwards it into the chokepoint context -- the same optional-parameter-with-honest-fallback pattern convergenceInput uses (JSONbored#5654). Omitted stays an honest absence (the throttle stage is skipped), never a fabricated clean history. Out of scope: reputation-throttle.ts's calculator/thresholds are unchanged. Closes JSONbored#5675
|
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 #5685 +/- ##
=======================================
Coverage 95.04% 95.04%
=======================================
Files 576 576
Lines 45977 45981 +4
Branches 14724 14724
=======================================
+ Hits 43699 43703 +4
Misses 1525 1525
Partials 753 753
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-14 05:23:17 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 4 non-blocking
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Closes #5675.
Problem
buildAttemptGovernorContextalways leftgovernor.reputationHistoryundefined, so the chokepoint's self-reputation throttle — already built + tested ingittensory-engine— never saw a real track record and was silently skipped on every attempt. Now that #5678 landed therecordOwnSubmissionwrite path, the read/write sides can be wired.Change
loop-cli.js, disposition-poll path): on a resolved terminal PR outcome, updategovernor-state.js's reputation history —decidedalways increments,unfavorableonly on a closed-without-merge (reusingrejection-state-machine.js'sisRejectedPr, consistent with Check a miner's own prior-rejection history on a repo (rejectionSignaled's second documented trigger) #5655's own-rejection classification). Forge-scoped byapiBaseUrllike every other governor-state write.attempt-cli.js→attempt-input-builder.js):attempt-cli.jsreads the per-repoloadReputationHistoryand passes it intobuildAttemptGovernorContext, which forwards it into the chokepoint context — the same optional-parameter-with-honest-fallback patternconvergenceInputuses (Track real per-issue attempt-history on the portfolio queue, feed the Governor's convergenceInput #5654). Omitted stays an honest absence (the throttle stage is skipped), never a fabricated clean history.reputation-throttle.ts's calculator/thresholds are untouched (.d.tsupdated to match the new signature).Validation
buildAttemptGovernorContextforwards a realreputationHistoryand omits the field entirely when the caller passes none (honest absence).{decided:10, unfavorable:8}) threaded throughbuildAttemptGovernorContextproduces areputation_throttledenied chokepoint decision.{decided:1, unfavorable:1}; the existing merged-outcome cycle covers the favorable (decided-only) branch.node:test(node:sqlite);node --checkclean.