Revision: 1
Last modified: 2026-12-04T17:00:00Z
Authority: constitution §11.4.167 / §11.4.21 / §11.4.101 / §11.4.119 / §11.4.133 / §11.4.6
Scope: §11.4.18 companion doc for constitution/scripts/multitrack/multitrack.sh
multitrack.sh is the top-level entry point of the multi-track engine. It
deliberately implements no mechanism of its own: it binds three already-built
siblings into one command surface — multitrack_config.sh (host/config
resolution + track enumeration), multitrack_registry.sh (the
.ws_state/streams.tsv accessor) and multitrack_device_lock.sh (the device
arbiter).
It operates on the software layer only. It probes (read-only) whether each
track's drive is mounted, reports the registry row and the device-lock pool
state, and when a track's LUKS2 drive is not mounted it reports
OPERATOR-BLOCKED honestly instead of attempting a mount. Mounting needs the
operator's su + passphrase; §11.4.133 forbids autonomous mount/format, and
this script never crosses that line.
bash,awk, and the three sibling scripts in the same directory (a missing sibling is exit 1, not a silent degrade).config/multitrack/<hostname>.yamlresolvable throughmultitrack_config.sh, or an explicitMT_CONFIG. A config that cannot be resolved/parsed is exit 1./proc/self/mountsreadable — that is the live mount probe. There is nofindmntdependency here.
multitrack.sh status # read-only report
multitrack.sh up # preflight / reconcile
multitrack.sh help
There are exactly three subcommands. Anything else is a usage error (exit 2).
| Code | Meaning |
|---|---|
0 |
status: the report printed (blocked tracks are DATA, not a failure). up: every track is live-mounted. |
2 |
usage error (unknown or missing subcommand). |
20 |
up only — OPERATOR-BLOCKED: at least one track needs an operator mount. This is the deliberate non-zero, not a crash. |
1 |
internal error (config unresolvable, sibling script missing). |
statusnever fails on a blocked track. Its exit 0 is a report verdict, not a "everything is healthy" claim. Read the table.upexit 20 is not a defect. It is the §11.4.21 honest operator hand-off. A CI job that treats 20 as a build failure will mis-fire on any host whose LUKS drives are not mounted.upmay rewrite the registry (atomically, viamultitrack_registry.sh set) when, and only when, the live mount state differs from the recorded state. On an all-unmounted host it is a no-op.- The script never mounts, unmounts or formats anything. If you expected a
drive to be brought up by
up, it will not be — read the operator note it prints.
multitrack_config.sh— config/track loader + drive detection (mt_load_config,mt_detect_drives,mt_plan).multitrack_registry.sh— the registry accessor.multitrack_device_lock.sh— the device arbiter.multitrack_cwd_hook.sh— the per-session adapter that actuallycds an alias into a track worktree.docs/guides/MULTITRACK_WORKTREE_RUNBOOK.md— the operator runbook.
2026-12-04 — header block, subcommand dispatch (status / up / help) and
the 20 OPERATOR-BLOCKED path re-read from the working tree.