Skip to main content

Diagnostic Catalog

Diagnostics are now owned by package metadata under morphs/<Package>/diagnostics/.

Source Of Truth

  • catalog.toml stores locale-independent metadata such as canonical code, severity, phase, slug, parameter names, and quick-fix ids.
  • diagnostics/<locale>/*.toml stores localized title, summary, default_message, and recovery text.
  • LSP, browser/playground assets, localization, and quick-fix discovery all consume the same generated registry data instead of a hand-maintained TSV.

Rules

  • Emit canonical package/domain codes only, such as CORE2201 or BUILD5001.
  • Do not introduce legacy N, NR, or W codes in new diagnostics or tests.
  • Add or update localized entries whenever a package adds a new canonical code.
  • Prefer structured metadata and generated fix ids over message parsing.

Validation

  • Registry loading validates canonical code metadata and locale coverage for catalog-declared diagnostics.
  • Unit and behavior suites validate emitted canonical codes end-to-end.