Decisions · ADR-002
Deterministic replayability
Status calculations are deterministic and tied to a versioned rule set, so the same inputs under the same rule version give the same result. Built so a reviewer can reconstruct how a status was reached.
Context
An auditor reviewing a compliance determination years after it was made cannot trust an outcome that depends on the current state of anything. The rule set evolves. Reference data evolves. Clock-bound logic introduces non-determinism. If the same inputs at different times produce different outcomes, the audit posture is invalidated and the platform cannot defend a historical determination. This is the failure mode that loses fair hearings.
Decision
Status calculations are designed to capture their inputs and the rule version that evaluated them, so the same inputs against the same rule version give the same result. The status is a calculation that state staff act on; the state agency makes the decision. There is no clock-bound randomness, no “current best estimate” logic, and no stale model output in the status calculation. Rule versions are first-class entities; every determination row links to the rule-version row that produced it.
Consequences
The design goal is that a reviewer in 2030 can see which rule version applied to a 2026 status and arrive at the same result. Rule changes require a new rule version and a clean cutover; old determinations stay associated with the old rule version. Operational cost: storing inputs verbatim (the platform cannot rely on reconstruction from state). The status calculation is designed as a pure function of (inputs, rule version), and that purity is enforced at the type level via ADR-004’s view/mutation separation.
Alternatives considered
- Store outcome only, recompute inputs from current state. Rejected: state evolves. Recomputed inputs in 2030 may not match the inputs as they existed in 2026.
- Store outcome plus a digest hash of inputs, not the full inputs. Rejected: cannot replay if rule version changes. Digest tells you whether something matches; doesn’t let you re-run the rule against the original inputs.
References
- standardDeterministic computation as the basis for replayable audit
- standardEvent-sourcing patterns for the inputs-and-rule-version pairing
Related decisions