Skip to main content
Sifr surfaces every compiler diagnostic with a stable, machine-readable code in the format SIFR-<FAMILY>-dddd. Whether you are reading terminal output, wiring up a CI pipeline, or integrating an editor extension, the same structured information is always available — you only choose how it is rendered. This page explains the diagnostic system from end to end: output formats, severity levels, the --diagnostic-format flag, the JSON envelope schema, exit codes, and how to suppress lint rules when needed.

Severity Levels

Every diagnostic carries one of three severity levels.
Only Error-severity diagnostics block a successful build. Warning and Note diagnostics are emitted alongside the build result and do not prevent artifact generation on their own.

Output Formats

Compiler-facing commands (sifr build, sifr run, sifr check, sifr emit) accept the --diagnostic-format flag with three values: human, json, and compact. The default is human.

Human Format (default)

The human format is designed for developer terminals. It renders source file locations, code snippets, caret highlights, related spans, notes, help text, code-action suggestions, and documentation URLs whenever span data is available. Spanless internal diagnostics fall back to an explicit location: <unavailable> line.
Human progress text (Finished, Binary:, phase summaries) is written to stderr only in human format. Do not grep for these words in scripts — use compact or json instead.

Compact Format

The compact format is a stable, line-oriented format suited for CI pipelines, agents, and quick terminal scanning. It emits a one-line summary followed by one line per diagnostic after recovery limiting. The first four fields on each diagnostic line are stable: severity abbreviation, code, location (or <unknown>), and message.
Compact mode intentionally omits code snippets and documentation URLs to keep output machine-friendly.

JSON Format

The json format emits a DiagnosticEnvelope object to stdout. It is the canonical format for editor integrations, language servers, and any tool that needs to consume structured diagnostic data. Successful builds in json mode emit no human progress text on stdout or stderr.

JSON Diagnostic Schema

The DiagnosticEnvelope wraps a versioned array of RenderedDiagnostic objects.
RenderedDiagnostic fieldsDiagnosticSpan fieldsSuggestionApplicability values

Exit Codes

Sifr commands use consistent exit codes across all subcommands.
Exit code 3 indicates a compiler bug, not a user error. If you encounter it, please report the SIFR-INTERNAL-0001 diagnostic output along with a minimal reproduction to the Sifr issue tracker.

Looking Up Error Details

You can get detailed documentation for any diagnostic code directly in your terminal using either sifr --explain or the sifr explain subcommand:
Both forms print the diagnostic description, message template, severity, and any relevant guidance without performing a build or package operation. This works even for retired codes — for example, sifr --explain SIFR-PACKAGE-0105 redirects you to the replacement code SIFR-PACKAGE-0101.

Suppressing Lint Diagnostics

Sifr’s policy-rule engine (sifr lint) emits suppressible Warning-level diagnostics. You can silence a specific rule on a single line using an inline comment:
Replace rule-id with the exact Sifr rule identifier such as todo-comment, trailing-whitespace, or boolean-positional-argument.
Blanket suppressions — comments that do not name at least one explicit rule ID — are rejected by the compiler. Sifr will emit SIFR-LINT-0003 and will not apply the suppression.
Suppressions apply only to policy diagnostics from sifr lint. Hard compiler errors (Error-severity diagnostics from sifr check or sifr build) cannot be suppressed with inline comments.
Sifr also reports two additional lint-related warnings to keep suppression hygiene clean:
  • SIFR-LINT-0001 — the rule ID in a suppression comment does not match any known policy rule.
  • SIFR-LINT-0002 — the suppression comment is present but did not actually suppress any diagnostic on that line.
To audit all suppressions without applying them, run sifr lint --ignore-suppressions. This flag does not affect per-file ignores or hard compiler diagnostics.