Seed Diagnostics Surface

Stage0 shell seed and canonical Vitte seed source now share a phase-oriented diagnostics contract.


Required phases

Every seed diagnostic must declare one explicit phase:

  • lexer
  • parser
  • ast_validation
  • module_resolution
  • symbol_resolution
  • sema
  • typeck
  • borrowck
  • mir_lowering
  • mir_verification
  • backend
  • linker
  • runtime_execution

Generic phase-less bootstrap failures are outside the accepted diagnostics surface.

Lexer coverage

  • LEX_E_INVALID_CHAR
  • LEX_E_UNTERMINATED_STRING
  • LEX_E_INVALID_CHAR_LITERAL
  • LEX_E_INVALID_ESCAPE
  • LEX_E_INVALID_UNICODE
  • LEX_E_INVALID_NUMBER
  • LEX_E_UNTERMINATED_COMMENT
  • LEX_E_TOKEN_TOO_LARGE

The shell seed includes byte-oriented hints when they can be computed from the raw source bytes. The Vitte seed mirrors the same codes and phase split and is converging toward identical message wording.

Parser coverage

  • PARSE_E_TOPLEVEL_DECL_EXPECTED
  • PARSE_E_INCOMPLETE_EXPR
  • PARSE_E_UNCLOSED_BLOCK
  • PARSE_E_MISSING_RPAREN
  • PARSE_E_MISSING_COMMA
  • PARSE_E_TYPE_EXPECTED
  • PARSE_E_PATTERN_EXPECTED
  • PARSE_E_BLOCK_EXPECTED

The parser surface now carries expected token, found token, syntax context, and recovery status for the supported bootstrap subset.

Module and symbol coverage

Module resolution now reports import chain, tested paths, requester module, and a closest-name hint. Symbol resolution now reports current scope, active imports, closest symbol, and original declaration information when available.

Available surfaces

Shell seed

toolchain/seed/vittec0.seed exposes text diagnostics and JSON diagnostics with pipeline_failed_at, primary_report, and phase_reports.

Canonical Vitte seed

toolchain/seed/src/main.vit now exposes:

  • diag <file>
  • diag-json <file>
  • check <file>
  • diagnostics_text_for_source(...)
  • diagnostics_json_for_source(...)

This Vitte surface reads a real file, analyzes it by phase, and renders a diagnostics JSON shape that is much closer to the shell seed surface.