You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Step 5: type the unscoped database doors narrowly and fence their callers #59
Found by the step 5 whole review (Sonnet, finding 6), triaged Issue futura (delivery L12); left out of the closing push for time.
Database.installation and libraryInstallation hand out the same CommandTx as a scoped command. So "opening a transaction without a scope does not compile" (criterion 7, database.check.ts) holds only for read, command and libraryCommand.
Today's callers:
platform/database.ts: the migration and login checks.
status/status.ts: now installationRead for the read.
identity/first-person.ts.
Several tests.
In phase 1 these doors reach every company row through runtime_transition. Phase 2 (PR 55) closes them in the database.
Trigger: before a second caller of an unscoped door appears outside platform, status and first-person.
Direction:
Narrow installation to the type its callers need (execute plus hub.starts).
Add a dependency-cruiser rule that only platform, status and first-person may name installation or libraryInstallation.
From the step 5 second delta check: hub_invitation also holds a table-wide INSERT on auth."user" (PR 53). The password command creates the person, so INSERT is needed. But a forgotten column list in the link scope could insert a person with any role, admin included, because the INSERT grant covers every column. Narrow it with the doors here: a column-level INSERT (id, name, email, email_verified, created_at, updated_at), or a row policy WITH CHECK (role is null or role = 'user') on the link scope's insert.
Activity
leandrotcawork commentedon Oct 17, 2026
From the step 5 second delta check:
hub_invitationalso holds a table-wideINSERTonauth."user"(PR 53). The password command creates the person, so INSERT is needed. But a forgotten column list in the link scope could insert a person with anyrole,adminincluded, because the INSERT grant covers every column. Narrow it with the doors here: a column-levelINSERT (id, name, email, email_verified, created_at, updated_at), or a row policyWITH CHECK (role is null or role = 'user')on the link scope's insert.