-
Notifications
You must be signed in to change notification settings - Fork 0
Error Model
Simon B.Stirling edited this page Mar 2, 2026
·
1 revision
I use this document as the frozen CLI error-behavior contract for the current bootstrap toolchain.
Contract version: errmodel.v1
I freeze deterministic exit-code and stderr behavior for representative CLI failure classes.
I keep stderr formatting normalized as:
- usage failures: one canonical
usage: ...line - non-usage failures: one canonical
error: ...line
-
2: usage/argument-shape error (usage: ...) -
3: cannot open input (error: cannot open input) -
4: cannot read input (error: cannot read input) -
5: invalid/non-canonical input payload (error: invalid module shape or non-canonical input) -
6: cannot write output image (error: cannot write output image) -
7: invalid/corrupt image container (error: invalid or corrupt L0IMG) -
9: invalid run argument (error: invalid run argument (expected unsigned decimal))
I enforce this contract in:
tests/error_model.sh
That harness is integrated into tests/run.sh and therefore enforced by make test.
I assert deterministic error behavior across representative commands and failures, including:
- usage failures (
l0c, unknown command, missing subcommand argument) - open/read failures (
verifyon missing file and directory path) - parse/decode failures (
verify,tracecat,mapcat,schemacatmalformed payloads) - build output write failure (
buildto denied path) - corrupt image failures (
imgcheck,imgmeta,runon invalid image) - run-argument parse failure (
runwith non-decimal argument)
- Localization or multi-line structured diagnostics.
- Fine-grained per-opcode parse diagnostics (v1 freezes current compact error surface).
- Platform-specific errno projection in stderr output.
- How-To-Write-L0
- Language-Reference
- Instruction-Set
- CLI-and-Compiler-Spec
- Implementable-Spec
- Command-Reference
- Examples-Catalog
- LLM-Quick-Reference
- Opcode-Examples
- LLM-Doc-Index