Model/docs/adr/0001-two-source-paths.md
2026-05-13 21:26:18 +00:00

1.5 KiB

Two source paths for a Property, not layered precedence

For modelling a Property we considered a strict layered precedence stack — patches > site_notes > energy_assessment > epc > predicted — with per-field provenance tracking. We rejected that in favour of two strictly disjoint source paths: a Property is modelled either from its Site Notes alone, or from the public EPC with Landlord Overrides applied on top. Site Notes are committed to being full-coverage by the domain (CONTEXT.md: Site Notes), so once we have them the EPC is irrelevant; conversely, Landlord Overrides are only meaningful when the EPC is the source of physical state.

The trade-off: layered precedence is more flexible (it tolerates a partial Site Notes survey by falling through to EPC for missing fields), but mixed-source data muddles the audit trail and undermines the "if we surveyed it, trust the survey" promise. The two-path model gives a cleaner derivation rule and an unambiguous source-of-truth per Property, at the cost of treating survey gaps as a survey-quality bug rather than a fallback signal. A Recency Tie-Break covers the one case where both exist: the newer of the two wins.

Consequences

  • Reversing this means rewriting Property.effective_epc and every service that reads it. Hard to roll back once 12 services depend on the two-path shape.
  • Future addition of a third path (e.g. partial-survey) is a real change, not just a config tweak — flag it as an ADR if proposed.