ContractSpec docs

OSS-first docs

These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.

defineDatabaseTable — physical-table contracts

Spec-first declaration of physical tables (columns, PK, FK, tenantColumn).

field.key.label
defineDatabaseTable — physical-table contracts
field.version.label
field.type.label
field.title.label
defineDatabaseTable — physical-table contracts
field.description.label

Spec-first declaration of physical tables (columns, PK, FK, tenantColumn).

field.tags.label
database,tables,schema,tenant
field.owners.label
field.stability.label
public

Spec-first physical-table contracts. Each `DatabaseTableSpec` declares columns (type/nullable/default), primary key, foreign-key relations, and the mandatory `tenantColumn` anchoring row-level tenant isolation.

Declared as the `DatabaseTableSpecModel` `SchemaModel`; the TS shape is its

Zod-inferred form.

`defineDatabaseTable(spec)` is fail-closed: it rejects a missing/empty

`tenantColumn`, a `tenantColumn` absent from `columns`, and PK/FK columns that reference unknown columns.

`registerDatabaseTable`/`listDatabaseTables` expose the canonical registry

that the Drizzle generator (F2) and relational read-model (F3) compile against.