ADR-0007: Make relationships and business rules executable¶
- Status: Accepted — retrospective baseline.
- Recorded: 2026-09-29. This is the recording date, not an invented original approval date.
- Authority and implementation boundaries: see Evidence below and the register conventions.
Context¶
Plausible-looking rows can violate keys, nullable references, formulas and cross-table invariants.
Decision¶
Represent supported rules in typed YAML/JSON contracts, enforce them deterministically, and validate the result. Declared/generated key domains and reviewed relationships take precedence over heuristic guesses. Repeated-identifier pools retain counts, not source identifiers or lookup maps.
Valid publication requires the applicable invariants. Controlled invalid cases must be explicitly requested, reproducible and reported; they never bypass privacy. Source-free generation formulas remain supported independently of the narrower transformation RC scope in ADR-0026.
Alternatives and consequences¶
Free-form LLM validation cannot establish invariants. Silently repairing conflicting keys or publishing a partially solved dataset hides invalidity. Exact source frequencies/totals are not guaranteed by retaining relational structure.
Evidence¶
Sources: generation and rules, relational contract, validation specification. Executable anchors: business rules, generation hardening, identifier pools.
The additive conditional-formula contract follows this deterministic rule decision; see the business-rules baseline and source-free example.
Revisit when¶
A new rule family needs defined executable semantics and validation; prose or a prototype alone is insufficient.
The additive explicit relational-scenario contract follows this decision; see the relational synthesis contract. It retains invalid status for requested orphans and uses generated parent ordinals only, without source histograms or row mappings.