--- name: verify-brigade description: "Prove a Brigade change works by driving the real `brigade` CLI against a throwaway temp target, then capture receipts as evidence. Use when you changed anything under src/brigade/ and need proof beyond pytest - init/doctor wiring, work-verify receipts, Grok Bot connector packs, feed manifests, handoff lint, guard scan/redact parity, the Fleet Hub HTTP wire contract. Also use before claiming a CLI behavior in a PR body, handoff, or job report." --- # Verify Brigade This skill verifies the `brigade` CLI against a temp target. The optional Center dashboard is a separate surface. Run the CLI and read what it wrote. This skill drives it through one helper, `control-brigade.py`, so a proof is a rerunnable command instead of a story. Every drive happens in a temp target this skill creates. The helper enforces that: `--target` is accepted only when it resolves *under* `/targets`, so the operator home, the Brigade checkout, and every other path are refused before a command runs. The state root gets the same treatment whether it comes from `--root` or from the default - resolved, refused if it resolves to or contains the home directory or the checkout, and refused if it is a symlink at the root or at `targets/`/`captures/`, so a link planted in a world-writable temp dir cannot redirect a drive. `cleanup` removes only paths `new-target` recorded. `AGENTS.md` forbids driving the real workspace anyway; here it is not reachable. What that paragraph does *not* claim: - A path under the temp base is allowed even when `$TMPDIR` sits inside the home directory. That is the only carve-out, and it is exactly that narrow: the home and checkout refusals run *first*, so the allowance applies only when the temp base itself resolves inside the home directory and outside the checkout. A `$TMPDIR` inside the checkout is still refused, and a relative `$TMPDIR` is refused outright rather than resolved against the working directory. The temp base itself is refused - a state root there would chmod the shared scratch tree to `0700`. - The default evidence root is `/.brigade/verification-evidence`, which is inside the checkout. That is the one deliberate exception: it is gitignored, and it sits outside the state root on purpose so `cleanup` cannot reach the proof. The default and `--evidence-root` are both guarded like `--root`, symlink check included: a link planted at either is refused, not followed. `--label` names the directory under that root, so it must be a simple `[A-Za-z0-9._-]` name of 1-64 characters - no separators, no `..`. a caller-supplied path, read for validation only and never written, so an operator can validate a real private feed manifest from wherever it lives. Everything the drive *writes* still lands in the target or the state root. ## Launch There is no long-running process. "Launch" means: have a Brigade CLI, and have a fresh target to drive it against. ```bash # fresh checkout (this repo). Quote the extras so the shell does not glob them. python3 -m venv .venv .venv/bin/pip install -e ".[dev,connector]" ``` The `connector` extra installs the optional MCP and JWT dependencies. The `grokbot` extra resolves to the same dependencies for the one-release removal window. The `[dev]` extra supplies pytest, ruff and mypy. Create the target: ```bash registry/skills/verify-brigade/control-brigade.py new-target ``` That prints one JSON object. It ran `git init -q -b main` and `brigade init --depth workspace --harnesses claude,codex` in a new directory under the state root (`$TMPDIR/verify-brigade/targets/-`), and recorded the path so `cleanup` can find it later. Ready is `"ok": true` plus the `"target"` path; export it: ```bash TARGET=$(registry/skills/verify-brigade/control-brigade.py new-target \ | python3 -c 'import json,sys; print(json.load(sys.stdin)["target"])') ``` `new-target` records the path before it runs `brigade init`, so `cleanup` can reclaim it even when that init fails; a failed init also removes the directory it made. `--dry-run` prints the two commands and creates nothing. To drive an existing directory you already made under `/targets` (instead of letting `new-target` make one), `init` runs the same `brigade init` against it: ```bash registry/skills/verify-brigade/control-brigade.py init --target "$TARGET" \ --depth workspace --harnesses claude,codex ``` Teardown is the `cleanup` section below. Run it after every attempt, including failed ones, so broken runs do not leave targets behind. ## Doctor One read-only check that answers "is this rig worth driving?" - before blaming Brigade for a drive that fails: ```bash registry/skills/verify-brigade/control-brigade.py doctor ``` It resolves the Brigade command (`--brigade`, then `$BRIGADE_BIN`, then `.venv/bin/brigade`, then `PATH`, then `python -m brigade`), reports its version, and checks git, the checkout, and a writable state root. `"ok": true` means drive. Anything `"fail"` means fix that first. Against a target that already exists, the equivalent question is: ```bash registry/skills/verify-brigade/control-brigade.py doctor-target --target "$TARGET" ``` `"summary": {"failed": 0, ...}` is the success signal. `warn` counts above zero are normal on a fresh target - memory-care, security, and backups are not initialized yet. Against this checkout itself (the development tree, not a temp target): ```bash .venv/bin/brigade doctor --target . .venv/bin/brigade status --target . ``` Observed here, both exit 0. Doctor printed `summary: 43 checks, 0 failed, 0 manual` and a list of `warn` rows (missing operator bootstrap files, unwired memory-care / security). Status printed group rows (`core`, `skills`, `memory`, `guard`, ...) with `0 fail` on every group; several groups were `[degraded]` or `[not-installed]` because this tree is not an initialized operator workspace. Healthy for a Brigade source checkout is **exit 0 and 0 failed**, not zero warnings. ## Drive Real commands from this repo, one per mapped feature. The full map is in [`features/README.md`](features/README.md); drive the feature your change actually touched, not just the convenient one. A paused feature can still be driven by hand, but its observations are about to change: read its header before citing the result. ```bash C=registry/skills/verify-brigade/control-brigade.py # init + doctor wiring $C doctor-target --target "$TARGET" # work verification receipts (returns the receipt id and status) $C work-verify --target "$TARGET" --capture verify-brigade # handoff inbox lint # PAUSED: the handoff format may change with hub memory v2 $C handoff-lint --target "$TARGET" --content-guard # guard scan and redact parity (lookbehind and backreference goldens) $C guard-parity --target "$TARGET" # Fleet Hub wire contract over HTTP (starts its own throwaway hubs, one of them on a # stepped clock for the expiry cases; no target needed). --write-golden re-records # the refusal-text and tombstone golden from the in-repo hub. $C hub-contract # Read-only production profile: audit it on a throwaway hub (the only profile allowed against production) $C hub-contract --profile prod-readonly # Fleet Hub storage parity: every stored row against the golden (own hub, stepped clock) $C storage-parity ``` Read the exit code, not the prose: | exit | meaning | |---|---| | 0 | the drive ran and the observation is what a healthy rig produces | | 1 | the helper itself failed (no Brigade, unsafe path, bad target) | | 2 | usage error | | 3 | the drive ran fine, but the observation is a failure | Stable handles to assert on, in order of preference: the JSON keys the helper normalizes (`run_id`, `status`, `summary.failed`, `checks[].status`, `valid`, `reason`), then the receipt directory under `$TARGET/.brigade/work/verify-runs//`. Do not grep the human prose; it changes. Checkout-level focused gates for a change in this repo (no full suite). `./scripts/verify-focused` itself runs ruff, ruff format `--check`, mypy, version-sync, the managed and template-profile snapshots, then the named pytest selectors. The three lint/type pieces can also be run alone: ```bash ./scripts/verify-focused tests/test_skills_cmd.py tests/test_ci_workflow.py .venv/bin/ruff check src/brigade .venv/bin/ruff format --check src/brigade .venv/bin/mypy ``` Receipted form — same focused command, recorded as a work-verify receipt (`brigade work verify run --help` lists `--argv-json`, `--capture`, and `--json`; `--help` itself exits 0): ```bash .venv/bin/brigade work verify run --target . \ --argv-json '["./scripts/verify-focused","tests/test_skills_cmd.py","tests/test_ci_workflow.py"]' \ --capture brigade-work ``` `--command` and `--argv-json` receipts are audit-only. Do not pass `--no-reuse` to the full `./scripts/verify` gate. Do not run the full suite as routine work; reproduce CI locally only when the operator asks. ## Evidence ```bash registry/skills/verify-brigade/control-brigade.py evidence --target "$TARGET" --label ``` Writes `.brigade/verification-evidence/-