Skip to content

feat(miner): wire real git worktree preparation into the attempt CLI (#5132) - #5252

Merged
JSONbored merged 1 commit into
mainfrom
feat/attempt-worktree-wiring-5132
Jul 12, 2026
Merged

feat(miner): wire real git worktree preparation into the attempt CLI (#5132)#5252
JSONbored merged 1 commit into
mainfrom
feat/attempt-worktree-wiring-5132

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Advances #5132

worktree-allocator.js only reserves a concurrency SLOT -- its own slot-N placeholder directories never receive real git content. attempt-cli.js never called attempt-worktree.js's prepareAttemptWorktree (#5237) to actually clone/fetch and create a real git worktree, so the worktreePath reported by a blocked attempt pointed at an empty directory, not real repo content.

Wires it in: prepared right after the coding-agent driver is confirmed configured, its real path replaces the allocator's slot path in every reported result, a new "blocked_worktree_preparation_failed" outcome (exit code 6) reports a real clone/fetch failure, and the worktree is cleaned up in finally since no real attempt runs in it yet (nothing to postmortem).

Test plan

  • npx vitest run test/unit/miner-attempt-cli.test.ts -- 24/24 (existing coverage updated with real worktree-prep mocks, plus new regression coverage for the preparation-failure path and baseBranch threading)
  • npx vitest run test/unit/miner-attempt-worktree.test.ts test/unit/miner-repo-clone.test.ts -- 18/18, unaffected
  • npm run test:engine-parity
  • node --check packages/gittensory-miner/lib/attempt-cli.js
  • npx tsc --noEmit

Advances #5132

worktree-allocator.js only reserves a concurrency SLOT (its own
`slot-N` placeholder directories never receive real git content) --
attempt-cli.js never called attempt-worktree.js's prepareAttemptWorktree
(#5237) to actually clone/fetch and create a real `git worktree`, so
the worktreePath reported by a blocked attempt pointed at an empty
directory, not real repo content. Wires it in: prepared right after the
coding-agent driver is confirmed configured, its real path replaces the
allocator's slot path in every reported result, a new
"blocked_worktree_preparation_failed" outcome (exit code 6) reports a
real clone/fetch failure, and the worktree is cleaned up in `finally`
since no real attempt runs in it yet.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 35b5946 Commit Preview URL

Branch Preview URL
Jul 12 2026, 11:45 AM

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.34%. Comparing base (e6adb43) to head (35b5946).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5252   +/-   ##
=======================================
  Coverage   94.34%   94.34%           
=======================================
  Files         473      473           
  Lines       39982    39982           
  Branches    14576    14576           
=======================================
  Hits        37722    37722           
  Misses       1585     1585           
  Partials      675      675           
Flag Coverage Δ
shard-1 46.29% <ø> (-0.15%) ⬇️
shard-2 34.60% <ø> (+0.01%) ⬆️
shard-3 31.02% <ø> (-1.07%) ⬇️
shard-4 32.93% <ø> (+0.83%) ⬆️
shard-5 33.72% <ø> (-0.10%) ⬇️
shard-6 45.07% <ø> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored JSONbored self-assigned this Jul 12, 2026
@JSONbored
JSONbored merged commit 44a1861 into main Jul 12, 2026
19 checks passed
@JSONbored
JSONbored deleted the feat/attempt-worktree-wiring-5132 branch July 12, 2026 11:52
JSONbored added a commit that referenced this pull request Jul 12, 2026
…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.
JSONbored added a commit that referenced this pull request Jul 12, 2026
…rktree (#5255)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant