Exit codes

Every ciresk ci exit code, what it is mapped from, and what to do next.

The exit code is the verdict. check, test, build and lint are run <kind> --wait; run --wait, wait and summary all mirror the job. A failed job never exits 0.

ExitMeaningMapped from--json body
0Success: the job succeeded, or a read command completed2xxnormal
1Job failed: a task exited non-zero or a test failedjob state = failednormal, verdict: failed
2Usage: bad flags, not a repository, the tree over its limits, a manifest problemvalidation_failed, invalid_json, manifest_invalid, local checks{error: Problem}
3Auth: no token, expired, wrong regionunauthenticated, wrong_region (after one retry against the indicated region){error}
4Policy denied: full build without policy or scope, untrusted ref, forbiddenforbidden, insufficient_scope, policy_denied{error} with required_scope
5Budget exceeded: session, day or concurrency capbudget_exceeded, rate_limited after retries, concurrency_limited{error} with budget and resets_at
6Cancelled: by cancel, or Ctrl-C during --wait (the job keeps running unless --cancel-on-interrupt)job state = cancellednormal
7Timed out: the task's own timeout, or --max-wait elapsed while waitingjob state = timed_out, local timernormal or {error}
8Infrastructure: worker lost, lease expired without requeue, API unavailable, networkjob state = infra_error, unavailable, internal, transport errors{error}

A problem code this table does not name maps to exit 8 when its status is 5xx and to exit 2 otherwise.

What an agent should do

ExitDo
0Report the job id and the summary as evidence.
1Read the summary, run next, fix, re-run the same command.
2Read the message; it names the fix (ciresk ci init, a line in .ciresk/ignore).
3Stop and report; a person has to log in or set CIRESK_TOKEN.
4Do not retry with --full; run ciresk ci check, or pass the targets you changed with -p.
5Stop; the message names when it resets; report spend from ciresk ci budget.
6Report; do not assume the change is good.
7Run ciresk ci wait once more if the job is still running; otherwise report.
8Retry once after a pause; then report as an infrastructure problem, never as a code failure.

Exit codes 3, 4 and 5 are not code failures: a hook that gates a push blocks on them too, because the check did not run.