Skip to content

chore(syntax-coverage): fail on every receipt the parser contradicts - #202

Merged
kvlonge merged 3 commits into
mainfrom
chore/syntax-receipt-disagreements
Nov 12, 2026
Merged

kvlonge merged 3 commits into
mainfrom
chore/syntax-receipt-disagreements

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Why

Snowflake's receipt judges the parser. The syntax gate failed only on new flips, so standing disagreements in either direction went unchecked.

Changes

  • syntax-coverage diff fails on every receipt the parser contradicts, whatever its mark or expectation, unless the dialect's receipt-disagreements.toml lists it. The list only shrinks: an entry the target branch lacks fails, and so does one the parser now agrees with until it is deleted.
  • Snowflake refused a statement when the importer recorded its receipt's phase as a syntax error, whatever the errno. The checker no longer keeps its own errno list.
  • Corrects documented hand rows that misread their pages, and pins the evidence that records them.
syntax errors accepted parsed cases refused other receipts
Snowflake 2,356 479 361
SQLite 642 0 0
DuckDB 0 5 0
  • The phase rule adds 2: ALTER WAREHOUSE ADD and DROP TABLES, refused with 1002. Sixteen receipts with errno 1002, 4, 92107 or 510807 become refusals the parser agrees with.
  • 2,087 false accepts go through an opaque fallback node. 424 of the 479 expect accept.
  • Snowflake does not accept 646 of 696 documented cases; the parser accepts 128 of those.
  • The 361 uncited receipts are not missing forms: 140 withdrawn arity cases, 109 hand and run-report probes, 105 replaced cases of catalogued forms, 5 empty-call probes and 2 nesting cases. One catalogue gap: Snowflake answers NORMALIZE ( ) with errno 938, as for SUBSTR ( ), so it has an undocumented NORMALIZE function.

Verification

  • A documented case with a 1003 receipt and an accepting parser fails the diff, and a 1002 syntax-phase receipt counts as a refusal; both tests fail under the previous rules.
  • Unit cases cover unlisted, listed, added, resolved and moved entries.
  • Through make, an added entry fails and the committed lists pass.
  • The generated cases match the pin with 0 files differing.
  • make check-ci passes.

The syntax gate failed only on new flips, and a case marked documented
was listed rather than failed, so a parser accepting SQL Snowflake
refused as a syntax error could pass. Snowflake's receipt is the judge:
check-syntax now fails on every receipted case the parser contradicts,
in both directions and whatever its mark or expectation, unless the
root's receipt-disagreements.toml lists it.

The file lists today's disagreements by form and only shrinks: an entry
the parser now agrees with fails until it is deleted, and an entry the
target branch's copy does not have fails. Snowflake lists 2,359
accepted syntax errors, 479 refused parsed cases and 361 other
receipts; SQLite 642 accepted syntax errors; DuckDB 5 refused parsed
cases.
Snowflake's receipts decide syntax; a documented case whose own SQL is
wrong tests nothing. Correct the documented hand rows the receipt
triage found misrendered: VERIFIED_AT takes epoch seconds, a stage
name with blanks is single-quoted whole, an Iceberg table with
PARTITION BY defines its columns, ADD and RENAME FIELDS cast between
OBJECT types inside the parentheses, account parameters are assigned,
a REFERENCES column list stays in its group, and a select-list
continuation names one item. Hand rows that spell variables or file
column numbers in ways the pages never show are no longer documented.

Pin the evidence that records the corrected cases, lift the two
ALTER WAREHOUSE TABLES entries that now have receipts, and re-record
the baseline and the Snowflake disagreements: of the corrected cases
Snowflake parsed 18, all accepted; it refused 9 as syntax errors, 2 of
which the parser accepts and lists.
…orded phase

The importer decides each receipt's phase, placing an error as a syntax
error only on evidence such as errno 1003 under the compilation prefix
or a 1002 whose message starts with "syntax error". The checker kept its
own list, errno 1003 or 921, so a syntax-phase receipt with any other
errno counted as neither parsed nor refused, and the two could drift.

The checker now treats every receipt the importer placed as a syntax
error as Snowflake's refusal, whatever its errno. A 1003 at another
phase still counts as neither.

Two receipts the parser contradicts are new: ALTER WAREHOUSE ADD TABLES
and DROP TABLES, refused with 1002 and accepted by the parser, now on
the Snowflake disagreement list. Sixteen syntax-phase receipts with
errno 1002, 4, 92107 or 510807 now count as refusals the parser agrees
with. Satisfied obligations and verified forms are unchanged.
@kvlonge
kvlonge added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 39335aa Nov 12, 2026
14 checks passed
@kvlonge
kvlonge deleted the chore/syntax-receipt-disagreements branch November 12, 2026 12:51
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