Skip to main content

Diagnostics

Structured Diagnostics

zero check --json emits machine-readable diagnostics instead of plain text. Every error includes:

FieldDescription
codeStable error code (e.g., NAM003)
messageHuman-readable message
spanSource location
repairTyped repair metadata

The Repair Loop

Two CLI subcommands complete the agent repair loop:

zero explain

Returns a structured explanation of any diagnostic code. Agents can look up NAM003 directly — no doc scraping required.

zero explain NAM003

zero fix --plan --json

Emits a machine-readable fix plan describing exactly what changes to make — no inference from prose required.

zero fix --plan --json examples/hello.0

Diagnostic Codes

Common diagnostic categories:

PrefixCategory
NAMNaming
BORBorrowing
TYPTyping
CAPCapabilities
CGENCode generation