Skip to main content

Exit codes

ovecc's exit codes are a stable contract, designed for CI scripts that need to tell "found problems" apart from "the run itself broke".

CodeNameMeaning
0successCommand succeeded; no gating threshold crossed
1findings_presentA --fail-on threshold was crossed (findings / cycles / risk)
2usageCLI usage error (bad arguments, unresolvable target, unparseable query)
3repositoryRepository or configuration error
4indexIndex or database error (e.g. database missing — run ovecc index first)
5parserParser error
6gitGit error
7internalUnexpected internal error

Exit 1 is a signal, not a crash

When --fail-on (or a gate) trips, ovecc exits 1 and still emits the complete report — including a full, valid JSON envelope in --format json. Your failing CI step always carries its own explanation:

$ ovecc security --fail-on any; echo "exit: $?"
Security findings: 13 (scanned the indexed repository)
...
exit: 1

Observed behavior worth scripting around

$ ovecc summary # in a directory that was never indexed
# → exit 4, "run 'ovecc index' first"

$ ovecc explain no-such-thing
ovecc: usage error: no architecture element matches 'no-such-thing' — try a module
name, a file path, or `ovecc query "module no-such-thing"` to search
# → exit 2

$ ovecc impact no-such-thing
Impact: no-such-thing
No matching architecture element.
# → exit 0, JSON payload carries "matched": false — check that field in scripts

Pipes

A downstream reader closing the pipe early (ovecc report | head, grep -m1, quitting a pager) is not an error: output stops quietly, exit code 0. Real internal panics exit 7.

In the MCP server

The MCP server maps these in-band: exits 0 and 1 are normal tool results (isError: false — a failing gate still returns its verdict); exits ≥ 2 become isError: true with the stderr message.