CRO PlatformAI-Native CRO OS
Toggle navigationMenu

Reference

Database schema — `cro.*` ERD

The canonical data model. Tables are color-coded by category: regulated tables carry provenance and require a Part 11 signature to promote staging → live. Click any table in the diagram to jump to its details card below, or open `/schema?table=study` to deep link.

Tables

15

Columns

174

Foreign keys

20

Regulated tables

9

Regulated9

Carries created_at / updated_at / created_by / provenance_id. Promotion requires a Part 11 signature.

Staging2

Where agents land their writes. State machine: proposed → reviewing → signed → promoted.

Audit2

Append-only provenance and ops logs. Not part of the regulated write path.

Reference2

External or read-only data we index but do not own.

Entity-relationship diagram of the `cro.*` schema — click a table for detailscroprovenance_eventAuditPKiduuidstudy_iduuid·actor_kindtext·actor_idtextmodel_providertextmodel_idtextFKmodel_version_iduuid·actiontext·subject_kindtext·subject_idtext·retrieved_contextjsonbreviewer_user_iduuidsignature_iduuid·occurred_attimestamptz·payloadjsonbcrostaging_recordStagingPKiduuid·entity_kindtextentity_iduuid·agent_idtextFKmodel_version_iduuidFKprovenance_iduuid·stateenum·proposed_statejsonb·created_attimestamptz·updated_attimestamptz·created_byuuidcrosignature_eventRegulatedPKiduuid·user_iduuid·user_display_nametext·intentenum·subject_kindtext·subject_idtext·re_auth_attimestamptz·meaning_of_signaturetext·signed_attimestamptz·created_attimestamptz·updated_attimestamptz·created_byuuidFKprovenance_iduuidcromodel_registry_versionRegulatedPKiduuid·providertext·model_idtext·prompt_hashtext·prompt_versiontext·registered_attimestamptzretired_attimestamptz·notestext·created_attimestamptz·updated_attimestamptz·created_byuuidFKprovenance_iduuidcrovalidation_evidence_runRegulatedPKiduuidpr_numberinteger·commit_shatext·evidence_pathsjsonbsigned_by_user_idtextsigned_attimestamptz·created_attimestamptz·updated_attimestamptz·created_byuuidFKprovenance_iduuidcrolive_essential_documentRegulatedPKiduuidFKpromoted_from_staging_iduuidFKsignature_iduuidstudy_iduuid·document_typetext·document_titletext·storage_uritext·metadatajsonb·created_attimestamptz·updated_attimestamptz·created_byuuidFKprovenance_iduuidcroapp_logAuditPKiduuid·leveltext·componenttext·messagetextFKprovenance_iduuid·payloadjsonb·logged_attimestamptzcrostudyRegulatedPKiduuid·codetext·sponsortext·phasetext·therapeutic_areatext·indicationtext·statustext·healthtext·executive_summarytext·goalsjsonb·start_datedate·planned_end_datedate·current_forecast_end_datedate·contracted_budgetnumeric·ebv_spentnumeric·eac_budgetnumeric·currencytext·created_attimestamptz·updated_attimestamptz·created_byuuidFKprovenance_iduuidcrostudy_kpiRegulatedPKiduuidFKstudy_iduuidlabeltextvaluetextdeltatextdelta_directiontextthresholdtext·positioninteger·created_attimestamptz·updated_attimestamptz·created_byuuidFKprovenance_iduuidcrostudy_milestoneRegulatedPKiduuidFKstudy_iduuidnametextplanned_datedateactual_or_forecast_datedatestatustextpositioninteger·created_attimestamptz·updated_attimestamptz·created_byuuidFKprovenance_iduuidcrostudy_riskRegulatedPKiduuidFKstudy_iduuidtitletextownertextseveritytextmitigationtextstatustext·created_attimestamptz·updated_attimestamptz·created_byuuidFKprovenance_iduuidcrostudy_resourceRegulatedPKiduuidFKstudy_iduuidroletextheadcountintegerftenumericrate_per_monthnumeric·created_attimestamptz·updated_attimestamptz·created_byuuidFKprovenance_iduuidcrovector_documentReferencePKiduuid·source_kindtext·source_uritext·chunk_indexinteger·contenttext·embeddingjsonb·metadatajsonb·created_attimestamptz·updated_attimestamptzcrosponsor_requestStagingPKiduuid·sponsor_idtextstudy_iduuid·subjecttext·bodytext·prioritytext·statustextFKprovenance_iduuid·created_attimestamptz·updated_attimestamptz·created_byuuidauthusersReferencePKiduuidemailtextencrypted_passwordtextemail_confirmed_attimestamptzraw_app_meta_datajsonbraw_user_meta_datajsonblast_sign_in_attimestamptz·created_attimestamptz·updated_attimestamptz
LegendRegulatedStagingAuditReferencePKprimary keyFKforeign key
Focused: cro.staging_record clear

Table reference

15 of 15 tables shown

cro

provenance_event

Append-only ALCOA+ provenance spine. Every regulated action emits a row here before any write. Inspectors join through subject_kind/subject_id to reconstruct chain of custody.

Audit
ColumnTypeKeyReferencesNotes
iduuidPK
study_iduuidnullable
actor_kindtextrequiredhuman | agent | system
actor_idtextrequired
model_providertextnullable
model_idtextnullable
model_version_iduuidFKcro.model_registry_version
actiontextrequired
subject_kindtextrequired
subject_idtextrequired
retrieved_contextjsonbrequired
reviewer_user_iduuidnullable
signature_iduuidnullable
occurred_attimestamptzrequired
payloadjsonbrequired

cro

staging_record

The only legal write destination for agents. Proposed state lands here in `proposed`; humans review and sign to advance through `reviewing` → `signed` → `promoted`.

Staging
ColumnTypeKeyReferencesNotes
iduuidPK
entity_kindtextrequired
entity_iduuidnullable
agent_idtextrequired
model_version_iduuidFKcro.model_registry_version
provenance_iduuidFKcro.provenance_event
stateenumrequiredstaging_state enum
proposed_statejsonbrequired
created_attimestamptzrequired
updated_attimestamptzrequired
created_byuuidrequired

cro

signature_event

Append-only 21 CFR Part 11 signatures. Every promotion staging→live requires one row here. Carries re-auth timestamp and meaning-of-signature text.

Regulated
ColumnTypeKeyReferencesNotes
iduuidPK
user_iduuidrequired
user_display_nametextrequired
intentenumrequiredsignature_intent enum
subject_kindtextrequired
subject_idtextrequired
re_auth_attimestamptzrequired
meaning_of_signaturetextrequired
signed_attimestamptzrequired
created_attimestamptzrequired
updated_attimestamptzrequired
created_byuuidrequired
provenance_iduuidFKcro.provenance_event

cro

model_registry_version

One row per (provider × model_id × prompt_hash). CI fails if a prompt diff lands without a registry row. Powers /models console and provenance joins.

Regulated
ColumnTypeKeyReferencesNotes
iduuidPK
providertextrequired
model_idtextrequired
prompt_hashtextrequired
prompt_versiontextrequired
registered_attimestamptzrequired
retired_attimestamptznullable
notestextrequired
created_attimestamptzrequired
updated_attimestamptzrequired
created_byuuidrequired
provenance_iduuidFKcro.provenance_event

cro

validation_evidence_run

One row per CI run that emitted CSV/CSA validation evidence. Captures pr_number, commit_sha, and the storage paths of evidence artifacts.

Regulated
ColumnTypeKeyReferencesNotes
iduuidPK
pr_numberintegernullable
commit_shatextrequired
evidence_pathsjsonbrequired
signed_by_user_idtextnullable
signed_attimestamptznullable
created_attimestamptzrequired
updated_attimestamptzrequired
created_byuuidrequired
provenance_iduuidFKcro.provenance_event

cro

live_essential_document

Promoted-from-staging essential documents (TMF artifacts). One row per signed promotion; links back to both the staging row and the signature event.

Regulated
ColumnTypeKeyReferencesNotes
iduuidPK
promoted_from_staging_iduuidFKcro.staging_record
signature_iduuidFKcro.signature_event
study_iduuidnullable
document_typetextrequired
document_titletextrequired
storage_uritextrequired
metadatajsonbrequired
created_attimestamptzrequired
updated_attimestamptzrequired
created_byuuidrequired
provenance_iduuidFKcro.provenance_event

cro

app_log

Ops-support structured log. Also acts as the transactional outbox for buffered events (per CLAUDE.md event bus default). Not regulated; no provenance requirement.

Audit
ColumnTypeKeyReferencesNotes
iduuidPK
leveltextrequired
componenttextrequired
messagetextrequired
provenance_iduuidFKcro.provenance_event
payloadjsonbrequired
logged_attimestamptzrequired

cro

study

One row per clinical study. Carries sponsor, phase, status, health, timeline, financials, and the executive summary used by /studies and /digest.

Regulated
ColumnTypeKeyReferencesNotes
iduuidPK
codetextrequiredunique short code
sponsortextrequired
phasetextrequired
therapeutic_areatextrequired
indicationtextrequired
statustextrequired
healthtextrequiredgreen | yellow | red
executive_summarytextrequired
goalsjsonbrequired
start_datedaterequired
planned_end_datedaterequired
current_forecast_end_datedaterequired
contracted_budgetnumericrequired
ebv_spentnumericrequired
eac_budgetnumericrequired
currencytextrequired
created_attimestamptzrequired
updated_attimestamptzrequired
created_byuuidrequired
provenance_iduuidFKcro.provenance_event

cro

study_kpi

Headline KPI tiles per study (label, value, delta direction, threshold). Position orders them in the /studies/[id] header strip.

Regulated
ColumnTypeKeyReferencesNotes
iduuidPK
study_iduuidFKcro.study
labeltextnullable
valuetextnullable
deltatextnullable
delta_directiontextnullable
thresholdtextnullable
positionintegerrequired
created_attimestamptzrequired
updated_attimestamptzrequired
created_byuuidrequired
provenance_iduuidFKcro.provenance_event

cro

study_milestone

Lifecycle milestones per study (FPI, LPI, LPLV, DBL, CSR). Planned vs. actual/forecast dates drive the at-risk indicator.

Regulated
ColumnTypeKeyReferencesNotes
iduuidPK
study_iduuidFKcro.study
nametextnullable
planned_datedatenullable
actual_or_forecast_datedatenullable
statustextnullable
positionintegernullable
created_attimestamptzrequired
updated_attimestamptzrequired
created_byuuidrequired
provenance_iduuidFKcro.provenance_event

cro

study_risk

Active and closed risks per study. Severity drives the /risks register heatmap; owner is the named human accountable for mitigation.

Regulated
ColumnTypeKeyReferencesNotes
iduuidPK
study_iduuidFKcro.study
titletextnullable
ownertextnullable
severitytextnullable
mitigationtextnullable
statustextnullable
created_attimestamptzrequired
updated_attimestamptzrequired
created_byuuidrequired
provenance_iduuidFKcro.provenance_event

cro

study_resource

Role-level resource plan per study (headcount, FTE, monthly rate). Feeds the cost-vs-budget rollups on the /costs console.

Regulated
ColumnTypeKeyReferencesNotes
iduuidPK
study_iduuidFKcro.study
roletextnullable
headcountintegernullable
ftenumericnullable
rate_per_monthnumericnullable
created_attimestamptzrequired
updated_attimestamptzrequired
created_byuuidrequired
provenance_iduuidFKcro.provenance_event

cro

vector_document

pgvector-backed semantic index for the knowledge-RAG agent. Embeddings live alongside source text and citation metadata.

Reference
ColumnTypeKeyReferencesNotes
iduuidPK
source_kindtextrequired
source_uritextrequired
chunk_indexintegerrequired
contenttextrequired
embeddingjsonbrequiredvector(1536)
metadatajsonbrequired
created_attimestamptzrequired
updated_attimestamptzrequired

cro

sponsor_request

Sponsor portal intake. Every inbound request lands as a staging row first; promotion to an actionable item still requires the same A2 gate.

Staging
ColumnTypeKeyReferencesNotes
iduuidPK
sponsor_idtextrequired
study_iduuidnullable
subjecttextrequired
bodytextrequired
prioritytextrequired
statustextrequired
provenance_iduuidFKcro.provenance_event
created_attimestamptzrequired
updated_attimestamptzrequired
created_byuuidrequired

auth

users

Supabase Auth user table. Referenced by created_by / created_by_user_id on every regulated row. Owned by Supabase Auth; we read but do not write.

Reference
ColumnTypeKeyReferencesNotes
iduuidPK
emailtextnullable
encrypted_passwordtextnullable
email_confirmed_attimestamptznullable
raw_app_meta_datajsonbnullable
raw_user_meta_datajsonbnullable
last_sign_in_attimestamptznullable
created_attimestamptzrequired
updated_attimestamptzrequired