-
-
Notifications
You must be signed in to change notification settings - Fork 89
feat(miner-hands): git-worktree-per-attempt isolation primitive #4269
Copy link
Copy link
Labels
gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.gittensor:priorityMaintainer-selected Gittensor priority — scores a 1.5x multiplier.Maintainer-selected Gittensor priority — scores a 1.5x multiplier.help wantedExtra attention is neededExtra attention is needed
Description
Metadata
Metadata
Assignees
Labels
gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.gittensor:priorityMaintainer-selected Gittensor priority — scores a 1.5x multiplier.Maintainer-selected Gittensor priority — scores a 1.5x multiplier.help wantedExtra attention is neededExtra attention is needed
The roadmap's stated concurrency primitive for parallel attempts: each coding-agent attempt runs in its own
git worktreeso multiple attempts (same or different issues) never collide on a shared working directory. Verified viagrep -rln "worktree" scripts/ .github/— zero hits in either directory, so there is no existinggit worktreeusage anywhere in this repo's own tooling/scripts/workflows to mirror; this is fully greenfield. The closest existing "isolated execution directory" precedent isisolatedCliCwd()insrc/selfhost/ai.ts:450-455, whichmkdtemps a plain scratch directory for a review subprocess — useful as a pattern for "always allocate a fresh, cleanup-tracked directory," but not a git worktree and not attempt/repo-scoped the way this primitive needs to be.Deliverables
packages/gittensory-engine/src/miner/worktree-allocator.ts(path coordinated with feat(miner-hands): define the CodingAgentDriver interface seam #4262'ssrc/miner/home) with a pure planning layer — given a repo path, a base branch, and an attempt id, compute the deterministic worktree path/branch name to use — plus a thin injected-exec wrapper (mirroring theSpawnFninjection convention from feat(miner-hands): define the CodingAgentDriver interface seam #4262/feat(miner-hands): CLI-subprocess CodingAgentDriver (reuse SpawnFn/redactSecrets/EFFORT_TIMEOUT_MS pattern) #4266) around the actualgit worktree add/git worktree removecalls, so naming/collision logic is unit-testable without shelling out in CI.CodingAgentDriverinterface (feat(miner-hands): define the CodingAgentDriver interface seam #4262) should accept as its "scoped working directory" — coordinate the exact shape (a path string vs. a richer handle) so it doesn't have to be retrofitted.git worktree add/remove, gated so it doesn't run unlessgitis available in the test environment — mirroring howcheckDockerPresent(packages/gittensory-miner/lib/laptop-init.js:87-96) treats an optional external tool as "not installed" rather than a hard failure.References
grep -rln "worktree" scripts/ .github/— zero hits, confirming no existing pattern in this repo's own toolingsrc/selfhost/ai.ts:450-455(isolatedCliCwd— closest existing "fresh scratch directory per subprocess call" precedent, mkdtemp-based not worktree-based)packages/gittensory-engine/src/portfolio/queue.ts:1-27(PortfolioQueueItem/PortfolioQueue— the concurrent-attempt bookkeeping this primitive's attempt ids should key against, so a queued item and its worktree stay correlated)packages/gittensory-miner/lib/laptop-init.js:71-96(findExecutableOnPath,checkDockerPresent— the "detect an optional external binary, degrade gracefully" pattern this issue's test gating should follow)CodingAgentDriveraccepts