Skip to content

Exit Behavior

DiffPal uses process exit status to distinguish completed review, blocked review, setup problems, provider problems, publishing problems, and internal tooling failures.

CodeMeaning
0Command completed successfully. Review may still contain findings when gate is disabled.
2Configuration, profile, provider validation, CLI flag, platform auth, or diff context/setup failure.
3Transient provider failure such as provider timeout or retryable provider error.
4Publishing or conversion failure, including platform API publishing and SARIF conversion.
5Internal tooling or local file/output failure.
10Blocking findings detected and --gate was enabled.
130Interrupted or cancelled by the process environment.

Success

Without --gate, a review command returns 0 when review, artifact writing, and any requested publishing complete. Findings can still be present and can still be marked blocking in artifacts and summaries.

Blocking Findings

With --gate, DiffPal counts findings whose severity meets diffpal.gate.block_on or --block-on. If any are blocking, the command returns exit code 10 after review output is written and publishing has been attempted.

Setup Failure

Exit code 2 covers invalid config, missing config, invalid feedback mode, invalid review channel, invalid instructions file, missing platform token, and missing host context such as base/head/repository metadata.

Review scope resolution failures are setup/context failures and also return 2.

Provider Failure

Provider validation failures return 2. Transient provider runtime failures return 3. Other provider/runtime failures return 5.

Publishing Failure

Host publishing failures return 4. This includes platform API failures and publishing file conversion errors. The diffpal sarif command also returns 4 for failed input reading, SARIF conversion, or SARIF output writing.

Behavior With And Without Gating

Gate enabledBlocking findings existExit codeFeedback/artifacts
nono0written/published
noyes0written/published, may report blocking status in output
yesno0written/published
yesyes10written/published before the gate error

Tooling failures return their failure code regardless of gate setting because the review result is incomplete.

Released as open source software.