docs(issue-21): item 4 helpers, the submodule removal rule and the resume cwd rule in the design doc, compatibility matrix and skill docs
- design doc §3: the hand-assembled worktree/.venv/create recipe is replaced by worktree_prepare.sh --creator-agent (its BASE= line is the base to record); cleanup is worktree_remove.sh --stop; resume needs the original path. - §4: what the helpers do - no .mam.env copy, the shared info/exclude, opt-in submodules (any init leaves modules/, which blocks a plain remove), removal of submodule worktrees with one --force after the checks, and never by hand. - §5: item 4 is loop A on this branch; phase-1 items are done in v4.6.0. - §7: create (control-root reconcile/watchdog, loud binding failure), resume (original cwd only, binding persisted when already running), stop (the removal helper's checks), monitor (register via create/prepare only). - create / stop / resume SKILL.md: usage and exit codes of worktree_prepare.sh and worktree_remove.sh, the original-cwd rule and its exit code (1 -> 2). Frontmatter versions are unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017R3Eg7MEpSWnm1oB9ZPP6G
This commit is contained in:
1 parent
657b4b70ed
commit
7988db9adf
4 files changed
+74
-23
No files matched your search
@@ -233,6 +233,23 @@ bash .agents/skills/multi-agent-mux-create/scripts/create_session.sh \
|
||||
|
||||
The script handles the YAML append, pane capture, and the `last_visible_status` placeholder.
|
||||
|
||||
## Issue worktrees: `worktree_prepare.sh` (Issue #21 item 4)
|
||||
|
||||
Run from the control root's skills tree (lib.sh's `WORKSPACE_ROOT` = the main checkout that owns `.mam`):
|
||||
|
||||
```bash
|
||||
bash .agents/skills/multi-agent-mux-create/scripts/worktree_prepare.sh \
|
||||
--path ../multi-agent-mux-wt/issue-42 --branch fix/issue-42 [--base <ref>] [--submodules] \
|
||||
[--creator-agent claude [--session <name>] [--role creator] [--herdr-session <s>] [--herdr-workspace <w>] [--onboard]] [--dry-run]
|
||||
```
|
||||
|
||||
- Creates the worktree next to the control root (a path **inside** it is refused), idempotently; links `.venv` to the control root's; adds `/.venv` and `.pytest_cache/` to the shared `info/exclude` (a linked worktree's exclude file is `$GIT_COMMON_DIR/info/exclude`, so it applies to the main checkout too).
|
||||
- **Submodules are opt-in** (`--submodules`). Initialisation writes `submodule.<name>.url` to the shared `.git/config`, and any attempt - even a failed one - leaves a `modules/` directory that makes a plain `git worktree remove` refuse. A failed `--submodules` removes those traces and exits 1; re-run without `--submodules` to finish.
|
||||
- `--creator-agent` creates the creator through this skill with the control root's binding and `MAM_NO_SUBSCRIBER_DAEMON=1`; the row's `pane.cwd` is the worktree.
|
||||
- Prints `BASE=<sha>`: record it **before** delegating the implementation, then review with `run_loop.sh --worktree <WT> --base "$BASE" --review-only`.
|
||||
- Exit codes: 0 ok, 1 git / submodule / create failure, 2 usage or path rule.
|
||||
- create itself: a control-plane binding that cannot be computed is refused (exit 2) for a `--workspace` other than the control root and warned about for the control root; the immediate reconcile and the watchdog run the control root's code.
|
||||
|
||||
## Pitfalls
|
||||
|
||||
- **Don't use `nohup`/`disown`/`setsid` for the agent itself** — those background the agent outside herdr. The whole point of this skill is *the herdr session is the supervisor*. `nohup` is OK only for *launching the wrapper* (which itself creates the herdr session via `herdr new-session -d`).
|
||||
|
||||
Reference in new issue
Block a user