{"modulePath":"github.com/opencharly/spec","version":"v0.2026332.1000","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package exitcode\n\nPackage exitcode (github.com/opencharly/spec/exitcode, #55 import-purity) holds the process exit-code contract a command plugin's Invoke(OpRun) returns to the host and the check-command 0/1/2/3 convention single-sourced here so both the host (main()'s exit mapping + \\`charly box feature run\\`) and the check-engine candy reference ONE contract. It is a fabric slice of the spec contract module — pure Go constants + a tiny error wrapper, no heavy deps (#55 Rule 2) — relocated from the github.com/opencharly/sdk root package. charly core imports this slice INSTEAD of the sdk root; the sdk root keeps a thin re-export during cutover then is deleted.\n\n## Constants\n\n```go\nconst (\n\tCheckFailExitCode    = 2\n\tCheckSkippedExitCode = 3\n)\n```\nThe check-command exit-code convention (goss/pytest 0/1/2/3), single-sourced here so both the HOST (main()'s exit mapping + \\`charly box feature run\\`) and candy/plugin-check reference ONE contract:\n\n\t0  all checks passed\n\t1  infra / usage error — no pass/fail verdict was produced (the host default)\n\t2  the check RAN and one or more checks FAILED\n\t3  the phase RAN NOTHING, so there was no verdict to bank — either a bed whose required\n\t   HOST prerequisite is absent (a GPU whose vendor has no matching card), or any check mode\n\t   whose plan resolution came back EMPTY (an image that baked no `plan:`, a deployment whose\n\t   source declares none, a bed child whose own plan and `add_candies` contribute no steps —\n\t   opencharly/plugin-check#110). \"Nothing ran\" is neither a pass nor a failure, so a caller\n\t   that reads only 0/non-0 must read 3 as \"ask why\", not as \"green\".\n\n## Types\n\n```go\ntype ExitCodeError struct {\n\tCode int\n\tErr  error\n}\n```\nExitCodeError carries a specific PROCESS exit code from a command plugin's Invoke(OpRun) back to the host, which maps it to os.Exit(Code). A compiled-in command candy returns its error verbatim through the in-proc dispatch, but the host cannot classify the plugin's OWN error TYPES across the module boundary — so a command that must set a NON-1 exit code (the check 0/1/2/3 convention) wraps its failure in \\*ExitCodeError, which the host detects with errors.As and honors as the exit status. Code 0 falls back to the host's default error handling (no special code).\n\n```go\nfunc (e *ExitCodeError) Error() string\n```\n\n```go\nfunc (e *ExitCodeError) Unwrap() error\n```\n\n","path":"github.com/opencharly/spec/exitcode","name":"exitcode","synopsis":"Package exitcode (github.com/opencharly/spec/exitcode, #55 import-purity) holds the process exit-code contract a command plugin's Invoke(OpRun) returns to the host and the check-command 0/1/2/3 convention single-sourced here so both the host (main()'s exit mapping + `charly box feature run`) and the check-engine candy reference ONE contract.","isRedistributable":true}
