Skip to content

feat!: name built-in Rules SQLCLEAN and own the host contract - #17

Merged
kvlonge merged 1 commit into
mainfrom
feat/sqlclean-codes
Oct 31, 2026
Merged

kvlonge merged 1 commit into
mainfrom
feat/sqlclean-codes

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Why

SQLBuild will lint and format through this crate, so SQLClean must own one canonical contract: its own Rule codes, and a host API without SQLBuild names baked in.

Changes

  • Built-in codes SQCnnn become SQLCLEANnnn (same numbers), custom codes XSQC... become XSQLCLEAN..., the parse error is SQLCLEAN999. No aliases.
  • Selection contract, now tested end to end: no select runs the default Rules, SQLCLEAN selects every built-in Rule, an exact code selects one.
  • Placeholders hosts write for template code are SQLClean constants (INTERPOLATION_PLACEHOLDER_PREFIX and three more) instead of hard-coded __sqb_lint_/__sqlbuild_* names.
  • One fixture_harness request object (cte_prefixes, input_cte_prefixes, empty_relation) replaces allows_ceremonial_select, allows_empty_fixture_star and the hard-coded harness CTE names.
  • DeclaredRelation/declared_relation_keys (incremental and audit key semantics) are removed; hosts pass relation_keys.
  • Embedding docs describe the host contract and how relation_keys matches; Rule docs, skill, README, benchmarks script and the demo GIF use the new codes.

Verification

  • make verify (fensu 0 faults, clippy on 1.95 and 1.99), integration and e2e suites, hygiene scan.
  • New e2e cases for the selection contract on one file with a default and two opt-in findings.
  • Format corpus and every Rule test pass unchanged apart from codes and placeholder names.
  • Re-recorded demo checked: SQLCLEAN005, SQLCLEAN001, XSQLCLEANTEAM001, fixes apply.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Deploying sqlclean with  Cloudflare Pages  Cloudflare Pages

Latest commit: 194262c
Status: ✅  Deploy successful!
Preview URL: https://e33963d2.sqlclean.pages.dev
Branch Preview URL: https://feat-sqlclean-codes.sqlclean.pages.dev

View logs

Built-in Rule codes are SQLCLEANnnn instead of SQCnnn, custom Rule codes
start with XSQLCLEAN, and the parse error is SQLCLEAN999.

The embedding API no longer carries SQLBuild names. Hosts write the
SQLClean placeholder prefixes exported from constants, describe a test
or macro wrapper with one fixture_harness request object instead of
allows_ceremonial_select and allows_empty_fixture_star, and derive
relation_keys themselves: DeclaredRelation and declared_relation_keys
are removed.

BREAKING CHANGE: SQC and XSQC codes are now SQLCLEAN and XSQLCLEAN, and
the lint request replaces the two harness flags with fixture_harness.

Co-authored-by: Kevin Longe <kvlonge@gmail.com>
@kvlonge
kvlonge force-pushed the feat/sqlclean-codes branch from 40d8d5b to 194262c Compare October 31, 2026 12:21
@kvlonge
kvlonge merged commit c8c6b30 into main Oct 31, 2026
16 checks passed
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