Skip to content

[sql] Report a table whose key does not begin with its tenant - #278

Merged
mcraveiro merged 1 commit into
mainfrom
check/a-tenant-first-key
Dec 4, 2026
Merged

mcraveiro merged 1 commit into
mainfrom
check/a-tenant-first-key

Conversation

@mcraveiro

Copy link
Copy Markdown
Member

The blame analysis of ORE Studio's sprint 31 recommended three proactive checks. This builds the one compass owns.

Built

rls_coverage gains RLS_003: a table with tenant_id whose primary key does not begin with it is reported where the create script defines it, and the project's ignore file can excuse a table with a reason. The fact now carries each table's first key column. The rule fires on a key (id, tenant_id), is quiet on (tenant_id, id), and honours RLS_003 <table> in the ignore file; compass.sql.tests passes at 131 assertions in 38 cases.

This is the break that reached main as "the schema gate refuses two new scheduler tables".

Recorded rather than built

The other two need another project's data. The answer-shape corpus and the permission classification files are ORE Studio's, and a compass rule over them would have to name its files, which the codecs deliberately avoid. The task under Catch the errors LLMs introduce records that, with the analysis page as evidence, so the ORE Studio side can pick them up.

The i18n half of the second check already exists: fr and pt validate against en through catalogueSchema at module load, so a missing card key fails the page tests.

🤖 Generated with Claude Code

The blame analysis of ORE Studio's sprint 31 proposed three checks. This
builds the one compass owns: rls_coverage gains RLS_003, which reports a
table with tenant_id whose primary key does not begin with it, and the
ignore file excuses a table with a reason. The other two need the answer
shape corpus and the permission classification, which are another
project's data, and the task records that with the analysis as evidence.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@mcraveiro
mcraveiro force-pushed the check/a-tenant-first-key branch from 1978fe2 to cf13723 Compare December 4, 2026 22:46
@mcraveiro
mcraveiro merged commit 5dfd1a0 into main Dec 4, 2026
5 checks passed

This branch was previously deployed

1 inactive deployment
CI — cf137236 Deployed Dec 4, 2026 by mcraveiro via linux-clang-release-ninja #552
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