ADR-0003: Canonical Schema Authority
Status
AcceptedContext
Repeated failures have shown drift between shared types, validators, DB schema, API behavior, and UI assumptions. Without a declared contract order, changes can appear correct locally while still breaking another layer. The same applies to the analytical layer: PostgreSQL remains the canonical source of truth for operational entities and workflow state, while the canonical improvement dataset remains the joined analytics, calibration, continuous improvement, and future ML/RL input layer aligned with the source contracts it summarizes.Decision
Adopt this canonical contract order for operating changes:- shared types
- validators or schemas
- DB schema or migrations
- API route behavior
- UI assumptions
- docs/wiki
Consequences
Positive
- drift becomes easier to reason about
- PR reviewers have a clear checklist for contract-affecting changes
- schema governance becomes explicit rather than inferred
Negative
- changes may feel slower because contract updates need cross-layer discipline
- repo contributors must learn the contract order