Skip to content

Spec Chapter 10 drift the #683 alignment gate cannot see: terminals, rule references, production bodies #1290

Description

@aallan

scripts/check_grammar_alignment.py (added by #1279 for #683) holds rule-name headers aligned between vera/grammar.lark and spec Chapter 10. Three classes of Chapter-10 drift remain outside its sight, and two live drift instances sit in the chapter today.

Gate blind spots (each demonstrated during #1279's review)

  1. Terminals. Re-adding a deleted terminal — or adding a fabricated BOGUS_TERMINAL to §10.2 — leaves the gate green (_HEADER requires a lowercase lead). No declared-vs-referenced audit exists: SOME, NONE, OK, ERR, COLON are declared and referenced by no production, while DOUBLE_COLON is referenced by module_call and declared nowhere.
  2. Rule references. Restoring the assert_stmt SEMICOLON | assume_stmt SEMICOLON ambiguity to statement leaves the gate green — only headers are compared, never right-hand sides.
  3. Production bodies. Of the seven grammar.lark edits since the spec chapter's creation, five changed bodies or terminals only — the class the gate cannot see.

Live drift in the chapter

  • Typed holes: "?" -> hole_expr has been in grammar.lark since 2026-03-30 and appears nowhere in Chapter 10's primary_expr.
  • §10.2's BLOCK_COMMENT: /\{-[\s\S]*?-\}/ is non-nesting, contradicting §1.3 ("They nest") and the implementation ({- a {- b -} c -} parses).

Direction

Extend the gate side-aware (terminal audit both directions, reference-set comparison) or fold Chapter 10 toward the DESIGN Grammar row's actual promise — a shared grammar, single-sourced — rather than a second hand-maintained copy held honest by ever-wider cross-checks. The two live drift items above are fixable independently of which direction the gate takes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions