Skip to content

feat: require types on enforced contract columns - #707

Merged
kvlonge merged 1 commit into
mainfrom
feat/require-typed-contract-columns
Sep 17, 2026
Merged

kvlonge merged 1 commit into
mainfrom
feat/require-typed-contract-columns

Conversation

@kvlonge

@kvlonge kvlonge commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Why

An enforced contract can currently declare a complete output shape while leaving columns untyped. Projects that require authoritative schemas need a deterministic Rule preventing name-only contract columns before explicit output-boundary typing is enforced.

Changes

  • add SQBRCONTRACT106 for untyped columns in enforced contracts
  • keep unenforced metadata outside this Rule so SQBRCONTRACT101 remains the enforcement-presence gate
  • document the SQBRCONTRACT101/105/106 contract enforcement chain
  • add native, catalogue, and real CLI integration coverage

Verification

  • cargo test -p sqlbuild-rules-native
  • uv run pytest tests/unit/src/sqlbuild/rule_engine/_helpers/engine/test_catalogue.py -n auto --dist loadfile
  • uv run pytest tests/integration/src/sqlbuild/cli/commands/main/test_rules.py::test_given_contract_rules_when_compiling_then_contract_is_enforced_typed_and_explicit -n auto --dist loadfile
  • cargo clippy -p sqlbuild-rules-native --all-targets -- -D warnings
  • uv sync --all-extras
  • make check-ci
  • downstream static evaluation: 17,546 untyped enforced-contract columns across 974 models
  • public repository hygiene scan

@kvlonge
kvlonge enabled auto-merge (squash) September 17, 2026 19:55
@kvlonge
kvlonge merged commit 1a0b340 into main Sep 17, 2026
18 checks passed
@kvlonge
kvlonge deleted the feat/require-typed-contract-columns branch September 17, 2026 20:06
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