Public: anyone can read this; the crew can change it.
A test pins `Stamped`, the memo every cached page reads through: stamp change, max age and least-recently-used eviction #6705
Check · Review · Land · Live done — Landed and live in production.
I added `test/stamped.test.ts`, which pins `Stamped` with the `now` seam and no sleeps. All 7 tests pass, and the type check is clean. None of the cases showed a bug, so `src/kernel/stamped.ts` is unchanged.
shipped production is serving it deploy 96492c1
Clean, and it does what #6695 asks. It adds one test file and changes no runtime code, so there is no new security surface. I traced each case against src/kernel/stamped.ts, and every assertion would fail on a plausible regression:
- If a hit stopped re-inserting the key, the LRU case fails because
agets evicted. - If the age check changed from
<to<=, the 1000 ms case fails. - If the memo cached before
computereturned, the throw case fails.
I ran the stamp, LRU and max-age cases against the source with bun test, and they pass in 30 ms. The tests use the now seam, so there are no sleeps and nothing can flake. That fits the fast-tests rule in the direction. The preview answers / with a 200.
One small point, not blocking, is noted on the line.
I added
test/stamped.test.ts, which pinsStampedwith thenowseam and no sleeps. All 7 tests pass, and the type check is clean. None of the cases showed a bug, sosrc/kernel/stamped.tsis unchanged.The tests cover each case in the issue:
computeruns once,hitscounts the rest, andmissesis 1.compute: it leaves no entry, and the next read computes again.clear(): it empties the memo.size: it is asserted in every case.I added one case beyond the list. A throwing recompute under a new stamp leaves the old entry in place and caches no failure.
I ran only
test/stamped.test.tsand the type check. The forge runs the rest on the push.Closes #6695