Repository navigation
feat(rules): run SQL Rules through the SQLClean engine - #1283
Merged
Merged
Conversation
…ess) Checkpoint of the SQLClean integration: SQLCLEAN Rule codes, default rule selection with the human-only notice, shared expansion inputs for early lint, and SQL Rules skipped under --no-sql-analysis. e2e fixture classification and Fensu faults are still open.
Pin sqlclean to v0.4.1, lint with the compile target and vars, skip audit and SQL test files that opt out of SQL analysis, skip the row-rule fact build for SQL-only selections, align fixtures and DuckShop with the new findings, and update the docs.
kvlonge
enabled auto-merge (squash)
November 1, 2026 10:25
kvlonge
disabled auto-merge
November 1, 2026 10:26
…ligibility SQL Rules now expand with the compiled project effective target and vars on every compile path instead of falling back to the default target when the early-lint reuse is missing. Commands without target flags use the project default explicitly. Restore the eight-code format --fix allowlist and its documented decisions, and cover --target and --vars end to end.
kvlonge
enabled auto-merge (squash)
November 1, 2026 10:46
kvlonge
disabled auto-merge
November 1, 2026 11:09
Default SQL Rules lint every compiled model, a measured 1.14x to 1.19x cold wall cost over select = []. Compiler-only cases keep the previous budgets and the 1.10 same-runner ratio; default-Rules cases scale the cold budgets by the measured cost. Also pin sqlclean to the PIVOT USING fix and keep two fixtures' derived tables out of SQLCLEAN039.
Pass compiler_only to the base generator when the base supports it, so the compiler-only job keeps both sides without Rules once main runs them. Mark the default-Rules cold allowance as temporary, reject --compiler-only with the dense project at parse time, assert that default-Rules guard cases run Rules, and pin sqlclean to the v0.4.2 release commit.
kvlonge
enabled auto-merge (squash)
November 1, 2026 14:10
…ules Default SQL Rules cost 1.09x on the 10,000-model compile and 1.20x and 1.25x on the 5,000- and 10,000-model cache guards' cold runs, measured against select = [] on the same machine. Scale those cold budgets and keep the previous budgets as compiler-only cases, as for 3,000 models.
kvlonge
disabled auto-merge
November 1, 2026 14:53
…ts on CI Replace the compiler-only twin at every guard size with one paired guard: the 3,000-model cache guard runs default Rules and select = [] in the same job and covers cold, warm, edit and project-config edit compiles at the previous budgets. Drop the compiler-only same-runner ratio job and the --compiler-only option of the ratio script. Scale each default Rules budget by the larger of the CI same-job and local alternating medians, excluding pairs whose Rules-independent phases exceed twice their median. Give the project-config edit its own budget, since it reruns every rule.
… budget scope The stated method gives 1.24x for the 5,000-model project-config edit, so its budget is 18.0 s. The cold budget bounds the cold run as well as the cache-disabled timeout.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
SQL Rules now live in the standalone SQLClean engine. SQLBuild runs them through it, so both tools share one rules system: an omitted
selectruns the default Rules,select = []turns configurable Rules off, and compiler validation stays on.Changes
sqlcleancrate, pinned to the v0.4.2 release commit. Codes are nowSQLCLEAN<nnn>.--target/--varson every compile path. Audit and test files withsql_analysis falseare skipped.format --fixkeeps its eight-code eligibility, verification and exit semantics.rule_ignoresgives the reason.select = []guard remains: the 3000-model cache twin, in the same job, at the old budgets (cold, warm, edit, project-config edit). Default budgets scale by the larger of CI and local paired medians: fresh 9.9/15.4/28.8 s; cache cold 10.5/17.1/33.6 s; new project-config edit budget 11.2/18.0/37.0 s. The fresh ratio vs main keeps a temporary 1.25 wall, 1.41 CPU cold limit.Verification
fensu checkreports 0 faults; ratio script unit tests pass.