Status: accepted · Date: 2026-11-06 · Related: ADR-0002, ADR-0015
Enforcement: scripts/leaf-modules.test.mjs (the // LEAF MODULE header), Brandt-household tests in packages/preparedness (82 L water, 67,000 kcal); packages/api/src/features/lists/lists.procedures.test.ts (seeded versions equal the package, publish needs two distinct sign-offs, published rows refuse UPDATE/DELETE/TRUNCATE through the list_version_immutable trigger and have no tenant UPDATE/DELETE grant).
Every quantity in Varu must cite its source, date and version, and a published version must never change (RNF12). The list is needed on the phone, in the web editor and in the API, and the phone must compute without a network.
Decision
- A leaf, isomorphic package
packages/preparedness. No I/O, no framework imports, a// LEAF MODULEheader. It holds the list versionsDE-2025.10(BBK "Vorsorgen für Krisen und Katastrophen", 13.10.2025) andEU-72H(EU Preparedness Union Strategy, 26.03.2025), the quantity formulas and readiness. Mobile, web and API import it. - Formulas are rules, not code paths. Water 2 L/person/day; pets 0.2 L/pet/day (a hypothesis, marked as such); kcal/day adult 2,200, needs-help 1,900, child 1,500, baby 800; goal days 3, 7 or 10. Readiness is the mean of 8 areas; days is the minimum of water days and food days.
- Published versions are immutable rows in Postgres for the editor and for
GET /lists/:country/:version: a list version, its item rules, its source and two review sign-offs. Publishing inserts; nothing updates. A correction is a new version. - The app ships the versions it knows and learns newer ones from the API; the home records which version it follows.
Why not the alternatives
- Rules only in Postgres. The phone would need the network to compute readiness, which breaks offline use.
- Rules only in the app bundle. The municipality editor could not publish, and a correction would need a store release.
Consequences
- Package and database must agree: a test loads each published seed version and compares it with the package.
- Changing a formula is a new version, never an edit of
DE-2025.10.