mirror of
https://github.com/ruvnet/RuView.git
synced 2026-10-18 21:00:22 -05:00
decay(now) multiplied confidence by exp(-(now - timestamp_ns)/tau_eff) on every call, but timestamp_ns is the last-seen time and does not move when decay runs. Calling decay(t1) then decay(t2) applied exp(-(t1-ts)/tau) * exp(-(t2-ts)/tau) instead of exp(-(t2-ts)/tau), so confidence fell faster the more often the caller ticked. Track how far each Gaussian has already been decayed (decayed_to_ns) and only apply the interval since max(decayed_to_ns, timestamp_ns). A fresh observation still restarts the clock, and the lifetime-stretched tau_eff is unchanged. Fusion and the merge pass keep the later of the two decayed_to_ns values. The new field is #[serde(default)], so maps serialized before this change load with 0 and decay from timestamp_ns as before. Adds two tests: one-shot vs. per-second decay must agree to 1e-12, and the wall-vs-transient persistence case must hold when decay runs every 10 s. Co-Authored-By: claude-flow <ruv@ruv.net>