Skip to content

0.11.0 — worktree sandbox hardening + multi-session repo safety

Choose a tag to compare

@bacnh85 bacnh85 released this 06 Oct 00:42
· 20 commits to main since this release
cfedae5

Worktree sandbox hardening + multi-session repo safety

Several Pi sessions (or parallel subagents) on one repository no longer clobber each other. Ported from oh-my-pi + Claude Code at ponytail scale — zero new dependencies, zero new settings.

subagent module

  • Per-repo lock — worktree add/remove and git apply --3way serialize per repo root; parallel children can no longer race git's no-waiter index.lock.
  • CoW backend (macOS) — sandbox:"worktree" now clones your working tree via clonefile(2): near-zero time and disk, and the copy is your working tree — uncommitted changes, node_modules, and .env come along for free. Self-copy-safe construction (per top-level entry into a sibling staging dir, atomic rename); falls back to a detached git worktree anywhere else.
  • Baseline carry — on the worktree fallback, the parent's uncommitted state is captured as pure reads (no git add/stash) and seeded into the sandbox, so children never work a stale tree and merge:"3way" patches land cleanly.
  • Owner markers + GC — crashed runs' sandboxes are swept automatically on session start (dead-pid detection, registration-aware removal); /subagent worktrees [clean] lists or forces the sweep.
  • .worktreeinclude — gitignore-style list of gitignored files (env, configs) copied into fresh worktrees.
  • Sandboxes auto-gitignore themselves — no more ?? .pi-worktrees/ in git status.

repair module (always-on, deterministic)

  • Conflict footer — full-file reads surface unresolved merge-conflict blocks automatically.
  • Write freshness guard — a write to a file another session changed since you last read it fails before writing with a re-read-first error; no more blind clobbering. apply_patch/str_replace_editor participate via a refreshMtime seam.

Docs

README now documents every module in the bundle (subagent, repair, steering, zai, a2a, todo, rules, gh, attachments, cron, permission were missing).

Verified live: baseline carry through a real sandboxed child, GC sweep in a fresh headless Pi session, herdr-pane load, both repair guards through real wrapped tools, and a concurrent two-child merge:"3way" race — both patches landed, no conflicts, no lock leftovers. 23 new tests; suite at 2639 green.

Also fixes two CI-only test failures that pre-dated this release (TZ-sensitive cron expectation; a11y test that needs real Chrome).