feat(miner-governor): iterate-loop stop/abandon/handoff policy (#2335) - #5040
Conversation
Adds decideNextAction (#2335): the pure policy the iterate-loop orchestrator (#2333, sibling issue) consults each iteration to choose among continue/handoff/abandon. Deliberately split from the loop mechanics so the thresholds are one small, independently-reviewable, IO-free artifact. Precedence: rejectionSignaled always wins (disengage silently, never retry-hammer a repo that has shown it doesn't want automated contributions) > ambiguous self-review abandons (never optimistically hand off) > a clean pass is the ONLY path to handoff > the iteration ceiling > a no-progress detector comparing blocker sets > continue. Barrel-exported from the engine's public entrypoint.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | ad444d1 | Commit Preview URL Branch Preview URL |
Jul 11 2026, 09:53 AM |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-11 09:55:26 UTC
✅ Suggested Action - Approve/Merge
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.
|
Summary
Closes #2335.
Adds
decideNextAction/decideNextActionWithReason(packages/gittensory-engine/src/miner/iterate-policy.ts): the pure policy the iterate-loop orchestrator (#2333, sibling issue, not yet built) will consult each iteration to choose among exactly three outcomes --continue,handoff, orabandon. Deliberately split from the loop mechanics so the actual thresholds are one small, independently-reviewable, IO-free artifact.rejectionSignaledalways wins, even over an otherwise-passing self-review -- disengage silently rather than retry-hammer a repo that has signaled it doesn't want automated contributions (the Matplotlib "MJ Rathbun" cautionary tale). An ambiguous self-review (the calculator itself errored) abandons rather than optimistically continuing or handing off. A clean predicted-gate pass (from maintainer: self-review adapter wiring iterate-loop diffs through predicted-gate + slop scoring #2334'sSelfReviewVerdict) is the only path tohandoff. A hard iteration ceiling abandons regardless of whether the blocker set was still changing. A no-progress detector (set-equality on the self-review's blocker codes vs. the prior iteration's) stops the loop from wasting turns on an attempt that isn't converging.HandoffPacket: the forward-looking interface Phase 4 (submission, built later) will target -- worktree path/branch ref, diff summary, the passing verdict, and an attempt-log reference. Interface only, not an implementation of Phase 4.deriveSelfReviewOutcome: narrows a realSelfReviewVerdict(maintainer: self-review adapter wiring iterate-loop diffs through predicted-gate + slop scoring #2334) down to theSelfReviewOutcomethis policy needs.Barrel-exported from the engine's public entrypoint.
Validation
Measured, not assumed -- per this session's coverage-discipline directive:
iterate-policy.jscoverage: 100.00% lines / 100.00% branch / 100.00% funcs.Test plan
decideNextActioncovered: continue (blocker set changed, first iteration, one-below-ceiling), handoff (clean pass), and every distinct abandon reason (rejection_signaled-- including winning over an otherwise-passing self-review,self_review_ambiguous-- with and without a reason string,max_iterations_reached-- at and beyond the ceiling,no_progress-- including reordered-but-identical sets, duplicate-code false-positive guard, and different-length fast path).deriveSelfReviewOutcomepass/fail mapping covered.