feat(miner): resolve the real per-repo MinerGoalSpec from a cloned worktree (#5132)#5255
Conversation
|
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 | de33906 | Commit Preview URL Branch Preview URL |
Jul 12 2026, 12:21 PM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5255 +/- ##
=======================================
Coverage 94.36% 94.36%
=======================================
Files 474 474
Lines 40089 40089
Branches 14617 14617
=======================================
+ Hits 37829 37831 +2
+ Misses 1585 1583 -2
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-12 12:26:14 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
…rktree Advances #5132 runMinerAttempt's killSwitchScope needs MinerGoalSpec.killSwitch.paused from the target repo's real .gittensory-miner.yml. checkMinerKillSwitch (governor-kill-switch.js, #2341) already resolves the scope once given that value, but nothing in this package ever fetched/parsed the file itself. Unlike self-review-context.js/rejection-signal.js/ams-policy.js (which fetch live over raw.githubusercontent.com before any clone exists), this reads the file from an ALREADY-CLONED repo on disk -- by the time a real attempt reaches this point, attempt-worktree.js's prepareAttemptWorktree (#5237/#5252) has already cloned it, so no extra network round trip is needed. KNOWN GAP, same discipline as this epic's other standalone pieces: not yet wired into attempt-cli.js's runAttempt, since that wiring needs a real repoPath from #5252's worktree preparation (open, CI-green, not yet merged as of this PR). Follow-up once it lands.
2e58b3d to
de33906
Compare
Closes #5132 The final assembly: attempt-cli.js now fetches a real SelfReviewContext (#5145), builds a real coding-task spec (#5239, blocking on an infeasible verdict), resolves the real AmsPolicySpec execution policy (#5249, extended here with maxIterations/maxTurnsPerIteration -- the same operator-risk-policy gap capLimits/submissionMode/slopThreshold already covered), assembles the real IterateLoopInput + Governor chokepoint context, and calls runMinerAttempt for real -- the first point in this epic where a real coding agent actually executes rather than every path ending in a reported block. New attempt-input-builder.js holds the two pure composers (buildAttemptGovernorContext, buildAttemptLoopInput) so the assembly logic is independently unit-tested, mirroring coding-task-spec.js's own precedent. Real outcomes now surface distinct exit codes: 0 (submitted), 7 (abandon), 8 (stale), 9 (blocked by submission gate), 10 (governed), plus the existing 4 (blocked_infeasible, repurposed from the old blocked_missing_prerequisite placeholder), 5 (rejection_signaled), 6 (worktree_preparation_failed). The worktree is cleaned up on submission, retained on any other real outcome for post-mortem inspection (cleanupAttemptWorktree's own retention policy). KNOWN, DOCUMENTED GAPS (not fabricated -- see attempt-input-builder.js and attempt-cli.js's own header comments): - governor.killSwitchRepoPaused only checks the GLOBAL env-var kill switch; a real per-repo .gittensory-miner.yml pause needs miner-goal-spec.js (#5255, open) wired in as a fast-follow. - governor.convergenceInput is an honest first-attempt-shaped literal, not a real per-issue attempt-history query -- attempt-log.js's schema has no repo+issue index, and reenqueue counts aren't tracked anywhere yet (non-convergence.ts's own header: that belongs on the portfolio-queue table once it grows attempt-history columns, a real separate schema change). This closes #5132 for the core attempt pipeline; #5135 (the autonomous supervising loop) remains as separate, explicitly-flagged safety-critical follow-up work.
Closes #5132 The final assembly: attempt-cli.js now fetches a real SelfReviewContext (#5145), builds a real coding-task spec (#5239, blocking on an infeasible verdict), resolves the real AmsPolicySpec execution policy (#5249, extended here with maxIterations/maxTurnsPerIteration -- the same operator-risk-policy gap capLimits/submissionMode/slopThreshold already covered), assembles the real IterateLoopInput + Governor chokepoint context, and calls runMinerAttempt for real -- the first point in this epic where a real coding agent actually executes rather than every path ending in a reported block. New attempt-input-builder.js holds the two pure composers (buildAttemptGovernorContext, buildAttemptLoopInput) so the assembly logic is independently unit-tested, mirroring coding-task-spec.js's own precedent. Real outcomes now surface distinct exit codes: 0 (submitted), 7 (abandon), 8 (stale), 9 (blocked by submission gate), 10 (governed), plus the existing 4 (blocked_infeasible, repurposed from the old blocked_missing_prerequisite placeholder), 5 (rejection_signaled), 6 (worktree_preparation_failed). The worktree is cleaned up on submission, retained on any other real outcome for post-mortem inspection (cleanupAttemptWorktree's own retention policy). KNOWN, DOCUMENTED GAPS (not fabricated -- see attempt-input-builder.js and attempt-cli.js's own header comments): - governor.killSwitchRepoPaused only checks the GLOBAL env-var kill switch; a real per-repo .gittensory-miner.yml pause needs miner-goal-spec.js (#5255, open) wired in as a fast-follow. - governor.convergenceInput is an honest first-attempt-shaped literal, not a real per-issue attempt-history query -- attempt-log.js's schema has no repo+issue index, and reenqueue counts aren't tracked anywhere yet (non-convergence.ts's own header: that belongs on the portfolio-queue table once it grows attempt-history columns, a real separate schema change). This closes #5132 for the core attempt pipeline; #5135 (the autonomous supervising loop) remains as separate, explicitly-flagged safety-critical follow-up work.
…5261) * feat(miner): wire the real runMinerAttempt call into attempt-cli.js Closes #5132 The final assembly: attempt-cli.js now fetches a real SelfReviewContext (#5145), builds a real coding-task spec (#5239, blocking on an infeasible verdict), resolves the real AmsPolicySpec execution policy (#5249, extended here with maxIterations/maxTurnsPerIteration -- the same operator-risk-policy gap capLimits/submissionMode/slopThreshold already covered), assembles the real IterateLoopInput + Governor chokepoint context, and calls runMinerAttempt for real -- the first point in this epic where a real coding agent actually executes rather than every path ending in a reported block. New attempt-input-builder.js holds the two pure composers (buildAttemptGovernorContext, buildAttemptLoopInput) so the assembly logic is independently unit-tested, mirroring coding-task-spec.js's own precedent. Real outcomes now surface distinct exit codes: 0 (submitted), 7 (abandon), 8 (stale), 9 (blocked by submission gate), 10 (governed), plus the existing 4 (blocked_infeasible, repurposed from the old blocked_missing_prerequisite placeholder), 5 (rejection_signaled), 6 (worktree_preparation_failed). The worktree is cleaned up on submission, retained on any other real outcome for post-mortem inspection (cleanupAttemptWorktree's own retention policy). KNOWN, DOCUMENTED GAPS (not fabricated -- see attempt-input-builder.js and attempt-cli.js's own header comments): - governor.killSwitchRepoPaused only checks the GLOBAL env-var kill switch; a real per-repo .gittensory-miner.yml pause needs miner-goal-spec.js (#5255, open) wired in as a fast-follow. - governor.convergenceInput is an honest first-attempt-shaped literal, not a real per-issue attempt-history query -- attempt-log.js's schema has no repo+issue index, and reenqueue counts aren't tracked anywhere yet (non-convergence.ts's own header: that belongs on the portfolio-queue table once it grows attempt-history columns, a real separate schema change). This closes #5132 for the core attempt pipeline; #5135 (the autonomous supervising loop) remains as separate, explicitly-flagged safety-critical follow-up work. * fix(miner): use a real FocusManifest fixture in attempt-cli tests CI's typecheck (not caught by an earlier stale local tsc run -- incremental cache silently no-op'd) correctly failed: the hand-rolled {present, settings, gate, warnings} manifest fixture doesn't satisfy FocusManifest's real shape (source, wantedPaths, preferredLabels, linkedIssuePolicy, and 8 more required fields). Uses the engine's own parseFocusManifest(undefined) to build a genuinely valid absent manifest instead, and drops the `as never` cast in miner-attempt-input-builder.test.ts that was silently working around the same gap there. * fix(miner): use a real RepositoryRecord shape in attempt-cli test fixtures CI's typecheck (again not caught locally -- verified this time with a genuinely fresh tsc run, all .tsbuildinfo caches cleared) correctly failed: the hand-rolled repo fixture used the wrong field names entirely (private/ownerLogin) instead of RepositoryRecord's real shape (isPrivate/owner, plus required isInstalled/isRegistered).
Summary
Advances #5132
`runMinerAttempt`'s `killSwitchScope` needs `MinerGoalSpec.killSwitch.paused` from the target repo's real `.gittensory-miner.yml`. `checkMinerKillSwitch` (`governor-kill-switch.js`, #2341) already resolves the scope once given that value, but nothing in this package ever fetched/parsed the file itself.
Unlike `self-review-context.js`/`rejection-signal.js`/`ams-policy.js` (which fetch live over `raw.githubusercontent.com` before any clone exists), this reads the file from an ALREADY-CLONED repo on disk -- by the time a real attempt reaches this point, `attempt-worktree.js`'s `prepareAttemptWorktree` (#5237, and its own `attempt-cli.js` wiring in #5252) has already cloned it, so no extra network round trip is needed.
Known gap, same discipline as this epic's other standalone pieces: not yet wired into `attempt-cli.js`'s `runAttempt`, since that wiring needs a real `repoPath` from #5252's worktree preparation, which is open/CI-green but not yet merged as of this PR. Follow-up once it lands (mirrors how `resolveRejectionSignaled` shipped standalone in #5241 before being wired into `attempt-cli.js` in the same PR once review flagged it).
Test plan