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.
| Exit | Meaning | Mapped from | --json body |
|---|---|---|---|
| 0 | Success: the job succeeded, or a read command completed | 2xx | normal |
| 1 | Job failed: a task exited non-zero or a test failed | job state = failed | normal, verdict: failed |
| 2 | Usage: bad flags, not a repository, the tree over its limits, a manifest problem | validation_failed, invalid_json, manifest_invalid, local checks | {error: Problem} |
| 3 | Auth: no token, expired, wrong region | unauthenticated, wrong_region (after one retry against the indicated region) | {error} |
| 4 | Policy denied: full build without policy or scope, untrusted ref, forbidden | forbidden, insufficient_scope, policy_denied | {error} with required_scope |
| 5 | Budget exceeded: session, day or concurrency cap | budget_exceeded, rate_limited after retries, concurrency_limited | {error} with budget and resets_at |
| 6 | Cancelled: by cancel, or Ctrl-C during --wait (the job keeps running unless --cancel-on-interrupt) | job state = cancelled | normal |
| 7 | Timed out: the task's own timeout, or --max-wait elapsed while waiting | job state = timed_out, local timer | normal or {error} |
| 8 | Infrastructure: worker lost, lease expired without requeue, API unavailable, network | job 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
| Exit | Do |
|---|---|
| 0 | Report the job id and the summary as evidence. |
| 1 | Read the summary, run next, fix, re-run the same command. |
| 2 | Read the message; it names the fix (ciresk ci init, a line in .ciresk/ignore). |
| 3 | Stop and report; a person has to log in or set CIRESK_TOKEN. |
| 4 | Do not retry with --full; run ciresk ci check, or pass the targets you changed with -p. |
| 5 | Stop; the message names when it resets; report spend from ciresk ci budget. |
| 6 | Report; do not assume the change is good. |
| 7 | Run ciresk ci wait once more if the job is still running; otherwise report. |
| 8 | Retry 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.