mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
deriveMessages() no longer re-derives and re-clones the whole surface per call: each node is projected exactly once, when first seen (O(new nodes) per access), through the now-public deriveEventMessage — the per-node pure function external reconstructors and the dev invariant fold over a log prefix, so no two paths can disagree about a request's messages. A surface rewrite (replace, invalidate) rebuilds, signalled by SurfaceManager.replaceGeneration — monotonic, bumped by every folded replace and by invalidate(), never reset. Callers get a fresh array snapshot per call over SHARED deep-frozen messages: isolation of the append-only log moves from per-call cloning to unrepresentability (mutation throws), which the two isolation tests now pin directly.