Skip to content

feat(config): rename column_contract_mode to check_declared_columns - #1434

Merged
chio-labs-delivery[bot] merged 3 commits into
mainfrom
feat/check-declared-columns
Nov 13, 2026
Merged

chio-labs-delivery[bot] merged 3 commits into
mainfrom
feat/check-declared-columns

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Why

settings.column_contract_mode = "implicit" | "explicit" named how a project opts in, not what happens. The setting only decides whether declared columns on models without a contract line are checked against the SELECT.

Changes

  • New [settings] check_declared_columns = true | false, default true. true checks that every declared column is in the SELECT and checks its nullability; false leaves declared columns as metadata, type enforcement and audit attachment, the same as per-model contract none. Per-model contract enforced / contract none still override.
  • column_contract_mode stays as a deprecated alias (implicit → true, explicit → false). Compiling prints one warning line naming the new key, and setting both keys is an error.
  • A cache-reused compile (launcher replay or Python reuse) prints the same warning.
  • Python API: SettingsConfig.check_declared_columns: bool replaces column_contract_mode, and the ColumnContractMode enum is removed (hosted-shapes list updated).
  • The K001 missing-column help, the two compiler goldens, the Contracts, Schemas, Project configuration and sqb compile docs, and the shipped skill references use the new key.
  • No DuckShop case: this renames a setting and changes no project shape, data value or lifecycle.

Verification

  • Loader tests cover default, false, both alias values, an invalid alias value, a non-boolean value and both keys set. A compile test checks the alias warning appears once and the new key prints none. An E2E test checks a warm reused compile still warns; it fails without either half of the reuse fix.
  • The generated-contracts oracle golden differs only by the help text: with the old help text substituted back, 0 of 126 entries differ.
  • Contract, discovery, compile and resource-SQL suites pass (200 tests); cargo test for sqlbuild-config, sqlbuild-cache and sqlbuild-analysis passes; make check-ci passes.

settings.check_declared_columns = true | false replaces
settings.column_contract_mode = "implicit" | "explicit". The old key
stays as a deprecated alias that prints one warning naming the new key,
and setting both keys is an error.
A reused compile, served by the native launcher or the Python CLI, now
prints the deprecated-setting warning before replaying stored output.
@kvlonge kvlonge added the full-verify Run the full Verify matrix on this pull request label Nov 12, 2026
@chio-labs-delivery
chio-labs-delivery Bot added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 3b7cbe3 Nov 13, 2026
58 checks passed
@chio-labs-delivery
chio-labs-delivery Bot deleted the feat/check-declared-columns branch November 13, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-verify Run the full Verify matrix on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant