Skip to content

feat(native): assemble SQL test facts natively behind the preview engine - #1065

Closed
kvlonge wants to merge 3 commits into
mainfrom
feat/native-sql-test-assembly
Closed

kvlonge wants to merge 3 commits into
mainfrom
feat/native-sql-test-assembly

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Why

Under preview, SQL tests were still assembled in Python. This builds their facts natively and hands back only what it cannot match exactly.

Changes

  • sqlbuild-analysis: native assembly of test names, target models, scope deps (incl. the macro call scan), case fingerprints (with Decimal.normalize) and P013 mock-reads-referencing-helper diagnostics with locations.
  • Binding assemble_compiled_sql_tests reads compile inputs directly; SQL_TEST_GLUE assembles natively and reports diagnostics in Python's order.
  • Per-test deferrals: macro mocks, non-ASCII text on the P013 path, decimals the context would round, failing reference scans. Macro mocks defer on purpose; M3 close-out Ports A routes them through the bridge. The differential records only macro_mocks (29).
  • Kept: _assemble_compiled_sql_test, still used by the python and native engines.

Verification

  • Assembly parity test (seeded model, direct, parameterized and mock-reads-helper tests) vs Python, plus Rust unit cases incl. a Python-computed fingerprint; P013 failure-corpus case with location.
  • Sabotage: deferring every test fails the parity gate (0 native) and seams E2E. Reverted. The gate counts only assemblies compile consumes.
  • Compile seam/deferral/lineage E2E plus test E2E (186 passed); make compiler-differential CI flags (321 identical); cargo test --workspace, clippy/fmt 1.99.0; make check-ci; make test (11940 passed); hygiene.

Test expectation changes

  • Seams E2E: assemble_native_sql_tests expected None, now native assemblies (none deferred): the seam answers.
  • Assembly parity counts are seeded and deterministic, so they are asserted exactly (was floors 150/13/80/3): native assembled 181, with P013 17, case fingerprints 96; deferrals capped exactly: macro_mocks 4, non_ascii_text 11, decimal_context 5. Any other deferral kind fails.
  • Sabotage re-run on the exact gate: all-defer fails it (0 native, 201 deferred), parity intact.

@kvlonge
kvlonge enabled auto-merge October 9, 2026 11:27
@kvlonge
kvlonge added this pull request to the merge queue Oct 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 9, 2026
@kvlonge
kvlonge added this pull request to the merge queue Oct 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 9, 2026
@kvlonge
kvlonge enabled auto-merge October 9, 2026 15:43
@kvlonge
kvlonge force-pushed the feat/native-sql-test-assembly branch from 2fb9252 to 194b280 Compare October 9, 2026 16:42
@kvlonge
kvlonge added this pull request to the merge queue Oct 9, 2026
@kvlonge
kvlonge removed this pull request from the merge queue due to a manual request Oct 9, 2026
@kvlonge

kvlonge commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Landed together in #1075 to cut merge-queue CI runs; review history stays here.

@kvlonge kvlonge closed this Oct 9, 2026
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