Skip to content

refactor: run build, audit, scenario, query, dag, contract, init, format and cost natively - #1103

Merged
kvlonge merged 27 commits into
mainfrom
feat/native-group-4
Oct 14, 2026
Merged

kvlonge merged 27 commits into
mainfrom
feat/native-group-4

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Why

Rust-hosted SQLBuild port (CHI-585), fourth combined PR: the remaining Phase 3 (CHI-592) command handlers except dbt, plus Phase 1 (CHI-589) lint and format.

Changes

  • Commands now native: sqb build (planning safety gates and prompts, limits, Python-node lifecycle, execution, completion), audit, scenario test/capture, query, dag, contract, init, format, cost.
  • Lint: interpolation handling, suppressions, fixture-null scan, SQL body format and lint mapping, lint run and file collection; cell-width/text-wrap helpers shared in sqlbuild-core.
  • Stays Python for now: defer_clone.py, macro expansion, the --fix compile session, cost allocation/Snowflake parsing.
  • Movable Python: 79,435 → 69,877 lines.

Intentional differences: an absolute .sql scenario selector now selects only that scenario; bad [format] TOML raises a different error type; traceback frames; internal Python APIs removed or renamed.

Verification

  • Old vs new real CLI runs on DuckDB fixtures per command (build 44 incl. prompts and warehouse/state tables, scenario 54 runs, query/dag 53, cost 52, format 27, contract 23, audit 18, init 9): identical apart from noted differences, spinner timing and traceback frames.
  • Generated-input comparisons vs the old Python (lint text, suppressions, formatter, query csv/json): 0 mismatches.
  • 10,849 focused tests incl. ~30 e2e files; compiler differential with full coverage; byte-identical compile output on a 1k-model and a large private project; make check-ci.
  • Independent review: no findings.

… fixture nulls natively

Interpolation sentinels for lint and formatting (references, macros,
templates, hook context and generic-audit parameters), sentinel
restoration, interpolation tokens at an offset, reason-required
suppressions and the fixture typed-null candidate scan run in the new
sqlbuild-rules lint_text module. SQL lint preparation now handles
non-ASCII text natively with character offsets, so the Python fallback
is gone. Delete the Python token, suppression and candidate modules.
Body ranges by project role, trailing-whitespace and omitted ceremonial
SELECT handling, sentinel widths, deduplicated batch formatting,
restoration and splicing, and the format-unsafe faults run in
sqlbuild-rules. Delete the Python body formatter.
Build the native lint requests (rule selection, thresholds, identifiers,
relation keys and the omitted ceremonial SELECT), run them in one
deduplicated batch and map every diagnostic, end position and fix back
through the expansion passes onto authored source in sqlbuild-rules.
Parse failures become authored faults as before. Delete the Python
native SQL lint boundary and its engine-response injection tests.
@kvlonge
kvlonge enabled auto-merge (squash) October 13, 2026 23:49
@kvlonge
kvlonge merged commit a1d313e into main Oct 14, 2026
40 checks passed
@kvlonge
kvlonge deleted the feat/native-group-4 branch October 14, 2026 00:57
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