Skip to main content

CLI reference

This page is a command reference for operators and integrators. New adopters should start with Your first runs. Return to the task guide that linked here once you have the command details you need.

The faff plugin includes a dependency-free Node CLI. Skills and hooks locate and invoke it automatically, so normal plugin use needs no separate CLI setup. It owns the repeatable checks and transitions that should not be reinterpreted by a model.

Most subcommands accept --selftest for their in-memory checks and --json for structured output. Pure commands make no tracker or network calls; the caller maps live state into their flags.

Durable-write redaction. The two code-owned durable-write cores — events append's record construction and every run-ledger.json write — replace exact occurrences of a narrow, allowlisted set of known secret values (configured api_key_env/seat_token_env handles resolved through the live environment, and the direct andon.url/andon.token fields; values under 8 characters are never targeted) with the fixed placeholder [REDACTED] before the bytes are serialized and hashed. This is exact-known-value redaction only — no token-shape regexes, no PII detection, no configurable pattern set, and no opt-out; it protects only the values SuperDomestique's own resolved config can name, not arbitrary secrets.

Config & install health​

SubcommandWhat it does
config <path|get|spec-docs-path|prd-docs-path|prdr-docs-path|adr-docs-path|adr-superseded-docs-path|spike-docs-path|templates-path|dump|resolved> …Resolve / read the two-file merged config — the only sanctioned config-read path. Resolution is .faff/config.local.yaml (a gitignored, machine-local overlay) deep-merged over .faff/config.yaml (the committable base) over the DEFAULTS registry (the old root .faffrc.local.yaml and .faffrc.yaml names are still read as a deprecated fallback; path, resolved and check print the exact git mv / mv to move them on stderr, never stdout): maps deep-merge per leaf, sequences are replaced wholesale by the overlay, scalars take the overlay value. An overlay parse failure is loud (exit 2, never a silent partial-apply). With no overlay present, behaviour is byte-for-byte the single-file behaviour. path prints each resolved file on its own line (base first; exit 3 only when neither exists); get <dotted.key> reads a scalar; get --json <dotted.key> returns structured values (objects, and native arrays from YAML block sequences); resolved echoes both file paths (config: + config local:), non-default slots, and the raw dispatch: values (dispatch <lane>: model=… effort=…, plus the build.by_tier and build.by_confidence matchers) for a run banner; dispatch lines are the only model and effort lines. An effort on an Agent-dispatched lane carries (effort recorded, not applied: Agent tool); a models: or effort: block in either file prints a dispatch: INVALID line naming the faff config unset command. A dispatch.<lane>.<field> value outside its closed Agent-token / effort vocabulary fails loud at get and set (exit 2, names value + legal set) — never a silent inherit at the dispatch site. get and set on dispatch.* also refuse an unknown lane, an unknown field, dispatch.eval.* (eval is not a dispatch lane), dispatch.build.by_confidence.<c>.effort (confidence carries too little signal to route effort; use by_tier) and an inline {…} map (use block form). Every removed models.* / effort.* key (bare models and effort included) exits 2 at get and set, naming its dispatch. replacement; unset is exempt, so config unset models clears the old block. get stays a raw read of the file value. templates-path [--create] [--absolute] prints the directory that holds committed template overrides (the ADR template, the native-template map and the per-type <type>.md files): the tracking.templates_path value when set, else .faff/templates, else the deprecated repo-root .faff-templates when only that exists. The fallback and the both-present case each print a deprecation notice on stderr once per process (stdout stays one bare path), with a remedy that suits the state; a configured key resolves silently. --absolute prints the directory joined onto the repo root, the string a non-CLI reader should use verbatim.
config init --set k=v [--set …] [--force] [--dry-run]Write/merge a tracking: block into .faff/config.yaml (creating .faff/ when absent; an unmigrated repo's root .faffrc.yaml is edited in place and never moved); one of the sanctioned config writers, with config set and config unset (no skill or agent hand-writes an rc file). Writes the base file only.
config init --local --pin-local-bundle --set k=v [--set …] [--dry-run | --expect-preview FILE]Compose the existing tracking changes and bundle_store: local in the personal overlay. Dry-run prints the exact resulting bytes. An apply with --expect-preview requires those bytes to match the freshly computed result before the single write. Refuses a conflicting bundle value and --force. Leaves the base untouched.
config unset <dotted.key> [--local] [--dry-run] [--root DIR]Remove a scalar leaf or a whole map subtree from one file, the base by default or .faff/config.local.yaml with --local. A surgical raw-text edit: comments and every other line stay, and any parent map the removal empties is pruned. The edit is checked against the real reader before it is written. Exit 3 when the key or file is absent (already gone); exit 2 for a list-valued key, which stays a committed-base hand-edit, and for a key inside an inline {...} map. It skips the removed-key and namespace checks, so retired trees stay removable. When the other file still sets the key, a note on stderr says so.
config check [--json] [--root DIR]Deterministic, read-only posture + integrity checker for the two-file model (no tracker access, no network, no writes). Checks: base/overlay parse; posture (is the base git-tracked and not ignored? — an unmigrated/uncommitted base is unrecoverable if corrupted, so the finding carries the 3 migration steps); overlay hygiene (the machine-local overlay must NOT be tracked); a secret scan over every scalar value (known credential prefixes + a key-name-gated high-entropy shape; *_env keys exempt) whose finding is redacted to key-path + value length + first-4-chars only — never the value; and legacy filename presence. Exit 0 clean (incl. no config, and not-a-git-repo which skips the posture checks and says so — parse + secret still run) / 1 ≥1 finding / 2 unreadable or a parse failure. --selftest runs the secret-pattern + merge + posture tables.
adversarial-backends [--json] [--root DIR]The mechanical assembler for the adversarial-review fallback chain — replaces agent hand-JSON.parse + merge + temp-file with one deterministic emitter, so a config value (e.g. a nvidia/-prefixed model id) is never retyped by the model. Reads adversarial via the existing loadConfig/dig path and prints a primary-first JSON array of {provider, model, host, api_key_env?, reasoning_off?, timeout?} (snake_case — the exact shape review-call.mjs's --backends-json mapper already consumes; review-call.mjs itself is unchanged). A named refs: block sequence resolves against the shared backends: namespace first; else a native backends: array is emitted as-is, each element standalone; else the legacy primary + fallbacks-string form is synthesized to [primary, …fallbacks], with primary-key inheritance for any omitted optional key on a fallback (an explicit fallback value is never overwritten). Exit 0 on a ≥1-backend chain; exit 3 when the adversarial block is absent or its host is unset (never a localhost-defaulted chain, so the calling skill's needs-human path is preserved); exit 2 on malformed fallbacks JSON or an unresolvable refs: name (fail-loud, never a silent [primary]-only chain). --json is accepted-and-ignored — the default output is already the JSON array --backends-json wants.
backends <resolve|realizable> --refs a,b,c [--requires local] [--harness NAME] [--json] [--root DIR]The shared named model/provider/auth backend config namespace — a top-level backends: map (name -> {provider, model, host, auth, api_key_env?, egress, reasoning_off?, timeout?}) generalizing the top-level engines: map (folds in at load; a name declared in both is a hard error, never last-wins), referenced by an ordered refs: list (index 0 first-served, no "primary"). auth (subscription-seat|api-key|none) and egress (local|external) are explicit-preferred, else derived: api_key_env present → api-key; keyless anthropic → subscription-seat (binds to the ambient interactive session — no seat_ref handle field); loopback/RFC1918/tailscale (*.ts.net) host → local egress, else external. resolve prints the resolved chain as JSON (fail-loud exit 2 on an unknown name or a namespace merge error). realizable runs the run-start fail-closed check: any requires: local ref whose chain resolves an egress: external backend refuses with a residency-violation naming it (checked before host/matrix realizability, per-entry, absolute); a whole chain with zero (harness, provider, auth)-admitted and host-set refs refuses chain-unrealizable — a served fallback admits, not any single backend being down. v1 pins harness to the single value the CLI passes today (claude-code — the ambient session subscription-seat binds to); the harness-varying half of the matrix is future work once a real per-run harness axis exists. engine:<name> lanes (faff engine call, faff dispatch resolve <lane>) resolve against this same merged namespace — provider: anthropic is accepted here but still refused at that consumer boundary. Exit 0 realizable / 1 refused (realizable); 0 ok / 2 usage-or-resolve-fault (resolve). --selftest runs the derive/merge/resolve/realizable/config-check-guard table.
hooks-ensure [--dry-run]Idempotently register faff's Stop-hook set (runcheck + prepcheck + inflightcheck + resumecheck + sentrycheck + turncheck --hook) and the PreToolUse fences (merge-fence --hook + background-fence --hook) in .claude/settings.json.
merge-fence --hook [--selftest]The outermost mechanical wall against a raw gh pr merge Bash call (registered by hooks-ensure as a PreToolUse hook). --hook reads a PreToolUse JSON event on stdin; a match on the pure matcher (a gh token — path/env-prefix tolerant — followed by pr then merge) denies with a single stderr line naming faff merge-gate as the sanctioned remedy and exits 2; a non-Bash tool, an absent/non-string command, or malformed/empty stdin all exit 0 silently, never blocking. faff merge-gate's own merge runs as a spawnSync child process rather than a Bash tool call, so it is invisible to the fence by construction.
background-fence --hook [--selftest]The mechanical wall against a build subagent self-backgrounding its own gate/test command (registered by hooks-ensure as a PreToolUse hook, probe-gated on the PreToolUse event exposing run_in_background — confirmed present). --hook reads a PreToolUse JSON event on stdin; a match on the pure matcher (tool_name==="Bash" and run_in_background===true (strict) and the command matches a narrow gate-family regex — node --test / faff gates run / npm test|run test* / npx vitest|jest|mocha|ava|tap / make test / pytest / cargo test / go test) denies with a single stderr line naming the foreground remedy and exits 2; a non-Bash tool, a non-gate command, an absent/false/non-boolean run_in_background, or malformed/empty stdin all exit 0 silently, never blocking. A regex token-sequence matcher, not a shell parser — a command that breaks a required token via quoting/splicing/substitution is a documented, honestly-pinned LIMITATION, same stance as merge-fence.
gitignore-ensure [--json]Idempotently, non-destructively add faff's ignore rules to two files: nothing to the project's root .gitignore, and every rule about .faff/ to a committed .faff/.gitignore (commit it so the rules reach other clones; it carves out .faff/config.yaml and .faff/config.example.yaml and leaves the overlay ignored). --json carries faff_dir (the .faff/.gitignore result, null with --local) and warnings: one per root ignore line, such as .faff/, that blocks the rules inside .faff/, naming .faff/* as the fix; plus one warning per written .faff/.gitignore whose own carve-out negations end up shadowed by a later catch-all line — read back after writing (so a repo that brought its own !/anchors/ or * before this run is caught too), naming the shadowed carve-out, the offending line, and a per-kind hand fix. The exit code stays 0 either way; the file is still written. --local writes only .git/info/exclude.
github-templates scan [--type <faff-type>] [--json] [--root DIR]Scan the working tree for a repo's own GitHub issue templates (.github/ISSUE_TEMPLATE/*.md and the legacy bare .github/ISSUE_TEMPLATE.md), parse each file's front matter, and bucket it onto the closed faff-type taxonomy {bug, feature, spike, chore, epic, default} — the GitHub occupant of create.md's tier-1 native-template slot (candidates only; scoring and selection are a separate verb). Pure and offline: no MCP, no network, no git, and it never reads tracking.tracker (the detection axis is the repo's structure). Without --type it emits the whole result (candidates, dropped audit trail, notes); with --type <t> it emits that type's candidate set — candidates typed t plus every universal candidate. A directory-form file that fails to classify is dropped (unclassified); a bare file that fails to classify is a universal candidate for every type; the gate never emits default, so --type default returns only universal candidates. config.yml/config.yaml and non-.md files are dropped, not read. labels accepts the unquoted flow form ([bug, triage]) via local normalisation (the shared parser is unchanged). Absence and malformation are clean misses at exit 0; an unknown --type exits 2.
native-map set --team <key> --tracker <token> [--dry-run] [--force] [--json] [--root DIR]Persist a faff-type→tracker-native-template identity map to the committed native-templates.yaml in the resolved templates directory (a sibling of the per-type override files; produced by /faff-onboard step 2, consumed by fill-from-tracker at create time). Confirmed pairs arrive as JSON on stdin ({"mappings": {"bug": {"id": "tmpl_123", "name": "Bug Report"}, ...}}) — deliberately not a <type>=<id>:<name> colon grammar, since a tracker template name may contain colons/newlines. Persist-only and pure: no MCP, no network, no env discovery (the skill discovers over MCP; the CLI only persists the values handed to it). Every mappings key is validated against the closed taxonomy {bug, feature, spike, chore, epic, default} (an unknown type → exit 2, no write); each value is a { id, name } identity ref (never a template body/description); a template id mapped to two types is refused. The untrusted name/id are emitted through the real YAML scalar encoder (never string concatenation), and the write is round-trip self-verified against the real reader before it touches disk — a value that would inject a sibling key or corrupt the structure aborts (exit 2). Empty mappings → no-op, exit 0, writes nothing. --dry-run prints the exact file text and writes nothing; --force overwrites a differing existing file. A write only ever targets the canonical location. When a map exists only at the deprecated location, set exits 2 without --force and names a file-level mkdir -p plus git mv of that one file; --force writes the new path and leaves the old file in place. --dry-run runs the same guard and reports what a real run would refuse as an advisory on stderr, still exiting 0 with the preview on stdout.
native-map fields --type TYPE [--local | --native-body FILE|-] [--root DIR]Return the mapped template identity to fetch or the ordered ticket fields. Supply a fetched description as markdown, or use the local override and built-in defaults. Skipped overrides and opaque native bodies produce diagnostics on stderr.
doctor [--target DIR] [--root DIR]Install health — by default scans the installer's global target directories, de-duplicated by resolved path: the install.skill_targets config key when set to a usable list, else the hardcoded pair ~/.claude/skills and ~/.agents/skills — flagging each faff skill as a live symlink, a stale copy-install, or missing from one scanned directory but present in another (a half-install — one harness can see it, another can't). --target DIR pins the scan to exactly one directory and does not read the config key. Plus the merge-fence PreToolUse registration, read from both <root>/.claude/settings.json and <root>/.claude/settings.local.json (Claude Code merges them; missing → non-zero exit naming faff hooks-ensure). A settings file that cannot be read (invalid JSON, or not a JSON object) is its own non-zero finding naming that file, and the fence then reads "unconfirmed" unless the other file holds it. Once faff hooks-ensure writes to settings.local.json by default, two advisory lines (never an exit change) also print: faff hooks found in settings.json, and any hook registered in both files.
version [--json] [--selftest]Also available as faff --version. Print the faff plugin release version, read from plugin/.claude-plugin/plugin.json through the one resolver every run, prep and graft record stamps as faff_version. Plain output is the bare version (for example 0.43.0); --json prints {"version":"<v>","source":"plugin-json"}. The resolver only trusts the manifest when it sits at skills/faff/bin/lib inside a plugin tree and names faff; anything else (a copied bin/lib, a governor install, an unreadable or malformed manifest) resolves to {"version":"unknown","source":"default"}. Exit 0 always on resolution, 2 on an unknown argument; --selftest runs the resolver table (valid, prerelease, missing, non-JSON, wrong name, bad shapes, location check, memoisation).
sync [--dry-run]Repair a stale copy-install — re-link the faff skills + the CLI via scripts/link-skills.sh --global --replace (inherits install.skill_targets, config-driven, for free).

install.skill_targets is a hand-authored .faff/config.yaml block sequence — the same shape as worktree_root, but a list rather than a scalar:

install:
skill_targets:
- ~/.claude/skills
- ~/.agents/skills
- ~/.config/some-other-harness/skills # any harness's auto-load directory

Each entry is absolute or ~/~/…-relative (a bare unquoted ~ parses as YAML null — quote it: "~"); a non-absolute, non-~ entry is skipped with a stderr notice. Unset, or every entry unusable, falls back to the hardcoded pair above — in both link-skills.sh --global and faff doctor's default scan set — byte-for-byte identical to before this key existed. Governs --global installs and doctor's default scan set only: never repo-local (non---global) mode, --target, or $CLAUDE_PLUGIN_ROOT. | validate-adapters scaffold --slot SLOT --name NAME --description TEXT --judgement-seam KIND[,KIND...] --path DIR/SKILL.md | Write a local draft with the slot's structural contract pointers. Refuses to replace an existing file. | | validate-adapters check --slot SLOT (--path FILE_OR_DIR \| --skill NAME [--skills-dir DIR]) | Report structural findings for one skill, including a foreign path. Exit 1 signals structural findings and exit 2 signals invalid inputs. Semantic conformance stays with the author and reviewer. | | validate-adapters [--skills-dir DIR] | Lint the shipped slot-skills for conformance drift (CI / pre-commit). Includes the per-file byte ratchet over every SKILL.md and references/*.md against plugin/skills/faff/prose-baseline.json: growth prints FAIL <path> (prose bytes) with the size, baseline and +<delta> and exits 1, as does a covered file with no entry or an entry with no file; a shrink prints a non-failing RATCHET line. A missing or malformed baseline fails on the bundled tree; with --skills-dir a missing one only prints an INFO line. | | prose-size baseline --lower [--skills-dir DIR] [--json]; prose-size tally --from REF --to REF [--scope all\|hot] [--group LABEL=T1,T2,...]... [--repo DIR] [--json] | Skill prose size in bytes. baseline --lower rewrites prose-baseline.json, lowering each entry whose file shrank; it never raises, adds or removes an entry and reports each grown, unlisted or missing file it left alone (exit 2 on a missing or malformed baseline or a write failure). tally reads git history only: for each first-parent commit in REF..REF it sizes the covered files (hot = the beep-boop, graft and prep SKILL.md) from git ls-tree -l and prints one row per commit that changed the total (ticket = the last parenthesised key in the subject), then each --group's net, other, start, end and net; --json emits the same as an object. Exit 2 when the repo or a ref cannot be resolved. No --selftest; covered by test/prose-size.test.mjs. | | rule-inventory check [--base REF] [--json] [--summary FILE] | Deleted skill prose must map to a rule-inventory row. Compares REF's tree with HEAD's (pass a merge-base; without --base, the merge-base with origin/HEAD, else skipped no-base). Every deleted block of skill prose (the prose-size covered set) must either appear verbatim inside one block of skill prose at HEAD, or be quoted by a row of a ## Rule inventory table in a spec the diff adds under the spec docs path (format: docs/reference/skill-authoring.md#rule-inventory). Skipped when no prose is deleted, or when no spec is committed and no .faff/anchors/ path changed; a changed anchor with no spec fails. --summary FILE appends the row-covered blocks, dropped and changed first. Every printed line starts rule-inventory: . Exit 0 pass or skipped, 1 fail, 2 a bad ref, git failure, unreadable or over-1-MiB spec, or unreadable config. No --selftest; covered by test/rule-inventory.test.mjs. | | build-queue-partition --facts FILE\|- | Partition a complete admitted queue from JSON. Supply issues with id and arrays files, directories, surfaces, scope_tags, blocked_by. Include inferred matches (producer, consumer, match_kind: id_reference\|paraphrase, confidence: firm\|ambiguous, evidence), directed non_blocking pairs (producer, consumer), and uncertain_collisions as ID pairs. Output is JSON with independents, ordered groups, directed dependencies, collisions as grouping witnesses, inferred receipts and inferred/ordering cycle lists. Sends no tracker requests and leaves admission, evidence interpretation and value ordering with the caller. Exit 2 means invalid facts or unreadable input. | | planning-graph [--cycles] [--unlock] | Read scoped issues (active IDs) and live_edges ([issue, blocker] pairs) as JSON from stdin. --cycles returns dependency_cycles with all cyclic members and one closed witness path per component. --unlock returns unlock_counts as ID/count pairs for distinct transitive dependents, optionally limited to supplied roots. Select either or both outputs. Use the full scoped active graph even when ranking a subset. Walks stay within supplied IDs. Exit 2 means invalid input. | | prep-context --issue ISSUE --root DIR [--run-dir DIR] --resolutions-file FILE\|- | Prepare one round's local ratified-scope scratch context from fresh committed sources and an already gathered resolution array. No tracker reads or register writes. Exit 0 ready, 3 legitimate absence, 2 failed or needs-human; JSON includes file/hash, assembly exit and warnings. Ready and absent results also return the resolved scratch_dir. Caller retains provenance filtering and logs every warning. | | validate-adapters --configured [--root DIR] | Pre-flight your configured (swapped-in) slot occupants before an unattended run. |

Eligibility & routing (pure — no tracker/network)​

SubcommandWhat it does
eligible --label L [--label L …] [--default opt-in|opt-out]Is a ticket automation-eligible? (true/false; hold > automate > default).
discovered-scope-priority --relationship <blocker|blocked-by|peer|parent|none> --source <build|review|post-merge|ci-triage|orchestrator|chain-gap> [--gate-defect] [--selftest]The shared priority function every autonomous/interactive discovered-scope filing site calls (beep-boop's discovered-scope filing, interactive graft's Step 12, tidy's chain-gap auto-fill), so the same finding gets the same tracker priority wherever it was filed. Pure, total relationship × source × gate_defect → priority lookup — no tracker/network, no "unknown" result, no non-zero exit on a valid combination: gate_defect first, then relationship == blocker, then source ∈ {post-merge, ci-triage}, then relationship ∈ {blocked-by, parent}, then source == review, else low. Prints exactly one of high/medium/low to stdout. --selftest drives the full table with no tracker/network dependency. Exit 0 / 2 usage or bad enum.
discovered-scope-plan --facts FILE|- [--record RUN-ID [--phase run|tidy]]Plan a proposed autonomous filing from fresh, supplied placement and policy facts. Concrete inputs use {confidence,mandate,parent,ancestry,appetite,opinionated,relationship,relationship_target,target?,prior_containment?}. A null parent is a new root. Use null for an absent relationship target. Records the existing containment and self-intake audits only with --record. Returns may-file with proposed Backlog placement, relationship and intake provenance, or surface with a reason. Exit 2 means a malformed input or failed containment check. The caller owns content, deduplication, all tracker writes and acknowledgement.
claim-verdict --claimed-at <ISO8601> --now <ISO8601> --ttl-hours N [--selftest]Is a faff claim (an issue at In Progress) live or stale? Pure age + TTL → verdict — reads no tracker and no system clock; the agent supplies --claimed-at from the connector's latest transition into the claim state (Linear: latest In Progress stateHistory.startedAt), resolves --ttl-hours from faff config get claim_ttl_hours, and separately checks the faff-claimed provenance label. stale iff strictly older than the TTL (at/under the TTL, and any non-positive age from clock skew, stays live — the fail-safe direction). Emits {verdict, age_secs, ttl_secs}; --selftest drives the boundary table (just-under / at / just-over TTL) with no tracker/system-clock dependency. Exit 0 / 2 usage or invalid input.
park-verdict --status <backlog|todo|in-progress|in-review|done|cancelled|archived> --draft-pr <present|absent> --park-comment <build|nonbuild|none> --human-takeover <true|false> [--selftest]May faff-tidy's autonomous case-1 stale-faff-parked sweep strip the label? Pure status + signals → verdict — reads no tracker and no system clock; the agent resolves each input from the tracker (open draft PR, the most-recent faff park comment's class, any human action since). Returns protect (a live faff mid-build park — a post-PR held-in-draft PR, or a no-PR build-class park with no human action since), strip-ok (terminal/in-review, or a clean human takeover of a pre-build park), surface (cannot classify — leave the label, surface for a human; the fail-safe direction), or n/a (below In Progress). Emits {verdict}; --selftest drives the boundary table with no tracker/system-clock dependency. Exit 0 / 2 usage or invalid input.
punt-scan <spec-file> [--selftest]Report which of a spec's open **Punt:** items are blocking (an unresolved decision the increment depends on) versus non-blocking (explicitly deferred out of scope), so routing and the producer self-rating stop treating a settled non-goal as an open decision. Pure spec bytes → PuntScanResult — reads no tracker, no network, and no system clock. A Punt marker is recognised as a plain line or as a list item, at any indent: behind one -, *, or + bullet, or one ordered 1. / 1) marker of up to nine digits (a single list prefix; a doubled - - prefix is not recognised). The list prefix is presentation, so a listed Punt reads the same as its unlisted twin. A marker is read over its logical line: the text after the tag plus every directly following line up to the first terminator, joined with single spaces, so where a producer wrapped the line does not change the reading. A terminator is a blank line, a heading, a line starting a bold token (which includes the next **Punt:**, **Chosen:**, **Decision:**, or **Assumes:**), a list-item opener, a code fence, a block quote, a table row, or a thematic break; a tag alone on its line takes its topic from the next line. A Punt is eligible (may be treated non-blocking) only when BOTH hold: it carries a bare (non-blocking) suffix (order-independent with (decides: <owner>)) AND its topic names an item under the spec's OUT OF SCOPE section (the OUT OF SCOPE item name-slug appears as a contiguous token run within the Punt topic-slug, both slugged via the house headingSlug rule). The bare tag alone never suffices, and an untagged or un-crossreferenced Punt is treated as blocking — the fail-safe direction. Emits {punts: [{topic, decides, non_blocking, out_of_scope_crossref, eligible}], eligible_count, blocking_open_count} (with eligible_count + blocking_open_count == punts.length); --selftest drives the baked fixture table with no tracker/network/clock dependency. Exit 0 / 2 on a missing or unreadable spec file.
pr-body sanitize|check --target <TARGET-ID> [--selftest] (body on stdin)PR-body citation hygiene — prevents a tracker's GitHub integration from auto-transitioning a sibling issue merely cited (not targeted) in a PR body. sanitize rewrites the complete body so only <TARGET-ID> keeps a Linear-recognisable ASCII identifier, as the sole trailing Closes <TARGET-ID> line: every other recognised [A-Z][A-Z0-9]{1,15}-[1-9][0-9]* token — target mentions elsewhere included — renders with U+2011 NON-BREAKING HYPHEN outside an http(s):// URL span, or %2D inside one (so a cited link destination still resolves). Idempotent — re-sanitizing an already-sanitized body is a byte-for-byte no-op. check re-verifies that same invariant with no transformation, exiting 0 when valid or 1 on a violation (diagnostic names only the broken rule + offending identifier/count, never body content). Pure: stdin/stdout only, no repository/tracker/network/environment access. Exit 0 sanitize / 0 check-valid / 1 check-violation / 2 usage or malformed --target.
admissible --spec <path|-> [--lights-out] [--json]Lights-out quality-IN gate — pure structural check over a spec's machine-verifiable DoD (## Scenarios + ### N. DONE). Gating R1 (≥1 born-verifiable scenario) / R2a (non-empty DONE) / R2b (no banned-vague DONE item); advisory R3 (runnable-check command → warnings, never gates) / advisory R4 (a SCENARIOS/DONE heading-level mismatch → warnings, never gates — the structural smell behind the section over-capture trap). The ## Scenarios section is bounded by name at the DONE heading (any level), the trailing confidence: line, or a faff-contract: fence — the same boundary dod classify uses, so the two parsers cannot disagree on a document's section extent. No LLM, never re-invokes the producer. Fail-safe: ambiguous/unparseable/absent DoD → inadmissible; --lights-out absent → admissible no-op (L1–L3 unchanged). Emits AdmissibilityVerdict {admissible, reasons, checks, warnings}; exit 0 admissible / 1 inadmissible / 2 usage.
admissible --spec <path|-> --author-diagnosticsReport draft feedback as compact JSON. Each item in major names Scenarios unit IDs by reason (r1, prose, or test_file) or a failing DONE presence or human-marker done_check with its detail. Overlapping Scenarios findings count once. notes reports a missing Scenarios section for the author. Exit 0 on a readable draft, 2 on errors. Use --lights-out separately for the actual admission decision.
dod classify --spec <path|-> [--issue <id>] [--json]Classify a spec's DoD criteria — the ## Scenarios blocks/assertions + the ### N. DONE checklist — by born-verifiability class (scenario | assertion | prose), reusing the same classifyCriterion rule admissible applies (no forked rule). Each criterion also carries a holdout boolean (marker-carried; only source:"scenarios" can be true — a holdout:-prefixed DONE item stays literal, holdout:false, with a stderr advisory naming the DONE-never-withheld rule), and the output adds a top-level holdout_counts: {holdout, visible} (additive only — counts is unchanged and still sums to criteria.length). The evaluator slot consumes this to decide which criteria it may machine-judge (scenario/assertion) versus force to needs-human (prose — the machine never judges a non-born-verifiable criterion), evaluating the full set (holdout + visible) regardless. Pure (file/stdin in, JSON out, no tracker/network/LLM); emits {criteria: [{id, text, class, source, holdout, human_only}], counts, holdout_counts}, where id is <source>:<n> (source scenarios or done, n the 1-based position among that source's criteria); Each done criterion also carries local_ac_id (the [ac-N] authored at the start of the DONE line, else the positional done:N) and, with --issue, ac_id (the qualified faff-1287#ac-3); text has the leading [ac-N] removed. A DONE item written needs-human: <reason> (after any [ac-N]) is human_only: true, tier delegated, verifier ac-checklist, and its text has the marker removed; an empty reason leaves the item literal, human_only: false, with a stderr advisory. Every other row is human_only: false. A near miss ([AC-2], [ac-03], [ac-2x]), a duplicate id, or ids on only some items falls back to done:N with a stderr advisory, never a failure. Exit 0 on a successful parse (an empty set is valid data) / 2 usage, a malformed --issue, or unreadable.
dod split --spec <path|-> --view builder|fullPrint the requested visibility view of a spec's ## Scenarios section. --view full is the identity (byte-for-byte). --view builder removes each holdout-marked scenario unit (a ```holdout / ~~~holdout fence, or a holdout:-prefixed bullet — recognised only inside ## Scenarios, the same section extent dod classify shares) and inserts one blockquote note under the heading (> N holdout scenario(s) withheld from this view…) only when N ≥ 1; a marker-free spec's builder view is a guaranteed byte-identical no-op. Coherence invariant: dod classify on the builder-view output equals the full classification minus the holdout:true criteria. Over-withholding (the builder view retains zero born-verifiable source:"scenarios" criteria while the full spec had ≥ 1) is an advisory on stderr, never a gate. Pure beyond the file/stdin read (no tracker/network/LLM); exit 0 on success / 2 on a missing/unknown --view or an unreadable spec.
holdout record --issue <id> [--key <k>] [--run-dir <dir>] [--credentials-env <VAR>] [--json]The one writer of the v0.3 holdout-anchored record. Reads the evaluator slot's block on stdin (JSON, or markdown holding exactly one faff-contract:holdout-verdict fence) and writes the record to .faff/holdout/<k>.json (<k> defaults to <id>), plus <run-dir>/<id>/holdout.json with identical bytes when --run-dir is given. The record's issue is always --issue; --key only names the store file. Each criterion carries id, text, holdout, exercised, expected, observed, evidence_ref, reason and reason_code; a met/unmet criterion needs the first three non-null (and carries no reason_code), and a needs-human criterion needs both reason and a valid reason_code from the closed vocabulary (human-only for a prose unit, no-surface/wire-error/credentials-unavailable/env-not-ready for an environment gap — a born-verifiable criterion is never human-only, a prose one always is). The writer is strict on a fresh emission: a needs-human criterion with no reason_code, or one breaking a cross-field rule, is refused exactly as a missing reason is. Strings are redacted of known config secrets, and of the bearer token named by --credentials-env (an environment variable holding the env-handle's credentials JSON, set for this one invocation), before being truncated to 2000 characters. The CLI never attests: spawner_attested is always false and attestation null, whatever the input claims; only the evaluate-call.mjs spawner stamps an attestation. Exit 0 the block is accepted. Exit 1 the block is refused (unparseable, schema violation, a missing detail field): a fail-closed needs-human record is still written to every requested path, because every consumer reads an absent holdout verdict as "did not run". Exit 2 usage, an id that fails ^[A-Za-z0-9][A-Za-z0-9._-]*$, a path that leaves .faff/holdout/ or .faff/runs/ (including through a symlink), an unusable --credentials-env, or an existing store file recorded for a different --issue: nothing is written. An unparseable existing store file is renamed to <k>.json.unparseable-<UTC timestamp> first. holdout record does not change the gate: holdout verdict and faff merge-gate route on the same class, verdict, evidence_present, aggregate, code_blind and attestation values as before.
holdout criteria --spec FILE [--counts]Project the full spec's running-stack criteria for the code-blind evaluator. Human-only prose rows include their existing blocking verdict. --counts returns just the judged, integration and delegation counts.
holdout receipt --key KEY --run-dir DIR --writer-exit CODE [--caged] [--root DIR]Check the finished evaluator record and report its aggregate without reproducing evidence. When the run promised a cage, it verifies the matching copies and requires spawner attestation. A failed writer or unavailable receipt exits 1 with needs-human.
holdout verdict --issue <id> [--dir .faff/holdout] [--require-spawner-attested] [--json]The per-issue merge-floor gate lookup for faff-graft Step 10's fourth (L4) merge-floor condition — persist-once/consume-twice. Reads the single per-issue verdict .faff/holdout/<id>.json, re-validates it through the same computeHoldoutVerdict gate (via holdoutGateResult — never a forked rule) the run-bridge (holdout verdicts) uses, and reduces it to one pass/block decision keyed to the issue being built — before the PRDR fold. Fail-closed: a missing / unreadable / malformed / non-code_blind / incoherent verdict, or any aggregate ≠ meets-spec (fails/gaps/needs-human), is block (exit 1) — never a silent pass; a conformant code_blind: true meets-spec is pass (exit 0); a missing --issue is exit 2. --require-spawner-attested arms the spawner-attestation ratchet (the caller sets it iff the run's lane-boundary intent promised the evaluator cage): a code_blind that was self-attested by the judged party — not stamped by the evaluate-call.mjs spawner — then blocks. Emits {issue, gate, reason, aggregate?, code_blind?, violations?, needs_human_reasons?} on stdout (a block is also summarised to stderr). needs_human_reasons is a per-reason_code count over the block's needs-human criteria (e.g. { "no-surface": 2, "human-only": 1 }; a legacy criterion with no code counts under "unspecified"), so an operator can tell an environment gap from a human-only check; it is present whenever ≥1 needs-human criterion exists and absent only when there are none. Reporting detail only — it never affects the pass/block decision. Pure beyond the single-file read (no tracker/network/LLM). The same file still feeds faff holdout verdicts --association unchanged — one artifact, two consumers.
holdout verdicts --association <json|@file|-> [--dir .faff/holdout] [--require-spawner-attested] [--json]The pure, trust-gated bridge from the evaluator slot's persisted holdout verdicts (.faff/holdout/<issue|run>.json) to the already-shipped faff prdr coverage --dod-verdicts flag — the missing pipe that lets prd-satisfied read the evaluator's judgements instead of conservatively defaulting every DoD to unverified. Reads each verdict in --dir, re-validates it through the same computeHoldoutVerdict gate (never a forked rule — --require-spawner-attested additionally arms the spawner-attestation ratchet, so a self-attested code_blind is treated as untrusted), and yields the literal "met" only for a block that is conformant and code_blind: true and aggregate: meets-spec; every other trusted aggregate (gaps/fails/needs-human) passes through as its own ≠met string, and an untrusted (contract-rejected) file is omitted entirely. Keys the map by the orchestrator-supplied issue→PRDR --association (the evaluator stays PRDR-blind); a key with no association entry is skipped (a PRDR is never guessed). Conservative duplicate-PRDR fold: a PRDR is met only when every holdout file mapping to it is met — a single failing re-run is never masked. Emits {verdicts: {<prdr>: <value>}, skipped: [{key, reason}]} as JSON on stdout (the skipped audit trail is also summarised to stderr). Pure (filesystem read of --dir only — no tracker/network/LLM, parity with dod classify / prdr coverage); does not modify prdr coverage / computePrdCoverageVerdict. An absent --dir → empty map, exit 0 (the valid "nothing trusted yet" answer coverage already handles); a missing/non-object --association, malformed --association JSON, or an unreadable --dir → exit 2; a successful run (including an empty map) → exit 0 — there is no exit 1 (report-only).
spec-review-lenses --tags T,T,… --level L1|L2|L3|L4 --appetite low|medium|high|full [--adversarial-configured yes|no] [--root DIR] [--selftest]Cost-gate that runs in front of the spec_review producer — maps a spec's classified change-surface tags + the runtime level + appetite to a LensSelection {lenses, mode, rationale}. Pure: the heuristic signal→tag classification is the prose layer's job (faff-prep, reusing the already-shipped-scan surface extraction); this only maps a classified surface to a selection. v1 is additive-only / safe-direction: only the architectural lens (or methodology where no tag adds it) is ever dropped, and only on a confidently-classified surface; infosec + QA are sticky (always fire at L1–L3); an unclassified or unrecognised tag fires all four (fail-safe); L4 is pinned to the full lens set and never narrowed by appetite; low/medium appetite widens to all four. mode is a function of whether an adversarial spec_review chain is CONFIGURED — at every level, not of the level alone, so a configured adversarial occupant reviews per-lens on an L3 drain rather than collapsing to the single-pass checklist (the axis the kill-switch also uses: it acts on attendedness, not on the mint). Configuredness comes from `--adversarial-configured yes
verification resolve [--json] [--holdout] [--spec-review] [--code-review]Which opt-in interactive high-assurance verification legs run at THIS attended session. Reads the verification.* config leaves + the $FAFF_RUN_DIR ledger and prints {attended, unattended, level, legs:{holdout,spec_review,code_review}, any}. Advisory only — a leg computes and surfaces the floor, it never confers unattended acting authority: the resolver short-circuits to all-off for any unattended run (a declared-unattended config, i.e. autonomous.unattended / autonomous.sentry_acting, or an L4 mint). The optional per-leg flags are the per-invocation opt-in (graft's --verify), OR-ed over the standing config posture but only on an attended run. The SKILL.md gates shell this rather than hand-reading .faff/config.yaml. [--selftest]. Exit 0 (pure).
next --status S --spec none|low|medium|high […]Legal next step for an issue (JSON {next, reason}).
graft verify-build --worktree DIR --issue ID --spec FILE [--run-dir DIR]Run the bundled foreground gate ladder once. On a pass, verify the captured builder spec against HEAD and the working file, then return its ordered DONE criteria in spec.criteria. Failure, missing runner and changed spec stop before grading. On exit 3, repeat the same command to resume with the saved gate progress. The optional run directory enables run and issue heartbeats.
graft admit --mode interactive|autonomous --facts <file|-> [--spec-file <path>] [--session-id S] [--run-dir DIR] [--wave N] [--now ISO] [--root DIR] [--json]Graft's Step 2 admission chain as one read-only command. The agent reads the issue once and passes a facts object {issue, status, labels[], spec:{found, confidence}, externally_blocked, claimed_at, tracker:{mode: tracker|git-only, configured, pinned, reachable}} (every field required; status is the normalised faff next --status enum; parked and awaiting-spec-review are derived from labels with the configured control-label names). It runs, in order: the tracker-reachability check, eligible, next (always, with ifEligible in interactive mode), the claim check for in-progress/in-review (the build-claim ref: the caller's own when owner.session_id equals --session-id, default $FAFF_SESSION_ID; a stale peer ref by the predicate build-claim acquire uses proceeds with a warning; claim-verdict is consulted when claimed_at is present, report-only), next's spec routing, the intake guard under the configured intake_gate, and, in autonomous mode, admissible --lights-out on --spec-file. Prints one {issue, disposition, reason, kernels, warnings} object (--json) or a summary line. Dispositions, all exit 0: proceed; needs-prep / needs-human (from next); excluded (next said done, none or blocked; reason names which); and, autonomous only, ineligible, claimed-by-peer (a peer status with no ref, or a live ref held by another session), blocked (intake refusal) and inadmissible. Interactive mode warns instead of refusing on eligibility, the claim and intake, and skips admissibility. With a run dir (--run-dir or $FAFF_RUN_DIR) and capture.decision_kernel: on it writes the next, eligible and (when consulted) claim-verdict base records and their action markers itself. It writes no tracker state, label, claim ref or provenance marker. Exit 2: missing or invalid facts, --mode, or --now; an autonomous found spec with no readable --spec-file; a configured or pinned tracker that is unreachable (tracker-unreachable); a build-claim store that cannot be read (claim-store-unavailable).
next prep-queue [--root DIR]Batch the existing eligibility and next-step kernels over a complete, ordered prep scope supplied on JSON stdin. Prints the selected issue IDs as {prep:[...]}. It leaves tracker reads and dispatch to the caller.
project-next --current planned|started|completed|cancelled [--kind project|issue] --total N --active N --done N [--has-dod] [--dod-met] [--json]Container (project / parent-issue) state-coherence + DoD-gated-Done transition predicate — emits a ContainerTransition {kind, current, desired, action, reason} from a child-issue rollup. The /faff-tidy orchestrator-lane sweep maps live child statuses to {total, active, done} and applies any advance via the tracker. Forward-only + monotonic — advance only when rank(desired) > rank(current); never moves a container backward. v1.1: project → started (first child starts) · parent-issue → started (any child in progress) · project → completed (all children done and no DoD) · project → completed (all children done and has DoD and --dod-met — the release gate is satisfied; unmet/unverified holds the project open with reason "release gate not passed — held open (DoD authoritative)"; the gate only ever tightens Done, never loosens it — gate-met with open children never completes a container). --dod-met without --has-dod is a malformed rollup (exit 2). Parent-issue → Done out of scope. Exit 0 (pure) / 2 malformed rollup.
state <issue> [--json] [--root DIR]Local read-model: resolve an issue's spec/parked/branch/worktree/ledger state as JSON; no MCP.
tracker probe [--json] [--root DIR]Classify the tracker-availability pin: reads tracking.tracker and prints pinned (a connector is asserted to exist — a skill must NOT downgrade to git-only on tool-invisibility, it discovers or fails loud) or unpinned (no assertion — attempt discovery before concluding absence). Pure (no MCP/network): it reports only the deterministic pin half; live reachability is the model's call after a harness discovery attempt (a CLI cannot probe MCP). --json → {pin, resolution}. Exit 0 on a successful classification / 2 on an unknown or missing verb, malformed config, or usage error.
tracker facts --source linear|githubClassify an already-fetched batch on stdin. Supply {complete:true,issues:[...],edges:[[issue,blocker],...],queue:[...]} with consistent IDs. edges and queue are optional. Linear accepts state name/category and GitHub accepts closure reason or PR merge evidence. Supply archive fields and parent observations under project. Output arrays contain hidden IDs, completed IDs (done), live_edges and source IDs with an external blocker (blocked). A missing target stays live. Incomplete or malformed input exits 2 with an empty stdout. Limit input to one MiB per batch. For large graphs include each fetched target alongside every source that uses it and supply the applicable queue membership.
queue-state new-keyPrint one freshly-minted stable item-key ("gitkey", gk-<YYYYMMDD>-<6×base36>) to stdout. Minted once, persisted, never recomputed from mutable content — rewording a roadmap line or renaming a spec never changes it. Pure (no FS/tracker/network); the shared mint authority /faff-plot and /faff-jot shell out to when stamping a git-only work item at creation time.
queue-state derive [--run-dir DIR] [--root DIR] [--json]The git-only queue_empty/all_parked differ — the automatic source faff run-done's --queue-empty/--all-parked flags need when there is no tracker queue to read. Collects the item-key union (every <!-- gitkey:K --> marker under <root>/.faff/intake/*.md, plus every filename stem under <root>/.faff/specs/*.md, de-duped by exact string), reads outcomes{} from the resolved run-ledger (--run-dir → $FAFF_RUN_DIR → latest under .faff/runs), and classifies each key terminal/pending against the active governance profile's terminal_states (activeProfile(), $FAFF_GOVERNANCE_PROFILE-overridable). Emits {queue_empty, all_parked, items_total, items_terminal, items_pending, reason} — fail-safe toward not-empty at every turn: a zero-key set → not empty, reason:"no-item-keys"; any pending key → not empty, reason:"work-remaining"; every key terminal and all parked → not empty, all_parked:true, reason:"all-parked"; every key terminal with ≥1 non-parked → empty, reason:"drained". Pure: no tracker/network/writes. A missing ledger is a valid non-drained state (exit 0, queue_empty:false) — a run that hasn't recorded outcomes yet simply isn't drained; a present-but-unparseable ledger is loud (exit 2), never silently coerced to a verdict; an unknown subverb/flag is exit 2. --selftest runs the classifier + mint-format/uniqueness + missing-vs-malformed-ledger + reworded-line/renamed-spec round-trip table.
drain-filter [--runs-dir DIR] [--root DIR] [--max-age-hours N] [--now ISO] [--json]Filters a runner pre-check's candidates (stdin: a JSON array of {"issue", "changed_at"}) against the run ledgers' declined records, so an issue a recent drain declined and nobody has changed since does not start another paid drain. For each candidate the newest run in the window (default 24 hours, 1 to 168) that mentions it decides: suppressed only when that run declined it and changed_at is not later than the decline's at. Fails open: an admitted issue, an unknown changed_at, an unreadable ledger newer than the deciding run, a malformed candidate or a missing runs dir all keep the candidate, and degraded names the cause. A run dir with no run-ledger.json (a runner placeholder) is skipped. Times must be ISO-8601 date-times. Prints the kept ids space-separated, or {kept, suppressed, degraded, window_hours} with --json. Read-only: no write, no network, no tracker call. Exit 0 on any well-formed input, 2 on non-array stdin or a bad flag.
findings-reconcile [--stdin]The resolved-elsewhere correlation — the deterministic half of tidy's finding-ticket diagnostic. Reads { finding_tickets, fix_corpus } JSON on stdin (the agent supplies fetched data; the CLI never touches the tracker) and emits { candidates }: open finding-tickets whose fix appears to have merged under a different ticket number. Two deterministic signals only — anchor co-reference (a shared findings-log path, e.g. .faff/logs/…-findings.md, tightened on the F<n> finding-id when both sides carry one; the path is an opaque identity key, never read as a file) and tracker/citation relation (a fix record's cited_ticket_ids naming the finding). Symptom similarity is not computed here — that recall layer is tidy's LLM judgement, weak-only. Self-reference guard: a fix whose source_ticket/ref is the finding is excluded (its own normal build path, not "resolved elsewhere"). strength: strong ⇔ ≥1 deterministic evidence item with merged: true; an unmerged citation surfaces but stays weak; a terminal-status finding (Done/Cancelled/Duplicate, name-based) never surfaces; a finding with no supplied anchor field has one derived from symptom_text by the same grammar (anchor: null opts out). Pure + surface-only — it never dispositions; the human closes a confirmed candidate per the settled disposition convention (Done with a comment trail naming the resolver, never Duplicate/cancelled-category). Exit 0 report-only (the verdict is the payload) / 2 on malformed input — or on an interactive TTY with nothing piped (refused with usage, never a silent hang) — loud, never a silent empty result. --selftest runs the anchor-grammar + correlation + self-reference-guard + terminal-filter table.
contain <mandate> (--parent ID | --root) --ancestry JSON [--record RUN-ID] [--phase run|tidy|prep|build]Subtree-of-mandate containment — is parent ∈ subtree(mandate)? Fail-closed. Trust boundary: --ancestry is agent-sourced, so the walk binds structure, not truthfulness. --record RUN-ID appends a containment-check event binding this verdict to the exact ancestry walked, so faff audit can recompute-and-compare post-hoc — a detective control, never preventive; a missing/non-dir run dir under --record exits 2 (usage-class, no verdict printed, nothing appended) rather than degrading to an unrecorded verdict. --phase (default run) tags the event's phase and requires --record. Without --record, behaviour is byte-identical to before.
self-intake <mandate> --target JSON [--record RUN-ID] [--phase run|tidy|prep|build|plot]The mechanical same-repo/team gate on the self-hosting outward → outward-self-intake reclassification — the filing chokepoint honours the reclassification only when this primitive confirms the discovered item's home is the mandate's own tracking team/repo. The self side is never caller-suppliable (no --self flag — rejected by name, exit 2): the CLI re-derives it from the merged committed config via its own loader, reading exactly containment.self_hosting_intake (the lane dial), tracking.team_key, and tracking.repo (empty/absent → null). The target side ({team, repo}) is caller-supplied on the same trust boundary as contain's ancestry (agent-fetched, bound by --record). Fail-closed first-matching-rung ladder: lane-off → unresolved-target → unresolved-self → team-match → repo-match → mismatch; strict === comparisons (case-mismatch → not-self); null never matches null. Exit 0 self (reclassification honoured) / 3 not-self (the mechanical outward-new-root verdict stands, hard-floored) / 2 usage, malformed --target, config parse failure (loud — never a silent not-self with a wrong reason), or --record run dir missing/unsafe run-id. --record RUN-ID appends a self-intake-check event binding the verdict to the exact target_raw string plus the config snapshot used (a missing run dir exits 2 before any verdict), so faff audit recomputes-and-compares post-hoc — a detective control, never preventive: the target is agent-fetched; the self side and the comparison are what stop being forgeable.
container-check [--json]Is this run inside a host-isolated container (the blast-radius boundary)? Reads only standard runtime signals (KUBERNETES_SERVICE_HOST, /.dockerenv, /run/.containerenv, systemd container= on PID 1, truthy env container) — invents no marker, never parses /proc/1/cgroup. Prints {result, basis}; exit 0 contained / 1 not_confirmed. The autonomous-entry preflight warns (never blocks) on not_confirmed by default.
evaluator-preflight [--repo-path PATH] [--json] [--selftest]The assert-in half of the rung-2 evaluator code-blindness seam — the evaluator lane runs this at entry and refuses (exit 1) unless it is inside a container (in-container leg, reuses container-check verbatim) and the codebase directory is physically unreadable (repo-absent leg, fsq.isDirectory(repoPath) === false), so a code_blind: true holdout verdict is backed by a physical fact, not the judged party's self-attestation. Sibling to container-check (which warns) — the evaluator must refuse. Pure over (env, fsq, repoPath); never throws (an fsq error fail-closes to the blind/passing state). The refuse decision rests on the physical probe, never on a declared intent artifact's claim. --repo-path defaults to the resolved repo working tree; --json prints {holds, repo_path, refusals[{leg, detail}]}, the human form lists the refusals; exit 0 holds / 1 refuse. Now wired: the evaluate-call.mjs spawner runs this in-cage before judging (a non-zero exit is the spawner's exit-10, needs-human); the host-socket-absent refuse-leg remains deferred.
lane-boundary emit --run-dir DIR [--lane LANE] [--json]The emit half of the config-declares → emit → assert-in chain (the intent-out counterpart of evaluator-preflight's assert-in). Resolves a lane's declared isolation from the config (lanes.<lane>.isolation.{container,host} — the two orthogonal axes: container: shared|own containment, host: local|remote locality) and emits it as <run-dir>/lane-boundary.json (faff becomes the first-ever writer of that file). Never writes a broken promise — the assembled intent is validated through computeLaneBoundary (the same validator contract lane-boundary + the merge-gate fail-safe use) before writing; an out-of-enum/malformed intent errors (exit 1) rather than persisting. Evidence class — orchestrator/trusted-side write authority only, never lane-written. SHIP-NOT-WIRE: no live call site invokes it this slice, so live runs keep lane-boundary.json absent and the merge-gate laneBoundaryDispatchState fail-safe stays byte-for-byte preserved (live wiring is deferred to the cage+spawner sibling). --lane defaults to evaluator; --json prints {ok, path, intent}; exit 0 written / 1 refuse-invalid / 2 usage.
corrective-integrity [--consumer corrective|detection] [--json]The corrective-integrity fail-safe gate — distrust by default over the forge surface a same-uid build lane shares with the orchestrator (corrective artifacts + run-ledger.json). Under a shared uid faff cannot cryptographically stop that lane from forging a corrective artifact or rewriting the ledger (it is a guardrail, not a cryptographic control — a local agent can always write a marker), so the pure probe proves no integrity boundary (asserted:false for all inputs; the signal parameter is an inert forward-compatible seam for a future un-forgeable channel — a signal from any build-lane-writable source is never honoured) and the gate degrades: corrective → Channel D (human relay), detection → reconcile-only (ledger content cross-checked vs git), an unknown consumer → Channel D (fail-safe, never trusted). No crypto, no secret, no signature — a shared-uid secret is itself forgeable. Prints {asserted, basis, trusted, disposition}; always exit 0 (report/degrade, never a hard refuse). Folds a corrective_authority: available | channel-D-only capability record into the lights-out ledger.
integrity-boundary [--root DIR] [--run-dir DIR [--issue ID] [--events]] [--json] [--selftest]The emitter half of the corrective-integrity boundary — faff originates the (version, dir-set) content of the FAFF_INTEGRITY_BOUNDARY declaration the cage (or today's hand-operator) exports, so a future dir-set change is a faff-only change (no consumer hard-codes faff-internal dir names — the drift class that added events.jsonl once already, killed). Default (launch grain) prints exactly v1:<abs-root>/.faff/runs — the stable ancestor the coverage math accepts, mintable before any run dir exists (per-run paths can't be named at cage launch). --run-dir DIR [--issue ID] [--events] prints the per-run grain: v1: + the exact correctiveIntegrityDirs(DIR, issue, {events}) set, for a cage that mounts fine-grain at build-lane-spawn time. Origin only — it never reads or validates pid-1 environ (that is the reader's separate authority; the assert-don't-implement trust boundary stands, faff still never provisions the mount). Strict root resolution, never a guess: --root must name an existing directory, else walk up from cwd for the first .git/.faff/.faff/config.yaml ancestor and exit 2 on no marker — an emitter whose output becomes a trust declaration must fail rather than print a findRoot-style guessed path. The version token is provenance, not a gate (the reader stays ungated). --json prints {version, mode, dirs, declaration}; --issue/--events without --run-dir, an unknown flag, or a comma in any emitted path (it would re-parse into a silently-wrong dir set) all exit 2. Invoke against the same path the run will use (coverage is textual prefix math, not realpath — a symlinked checkout that resolves differently fails closed at merge as dir-mismatch). Exit 0 printed / 2 bad input; --selftest runs the round-trip table.
integrity-digest <snapshot|verify|hash> --run-dir DIR [--issue ID] [--events] [--manifest json|file|-] [--json] [--selftest]Custody-based tamper detection over the evidence set (correctiveIntegrityDirs) — the sanctioned interim integrity rung while the real read-only mount is deferred. A trusted dispatcher holds the emitted manifest in its own conversation context across an untrusted subagent dispatch (custody the subagent structurally cannot read or alter — it replaces signatures, which need an on-disk key a same-uid lane can read); verify then recomputes-and-compares to detect tampering before the evidence is consumed (the same recompute-and-compare detective pattern faff contain uses for agent-supplied ancestry, applied to the forge surface). snapshot walks correctiveIntegrityDirs(runDir, issue, {events}) and emits a per-member digest manifest to stdout: run-ledger.json + the per-issue files hashed byte-exact, corrective/ as a per-sub-file map (which-file granularity), events.jsonl as {length, prefix_sha256} — prefix-preserving, so a legitimate append is not tampering but a truncate/prefix-rewrite is; an absent member is recorded, so an appear/disappear is caught too. verify --manifest <json|file|-> recomputes and prints digest-verified (exit 0) or tampered naming the mismatched path(s) down to the sub-file (exit 1). hash reads stdin to EOF and prints the 64-hex digest of those bytes (exit 0) — the orchestrator's intended-content check pipes its in-context bytes here so it shares this one resolver rather than carrying its own tool policy. Hashing resolves its tool from a fixed list of absolute paths (/usr/bin/sha256sum, /bin/sha256sum, /usr/bin/shasum -a 256), probed in order — first present wins, never PATH (the same-uid tool-poisoning mitigation, now portable across Linux and macOS), and the spawn runs under a sanitized minimal env (PATH only, no inherited PERL5LIB/PERL5OPT) so the Perl-script shasum candidate adds no injection channel; no candidate present is fail-loud exit 2, never a silent verified. It emits its own trust class digest-verified and never references FAFF_INTEGRITY_BOUNDARY / integrityGate (the mount-asserted basis is a separate authority; conflating them is the lying-attestation the assert-the-boundary decision forbids — folding this verdict into the gate is the consumer's job, not this CLI's). Exit 0 verified/printed / 1 tampered / 2 bad input or hash-unavailable; --selftest runs the round-trip + tamper + events-prefix + trust-boundary table.
bundle <publish|verify> [--run-dir DIR] [--boundary-kind issue-merge-floor|run-close] [--boundary-key KEY] [--run-id ID --run-segment-id N] [--root DIR] [--json] [--selftest]Phase-0 recovery bundle publish + fail-closed independent verify. publish --run-dir DIR --boundary-kind K --boundary-key KEY assembles the 7-member minimal set (ledger_snapshot, admitted_outcomes, anchors, artifact_manifest, last_safe_boundary, redaction, bundle_manifest_digest) via the pure core buildBundle — every member is either a byte-copy of an already-redacted file, a projection over those bytes, or a purely structural pointer — and writes it through the resolved bundle_store occupant (the top-level bundle_store config key — a mode enum, not a slot — default local: nothing leaves the box; git-remote: pushes a write-once orphan commit to its own refs/faff/bundles/<run_id>/seg-<segment>/<boundary_key> ref — no PR, no CI). A re-publish at an already-published identity with a matching digest is an idempotent no-op; a mismatched digest at the same identity refuses (write-once, never overwritten). A distributing occupant's unreachable backing store reports store_unavailable and never fails the run (exit 0, the run continues locally). verify --run-id ID --run-segment-id N --boundary-kind K --boundary-key KEY reads the bundle back through the store and folds it through the pure fail-closed ladder classifyBundle — reusing buildManifest/diffAgainstManifest (integrity-digest.js) and verifyChain/verifyEffectsChain (events.js) for tamper detection, never forked — into one of six verdicts: CLEAN, STALE (superseded by a later boundary in the same run segment), MISSING, MALFORMED, TAMPERED, or VERIFICATION_UNAVAILABLE (the store was unreachable or a read was denied — never treated as clean). Every identity component (run_id, boundary_key) is validated against a strict charset before any store-handle interpolation. The emitted verdict is the bundle-verdict contract (faff contract bundle-verdict). Exit 0 CLEAN / 1 STALE|MISSING|MALFORMED|TAMPERED / 2 VERIFICATION_UNAVAILABLE or bad input; --selftest runs the pure-core table plus a local-store and a scratch-bare-repo git-remote-store round trip.
bundle-recover --issue ISSUE-ID [--run-id ID] [--root DIR] [--dry-run] [--json] [--selftest]The read-only Phase-0 recovery verb — lets a FRESH executor with no local .faff/runs/<run-id>/ pick up an unattended run after the original executor was lost at a published safe boundary. Discovers the most recent published bundle for --issue across every run (git-remote: widens gitRemoteBundleStore.listBoundaries's own ls-remote glob idiom to refs/faff/bundles/*/seg-*/<ISSUE>; local: scans .faff/bundles/*/seg-*/<ISSUE>/), verifies each candidate through the SAME fail-closed ladder faff bundle verify uses (verifyBundleIdentity/classifyBundle — never forked; only a CLEAN verdict is ever consumed), selects the CLEAN candidate with the latest last_safe_boundary.ts (tiebreak: the sortable run-YYYYMMDD-HHMMSS prefix in run_id; an indistinguishable tie refuses ambiguous, never a silent guess), and reconstructs exactly three targets from that bundle's own bytes — run-ledger.json, the .faff/anchors/<run-id>/<boundary-key>/ directory, and events.jsonl — write-once (an existing byte-identical ledger is noop-already-present; a diverging one refuses as an identity conflict, never overwritten). The reconstructed ledger is then handed to the SAME shipped resume cores faff lights-out --resume uses (classifyReEnterable, reconstructResumePlan, gatherResumeEvidence) to compute a read-only resume_preview — a shipped issue whose merge cannot be proven from bundle bytes (the bundle carries no merge-record.json) parks, never skips, and any computeEscapes escape over the reconstructed declared-effects.jsonl parks its issue too. Writes no owner state (never owner.status, never owner.epoch) and makes no forge call — the continuation that does either stays the separate faff lights-out --resume <run-id>, run after this verb reports reconstructed. --run-id ID narrows discovery to one run (also the only way to reach a run-close boundary, whose boundary_key is never surfaced by the issue-keyed query). --dry-run runs the full discover/verify/select/preview path into a scratch directory and reports the disposition without touching the real root. The emitted RecoveryDisposition ({disposition, bundle_verdict, bundle_identity, run_id, run_dir, boundary_kind, reason, resume_preview, candidates_considered}) is the recovery-disposition contract (faff contract recovery-disposition) — a non-CLEAN bundle_verdict can never pair with anything but disposition: refused. Exit 0 reconstructed|noop-already-present / 1 refused / 2 usage or internal fault; --selftest runs the pure-core table (selection ordering/tiebreak/ambiguity, the idempotency decision, the escape fold, contract coercion) plus a full local-store discover→verify→reconstruct→preview round trip; the killed-executor fixture and the no-gh-call oracle live in test/bundle-recover.test.mjs.
build-claim <acquire|confirm|reclaim|release|release-if-stale|read> --issue ID [--sha SHA] [--session-id S] [--heartbeating|--no-heartbeating] [--remote NAME] [--root DIR] [--json]The build-queue mutex — a write-once refs/faff/build-claims/<issue> git ref on origin (default remote), so at most one graft anywhere builds a given issue; the tracker In Progress status and faff-claimed label demote to human-facing breadcrumbs. Built from the shipped recovery-claim primitive (generalised to claimStoreCore, of which recoveryClaimStore stays a byte-identical thin binding) via buildClaimStore — on origin, so it works under every bundle_store and is git-only mode's first cross-host build claim. acquire CAS-pushes the ref (self-session idempotent re-acquire), and on an existing ref transparently reclaims a genuinely-stale prior claim via --force-with-lease — staleness judged by buildClaimStaleAware: a heartbeating:false (bare human graft) claim by claim_ttl_hours age; a same-box (machine_id matches faff machine-id, run-dir resolves) crashed claim off the live heartbeat file, immediately, no wait; a cross-box claim off the frozen snapshot via runIsHeld/heartbeatStaleSecs. Liveness is heartbeat-only — the recorded pid is never probed. confirm is the read-after-write head-confirm (the ref head, not any timer, decides who builds — run before the first irreversible build side effect). release is a lease-matched delete (--force-with-lease=<ref>:<sha> :<ref>) so a re-queued issue is re-acquirable — never a bare --force; a superseded/missing no-op is benign. reclaim is the standalone stale-reclaim; release-if-stale (tidy's groom) releases the ref only if the current holder is stale, never yanking a live heartbeating build. read reports the current holder. acquire/confirm/reclaim exit 0 on success / 1 on refuse; release/release-if-stale/read exit 0 (best-effort). Covered by faff bundle --selftest (the buildClaimStore git-integration + the buildClaimStaleAware three-row pure table).
landing-claim <acquire|tick|confirm|reclaim|release|read> --issue ID [--sha SHA] [--claimer-id ID] [--pr-head-sha SHA] [--remote NAME] [--root DIR] [--json]The endgame-only landing-resume concurrency floor — a write-once refs/faff/recovery-claims/<issue> git ref on origin (default remote — a sibling ref namespace to recoveryClaimStore's own refs/faff/recovery-claims/<run_id>/seg-<n>, never colliding since run ids always start run- and issue ids never do), so at most one L3 executor anywhere runs the endgame-only landing pass for a stranded In Review + open-PR issue. A THIRD claimStoreCore binding (landingClaimStore, beside recoveryClaimStore and buildClaimStore) — same acquire/CAS/lease-matched-reclaim/lease-matched-release plumbing, but deliberately simpler staleness than buildClaimStore's machine-aware three-row test: heartbeat-only — a claim is reclaimable only when now - last_heartbeat > heartbeatStaleSecs (runIsHeld's own threshold), never by claim age, and only when the existing claim carries provenance: "faff-claimed" (a claim of any other/unreadable provenance reads as unconditionally held — never seized). acquire --claimer-id ID --pr-head-sha SHA CAS-pushes the claim ({issue, claimer_id, pr_head_sha, claimed_at, last_heartbeat, provenance:"faff-claimed", claim_epoch}, pr_head_sha the fencing token) and on an existing ref transparently reclaims a genuinely-stale one — refusing as fencing-mismatch, without ever evaluating heartbeat staleness, when the existing claim's own pr_head_sha no longer matches the caller's --pr-head-sha (the PR moved on since that claim was minted; never reclaim against a stale revision). tick --sha SHA is the holder's own heartbeat refresh — a lease-matched force-update of its own claim (mySha) each landing-cycle boundary while the landing loop runs; unconditional on staleness (the caller already proved it holds mySha), refusing only superseded if a reclaimer moved the ref since. confirm/reclaim/release mirror build-claim's verbs exactly (the read-after-write safety pin; the standalone stale-reclaim; the lease-matched delete on terminal disposition — merged, or the 3-cycle hard-park). read reports the current holder. acquire/tick/confirm/reclaim exit 0 on success / 1 on refuse; release/read exit 0 (best-effort). Covered by faff landing-claim --selftest (race, live-heartbeat-blocks-reclaim, stale-and-faff-claimed-reclaims, stale-but-foreign-provenance-never-seized, tick-refreshes-liveness, tick-refuses-once-superseded, release-then-remint).
corrective <author|check> --run-dir DIR --issue ID [--json]Sentry-2 Channel A — stop-and-redispatch with a machine-authored, subtractive-only corrective input. The op vocabulary is a closed enum (park-with-cause, forbid-surface, tighten-threshold, descope-to-subset) — additive intent is inexpressible by construction; anything else fails validation. author --op OP <op flags> --cites-signal S [--cites-seq N] [--cites-evidence S] validates the record (closed enum, op-shaped payload, a required citation — no un-cited input ever validates — and a tighten-threshold value strictly tighter than the effective sentry.* config value) and writes it onto the corrective-integrity forge surface (correctiveIntegrityDirs(runDir)'s corrective dir) + appends a corrective-authored event; invalid → exit 1, nothing written. author --json additionally carries sha256 — the sha256 of the file it just wrote at path — so an orchestrator holding an integrity-digest custody baseline can check this write's touched member without a second read. check gates every read through integrityGate(correctiveIntegrityProbe(...), "corrective"): unasserted → {disposition:"channel-D", consumed:false, inputs} — surfaced for human relay, never acted on as authentic; asserted → validates + folds the cumulative constraint set (order-independent intersection semantics across multiple inputs on one issue — the audit trail that makes sequential-narrowing steering reviewable) into {disposition:"trusted", mandate:"narrowed"|"empty"|"indeterminate", constraints, applied, rejected} + appends corrective-consumed. An invalid/foreign/additive artifact is rejected (never applied) and reported in rejected for park/needs-human routing; an empty/doubtful indeterminate mandate is the orchestrator's park-before-dispatch signal, never a spin. Reads are scoped to the named --issue only. Pure cores + thin I/O, never a crash on an unreadable/unparseable artifact; exit 0 report (check) / 2 usage / 3 no run dir.
merge-gate delivery-receipt --merge-exit CODE [--precondition REASON]Read the existing structured gate receipt from stdin and append the default ship producer's delivery block. A confirmed open-PR precondition rejection may carry the caller's deferral reason. The formatter performs no Git or forge operation.
merge-gate --pr N --issue ID --run-dir DIR --level L1|L2|L3|L4 [--merge-args "flags"] [--execute|--check-only] [--interactive] [--human-override] [--accept-review-unavailable] [--allow-no-ci] [--json]The sole sanctioned gh pr merge path — a pure decideFloor core (registered as the integrity-floor contract, --selftest-covered) wrapped in a thin impure gh/git shell. The shell observes CI itself on the resolved PR head sha (it never accepts a caller-supplied CI verdict — the model's self-report is exactly what the gate distrusts), re-reads the persisted floor artifacts from the run-dir (<run-dir>/<ISSUE>/ac-checklist.json + review-verdict.json, the latter re-validated through the same computeReviewVerdict rule; under --level L4 the .faff/holdout/<ISSUE>.json verdict via holdoutGateResult), decides via the pure contract, and runs gh pr merge only on merge-ok. The merge is pinned to the observed head sha (gh pr merge --match-head-commit <observed-sha>, gate-composed — callers cannot supply it), so a push landing on the PR branch between CI observation and merge no longer slips through: the forge itself rejects the pinned merge and the gate refuses (no merge of a never-observed commit). CI observation is fail-closed on loss of the primary signal: the check-runs API is the primary source and the legacy commit-status API only a supplement — if check-runs is unreadable the reading is indeterminate even when the legacy status is green (a legacy success alone is never trusted; a readable check-runs with the legacy API down still classifies normally). Fail-closed everywhere: a missing/unreadable artifact, an indeterminate CI reading, no-ci-coverage (default; --allow-no-ci opts a change-class in), a head-sha mismatch (stale green — CI attributed to an earlier commit), a head that drifted after observation (forge-rejected pin), review != pass, or an L4 holdout != meets-spec all refuse. With --merge-args "--auto" the pin guards only auto-merge enablement (the forge refuses to enable auto-merge against a drifted head); it does not cover the eventual forge-side merge, which fires when required checks pass against whatever head then exists — that later merge is delegated to the forge's own observation, unchanged by this gate. --check-only computes the verdict without merging; --interactive --human-override records an override to the run-dir and replaces the autonomous refusal (the merge path stays singular even for a human override); --interactive --accept-review-unavailable --override-reason "..." is the narrower sibling override — it excuses only a review_verdict == "unavailable" leg (a review-chain outage, never a fail/needs-human/missing review), computed structurally by re-deciding the same decideFloor core with the review leg forced to pass and requiring zero remaining blockers; any other unmet leg still refuses (naming it, never silently escalating to the blanket override), and the two override flags are mutually exclusive (exit 2 if both are passed). Both override kinds record to the same per-issue merge-gate-override.json, distinguished by source ("human-override" vs "review-unavailable-accept") so faff audit never conflates a narrow outage-accept with a blanket override; an already-merged PR is an idempotent no-op. --merge-args is validated against the closed gh pr merge flag allowlist (--squash/--merge/--rebase/--delete-branch/--auto); any other token → exit 2, so no untrusted free-text reaches the merge shell. --admin is deliberately not on the allowlist — it instructs the forge to bypass branch protection, the very backstop the merge floor leans on (and which branch-protection-check asserts), so faff never issues one under any lane; --merge-args "--admin" → exit 2. The three human-only flags --human-override, --accept-review-unavailable, and --allow-no-ci are fenced on a genuine interactivity signal — they are honoured only when process.stdin.isTTY === true and --interactive is also present; a non-TTY invocation (the autonomous lane, or any agent-driven Bash call) passing any of them → exit 2 fail-loud before any gh call, naming the run-it-yourself-in-a-real-terminal remedy. A sibling argv flag is self-assertable, so it can never be the fence; the TTY signal is one the autonomous lane structurally cannot mint. --human-override and --accept-review-unavailable additionally require a non-empty --override-reason (the explainable-record guard). On a merge this invocation actually confirms landed (the clean-success tail, or the classifyPostMerge "merged with a failed post-merge step" path) it also observes — appends {kind:"merge", target:"pr:<n>"} (+ {kind:"branch-delete", target:<head-branch-name>} iff --delete-branch was requested and the merge itself succeeded cleanly) to the run-dir's declared-effects.jsonl via the shared appendEffectEntries helper (effects.js), and warns on stderr, once per effect — never refuses — if no faff effects declare at --step merge covers it (declaring is graft's job, before this command is ever invoked; this CLI is the mechanical observer only). --check-only, a refuse verdict, and the already-MERGED idempotent no-op write nothing to the ledger. Governed runs: the merge and --delete-branch legs are verified by Commissaire (verifyGrant) against the PR's own baseRefName and head ref, with the trust file read once from the base branch of the repository named in the PR url; --json adds commissaire_grants (one entry per checked leg, including an evidence flag), and a refusing leg adds a Commissaire <leg> grant refused: <reason> blocker. Ungoverned runs make no extra calls. Exit 0 merge-ok / 1 refuse / 2 fail-loud (bad inputs / cannot establish PR identity). On an unattended run (an anchored human-only-acs.json with unattended: true and a stamp that matches it), a pending criterion the file lists as human-only and that carries only human verifications no longer raises the AC blocker, provided another criterion passed; the result and merge-record.json carry the skipped ids as ac_called_out ([] otherwise). --local and the already-merged reconcile decide the same way.
pr preflight (--branch NAME | --issue ID --slug SLUG [--tracker-branch NAME])Read-only push and squash-merge probes for the default git/GitHub delivery path. In issue mode it uses the owned worktree branch or the same branch convention as worktree ensure. In the feature checkout use its PR head branch. Returns JSON with clear, git-only or indeterminate (exit 0), or blocked and its operator remedy (exit 1). Invalid arguments exit 2. Graft and ship separately check diff-specific token scope and Actions policy.
pr plan-in-review --issue ID [--run-dir DIR]Takes fresh tracker facts and the PR-open transition on stdin. Plans the forward MCP update from In Progress and reuses the corresponding effect payload for declaration and observation. The connector performs the update.
pr open --run-dir DIR --issue ID --base BRANCH --title T --body-file FILE [--append-ac-checklist] [--spec-review-evidence FILE] [--json]Run in the feature worktree. With --append-ac-checklist, omit the Acceptance Criteria section from the draft. The command renders it from the committed anchor and checks the complete body before pushing. In order: refuse unless review-verdict.json re-validates to pass; the governed-run check (commissaire contract status, 30 s); best-effort evidence write spec-review-verdict from --spec-review-evidence; sanitize and check the body in-process (the checked bytes are the shipped bytes); gh pr list for an open PR on the branch, before anything outward (on a governed run an existing PR needs a valid pr-create grant); clear any stale human-only-acs.json and mint it from the main-checkout captured spec with evidence write human-only-acs (skipped on already-open; a fault is a warning, never a refusal); mint the anchor with events anchor, commit it as chore(<ISSUE>): anchor run evidence (only an empty stage skips the commit), and push it (bracketed with effects declare|observe on a governed run); best-effort bundle publish; on a governed run the pr-create commissaire effect declare and authorize, with level, attendance and holdout derived as merge authorize derives them; then pr-create, unchanged, and the governed observe. It never writes the tracker: opened and already-open carry tracker_transition ({to: "In Review", governed, effect}) for the agent to apply. Prints one {token, exit, pr_url?, pr_number?, head_sha?, anchor_dest?, cause?, blockers?, warnings[], governed?, tracker_transition?} object (--json) or a summary line. Exit 0 opened / already-open / no-op (git-only); 1 refused (review-not-pass, body-unsafe, open-pr-other-base, pr-create-refused); 2 errored (usage, unreadable input, wrong-branch, gh-unavailable, an anchor CLI error, a commit or push failure); 3 needs-human (anchor-no-events, anchor-genesis-invalid, anchor-floor-incomplete, commissaire-status-failed, already-open-ungranted, pr-create-denied).
pr-create --run-dir DIR --issue ID --base BRANCH --body-file FILE [--title T] [--level L] [--json]The sole sanctioned gh pr create path (never a raw gh pr create) — a fail-closed pr-create chokepoint sibling of merge-gate. On a git-only repo (no pushable remote) it is a no-op exit 0 (mirrors graft Step 9b's git-only no-op). Otherwise it resolves the Commissaire pr-create decision leg for (issue, step="pr-create") — three-valued, resolvePrCreateGrant (the structural mirror of merge-gate's own merge resolver): not-applicable (an ungoverned run — no schema:3 records — opens the PR exactly as a raw gh pr create would, byte-for-byte), valid-grant (a governed run carrying a covering, verified, signed pr-create grant → open), or absent-or-invalid (a governed run with no covering grant, or a grant that fails Commissaire's verification against the admitted key and the base branch's trust file → refuse, exit 1, open nothing). --base is the grant-coverage target (the base branch the PR opens against — the merge grant's base-branch convention; * wildcard grants still cover). On a governed leg it is also forwarded to gh pr create with --repo <slug> (the repository the trust file was read from), so the checked target is the acted target; the ungoverned open is identical to the pre-slice call (gh pr create --body-file <FILE> + optional --title). With --json a governed run adds commissaire_grants (one entry per checked leg: reason, custody, classification, trust source, base ref, repo slug, evidence), and a refusal adds a Commissaire pr-create grant refused: <reason> blocker. On an open it observes the {kind:"pr-create", target:<base>} effect (declare + observe at step="pr-create", schema:2) unless a covering schema:3 grant already owns the lineage (prCreateCoveredBySchema3Grant — a covered create suppresses its schema:2 trail for a single schema:3 lineage). Exit 0 opened / no-op, 1 refuse / gh pr create failure, 2 bad inputs.
merge authorize --run-dir DIR --issue ID (--pr N [--delete-branch] | --local [--base B] [--branch BR]) [--json]Writes the merge-step Commissaire grants a governed run needs before merge-gate will merge it, from the run's own facts: level from the committed anchor at the head merge-gate enforces, attended from verificationUnattended at that level, and holdout through the freshness-checked holdout reader (blocked when stale, missing when absent). No flag supplies any of the three. Declares and authorizes the merge effect on the base (plus branch-delete on the head under --delete-branch) through the existing faff commissaire effect verbs, skipping an effect whose valid grant already records the same inputs. An ungoverned run writes nothing. A deny leaves the declaration in place with no grant, so merge-gate still refuses. --json prints {governed, inputs, effects, written}. Exit 0 granted or ungoverned, 1 denied or already merged, 2 an input (PR identity, anchor level) could not be established.
merge observe --run-dir DIR --issue ID (--pr N [--delete-branch] | --local [--base B] [--branch BR]) [--json]After a confirmed merge, writes one faff commissaire effect observe --step merge per effect in the same set, skipping one already observed. Refuses (exit 1) without the merge-record.json merge-gate writes only on a confirmed merge.
branch-protection-check [--repo owner/repo] [--branch name] [--json]Assert-don't-enforce branch-protection probe (mirrors container-check) — is the target branch protected by required status checks? Probes the effective-rules API gh api repos/{repo}/rules/branches/{branch} — the documented union of classic protection and GitHub rulesets, so ruleset-only protection is seen (the classic protection endpoint 404s on it) — and classifies the result purely: protected when a required_status_checks rule applies (carrying its contexts), unprotected when the rules array carries no such rule (incl. []), indeterminate on a 404 / unparseable body / gh failure. Prints {status ∈ protected|unprotected|indeterminate, required_checks, basis}; exit 0 protected / 1 not-confirmed (unprotected/indeterminate). The autonomous-entry preflight (beep-boop + lights-out) warns by default on not-confirmed, blocks only under the opt-in autonomous.require_branch_protection knob, and never fires in interactive mode — the compensating control that makes the merge floor binding at the forge. faff never mutates the consumer's GitHub settings.
github-auth-check [--json] [--selftest]Run-start GitHub-auth preflight — is the GitHub push credential live? A read-only gh api user probe (user-scoped, so it needs no repo slug and runs before any repo resolution), classified purely: authed on exit 0 with a parseable .login; auth-failed when the API rejects the credential (HTTP 401/403 / bad-credentials / not-logged-in — the loud, actionable "re-auth" outcome); indeterminate when gh can't run (binary missing, network error/timeout) or the failure is not attributably auth. Deliberately fail-open: only a rejected credential is auth-failed; a missing gh or a network blip is never a re-auth claim, and the token value never appears in basis (gh's auth stderr reports the HTTP status, not the token). Prints {status ∈ authed|auth-failed|indeterminate, basis, login} under --json, else <status> (basis: <basis>) (— <login> appended when authed); exit 0 authed / 1 otherwise. The beep-boop autonomous-entry preflight runs it before the build queue is minted and surfaces auth-failed loudly at kickoff, warns by default, blocks only under the opt-in autonomous.require_github_auth knob, and indeterminate never blocks even under block. --selftest runs the pure classifier (authed / auth-failed 401 / indeterminate) offline.
post-merge-check --issue ID --pr N --run-dir DIR [--sha SHA] [--json]Post-merge verification (verification-only — no auto-revert) — invoked at faff-graft Step 10's shipped arm (autonomous mode only, after faff merge-gate returns merge-ok). Re-runs the project's own declared UNIT rung — resolved via the same discoverRungs/runRung (gates.js) faff-graft Step 7.5/Step 8 already trust, never a second, divergent resolver — against an ephemeral, detached git worktree at the sha faff merge-gate already pinned into <run-dir>/<issue>/merge-record.json (head_sha; --sha overrides for a human-invoked re-check only, never a second automatic sha resolution). The worktree is named under the system tmpdir (outside any configured worktree_root) and is always removed — success, a failing rung, or a worktree/spawn error (FINALLY semantics) — so a crash mid-run never leaves a stray git worktree entry. Classifies purely: the rung pass → verified-ok; fail → verified-fail; no UNIT rung discovered, or any worktree/fetch/spawn error → the distinct, non-blocking unverified (never a fail-closed park — a repo with no declared test command must not park every merge). Persists <run-dir>/<issue>/post-merge-verification.json ({issue, pr, merge_sha, verdict, basis, command, discovered_scope_ref, checked_at}); the pure classify+shape half is computePostMergeVerification, registered as CONTRACTS["post-merge-verification"] (see the contract row). This CLI only observes and annotates — it never merges, reverts, reopens the issue, or opens a PR; on a verified-fail exit, faff-graft's Step 10 prose (not this CLI) posts the tracker comment and appends the source: "post-merge" discovered-scope entry. post_merge.check (.faff/config.yaml, default on) is consulted by the caller (graft) before invoking this CLI at all. Exit 0 verified-ok / 1 verified-fail / 2 fail-loud (bad inputs / cannot resolve a merge sha) / 3 unverified; --selftest runs the verified-ok/verified-fail/unverified/worktree-cleanup table against a real tmp git repo.
ci-triage --pr N --issue ID --run-dir DIR [--repo owner/repo] [--transience transient|persistent|unknown] [--fault-domain infra|code|unknown --fault-domain-source llm] [--json]CI failure triage — invoked at faff-graft Step 10's ci-red branch (both interactive and autonomous). Classifies a red CI result across three axes — transience (transient/persistent/unknown), fault_domain (infra/code/unknown), origin (mine/main-was-red/unknown) — and derives a per-class action via the pure core deriveTriageAction (registered as the ci-triage contract, --selftest-covered, no network). The thin impure shell observes only: the PR head's check-runs, main's head check-runs (git rev-parse origin/main then the same check-runs API), and the committed flaky register (operations/ci/flaky-register.json, behind a single read/append accessor) — it never re-triggers a run, parks, files a ticket, or merges. origin is per-check (a main failure on a different check is still mine) and fails closed to unknown on an unreadable main head. fault_domain is mechanical-first from check-run metadata (startup_failure/timed_out → infra; anything else → unknown, never guessed as code) — --fault-domain/--fault-domain-source llm is the only way to narrow an unknown metadata read (a malformed/out-of-enum value coerces to unknown). --transience is fed in by the caller (graft, after it performs its own clean same-sha re-run) — this CLI never re-triggers one itself, so an omitted/malformed value defaults to unknown (the pre-rerun first call). action is always the pure function of the three axes, never a caller-trusted field: origin: main-was-red (or unresolved unknown) wins outright; a transient result proceeds to proceed-to-merge-gate regardless of fault domain (the real procedure skips the fault-domain question entirely once the re-run goes green); an unresolved transience fails closed; a genuinely persistent failure routes infra → park-errored / code → fix-attempt / still-unknown → the same fail-closed park. On --transience transient, appends one flaky-register event per this pass's failing check signatures and quarantines (marks the register entry — never an autonomous test-file edit) the first time a signature's event count reaches 3 with no quarantine_ticket already set (an already-quarantined signature is never re-filed). Persists the full verdict to <run-dir>/<issue>/ci-triage.json on every invocation. The verdict is never an input to faff merge-gate — a cleared-transient failure proceeds to the merge gate only because the clean re-run made the head-sha checks actually green, and merge-gate independently re-observes them. Exit 0 verdict produced · 2 fail-loud (missing --pr/--issue/--run-dir, or the PR/repo identity can't be resolved); --selftest drives the pure cores (the full deriveTriageAction axis table incl. all-unknown, the metadata fault-domain reader, the per-check origin reader, and the flaky-register fold) with no network.
land --pr N --issue ID --run-dir DIR [--slice-secs N] [--fault-domain code|infra] [--dry-run] [--json]The bounded landing loop — invoked at faff-graft Step 10 (autonomous top-level). Drives an open PR toward mergeable and returns one token: ready (CI green by merge-gate's own observation, mergeable, review pass), pending (exit 3: this call's slice, default 480 s, is spent; re-invoke), landing-resumable (the 25-minute deadline elapsed), leave-for-human:<no-ci-coverage|ci-red-park|rebase-conflict>, needs-fix:<conflict|regression>, or needs-judgement:fault-domain (re-invoke with --fault-domain). It runs ci-triage, re-runs a failed check within the flaky budget (one per head sha, two per build), and updates a BEHIND branch; it never merges, parks, drafts, or writes to the tracker. The deadline and budget persist in <run-dir>/<issue>/landing-loop.json. --dry-run observes once and reports what it would do, writing nothing.
land watch --pr NWatches GitHub checks in the foreground at 15-second intervals. Counts adjacent identical check tables and forwards diagnostics, signals and the GitHub CLI exit status.
land assess-fix --mode shadow|unattended --before FILE [--pushed SHA --after FILE]Classifies one fix attempt from saved land --json --fix-checks observations for the same PR and issue. Omit both optional flags only for a confirmed no-push. Returns a JSON action to record, observe again, resume later, park for human review, or continue the landing loop. A mismatched head or unusable observation exits 2. Pass returned check names to landing-progress record-fix-cycle --failing-checks-json as a JSON array.
land fix-attempt <status|begin|submit|assess> --run-dir DIR --issue ID --pr N --mode shadow|unattendedResumable landing fix accounting. status reads the active attempt and budget. begin --before FILE [--next ID] binds a saved fixable observation and returns an attempt ID. submit --attempt ID (--pushed SHA|--no-push) [--tried CSV] records the implementor's result. After a push, save an observation from land --json --fix-checks --expect-head SHA and pass it to assess --attempt ID --after FILE. A failed attempt counts once, including retries of the same submission or assessment. A superseded head, pending checks and a landing deadline spend no cycle. If the result of an interrupted implementor is unavailable, the caller surfaces the fault. Invalid or corrupt state exits 2.
prep attach: prep attach --issue ID --spec FILE --mode interactive|autonomous [--git-only] [--reviewed] [--fresh] [--gate-history N] [--extraction FILE] [--root DIR] [--json]; prep attach --issue ID --confirm --comment-id ID [--reviewed-spec FILE] [--root DIR] [--json]; prep attach --issue ID --park [--root DIR] [--json]The prep spec attach. Invoked by faff-prep the instant the spec producer returns, and again before every re-post. For a prepared review attachment, use --reviewed to check the latest approval, owner and bytes before writing. A repeated tracker stage returns needs-judgement with reconcile-tracker-post until the post is confirmed. Confirm the posted prepared file with --reviewed-spec FILE and the tracker comment ID. A repeated confirmed stage returns attached and its digest. Use --fresh for newly produced specs. Bundled producers must supply the review severities in their readiness block. Stage applies the confidence ceiling to the retained rating. After checking any review handoff, stage writes the .faff/prep/<ISSUE>.json attach-state marker (attached:false), stamps the > Spec: provenance line under the H1, writes one build-tier: line, runs the spec-readiness fold, and records spec_sha256 and body_path on the marker. It prints one token: ready-to-post (post body_path byte for byte, then confirm), attached (git-only: .faff/specs/<ISSUE>.md written and the marker closed), invalid (with violations), needs-judgement (reason no-readiness-block, re-enter with --extraction, or git-only-marker-parked), or errored (exit 2). On ready-to-post and attached only, the result and the marker carry an advisory admissibility object, the faff admissible --lights-out result over the stamped text: admissible (boolean), reasons (string array) and scenarios_prose (string array of scenarios:<n> ids of prose Scenarios units), with those types on every path; any fault reads admissible: false with an admissibility check failed: … reason. Stage also writes one retained admissibility: line directly after build-tier: (admissible, admissible — prose scenarios: …, refused — <failing check ids>, with R1.scenarios (k of m units count) or (no Scenarios units), or unknown — check failed), built only from the verdict word, check ids and unit ids and capped at 300 characters; text mode appends admissibility: <value> to its details. It never changes a token. --confirm re-hashes body_path against spec_sha256 and closes the marker only when they match, recording comment_id and attached_at. --park sets disposition:"parked" on a staged marker. --issue must be a tracker key. Never touches the tracker or consults a decision kernel. No --selftest; covered by test/prep-attach.test.mjs.
spec commit|verify — spec commit --issue ID --title TEXT --spec FILE --worktree DIR --run-dir DIR [--prep-root DIR] [--json]; spec verify --issue ID --spec FILE --worktree DIR [--run-dir DIR] [--criteria] [--json]The graft spec commit and its pre-grading check — invoked at faff-graft Step 4 and Step 8. commit writes the builder view of the captured spec (dod split --view builder, holdout scenarios removed) into the worktree as <spec-docs-path>/<date>-<issue>-<slug>-design.md and commits only that path, byte for byte; it records the digest, source_check (advisory: the prep marker's spec_sha256 against the captured file), faff_version, commit_subject_scheme (the scheme its commit subject was built from; on already-committed with no record yet, the value resolved now) and warnings (dod split's non-gating over-withholding advisory, empty when there is none) in <run-dir>/<issue>/spec-commit.json. On committed and already-committed the result also carries commit_subject_scheme, plus warnings when there are any, and each warning is printed to stderr as spec commit <issue>: warning: <text>; warnings never change the token or exit. It prints one token: committed, already-committed, needs-judgement (reason committed-spec-differs or uncommitted-file-at-path), or errored (exit 2). verify re-splits the captured spec and checks the committed spec in HEAD and in the working tree against it, printing verified, mismatch (exit 1, differs lists head and/or working-tree) or errored (exit 2). verify --criteria selects JSON and includes ordered DONE criteria from the verified builder bytes on success. Neither command touches the tracker or consults a decision kernel. spec --selftest runs the pure checks.
governance-check --run-dir DIR [--run-dir DIR …] [--anchor-dir DIR …] [--issue ID] [--level L1|L2|L3|L4] [--require-evidence-schema] [--json] [--summary-md FILE]The harness-independent enforcement binding — the composition verb behind .github/actions/governance-check, a required status check that binds faff's governance floor to any PR emitter (not just the Claude Code harness). Composes already-shipped cores, adding no new invariant: runcheck's completeness audit (auditLedger); the ledger's last recorded budget-checkpoint event in events.jsonl (breached != [] at outcome escalate ⇒ fail — never a live token recompute; an absent events.jsonl falls back to the ledger's own stop_reason for a budget-escalated(...) record); merge-gate's floor-artifact re-validation for each target issue (readAcComplete + readReviewVerdict — the same functions merge-gate reads, plus readHoldout, whose holdout leg is capability-driven at any level); audit's buildReconstruction events↔ledger coherence join (report-only, never gating, mirroring faff audit's own posture); and the run-ledger owner block's shape (well-formed ⇒ gating; status + heartbeat age are report-only — a committed snapshot cannot prove the emitting run is still heartbeat-live at CI time). Issue derivation for the merge-floor leg: explicit --issue > branch-name match (case-insensitive [A-Za-z]+-[0-9]+, upcased, via a local git rev-parse --abbrev-ref HEAD — no network) > every admitted issue with a terminal outcome in that run dir. Walks each --run-dir independently and aggregates: pass = AND over every run's gating legs; reasons names run-id + leg + cause per failure. Pure evaluator: no network call anywhere, reads only the given run dirs + local repo files. A malformed/unreadable run-ledger.json is fail-loud (exit 2, never folded into a leg failure) — mirrors runcheck/disposition's own malformed-ledger posture. --summary-md FILE renders the same job-summary table the default text output prints (byte-identical local vs CI, so $GITHUB_STEP_SUMMARY and a terminal run never drift). Exit 0 pass · 1 fail · 2 usage (no --run-dir, unknown --level, non-directory --run-dir) or a malformed ledger; --selftest runs the leg-table + multi-run-dir AND-aggregation + malformed-ledger-exit-2 table. Anchor results also carry a report-only evidence_schema leg (report_only: true, status pass, legacy, fail or error, with the non-conforming file names and a one-line detail) from evidence validate's check; by default it never changes pass, the exit code, reasons or the annotations. With --require-evidence-schema it gates (report_only: false, pass: status === "pass", so legacy, fail and error all fail): the anchor's pass becomes integrity && merge_floor && evidence_schema, and a failing leg adds a reasons line and an annotation. Run-dir results carry no evidence_schema leg. The governance-check Action passes the flag only under its evidence-schema: require input; its separate base-commit evidence leg is described in the governance-check guide, section 5. File names are sanitised (control characters become a space, :: becomes : :, `
landing-comment --pr N --head-ref REF (--files-file PATH | --files-stdin) [--anchors-root DIR]Renders the ready-to-land PR comment for a build-complete faff PR — the verb behind .github/actions/faff-landing-comment. Never merges: it maps the PR's changed files to its committed anchor, reads the merge floor by shelling faff merge-gate --check-only --json (the --check-only path returns the verdict before merge-gate's merge spawn), and prints one comment body to stdout for the workflow to upsert. The body is wrapped in a hidden <!-- faff-landing:N --> marker pair (the review-findings comment-identity idiom) and carries, by case: a graft, floor merge-ok PR — the pre-filled faff effects declare … --step merge heredoc plus the copy-pasteable faff merge-gate … --run-dir .faff/anchors/<run> … --execute command; a graft, floor refuse PR — merge-gate's blocker lines verbatim and no run command; a non-graft PR (no anchor leaf for its issue) — the --human-override --interactive --override-reason variant with <issue> derived from the head branch and no --run-dir. Issue derivation is the head branch (case-insensitive [A-Za-z]+-[0-9]+, upcased); a diff that carries anchor leaves for other issues but none for this PR's own, or whose matching leaves disagree on <run>, is fail-loud (exit 1, never a guess against an unrelated run's floor). The --execute / --human-override text lives only inside the rendered body for a human to copy — this verb invokes neither the merge verb nor gh pr merge. Reads changed paths from --files-file (one per line) or --files-stdin. Exit 0 (comment rendered) · 1 (fail-loud anchor resolution) · 2 usage; --selftest runs the resolveAnchor + renderBody table (no fs/git/network).
harness <seams|check> [--json] [--root DIR]The harness-abstraction seam register: the in-code declaration of the seven seams where faff's behaviour depends on which harness it runs under, each carrying its binding kind (code | prose | unbound), the disposition doc row it traces to (docs/reference/architecture/harness-coupling.md → ## The seams), and the concrete artifact the Claude Code driver uses today. seams prints the register (--json emits it structured, tracker-access shown as carrying no driver-side check). check is the falsifiable half — it asserts every declared binding resolves: each code seam's exported symbols are present on its module, each prose seam's section text appears verbatim in its file, every seam's doc_row label is a bold row of the disposition inventory's ## The seams slice (a label colliding with the disposition-vocabulary table never satisfies it — only the seams slice is parsed), the headless-session-entry floor contract is a key of the COMMANDS map, and a reverse credential sweep over plugin/skills/faff/bin/lib/*.js + eval/*.mjs reports any forwarding spawn-family call site (spawn resolved by binding — including a parameter defaulting to spawnSync — with an env value not provably a fixed literal) that no seam's credential_scope registers. Both verbs print, in text and --json, that the check covers the declared bindings only and is not a general prose-reference checker. Performs no network access and spawns no child process. Exit 0 clean · 1 one or more bindings failed to resolve (or an unregistered forwarding spawn) · 2 usage fault; --selftest exercises every finding kind with injected readers/resolver/COMMANDS/spawn (zero real I/O).

Run orchestration & safety (beep-boop)​

SubcommandWhat it does
runcheck [--hook] [--recover] [--json] [RUN_DIR]Audit a /faff-beep-boop run ledger; --hook gates session-end on dangling admitted work (owning session / --recover hard-blocks; foreign runs warn at most).
heartbeat [RUN_DIR] [--run-dir DIR] [--unit ISSUE] [--json]The single sanctioned write path for run liveness — refresh the dedicated .faff/runs/<run-id>/heartbeat file to now (resolves RUN_DIR → $FAFF_RUN_DIR → latest run) so a live-but-quiet build's long sub-steps keep the run held. The tick's only write is that file (atomic tmp + rename) — it never touches the run ledger, so concurrent tickers can never clobber an orchestrator outcome write. Every reader overlays the file over the legacy owner.last_heartbeat ledger field (the effective heartbeat is the max of both), so a pre-upgrade run keeps working with zero migration. Strict flag parsing: the flag set is closed — --run-dir DIR is an exact equivalent of positional RUN_DIR (giving both exits 2), and any unknown --flag (e.g. an invented --run <id>, formerly a silent exit-0 no-op) exits 2 with a usage message naming the legal flags; flag values never leak into the positional slot. An explicit target (positional or --run-dir) that is missing or has no run-ledger.json exits 3 with the path named on stderr; the soft no-op (exit 0, written:false) is scoped to ambient resolution (no explicit target — an empty-string positional counts as ambient, so an unset shell var stays safe to pass) and to a done/unowned run (no file written either); exit 2 on a malformed ledger or a value-flag missing its value. --unit <issue> (the fleet member tick): writes BOTH the run file above AND a dedicated heartbeat.<issue> file — same atomic single-value shape, single-writer by construction (only that member ever ticks its own file). faff sentry check reads it to resolve member-scoped liveness under the parallel executor. An invalid --unit value (empty/traversal-shaped) exits 2 before any write; --json output gains "unit": <issue>|null.
prepcheck [--hook] [--recover] [--json]Audit faff-prep attach-state markers (.faff/prep/*.json); --hook gates session-end on a produced-but-not-attached spec (owning session / --recover hard-blocks; a foreign marker a live run still holds, or one written recently, warns at most).
inflightcheck (--open --key K [--describe T] | --close --key K | --hook | --list | --json) [--recover] [--root DIR]--list returns the same owned-marker JSON report and exit status as --json (3 with an open owned marker, otherwise 0). The fourth Stop-hook family member — the mechanical turn-end floor over the orchestrator's Agent-dispatch arm, closing the arm background-fence abstains from. The orchestrator writes a per-dispatch marker before an Agent-tool Producer dispatch (--open, keyed by a ^[A-Za-z0-9_-][A-Za-z0-9._-]*$ dispatch key rejected before any filesystem touch) and clears it after the tool result returns (--close, idempotent); markers live at .faff/inflight/<owner-scope>/<key>.json where owner-scope is slug(FAFF_RUN_DIR) | slug(FAFF_SESSION_ID) | "local" — the owner identity is path-encoded (subdirectory), so a corrupt/unparseable body that path-proves it owned fails closed (block) rather than fails open. --hook audits at turn-end: an owned marker whose opened_at is past the sweep TTL (FAFF_INFLIGHT_STALE_SECS, default 900s) is a corpse and is swept — keyed on opened_at age alone, never runIsHeld, so a same-scope resumer that keeps the run heartbeat fresh cannot leave a corpse un-swept and wedge turn-end; a live owned marker (recent opened_at) blocks via the {"decision":"block", reason} stdout payload; a foreign marker a live owner still holds is silent, a foreign abandoned one warns (--recover forces the block). --hook always exits 0 (the block rides the payload, never the exit code). Reuses the shared ownership/liveness precedence (runIsHeld from runcheck); pure — no tracker call. --selftest runs the pure decision + key-validation + slug tables.
resumecheck [--hook] [--json] [--selftest] [--root DIR]The sixth Stop-hook family member — the same-session release of a dead headless-resume claim. A headless claude -p '… faff lights-out --resume …' that claims the owner (owner.status:"running" + a fresh last_heartbeat + a run-resume event) then ends its turn with no work leaves a frozen-fresh claim the next --resume refuses for the whole staleness window. --hook audits the owning session's turn-end: when the run it owns (runIsOwned via the FAFF_RUN_DIR pointer; a foreign owner is never touched) is still running and the events-log tail record is that run-resume (the no-work evidence — append-only + seq-ordered makes "the tail" exactly "the only event since the resume"), it stamps owner.status running → aborted-resumable under the epoch/session fence (mutateLedgerUnderLock, so a concurrent legitimate takeover yields rather than clobbers) and appends a run-claim-abandoned audit event. It never blocks (a block leaves the corpse) and always exits 0 — the write, not the exit code, is the observable (--json prints {released, reason?, run_id?, epoch?}). The write-side never age-gates; the deadclaim grace (FAFF_RESUME_DEADCLAIM_GRACE_SECS, default 300s) lives only on the read-side backstop (classifyReEnterable's provablyDead input in lights-out --resume), which reclaims a held-but-provably-dead claim for the hard-kill case this hook cannot fire on. Pure decision core — no tracker call; --selftest runs the decision + grace-parse + read-side-boundary tables.
turncheck [RUN_DIR] [--hook] [--recover] [--json]The fifth Stop-hook family member — the state-based turn-end floor, the enumeration-based inflightcheck's complement. Where inflightcheck refuses turn-end only for an explicitly-opened per-dispatch marker, turncheck reads owner.status itself and refuses a non-terminal turn-end: an owned session ending its turn while the run is still owner.status:"running" with a clean queue (auditLedger) and no open in-flight marker for this owner — the strand class an unbracketed subprocess spawn (the spec-review fan-out) leaves that enumeration cannot see. Composes disjointly with the siblings (runcheck owns an undispatched queue, inflightcheck an open marker, turncheck the running-but-clean-and-quiet residual), so exactly one hook speaks per case. Reuses runcheck's runIsOwned/runIsHeld/auditLedger (heartbeat-only liveness; a foreign session is never hard-blocked, warned at most) + inflightcheck's owner-scope marker read (folded into the pure decision as hasOpenInflight, so the decision stays filesystem-free). The owning session forces held:false (its own heartbeat is fresh at its turn-end), so heartbeat freshness only decides the foreign silent-vs-warn split; a malformed owned ledger fails closed (block), a foreign one is silent (parity with runcheck's malformed-ledger path). --hook blocks via the {"decision":"block", reason} stdout payload and always exits 0; --recover forces the block on a foreign not-held residual. Pure — no tracker call. --selftest runs the pure decision table (its impure owner-scope resolution is covered by test/turncheck.test.mjs). Its detective half is faff disposition, which flags the same bare owner.status:"running" post-mortem.
run preflight [--repo OWNER/REPO] [--branch NAME]Read-only autonomous entry probes. Uses local config, container and host-socket detection, GitHub auth, and required-check rules on the default branch. Returns {decision,findings}. Exit 0 proceed with any warnings, 3 blocked by an explicit policy, 2 usage/configuration failure. Indeterminate GitHub auth and a present host socket warn even when other policies block. The separate lights-out floor still applies.
run checkpoint --run-dir DIR --phase prep|build|wave [--root DIR] [--session-id ID] [--json]Run beep-boop's between-units checkpoint and return one action (continue, narrow, park-issues, stop, escalate, abort, fail-closed). It runs budget check, effects check, effects reconcile-merges and sentry check, appends the budget-checkpoint, sentry-checkpoint and sentry-trip events, runs sentry abort on an acting run's abort and pumps andon. A failed, indeterminate or out-of-shape read is a fault in the direction that keeps the kill-switch armed. It parks, narrows and authors nothing: park_issues and needs_judgement are returned for the caller. Exit 0: keep dispatching. Exit 3: stop. Exit 2: usage, a missing or malformed ledger, or a run dir that is not <root>/.faff/runs/<run-id>; a caller treats exit 2 as fail-closed.
run wave-mode --run-dir DIR [--root DIR] [--converge | --no-converge] [--git-only]Read the run level and return fold for within-run filing and consult for the wave-boundary termination predicate. L4 always returns both. A git-only run always consults the predicate.
run wave-consult --run-dir DIR --wave N --budget JSONSupply fresh tracker --queue JSON with --coverage JSON or --no-prd, or --git-only with --prd PATH or --no-prd. Add --non-convergence at the fold's stall cap and the optional methodology --policy JSON. Returns the run-done verdict, reason, warnings and ID for recording the action taken.
run close --run-dir DIR --stop-reason TOKEN [--git-only] [--root DIR] [--session-id ID] [--json]Run beep-boop's run-end bracket. It refuses (exit 3, writing nothing) while an admitted issue has no outcome or an outcome is not a terminal state, except a sentry-abort close of a run carrying the abort mark, which closes and reports the issues in undispatched. Otherwise it appends the token-tagged run-end event ({stop_reason, shipped, parked}), writes stop_reason and the owner close in one locked edit (an aborted-resumable owner is kept), stops the sentry poller, runs commissaire effect reconcile then verdict conclude per admitted issue when the run is governed or the status probe cannot answer (under the abort exemption the undispatched issues are skipped, so a resume concludes them), and with --git-only runs events anchor-run, a commit limited to .faff/anchors/<run-id>/ and the run-close bundle publish; then judge-trail mint and andon pump. A failed step is a fault and the close proceeds. The stop token must be one beep-boop documents (queue-drained, all-remaining-parked, budget-hit(<dims>), budget-escalated(<dims>), sentry-abort, converged/both-dry, non-convergence, product-incomplete, governance-admit-failed). Exit 2: usage, an unknown token, a missing or malformed ledger, a run dir outside its root, a run already closed with a different token, or an owner-close write that is refused or yields (closed: false; the run-end event appended before it stays).
run open (--mode M | --adopt-run-dir DIR) [--until HH:MM] [--max N] --root DIR --session-id ID [--export | --json]Run beep-boop's run-start bracket. It mints the run with run-ledger init-self-drain (or adopts a running run whose $FAFF_RUN_DIR names it, such as a faff lights-out ledger), fills an absent owner.harness/model from harness identify, writes the budget envelope once (config plus --until/--max) with measure_root, runs budget baseline, then settles governance: commissaire contract status (30 s), contract admit when ungoverned, and admit-required on a failed admit. A failed or unparseable status probe, a required run's failed admit, or an unreachable configured governor fails closed: it writes commissaire/governance-required.json and a park event, closes the owner with stop_reason: governance-admit-failed, and only once that write lands appends a token-tagged run-end event, pumps andon and runs hooks-ensure; it starts no poller (exit 3). A refused or yielded owner close exits 2 with no run-end and no andon ping, though hooks-ensure still runs; admitted issues already on an adopted ledger are left for the caller to park. Then it runs hooks-ensure and starts the sentry poller. --export prints export FAFF_RUN_DIR=… and export FAFF_SESSION_ID=… on exit 0 and 3. Exit 2: usage, a malformed --until/budget.until or --max (nothing minted), a failed mint, a refused adopt, a flag that differs from a recorded envelope, or a ledger write the lock or schema refuses or that yields to a newer owner (the fail-closed owner close included).
run trigger [--run-dir DIR] [--root DIR] [--prd-readiness FILE | --prd-slot-unreachable] [--prd-goals FILE] [--after-plan --correlation-id ID --prd-creative-licence broad|tight --prd-root-container C] [--json]Run beep-boop's L4 run-start trigger (§0a). It classifies the inherited handoff ($FAFF_RUN_DIR): not-l4 is skip and reads nothing else, a bad handoff is fault. On an inherited L4 ledger it reads prd list/prd path, tracking.container/tracking.repo, run-outward, the prd slot's readiness block (via contract prd-readiness) and prdr coverage, coerces each to the seven run-start signals (every failed read lands on the refuse-biased value; an empty goals list is unmeasurable), spawns faff run-start for the verdict and records the creative licence with run-record-prd on drain. A present PRD with no readiness input stops at needs-judgement:prd-inputs (no kernel consulted); the skill invokes the prd slot, reads the PRD's goals, and calls again with --prd-readiness/--prd-goals (or --prd-slot-unreachable). --after-plan --correlation-id ID --prd-creative-licence L --prd-root-container C, after /faff-plot --autonomous, records the licence and root container the deciding call returned (validated, re-reading nothing) and marks plan on that call's id; a missing or invalid value is record-failed. It mints the run-outward/run-start consult ids itself and writes their action markers. Tokens: skip, fault, needs-judgement:prd-inputs, plan, drain, refuse, record-failed, recorded. Exit 0: continue as the token says. Exit 3: stop and start nothing (refuse, fault, record-failed). Exit 2: usage (no result); a caller treats exit 2, any other exit and unparseable output as refuse.
run return-map --outcome TOKENClassify a reconciled graft return. JSON reports action: terminal|merge-handoff|pre-admission, the existing bucket or null, and the existing hold annotation array name or null. A terminal bucket is also the normalized outcome value for the existing event path. Exit 2 on an unknown token. Does not read or write a run.
run summary --run-dir DIR [--facts FILE] [--root DIR] [--session-id ID] [--out FILE]Render beep-boop's run summary (<run-dir>/summary.md, or --out) from the run directory and print the same bytes. It reads the ledger and events.jsonl directly and computes unit economics, budget state, install health (faff doctor) and the ground-truth divergences (reconcileCore over an input it assembles from disk, the forge and facts.tracker) in-process, with no faff subprocess; PR numbers come from merge-record.json, then landing-loop.json, then gh through merge-gate's forge path. Only tracker reads and in-run judgements come from the facts file (format: 2, keys tracker and run), and every line built from one ends _(reported)_. A missing or malformed facts file, a failed doctor and a failed forge read each render a visible ⚠/could not read line at exit 0. Exit 2: usage, or a ledger that is unparseable or missing owner.started_at, admitted or outcomes. faff run <unknown-verb> exits 2 with a usage line naming the registered verbs. A shipped issue whose merge-record.json lists ac_called_out renders under ## Shipped (human-only ACs called out).
run reconcile --run-dir DIR --level L1|L2|L3|L4 [--facts FILE] [--root DIR] [--json]Compare the ledger and recorded merges with live PR heads or local base ancestry. Reads sibling and delivering-issue terminal observations from the format 2 summary facts file. Missing or unbound evidence produces a divergence. Exit 0 pass, 1 divergence (warn through L3, needs-human at L4), or 2 unreadable input or level mismatch. Prints the gate result, without emitting the assembled input. The pure reconcile command remains available for supplied evidence.
budget check [--until HH:MM] [--max N] [--json]Emit a run cost/compute BudgetState (spent, breached, outcome, warnings) from the ledger + config budget: + local transcripts. budget.cost prices per-model × per-class from a built-in price map, unconditionally (pricing:"map" in the resolved envelope) — a model absent from the map prices at the map's costliest known per-class rate (fail-safe overcount, named in a warning) rather than ever silently undercounting. The legacy flat budget.price_per_mtok scalar is removed — a .faff/config.yaml that still sets it is ignored (cost still prices from the map) and named in a warnings entry (naming budget.price_per_mtok_by_model as the remedy for a per-model override); it is never a hard exit here (that would fail-open the whole budget signal, see below), but faff lights-out's mint-time preflight refuses outright on the same condition (no fail-open risk there). Only a legacy ledger minted before this removal can still carry a recorded pricing:"flat" — its own baked-in figure is honoured byte-for-byte via envelopeFromLedger so an in-flight run's dollar ceiling never silently changes mid-run. A pre-change ledger with no per-model baseline pro-rates the per-model deltas from the scalar this-run fraction and warns; tokens_source:"estimate" under map pricing reports cost:null with a loud warning (no per-model data to price — never a silent flat-scalar guess). Cost warnings surface only when budget.cost is actually configured — an unconfigured cost dimension stays silent. A malformed budget.until/--until (not valid HH:MM) is never a vacuous ceiling that silently never breaches — it degrades to a warnings entry (present only when non-empty, mirrored to stderr) naming the raw value; breached never contains until for it; exit stays 0 (a hard failure would fail-open the whole budget signal for sentryReadBudget/run-done --budget, masking a real tokens/cost breach). A well-formed until resolves once, against the run origin (the earliest owner_history/owner started_at, so a resume keeps the original deadline) in that owner's recorded utc_offset_min, never against the check's own clock; spent.until_at (present only when an until ceiling is set) prints the deadline compared against. A run with no usable start anchor (none parseable, or more than five minutes in the future) treats until as reached with until_at: null and a warnings entry; a ledger minted before the offset existed resolves in the checking box's timezone and warns; with no run at all the deadline stays relative to the check's clock. This is distinct from the run's own ledger being unreadable (explicitly-named and absent, or present-but-corrupt): that is an own-fault, not a config problem — it emits {outcome:"indeterminate", indeterminate:true, reason} (zeroed spent, tokens_source:null, breached:[]) and exits 3, never silently coerced into an all-clear reading. A legitimately empty surface (no run requested, none found) is unaffected — outcome:"none", exit 0, byte-for-byte as before.
economics [--run-dir DIR] [--by class|model|mcp|day|effort] [--json]Per-run unit economics — emit a UnitEconomics JSON (tokens_total, tokens_source, price_per_mtok, pricing, cost_total, buckets, shipped_count, attempt_count, cost_per_shipped, cost_per_attempt, per_issue, zero_ship, warnings) deriving cost-per-shipped-issue + cost-per-attempt from the run ledger's terminal outcomes + budget check's transcript-summed this-run tokens. Pure, rendering-only (no tracker/network/LLM — parity with budget check/runcheck): reuses budget's exact token path (baselined at run start; estimate fallback labelled) and touches no producer (ledger/budget check/events byte-unchanged). A run resumed across epochs is one run made of several sessions, and the top-line spans all of them: economics resolves the metered session by the same precedence budget check uses (--session-id > the ledger's open-span session_id > the mint-time measure_session_id > ambient), rebaselines on the open span, and adds the ledger's closed prior-epoch session spans — so tokens_total/cost_total match budget check's spent on the same resumed run instead of reporting the resuming epoch alone. A single-session run is byte-for-byte unchanged: with no budget.sessions nothing is folded or rebaselined, and with one all-open span the same holds whenever that span's baseline_by_model_class agrees with tokens_at_start (which is what the resume writer records). Where the two disagree the open span's baseline wins, since it is the one measured against the session actually being metered. Surfaces that cannot span epochs say so rather than dropping them silently: the estimate fallback (a measured span sum is not a per-attempt estimate), the day/mcp/effort/phase axes and per_issue (a closed span retains per-model × per-class deltas only) each add a warnings entry naming the prior epochs they do not cover, and a span closed with a degraded basis (close_source other than transcript) adds a provenance warning. Every one of those warnings gates on the presence of a prior epoch, not on its magnitude, so a degraded or zero-delta earlier epoch still warns; the tokens_at_start=0 inflation warning is correspondingly suppressed on a resumed run (the total is an explicit composition, not a naive whole-session sum) and still fires on a genuinely baseline-less single-session run. The top-line prices via the SAME map + rate source budget.cost uses — pricing:"map", unconditionally, on a fresh resolve — so cost_total stays consistent with tokens_total (both this-run, baselined at run start) and with budget check's spent.cost, closing the "two cost figures" gap (which was a RATE difference — flat scalar vs the map — not a population one). The top-line prices THIS RUN's per-model delta (honouring a per-model baseline when the ledger carries one, else pro-rating); at a run-start baseline of 0 (the common single-session case) it equals the sum of --by model's priced rows. An unpriced model's tokens are excluded from the top-line (cost:null for that model's row — the existing REPORTING convention, distinct from the governor's fail-safe overcount) and named in a warnings entry, while priced models still sum. The legacy flat budget.price_per_mtok scalar is removed — a .faff/config.yaml that still sets it is ignored (the top-line still prices from the map) and named in a warnings entry; only a legacy ledger minted before this removal can still carry pricing:"flat", the legacy flat-scalar top-line, byte-for-byte. cost_* is null with no dollar column when nothing could be priced (a legacy pricing:"flat" ledger with price_per_mtok=0, or tokens_source:"estimate" with no records to price); zero_ship (0 shipped, >0 tokens) is flagged loud; attempt_count excludes routed-out/unreached-budget; per_issue is best-effort agent-*.meta.json attribution (session-owned transcripts, [A-Z]+-\d+ in the description matched to a ledger outcome), and run-level figures never depend on it. beep-boop's ## Reporting step renders the block. --by class|model|mcp|day pivots the same transcript walk into per-token-class / per-model / per-day / per-MCP-tool buckets, priced per-model × per-class from a built-in price map (living alongside budget check's own pricing logic, so both consult one source), optionally overridden by budget.price_per_mtok_by_model; an unknown model prices to cost: null in this REPORTING surface, distinct from $0 (the budget.cost GOVERNOR instead fail-safe-overcounts an unknown model — the two surfaces deliberately differ: a reporting null is honest, a governor null would be vacuously unbreachable). The class/model axes reconcile to the raw measured transcript total plus engine spend and, on a resumed run, the closed prior-epoch spans; that equals the top-line tokens_total only when the subtraction baseline is 0 (a non-zero tokens_at_start or open-span baseline is subtracted from the top line, never from the breakdown) — on a resumed run they fold the closed prior-epoch spans too (the model axis row-for-row by model, the class axis by summing each token class across models), so a model seen only in an earlier epoch still appears. day/mcp/effort/phase reconcile on a single-session run; on a resumed run they stay scoped to the resuming epoch and carry the coverage warning above rather than silently mismatching the epoch-spanning top line. --by mcp reports per-tool call_count/request_bytes/response_bytes plus a measured per-tool cache-read attribution (each billed cache_read split pro-rata across the resident context, so an MCP tool_result's share is measured, not a single global amplification factor). --by effort is the one axis that reads the run's events.jsonl (not the transcript) — reasoning-effort is a request-time setting the transcript never records, so it is captured at dispatch time on the token-tag event. It buckets dispatches by their data.effort label (severity order, plus a (none) bucket for token-bearing dispatches that carried no effort), sums the four-class token deltas per bucket, prices each at the run's dominant model (an ESTIMATE — events carry no model), and reports coverage_pct (events token total ÷ top-line) rather than forcing a reconciliation, since events only span tagged windows (source: "events"; degrades to estimate with no events log). --by X --json rides a breakdown object on the JSON; --by X without --json prints a skimmable table; the token/bucket counts stay byte-for-byte with no --by; the top-line cost_* figures reflect map pricing by default, as described above. An unrecognised axis exits non-zero naming {class, model, mcp, day, effort}. Non-leak: sizes/counts/names/model-ids/effort-labels/costs only — never transcript payload content.
disposition [--run-dir DIR] [--json] [--selftest]The run-end disposition verdict a headless (CI / cron / container) wrapper runs as its final, exit-propagating step — classifies one run dir's on-disk end state into clean vs needs-attention, so a lights-out run whose issues parked / errored / escalated exits non-zero instead of reporting green-by-silence (the write/exit side of unattended visibility, paired with audit/events on the read side). Run-dir resolution: --run-dir → $FAFF_RUN_DIR → none (an explicit --run-dir is honoured as-is, never redirected when its ledger is missing — a wrapper naming a dir with no ledger sees exit 3, not a verdict about a different run; the old "latest under .faff/runs" guess is removed outright — with the L4 drain now reusing its inherited ledger end to end, several unclosed *-lights-out ledgers can legitimately coexist, so neither flag/env supplied is exit 3, never a guess). Pure: filesystem reads under the run dir only — no tracker / network / LLM, and it writes nothing (parity with runcheck / economics / audit); reuses auditLedger + TERMINAL_STATES (runcheck) and extractParksBlock (park-history), forks none. Adds no second copy of the durable signal — per-issue surfacing (the faff-parked label + reason comment) already ships in the park protocol and the run summary.md already ships as a hard-floor artifact; this verb adds only the process-exit contract over them. Classification (the exit code depends only on run-ledger.json): outcomes parked / errored / unreached-budget / pr-open each → an issue-outcome attention item, while shipped / routed-out are clean (a PR left open is a "human must act" outcome; routed-out was never attempted — counting it would make near-every run red); an escalate-class stop_reason (budget-escalated(...) prefix, non-convergence, product-incomplete, sentry-abort) → a run-escalation item even when every issue shipped; a ledger abort entry or owner.status == "aborted-resumable" → an aborted item; auditLedger.clean == false (undispatched admitted issues, or invalid outcome tokens) → an incomplete-ledger item naming them (an abandoned/killed run reads as needs-attention independent of stop_reason adoption — fail toward attention). Cause joining (best-effort, degrade-don't-crash): each attention issue's cause is filled from the summary.md faff-parks block's root_cause_class → else the latest issue-outcome event's data → else null; a missing/malformed summary.md or events.jsonl degrades cause to null and never changes the exit code. --json emits a DispositionReport {run_id, disposition, attention[{kind, issue, outcome, cause}], counts} (the counts histogram is informational); default output is skimmable one-line-per-attention-item text ending with the disposition. Exit 0 clean · 1 needs-attention · 2 usage / malformed ledger · 3 no run dir / no ledger; --selftest runs the classifier fixture table.
quality [--run-dir DIR] [--json]Per-run quality/outcome telemetry — the quality mirror of economics. Emit a QualityReport JSON (run_id, outcomes, shipped_count, attempt_count, parked_count, park_rate, rework {total_turns, reworked_attempts, tagged_attempts, rework_rate, mean_turns}, gate_catch, per_issue, source, warnings) from the run ledger's terminal outcomes (authoritative) + the events.jsonl issue-outcome events' data.gate / data.rework_turns tags. Pure, read-only (no tracker/network/LLM — parity with economics/budget check/runcheck). Pairs with economics by sharing run_id and the exact shipped/attempt denominators (ECONOMICS_BUCKET_ORDER + the routed-out/unreached-budget exclusion), so a $/quality read is economics.cost_per_shipped beside quality.park_rate on one run — no cost is duplicated into quality. park_rate/rework_rate are over attempt_count (dispatched builds) and are null on a zero-attempt run (never 0/0); mean_turns averages over tagged_attempts (the attempts that actually carried a rework_turns tag), and a warning flags rework_rate as a lower bound when tags don't cover every attempt; gate_catch is the distribution of which quality gate {structural, adversarial, holdout, ci} caught a non-shipped build; source is ledger+events, or ledger (with gate_catch: [] and a nulled rework) when the run has no events.jsonl. --json emits the report; no flag prints a skimmable table; a missing run dir exits 2. Non-leak: outcome-names / gate-names / counts / rates only — never any finding, spec, or transcript payload.
reconcile --run-dir DIR --level L1|L2|L3|L4 [--json] [--selftest]The blocking run-end ground-truth gate — confronts each ledger shipped outcome (+ each spec-referenced, non-admitted sibling's terminal-state) with live git/forge/tracker evidence the orchestrator already gathered, never re-observed here: the verb stays pure, mirroring merge-gate's decideFloor split. runcheck audits ledger completeness; this audits ledger-vs-world ground-truth — deliberately a separate verb so runcheck's no-I/O Stop-hook purity is never touched. Reads a ReconcileInput {level, shipped[], siblings[], sibling_baseline} on stdin, emits a faff-contract:run-reconcile block {divergences, consistent, disposition}. Divergence classes: phantom-merge (the shipped issue's recorded merge-record.json head_sha != the observed merged head sha), claimed-shipped-unmerged (no merge record, or the observed PR isn't merged — fail-closed: unprovable ⇒ divergence), unowned-sibling-mutation (a spec-referenced, non-admitted sibling moved terminal within the run's window; the run cannot attribute the move to any actor), sibling-check-unproven (sibling_baseline is absent, or captured isn't strictly true: the sibling check itself did not provably run, distinct from running and finding nothing; a run-level divergence, issue: null). sibling_baseline: {captured, entry_count} defaults degraded — silence about it reads exactly as captured: false, so a caller that forgets the attestation lands in the loud branch rather than a vacuous pass; entry_count catches an internally incoherent claim (fewer entries than siblings.length) but proves omission was avoided, not that the claim is genuine. disposition is level-gated: consistent → pass; any divergence → needs-human at L4 (hard-block/escalate — the only level nothing is watching), warn at ≤L3 (surfaced, non-blocking). Exit 0 consistent / 1 divergence(s) / 2 malformed ReconcileInput or missing --run-dir/--level (fail-loud, never a silent pass); --selftest runs the divergence-class + level-gating + validate table.
reconcile-recover --run-dir DIR --issue ID --level L1|L2|L3|L4 [--sha SHA] [--json] [--dry-run] [--selftest]The merged-but-unclosed auto-close verb — a new, reconcile-adjacent, write-capable verb (never folded into reconcile/disposition, which stay pure) that closes a merged-but-unclosed run-ledger to shipped: an admitted issue absent from outcomes whose merge-record.json proves merged:true (the harness killed the orchestrator after a durable merge, before it reached the ledger close). Holds a narrowly-scoped, deliberately-recorded exception to "only the run's own agents write owner.status" — scoped by actor (this verb only), operation (owner.status running→done + outcomes:absent→shipped only), precondition (verifiably-merged AND verifiably-stale AND unclosed), and pairing (never a bare write). A thin composition, introducing no new detection/liveness/gate logic: reuses the merge-evidence reader and unclosed audit (disposition.js) and the owner-heartbeat liveness check (runcheck.js/heartbeat.js) for the verifiably-stale/not-live discriminator (the same signal the runcheck Stop hook trusts — a live run that merged seconds ago has a fresh heartbeat and is excluded), and delegates the write to the existing, single tested ledger-close writer (run-ledger record-outcome, invoked as a subprocess — never a second, forked writer). The pure admission core admitRecovery({ledger, issue, merged, held}) returns recoverable | not-merged | not-unclosed | live; only recoverable proceeds to the gate — a re-run post-merge-check against the merge's own pr/sha. verified-ok writes outcomes[issue]="shipped" + owner.status:"done" (+ an issue-outcome close event); anything else (verified-fail OR unverified/absent) blocks — a red or absent post-merge-check must block — leaving the merged-unclosed disposition item standing for a human, never masking a regression. --dry-run reports the would-be recovery without writing. Idempotent + re-entrant: a re-run after a successful recovery (or a losing concurrent recovery) re-reads not-unclosed and no-ops. Never auto-reverts/reopens, never invents a new outcome token, never edits the out-of-repo drain wrapper deployed outside this repo (in-repo reference wrappers only — operations/ci/faff-cron.sh, operations/ci/l3-watcher.yml; see docs/guide/self-hosted-rig.md). Exit 0 recovered, or not-unclosed-already-closed (idempotent clean) · 1 blocked (post-merge-check red/absent) · 2 usage / malformed input · 3 not recoverable on admission (not-merged / not-unclosed-never-admitted / live — fail-safe no-op); --selftest runs the pure admitRecovery fixture table across every admission branch (mirrors disposition --selftest); the gate+write paths are covered by dedicated integration tests exercising a real git repo (parity with post-merge-check --selftest's own build).
machine-id [--json] [--selftest]Resolve a collision-resistant per-host machine id — the source a same-box claim-reclaim fast path is gated on (thisMachineId(); a shared id across two hosts is the double-build hazard, so the source fails toward uniqueness and a bare hostname is never a source). Order: the OS machine id (/etc/machine-id / /var/lib/dbus/machine-id, or an injected platform hook on macOS/Windows), sha256-hashed so a raw host id never enters a pushed git ref; else a durable UUID minted once under <homeDir>/.faff/machine-id (above any worktree, so one host resolves one id) and reused; no hostname fallback. A placeholder / uninitialised OS id (all-zeros, uninitialized) is treated as absent → minted. Default prints the id; --json prints {id, source} (source ∈ os-machine-id | minted-existing | minted-new). --selftest runs the pure-core negative-test harness — distinct-per-host, container hostname-collision (shared hostname → still distinct), hostname-source-rejected (mints, never returns a hostname), and readable/idempotent — over a fully-injected fake filesystem, plus a real-host stability check.
run-done [--queue-empty] [--all-parked] [--ledger-clean] [--budget JSON] [--prd-coverage JSON | --no-prd] [--inflection reached|none] [--non-convergence] [--policy JSON] [--json]The terminating-condition predicate — compose faff's shipped run signals into the one decision that ends an unattended run (run-complete / continue / escalate). Pure: no tracker/network/disk beyond args, and it never calls the methodology (the orchestrator resolves the policy and passes --policy). Reimplements no signal — reads queue state + runcheck's .clean (--ledger-clean) + budget check's {breached,outcome} (--budget) + prdr coverage's prd-satisfied (--prd-coverage → .satisfied; --no-prd when no PRD is in scope). A fixed safety floor no --policy may weaken (budget-escalate → escalate; unclean ledger at drain → continue/undispatched-ledger; prd_satisfied==false → escalate/product-incomplete) precedes the policy-weighted rungs (the structural-default ladder — non-convergence→escalate, budget-narrow→continue, budget-stop→complete, value-inflection→complete, work-remaining→continue, drained|all-parked→complete — overridable by the methodology's run-termination-policy via --policy). Emits a RunDoneVerdict {verdict, reason, signals, policy_source, conformant, violations}, schemaChecked against run-termination belt-and-braces; malformed JSON → exit 2; report-only exit 0 (the verdict is in the payload).
run-ledger <init-interactive --issue <ISSUE-ID> [--root DIR] [--id RUN-ID] | record-outcome --issue <ISSUE-ID> --outcome <TERMINAL> [--run-dir DIR]> [--json] [--selftest]The standalone-interactive L2 mint — the L2 sibling of lights-out's L4 mintLightsOut. A directly-invoked /faff-graft ISSUE-XX (no beep-boop orchestrator above it) has no run dir of its own, so it mints neither the events.jsonl nor the run-ledger.json that faff events anchor (graft Step 9b) byte-copies into the committed anchor faff merge-gate reads — the anchor cannot be built and the merge floor refuses. init-interactive creates a fresh .faff/runs/run-YYYYMMDD-HHMMSS-graft-<issue>/ carrying a minimal honest run-ledger.json (level:"L2", admitted:[<issue>], outcomes:{}, a running owner, a minimal budget.envelope) + a genesis events.jsonl run-start chain, so the EXISTING anchor + gate path just works — satisfying the fail-closed floor with honest inputs, never weakening it. level is the CONSTANT "L2", written unconditionally — there is NO flag that sets/raises/lowers it (exactly as mintLightsOut hardcodes "L4"); the anchored level is the merge-gate ceiling, never operator-settable. Every chain hash (the genesis prev = SHA-256(run_id), each link, the anchor's chain-head.json witness) is CLI-computed — the caller never supplies a hash; because the run dir's basename IS the run_id, the genesis chain still verifies after events anchor relocates it under .faff/anchors/<run-id>/<issue>/. CLI-level trust guard (defense-in-depth): if FAFF_RUN_DIR (or --root's newest run dir) already resolves a live run at a level ABOVE L2 (L3/L4, owner.status:"running"), the verb refuses (exit 3) and emits a refusal observe onto that run's timeline, minting no L2 dir — an interactive L2 mint must never silently downgrade a live higher-level run, and the boundary is enforced in the deterministic CLI, not only in swappable graft prose. Bare stdout is JUST the absolute run dir path (so a caller can export FAFF_RUN_DIR="$(…)"); --json emits {proceed, level, run_id, run_dir, ledger_sha256_before:null, ledger_sha256_after}. Exit 0 minted · 2 bad --issue/usage (mints no partial dir) · 3 the live-higher-level guard. record-outcome is the honest terminal write (§4 step 6) on the interactive-minted live ledger, run at the graft terminal AFTER Step 9b already committed the immutable anchor: it sets outcomes[<issue>] = the terminal-state string (a faff events ledger-outcome vocabulary member) + owner.status:"done" under the ledger lock (which also folds a ledger-write event — belt-and-braces chain honesty), and on the shipped path appends an issue-outcome close event; because the write lands only on the live dir, the already-committed anchor stays a byte-stable pre-merge outcomes:{} snapshot. Resolves the run dir from --run-dir > FAFF_RUN_DIR > newest under --root; exit 0 recorded · 2 bad --issue/--outcome · 3 no live run dir resolved. --selftest validates the minted ledger shape + the guard predicate + the terminal-outcome edit + the genesis chain in-memory (mirrors lights-out/events).
run-ledger record-declined --issue <ISSUE-ID> --reason <TEXT> --observed-at <ISO> [--run-dir DIR] [--json]A drain records an issue it considered and did not admit (routed out, or claimed by a peer) as declined[issue] = {reason, at, recorded_at} in the live run ledger, under the same lock as record-outcome. at is the drain's observation time, so a change made after that read still counts; recorded_at is audit only. Control characters in --reason become spaces and it must be 1 to 200 characters; --observed-at may be any past time but not more than 60 seconds in the future. Exit 0 written, 2 bad input, 3 no run dir or the write failed. Read by faff drain-filter.
run-outward --target JSON [--self JSON] [--json]The signals.outward producer feeding run-start's outward-only floor — is this run's resolved target aimed outward (a non-self adopter/greenfield container) or is it self-directed (faff's own container)? Pure: no tracker/network/disk beyond args, parity with contain/run-start — the caller resolves the live TargetRef {container, repo, source} (explicit > inherited > methodology-default) and the live SelfRef {container, repo, is_self} (the repo-slug oracle: self.repo := tracking.repo, is_self := target.repo == tracking.repo) and passes both in; this CLI only decides. A fixed fail-safe ladder (first-matching-check-wins, biased toward self-directed): self.is_self===true → outward:false/self-marked; target container and repo both null → outward:false/unresolved-target; target.container non-null and equal to self.container → outward:false/self-container; target.repo and self.repo both non-null and equal → outward:false/self-referential; otherwise → outward:true/outward-adopter. Null-safety is structural — two absent containers never read as a match, and an all-null SelfRef with a resolved non-self target correctly falls through to outward:true. Emits an OutwardSignal {target, outward, reason}; re-implements no run-trigger reason (the refusal itself stays single-homed in run-start — report-only exit 0, the boolean lives in the payload, so a caller feeds .outward straight to run-start --outward|--no-outward rather than branching locally). Malformed --target/--self JSON → exit 2 (usage).
run-record-prd [--run-dir DIR] [--classify | --prd-creative-licence broad|tight [--prd-root-container C]] [--json]The narrow, lock-guarded PRD-record verb over the one inherited L4 ledger. Under lights-out, the operator mints exactly one run-ledger in cage-1 and hands its directory off via FAFF_RUN_DIR; the drain (beep-boop §0a) and a nested /faff-plot --autonomous Ignition reuse that same ledger end-to-end and never mint a second one — this verb is how a later stage writes what it discovers (the PRD's creative-licence, the resolved root container) onto that one ledger instead. --classify is report-only (parity with run-outward): resolves --run-dir (default $FAFF_RUN_DIR) through the shared classifyInheritedRunDir ladder — unset/empty → not-l4; a readable ledger whose level isn't "L4" → not-l4 (a legitimate nested-L3 run, not a fault); a readable level:"L4" ledger whose run_id matches the lights-out mint shape (run-<YYYYMMDD-HHMMSS>-lights-out(-<hex6>)?) → inherited-l4; anything else non-empty (no ledger, unparseable, or an L4 ledger that isn't a lights-out mint) → fault — and always exits 0 with the verdict in the payload, never deciding for the caller. Write mode (no --classify) validates the SAME ladder first — a fault verdict (including no --run-dir/$FAFF_RUN_DIR at all) exits 3, a not-l4 verdict exits 2 (never writes onto a non-L4 ledger) — then reuses the mint-side flag validators verbatim (prdCreativeLicenceFromFlag/prdRootContainerFromFlags, lights-out.js): an off-vocabulary --prd-creative-licence or a --prd-root-container without it exits 2. On a valid inherited-l4 target it mutates only prd_creative_licence/prd_root_container through mutateLedgerUnderLock (heartbeat.js) — every other field byte-unchanged — fenced by {epoch, session_id} read from the validated ledger's own owner (never the caller's environment), so a concurrent --resume takeover makes the write yield (exit 4, nothing written) rather than clobber a superseded owner's ledger. Idempotent: re-recording the same values is a byte-stable no-op, still exit 0. Exit 0 written/no-op (or --classify report) · 2 bad flag value / not-L4 ledger · 3 no ledger resolvable · 4 owner-epoch fence yielded. --selftest covers the classifier ladder + the record core (incl. the fence) in-memory.
run-start [--signals JSON] [--target-resolved|--no-target-resolved] [--outward|--no-outward] [--prd-present|--no-prd-present] [--prd-ambiguous|--no-prd-ambiguous] [--prd-admissible|--no-prd-admissible] [--coverage-measurable|--no-coverage-measurable] [--coverage-covered|--no-coverage-covered]The run-start trigger predicate — the mirror of run-done (run-done ends a run failing toward escalate; run-start opens one failing toward refuse). Composes faff's shipped run-start signals — target resolution + the outward-only read (signals.outward, the container mechanism supplied elsewhere) + prd-readiness admissibility + prdr coverage's .covered — into the one decision that opens an unattended run (plan / drain / refuse). Pure: no tracker/network/disk beyond args, reimplements no signal (each arrives as a passed-in boolean via --signals JSON and/or per-signal flags, a flag overriding the bundle). A fixed refusal-biased ladder (first-failing-check-wins): target empty→refuse/no-target; inward (outward==false)→refuse/self-directed (before PRD checks); multiple Active/Frozen PRDs→refuse/prd-ambiguous; no PRD present→drain/no-prd-nothing-to-plan; prd-readiness not admissible→refuse/prd-inadmissible; coverage unmeasurable→refuse/coverage-unmeasurable; covered==false→plan/coverage-thin; covered==true→drain/prd-covered. The ordering is load-bearing — the outward floor precedes the PRD checks so inward+no-PRD is self-directed while outward+no-PRD is a benign drain. Fail-safe: any non-true signal coerces to false, so a malformed/empty bundle derives refuse/no-target and the privileged plan is unreachable unless every affirmative signal is explicitly true. Emits a RunTriggerVerdict {verdict, reason, signals, conformant, violations}, schemaChecked against run-trigger belt-and-braces; malformed --signals → exit 2; report-only exit 0 (the verdict is in the payload). Validated consumer-side by contract run-trigger (Pattern-B — it re-derives {verdict, reason} from signals and rejects a hand-altered verdict).
audit <run-id> [--root DIR] [--issue ISSUE] [--json]Read-only run-reconstruction forensics view — joins the three substrates a finished run leaves on disk (events.jsonl timeline + run-ledger.json final state + .faff/provenance/<ISSUE>.json intake proofs) into one who/what/why reconstruction: per-run lifecycle (started/ended/duration/complete/phases/owner), one rollup per admitted-or-evented issue (provenance via/initiated + its events in seq order + ledger outcome + park cause), a budget summary (ledger envelope + tokens_at_start + budget-checkpoint events — never live-recomputed), a supervision summary (sentry-checkpoint events in seq order + last_intervention — proof a faff sentry check consult ran at every between-units checkpoint; 0 checkpoint(s) / last intervention: — on a legacy run with none), a coherence block (reuses auditLedger for undispatched/invalid + adds events↔ledger mismatches + missing substrates + a containment recompute — see below), and a durable judge-trail SECOND source — `recon.durable_judge_trail: {available, records[]
judge-trail mint --run-dir DIR [--root DIR] [--json]The durable, interrogatable spec-review judgement trail WRITER. Best-effort: at run close, copies each issue's on-disk spec-review scratch material (round-<n>.json objections, judge/ledger.json + judge/ruling-<pid>.json rulings, judge/admit-result.json, the on-disk/ledger-fallback spec text) VERBATIM — never re-derived, never re-judged — into a per-issue subtree, computes a manifest.json with a CLI-computed witness_sha (sha256(canonicalJSON(manifest_core))), assembles one tree via a temp index + write-tree (real nested subtrees from slash-containing paths — git mktree alone only builds flat trees), commits it (no parent), and writes/pushes it to the dedicated custom ref refs/faff/judge-trail/<run_id> per the resolved bundle_store (local → git update-ref; git-remote → a non-force push to origin). Opens no PR, triggers no CI (a custom ref, never refs/heads/*), and survives run-dir cleanup — an additive sibling to the PR-only committed-anchor rule, covering exactly the parked/errored case that never reaches a PR. Write-once: a re-run of the same run_id (local ref already exists, or a non-force push loses the race) is a clean, logged no-op — never a force-update. A run with no judgement material anywhere mints nothing (exit 0, clean no-op). Exit 0 on mint or clean no-op; non-zero is logged by the caller (faff-beep-boop's run-close bullet) and never gates run close, a merge, or a park.
judge-history [--issue ID] [--run RUN_ID] [--lens L] [--outcome O] [--root DIR] [--json]The reader core for the durable judge-trail — the single reader faff audit's durable second source also consumes (via self-spawn, see the audit row). Enumerates refs/faff/judge-trail/* via git plumbing only (for-each-ref / ls-remote + fetch --no-tags + show per the resolved bundle_store) — no working-tree checkout, ever. Per record, recomputes witness_sha from the manifest's own bytes using the same canonicalJSON the writer used and compares against the stored claim — the store's own claimed hash is never trusted (mirrors bundle.js's classifyBundle recompute-per-read discipline); a mismatch, a missing manifest, or an unparseable one all render tamper_suspect:true with the record retained, never dropped and never an error exit. --issue/--run filter early (before manifest reads); --lens (intersects the manifest's lenses set) and --outcome (admit|park|error|no-judge) filter the assembled record set. No refs at all → an empty set ([] under --json), exit 0 — not an error.
park prepare|finalize [--root DIR]Takes park facts on stdin. Prepare freezes the caller-assigned transition and fingerprints an eligible cited config file. Finalize consumes fresh effect observations, returns the next connector action or folds a completed fact into the caller-owned accumulator.
park-history --now ISO [--issue ID]Deterministic repeat-park counts over .faff/runs summaries (≥3 same root-cause class in 21d).
park-reconsider --selftestThe git-only Unpark decision + write contract shared by the autonomous resume-reconsider pass and the interactive /faff-prep re-invoke. The pure classifyReEntry re-entry decision — a machine park whose single repo-root config-file cited input has a demonstrably changed content fingerprint since park reconsiders; every other input fail-closes with a specific reason (human-park / no-cited-input / no-stored-fingerprint / ref-outside-repo-root / fingerprint-unreadable / clock-not-advanced / input-unchanged). Symlink-safe repo-root confine (realpath containment, the model ported from spec-judge-casefile.js). The shared apply_git_only_unpark helper, parameterised by ledger-write authority: own-live-run (autonomous) clears the run's parked outcome via mutateLedgerUnderLock first, then the marker, refusing on lock/yield/malformed; cross-run-readonly (interactive) writes only the marker, refusing on a still-live or malformed earlier run — never a bare disposition strip. An internal compute/selftest surface with no operator unpark side effect (the seams call the helper directly); --selftest runs the reason-table fixtures. Pure decision + confinement; the one write is the marker + (own-live-run) its own ledger/events.
worktree ensure --issue ID --mode interactive|autonomous --slug SLUG [--tracker-branch NAME] [--labels JSON] [--run-dir DIR] [--root DIR] [--json]Graft's Step 3 worktree provisioning as one command. Finds or creates the issue's build worktree by composing worktree-check, worktree-heal, build-progress read, resume-store restore, conventions mine/get branch_naming, the worktree-root resolver, and the bundled setup-worktree.sh (a project scripts/setup-worktree.sh wins) and remote-diff-base.sh. It makes no tracker call: graft passes the tracker's branch hint and, for the resume-store hold check, labels from a fresh read. Prints one object: {issue, disposition, mode, cause, resume_at, wt, branch, base_ref, behind, setup_script, graft_skill_dir, resume, detail, warnings}, every key on every result; a fresh result adds base_sha, the new worktree's HEAD (the commit it was created from; null with a warning when unreadable). On a fresh result base_ref is the pinned FAFF_WORKTREE_BASE_REF, else the bundled script's base resolved before it runs (origin/<default>; git-only, the root checkout's branch or HEAD), else null with a warning for a project script. disposition: ready (continue by resume_at), hand-over (interactive: a state the human resolves), parked (autonomous: the same states), needs-human (a hold label with an unusable store, or a conflicted rebase that could not be aborted), claimed-by-peer (the store is busy). mode / cause / resume_at on ready: reused/worktree-fresh/existing; rebased/stale-rebased/existing (a stale worktree rebased in place onto base_ref); healed/clobbered-healed/existing; resumed/checkpoint-match/gate (autonomous: a build-complete checkpoint whose diff hash matches the remote three-dot diff; the worktree is recreated from the verified branch, never resetting a local branch); resumed-from-store/store-restored/gate or review (a hold label and a valid resume store; resume carries the store's {cause, dialogue}); fresh/no-worktree, checkpoint-mismatch or store-mismatch/start. Blocker causes: rebase-conflict (autonomous aborts the rebase; interactive leaves it in progress), rebase-abort-failed (autonomous: the abort itself failed), heal-failed, uncertifiable:<reason>, setup-script-unresolvable, setup-refused (a fresh create, before any script runs: detail.reason path is a symlink or path already exists with detail.path, by the flattened branch name; remote branch exists with detail.branch naming the matched ref, or a list when both the flattened and the real name match; remote branch check failed with detail.exit, fail closed), setup-failed, resume-base-unresolvable, resume-branch-diverged, resume-recreate-failed (including any file or symlink already at the recreate path), worktree-missing, root-outside (autonomous parks on every path, reuse included; interactive stays ready with a warning), store-missing, store-restore-failed:<exit>, store-busy. A resume store on disk with no hold label is a warning (detail.store_path), never read. Every disposition exits 0; exit 2 is a bad invocation (a missing flag, a slug outside ^[a-z0-9]+(-[a-z0-9]+)*$, autonomous mode with no --run-dir/$FAFF_RUN_DIR, a missing or unparseable --labels when the hold check is reached, an unresolvable label configuration at the hold check, or an unreadable repo root), always before any worktree is created.
worktree checkpoint --issue ID --branch NAME --run-dir DIR [--head SHA] [--build-complete push|git-only]Run from the build worktree. With --head alone, verify the durable branch and save its three-dot diff hash for resume. Build completion pins the current commit, honours graft.push_at_build_complete, and pushes the feature branch to origin only in push mode. On a governed run it declares the push before publishing and observes it after success. A failed verification preserves the previous checkpoint.
worktree-check --issue ID [--root DIR] [--behind-threshold N] [--json] [--selftest]Is a REUSED worktree's base still current with the fetched remote default branch? Locates the issue's worktree via the same worktree-prune.js matcher (ownMatches/tokenMatch, imported not reimplemented — no issue-id prefix collision), resolves the comparison base by shelling remote-diff-base.sh (the one fail-loud base resolver, never a second one), and counts behind = git rev-list --count <branch>..<base> — how many default-branch commits merged since the worktree forked. Exit 0 fresh (behind <= threshold, default threshold 0 — even one missed merge is stale by default), exit 1 stale (prints {issue, worktree_path, branch, base_ref, behind, threshold, stale} on --json), exit 2 cannot certify — prints {issue, error, reason} on --json, reason one of no-worktree (nothing to reuse — the only exit-2 cause safe to fall through to a fresh create), clobbered-recoverable (an orphaned issue-owned checkout survives but its .git/worktrees/<id>/ admin metadata was pruned out-of-band while its branch ref lives; JSON additionally carries worktree_path, branch, admin_id — heal it with worktree-heal, then re-check), ambiguous-match, no-branch, base-unresolvable, unreadable-behind, or git-unavailable (the certify-failing causes mean a worktree for this issue already exists and cannot be certified — never fall through to a fresh create against an already-checked-out path). Never a false fresh. --selftest runs the pure classifyWorktreeStaleness table.
worktree-heal --issue ID [--root DIR] [--json] [--selftest]Self-heal a graft worktree whose .git/worktrees/<id>/ admin metadata was pruned out-of-band while its checkout dir + branch ref survived (the recovery half of the scoped-prune surface). Probes for the clobber with the same fail-safe detection worktree-check reports (detectClobber, symmetric exactly-one guard on both the issue-owned checkout directory and the branch ref whose slash-flattened name maps to that checkout — the branch is bound to the checkout's path, never the issue token, so a stale same-token branch can never drive a wrong-branch heal); recreates the three admin pointer files (gitdir/HEAD/commondir) then runs git worktree repair and VERIFIES (checkout on the correct branch, resolvable HEAD, and repo-side re-registration in git worktree list). Exit 0 healed (working-tree content preserved; JSON carries worktree_path, branch, admin_id), exit 1 repair did not restore a tracked working worktree, exit 2 nothing to heal (no finding, incl. ambiguity → fail-safe no-op) — also the idempotent re-run path once healed. git worktree add is never used to adopt the surviving dir. --selftest runs the pure bindClobberFinding table.
worktree-prune [--own PATH] [--branch B] [--issue ID] [--run-dir DIR] [--dry-run]Scoped, fail-safe prune of only this run's own dangling worktrees — never the repo-wide prune that clobbers a live peer. On a governed run, --run-dir DIR (with --issue) records a schema:2 branch-delete declare/observe pair at step worktree-prune covering each removed admin dir — DETECTED, never prevented (a record-append failure never gates the prune); a dry-run, ungoverned run, absent --run-dir, or zero-removal writes nothing.
worktree-root [--assert PATH] [--root DIR] [--json] [--selftest]The single canonical worktree-root resolver + containment assert. Prints the resolved root (precedence FAFF_WORKTREE_ROOT → worktree_root → ~/.faff/worktrees/<basename(repoRoot)>; env/config verbatim, only the default appends <repo>). --assert PATH exits 0 iff PATH is strictly under the resolved root, else exit 1. The one source the setup-worktree hook, the lights-out preflight, and the graft worktree assert all call so they never drift.
review-target [--resolve|--guard] --issue ID [--run-dir DIR] [--root DIR] [--json] [--selftest]Resolves the correct explicit review target for a build under a worktree lane, so a forked ad-hoc /code-review with no target never silently reviews the harness session's ambient (main-checkout) cwd instead of the actual build diff. --resolve (the default) matches the issue's worktree via worktree-prune.js's own token matcher (never a second one), resolves the ref-to-ref base by shelling remote-diff-base.sh, and prints pr:<n> when gh pr list --head <branch> --state open finds an open PR, else --path <wt> --base <base> --branch <branch> pre-PR. --guard compares the AMBIENT cwd's HEAD branch against that resolved branch-under-build: exit 0 on a match, exit 0 (no-op) when no --issue is given at all (nothing to guard), exit 1 naming the correct target on a mismatch. Fail-safe: once --issue is given, an unresolvable target (no-worktree, ambiguous-match, no-branch, base-unresolvable, git-unavailable) always exits 2 (refuse) for both modes — never a silent pass. --selftest runs the pure formatTarget table.
stage-guard --worktree <dir> --mode assert|filter [--json]Build-safety staging guard — a filename-class secret check over the current git index, not a content scanner (content scanning is out of faff's concern — that is a repo's own pre-commit / CI). The primary defence is allowlist selective staging (git add -u + explicit named paths, never git add -A); this is the cheap backstop. assert exits 1 if any staged path is secret-class (.env/.env.*, *.pem/*.key/*.p12/*.pfx/*.keystore/*.jks, id_rsa*/id_dsa*/id_ecdsa*/id_ed25519* but not *.pub, .netrc/.pgpass/*.pgpass, credentials/credentials.json, .npmrc, .pypirc; *.example/*.sample exempt), 0 when clean — for the precise build commit. filter always exits 0, git restore --stageds each secret-class path and reports it — for WIP-preservation commits (sentry-abort, member-park) that must stay resumable. Pure git-plumbing (no tracker/network); the shared lib bin/lib/stage.js is the single home both sentry.js and the graft/concurrency prose route through. --selftest runs the classification table.
sentry <check|abort> [--run-dir DIR] [--forbidden-side-effect] [--authority available|channel-D-only] [--issue ID] [--signal NAME] [--worktree PATH] [--json] [--summary-md FILE]Live-run derailment detection + the hard kill-switch (the supervisory lane). --summary-md FILE (check only — abort ignores it) renders the same verdict as a markdown summary appended to FILE, mirroring governance-check --summary-md (the verb owns rendering, so a local readout and a CI job summary never drift); composes with --json rather than gating it, and a write failure only warns on stderr — it never changes check's exit code or verdict. The indeterminate (exit 3) path writes no summary. check READS a live run's append-only surface — events.jsonl + run-ledger.json + the effective heartbeat (the dedicated heartbeat file overlaid over the legacy owner.last_heartbeat field) + a consumed faff budget check child call — without mutating it, and emits a DerailmentVerdict {signal, severity: warn|trip, evidence} per trigger plus the chosen intervention (continue / surface / pause / correct / abort; surface is the softest trip-response, a run-scoped log+/faff-wtf write that never parks an issue and never escalates). Sentry-2 Channel A: correct sits between pause and abort and is reachable only when authority is available — derived from a child call to corrective-integrity --consumer corrective (never a direct require, so this stays a pure governance span), fail-safe to channel-D-only on any non-OK child; only fix-review-thrash's mapped pause ever upgrades, every abort route is unchanged. --authority is a hermetic test-only override seam (explicit-flag-only, mirrors --budget-json/--now-ms) — production never passes it. v1 signals: budget-breach (consumes faff budget check's {breached,outcome}, no own counter), wall-clock-runaway (heartbeat staleness beyond the window OR run-elapsed beyond the ceiling; evidence names `heartbeat_source: "heartbeat-file"
sentry-poller <start|stop|status|run> [--run-dir DIR] [--interval-secs N] [--json] [--root DIR]The primary detached watchdog locus. Every sentry check consult elsewhere in the CLI is cooperative — it only runs when the supervised orchestrator volunteers control at a between-units checkpoint. This is the locus that does not depend on that cooperation: a mint-scoped, detached, unref'd child process that loops the unmodified sentry check/sentry abort CLI on a fixed interval (default 90s, ~1/10 of the 900s staleness window), so a wall-clock-runaway orchestrator that stops reaching checkpoints is still caught from outside its own control flow. It carries no detection math of its own — every verdict originates from a sentry check child call — and its only ledger-writing action is the existing sentry abort child (ledger-mark cancellation only: no code path here ever sends a real signal to any PID). start is idempotent on a live pid (process.kill(pid, 0) probe), clears a stale stop sentinel, spawns detached+unref'd, and writes the handle sentry-poller.json {pid, started_at, interval_secs} atomically (tmp+rename); exit 3 no run dir/ledger resolves, 2 on a bad --interval-secs (integer ≥ 1). stop writes the sentry-poller.stop sentinel — race-free, no kill signal ever sent — and exits 0 once a run dir resolves (including when no handle exists); the poller exits within one interval. status reports {running, pid, started_at, interval_secs} from the handle plus a liveness probe ({running:false} when no handle). run is the internal foreground loop start spawns (documented for completeness; prose never calls it directly) — each tick: a stop sentinel or a gone run dir exits immediately; owner.status leaving "running" self-stops (the backstop that bounds orphan-process risk if the sentinel never arrives); a mint-scoped action — the ledger's level === "L4" — runs sentry abort on a tripped:true/intervention:"abort" verdict and appends one sentry-checkpoint event (never per-tick); a non-L4 run (or a pause/correct intervention, at either level — an anti-pattern the poller deliberately never acts on) only logs advisory-trip and keeps polling, mirroring the existing "the consult always runs; acting is mint-scoped" rule; a sentry check own-fault (exit 3 / unparseable output) logs indeterminate and keeps polling — never coerced into an abort — capped at 20 consecutive faults (fault-cap-exit) so a permanently broken surface doesn't poll forever. All tick telemetry lands in the append-only sentry-poller.log (best-effort — a log-write fault never blocks or terminates the loop). This is the codebase's first detached spawn (every other child call is a blocking spawnSync). --selftest drives the pure tick-decision core over the full dispatch table (sentinel / dir-gone / ledger-fault / owner-status / L4-abort / non-L4-advisory / pause / indeterminate / fault-cap) plus --interval-secs validation, with no filesystem access and no real child process.
sentrycheck --hook [--root DIR] [--selftest]A cheap assist watchdog locus — the third member of the Stop-hook family alongside runcheck/prepcheck, a staleness-triggered sentry check consult with zero new detection math. Every faff Stop hook fires on every session's turn-end and looks at the newest run ledger; this reuses runcheck's ownership/liveness gate verbatim (the same env/session-id ownership match, heartbeat-only liveness with the dedicated heartbeat file overlaid first — the recorded owner pid is never consulted) and consults only on the exact foreign + owner.status:"running" + not-held case — the abandoned-looking run runcheck --hook already warns on. Owned, held (a live foreign owner), not-running (done / aborted-resumable / a legacy no-owner ledger), no run dir, and an unreadable ledger all fast-path to a silent exit 0 with no child spawned — a per-turn-end child on every session's Stop event would be unacceptable hot-path cost, and an owned run is already covered elsewhere. On a genuine consult it spawns exactly one faff sentry check --json --run-dir <dir> child, bounded at a 10-second timeout (the same child-spawn pattern the budget consult uses) — tripped:false stays silent (sentry's verdict is authoritative); tripped:true writes one non-blocking stderr [warn] line naming the run id, the tripped signal(s), the intervention, and both remedy commands (faff sentry check / faff sentry abort); a consult failure (timeout, spawn error, unparseable stdout, or a clean exit-3 indeterminate reply) writes a distinct non-blocking notice instead of silently swallowing the fault. Advisory-only at every level, including L4 — acting (sentry abort) is mint-scoped and belongs to sentry-poller (this hook has no --worktree to commit WIP against, and a non-owner never writes a foreign run's ledger); the module contains no call to sentry abort and performs no ledger write. --hook mode always exits 0 and never emits a stdout decision payload — a foreign run's state must never make an unrelated session un-exitable, the exact silence discipline runcheck --hook/prepcheck --hook already honour. --selftest runs the pure gate table (owned via both ownership signals / held / stale-running / done / aborted-resumable / legacy no-owner / unparseable heartbeat / a shrunk staleness-window override) plus the consult-outcome classifier table (tripped / ok / indeterminate / spawn-error / timeout / unparseable-stdout / unexpected-exit-code).
lights-out [--check] [--until HH:MM] [--max N] [--slot-unreachable review|spec_review …] [--id RUN-ID] [--json]The L4 lights-out entry point — "leave the building" as one enforced action instead of a hand-assembly of flags. Runs a fail-closed basic preflight over the launch preconditions, then on pass mints a strict-defaults L4 run-ledger and persists a banner; on any miss it refuses (mints nothing, emits no work). The preflight: container-check must be contained (warn→block on this path only — the cage is the container's job, faff never self-grants --dangerously-skip-permissions); the review + spec_review slots must be reachable (configured-but-unreachable counts as absent — the second-opinion gate must never silently pass+skip); a spend/time budget ceiling must be set — budget.cost (dollars) is the recommended default L4 governor: it is priced per-model × per-class from a built-in price map, unconditionally (the map always has SOME price, including a costliest-known-rate fallback for an unpriced model), or budget.tokens / budget.until / --until — a count-cap (max_attempts) alone is refused here because a tally is not an L4 governor (it may ride along only as an extra backstop); a .faff/config.yaml that still sets the removed legacy budget.price_per_mtok scalar refuses outright on its own gate budget-price-per-mtok-removed naming the raw value (no fail-open risk at mint time, unlike budget check's warn-and-ignore posture), and the minted run-ledger envelope defaults at_ceiling: escalate when config leaves it unset (an explicit value is honoured verbatim); a malformed budget.until/--until (not valid HH:MM) refuses on its own gate budget-until-invalid naming the raw value — this fires regardless of any other ceiling set (a run must never mint a ledger carrying malformed until), and when the malformed until is the run's only ceiling, budget-ceiling fires alongside it too (each names its own remedy); a token-dependent ceiling (budget.tokens, or an armed budget.cost) additionally requires the budget meter to be measurable (transcripts readable), not merely configured — estimate-only metering (transcripts unreadable) refuses on gate budget-metering by default, or under the explicit opt-in budget.on_estimate_only: warn proceeds with a loud DEGRADED banner line + a degrades[] JSON entry and records budget.metering: {source_at_mint, degraded} in the minted ledger (an until-only/count-only governor is a clock and never gates on this); all 8 shipped guardrail contracts — admissible --lights-out, the spec-review-verdict contract, run-done, budget check, events, sentry, holdout/prdr coverage, container-check — must pass a genuine reachability probe (not a config read), each marked live/degraded/absent in the ledger's armed map (the banner is derivable 1:1 from it); and the floor assertions hold. The floor is a checked/static split the banner labels per entry: worktree_isolation is a genuine runtime check (the resolved worktree root must be strictly outside the repo working tree and creatable/usable — a writable nearest-existing ancestor — probed side-effect-free with no mkdir), rendered checked; no_execute and autonomous_contract are static invariants of the shipped code (nothing external can runtime-verify "the runner derives no command from free text"), rendered static — the loop still fails closed on any non-true value, but the surface no longer presents a static invariant as a live check. Beyond those single-dial checks it runs a dial-coherence pass over the assembled dial tuple (slot occupants + gates.fallback), refusing combinations that pass every individual check but are jointly reckless for an unattended run — a non-adversarial review/spec_review occupant (dial-coherence:adversarial-review / -adversarial-spec-review) or a gates.fallback that is not fail-closed (dial-coherence:gates-fallback); a vetted level-recipe short-circuits it as coherent-by-construction, and it is fail-closed on the unknown (appetite is out of scope — L4 forces appetite: full). The banner additionally reports each guardrail on two static axes, recorded in the ledger's enforced and rechecked maps. Enforcement — reachable (its contract answers the probe) vs enforced (a shipped orchestrator step actually invokes it) — so a guardrail that is wired-but-never-called reads reachable-only, never a bare live. Recheck (`rechecked:yes

Provenance & control labels​

SubcommandWhat it does
intakecheck <issue> [--labels csv] [--interactive]Intake-provenance guard — did the ticket enter through a sanctioned front door? (reads the CLI-written .faff/provenance/<issue>.json marker).
intake-record <issue> --via jot|backfill|fast-trackWrite/update the provenance marker + emit the descriptor (migration / orchestrator tool, not the human steady-state remedy).
labels [--names]Print the canonical faff control-label manifest (JSON; --names for bare names).
label add|remove <issue-id> <label>Emit a faff-contract:label-op descriptor for a control-label mutation the agent performs via MCP — pure, no tracker I/O; refuses the tracker-owned eligibility labels.

Contracts, schemas & quality​

SubcommandWhat it does
contract <name> [--in FILE] | [<name>] --describe [--json]Per-slot contract script: extraction JSON in → canonical contract data out. --describe is a read-only rendering branch — no stdin, no validation — that prints the contract's prose semantics (purpose, enum values + meanings, coercion/fail-direction, envelope, producer notes) generated from the SAME describe data bound by reference to the validation enums below, so the described and validated values can never drift apart; --describe --json emits the same data as JSON; an unnamed --describe prints the one-line-per-contract index. --json without --describe, or --describe combined with --in, is a usage error (exit 2) (spec-readiness, review-verdict, quality-gates, delivery-outcome, prd-readiness, prdr-admission, adr-admission, prdr-yagni, prd-coverage, run-termination, spec-review-verdict, architecture-proposal, env-handle, holdout-verdict, post-merge-verification, ci-triage, bundle-verdict); exit 0 conformant / 1 non-conformant / 2 fail-loud. The adr-admission contract validates faff adr admit's computed verdict {disposition, authority{actor,supersedes_provenance,by_level}, challenge{ran,outcome}, ratchet{lineage_supersessions,breached}, reasons[], violations[]} — the PRDR two-gate admission pattern ported onto the ADR axis, with the PRD-specific upper/lower value gates replaced by one folded challenge (drift-review) gate: an admit disposition MUST satisfy challenge.outcome==survived ∧ by_level==ok ∧ ¬ratchet.breached ∧ ¬(actor==loop ∧ supersedes_provenance==human), else it is a violation (exit 1); an out-of-enum disposition/actor/supersedes_provenance/by_level/challenge.outcome is fail-loud (exit 2), never coerced toward admit. The architecture-proposal contract validates the architecture slot's proposal envelope {chosen_architecture, rationale, adr_candidates[], assumptions[], recommendation}: a bad recommendation (∉ build/buy/hybrid) or empty chosen_architecture/rationale is a violation (exit 1); a non-object is fail-loud (exit 2). The env-handle contract validates the env slot's provisioned-environment handle {status, endpoint, endpoints?, health_checks[], readiness?, teardown_ref, teardown_cmd?, credentials?, provisioned_at, provisioner, violations}: a pure function over the handle object (no I/O) — exit 0 only when the handle is conformant and status: ready; a non-ready status (provisioning/failed/terminated), a bad status enum, a missing required field, or a ready handle with no endpoint or no health_checks are violations (exit 1); a non-object is fail-loud (exit 2). The holdout-verdict contract validates the evaluator slot's code-blind verdict {aggregate, code_blind, criteria[{class, verdict, evidence_present}], violations}: exit 0 only when code_blind: true, every prose criterion is needs-human (the machine never judges a non-born-verifiable criterion), every met/unmet carries evidence, and the aggregate matches the derivation from the criteria; an out-of-enum aggregate coerces to needs-human (never meets-spec) at exit 1; a non-object is fail-loud (exit 2). The post-merge-verification contract validates faff post-merge-check's computed verdict {verdict, command, basis, violations}: an out-of-enum verdict coerces to unverified (never verified-ok — never guess green); a verified-ok/verified-fail verdict carrying no command, or any verdict carrying an empty basis, is a violation (exit 1); a non-object is fail-loud (exit 2). The ci-triage contract validates faff ci-triage's computed TriageVerdict {pr, head_sha, transience, fault_domain, origin, action, evidence, violations}: action is always recomputed via deriveTriageAction(transience, fault_domain, origin) — a caller-supplied action that disagrees with the derived one is a violation, never trusted as-is; an out-of-enum transience/fault_domain/origin each coerce to unknown (never guessed toward a merge-eligible value); a non-object is fail-loud (exit 2). The bundle-verdict contract validates faff bundle verify's computed six-value verdict {verdict, identity, cause, superseded_by, violations}: an out-of-enum verdict coerces to VERIFICATION_UNAVAILABLE (never CLEAN — never guess clean); a malformed identity/superseded_by (bad charset, missing field, a run-close boundary_kind paired with a non-run-close boundary_key) is a violation, not fail-loud; verdict: STALE with a null superseded_by, or a non-STALE verdict with a non-null superseded_by, is a violation; a non-object is fail-loud (exit 2).
conventions <mine|get|show> [<key>] [-d DEFAULT] [--json] [--root DIR]Repo-convention discovery — the third "repo archaeology" leaf beside profile/gates. mine is the default conventions-acquirer: a deterministic, read-only scan of standards docs (CONTRIBUTING*/AGENTS.md/CONVENTIONS*/.github templates/docs/**/{contributing,style}*, fixed scan order, first confident hit wins) then git history (git log/git for-each-ref, read-only), emitting one faff-contract:conventions block for branch_naming / commit_subject / pr_title (--json for raw JSON); writes no files (the orchestrator persists .faff/conventions.json). get <key> is the single resolver every consumption site calls, in precedence order explicit conventions.<key> config > a standards-doc statement > a discovered CI gate that already enforces the convention (gate beats style, never re-inferred) > history-inferred (adopted only when one scheme's share of classified samples is ≥ conventions.history_dominance, default 0.7, over a ≥20-sample floor) > the faff default (issue-slug / conventional / conventional respectively) — always exits 0 with a value, -d DEFAULT overrides the vocabulary default only when resolution genuinely fell to that tier. show prints the effective set (.faff/conventions.json ⊕ conventions:), exit 3 when never mined and no override is configured. An out-of-vocabulary discovered or explicitly-configured scheme is treated as no-signal for its tier and falls through — never invented.
gates <discover|run> [--json] [--budget-secs N] [--resume] [--clear-progress]Cost-ordered engineering-quality gate ladder — discover/run the repo's own declared cheap checks (pre-commit / package.json / Makefile / executable test and lint runner files in script/, scripts/ and bin/, matched by name only / .github/workflows/*.yml — the CI source is a run:-line scan against a curated recognised-runner allow-list, so a CI-only repo resolves discovery: confident; local sources win dedup) cheapest-first, fail-fast, emit a faff-contract:quality-gates block. run --budget-secs N (1 to 480) or run --resume (budget from gates.run_budget_secs, default 420) runs the ladder unit by unit (a rung, a pool file or a shard) against a wall-clock budget: when it runs out with units left, the call saves progress to .faff/gates/run-progress.json, prints no contract block and exits 3, and the next --resume call skips the units already done on the same tree and plan. run --clear-progress deletes that file.
engine call --lane methodology|intake --system FILE --user FILE [--root DIR] [--run-dir DIR]One-shot local-engine dispatch for an engine-valued pure-data-in lane. Resolves dispatch.<lane>.model = engine:<name> against the top-level engines: map (provider / model / host / api_key_env indirection — the env var name, never the key; provider families: the openai-compatible aliases, or codex; anthropic refused — that's what the Agent-token vocabulary is for). The HTTP family runs a preflight (openai /v1/models — engine-unreachable and model-not-served are distinct named exits), then one non-streaming completion (openai /v1/chat/completions). The codex family is a spawn transport instead of an HTTP POST: it takes bin_path (no host) and auth: subscription-seat | api-key, probes the seat with codex login status, then spawns codex exec --json --ephemeral --skip-git-repo-check --sandbox read-only -m <model> - with the prompt on stdin and a throwaway temp cwd removed afterwards, parsing the JSONL event stream after exit and taking the last agent message as the producer block. Either way stdout is the completion text (the producer output). --run-dir binds the dispatch's measured spend to a run (written to <run-dir>/engine-spend.jsonl); a sink fault warns and never changes the exit code. Fail-loud and terminal: no retry, no fallback chain — the caller surfaces/parks and never re-dispatches on the session model. The lane allowlist (methodology | intake) is enforced at dispatch and at config read. A graded dispatch.<lane>.effort on an engine whose family has no graded reasoning-effort transport is refused, naming the key it came from; on a graded family it is carried, and xhigh / max clamp to high with a stderr note. The lane's model and effort resolve from dispatch: directly. exit 0 ok · 2 usage/config fault · 4 model-not-served · 5 engine-unreachable · 6 auth-failed · 7 malformed-response. The codex family reuses that taxonomy: a missing binary, an unusable temp cwd, a child timeout or a non-auth child failure all exit 5; not being logged in, or an auth-shaped child failure, exits 6; an unparseable event line or a run that produced no agent message exits 7. Treat exit 7 on a run you have manually confirmed as good as the signal that codex's event serialization has drifted — the flag and event shapes are pinned from codex-rs source rather than observed output, and want re-pinning against a live binary.
tier <spec-file> [--gate-history N] [--json]Deterministic prep-time build-tier classifier — print mechanical|standard|complex for the given spec file, a pure weighted-linear score over mechanically-extracted spec features (spec_lines, done_items, scenario_count, the retained confidence line as an additive prior, and an optional --gate-history N prior-park-count term) against baked, corpus-calibrated cut points. Same input always yields the same output — no LLM judgement, no randomness. --json prints {tier, score, features} for inspectability; bare mode prints just the token. An absent/unparseable confidence line uses the default prior, never high. Exit 0; exit 2 on a missing spec file or a non-numeric --gate-history. Read-only.
dispatch resolve <lane> [--tier <tier>] [--confidence <conf>] [--json] [--root DIR]Resolve the model and reasoning effort for one subagent-dispatched lane (build, prep_explore, spec, spec_review, methodology, intake, architecture, adr) from the one dispatch: tree, printing {"model":"<token>","effort":"<level>"}. Producer and build handoffs use the same resolver. Each field resolves on its own, most specific position first: dispatch.<lane>.<field>, then inherit (omit the parameter); the build lane walks by_tier.<t>, by_tier.default, by_confidence.<c>, by_confidence.default for the model and by_tier.<t>, by_tier.default for the effort, then dispatch.build.<field>. The model is applied as the Agent-tool model parameter; effort is applied only on engine lanes (engine call), and on an Agent-dispatched lane the site records it in the run log as not applied. --tier and --confidence apply only to build and exit 2 on any other lane; eval is not a dispatch lane (it lives at eval.model / eval.effort). The whole dispatch: tree is validated on every call, so a typo anywhere (an unknown lane or field, an off-vocabulary token, engine:<name> outside methodology / intake, effort under by_confidence, an inline {…} map, or a models: / effort: block left in either config file) exits 2. Engine capability checks stay in engine call; this verb reports the configured effort. dispatch --selftest covers the vocabulary refusals and the build chains. Exit 0 resolved / 2 usage or invalid value.
dispatch prepare-producer <lane> [--in-context | --fresh-adversarial | --shared-spec-files] [--root DIR]Resolve a configured producer. Returns its occupant, first-use conformance check (bundled or validate), and transport. An Agent or engine dispatch also returns the configured model and effort. Pass --in-context for an existing inline invocation. For a fresh adversarial spec review with its full input ready, --fresh-adversarial allows spec-review-cli when the bundled dark reviewer inherits model and effort. With a shared writable filesystem, --shared-spec-files allocates private, per-dispatch spec and review paths for the bundled Agent spec writers. The caller removes them after use. Exit 2 on invalid arguments or configuration.
dispatch prepare-build --executor sequential|parallel [--root DIR]Read one ordered unit on stdin as JSON with members (each has issue and optional tier or build-tier and confidence), run_id, run_dir and session_id. Resolves the build lane once with the highest tier and lowest retained confidence. Returns dispatch for the worker prompt, agent_parameters for the tool and effort_log for the run log. Sequential runs in the foreground. Parallel runs in the background. inherit omits the Agent model parameter. Exit 2 with no handoff on invalid input or config. The executor owns correction verification and attaches verified constraints.
dispatch verify-member --run-dir DIR --issue ID --return JSONFeed the dispatcher-held run manifest on stdin and pass the member’s returned digest object (or null) as a single argument. Checks run custody before member evidence. Exit 0 for agreement, 1 for a detected fault, 2 when verification is unavailable. The JSON scope selects the run or member park. The dispatcher owns ledger writes.
review-iteration-cap --appetite <low|medium|high|full>Single-owner the review fail→fix→review loop bound. Prints the integer cap (low→1, medium→3, high→5, full→10) on stdout, exit 0 — the single authoritative source both faff-graft's Step 9 review loop and the review slot's Appetite integration table (faffter-noon-review/SKILL.md) derive from, so the two can never silently disagree. Pure (appetite passed in — already resolved via faff config get appetite — no tracker/network call). An unrecognised/absent --appetite exits 2, names the legal set, and prints nothing to stdout.
review-fixture-paths [--ref <base>]Print the directory prefixes whose files code review treats as test data rather than shipped code, one per line, exit 0. Reads review.fixture_paths from .faff/config.yaml; an unset key resolves to the generic defaults (fixtures/, __fixtures__/, testdata/), a list replaces the defaults entirely, and [] turns the feature off. With --ref <base> it reads the committed .faff/config.yaml at that ref (git show <base>:.faff/config.yaml) with the same YAML reader faff config uses, ignoring the working tree and the .faff/config.local.yaml overlay, so a change under review cannot widen its own list; a ref with no config file resolves to the defaults. Without --ref it reads the working tree, for inspection. A malformed or legacy-named config, or an unresolvable --ref, prints the error on stderr and exits 2. Pure read (no tracker/network call).
spec-review-iteration-cap --appetite <low|medium|high|full>The spec-stage counterpart of review-iteration-cap — the appetite-scaled ceiling N the prep↔review Spec-review-gate loop is capped at (the would-be-park point where the spec-review judge is consulted at L3–L4). Prints the integer cap (low→1, medium→3, high→5, full→10) on stdout, exit 0. It carries no cap literals of its own: APPETITE_CAP/resolveReviewIterationCap are re-exported verbatim from review-iteration-cap (the single authoritative source), so the spec-review and code-review caps can never silently diverge and there is no second copy of the map to drift. Pure (appetite passed in — already resolved via faff config get appetite — no tracker/network call). An unrecognised/absent --appetite exits 2, names the legal set, and prints nothing to stdout.
spec-review extract-evidence [--file <spec> | --file -]Extract the spec-review evidence block prep embeds in a committed spec — the git-only carry fallback graft's spec-review-evidence materialise step reads when no ## Spec-review evidence tracker comment is present (the sibling of adr extract-intent). Locates the ## Spec-review evidence heading (case-insensitive, any heading level) and prints the JSON body of the faff-contract:spec-review-verdict fenced block within it on stdout, ready to pipe to faff contract spec-review-verdict. --file - (or omitted) reads stdin. Section-locate + fence-extract only — it does not validate the block (the caller pipes it to the contract). Exit 0 on a hit; exit 1 when no such heading/block is present (a legitimately-absent state graft logs and skips on); exit 2 on an unreadable file/stdin. Pure (fs/stdin read only; no tracker/network/git).
spec-review collate-evidence --dir <scratch> [--dispositions <file> | --from-judge --spec <file> [--judge-dir <dir>]] [--comment]Collate every valid round-<n>.json prep recorded into one whole-loop record: every objection is its own item (never merged) with a stable key <round>#<index>, first_round = last_round, and one occurrence. --dispositions folds in a JSON array of {key, lens, disposition, disposition_rationale?, refutation?} that must cover every key exactly once. --comment prints the whole ## Spec-review evidence comment body, ending in a sha256: line over the block's single JSON line, for the agent to post unchanged. With --comment it also writes the anchored spec-review-verdict.json from that exact comment text, in the same call: into <run-dir>/<ISSUE> when --dir is <run-dir>/<ISSUE>/spec-review (the run dir must be under .faff/runs/), or into --dir itself when it is .faff/spec-review/<ISSUE> (a relative --dir resolves against the repo root). The file equals what evidence write spec-review-verdict writes from the same comment. stderr says wrote <path> on success, or warning: spec-review-verdict.json not written: <reason> when placement or the writer refuses; stdout and the exit code do not change, and an earlier file is removed (refusal) or moved to spec-review-verdict.stale.json (fault) so a stale review never stays at the canonical path. Without --comment nothing is written. Known secrets are redacted before rendering. A round file that is not a conformant round is skipped and named on stderr. Exit 0 printed; 1 dispositions file invalid; 2 usage, unreadable --dir, or a redaction-config fault. Replaces select-evidence. --from-judge --spec <file> builds the dispositions from the spec-review judge's ledger.json and ruling-<pid>.json (in --judge-dir, default <scratch>/judge) instead of a file: proposition p-(i+1) maps to key <n>#<i> of the latest in-window round, AFFIRM_SPEC is refuted, an applied UPHOLD_REVIEW or SYNTHESIZE correction is fixed, and everything else is open. A ledger that disagrees with the round exits 1; a missing ruling or ledger exits 2; --from-judge with --dispositions, or without --spec, exits 2.
spec-review write-evidence --dir <scratch> --file <file|->Write the anchored spec-review-verdict.json from a carried ## Spec-review evidence comment (or a committed spec holding that section), placing the target from the scratch --dir exactly as collate-evidence --comment does. For the paths-only carry, where there are no rounds to collate. Exit 0 written (stdout is the path); 1 refused (no section, digest mismatch or schema violation; each reason on stderr as refused: <message>, any earlier file removed, nothing written); 2 usage, missing or unreadable --file, placement fault, redaction-config or IO fault (an earlier file is moved to spec-review-verdict.stale.json).
spec-review carry-check --before <file> --after <file> [--root <dir>]Decide whether a stale-refresh's diff is narrow enough to keep the prior review instead of re-running the Spec-review gate — the deterministic check behind faff-prep's Path 1 and Scenario B iterate. Reads the before and after spec text, normalises both (drops the provenance stamp, the build-tier: line and the one fixed > Revised on YYYY-MM-DD: paths refreshed note; replaces line references with placeholders; replaces each path token with its last segment) and compares them: equal → every changed path token pair must also be a verified move on disk (old path absent, new path present under --root, default cwd) or the refresh re-reviews. Prints one {carry, reason, approval, changes, path_moves, first_divergence} JSON line on stdout. Exit 0 when carry is true (reason: "paths-only"); exit 1 on any no-carry reason (no-prior-approval, approval-line-changed, confidence-changed, content-changed, path-move-unverified); exit 2, with nothing on stdout, on a usage error or an unreadable --before/--after file. Pure apart from the two file reads and the on-disk existence checks: no tracker, no network, no git, no clock.
spec-review route [--file <verdict> | --file -]Decide where a spec-review reject-approach goes next: back to prep for an in-place re-spec, or to plot for a re-slice. Reads the verdict JSON from --file, or stdin when --file is - or omitted, in either shape: the raw block body {verdict, objections} or the faff contract spec-review-verdict stdout (which adds conformant and violations). Prints one {destination, reason, carried_design_objections} JSON line on stdout. destination is plot (reason methodology-major-or-above) when any methodology objection is blocker or major, otherwise prep (reason no-methodology-major); carried_design_objections lists every non-methodology objection as {lens, severity} in input order on plot, and is [] on prep. Exit 0 on a route; exit 2, with nothing on stdout, on an unreadable file/stdin, unparseable JSON, a verdict other than reject-approach, conformant: false, empty objections, or an out-of-enum lens or severity. Pure (stdin/fs read only; no tracker/network/git).
spec-review dispatch --dir DIR --spec FILE [--enabled-lenses CSV | --retry-lenses CSV] [--context FILE]... [--root DIR] [--turn-budget-secs SECONDS] [--run-dir DIR] [--record-round interactive|autonomous --issue ID [--prepare-attachment SHA256]]Run a fresh batch for the complete ordered selection (default all four). A retry returns only the requested lens entries to combine with prior votes. With a turn budget and the owning run's issue/spec-review directory, --run-dir renews the parent heartbeat during either wait. Writes receipts and emits the fenced verdict. On a fresh pass, --record-round defaults to the configured prep.spec_review_turn_budget_secs, brackets dispatch with an in-flight marker and returns the saved round decision as JSON. Use the issue’s spec-review directory and pass its exact run directory under a run. A retained outage batch adds retry_entries with the prior votes path. Turn-budget expiry returns 124 before recording a verdict.
spec-review prepare-requests --dir DIR --spec FILE [--lenses CSV] [--context FILE]... [--root DIR]Prepare the adversarial spec-review requests without calling a backend. Retains lens and context order, appends the ratified-scope context when present, and uses the current round from the scratch directory. Omit --lenses for all four lenses. Resolves the existing pin-first fallback chain, applying the reputation filter only when unpinned, and applies the spec-review timeout, output cap, deadline and strategy settings. Exit 0 prints {round, strategy, backends_path, requests_path}; both files are in a private temporary directory. Use the same backend file for fan-out and pin capture. Exit 3 means unconfigured. Exit 2 means malformed input, configuration or a preparation fault. Both provide {round} when available and produce no requests. The caller handles fan-out, unavailable lens results and recording.
spec-review record-results --dir DIR --round N [--lenses CSV] [--receipts-only] [--strategy NAME] (--results FILE --backends-json FILE | --no-results)Record one ordered fan-out batch for the requested lenses and write the existing fenced spec-review verdict to stdout. Give it the same lens subset and backend file used in preparation. It validates the full returned set, applies the existing outcome parser and aggregation, saves served transcripts with exclusive retry filenames, and records the actual served reviewer for this round. An explicit --no-results records each enabled lens as unavailable/config-fault and captures the empty served set. Exit 0 emits the fenced block only for a full lens set. Partial sets require --receipts-only, which prints the parsed entries for caller-owned aggregation. Exit 2 reports a malformed batch, invalid attribution or an I/O fault with no verdict on stdout. It does no dispatch or prep round recording.
spec-review round --issue ID --dir <scratch> --verdict-file <file|-> --mode interactive|autonomous --occupant adversarial|single-pass [--served any|none] [--run-dir DIR] [--appetite low|medium|high|full] [--retry-limit N] [--root DIR] [--prepare-attachment SHA256] [--json] | --open-window --dir <scratch> | --mark-ratified N --comment-id ID --dir <scratch> --mode interactivePrep's post-dispatch Spec-review gate as one verb: governs the window, locates the single verdict block, writes round-<n>.json before piping it to the contract, routes a reject-approach, checks churn, counts the appetite cap from disk and applies the convergence yield, then returns one action (approve, fix-and-rerun, park, judge, re-slice, retry-outage, hold-outage, surface-outage) and writes it to decision-<n>.json. With --prepare-attachment and JSON output, an ordinary approval can prepare the spec and any review evidence from the stage digest supplied to the reviewer. The saved attachment.status is prepared, manual for decisions that need explicit evidence handling, or stale when ownership or bytes differ. Exit 0 for every action, 2 for a fault. --open-window resets the window and the cap after a recorded park or judge; --mark-ratified excludes a fully ratified round from the cap.
spec-review hold --issue ID --cause outage|turn-budget --mode interactive|autonomous [--kind infra-configured|model-transient] [--lenses CSV] [--dir <scratch>] [--hold-limit N] [--retry-limit N] [--root DIR] [--json] | --read --issue ID | --clear --issue IDPrep's outage and turn-budget holds as one verb, over .faff/resume/<ISSUE>/spec-review-hold.json under the resume-store issue lock. Returns hold (with the label op and the hold notice), park (an exhausted counter, or a corrupt store renamed aside) or surface (interactive never auto-holds). The two counters are independent and unknown keys are kept. Exit 0, 2 for usage or an unmet outage precondition, 4 when the lock is held.
spec-review-churn --prev FILE --curr FILEDetect a non-converging prep↔review Spec-review-gate loop — the churn signal faff-prep/SKILL.md's Loop cap paragraph checks on the second revise/prep-destined reject-approach round, before spending the remaining iteration. Reads two round-record JSON files (each the {verdict, objections} extraction JSON faff-prep already parses for the faff contract spec-review-verdict pipe, persisted verbatim to .faff/runs/<run-id>/ISSUE-XX/spec-review/round-<n>.json) and prints a {churn, prev_lenses, curr_lenses, new_lenses, reason} result on stdout, exit 0. churn: true iff --curr's deduped objecting lens-set contains a lens that was not objecting in --prev (severity and same-lens objection content are not tracked — a same-lens objection being swapped for a different one at the same lens is accepted as an undetected narrow gap, not engineered around). A missing/unreadable --prev (round 1 has no prior record) degrades to churn: false with reason: "no prior round on disk", never a crash; a malformed (present-but-corrupt-JSON) --prev or --curr is fail-loud (exit 2) — plumbing breakage, not a legitimate degrade case. Pure (no tracker/network writes).
spec-review-convergence --dir DIR [--window-start N]Decide whether a prep↔review Spec-review-gate loop is strictly converging — the convergence signal faff-prep/SKILL.md's Loop cap paragraph checks before parking at the count cap, so a measurably-closing reviewer is granted its next round instead of being force-parked. Reads every round-<n>.json in DIR (the same {verdict, objections} records spec-review-churn reads, at .faff/runs/<run-id>/ISSUE-XX/spec-review/), orders them numerically, and prints a {converging, totals, blocker_counts, strictly_decreasing, blocker_free_latest, no_churn, new_lenses_by_step, reason} result on stdout, exit 0. converging: true iff, across the full window, the total objection count strictly decreases at every step AND the latest round has zero blocker-severity objections AND no lens objects in a round that wasn't objecting in its predecessor (the whole-window extension of the churn lens-set guard). Total count = objections.length, blocker count = severity == "blocker" — both derived, no schema change. A missing/unreadable --dir degrades to converging: false (fail-safe = do not yield = park as today, the opposite of churn's degrade direction); a malformed round record is fail-loud (exit 2). --window-start N bounds the comparison to the persisted convergence window [N .. max]: after reading the directory it keeps only records with round number >= N before ordering and detecting, so a restart or human unpark compares only one continuous conversation (omitted → today's whole-directory read, byte-identical; a malformed N is a usage error, exit 2; an N past the max round leaves fewer than two records in window and returns converging: false with the existing "need >=2 rounds" reason, a park). Pure comparator (no tracker/network writes); shares spec-review-churn's accepted same-lens-swap gap, bounded by the self-terminating strict-decrease invariant.
build-review-round record|reply|resume --run-dir DIR --issue ID --round NRecord an autonomous graft dialogue return, persist its author replies, or resume its last action. record --diff-hash SHA256 takes the settled review-verdict JSON on stdin and returns reply, pass, fix, judge, park, or unavailable. reply takes one fix (finding_ref, kind, fix_commit) or rebuttal (finding_ref, kind, rebuttal_text) per critical, saves scrubbed replies and returns review. resume takes the stored next round, restores the action and counters, and repairs an interrupted evidence write. Legacy dialogue seeds its next record with the stashed --fix-rounds-used and --rebuttal-rounds-used. A replay preserves both history ordinals and the counters. Exit 1 refused input and exit 2 invocation, path, state or write fault.
build-review-churn --prev FILE --curr FILEThe build-review dialogue loop's sibling of spec-review-churn, ported one altitude down: same file-read/round-number/CLI-arg-parsing scaffolding, but the comparator key is the finding-identity digest (finding_id := normalize(file_path) + "::" + normalize_title(title), line-number-free), not a lens-set — build-review findings carry no lens. Reads two DialogueRoundRecord JSON files ({signal, findings, author_replies}, persisted to <build-review-dir>/round-<n>.json) and prints a {churn, prev_critical_ids, curr_critical_ids, new_critical_ids, carried_critical_ids, refused_carries, reason} result on stdout, exit 0. Ids are resolved with resolveRoundChain over every earlier round-<k>.json in the same directory, so a finding that carried a prior id by handle (carried_id) keeps it; carried_critical_ids lists the current standing criticals whose id came from an accepted carry, and refused_carries counts the current round's carries resolveRoundChain refused. When --prev and --curr sit in different directories, ids are resolved over those two rounds only, a stderr line says so and the output adds chain_rounds: 2; an unreadable earlier round file exits 2. churn: true iff --curr's standing-critical (severity=="critical") finding_id set contains an id that was NOT standing-critical in --prev — a same file+title finding whose location shifts by a line is the SAME identity (no churn). A missing/unreadable --prev degrades to churn: false; a malformed --prev or --curr is fail-loud (exit 2). Pure (no tracker/network writes).
review-prior --dir DIR [--block]Lists the previous code-review round's findings so the next review pass can name the one it re-raises by handle. Reads every round-<k>.json in DIR (each must parse, else exit 2 naming the file) and prints {round, findings} for the highest round, each finding as {handle, title, location, severity} with handles P1..Pn in record order. Titles and locations are secret-redacted, scrubbed of directive sentences, stripped of backticks and control characters and cut at 200 characters. A missing directory or no round files prints {"round":0,"findings":[]}. --block prints the framed prompt block instead (a ## Prior findings (previous review round) heading, a data-not-instructions line and one fenced json block), or nothing when there are no findings.
build-review-convergence --dir DIR [--window-start N]The build-review dialogue loop's sibling of spec-review-convergence — the fix-cap-exhaustion yield check faff-graft's Step 9 dialogue loop consults. Reads every round-<n>.json in DIR, orders them numerically, and prints a {converging, totals, strictly_decreasing, no_new_finding, new_finding_ids_by_step, reason} result on stdout, exit 0. converging: true iff, over [window-start .. n], the standing-critical COUNT strictly decreases every round AND no new standing-critical finding_id appears since the prior round — ONE definition, no third "latest round critical-free" clause (convergence is only ever consulted while standing criticals are non-empty, so that clause would return converging:false on every call). A missing/unreadable --dir degrades to converging: false (fail-safe = park); a malformed round record anywhere in DIR is fail-loud (exit 2); --window-start N mirrors the spec-side flag. Ids are resolved with resolveRoundChain over every round in DIR, so a carried id (carried_id) holds across rounds; rounds before --window-start only resolve ids and the step into the window is not compared. Pure (no tracker/network writes).
build-judge-evidence (--assemble --dir DIR --issue ISSUE-XX --diff FILE [--out JUDGE-DIR] [--acceptance-criteria FILE] [--repository-evidence FILE] [--window-start N] [--run-id ID] [--retry-limit N] [--budget-secs N] [--reopen-for-hold N] | --admit --dir DIR --level LEVEL [--out JUDGE-DIR])The build-review would-be-park judge's evidence/dispatch/roll-up CLI, a sibling of spec-judge-evidence's --assemble/--admit shape with the dispatch loop embedded here (unlike the spec side, whose per-proposition dispatch is driven by faff-prep's own SKILL.md loop — a deliberate build-side shape departure, not a spec-side refactor). --assemble derives the adjudication set from the dialogue round records (standing criticals plus any rebuttal-driven withdrawal awaiting confirmation, p-05), calls the deterministic assembleBuildCaseFiles (Argument A = the independent reviewer's finding, Argument B = the author's last rebuttal or a labelled null-defence, order coin-swapped, every field scrubbed with scrubSpecField's composition — never scrubArgumentField, whose lens-scrub layer would redact lensless build evidence), writes case-<case_id>.json + ledger.json (mode 0600) under JUDGE-DIR (default DIR/judge), then for each non-parked case_id in ledger order dispatches the two-phase judge via review-call.mjs (Phase 1 blind reconstruction validated by validateReconstruction; Phase 2 rule parsed by parseVerdictBlock(stdout, "build-judge-verdict")), writing ruling-<case_id>.json per finding (each carrying a binding of finding_id, pre_ruling_diff_sha, case_sha and run_id; --assemble stops before any attempt that would not fit the call budget (--budget-secs > graft.build_judge_call_budget_secs > 540; the first attempt of a call always runs), persists ledger.json after every attempt, exits 3 (incomplete) to be re-invoked with the same arguments, resumes a ledger whose adjudication identity (run, window, and each case's finding, diff and case digests) matches, and sweeps earlier ruling, reconstruction (recon-<case_id>.json, the persisted Phase-1 output) and admit-result.json files only when it does not; --admit treats a ruling file whose binding does not match its ledger entry as missing, exit 2) — judgeDispatchDisposition (imported from review-call.mjs, never reimplemented) maps UNREACHABLE/DEADLINE to a bounded retry (--retry-limit, else graft.build_judge_retry_limit, else 2; an invalid flag is a usage error, exit 2) then park (each dispatch carries --deadline / --timeout resolved from adversarial.build_judge.* -> adversarial.* -> 480 / 120, with a spawn backstop at deadline + 30s that reports exit 8); every other non-OK exit parks the finding directly. Every dispatch-time park also stamps a structured park_class next to park_cause: outage (a phase's bounded retries ran out, or an attempt was killed mid-call), backend-chain (the adversarial chain was unset or malformed) or final (any other: an invalid reconstruction, a malformed or missing verdict block, a park disposition, a reconstruction missing on resume); an assemble-time park carries none. --reopen-for-hold N (an integer >= 1, else exit 2) is how a held build's resume continues the judge: on a resumed ledger it turns each outage and backend-chain park back into pending once per hold count, resetting only the failed phase's attempt counter (a bound reconstruction is kept, so Phase 1 is not re-run), stamping reopen_count on the entry and recording N in the ledger's reopened_for_holds, so a repeated call with the same N reopens nothing; final parks and entries without a park_class are never reopened, a fresh (non-resumed) ledger only records N, and an N above graft.build_review_hold_limit reopens nothing and warns on stderr. The summary always carries reopened (the reopened case ids, [] when none). A field failing the scrub fixpoint check or tripping hasDiffMarkers on a non-diff field parks that finding at assemble time (unresolved, no case file emitted for it) — never an unsafe payload reaching a model. --admit computes the ONE build-side floor (critical-free-latest, p-17, derived from the last dialogue round record — fails CLOSED on a missing/unparseable input) and rolls the resolved ledger up via admitBuildRollup: admit = every blocking finding OVERTURN-resolved AND no PRODUCT_BOUNDARY AND no parked/unresolved finding (a single OVERTURN among several standing criticals never admits, p-16). Prints the AdmitResult and exits 0 (admit) / 1 (not admit) — mirroring spec-judge-evidence --admit's convention. An unreadable --dir at assemble is fail-SAFE (a {park:true} bundle, exit 0); a malformed round record, or a malformed/missing ledger.json at admit, is fail-loud (exit 2).
spec-review-pin (--resolve --dir DIR --consumer NAME [--root DIR] [--json] | --capture --dir DIR --backends-json FILE --winner-index N)The reviewer-pin the L4 adversarial spec_review occupant resolves its chain through, so a flapping backend can't silently swap the serving reviewer across the rounds of one spec's loop (which makes a converging spec read as churn and false-park). --resolve prefers the pinned backend with fallback: with DIR/pinned-reviewer.json present it prints the bare primary-first array [pin, …rest-of-assembled-chain] (pin first, the pin de-duped out of the tail, so a rate-limited pin round falls back to the tail instead of hard-parking); with no pin file (round 1 / unpinned) it prints the bare per-consumer chain byte-identical to adversarial-backends (the shape review-call.mjs's --backends-json mapper consumes). --json wraps the output as {chain, pinned}. It wraps assembleAdversarialBackends, so its errors pass through: exit 3 (adversarial unset/host-unset), exit 2 (malformed chain config) — plus exit 2 on a present-but-corrupt pinned-reviewer.json (fail-loud; never a silent bare full chain — a broken pin is a plumbing fault). --capture --winner-index N is the idempotent first-write of the round-1 served backend (chain[N]) as the pin sidecar: it writes only when no pin exists yet (rounds ≥ 2 no-op, never overwriting round 1's pin) and prints {written}; an out-of-range N, an unreadable --backends-json, or a non-array chain is fail-loud (exit 2). Pure but for the single sidecar write. The round records, the spec-review-verdict schema, and the reviewer-blind convergence/churn detectors are untouched (the swap-round window reset is prep's loop-level job).
spec-review-reputation (--report | --eligible --backends-json FILE) [--consumer NAME] [--now ISO] [--root DIR] [--scan N] [--json]The selection-time reputation ledger that strikes a candidate-degenerate spec_review reviewer before it can serve as the sole gatekeeper — a mono-severity backend that stamps every lens critical forces reject-approach every round and false-parks the run at the loop cap (the aggregate.mjs severity veto honours it faithfully; nothing upstream checks whether the reviewer can ever pass a spec). Recompute-on-read (no materialized store; the ledger is recomputed from run artifacts on each read), mirroring park-history: a fixed run-count scan of the newest --scan (default 50) run dirs under .faff/runs, an injected --now (accepted for parity; no time-decay reads it, so output is deterministic for a fixed history), and a pure arithmetic core (no LLM). Per serving identity (provider|model|host, reused from spec-review-pin) it counts the specs reviewed (terminal round-<n>.json verdict attributed via the pinned-reviewer.json sidecar; an un-attributable dir is skipped), the specs blocked (a terminal reject-approach; needs-human never counts), and how many of those blocks were accepted downstream — a run-ledger outcomes[issue] of shipped/pr-open, a shipped issue-outcome event, or a non-reject spec-review verdict on the same issue ordered strictly after the block by (run_id, round) (run-ids are date-prefixed → chronological; a ship sorts at (run_id, +∞); an earlier-run or same-round peer approve never counts). A backend is flagged iff reviewed >= 8 AND block_rate >= 0.90 AND overturn_rate >= 0.30 (the two-gate AND means a discriminating backend is never flagged whatever its overturn-rate). --report prints the ReputationLedger JSON (scan, echoed thresholds, a backends map of {reviewed, blocked, blocked_then_accepted, block_rate, overturn_rate, flagged}, a sorted flagged list). --eligible --backends-json FILE reads the assembled chain array (byte-compatible with adversarial-backends/spec-review-pin), strikes flagged identities, and prints the struck chain array (default) or {chain, struck, all_struck} (--json) — it never empties the chain: an all-flagged input is returned unchanged with all_struck: true, because a degenerate sole gatekeeper with no configured alternative is an operator-widen-the-pool signal, not a licence to skip the gate (fail-closed). Exit 0; a present-but-corrupt round record / run-ledger.json, a missing/unreadable/non-array --backends-json, or a non-positive --scan is fail-loud (exit 2). Pure (no tracker/network writes; reads run artifacts only).
spec-review-dir --issue ISSUE-XX [--run-dir DIR]Print the per-spec spec-review scratch dir both the round records and the reviewer pin resolve through, so interactive prep (no $FAFF_RUN_DIR) and autonomous runs never disagree on where those live — closing the pre-existing gap where interactive round records were scoped under an undefined <run-id>. Resolves the mode once: a run-dir (the --run-dir flag, else $FAFF_RUN_DIR) → <run-dir>/<ISSUE>/spec-review; otherwise → .faff/spec-review/<ISSUE>. --run-dir (explicit) wins over $FAFF_RUN_DIR (ambient), mirroring review-call.mjs's precedent. Pure path computation — never creates the dir (callers create on first write), exit 0.
spec-review-window (--next-round | --read | --set N) --dir DIRPersist the prep↔review Spec-review convergence window across a restart or human unpark, so the convergence/churn checks compare only records from one continuous conversation. Owns two deterministic pieces both keyed on the surviving scratch dir (spec-review-dir): --next-round prints the next round number derived from disk (max(round-<n>.json) + 1, or 1 for an empty/absent/unreadable dir), so a resumed loop appends round-<max+1>.json rather than the agent's in-memory counter overwriting round-1.json; --read prints the persisted window_start from the DIR/window.json sidecar (defaulting to 1 when the marker is absent, the fail-safe park-leaning direction, since a wider window can only make convergence harder to reach); --set N writes { "window_start": N } (creating DIR if absent). Exactly one mode flag and --dir are required. N must be an integer >= 1 (else usage error, exit 2); a present-but-malformed window.json on --read is fail-loud (exit 2), parity with the round-record readers. No hashing, no fingerprint: the window is one persisted integer. The round-<n>.json body is untouched (the marker is a separate sidecar, mirroring pinned-reviewer.json). Reuses roundFilesInDir from spec-review-convergence (a legal factory-to-factory require edge).
spec-judge-evidence --dir DIR --window-start N --level <L1..L4> --appetite <a> --issue ISSUE-XX [--container C]Assemble the deterministic evidence bundle the spec-review judge weighs at the would-be-park point — it never re-derives a layer's output, it shells the shipped resolvers and passes their output through verbatim. Emits one-line EvidenceBundle JSON: standing_objections (the latest in-window round's objections), convergence (from spec-review-convergence --dir --window-start, verbatim), churn (from spec-review-churn over the last two in-window rounds), blocker_free_latest (reused from convergence — the accept-bar guard), infosec_major_free_latest (derived here: true iff no standing infosec objection at major/blocker — the security-severity floor), calibration (the serving backend's row from spec-review-reputation --report --json, keyed on DIR/pinned-reviewer.json, with cleared derived: reviewed >= min_sample ? !flagged : "unknown"), ratified_scope_block (the ## Ratified scope markdown from ratified-scope --assemble on exit 0, null on exit 3 or a degraded source), appetite_cap (from spec-review-iteration-cap), rounds, and level. A merely-absent optional layer degrades its one field (calibration.cleared:"unknown", ratified_scope_block:null) with a stderr note; an unreadable --dir emits a {park:true, reason} park-direction bundle exit 0 (fail-safe — the judge is not consulted); a malformed round record is fail-loud (exit 2). Validates --issue/--container with a bare-id guard. INTERIM bundle shape. Two per-proposition modes on the same subcommand. --assemble --dir DIR --window-start N --spec FILE --issue ISSUE-XX [--out JUDGE-DIR] [--repo-root PATH] [--run-id ID] [--container C] atomises the standing residue 1:1 into propositions and writes, under JUDGE-DIR (default DIR/judge), one blinded case-<pid>.json per proposition (governing requirements, a clean spec-section snapshot with no diff markers, bounded + secret-redacted repository evidence under realpath path-confinement, the deterministic-template proposition "Is the decision at <spec_anchor> sound with respect to <lens-domain>?", and the two anonymised arguments A/B in a run-seed-randomised order) plus one out-of-band ledger.json (the un-blinding key — retained lens tag, sources, stable case_file_anchor, contested_source, order_seed, pre_ruling_spec_sha/pre_ruling_spec_content) written mode 0600; an unreadable --dir emits a {park:true} bundle, a malformed round record is fail-loud exit 2. --admit --level <L3|L4> --out JUDGE-DIR --spec FILE [--dir DIR --window-start N] [--run-dir PATH] rolls the resolved ledger + ruling-<pid>.json files up to a deterministic AdmitResult { admit, level, resolved[], unresolved[], parked[], prd_boundary[], minor_corrections_applied[], minor_corrections_unapplied[], floor_veto[] }: blocking(p) := severity ∈ {blocker,major}; a blocking UPHOLD_REVIEW/SYNTHESIZE resolves only when the correction-applied check passes (the verification literal is present in the current spec, absent from the retained pre-correction content, and the whole-file hash changed); floors (blocker_free_latest, infosec_major_free) veto over the top and a null/degraded floor input fails closed (floor_input_degraded); the L4-ratification gate coerces a caller-asserted --level L4 to effective L3 (l4_unratified with no run-ledger L4, l4_chain_uncorroborated when the local events.jsonl chain does not verify from genesis or carries no mint level:L4 event) and a null PRD at effective L4 is prd_absent_at_l4 — the roll-up's half of the two-part L4-final gate, whose other half is the merge-time governance-check against the protected-branch anchor. A parked blocking proposition, a missing ruling-<pid>.json for a listed non-parked proposition, or a malformed ledger.json are handled fail-safe/fail-loud (a missing ruling or malformed ledger is exit 2). A third mode, --restamp --pid PID --spec FILE [--out JUDGE-DIR | --dir DIR], re-stamps one proposition's pre_ruling_spec_sha/pre_ruling_spec_content to the current on-disk spec state — the CLI seam faff-prep's dispatch loop calls between the previous proposition's applied correction and this proposition's judgement, so the roll-up's correction-applied check reads the right pre-correction baseline instead of the shared assemble-time snapshot. It mutates only the target entry's two pre_ruling_* fields (every sibling entry, and every other field of the target entry, survives byte-for-byte) and prints {restamped, sha, out} on success. Unlike the evidence bundle's fail-safe unreadable---dir park, --restamp runs only mid-dispatch after --assemble has provably written ledger.json, so a missing/malformed ledger.json, a ledger with no order[]/entries{}, a --pid absent from the ledger, or an unreadable --spec are all fail-loud (exit 2), mirroring --admit. --assemble, --admit, and --restamp are mutually exclusive.
spec-judge-evidence --assemble --sequence --dir DIR --window-start N --spec FILE --issue ID [--container C] [--run-dir DIR]; spec-judge-evidence --step --dir DIR --window-start N --spec FILE [--backend IDENTITY] [--park PID] [--budget-secs N] [--run-dir DIR]Resume the private judge ledger for this review window. Select a configured independent judge by provider|model|host. By default each step spends at most one foreground transport attempt on the current proposition. With a positive --budget-secs N it continues checkpointed phases and retries until a correction, completion, or budget hand-back. Exit 3 returns action: "budget" and the number of completed steps. Before starting a provider attempt, it reserves the configured deadline plus transport grace and reports that duration as attempt_secs if it cannot fit. Resume with sufficient time for the attempt and setup. Bounded completion reports parked proposition IDs and their recorded reasons. Pass the same owning --run-dir at assembly, step and admission. The step renews its heartbeat during a pending provider call, including in single-step mode. retry, continue and parked ask for another step. apply-correction returns a bounded correction to the author and holds the queue until the edit is verified or the caller parks that proposition. done allows --admit. Exit 2 means a state, evidence or input fault. Case files and validated ruling JSON stay in the existing judge directory.
spec-judge-accept-bar --evidence <file|-> --verdict <file|-> --level <L1..L4>The deterministic accept-bar roll-up the spec-review judge step applies at the would-be-park point — "arithmetic over the bundle, not the judge's read". Reads the pre-judge evidence bundle (spec-judge-evidence) and the judge's conformant spec-judge-verdict (both a file path, or - for stdin) and prints {disposition, coerced_from, floor_fired, level} on stdout, exit 0. It only coerces an accept; keep-going/park-needs-human pass through verbatim (coerced_from:null, floor_fired:null). An accept is coerced to park-needs-human on the blocker floor (blocker_free_latest !== true, every level, floor_fired:"blocker") or the level-aware infosec floor: at L4 the interim pre-judge floor (infosec_major_free_latest !== true), at L1–L3 the post-adjudication scan over verdict.upheld (fires only on a still-standing infosec objection at major/blocker — a conformant accept upholds none, so it is a no-op today and goes live under the widened four-outcome contract). An uncoerced accept runs the authority gate → accept-final at L4, accept-provisional below. It does not re-police the accept ⇒ empty upheld invariant (that is faff contract spec-judge-verdict's job, run by the caller first). Fail-closed (exit 2, no disposition) on a non-object/unreadable/non-JSON evidence or verdict, or a verdict.verdict outside the closed three; a missing blocker_free_latest/infosec_major_free_latest field is the fail-safe (the floor fires).
adr <next-number|new|list|live-decisions|validate|supersede|admit|renumber|format>Deterministic mechanics over the configured ADR log. format [--json] [--root DIR] is the read-only ADR-shape resolver: a repo with no committed adr.md in the resolved templates directory resolves to the Nygard default (Context/Decision/Consequences); a committed, parseable one resolves to that file's own level-2 headings instead — new and the adr slot producer both scaffold/author against this one resolution, never a hand-read of the template file. A present-but-empty/heading-less/unreadable template degrades to Nygard and logs the skip; a template with no ## Decision heading disables the L3 contradiction-detection seam for that repo (both surfaced in --json's notes). validate names every colliding file on a duplicate number; it never requires the optional Provenance: field (absent reads human) but flags a present out-of-enum value. new --provenance human|loop stamps the tier (default human); list --json / live-decisions both surface it. admit --actor loop|human --supersedes-provenance human|loop|none [--self] [--challenge survived|overturned] [--lineage-supersessions N] is the two-gate admission gate that ports the PRDR admission pattern onto the ADR axis — a pure function (no tracker/network call) emitting one admit/propose-only/reject verdict a caller pipes to faff contract adr-admission; admit requires the drift challenge to have survived (absent/overturned never passes), by_level: ok, and an unbreached adr.thrash_max/adr.thrash_window ratchet — a loop-over-human move gates at best to propose-only. renumber <filename|number> --to <NNNN|next> [--ref-scope f,f…] is the merge-time collision-repair primitive: move one ADR to a free number, fix its heading + in-scope canonical back-refs, and re-validate (git-agnostic fs move — the caller stages it); it refuses (exit 1) an occupied target, an ambiguous bare number (pass the filename), or a still-red re-validate, leaving no half-renamed tree. The faff-graft Step-10 merge guard calls it to renumber a concurrent-collision ADR before ship.
adr promotion-source [--root DIR] (--tracker-intent | --file SPEC)Select a known tracker comment or read the Step 4 spec for the promotion section. The result includes the resolved ADR directory when applicable. Off mode and missing intent skip promotion. An unreadable spec also prints a diagnostic.
andon <pump|send> [--json]Push alerting for run-critical events — the one command in this binary that opens a real network connection (node:http/node:https built-ins only, zero new dependencies). pump --run-dir DIR is the orchestrator-facing verb: a cursor-based reader over <run-dir>/events.jsonl that classifies each new event against the closed run-critical set (park / sentry-trip / budget-checkpoint with data.breached≠[] → budget-breach / run-end) plus three opt-in informational classes — lifecycle progress, not a run-critical condition, absent from the default events: set: issue-admitted → one run-level admitted summary listing every ticket the run admitted (no issue field), and prep-start/build-start → one issue-scoped notification each naming the run, the ticket, and the stage. Dedupes a persisting condition to one notification via a per-run key (andon-state.json's notified), and POSTs one skimmable {run_id, class, issue?, title, body, ts, seq} record — reshaped per andon.format (generic|ntfy|slack|discord) — to andon.url. Fail-open by construction: a send failure (timeout/refused/non-2xx) is recorded in andon-state.json.failures and the cursor holds (retried next pump) but the command still exits 0 — notification outcome never gates, parks, or halts a run. At most 10 individual sends per pump; further pending critical/informational events in the same pump collapse into one rollup notification (both still marked notified + the cursor still advances past them). andon.url unset ⇒ complete no-op — zero network calls, zero state writes (the andon is dark by default), and with no andon.events override the resolved set stays exactly the three run-critical classes — existing configs are unaffected. send --class C --title T --body B [--issue ID] is the direct one-shot escape hatch bypassing the event log entirely (e.g. a fatal error outside any run dir); same config/format/fail-open posture. --json reports {disabled, sent, failed, skipped, cursor, malformed} (pump) or {disabled, sent, failed} (send). Malformed events.jsonl lines are skipped and counted, never abort the pump. See .faff/config.example.yaml's andon: block for the full config surface (url/format/token/events) — url/token are secret-bearing and belong in the gitignored .faff/config.local.yaml overlay, never the committed base.
decisions <match --punt "<topic>"|list|validate|intent-status [--file PATH]> [--json] [--root DIR]The decisions register (ADR-lite) — deterministic mechanics over a single committed docs/decisions.md, the "pino vs winston" park-eliminator the gateway's needs-decision-first resolve-attempt consults before its bounded inference. match --punt "<topic>" normalizes (lowercase, collapse whitespace, strip surrounding punctuation/quotes) the punt topic and every entry's Matches: keys and returns the single normalized-full-equality match {id, chosen, rationale, scope} — never substring/containment, so a generic key contained in a longer unrelated punt never fires; two or more equal-matching entries is ambiguous and returns {match: null}, same as no match at all. Scope: is descriptive-only, never consulted by the match. list [--json] enumerates every entry (id/topic/chosen/date, plus an additive kind field per --json object — precedent or ratified_tradeoff; the text form is unchanged); validate structure-lints per kind and enforces globally-unique citation ids, printing FAIL docs/decisions.md ✗ <reason> per violation (exit 1). Two entry kinds, discriminated by the lexical presence of a Ratified-by: field line (not its value — a blank Ratified-by: is a malformed tradeoff, never a precedent): a precedent keeps today's rules (Chosen/Rationale/Scope/Matches/Date, Matches non-empty) and is the only kind match ever returns; a ratified tradeoff requires Chosen/Rationale/Scope/Source-issue/Ratified-by/Date (Matches optional and never matched), enforces Source-issue against ^[A-Z]+-\d+$, and accepts only Ratified-by: human in v1 (a loop value is refused until a deterministic loop-provenance admit gate exists). intent-status [--file PATH|-] classifies a ## Decisions-register intent tracker comment body (read from --file, --file - or an omitted --file both reading stdin) as live (exit 0), superseded (exit 1, iff the body carries a > Superseded ... marker line — a (superseded) heading suffix alone is never authoritative), or not-intent (exit 2, any comment lacking the ## Decisions-register intent heading, or a usage/read error); --json emits {kind, status}. It is the shared deterministic skip decision faff-prep's reconcile step and faff-graft Step 4c's materialise guard both shell out to, so the marker grammar can never drift between writer and reader. Pure, no tracker/network access, no writes (region factory, mirrors the faff next/faff eligible caller-passes-state contract): an absent docs/decisions.md is a clean {match: null}/empty list, never an error (exit 2 is reserved for a genuinely unreadable file). The CLI is deliberately read-only — register writes are ordinary committed-file edits landed in a human-ratified PR (faff-prep records a ## Decisions-register intent capture comment, faff-graft materialises the entry on the feature branch), never a CLI-driven runtime write.
ratified-scope (--assemble [--container <c>] [--root DIR] | --validate [--in FILE] [--json])Assemble or validate the ## Ratified scope block a spec-review design lens later defers to. --assemble splices a fixed plain-markdown block from committed sources — a PRD's ## Goals & success metrics section (under a ### Ratified goals: PRD subsection, emitted first) and its ## Non-goals section (docs/prd/<container>.md, when --container is given), the docs/decisions.md settled precedents (every precedent entry with a non-empty Scope), and the docs/decisions.md ratified tradeoffs (every honourable Ratified-by: human tradeoff, under a ### Ratified tradeoffs (docs/decisions.md) subsection with a Source-issue/Ratified-by settling line) — and prints it (exit 0), or exits 3 with empty stdout when nothing is ratified (no goals, no non-goals, no scoped precedent, and no honourable tradeoff); it never parses the meaning of what it copies and never writes a file. Each honourable tradeoff emits one no-expiry-enforcement warning to stderr at assemble time — a deterministic function of the register contents, independent of any downstream demotion (v1 records Scope but does not enforce scope/topology expiry; v2 owns that). --validate is a shape-only well-formedness check over a supplied block (--in FILE else stdin, capped at 1 MiB): exit 0 when the block carries the exact heading, the provenance anchor, and at least one recognised subsection; exit 1 (problems listed, or {valid, problems} under --json) on a malformed or empty block. A --validate pass proves the container is the right shape to be consumed, not that it was authentically assembled from committed files (authenticity is the human's / judge's call, never the CLI's). Pure — no tracker/network access, no writes; exit 2 is a usage error, an unreadable source, or input over the cap. The ## Goals & success metrics and ## Non-goals scans both reuse the shared sectionBody scanner admissibility.js exports (no scanner copied).
decision-capture <record --run ID --issue ID --kernel NAME [--action JSON]|list [--run ID|--all-runs] [--coverage replayable|non-replayable|uncovered]|export --out DIR [--include-anchors]>Read-only instrumentation of the current decision-kernel (next/eligible/tier/run-done/queue-state/regions — the ratified Phase-1 KERNEL_REGISTRY seed set) inputs and chosen actions, for Phase-1 orchestration-fidelity measurement — it performs no assignment, protected effect, or canonical decision. Gated off by default on config capture.decision_kernel == "on"; unset or any other value is a clean no-op. record reads {normalised_inputs, selected_action} as JSON on stdin (--action JSON supplies/overrides selected_action when stdin omits it), computes coverage — replayable (known kernel, every required input present) | non-replayable (known kernel, ≥1 required input missing, named in missing_inputs) | uncovered (kernel not in the registry) — never trusting a caller-supplied coverage value, and appends one type="decision-capture" event via the existing appendEventRecord (inheriting the tamper-evident events.jsonl hash chain + the known-secret redaction wired into every durable-write path, never forked), stamping a causation: {seq, sha256} pointer to the run's chain head at capture time; prints {seq, coverage} on success. Best-effort by construction: a disabled gate, malformed stdin, an invalid record shape, or a journal-append fault degrades to a logged .faff/logs/decision-capture.jsonl note and always exits 0 — a capture defect can never block or change an authoritative outcome. An event the write core refuses (an empty --issue on the issue-scoped decision-capture and decision-capture-action types) is a suppressed capture whose note names the event type, kernel and rule; unlike faff events append, which exits 1 on the same refusal, capture is instrumentation and never gates. list streams matching records as JSONL from a run's (or every run's, --all-runs) events.jsonl, optionally filtered by --coverage. export --out DIR collects matching records across every run dir into a redacted, manifest-digested corpus (decision-corpus.jsonl + manifest.json, bundle.js's export pattern) — re-applying redact.js's known-secret redaction at the publish boundary (belt-and-braces) and digesting via integrity-digest.js's sha256, never forking either. Opt-in --include-anchors additionally folds committed .faff/anchors/**/events.jsonl decision-capture records into the corpus — the route by which an external/distributed lights-out run's records reach main — de-duplicated by run_id+seq (a live run dir wins over its byte-identical anchor copy), deterministically ordered so corpus_sha256 reproduces regardless of source mix, and re-redacted through the same publish-boundary pass; a bad or absent anchor is skipped with a stderr note and never faults the export, and the default (no-flag) path stays byte-for-byte the live-run-dirs-only corpus.
shadow-fidelity <run --corpus FILE [--manifest FILE] [--out DIR] [--non-default-policy-run RUN_ID]...|reproduce --dir REPORTDIR>The read-only coordination-fidelity study: turns a decision-capture export bundle into the first hard input to the v5 Gate 1 coordination decision, and performs no assignment, tracker mutation, protected effect, merge, or canonical decision — it reads files and imports the nine in-scope pure kernels, reimplementing none. run replays each replayable record's normalised inputs through the SAME versioned kernel that produced the capture (next/eligible/run-done/queue-state/claim-verdict/park-verdict/project-next/run-outward/run-start), compares the prescribed action against the recorded selected_action, and grades any divergence by decision kind and consequence (harmless/wasteful/wrong) into a matrix with denominators; it maps the capture's non-replayable onto the missing-input coverage class, excludes version-skew and input-uncaptured records (derived structurally — next's awaitingSpecReview and run-done's policy), and sets aside the decision-kernel commands the map names but the shadow cannot replay (state/run-ledger/decision-capture) plus the instrumented-but-non-decision-kernel tier/regions, both derived from the state-authority map + registry each run. Orchestration cost (intervention, retry, resume, latency, token spend) is read from existing run artifacts, joined by run_id, and snapshotted into result.json (gitignored sources ⇒ a recorded observation, not a content-addressed reproducible output). --out DIR commits the corpus, a pinned manifest.json, and result.json into the report directory; reproduce --dir REPORTDIR recomputes the committed corpus digest, asserts it matches the manifest, re-runs the analysis, and asserts byte-identical corpus-derived outputs. An empty or capture-off bundle yields a stated null result, never a pass.
prd <path|new|link|list|select|validate [--strict]>Deterministic mechanics over the configured PRD log (default docs/prd/) — the product-axis counterpart to adr: scaffold/list/validate a per-container PRD (slug-keyed) and emit the container-link line; the caller commits + applies it. validate is lenient (metadata + non-empty body, never section shape); validate --strict additionally form-checks ## Acceptance criteria as born-verifiable — every criterion must be a Given/When/Then scenario or a MUST/comparator assertion (loose prose, placeholder-only, or a missing section FAILs). A Frozen-status PRD always runs that born-verifiable check even without --strict (the freeze precondition); ## Requirements and other sections stay lenient. The check gates FORM only — semantic verifiability is the evaluator's/human's job.
prd select [--json] [--root DIR]Read-only PRD discovery for standalone plot. Emits the selected container and path, a shortlist for the human when several Active or Frozen PRDs qualify, or a reason to fall back to discovery. A lone PRD is eligible regardless of status.
prd-checklist <path>The git-only PRD gate's parse-and-emit half: parse a checklist-style PRD's GFM task-list stop-conditions (- [ ]/- [x]/- [X], any nesting depth, fenced-code-block lines ignored) and emit the existing prd-coverage contract shape — no new schema. Every parsed task-list item maps onto the completion face, never the coverage face: covered is always true / uncovered_goals always [] (a listed checkbox is trivially tracked), while checkbox state drives completion.all_met / unmet_or_unverified / the satisfied roll-up run-done reads via --prd-coverage. Pure: filesystem read of <path> only, no tracker/network/writes. Governing safety constraint — never a false covered/satisfied: an empty/whitespace-only file, a file with no GFM task-list items (prose/headers/plain bullets only), or a checkbox with an empty label all degrade loudly (exit 2, stderr diagnostic, no stdout block) rather than a vacuous satisfied:true. Output is raw single-line JSON on stdout, exit 0, belt-and-braces schemaChecked against prd-coverage, and accepted unchanged by faff run-done --prd-coverage.
prdr <path|new|list|supersede|validate|admit|yagni|coverage|land>Deterministic mechanics over the configured PRDR product-requirements decision-record log — the supersedable record between the immutable PRD and the per-slice spec (PRD content, ADR mechanics: globally-numbered, immutable, supersedable). new scaffolds a record citing its container + PRD-goal; supersede is a pure mechanical linker; validate is presence-only (metadata + the four body sections + symmetric supersession, never section content). admit <prdr> --actor loop|human --supersedes-provenance human|loop|none [--self] [--new-capability] [--drops-last-goal] [--lineage-supersessions N] [--thrash-max N] [--upper JSON] [--lower JSON] is the two-gate admission gate: a pure verdict (no tracker/network call) that computes authority (provenance check), the recursive by-level invariant (a loop cannot supersede the PRDR governing its own increment), and the count thrash-ratchet itself, then folds in the upper (YAGNI) and lower (coverage) gate verdicts — or their fail-safe defaults when absent (a new-capability PRDR is not admitted without the YAGNI judge; a supersession dropping a goal's last cover escalates) — and prints a prdr-admission verdict (admit / propose-only when a loop moves a human-provenance PRDR needing human ratification / reject). yagni [<prdr>] --prd-goal <g> --prd-goals JSON [--proposal admit|reject] [--proposal-reason S] [--serves-goal] [--within-scope] [--challenge survived|overturned] [--challenge-reason S] [--grounding-present] is the upper (YAGNI) gate: a pure two-phase arbitration (no tracker/network) — a deterministic trace-to-goal precondition (prd_goal ∈ PRD goals, else reject at the door), the methodology slot's Phase-1 proposal, and the adversarial-review slot's Phase-2 challenge → conservative-reject-on-doubt; prints 255's upper {admit, reason} verdict as a prdr-yagni block, fed to prdr admit --upper. coverage --prd-goals JSON [--live-prdrs JSON] [--dod-verdicts JSON] [--container <slug>] is the lower (coverage) gate + prd-satisfied roll-up (two faces of one goal↔PRDR↔DoD relation): a pure verdict (no tracker/network) computing both the static coverage — every PRD goal stays covered by a live PRDR, emitting 255's lower {covered, uncovered_goals} (fed to prdr admit --lower; a supersession dropping a goal's last live PRDR → uncovered → lower violation, no silent abandonment) — and the dynamic roll-up prd-satisfied ⟺ coverage ∧ (∀ live PRDR DoD met), reading the evaluator's per-PRDR DoD verdicts (--dod-verdicts) with a conservative default (a DoD with no met verdict is unverified ⇒ not satisfied, so while the evaluator is unbuilt prd-satisfied is conservatively false — the run cannot claim product-done without the judge). --live-prdrs overrides the configured live-set read; prints a prd-coverage block — the product-done predicate the run-terminating-condition composition and the per-project release-gate Done transition consume. land --local <number> [--base <branch>] [--root <dir>] [--prd-goals JSON] [--run-dir DIR --issue ID] [--json] is the git-only third landing step after author→ratify→accept: on a no-remote repo (fail-closed on a present or indeterminate remote — land via the forge PR path instead) it fast-forwards the local base branch onto an Accepted record's prdr/NNNN-slug accept branch (created by prdr accept), reusing merge-gate --local's own landBaseFfOnly ff-only base-advance primitive (never a fork of it — a peer sibling gate, narrower and doc-only-shaped, never a merge-gate --local overload or bypass). Refuses (exit 2) with no mutation on a remote-backed/indeterminate repo, a Status that isn't Accepted, or a missing accept branch; refuses (exit 1) when the accept branch isn't a fast-forward descendant of base, the base is dirty, any changed path in base..landing falls outside the configured PRDR directory (a segment-anchored containment check — a bare prefix match would admit a sibling escape like records/prdr-notes/evil.js), or candidate validation (prdrValidate + prdrGitTier, run against the LANDING tree via a throwaway detached worktree) FAILs. On success it emits {prdr, file, base, old_base_sha, new_base_sha, landed:true, coverage} (coverage recomputed from the just-updated base — an Accepted-but-unmerged record is never counted; only land moves a goal from uncovered to covered) and, when --run-dir/--issue are supplied, persists the same record under the run dir. Reads tracking.prdr_docs_path (default docs/prdr/), prdr.thrash_max, prdr.thrash_window, prdr.accept_branch_prefix.
profile <validate|show|mine> [--file F] [--json]Infra-profile schema + CLI + repo-mining acquirer. validate a profile JSON; show the effective profile (.faff/infra-profile.json ⊕ .faff/config.yaml infra:, override wins per field); mine is the default profile-slot acquirer — a deterministic, read-only repo-miner that scans --root for committed infra artifacts (CI workflows, Dockerfile/compose, Terraform, netlify/vercel/Procfile, language manifests) and emits one faff-contract:infra-profile block (--json for raw JSON). Pure file inspection: no network/install/subprocess; writes no files (the orchestrator validates the block then stores it).
manifest validate [--file F]Tier-1 binding-manifest schema + names-only validator (descriptor class, like profile above — not a faff contract entry). validate reads a binding manifest from --file or stdin (raw JSON or a faff-contract:tier1-binding-manifest fenced block) and proves it names real symbols only: a closed key-allowlist at every nesting level (a smuggled returns/body/script/mock/expr field is rejected as unknown), the bare-identifier / dotted-path grammar on every symbol field, and closed enums for kind and the arg-type hints. Exit 0 valid / 1 invalid (per-line violations on stderr, including a valid-JSON non-object top level) / 2 malformed (input does not parse as JSON). Pure: no I/O beyond the input read, writes no files. The normative shape is docs/reference/tier1-binding-manifest.md; the reflection adapter consumes a validated manifest over the session RPC wire. --selftest covers a conformant manifest, a smuggled field, a non-identifier op, an instance-op-without-construction, a non-object top level, and a parse failure.
profiles <list|validate> [--file F] [--json]Governance profiles (unrelated to profile above — this is the runcheck/events/sentry vocabulary table, not the infra profile). The three governance engines are dialect-independent machinery; the closed word-lists they validate against (terminal states, event types + per-type field rules, sentry thresholds/predicate bindings) are single-sourced into one DELIVERY_PROFILE constant each engine reads via a threaded, defaulted profile parameter — byte-identical to today's hardcoded vocabulary when it's the active profile (the default). list prints the active profile ($FAFF_GOVERNANCE_PROFILE names an override file); validate [--file F] shape-validates a profile (F, or the active one) against the closed-vocab guard (every leaf a string / finite number / array-of-strings / flat object — a conditional/nested-policy shape is refused, naming the offending leaf): exit 0 valid / 1 invalid+reasons / 2 unreadable. A missing/malformed/shape-invalid override is loud — every governance subcommand exits 2 with the reason on stderr, never a silent fallback to delivery. --selftest drives all three engines' pure cores under both DELIVERY_PROFILE and a synthetic disjoint-vocabulary SECOND_PROFILE fixture: a delivery fixture is rejected under SECOND_PROFILE (and vice versa), and sentry's thrash predicate trips at SECOND_PROFILE's own thrash_n — the dialect-independence proof.
fixtures <validate|show|realise> [--file F] [--out DIR]Fixtures dataset-manifest schema + CLI — validate a manifest JSON, show the effective manifest (.faff/fixtures/manifest.json ⊕ .faff/config.yaml fixtures:, override wins per field), or realise a deterministic dataset from (manifest, seed) into dataset_path/--out. The generation strategy is a deferred slot; this ships the contract plus a trivial reference generator.
env <compose-gen|up|seed|down> [--profile F] [--plan F] [--out PATH] [--project NAME] [--manifest F] [--sla-secs N] [--poll-secs N]Live compose provisioning for the env slot. compose-gen is the deterministic, docker-free core — maps an infra profile (--profile, else .faff/infra-profile.json) through the built-in DATASTORE_TABLE to a docker-compose file (--out, default .faff/env/docker-compose.yml) and prints a ProvisionPlan (services, endpoint, health_checks[], seed_targets[], unprovisionable[]; each health_checks[] entry's path is a probe descriptor, not always a URL path — a URL path for an HTTP app service (expected_status: 200), or a full probe command for a datastore service (expected_status: 0)); byte-identical across runs (no wall-clock/random). An unknown datastore kind is reported in unprovisionable[] (the producer fails loud), never silently skipped. When the repo ships its own committed compose (docker-compose.yml / compose.yaml / …) that declares a single buildable app service, compose-gen reconciles the synthesized app against it — its port, environment (incl. DATABASE_URL, with datastore hosts realigned to the generated service names), build context/dockerfile, and healthcheck win over the profile-shaped defaults (the healthcheck is taken verbatim, and a synthesized fallback never assumes curl); with no repo compose the output is byte-identical to profile-only synthesis. The reconcile also covers the datastore tier: each generated datastore service inherits the repo datastore service's auth env (POSTGRES_USER/POSTGRES_DB/POSTGRES_PASSWORD, etc.) merged over the table default (so the role/database the app's connection string binds to are actually created), and the app service gains a depends_on: { <store>: { condition: service_healthy } } gate so a connect-at-boot app doesn't race the datastore. The live verbs touch docker: up runs compose up -d (with --project-directory <repo-root>, so a relative build context: . resolves to the repo root rather than the generated-compose dir) + health-waits to --sla-secs (default 60, --poll-secs 2); seed realises the dataset (faff fixtures realise --manifest) and loads per seed_targets (sql-load = postgres/mysql/sqlite; mount = the provisioned-but-unseeded fallback for redis/mongo until an engine-native loader lands); down runs compose down -v (idempotent) — resolving the same compose context up used when the default generated compose file exists (--project-directory + -f + --remove-orphans, which covers a stale or other-project file at the default path), else the label-based -p-only form. Every verb inherits the ambient engine context: the docker CLI resolves DOCKER_HOST itself; faff never sniffs sockets, never sets DOCKER_HOST, and never falls back to the default socket when DOCKER_HOST is set but dead — an unreachable engine is a loud terminal error naming the effective context (DOCKER_HOST=…, or default socket when unset). That ambient model is what makes the verbs engine-agnostic across host daemons and rootless nested engines; rootless caveats (storage driver, cgroup delegation, port-publishing loopback) are cage-image preconditions, not faff's — the joint acceptance runbook at docs/reference/cage-engine-acceptance.md covers them. The default faffter-noon-env-compose producer orchestrates these and emits the faff-contract:env-handle.
eval affected [--surfaces a,b,…] [--diff <ref>] [--json] [--root DIR] [--selftest]Advisory (non-contract) deriver of the affected eval --kind subset a change needs: composes each touched skill surface's judgement_seam: frontmatter with eval/seam-registry.json (the KIND→surface SSOT) so the operator-owned eval-sweep-gate can re-baseline a scoped subset instead of a full frontier sweep, or skip on none. Touched surfaces come from --surfaces (comma list) and/or --diff <ref> (git diff --name-only <ref>...HEAD, via an argv-array, never a shell string); at least one is required (else exit 2). Fail-safe to full, never under-recommend: none is emitted ONLY when every touched surface is confidently non-grading (judgement_seam: none or owns no graded kind); any doubt — an unresolvable diff ref, a touched file outside any plugin/skills/<surface>/, an undeclared (null-frontmatter) surface, a seam whose registry row names a different surface, or an unavailable registry — resolves to full with a reason. Plain stdout is one line (subset → the comma-joined sorted-unique kinds, usable directly as run-evals.mjs --kind; none — …; full — <reason>); --json emits {verdict ∈ none|subset|full, kinds (sorted+unique), surfaces, reason}. Reuses validate-adapters.js's readJudgementSeam/loadSeamRegistryForLint (no re-parse); --selftest runs the in-module case table. exit 0 for any classification (none/subset/full all valid) / 2 usage.
events <append|validate|read> --run <run-id> [--ts ISO] [--tokens] [--file F] [--type T] [--issue I] [--json]Structured run-event log — the timeline substrate for run observability. append adds one RunEvent (the CLI fills the schema/run_id/seq/ts envelope; seq = current line count is the authoritative monotonic order, ts best-effort) to the append-only .faff/runs/<run-id>/events.jsonl; validate checks a JSONL stream line-by-line; read filters it. --tokens (opt-in on append) injects a four-class token delta into the event's data: data.tokens = {input, output, cache_write, cache_read} (spend since the run's last checkpoint, measured via the same transcript-sum + child-attribution path budget check uses) and data.tokens_source (transcript when metered, or estimate with tokens: null when no transcript is readable); it also advances the ledger's budget.tokens_at_last_event checkpoint and stamps data.ledger_sha256_before/data.ledger_sha256_after — the ledger digest this locked write saw and left, so an orchestrator holding an integrity-digest custody baseline can close its mid-bracket re-baseline sequence without a second read. Counts-only (never prompt/response payload), and schema stays 1 (additive under the free-form data). Absent --tokens, the record is byte-identical to before (no measurement, no ledger read). Emitters tag phase-closing events only. An optional data.effort label (one of low|medium|high|xhigh|max) may be supplied in the append payload to record the request-time reasoning-effort a dispatch used — validated against that closed vocabulary, additive, non-leak (a single label); economics --by effort pivots it. An issue-outcome event may also carry an optional data.gate (which quality gate — structural|adversarial|holdout|ci — caught a non-shipped build) and data.rework_turns (a non-negative integer fix-loop count) — both validated, additive, non-leak (single scalars); faff quality pivots them. The in-flight view and morning report are later producers that read this log. append's run dir is worktree-aware: without an explicit --root, it resolves .faff/runs/<run-id> against cwd first and, if absent there, against the MAIN checkout (via git rev-parse --git-common-dir) — so an append from inside a linked build worktree lands in the main checkout's events.jsonl, not a missing worktree-local one; an explicit --root is a strict escape hatch with no such fallback.
events anchor --run-dir DIR --issue ID --dest DIR [--check] [--json]Snapshot one issue's chain evidence from a run dir to an immutable, committable per-PR anchor (graft Step 9b). The mint stages the anchor under os.tmpdir(), validates exactly those bytes with evidence validate's check, and copies them to --dest only on a pass, replacing a prior anchor there wholesale; a refused mint writes nothing under --dest or its parent. Flag and usage checks (exit 2), the ledger-fold check (exit 1) and the floor-incomplete check (exit 3) come first. Refusals, one stderr line per failing file (at most five, then (+N more files)) carrying a path, status and violation count and never violation text: exit 3 schema-unavailable <reason>, schema-check-error <reason>, unschemaed-file <path>, schema-mismatch <path>: <status>, <n> violation(s) (a legacy anchor is refused here too), anchor-shrink <path> (a re-mint that would drop a file from the anchor already at --dest); exit 2 dest-not-directory (a symlink or non-directory) and dest-not-anchor (a non-empty --dest that is not a prior anchor). --check runs every check and exits with the code the real mint would, then deletes the staged anchor and never touches --dest, printing events anchor --check: ok on success; with --json it also prints the staged anchor's full validation report (violation text included, known secrets redacted) for a local operator, and exits 2 with no report if the redaction config cannot be read. Never paste --check --json output into a tracker comment, a PR body or a committed file. anchor-run and the bundle re-mints do not validate.
evidence capabilities --jsonPrints what this CLI's evidence validate supports, { "validate": ["require-evidence-schema", "candidate-schemas", "holdout-binding"] }, and exits 0. The governance-check Action reads it from the PR base commit's CLI to decide whether to offer candidate schemas and whether the base checks the holdout binding; probing flags would not work, since an unknown flag exits 2 just as schema-unavailable does. A CLI without this subcommand is treated as listing nothing.
evidence validate <anchor-dir> [--require-evidence-schema] [--json] [--candidate-schemas <dir>]Read-only check of one per-PR anchor directory against the bundled v0.3 evidence schemas (plugin/skills/faff/contracts/evidence-v0.3/, a byte-identical copy of verification/evidence/v0.3/; the CLI never reads the anchor's or the checkout's verification/). Reports pass, fail or legacy. An anchor is legacy when no present evidence document carries schema_version; legacy is decided first, runs no schema checks and wins over an unmanifested file. Otherwise every file is validated against the schema its manifest entry names, JSONL files line by line with eventViolations / declaredEffectViolations as well, and a file with no manifest entry fails as unschemaed. A torn tail (a final line with no newline that does not parse) is skipped and reported as torn_tail: true; any other unparseable line fails the file. No violation message quotes a data value. --candidate-schemas <dir> checks the anchor against a second v0.3 directory (in CI, the PR head's copy) only where every change from the bundled schemas is purely additive: annotation edits, or a new optional, typed, closed property on a closed object (an array node must also declare items). A changed anchor-manifest.json, an unloadable or escaping file, or any other difference falls back to the bundled schema for that file and is listed in candidate_rejected; a candidate fault never changes the exit code. --json prints { status, anchor_dir, spec_version, files: [{ path, status, violations, torn_tail? }] }, plus schema_source (base or candidate) per file and a top-level candidate_rejected: [{ path, reasons }] when --candidate-schemas is given. Exit 0 pass or legacy / 1 fail, or legacy under --require-evidence-schema / 2 usage error, missing directory, or an unreadable bundled manifest or schema (schema-unavailable <path>). evidence --selftest validates every bundled example and builds temp anchors for the pass, legacy, unschemaed, extra-property, torn-tail and mid-file cases. The command writes nothing; the same check refuses a non-conforming per-PR mint (events anchor) and fails the governance-check Action under require. A holdout.json must also carry the issue named by chain-head.json (a mismatch, or no chain-head.json, fails the file with holdout.json: issue does not match anchor issue) and meet the writer-only holdout constraints.
evidence write spec-review-verdict --run-dir <dir> --issue <id>Write the v0.3 spec-review-verdict.json for one issue from a carried ## Spec-review evidence comment (or a committed spec holding one) read on stdin. Verifies the block's sha256: line, so an edited, summarised or pre-collation block is refused; applies the known-secret redaction; validates against the bundled spec-review-verdict-anchored schema plus the founded-verdict, enum and round-range checks; writes through a temp file and a rename. Path guards: --issue must be a bare id, and --run-dir must resolve inside .faff/runs/ of the working or main checkout (symlinks resolved). Exit 0 written; 1 input refused, nothing written; 2 usage, path-guard, IO or redaction-config fault, nothing written.
evidence write ac-checklist --run-dir <dir> --issue <id>Write the v0.3 ac-checklist.json for one issue from {all_verified, criteria?: [{ac, verified, passed, ac_id, verifications?}]} on stdin (graft Step 8). Stamps schema_version, keeps ac/verified/passed/ac_id/verifications per criterion and drops every other key, and applies the known-secret redaction. ac_id is the qualified id (faff-1287#ac-3); verifications is a list of `{kind: test
evidence write human-only-acs --run-dir <dir> --issue <id>Write the v0.3 human-only-acs.json for one issue from {issue, level, unattended, human_only} on stdin (called by faff pr open), then append one human-only-acs-stamp event carrying the SHA-256 of the exact bytes written. Stamps schema_version and faff_version. Refused: an issue that differs from --issue (case-insensitive), unattended true at L1 or L2, unattended false at L4, a duplicate id, an id that does not parse, and an id naming another ticket. Exit 0 written; 1 input refused, nothing written; 2 usage, path-guard or IO fault, a run dir with no events.jsonl, or a failed stamp append (the file is removed again).
evidence render ac-checklist --run-dir <dir> --issue <id>Print graft's PR-body ## Acceptance Criteria block from the written ac-checklist.json (graft Step 8): one - [x]/- [ ] line per criterion with its ac_id in a code span, a Verified: line, and one Method: line per verifications entry; No acceptance criteria. for a zero-AC anchor. Validates the anchor against its schema and the writer's rules first, so an anchor that fails either prints nothing. Same path guards as the writers. Exit 0 block printed; 1 anchor missing, invalid or breaking a writer rule; 2 usage or path-guard fault.
evidence record-review-round --run-dir <dir> --issue <id> [--prior-dir <dir>]Record one code-review pass (graft Step 9) as review-rounds/round-<n>.json, n one above the highest recorded round, from its faff-contract:review-verdict block on stdin with the pass's dispositions folded in. Refuses (exit 1) any signal but pass, fail or needs-human (an outage pass records nothing) and findings that are not an array of objects. Ignores a supplied finding_id: each finding's id is what resolveRoundChain decides over the contiguous run of recorded rounds ending at this one, honouring the reviewer's carried_id only as it accepts it. An out-of-enum severity, disposition or source, or a non-string carried_id, is written as null with a stderr warning that names the key path, never the value. --prior-dir (graft's build-review/ directory, on a dialogue-loop pass) translates each P<k> handle from that directory's highest round into the handle of the finding with the same normalised file and title in the previous review-rounds/ record, or null with a warning when there is no single match. Writes through a temp file linked to the target, so two concurrent calls never record the same round. Same path guards and redaction as the other writers. Exit 0 recorded; 1 input refused; 2 usage, path-guard, redaction-config or IO fault, a --prior-dir outside the issue directory, an unreadable or schema-invalid existing round record (named), or a round number taken by a concurrent call; nothing written on a non-zero exit.
evidence write review-verdict --run-dir <dir> --issue <id> [--park needs-human|unavailable | --judge-admitted]Collate every recorded review-rounds/round-<n>.json into the v0.3 review-verdict.json (round_history: "recorded", rounds_total = the number of rounds). Findings merge on the resolveRoundChain id, re-resolved from the stored carried_id, title and location with resolution restarting at a gap in round numbers; each merged finding keeps one occurrence per round, its latest location, and its other fields from the highest-severity round. Settlement: the terminal round's own disposition for a finding it raised (default and judge modes), else a recorded refuted or accepted-risk, else fixed when the loop ended in pass and open otherwise. The default mode takes the terminal round's signal and refuses (exit 1) no rounds or a fail terminal round. --park needs-human and --park unavailable write that signal with zero or more rounds and never settle a finding fixed. --judge-admitted writes signal: "pass" and admitted_by: "build-judge", refusing (exit 1) unless rounds exist and build-review/judge/admit-result.json records admit: true. Any two of --park, --judge-admitted and --terminal-only exit 2. A round record that fails to parse or validate is refused, named. Same path guards, redaction and temp-file write as the other writers. Exit 0 written; 1 refused, nothing written; 2 usage, path-guard, IO or redaction-config fault.
evidence write review-verdict --terminal-only --run-dir <dir> --issue <id>Write the v0.3 review-verdict.json from a terminal review-verdict block on stdin, for a review whose earlier rounds were not recorded: rounds_total: 1, round_history: "terminal-only", every finding null-filled with its finding_id and one occurrence. Keeps adversarial_outcome, drops other unknown keys, redacts known secrets. Before the file lands it appends one evidence-terminal-only event to the run's events.jsonl; a run dir without one, or a failed append, exits 2 with nothing written. Refuses (exit 1) signal: unavailable, which the outage park writes through --park unavailable, and a run dir whose issue holds review-rounds/round-*.json. Graft no longer calls it; it stays for manual recovery.
evidence return --run-dir <dir> --issue <id>Lane side of return-by-digest. Prints one EvidenceReturn JSON line, {"issue", "ac_checklist":{"present","sha256"}, "review_verdict":{"present","sha256"}, "human_only_acs":{"present","sha256"}}, holding the leaf sha256 (the digest integrity-digest hash reports) of <run-dir>/<id>/ac-checklist.json, review-verdict.json and human-only-acs.json, with present:false, sha256:null for an absent file. A dispatched graft returns that line verbatim as its EvidenceReturn, so no file body crosses the HTML-escaping return channel. Read-only. Exit 0 printed. Exit 2 usage, a path or issue id rejected as for evidence write, an evidence file that is a symlink or not a regular file, or the hasher unavailable: nothing on stdout.
evidence verify-return [--against-ledger] --run-dir <dir> --issue <id>Dispatcher side of return-by-digest. Reads the returned EvidenceReturn line (or the literal null when the lane returned none) on stdin, re-hashes the three evidence files (rows in that order), and prints one verdict line: verdict (agree, mismatch or malformed), issue (always --issue), files (per-file returned_* and disk_* fields and a result of match, absent-both, presence-disagreement, hash-mismatch, not-regular-file or no-claim), evidence_persisted (the ledger entry to append; null unless it agrees with a file present), park_cause, paths and tampered_paths (the subset naming a changed file, for integrity_tampered). With --against-ledger the claim is the last evidence_persisted entry for --issue in <run-dir>/run-ledger.json (no entry means no claim) and stdin is not read; run it after the run-grain verify, before the merge locus. Read-only: it writes no file and never the ledger. Exit 0 agree. Exit 1 mismatch or malformed (a legacy body, bad hex, extra keys, or another issue's return). Exit 2 usage, a rejected path, a TTY on stdin, a missing or unparseable ledger, or a malformed digest in its entry, under --against-ledger, or the hasher unavailable: nothing on stdout.
evidence-readiness --since <rev> [--anchors-root DIR] [--json]The measurable exit criterion for switching on mint refusal. Re-validates, with the bundled v0.3 schemas at the current commit, every per-PR anchor first added to git in <rev>..HEAD under the anchors root (default .faff/anchors), and reports whether mint refusal may be switched on. A warning is one anchor whose status is not pass (legacy, fail or error), counted per anchor. ready needs: at least one anchor in the window; each of the seven evidence-writer tickets (a constant in the module) merged at or before <rev>, where a writer resolves to its pinned merge commit (a second constant in the module) when that commit is on HEAD's first-parent chain and its subject names (<ID>), else to the newest (<ID>) first-parent commit (no flag skips a writer or changes a pin); no dropped path; zero warnings; at least one qualifying beep-boop run (name contains -beepboop-, every window anchor bound and passing); every routine file observed in a qualifying-run anchor; and spec-review-verdict.json and holdout.json observed in a bound window anchor of any run. An anchor is bound when the commit that added it names its issue as a whole token. Paths with fewer than three segments below the anchors root (a README) are ignored; unsafe, traversing or symlink-escaping paths are dropped and block. It refuses a dirty or outside-the-repo anchors root. Output carries paths, statuses and counts only; --json names since, head and the seven writer commits. Exit 0 ready, 1 not ready (see unmet), 2 usage, a non-resolving <rev>, no git work tree, or the bundled schemas unavailable. Hand-off to enforcement: the slice that switches on mint refusal requires faff evidence-readiness --since <rev> to exit 0 at the commit it branches from and again at its own head before merge (so a v0.3 schema edit made inside that slice is covered), with the --json output pasted into its PR description. Meeting it needs one beep-boop list run and one graft run with a holdout scenario after the seven writer tickets merge (the readiness proving runs, which that slice starts first). --selftest runs the criterion table.
review-progress <read|write> <run-dir> <issue> [--phase1-pass --diff-hash H | --phase2 STATUS [--findings PATH] [--attempts N] | --outage-retry]Per-issue review checkpoint at <run-dir>/<issue>/review-progress.json so a re-dispatched build subagent resumes the graft review step (skips a completed Phase-1/Phase-2) instead of repeating the slow adversarial second-opinion. read → ReviewProgress JSON (exit 0) / exit 3 when absent (no checkpoint yet — not an error). write --phase1-pass --diff-hash H records the passing Phase-1 verdict + the diff hash it was computed against (the diff-identity guard — a resume skips Phase-1 only when the current diff still matches). write --phase2 <pending|in_flight|complete|skipped_deadline|skipped_unreachable> records Phase-2 progress. write --outage-retry increments the top-level outage_retries counter (absent → 1; requires an existing record — exit 2 if none) for graft's retry-later hold on a mandatory-review unavailable verdict. Pure JSON (no tracker/network) — a hint, never authoritative over git/PR truth; exit 2 usage / bad status.
review-progress resume <run-dir> <issue> --diff-hash HFrom the review worktree, return a next-step hint for the captured diff. A matching pass can resume Phase 2 or reference a readable completed findings file. Advisory skips retain their recorded status. Use write --phase2 STATUS --expect-diff H to reject a late callback if the checkpoint moved (exit 3). Phase writes preserve the outage retry count.
build-progress <read|write> <run-dir> <issue> [--build-complete --diff-hash H --branch B]Per-issue build-complete checkpoint at <run-dir>/<issue>/build-progress.json — written at graft build-complete (Step 8b) after the branch is pushed to origin, so a re-dispatched graft resumes at review (recreating the worktree from origin/<branch>, skipping the build) instead of rebuilding. read → BuildProgress JSON (exit 0) / exit 3 when absent (no checkpoint yet — not an error). write --build-complete --diff-hash H --branch B records the remote-three-dot diff hash it was gated at + the pushed branch (the diff-identity guard — a resume skips the build only when the current remote diff still matches). Pure JSON (no tracker/network/git — the hash is computed in graft prose); a hint, never authoritative over git truth; exit 2 usage / missing flag.
landing-progress <read|record-fix-cycle|clear> <run-dir> <issue> [--kind conflict|regression --head-sha SHA [--failing-checks a,b] [--tried x,y]]Per-issue persisted fix-cycle counter at <run-dir>/<issue>/landing-progress.json, siblings of review-progress/build-progress — so a future landing loop's conflict/regression fix-cycle count survives a firing boundary (a beep-boop run ending and a later run resuming the same issue). read → LandingProgress JSON (exit 0) / exit 3 when absent (no cycles yet — not an error). record-fix-cycle --kind <conflict|regression> --head-sha SHA [--failing-checks a,b] [--tried x,y] appends one history entry and derives fix_cycles from history.length (invariant: fix_cycles == length(history), holds by construction) — exit 2 on an unknown --kind, a missing --head-sha, or an existing fix_cycles == 3 (the caller must hard-park at 3; this record never silently clamps a 4th write). clear removes the record; idempotent (exit 0 whether or not it existed). Pure JSON (no tracker/network/git — the fold is total and side-effect-free); atomic tmp+rename write; a malformed on-disk file reads as null (schema-tolerant). No loop integration — this ticket ships only the record, the pure fold, the CLI verb, and the selftest.
resume-store <stash|restore|read> --issue ISSUE [--run-dir DIR] [--cause review-outage|build-review-dialogue] [--fix-rounds-used N --rebuttal-rounds-used N] [--store-root DIR]The resume store at <store-root>/<issue>/ (default .faff/resume) that carries a held graft build into the next drain's fresh run dir. stash copies every top-level regular *.json in <run-dir>/<issue>/ except hold.json and spec-review-hold.json, plus review-rounds/ and build-review/ recursively, keeping file modes and mtimes and skipping symlinks; it keeps any spec-review-hold.json prep left in the store byte for byte, writes the hold record hold.json ({schema_version, issue, cause, stashed_at, carried, dialogue?}), publishes the new store by rename and prints the record. dialogue ({hold_count, next_round, fix_rounds_used, rebuttal_rounds_used, stage}) is present when build-review/ holds a round file, and then both counter flags are required; next_round is the disk-derived round counter and a build-review-dialogue stash adds 1 to the prior record's hold_count. stage is judge when build-review/judge/ledger.json is a regular file in the issue dir at stash time (the build judge was mid-assemble), else dialogue (a directory or symlink in its place reads as dialogue); the stash derives it from disk, no flag sets it, an absent stage in a record written earlier reads as dialogue, and a record with a stage outside dialogue, or a value other than those two, is out of shape. restore copies the same set back into <run-dir>/<issue>/ after proving the stashed and staged rounds match next_round and, for a judge stage, that the judge ledger travelled, and refuses (exit 1, run dir unchanged) on a mismatch, a dialogue store without hold.json, a judge-stage store without a judge ledger, a run dir whose review-rounds/ or build-review/ is non-empty or a symlink, or a directory where a carried file would land. read prints the record. A store without hold.json reads and restores as {"cause":"review-outage","legacy":true}. Every subcommand takes a per-issue lock (.<issue>.stage, stale after 10 minutes) and first repairs a publish torn by a crash. Exit 0 done, 1 refused, 2 usage error, bad --issue, unknown cause, out-of-shape record or I/O fault, 3 no store (restore/read), 4 the issue lock is held. --selftest checks mode and mtime preservation and a lock taken over mid-stash.
resume-store prepare-hold --run-dir DIR --issue ID --cause review-outage|build-review-dialogue --mode interactive|autonomous [--resumed] [--fix-rounds-used N --rebuttal-rounds-used N] [--store-root DIR] [--root DIR]Prepares one local build review hold per source run and issue. Reads the relevant cap, publishes checkpoint and retry receipt together under the issue lock, and repeats the same result on retry. --resumed distinguishes a lost restored hold from a first hold. Returns hold with the role, notice and token, park with a reason and signal, or stale if a later hold superseded this run. Exit 4 means the lock is busy. Tracker changes, claim release and terminal verdicts stay with the caller. Existing stash and restore commands support older records.
effects <declare|observe|check|reconcile-merges|verify> --run <run-id>|--run-dir <dir> [--issue ID] [--step NAME] [--ts ISO] [--json]Escaped-side-effect detection via a declared-effects ledger — the producer of the escaped-side-effect signal Sentry (the kill-switch) consumes. reconcile-merges is the off-ledger landed-merge DETECTION backstop check alone cannot provide: check is a pure comparison over the ledger, so a protected merge performed with zero declare/observe activity (direct-git, off the governed path entirely) never touches it and reads clean. reconcile-merges --run <id>|--run-dir <dir> [--issue ID] [--json] instead reads this run's landed merges directly from git ground truth — the protected branch's first-parent history since the base_sha recorded at run mint — and diffs them against this run's declared/observed merge effects, emitting {reconciled, uncovered: [LandedMerge], any_escape, fault, forge_enriched, legacy_exempt}. An in-window landing with no derivable issue key is surfaced issue:null (never dropped, fail-safe); a landing is covered by either an attribution match (its issue has ANY declared/observed merge effect) or a target match (pr:<N> / commit:<sha> cross-matched via the commit subject or merge-record.json.head_sha, never coupled to forge/gh uptime — forge_enriched:false is logged only, it never sets any_escape). legacy_exempt:true (a run minted before this feature, no post-feature mint marker) is CLEAN, never a false positive on deploy; reconciled:false (a primary-read fault, or a post-feature run with no recorded base_sha) is NON-clean. Detection only, never prevention — see faff effects reconcile-merges --describe for the accepted limits (the declared-effects ledger this judges against is writable by the same actor authorised to merge; genuinely closing that gap means mediating the merge itself so it cannot be performed off-ledger at all, which is out of scope here). Wired into the beep-boop between-units checkpoint immediately after check (faff-beep-boop/SKILL.md → The interrupt): forbidden := check.any_escape OR reconcile.any_escape OR (reconcile.reconciled === false). declare / observe read an EffectDescriptor ({kind ∈ a closed effect vocabulary, target, reversible?}, object or array) on stdin and append a LedgerEntry (the CLI fills the schema/run_id/seq/ts envelope; kind_of_entry/issue/step required) to a parallel .faff/runs/<run-id>/declared-effects.jsonl — never an events.jsonl schema bump; exit 0 ok / 1 bad descriptor (unknown kind / missing target) / 2 malformed JSON or a missing --run/--issue/--step / 3 run-dir missing. check computes observed-minus-declared per (issue, step) with exact-target + * matching and emits {escapes: [EscapeSignal{signal:"escaped-side-effect", issue, step, escaped[], event_seq}], any_escape} (--json); a missing ledger file is a clean state ({escapes:[], any_escape:false}, exit 0 — not exit 3). Detection only — it never aborts (that is the kill-switch's / recovery's job); the orchestrator bridges any_escape into Sentry via faff sentry check's --forbidden-side-effect CLI flag (the signals.forbidden_side_effect seam's CLI surface), run immediately after this check at every between-units checkpoint. declare/observe share one append core, appendEffectEntries (validates every descriptor before writing any, all-or-nothing; merge-gate calls the same helper for its own mechanical observe — see that row). merge-gate --execute is the first mechanical producer: graft Step 10 declares a PR's merge (+ branch-delete iff requested) before handing off to it, and merge-gate observes what it actually did after a confirmed merge — real declared-vs-observed pairs, and a real uncovered-observe warning, exist end to end at that one chokepoint. Pure (no tracker/network; writes only under the run dir). The run dir is worktree-aware: without an explicit --root, declare/observe/check resolve .faff/runs/<run-id> against cwd first and, if absent there, against the MAIN checkout (via git rev-parse --git-common-dir) — so a call from inside a linked build worktree reads/writes the main checkout's ledger instead of exit-3ing or false-reporting clean against an empty worktree root; an explicit --root is a strict escape hatch with no such fallback.
commissaire <object> <action> --run-dir DIR [--producer ID] [--contract-revision R] [--scope kind,kind] [--unit-id U] [--step S] [--governor-dir D] [--producer-dir D] [--json]The external Commissaire facade (Phase 2A) a second producer (any actor that is not faff's own runner) drives to produce authenticated governed facts and a Commissaire-signed protected-effect decision, using only this CLI and documented artifacts. The surface is a noun-verb object grammar over the governed objects contract / effect / verdict / audit: contract admit, effect declare, effect authorize, effect observe, effect reconcile, verdict conclude, audit seal, audit export, audit verify. The seven original flat verbs are retained as compatibility aliases (admit, declare, request-decision, observe, reconcile, terminal-verdict, seal-bundle), each resolving to the same handler as its object-verb form (an alias never carries a second implementation). effect authorize (alias request-decision), verdict conclude, and audit seal (aliases terminal-verdict / seal-bundle) are all built to depth in-process — none shells out to events anchor / bundle; audit export copies an already-sealed bundle's manifest and members to a destination directory. Split-key trust: a producer holds only a symmetric K_producer (HKDF-derived from a governor-held master_secret) and HMACs its own claims (declare/observe/request records, author:"producer"); only Commissaire holds the Ed25519 SK_commissaire and signs decisions (effect-decision-verdict, author:"commissaire"), so a producer that HMACs a fake verdict produces a record that fails verifyDecision (the round-1 infosec fix). admit mints the governor keypair + master into --governor-dir (default <run-dir>/commissaire/governor), delivers K_producer + publishes PK_commissaire into a SEPARATE --producer-dir (default <run-dir>/commissaire/producer), records the admitted scope, and refuses when the two dirs coincide (the SK and any producer key must never share one custodian). declare/observe append schema:3 EffectDescriptor records (HMAC'd); request-decision reads {effect, evidence_seq?} on stdin, evaluates every leg (admitted, producer-auth, scope, descriptor, freshness, coverage, assurance floor) and appends an Ed25519-signed grant-or-deny {verdict, reason, verdict_seq}; reconcile runs computeEscapes (verb-4 detection persists alongside the decision). Canonicality is per record kind (v5 ADDENDUM-1 decision 2): schema:3 and schema:2 records share one declared-effects.jsonl hash chain; on a governed run a merge or PR create that carries a valid Commissaire grant is canonical in schema:3 and its schema:2 observe is suppressed, every other effect kind stays canonical in schema:2, and computeEscapes reads both, so no record is canonical in both schemas. Records are signed, never encrypted (a transparency log). Prevention is not this facade's act: a chokepoint on the effect path (the worked example is merge-gate's pre-merge floor) calls verifyDecision and refuses the effect unless it is a genuine covering grant; generic effects with no chokepoint are detection-only. --unit-id names the work unit the record belongs to; new schema:3 records carry it as unit_id, frozen records keep issue and stay readable, and a record carrying both keys is rejected. --issue is accepted as a deprecated alias of --unit-id for one release (one stderr notice; passing both is a usage error), and summary JSON output carries both issue and unit_id for the same release. Imports neither SuperDomestique scheduling nor any faffter-* skill (region:factory, requiring only the governance cores). Exit 0 ok / 2 usage or bad payload / 3 run dir missing. audit verify (the first operation under the audit object namespace) is the secret-free external replay seam: it re-authenticates a schema:3 ledger from a published pk.json alone — no governor or producer secret, no --selftest — as a thin read-only projection of verifyAuthLeg, and prints a stable, versioned JSON contract (version, result, producer_claims with three buckets, commissaire_decisions, pk_fingerprint, ledger_failures, per-record records). Producer claims report separately as verified / unverifiable_without_secret / failed (an unchecked claim is never folded into a pass); missing key material or a bad decision signature fails closed. It carries its own exit contract, distinct from the sibling verbs' 3: 0 valid decisions with an honest producer classification, 1 verification failure, 2 invalid invocation or setup (missing --run-dir or no schema:3 governance context).
scenario-matrix <record|render> [MATRIX.jsonl | --in FILE] [--selftest]The nine-scenario Phase 0 reference-matrix emitter — a cross-oracle evidence tool, deliberately outside the Commissaire facade (whose fixed objects are contract/effect/verdict/audit; this is none of them), so it gets its own top-level group. record reads one scenario-result JSON on stdin and writes a canonical ScenarioRecord (schema:1) JSON to stdout via the pure buildScenarioRecord emitter — computing the assurance_vector FROM the disposition_basis (journal class J-C only on a verified producer HMAC leg else J-D; effect class E-B only when the disposition is blocked; organisational_independence always false; isolation fixture; review mechanical) and failing LOUD (exit 2) rather than banking a dishonest record: a claim_label that implies E-B on a non-blocked row or non-repudiation on a producer HMAC leg, a two_custodian_split_verified that is not true, a one_shot_control present/absent disagreeing with the catch-ordinal rule {2,3,5,6}, or a missing run_id/work_item_id. render reads a matrix.jsonl path (positional or --in FILE) and writes REPORT.md deterministically via the pure renderReport (records sorted by scenario_ordinal, no timestamps/randomness), so a clean checkout re-banks byte-identically. The emitted record is re-validated by faff contract scenario-record; the nine banked records + the deterministic report live under verification/evidence/ (the Phase 0 reference-matrix bundle), reproduced by test/phase-0-matrix.test.mjs. Exit 0 ok / 2 usage, bad payload, or an honest-claim guard throw; --selftest runs the in-memory emitter/guard/render table.
lint-refs [--root DIR]Ban external-artifact refs (ticket tags, ADR citations, numbered ADR-file pointers) in enforced prose — scans docs/guide/**; names each file:line ✗ match and exits 1 on a hit, else 0.
lint-cli-doc [--root DIR] [--json]Assert docs/guide/cli.md documents every subcommand the CLI dispatches (the COMMANDS registry), bidirectionally — names each ✗ missing/✗ orphaned and exits 1 on drift, else 0.
lint-cli-coverage [--root DIR] [--json]Assert every subcommand in the COMMANDS registry is tested by something — a non-null REGION_SELFTEST_ARGV selftest, or a declared test/*.mjs file for a null-selftest command. Bidirectional and fail-closed: names each ✗ uncovered/✗ orphaned/stale-declaration and exits 1 on a gap, else 0.
cli-surface --json | --selftestThe declared, machine-readable CLI grammar — a per-verb {kind, subcommands, flags, required_flags} descriptor assembled from each dispatch module's own exported SURFACE + accepted-flag CommandSpec (never a re-listing), in bijection with COMMANDS. --json prints the full map (kind ∈ subcommand_dispatch|positional|flat; flags: null = no declared spec, an unknown accepted set, never an empty one). --selftest asserts the bijection, a pinned classification for each dispatch verb (a real member of its live vocabulary) plus the three pinned positional verbs, and that every declared required_flags name is itself in the verb's own accepted-flag set; exit 0 clean / 1 violation(s) / 2 usage. The scaffolder CLI-surface drift-guard imports this module's SURFACES directly (never spawns faff <verb>) for both verb/subcommand existence and the flag-layer assertions (unknown flag, missing required flag) on RUNBOOK command-block lines.
regions <list|check|selftest> [--json] [--region governance|factory|all] [--base REF]The logical governance/factory boundary inside the CLI, enforced structurally over its real require() graph. list prints the single in-code region map (command → region; --json for the object). check builds the file→region map from each entrypoint/bin/lib module's own region banner, then walks each governance/shared-infra module's require("./…") edges against it — a governance file requiring a factory file, or a shared-infra file requiring any local module, is a violation naming both files, their regions, and the require line (comment/string-embedded require-shaped text is ignored); exit 0 clean / 1 violation(s) / 2 malformed (a file with no region banner, mixed-region banners, an unknown region, a non-literal require argument in a bound file, a bound file's require resolving outside the source set, or map/registry drift); there is deliberately no suppression mechanism. Before the require-graph lint, check also runs the TS-first leg over every file under bin/lib, recursively: a .js, .mjs or .cjs module with no .ts source of the same path that is not listed in plugin/skills/faff/legacy-js-modules.json (the sorted, shrink-only allowlist of legacy JavaScript modules) exits 1; an allowlist entry for a file that is gone or now has a .ts source exits 1; with --base REF, an allowlist entry absent from the allowlist at REF (or, when REF has no allowlist, from REF's own unpaired modules) exits 1. A .ts not listed in tsconfig.json include, an absent, unparseable, unsorted or duplicate-entry allowlist, an entry that escapes bin/lib or is not a JS path, a symlink (to a file or a directory), a .mts/.cts source, a name with a control character, an unknown REF or any other git failure exits 2. --base accepts only a plain ref ([A-Za-z0-9._/-], not starting with -), and every name in a TS-FIRST line is JSON-quoted. CI passes --base with the pull request's base, or with the commit a push to main replaced. selftest spawns each member command's own --selftest per an explicit full allowlist (default --region all) and prints a per-command pass/fail table — a governance member without a selftest is fatal; a factory one is reported no-selftest, non-fatal; exit 2 before any spawn on allowlist drift (a command missing from the allowlist, or a no-selftest entry whose handler now carries a selftest branch).

Most are invoked by the skills and hooks for themselves. A few are handy by hand — e.g. faff config get <dotted.key> to read a value from your config, or faff validate-adapters --configured to pre-flight your swapped-in slots before an unattended run.

Running it by hand​

The binary lives at plugin/skills/faff/bin/faff inside the installed plugin. Locate it and (optionally) symlink it onto your PATH once:

faffbin=$(find ~/.claude -path '*/skills/faff/bin/faff' -type f 2>/dev/null | head -1)
ln -s "$faffbin" ~/.local/bin/faff # then add ~/.local/bin to PATH if it isn't already
export PATH="$HOME/.local/bin:$PATH"

Or just call it by that full path. (Inside skills and hooks it's resolved automatically — command -v faff first, then the install-relative path — so you never have to set this up for normal use.)

Commissaire as its own CLI​

Commissaire — SuperDomestique's governance system — is also reachable as its own commissaire binary, not only as faff commissaire …. scripts/link-skills.sh symlinks it beside faff; to locate and symlink it by hand:

cmsrbin=$(find ~/.claude -path '*/skills/faff/bin/commissaire' -type f 2>/dev/null | head -1)
ln -s "$cmsrbin" ~/.local/bin/commissaire # the same ~/.local/bin as faff

A marketplace install does not put commissaire on PATH; link it by hand as above, or run scripts/link-skills.sh --global from a checkout.

To roll the binary back, remove the symlink. scripts/link-skills.sh --global --unlink removes both faff and commissaire from ~/.local/bin when they point into that checkout, and leaves a same-named link that points elsewhere alone; a hand-made link is removed with rm ~/.local/bin/commissaire. This touches only PATH. faff commissaire … reaches the same handler and stays available, and an installed governor runs its own copy of bin/commissaire by full path, so it is unaffected.

It exposes the noun-verb grammar commissaire <object> <action> (e.g. commissaire contract admit, commissaire contract status, commissaire effect authorize, commissaire audit verify) — dispatching into the same handler faff commissaire … reaches, so both forms behave identically.