mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-12 04:01:20 +00:00
Review follow-up: the per-step gate recomputed view(previous) on every changed apply — a property read for identity-stable views, but a fresh throwaway object per change for computing views. The registry now keeps a WeakMap from state object to raw view: the previous state's view was cached when that state was current, so each distinct state's view computes exactly once (gate and snapshot share the memo) and the quiet path allocates nothing. Unlike the earlier lastView record, an entry is keyed by the state itself — the view of that exact state by the pure-view contract — so no stamping discipline exists to get wrong. Primitive states bypass the WeakMap and compute directly.