You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Docs: document vg scan / vg build exit codes for CI gating #234
CI users gate pipelines on vg scan / vg build exit status but the public docs do not spell out which codes mean success, findings-above-budget, hard failure, or misconfiguration. Actionable, local-first CLI behavior needs an explicit exit-code table.
What to do
Document exit codes for vg scan and vg build (and note related report/sbom commands if they share the same convention).
Give a minimal CI snippet (shell or GitHub Actions) that treats “findings” differently from “tool crashed”.
Source of truth.src/util/exit.ts defines ExitCode: 0 OK, 1 ERROR, 2 GATE_FAILED, 3 NOT_FOUND, 4 NON_DETERMINISTIC, 5 USAGE_ERROR, 6 ENGINE_UNAVAILABLE (a missing optional module, kept separate from 2 so a CI gate can never read "engine missing" as pass or fail). Graph verbs throw CliError with one of these.
2 for every gate that trips: --drift-budget / --drift-worsening, --fail-on (including architecture-finding and iac-finding), and the security gate. Some gate preconditions also exit 2, e.g. --fail-on architecture-finding with --no-graph.
1 for operational errors, e.g. a missing scan path or an unreadable --package-manifest (thrown as CliError(..., ExitCode.ERROR)).
5 for usage errors caught before scanning, e.g. an unknown --fail-on value.
--strict only changes upload behaviour: without it a failed push warns and the scan exits on its own result; with it the push failure exits 1. Worth one sentence, because people assume --strict tightens the gates.
Existing doc gap.DOCS.md "Generic Pipelines" says the CLI "Returns meaningful exit codes (see below)", but there is no table below it. That sentence is the natural anchor for this table.
Suggested shape. One table for the shared codes, then a short per-command note for vg scan and vg build listing which flags can produce 2. The CI snippet should branch on $?: 0 pass, 2 findings/gate (fail the job with a clear message), anything else treat as a tool or config error. Keep #152 for the Action example itself and link to it.
Verify before writing. Run vg scan --drift-budget 0 and vg scan --package-manifest ./missing.zip on a toy repo and paste the observed exit codes in the PR.
Activity
vibgrate-team commentedon Oct 4, 2026
Spec notes for implementers
Source of truth.
src/util/exit.tsdefinesExitCode:0OK,1ERROR,2GATE_FAILED,3NOT_FOUND,4NON_DETERMINISTIC,5USAGE_ERROR,6ENGINE_UNAVAILABLE (a missing optional module, kept separate from 2 so a CI gate can never read "engine missing" as pass or fail). Graph verbs throwCliErrorwith one of these.vg scanspecifics (src/reporting/commands/scan.ts):2for every gate that trips:--drift-budget/--drift-worsening,--fail-on(includingarchitecture-findingandiac-finding), and the security gate. Some gate preconditions also exit 2, e.g.--fail-on architecture-findingwith--no-graph.1for operational errors, e.g. a missing scan path or an unreadable--package-manifest(thrown asCliError(..., ExitCode.ERROR)).5for usage errors caught before scanning, e.g. an unknown--fail-onvalue.--strictonly changes upload behaviour: without it a failed push warns and the scan exits on its own result; with it the push failure exits 1. Worth one sentence, because people assume--stricttightens the gates.Existing doc gap.
DOCS.md"Generic Pipelines" says the CLI "Returns meaningful exit codes (see below)", but there is no table below it. That sentence is the natural anchor for this table.Suggested shape. One table for the shared codes, then a short per-command note for
vg scanandvg buildlisting which flags can produce2. The CI snippet should branch on$?:0pass,2findings/gate (fail the job with a clear message), anything else treat as a tool or config error. Keep #152 for the Action example itself and link to it.Verify before writing. Run
vg scan --drift-budget 0andvg scan --package-manifest ./missing.zipon a toy repo and paste the observed exit codes in the PR.