The access contract
Every backend procedure gets an entry declaring its access as structured data: whether the caller must be signed in, which scopes the procedure requires, and how rows are scoped to the caller: own rows only, rows reachable through a declared relationship (a reporting chain, a project membership), rows in the caller’s org, or public. Attribute-based overrides (“admins can see others’ rows”) are declared against real columns, and bespoke rules the vocabulary can’t express are named conditions. Two properties keep the contract honest:- It must match the code’s guards. The declared authentication and scopes are cross-checked against the procedure’s actual guard at build time. A contract claiming a scope the procedure doesn’t enforce fails the build, and vice versa.
- It must be exercised. The build derives from the contract the exact set of scenarios the entry’s test has to cover, and fails until each exists.
Scenarios: every boundary gets a real request
The entry’s test expresses each boundary as an isolated scenario: its own seed, real calls against the running backend as specific personas, and read-only verification of the outcome.Generated descriptions and review flags
From the verified contract, the build generates everything the reviewer reads:- “Who can do this” and “How access is verified” — the plain-language description of each endpoint’s rules is generated from the contract, not written by a person.
- Concerns — review flags computed from what the contract permits: an endpoint where any signed-in user can modify rows they don’t own, or read every row, gets a warning that the permissive access should be verified. An unauthenticated surface is labeled “Anyone — even without signing in —”. Nobody types a concern by hand, and nobody can forget one.

