prometeu-studio/docs/pbs/agendas/11.4. AST Workshop 4 - Diagnostics, Recovery, and Gate Evidence.md

2.7 KiB

PBS AST Workshop 4

Status: Closed (2026-03-05)

Purpose

Close AST-facing diagnostics/recovery rules and Gate U evidence needed to finalize the AST contract.

Decisions To Produce

  1. Required diagnostics attribution behavior sourced from AST.
  2. Recovery invariants for parser output after syntax errors.
  3. Mandatory AST fixture corpus for Gate U evidence.
  4. Explicit deferred list for non-AST concerns.

Candidate Decisions

1. AST Must Sustain Diagnostics Fidelity

  • Primary attribution for syntax diagnostics must remain stable and source-anchored.
  • Cross-file related spans are attached when required by diagnostics rules.

2. Recovery Must Preserve Structural Integrity

  • Recovered AST may be partial, but must remain structurally coherent.
  • Recovery must not fabricate semantically valid shapes that hide syntax failure.

3. Gate U Evidence Baseline

  • AST conformance evidence includes representative valid trees, invalid/recovery cases, and attribution assertions.

Questions To Resolve

  1. Which recovery behaviors are mandatory versus implementation-defined?
  2. What is the minimum fixture set to prevent AST regressions?
  3. Which AST-facing diagnostics codes must be frozen now?

Expected Outputs

  1. Decision note on AST diagnostics/recovery policy.
  2. Decision note on Gate U AST evidence baseline.
  3. Closure checklist for 11. AST Specification.md.

Decision Outcome (2026-03-05)

Decision record: docs/pbs/decisions/AST Diagnostics, Recovery, and Gate Evidence Decision.md.

  1. AST-facing syntax diagnostics must remain stable by identity (code, severity, phase, primary attribution).
  2. Human message text is locale-dependent and not the conformance identity key.
  3. Stable i18n identity is token/template-id based, aligned with diagnostics contract fields.
  4. Recovery is allowed for continued diagnostics, but recovered AST must stay structurally coherent with consistent attribution.
  5. Recovery must not mask real syntax failure by fabricating permissive valid AST shapes.
  6. Gate U AST evidence must include valid fixtures, malformed/recovery fixtures, diagnostics assertions, and attribution assertions.
  7. Mandatory negative fixture families include unexpected tokens, missing closers, forbidden non-associative chains, and unsupported forms with deterministic rejection.

Explicit Deferrals

  • IRBackend lowering details (owned by 13),
  • backend/runtime/verifier concerns,
  • compatibility/publication policy.

Inputs

  • docs/pbs/specs/11. AST Specification.md
  • docs/pbs/specs/12. Diagnostics Specification.md
  • docs/general/specs/13. Conformance Test Specification.md
  • docs/pbs/agendas/11.3. AST Workshop 3 - Statements and Expressions.md