Documentation
¶
Overview ¶
Package exitcode is the process exit-code taxonomy and the classification of an error onto it, shared by the kanonarion binary and the call-graph child an importing application serves, so the two exit alike.
Index ¶
Constants ¶
const ( OK = 0 Partial = 1 Failed = 2 Cancelled = 3 // NotFound signals that a record requested by ID or coordinate (walk, // scan run, extraction, directive scan, licence, vulnerability, call // graph,...) does not exist. Distinct from Config so scripts can tell // 'no such record' — which the remedy named in the message fixes — from // 'the request itself was malformed'. NotFound = 4 // Policy signals that a governance or publication gate fired on real // findings: the command ran to completion, measured the artefact, and the // policy it was asked to enforce says the result is not publishable. That is // the gate working, not a configuration error, and a CI step must be able to // route it to a human rather than to whoever fixes broken invocations. Policy = 5 Integrity = 10 // Config is the invocation/precondition catch-all: a malformed argument, // an unparseable coordinate, a missing toolchain, a policy FILE that is not // there, or a store whose schema is newer than this binary. It says the // command never got as far as producing an answer. Config = 20 )
Exit codes.
The taxonomy exists so an automation caller can branch on the process exit code alone, without parsing stderr prose. Four questions a script actually asks get four different answers: did the work complete (0/1/2/3), does the record you named exist (4), did a policy gate fire on real findings (5), is the recorded evidence in doubt (10), or did you invoke it wrongly (20). Collapsing any of those onto Config makes "you typed it wrong" indistinguishable from "the gate you asked for did its job".
Variables ¶
var EvidenceInDoubt = []error{ walkports.ErrWalkIntegrity, cgports.ErrCallGraphIntegrity, cgports.ErrCallGraphConflict, ifaceports.ErrInterfaceIntegrity, ifaceports.ErrInterfaceConflict, licenceports.ErrLicenceIntegrity, licenceports.ErrLicenceConflict, exampleports.ErrExampleIntegrity, exampleports.ErrExampleConflict, extractports.ErrExtractionRunIntegrity, vulnports.ErrVulnIntegrity, vulnports.ErrVulnConflict, vulnports.ErrSnapshotIntegrity, stdlibports.ErrFactsIntegrity, stdlibports.ErrFactsConflict, fetchports.ErrFetchRecordIntegrity, nativeports.ErrNativeConflict, }
EvidenceInDoubt is every sentinel meaning the recorded evidence cannot be trusted: a stored record whose content hash does not verify, or two records for one coordinate that disagree. The table gives both to Integrity and does not qualify either by which domain raised it.
Only the walk sentinel was mapped, so the other twelve reached Config by the fallback — which says the invocation itself was wrong, and routes a store-integrity problem to whoever fixes broken command lines. A sentinel added to a ports package must be added here; the contract test reads the ports packages and fails if one is missing.
var ModuleNotFetched = []error{ cgports.ErrModuleNotFetched, ifaceports.ErrModuleNotFetched, licenceports.ErrModuleNotFetched, exampleports.ErrModuleNotFetched, nativeports.ErrModuleNotFetched, }
ModuleNotFetched is every producer's refusal for a module whose bytes the store does not hold. The printed 'kanonarion fetch' runs as given and supplies them, so it is an absent record (4), not a malformed invocation (20).