Repository navigation
[sql] Report a table whose key does not begin with its tenant - #278
Merged
Merged
Conversation
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
force-pushed
the
check/a-tenant-first-key
branch
from
December 4, 2026 22:46
1978fe2 to
cf13723
Compare
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The blame analysis of ORE Studio's sprint 31 recommended three proactive checks. This builds the one compass owns.
Built
rls_coveragegains RLS_003: a table withtenant_idwhose 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 honoursRLS_003 <table>in the ignore file;compass.sql.testspasses 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:
frandptvalidate againstenthroughcatalogueSchemaat module load, so a missing card key fails the page tests.🤖 Generated with Claude Code