feat(miner-governor): enforce non-convergence + budget/turn/termination halts (#2347) - #4989
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-11 08:16:20 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4989 +/- ##
==========================================
+ Coverage 94.31% 94.34% +0.02%
==========================================
Files 455 456 +1
Lines 39083 39105 +22
Branches 14256 14264 +8
==========================================
+ Hits 36862 36893 +31
+ Misses 1572 1560 -12
- Partials 649 652 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Closes #2347
Summary
Wires the existing pure non-convergence detector (
classifyPortfolioConvergence) and budget/turn/termination cap calculator (evaluateGovernorCaps) into the run-loop iteration boundary. Either signal tripping halts the current run, releases the in-flight portfolio item viamarkFailed, blocks further queue claims until a human clears the halt, and records full context to the governor ledger.Changes
packages/gittensory-engine/src/governor/run-halt.tsevaluateRunLoopHalt,detectNonConvergence,evaluateBudgetCapsalias, ledger event builderpackages/gittensory-engine/src/index.tspackages/gittensory-miner/lib/governor-run-halt.jsevaluateRunLoopBoundaryGate— halt check + release + ledgerpackages/gittensory-miner/lib/governor-run-halt.d.tspackages/gittensory-miner/lib/portfolio-queue.jsmarkFailed— releasein_progress→queuedpackages/gittensory-miner/lib/portfolio-queue-manager.jsmarkFailedpackages/gittensory-miner/package.jsonbuild --checkfor governor-run-haltgovernor-run-halt.test.ts,miner-governor-run-halt.test.ts,markFailedqueue tests, engine package testBehavior
canClaimNext: true; ledger recordsallowed/continuequeued; ledger recordsdeniedwith convergence contextdeniedwith cap dimensionkill_switchTest plan
markFailedreleases in-progress rows and rejects queued/done/missing itemsnpm run test:unit -- test/unit/governor-run-halt.test.ts test/unit/miner-governor-run-halt.test.ts test/unit/miner-portfolio-queue.test.tsnpm run test --workspace @jsonbored/gittensory-enginenpm run test:ci(full gate before push)Notes
main; this PR adds enforcement only.detectNonConvergence,evaluateBudgetCaps.Test plan
markFailedportfolio queue testsnpm run test:ci