Skip to content

feat(miner-hands): git-worktree-per-attempt isolation primitive #4269

Description

@JSONbored

The roadmap's stated concurrency primitive for parallel attempts: each coding-agent attempt runs in its own git worktree so multiple attempts (same or different issues) never collide on a shared working directory. Verified via grep -rln "worktree" scripts/ .github/ — zero hits in either directory, so there is no existing git worktree usage anywhere in this repo's own tooling/scripts/workflows to mirror; this is fully greenfield. The closest existing "isolated execution directory" precedent is isolatedCliCwd() in src/selfhost/ai.ts:450-455, which mkdtemps 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

References

  • Verified via grep -rln "worktree" scripts/ .github/ — zero hits, confirming no existing pattern in this repo's own tooling
  • src/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)
  • Coordinates with feat(miner-hands): define the CodingAgentDriver interface seam #4262 (this batch) on the exact working-directory input shape CodingAgentDriver accepts

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.gittensor:priorityMaintainer-selected Gittensor priority — scores a 1.5x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions