0 and 1 are normal outcomes; 2 through 5 are failures. JSON on stdout does not change the exit code.
The six codes
A rejection (
3) means Shrike ran and made a decision. A 4 means Shrike could not make a trustworthy decision. Do not treat them as interchangeable in automation.
Per command
Partial results still follow the table: if a report has one removable file and one diagnostic, the exit code is
1, not 4. A diagnostic does not by itself change the exit code.
Configuration and usage errors
Exit2 covers conditions that are the caller’s responsibility:
- Unknown flags, missing flag values, or conflicting flags such as
--allwith--base, or--verbosewith--quiet. - A config that does not export an object, throws during evaluation, or times out. The message names the config path.
- A dirty working tree for
clean/prunein worktree mode, or forverifywithout--allow-dirty. ci installrefusing to overwrite an existing workflow that is not Shrike-managed; rerun with--forceafter reviewing it.--no-checks, which is rejected because a verified deletion needs at least one project check.
config_error or invalid_* code is also a usage error, not an internal failure.
Fail-closed conditions
Exit4 is deliberate. Examples:
shrike-engine was not found, an unsupported platform, or a checksum mismatch in the installed engine.- An engine timeout (
SHRIKE_ENGINE_TIMEOUT_MS) or a protocol mismatch. - A base ref that cannot be resolved by
git merge-baseorgit rev-parse. - No verification checks were found, and
--no-checksis not supported. - A batch could not be bisected conclusively.
- A requested build-evidence export is missing or unusable with
--require-build-evidence. - An installer action failed, including a path that would escape the repository through a symlink.
- A
verifyplan is stale becauseHEAD, the merge base, or the tree changed.
Verification and revert failures
Exit3 means at least one batch regressed and Shrike reverted it. Passing batches may still have been committed. Read the receipts to see which check failed and which symbols were rejected, then fix the project or the check and re-plan.
Exit 5 means the revert itself failed. Stop. The normal worktree and branch cleanup must not continue until the tree is restored:
recover restores only the files listed in the snapshot and rejects absolute or traversal paths. Do not hand-edit the worktree.
CI interpretation
The Shrike Action maps these codes into its step result.
fail-on: never is advisory: it reports the delta without failing on findings. fail-on: newly-dead fails when anything is newly dead. max-items fails when the count exceeds the cap.
In shell scripts, do not rely on set -e alone if 1 is an expected finding:
Next
- Commands — full command and flag reference.
- Cleanup report — interpreting findings.
- Verified pruning — exits
3,4, and5during cleanup. - Troubleshooting — fixes for common failures.