Skip to content

docs(spec): bounded-exhaustive verifier for parser vs grammar drift (#643) - #644

Merged
adityamukho merged 2 commits into
v3from
spec/643-grammar-verifier
Oct 20, 2026
Merged

adityamukho merged 2 commits into
v3from
spec/643-grammar-verifier

Conversation

@adityamukho

Copy link
Copy Markdown
Collaborator

Design spec for #643: a deterministic, bounded-exhaustive verifier that checks the real parser against tests/grammar/grammar.pest, plus generating the EBNF from grammar.pest.

Spec: docs/superpowers/specs/2026-10-20-grammar-drift-verifier-design.md

Settled with the maintainer (2026-10-20):

  • syntax/semantic classification of error codes is a test-only list (no public API);
  • the EBNF is a generated docs/GRAMMAR.md, published by the docs site as a snapshot page;
  • main gets the verifier only, with no new error codes.

Summary:

  • §3: 24 user-facing INT-019 sites and the INT-000 retract-arity path get their own PRS codes; 4 unreachable INT-019 sites stay.
  • §4: property: pest rejects ⇒ parser rejects; pest accepts ⇒ parser accepts or rejects with a semantic code. Semantic codes need a witness and one meaning per code.
  • §5: lexical level (all ≤3-char strings, ~1.07M) and structural level (12 templates × balanced token sequences, k = 3 default, deeper on a schedule); KNOWN_DRIFT predicates, each failure matching exactly one.
  • §7: pest → EBNF renderer with a staleness test.
  • §9: PR order.

Reviewed with Codex; its findings (witness rule, overlapping drift predicates, token count, balance definition and cost, ordering) are addressed in the second commit.

Docs only; no code change. Part of #643.

🤖 Generated with Claude Code

https://claude.ai/code/session_019kY61Y11gcRD91Y6b7jbGT

adityamukho and others added 2 commits October 20, 2026 14:29
@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit 3f13023 into v3 Oct 20, 2026
25 checks passed
@adityamukho
adityamukho deleted the spec/643-grammar-verifier branch October 20, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant