Skip to content

docs: teach table checks (#347) - #351

Merged
0x054 merged 2 commits into
feat/table-checksfrom
feat/table-checks-347
Aug 18, 2026
Merged

docs: teach table checks (#347)#351
0x054 merged 2 commits into
feat/table-checksfrom
feat/table-checks-347

Conversation

@0x054

@0x054 0x054 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add Table checks section to the models guide: Check(suffix, predicate) in __ferro_checks__, lambda style (I-8), live name ck_<table>_<suffix>, and CheckViolationError on violation — with Assignment/Annotated tabs sharing the same ClassVar (I-7).
  • Extend the migrations capability matrix with table-check and column db_check reconcile rows (add / rebuild / drop / leftover warning; SQLite create-inline vs reconcile skip per ADR-0013/0014).
  • Update AGENTS.md I-1 item 8 with ck_<table>_<suffix> table-check naming alongside column checks.
  • Add runnable docs/examples/table_checks.py + _annotated.py companions; note CheckViolationError on the exceptions API page.

Test plan

  • uv run pytest tests/test_docs_examples.py
  • Example scripts run end-to-end via docs-examples harness

Issue closure

Closes #347

Made with Cursor

0x054 and others added 2 commits August 18, 2026 10:18
Document __ferro_checks__ declaration, CheckViolationError, auto-migrate
capability matrix rows, and I-1 ck_<table>_<suffix> naming for table checks.

Co-authored-by: Cursor <cursoragent@cursor.com>
Match the migrations matrix (ADR contract, not the Transfer-only slice)
and name the column-check FFI that actually exists.

Co-authored-by: Cursor <cursoragent@cursor.com>
@0x054

0x054 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Gate: clear

Read the full docs diff. AC for #347 is met.

  • Models guide: Check + __ferro_checks__, lambda pair, live ck_pair_at_most_one_side, violation → CheckViolationError
  • I-7 tabs share an identical ClassVar; field declarations are tabbed
  • I-8 lowercase-singular lambda
  • Migrations matrix: create-inline, add/rebuild/drop, leftover warning, SQLite skip
  • AGENTS.md I-1 item 8: ck_<table>_<suffix> beside ck_<table>_<col>
  • Runnable docs/examples/table_checks.py + _annotated.py

Nits fixed on the PR: dialect paragraph now states the locked ADR-0016 contract (same as the migrate matrix documenting the ladder before sibling slices land); I-1 column-check FFI named _ddl_check_constraint_name.

Merging into feat/table-checks once CI is green. Does not close parent #339.

@0x054
0x054 merged commit 4e9c3eb into feat/table-checks Aug 18, 2026
7 checks passed
@0x054 0x054 mentioned this pull request Aug 18, 2026
5 tasks
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