backlog(B-0558): worktree-pool primitive — pre-allocated isolated sideticks per Otto identity#3817
Conversation
…eticks per Otto identity Files B-0558 as new P3 top-level row addressing sub-case 4 (pruned-sidetick race) of the borrow-on-existing saturation ceiling. Completes the substrate trilogy from the fresh-cold-boot Otto-CLI session that empirically validated all 4 sub-cases: - PR #3808 = WHAT was observed (empirical evidence in tick shard) - PR #3812 = WHAT TO DO when observing it (operational mitigations for sub-cases 1+2 in rule body) - B-0558 (this PR) = WHAT TO BUILD to prevent sub-case 4 (worktree-pool primitive) Sub-case 3's structural fix already filed at B-0530 (cron-sentinel mutex). Design: per-identity worktree pool at /var/zeta-worktrees/<identity>/ or $HOME/.zeta-worktrees/<identity>/, pool size 2-3 per identity, .zeta-pool-owner marker respected by peer-Otto pruning, TS allocate/release API at tools/worktree-pool/allocate.ts. Effort M (1-2 ticks). Acceptance includes empirical validation via repeat-the-failure-mode test. Composes with B-0506 (autonomous-loop), B-0519 (multi-Otto branch-state contamination), B-0530 (sub-case 3 mutex), and the saturation-ceiling section of .claude/rules/claim-acquire-before-worktree-work.md (operationalized in PR #3812). Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5647e4dc53
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| |---|---|---| | ||
| | 1 | Existing-branch-name reuse → peer-WIP commit inheritance | ✓ uniquified name + git rev-parse pre-check | | ||
| | 2 | Concurrent-WIP-blocked switch | ✓ wait for working-tree-clean window (capacity-limited) | | ||
| | 3 | Pack-dir B-0530 race on `git worktree add` | ✗ NO MITIGATION — needs [B-0530](B-0530-cron-sentinel-mutex-prevent-otto-cli-self-contention-2026-05-15.md) mutex | |
There was a problem hiding this comment.
Update B-0530 mitigation status to shipped
This row marks sub-case 3 as NO MITIGATION and says it "needs B-0530," but docs/backlog/P3/B-0530-cron-sentinel-mutex-prevent-otto-cli-self-contention-2026-05-15.md is already status: closed with a shipped implementation documented in its Resolution section. Keeping this as unmitigated makes the backlog state internally inconsistent and can mis-prioritize follow-up work (e.g., treating sub-case 3 as still open when planning B-0558 acceptance).
Useful? React with 👍 / 👎.
| title: "Worktree-pool primitive — pre-allocated isolated sideticks per Otto identity" | ||
| tier: factory-infrastructure | ||
| effort: M | ||
| created: 2026-05-16 |
| @@ -0,0 +1,102 @@ | |||
| --- | |||
| id: B-0558 | |||
|
|
||
| - [B-0530](B-0530-cron-sentinel-mutex-prevent-otto-cli-self-contention-2026-05-15.md) — sub-case 3 mitigation; together they address all 4 sub-cases | ||
| - [B-0519](B-0519-multi-otto-branch-state-contamination-rca-2026-05-14.md) — multi-Otto contamination RCA at branch-state scope; this row addresses worktree-path scope | ||
| - [B-0506] — autonomous-loop substrate |
|
|
||
| 3. **Refresh discipline**: at session start (cold-boot), each Otto identity ensures its pool sideticks exist and are at `origin/main`: | ||
| - If sidetick directory missing: `git worktree add <path> origin/main` (one-shot per identity per cold-boot; rare so contention low) | ||
| - If sidetick exists: `git -C <path> fetch + reset --hard origin/main` (always safe at session start) |
| - #3812 = WHAT TO DO when observing it (operational mitigations for sub-cases 1+2) | ||
| - This row = WHAT TO BUILD to prevent it (structural fix for sub-case 4) | ||
|
|
||
| Sub-case 3's structural fix is B-0530 (already filed, closed status pending mutex implementation). |
| | 4 | Pruned-sidetick race | ✗ NO MITIGATION — needs THIS ROW | | ||
|
|
||
| Empirical anchors: | ||
| - Shard PR [#3808](https://github.com/Lucent-Financial-Group/Zeta/pull/3808) (`docs/hygiene-history/ticks/2026/05/16/0715Z.md`) — the 4-tick-arc evidence |
| | 3 | Pack-dir B-0530 race on `git worktree add` | ✗ NO MITIGATION — needs [B-0530](B-0530-cron-sentinel-mutex-prevent-otto-cli-self-contention-2026-05-15.md) mutex | | ||
| | 4 | Pruned-sidetick race | ✗ NO MITIGATION — needs THIS ROW | | ||
|
|
||
| Empirical anchors: |
|
|
||
| ## Effort estimate | ||
|
|
||
| **M** (1-2 ticks of focused work): |
|
|
||
| ## Status notes | ||
|
|
||
| Filed 2026-05-16 from the fresh-cold-boot Otto-CLI session that empirically validated all 4 sub-cases (~32 min, 4 commit attempts, 2 substrate PRs shipped: [#3808](https://github.com/Lucent-Financial-Group/Zeta/pull/3808) + [#3812](https://github.com/Lucent-Financial-Group/Zeta/pull/3812)). This row completes the substrate trilogy: |
| - `allocate(identity)` returns a free sidetick path (one not currently in use by this session) | ||
| - `release(identity, path)` marks the sidetick as available | ||
| - Locking via filesystem flock on the marker file (no bus dependency) |
CI catch on PR #3817: "check docs/BACKLOG.md generated-index drift" required regen after adding B-0558. Mechanical fix: BACKLOG_WRITE_FORCE=1 bun tools/backlog/generate-index.ts. Co-Authored-By: Claude <noreply@anthropic.com>
…annel exhausted is corner case (#3843) Documents the corner case of holding-discipline rule's forced #6 escalation when a session has shipped its substantive substrate. Remaining open PRs are BLOCKED on human-maintainer review (#3812) or contention-blocked rebase (#3817). THIS file IS the meta-decomposition move at forced #6 for this corner case — documenting the pattern rather than re-sharpening already-sharpened rules. Distinct from PR #3832's mid-session saturation-ceiling memory. Co-authored-by: Claude <noreply@anthropic.com>
|
Closing in favor of #3894, which re-lands the B-0558 substrate onto a fresh branch off current main. The BACKLOG.md conflict on this branch (DIRTY since 07:57Z) couldn't be resolved via The substrate content is identical (102-line B-0558 file + 1-line BACKLOG.md insertion). Original branch retained in git history per |
Pull request was closed
Two MD032 failures inherited from #3817's original authoring. Added blank lines before the two affected lists in Empirical anchors and Effort estimate sections. Co-Authored-By: Claude <noreply@anthropic.com>
…md conflict bypassed) (#3894) * backlog(B-0558): worktree-pool primitive — pre-allocated isolated sideticks per Otto identity (re-land) Re-lands the substantive content from PR #3817 (DIRTY/CONFLICTING on docs/BACKLOG.md) onto a fresh branch off current main. The file content is unchanged; the BACKLOG.md insertion is manually re-applied to match current main's index state (B-0557 now `[x]`). Substrate addresses sub-case 4 (pruned-sidetick race) of the borrow-on-existing pattern in claim-acquire-before-worktree-work.md. 4 failure sub-cases empirically validated in 0715Z tick arc; sub-cases 3 + 4 need substrate engineering (B-0530 + this row). Original PR #3817 will be closed with cross-link to this PR. Co-Authored-By: Claude <noreply@anthropic.com> * fix: MD032 blank-lines around lists in B-0558 file (lines 29 + 89) Two MD032 failures inherited from #3817's original authoring. Added blank lines before the two affected lists in Empirical anchors and Effort estimate sections. Co-Authored-By: Claude <noreply@anthropic.com> * fix(b-0558): address 6 Copilot review findings on #3894 (last_updated, type, 0715Z ref, git syntax, B-0506 link, BACKLOG.md regen) All 6 findings verified real. Row file: 4 edits (frontmatter last_updated added; type: feat → feature; 0715Z reference rephrased to acknowledge PR #3808 closed-without-merge; git one-liner split into two commands; B-0506 linked to its file). BACKLOG.md regenerated via bun tools/backlog/generate-index.ts — output byte-identical to prior manual edit (no diff). Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
…#3823 closed + #3817 deferred (#3883) * shard(tick): 2026-05-16T13:31Z — stale-armed-PR triage: #3871 merged + #3823 closed + #3817 deferred Continuing investigation-then-act discipline from 13:10Z tick: - #3871 (12:07Z+12:11Z bundle) self-resolved + merged - #3823 closed as redundant (0758Z.md already on main) - #3817 deferred (BACKLOG.md conflict needs manual rebase) No multi-Otto contamination this tick. Audit cycle 38/38 holds. Co-Authored-By: Claude <noreply@anthropic.com> * fix: MD032 blank-line before list in 1331Z.md line 25 Same FP class as #3894's lint fix. Adds blank line after the 'Either:' lead-in. Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
Summary
Files B-0558 as new P3 top-level row addressing sub-case 4 (pruned-sidetick race) of borrow-on-existing's saturation ceiling. Completes the substrate trilogy:
Sub-case 3 structural fix at B-0530.
Design
/var/zeta-worktrees/<identity>/(size 2-3).zeta-pool-ownermarker respected by peer-Otto prune logictools/worktree-pool/allocate.ts—allocate()+release()🤖 Generated with Claude Code