Make the calculation input hash cover actual state content #38
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
buildCalculationDataRevision(src/lib/calculationRuntime.js:445-464) fingerprints inputs by counts and IDs only, andcacheableInput(backend/src/calculationRunner.js:423-437) hashes little more than that revision string. Cache correctness therefore rests entirely onhome.data_revisionbeing bumped by every input-affecting write (currently true — verified allmarkHomeDataChangedcall sites in app.js). Any future write path that misses the bump serves stale results silently.Fix: include the full normalized state in the hashed payload (
stableStringifyis already there; strip volatile fields likegeneratedAt). Keepdata_revisionas the cheap fast-path staleness check. Add a comment at both sites explaining the two-layer scheme.Acceptance criteria
Relations: relates to #15, #16
(Audit finding F-17, 2026-07-16 — Severity: Low, Confidence: High)