The Cardinal application
The system of record.
For: developers and reviewers
Everything Cardinal knows lives in one database, and one rule governs how it gets there: data is never written by a raw insert. Every write โ agent or human โ goes through a stored procedure that checks the actor, makes the write idempotent, and appends a hash-chained audit row. This page is that contract, and the families of records it protects.
The golden write-path rule
To read, you query a base table. To write, you call a stored procedure โ never an insert or update directly. Each procedure enforces four things, in order, every time.
flowchart LR CALL(["โ๏ธ A write
agent ยท human ยท system"]):::input G1{{"1 ยท Right actor?
role + RLS check"}}:::gate G2{{"2 ยท Idempotent?
operation_id dedupe"}}:::gate G3{{"3 ยท Apply"}}:::gate WRITE[("๐ base table")]:::db AUDIT[("๐ hash-chained
audit row")]:::chain REJ[/"โ rejected"/]:::bad SKIP[/"โญ return prior result"/]:::skip CALL ==> G1 G1 == โ ==> G2 G1 -- โ --> REJ G2 == โ first time ==> G3 G2 -- โญ replay --> SKIP G3 ==> WRITE G3 ==> AUDIT classDef input fill:#fce4ec,stroke:#b11f4b,stroke-width:2.5px,color:#7a1132 classDef gate fill:#fef3c7,stroke:#d97706,stroke-width:2px,color:#78350f classDef db fill:#f1f5f9,stroke:#475569,stroke-width:2px,color:#0f172a classDef chain fill:#1f2937,stroke:#111827,stroke-width:2.5px,color:#f9fafb classDef bad fill:#fee2e2,stroke:#dc2626,stroke-width:2px,color:#7f1d1d classDef skip fill:#e2e8f0,stroke:#64748b,stroke-width:2px,color:#1e293b
Why a procedure, not an insert
A raw insert could skip the actor check, double-apply on a retry, or land without an audit row. Routing every write through a procedure makes those mistakes impossible by construction.
Agents write through a shim
Agents write by inserting into a thin "in" view whose trigger calls the procedure. Humans hit the same procedures through the API. Both end up on the identical, audited path.
The record families
The schema groups into a handful of families. (Exact table counts are an implementation detail and drift over time; this site describes the model, not a fixed inventory.)
Engagement artifacts
Decisions, ADRs, risks/issues/blockers, workstreams, conversations, documents, notes, and recognitions โ the substance of the engagement.
Reports & briefs
The generated reports and the twice-daily 5-3-2-1 brief, with their publication and export records.
The conversation substrate
Conversations, communications, and the classifier and embedding records that group inbound messages into threads.
The publishing substrate
Publications, their per-target delivery rows, and the acknowledgements that come back.
Cost & governance
Cost telemetry, configuration and budgets, and the various operational state tables.
The audit spine
The hash-chained ledger, its payloads, the role snapshots and rotation log, and the leases.
Status vocabularies
Several record types move through a defined lifecycle. The exact state names are validated against the database; the shapes below are the ones a reader meets most often.
Decisions
Move from proposed, through accepted/decided, to ratified or resolved โ or are superseded or rejected.
ADRs
Move through draft โ reviewed โ compliance-checked โ ratified before they are settled.
Publications
Move from pending approval, through queued and in-flight, to sent โ or failed, superseded, or withdrawn.
Sensitivity
Documents carry a label from general through internal and confidential to regulated โ gating who may read the body.
The audit spine
The heart of the model is an append-only ledger where each row is hash-linked to the one before it. It is never updated or deleted; corrections are new rows. A verification routine walks the chain and returns OK only if every link holds โ so tampering is detectable, not merely discouraged. The Steward runs that verification continuously.
See the write-path in the end-to-end flow โ ยท The guarantees it underpins โ