Skip to content

fix(syntax-receipts): import the first Snowflake batch's runs faithfully - #178

Merged
kvlonge merged 8 commits into
mainfrom
fix/refuse-client-failures
Nov 11, 2026
Merged

kvlonge merged 8 commits into
mainfrom
fix/refuse-client-failures

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Why

Importing the first Snowflake recording batch showed three importer problems:

  • A client-side failure, such as a read timeout (errno 250003), was imported as a runtime_error although Snowflake's answer was never seen. The runner marks these records connector_fields.case_result: false.
  • A run-database packet that carries each case's whole setup, template included, had the template appended again, so receipts named a doubled setup no case has.
  • Errors whose message shows Snowflake parsed the statement were refused as having no established phase.

Changes

  • Refuse records with case_result: false. Records without the field import as before.
  • Count a packet's setup only after the run setup it repeats. Refuse a packet that carries another run's template.
  • Place reviewed errnos as semantic_error: 509000, 509001, 509008, 509013, 393941, 90025, 3001, 3172, 93171 and 98620. Errnos 603, 630 and 926 stay refused.
  • docs/syntax-coverage.md lists the phase rules in order.

Verification

  • uv run pytest tests/unit/scripts/syntax_receipts: 73 passed. Each new test fails without its check.
  • ruff, ty and fensu pass.
  • Re-importing the first batch: receipts bind to their cases' setups, the timeout is refused, and 51 of 69 unplaced errors now import.

…nowflake answered

A raw record whose connector error was not the warehouse's answer to the
statement (case_result false: a read timeout, a dropped connection) no longer
becomes a runtime_error receipt. The importer refuses it with the connector's
error class and number, in run-database and packet runs alike.
… SQLSTATE

With SQLSTATE n/a, as the connector reports a read timeout, the code before the
fix imports these records as runtime_error receipts, so both cases now
reproduce the bug rather than only a changed refusal reason.
… once

A run-database packet may carry the case's whole setup, the run's
template included, rather than only the fixtures that follow it. The
importer appended the packet setup after the run setup it had already
built, so each receipt named the template twice and bound to a setup no
case has. The packet setup now counts only after the run setup when it
repeats it.
…un's template

A packet whose setup starts with a run template other than the one the
run made would otherwise be kept whole after the run setup, so its
receipt named the template twice. That setup then feeds back into the
case. Such a row is now refused. The test packet also repeats its
fixtures and a template line, which must all be kept.
…lake parsed the statement

Errors without the SQL compilation error prefix, and compilation errors
above 100000 under SQLSTATE class 42, were refused as having no
established phase. Where Snowflake's message shows it parsed the
statement and refused it on a rule about what it says (secret and
option checks, a storage URL, a missing object to undrop, access
control, a required property, an account restriction, an
application-only operation), the errno is now reviewed as semantic.
Internal errors, statement timeouts and errors that may come from the
parser itself stay refused.
…outs refused

The phase paragraph now follows the importer's checks in order. Tests
keep internal errors and statement timeouts refused, and a missing
object to undrop gets the missing-object reason.
@kvlonge kvlonge changed the title fix(syntax-receipts): refuse a record whose connector failed before Snowflake answered fix(syntax-receipts): import the first Snowflake batch's runs faithfully Nov 11, 2026
@kvlonge
kvlonge enabled auto-merge November 11, 2026 17:57
@kvlonge
kvlonge added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit c3a5599 Nov 11, 2026
16 of 22 checks passed
@kvlonge
kvlonge deleted the fix/refuse-client-failures branch November 11, 2026 18:55
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