feat(miner): wire the real runMinerAttempt call into attempt-cli.js#5261
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 | 0e2c0ae | Commit Preview URL Branch Preview URL |
Jul 12 2026, 12:38 PM |
57e7992 to
e35b80c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5261 +/- ##
=======================================
Coverage 94.37% 94.37%
=======================================
Files 474 474
Lines 40114 40116 +2
Branches 14627 14627
=======================================
+ Hits 37856 37858 +2
Misses 1583 1583
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-12 12:45:44 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
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.
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.
42c9a36 to
0e2c0ae
Compare
…tures 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
Closes #5132
The final assembly.
attempt-cli.jsnow: fetches a realSelfReviewContext(#5145), builds a real coding-task spec (#5239, blocking on an infeasible verdict), resolves the realAmsPolicySpecexecution policy (#5249, extended here withmaxIterations/maxTurnsPerIteration-- the same operator-risk-policy gapcapLimits/submissionMode/slopThresholdalready covered), assembles the realIterateLoopInput+ Governor chokepoint context, and callsrunMinerAttemptfor real -- the first point in this epic where a real coding agent actually executes rather than every path ending in a reported block.Checked against #5132's own acceptance criteria:
AttemptResult(not a test double).--liveopt-in still required).runMinerAttempt's own tests already verify (the governor context is threaded through unchanged intoevaluateGovernorChokepointGatePersisted).New
attempt-input-builder.jsholds the two pure composers (buildAttemptGovernorContext,buildAttemptLoopInput) so the assembly logic is independently unit-tested, mirroringcoding-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 existing4(blocked_infeasible, repurposed from the oldblocked_missing_prerequisiteplaceholder),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.jsandattempt-cli.js's own header comments):governor.killSwitchRepoPausedonly checks the GLOBAL env-var kill switch; a real per-repo.gittensory-miner.ymlpause needsminer-goal-spec.js(feat(miner): resolve the real per-repo MinerGoalSpec from a cloned worktree (#5132) #5255, open) wired in as a fast-follow.governor.convergenceInputis 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).Neither gap is in #5132's own stated acceptance criteria; both fail toward under-restricting rather than silently letting something through that shouldn't be. #5135 (the autonomous supervising loop) remains as separate, explicitly-flagged safety-critical follow-up work.
Test plan
npx vitest run test/unit/miner-attempt-cli.test.ts-- 30/30 (full rewrite: real-pipeline happy path with real loopInput/governor assembly verification, every one of the 5 runMinerAttempt outcomes with their distinct exit codes, infeasible-verdict blocking, worktree retention-on-non-submit regression, plus every pre-existing blocked-path test updated for the new required mocks)npx vitest run test/unit/miner-attempt-input-builder.test.ts-- 10/10 new tests for the two pure composersnpx vitest run test/unit/ams-policy-spec-parser.test.ts test/unit/miner-ams-policy.test.ts-- 100% coverage confirmed on the extendedams-policy-spec.ts(maxIterations/maxTurnsPerIteration)test/unit/miner-*.test.ts, 94 files): identical pass/fail counts confirmed against a pristineorigin/mainworktree -- zero new failures, only new passing coverage (the only failures are a confirmed pre-existing, environment-only subprocess-resolution gap unrelated to this change)npm run test:engine-paritynode --checkon both new files;npm run --prefix packages/gittensory-miner buildnpx tsc --noEmit