Reference
Exit codes
Normal rcf command outcomes use subsets of exit codes 0 through 5. Code 3 covers structural and other command-specific failures, code 4 identifies a deliberate refusal, and rcf verify run uses code 5 for a tripped gate. Foreground rcf audit view returns 130 on SIGINT.
Normal rcf command outcomes use exit codes 0 through 5, but individual commands use subsets and some meanings are command-specific. Foreground rcf audit view returns 130 on SIGINT, and rcf audit test-strength returns 130 on SIGINT and 143 on SIGTERM after stopping its test runs and removing its scratch directory. CI steps and scripts should branch on the contract for the command they invoke. In particular, rcf verify run uses 5 when its severity gate trips or its verdict is NOT-DEPLOYED, BLOCKED or LAUNCH-FAILURE, and rcf audit test-strength uses 5 when a criterion is blocked and none fails.
0: success
The verb did its job. Note that for the audit and validate verbs, "success" describes the run, not necessarily a clean bill of health in every mode: a clean rcf define validate exits 0, and so does a plain rcf audit coverage that reports gaps, because reporting is its job. It is --strict that turns a gap into a refusal.
1: unexpected failure
The crash class: an unexpected input/output failure or an error the verb did not anticipate, such as a filesystem that refuses a write. Handled read failures use command-specific codes: an unreadable --from-file exits 2, while an unreadable verify chain exits 3. rcf feedback also uses 1 by design, and rcf feedback --help lists each case: another rcf feedback command still held the project's feedback store when the wait ran out, a linked worktree's held queue could not move into the main checkout, submit filed an issue it could not record in time, or another command took the store over from this one. In each case stderr names what happened and nothing is lost. Outside those cases, if you meet a 1 reproducibly, that is a bug report worth filing.
2: usage
The command line itself is wrong: a misspelled verb, a missing argument, a flag the verb does not take. Also returned when a verb cannot run where it was invoked, such as a tree verb outside an initialised project, or when rcf init finds an existing config file it cannot parse and refuses to modify it. rcf verify run --hand against a loopback --url exits 2 without --engine and --served-sha, and either flag on a packed-package target exits 2. rcf verify run --out takes a file path: naming a directory exits 2 before any request reaches the target, and so does --out alongside --hand, where the report path is the verb's. rcf feedback add exits 2 when the .gitignore that should cover .rcf/feedback/ does not; in a linked git worktree that is the main checkout's. Retired forms exit 2 with a line naming what replaced them: rcf build finalise with --report, --max-report-age, --allow-pre-merge, --ship-without-eval, --ship-without-verified, --mode, --url or --provision-mode; rcf build backstop adopt and rcf build bundle --allow-unverified; and rcf audit separation --require-hand. In the release Verify, rcf verify run --release exits 2 on --record without --release and --since, a --since that is not a commit HEAD contains, a label holding a path separator or a dot segment, --mode or --offline, or no target or two. rcf define validate --base exits 2 on a ref that does not resolve. rcf audit test-strength exits 2 on a whole-run failure, before it scores anything: a missing or malformed rcf/test-strength.json, more mutants than --max-mutants, a bound test that is red before any mutant or that its runner did not run, a bound test run that wrote in the project, or a git ls-tree of HEAD that fails.
3: command-specific failure
Code 3 is command-specific. It covers validation, chain-load, soundness, capability, conflict or availability failures. For tree-validation paths, it means structural failure in the documents: a schema violation, a reference that resolves to nothing, or a required piece of the chain that is absent. rcf define validate exits 3 and lists the issues whenever the tree is broken. The same code backs refusals that are really soundness findings, such as rcf build finalise on an item whose touched acceptance criterion has no source file recorded against it, rcf define validate on a new or amended criterion that carries no verification flag, and a verification value other than external or testOnly. It also backs the capability-refusal on rcf define blueprint add: a blueprint that declares requiresAppliedCapabilities refuses at add time when its effective capability set contains none of the named capabilities. That set combines capabilities from applied blueprints with capabilities confirmed through custom-auth providesCapability elicitation, so a custom-auth answer can satisfy the gate without an applied shelf blueprint. The refusal message names the security-auth-* prefix so an operator knows which blueprint to add first. The named allowSkipFlag on the blueprint (--allow-no-auth-yet for both the shipped admin console and the shipped account-settings shell) records an acknowledgement on the sidecar and lets the add proceed with the capability-gated surfaces disabled. rcf define create <kind> --id and rcf define ledger <name> add --id exit 3 when the id already exists with different content, naming the differing fields; an identical replay exits 0 and writes nothing. Blueprint conflicts also exit 3, as does rcf version --check when neither the network nor a usable cache can provide an update signal.
4: refused
The tool understood the request completely and is declining it, by design. rcf build mark goes no further than inProgress: it refuses complete, which only rcf build finalise writes from the round's recorded verdicts, verified, which only a release Verify writes, and backward transitions such as moving a work item from inProgress back to notStarted. rcf define update <fbs-id> --set executionStatus=<status> is the deliberate correction override. rcf build finalise refuses without --ci-run, without a Review MERGE and adequacy PASS and a Test PASS at the same head, without a valid test-strength record for that head covering the touched criteria, or when the separation audit fails; every refusal leaves the item unchanged. rcf build bundle refuses without a green base-suite record for the base. rcf build verdict review and rcf build verdict test refuse a dirty working tree, a second verdict for the same head, and a PASS the review or the TAP does not support. A release Verify that fails exits 4, and --record refuses a dirty working tree. rcf audit test-strength exits 4 when a criterion fails, and rcf audit separation exits 4 on a violation. rcf audit coverage --strict refuses while any acceptance criterion in scope lacks a test whose pointer resolves, or while a supersession is broken. A 4 is never a malfunction: it is the referee doing its job, and the right response is to change the work, not the command.
5: gate tripped or blocked
rcf verify run exits 5 when its configured severity gate trips or its verdict is NOT-DEPLOYED, BLOCKED or LAUNCH-FAILURE. The command still writes its report. rcf audit test-strength exits 5 when a bound test or Code Node file the audit cannot read blocks a criterion and no other criterion fails; a failing criterion wins with 4, and a usage error with 2.
The site's drift checker checks only that every exit code it extracts from installed rcf-lite has a heading here. Its extractor is limited to codes 0 through 4, and it does not validate the meanings above or detect codes 5, 130 or 143. The forward-only lifecycle behind the refusal examples is explained in the five-stage build cycle.