Skip to content

test(parser): backport the parser vs grammar verifier to v2.x (#643) - #655

Merged
adityamukho merged 2 commits into
mainfrom
feat/643-verifier-v2
Oct 20, 2026
Merged

adityamukho merged 2 commits into
mainfrom
feat/643-verifier-v2

Conversation

@adityamukho

Copy link
Copy Markdown
Collaborator

#643 PR 5 (plan steps 19–21): the parser vs grammar verifier on main, and the nightly job.

Changes

  • src/query/datalog/parser/verifier.rs: v3's verifier, unchanged apart from SEMANTIC.
  • tests/grammar/grammar.pest: v3's grammar (exact fact and retract fact, reserved list heads, kw_* word boundaries, edn_value_only). fact_too_few_elements.edn and retract_wrong_arity.edn move to invalid/syntax/.
  • SEMANTIC on main: PRS-021, PRS-022, and INT-019 with two witnesses (window :over () without :order-by; rule with no body clause). PRS-080/PRS-084/PRS-107 don't exist on v2.x.
  • KNOWN_DRIFT: v3's list unchanged. Every entry matches on main (no stale entry at k = 3 or k = 4). EmptyWhere was already on v3's list.
  • .github/workflows/grammar-verifier.yml: nightly k = 4, main at 05:30 UTC and v3 at 17:30 UTC. The branch comes from the cron, as in soak.yml. workflow_dispatch takes ref and bound. On failure it opens or comments on Nightly grammar verifier failure (<branch>). The same file goes to v3 in a separate PR.
  • Docs: CHANGELOG Unreleased "Tests", docs/TEST_COVERAGE.md, CLAUDE.md module line, counts.

Deviations from the plan

  • INT-000 isn't listed as semantic. Spec §8 says INT-019 and INT-000. No pest-accepted input raises INT-000 at k = 4: once the retract fact is exact, the retract arity (the only INT-000 site) is a pest rejection. Listing a code needs a witness.
  • Known limit (spec §8, raised by Codex): INT-019 counts as semantic as a whole. So a syntax error coded INT-019 that pest accepts isn't caught on v2.x. The verifier's doc comment and CHANGELOG say so.

Verification

  • cargo test: 1315 tests (1306 passing, 9 ignored), 0 failed.
  • Verifier at k = 3: ~40 s debug. At k = 4 (MINIGRAF_GRAMMAR_BOUND=4): 331 s wall locally, all 4 tests pass.
  • cargo fmt --check, cargo clippy --all-features -- -D warnings clean.
  • Codex review: the INT-019 breadth point above (by design per spec §8). Docs updated to state it.

Refs #643

🤖 Generated with Claude Code

https://claude.ai/code/session_019kY61Y11gcRD91Y6b7jbGT

@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 and others added 2 commits October 20, 2026 19:00
Port src/query/datalog/parser/verifier.rs and v3's grammar.pest (exact
fact and retract fact, reserved list heads, keyword word boundaries) to
main. INT-019 still mixes syntax and semantic parse errors on v2.x, so
it counts as semantic, with a witness per semantic site; PRS-080,
PRS-084 and PRS-107 do not exist here. KNOWN_DRIFT is v3's list
unchanged: every entry matches at k = 3 and k = 4 on main.

Add .github/workflows/grammar-verifier.yml: nightly k = 4 runs on main
and v3, branch picked from the cron as soak.yml does, an issue opened
or commented on failure.

Refs #643

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019kY61Y11gcRD91Y6b7jbGT
@adityamukho
adityamukho merged commit f851222 into main Oct 20, 2026
21 checks passed
@adityamukho
adityamukho deleted the feat/643-verifier-v2 branch October 20, 2026 13:44
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