fix: have executor self-report worktree metadata (#1349)

This commit is contained in:
Tom Boucher
2026-06-16 14:19:08 -04:00
committed by GitHub
parent 6e242bd76a
commit 9540fe43b9
6 changed files with 55 additions and 3 deletions

View File

@@ -635,6 +635,7 @@ increases monotonically across waves. `{status}` is `complete` (success),
this commit — the orchestrator force-removes the worktree after you return, and
any uncommitted SUMMARY.md will be permanently lost (#2070).
REQUIRED ORDER: Write SUMMARY.md → commit → only then any narration. No text between Write and commit (truncation risk; #2070 rescue is not primary defense).
</parallel_execution>
<execution_context>
@@ -682,7 +683,7 @@ increases monotonically across waves. `{status}` is `complete` (success),
)
```
Immediately after each worktree `Agent()` spawn returns metadata, atomically append `{agent_id, worktree_path, branch, expected_base}` to `WAVE_WORKTREE_MANIFEST`. If any field is missing, stop and ask for recovery instead of scanning all agent worktrees.
After each `Agent()` returns, parse executor-returned worktree metadata (`<worktree_metadata>`) before harness metadata, then atomically append `{agent_id, worktree_path, branch, expected_base}` to `WAVE_WORKTREE_MANIFEST`. Missing: stop and ask for recovery instead of scanning worktrees.
> **Worktree recovery policy (#48 + #1292):** See `execute-phase/steps/worktree-recovery-policy.md` — FAIL-CLOSED rule for base/HEAD-namespace mismatches AND isolated-run fail-safe recovery.