Compiled from
raw/codebase-snapshots/supabase-schema-2026-04-09.md(runs table)
Lexery - Contracts and Run Schema
Why This Page Exists
One of the most important convergence layers in Lexery is the run contract:
- what portal/API submit
- what Brain accepts
- how auth/plan/attachments enter runtime
Shared Contract Signals
From origin/dev packages/contracts
CreateRunRequestSchemaAttachmentInputSchemaCreateRunResponseAuthContextRunEventRunSnapshot
CreateRun Request Fields
querytenant_iduser_idconversation_idlocaleclient_contextattachmentsdry_rundebugidempotency_keyallow_anonymous
Attachment Shape
Each attachment must provide exactly one source:
contentBase64- or
presignedUrl
Auth Context Shape
tenant_iduser_idplan_tierfeatures
Snapshot Meaning
The runtime contract already anticipates:
- request snapshotting
- auth snapshotting
- flags
- version
- overflow references
- project/mm context
Why This Matters
Observed: Lexery is trying to make the product-to-brain boundary explicit and typed.Inferred: shared contracts are the main antidote to branch drift betweenorigin/devand Brain branch work.
Major Drift Still Present
- plan taxonomy is still inconsistent across backend and frontend
- some contract richness exists in
origin/devmore clearly than in current local checked portal/api code