Revision: 1
Last modified: 2026-12-04T17:00:00Z
Authority: constitution §11.4.164 / §11.4.187 / §11.4.28 / §11.4.177 / §11.4.133 / §11.4.6
Scope: §11.4.18 companion doc for constitution/scripts/multitrack/multitrack_bootstrap.sh
The ONE idempotent command that wires the multi-track engine into a consuming project out of the box — run when a project first adds the constitution submodule, and on every later constitution pull (auto-fired from the §11.4.164 post-update seam).
Idempotency is structural, not memoised: the script writes no timestamped or per-run state file of its own and delegates to already-idempotent siblings, so a second run against the same environment produces byte-identical resulting state.
- Install the cwd-hook symlink (delegated to
multitrack_cwd_hook.sh --install). - Verify (never install) that the toolkit alias exists and that the symlink resolves to this constitution copy — purely informational.
- Validate the config;
MT_TRACK_COUNT>=1. A missing/unparsable host config is the only genuinely fatal path. - Seed orchestrator state with
reconcileand confirmstatusruns. - Operator-gate drive-prep: a READ-ONLY probe per track. An unmounted drive is an informational note and does not affect the exit code. Nothing is ever mounted or formatted.
- Opt-in (
MT_SUPERVISOR_WATCH_ENABLE=1, default OFF): start themultitrack_supervisor.sh watchdaemon, pgrep-guarded so it is idempotent.
multitrack_bootstrap.sh [--check|--dry-run] [PROJECT_ROOT]
PROJECT_ROOT=/path/to/project multitrack_bootstrap.sh
With no argument PROJECT_ROOT defaults to $PWD; $1 takes priority over the
env var. There is no hardcoded project path, by design.
| Code | Meaning |
|---|---|
0 |
wired (informational NOTES are still possible and non-fatal) |
1 |
a required sibling engine script is missing, or cwd-hook --install failed |
2 |
no per-host config resolvable and no default single-track fallback could be established (prints the YAML template + operator step). Also the strict fatal path when MT_REQUIRE_HOST_CONFIG=1 |
3 |
config resolved but failed to parse, or parsed with zero tracks |
4 |
orchestrator reconcile or status failed unexpectedly |
- Exit 0 with notes is the normal state on a fresh host — a missing toolkit alias and an unmounted track drive are both reported as NOTES. Read the report; do not infer "fully ready" from the exit code.
- Exit 3 is never defaulted past. A malformed config with zero tracks will not be silently replaced by a one-track default.
--check/--dry-runwrite nothing; use them in CI where you only want the diagnosis.- The only filesystem write it can cause is the cwd-hook symlink (default
~/.local/bin/claude-cwd-hook, overrideCMA_CWD_HOOK) plus the orchestrator's atomicbindings.snapshotrewrite.
multitrack_config.sh— config resolution used in step 3.multitrack_cwd_hook.sh— step 1.multitrack_alias_orchestrator.sh— step 4.multitrack_supervisor.sh— step 6 daemon.constitution/skills/multitrack/register.sh— the auto-install seam.test_multitrack_bootstrap.sh— the RED/GREEN guard, including the non-idempotency defect class this script is built not to have.
2026-12-04 — the six steps, argument handling and the exit-code table re-read from the working tree.