From 9558eab6f387b59e0730634c6c1916d28b0c472c Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 22 May 2026 20:48:58 +0100 Subject: [PATCH] Keep durable memory anchors in context --- .../core/src/void-self-state-projection.ts | 32 +++++++++++++++++-- state/evidence.jsonl | 1 + 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/packages/core/src/void-self-state-projection.ts b/packages/core/src/void-self-state-projection.ts index 901cbbe..83ccd6f 100644 --- a/packages/core/src/void-self-state-projection.ts +++ b/packages/core/src/void-self-state-projection.ts @@ -180,11 +180,20 @@ export function renderVoidSelfStateSummary( .sort((left, right) => right.priority - left.priority) .slice(0, 4) .map((value) => value.label); - const memories = state.thoughtMemory.memories - .filter((memory) => !memory.retiredAt) + const activeMemories = state.thoughtMemory.memories + .filter((memory) => !memory.retiredAt); + const memories = activeMemories .slice(-6) .reverse() .map((memory) => renderTypedMemory(memory, identityName)); + const detailedMemoryIds = new Set( + activeMemories + .slice(-6) + .map((memory) => memory.memoryId), + ); + const memoryAnchors = activeMemories + .filter((memory) => !detailedMemoryIds.has(memory.memoryId)) + .map((memory) => renderTypedMemoryAnchor(memory)); const shortTermMemories = state.thoughtMemory.shortTerm .slice(-6) .reverse() @@ -239,6 +248,9 @@ export function renderVoidSelfStateSummary( memories.length > 0 ? [`- What ${identityName} remembers:`, ...memories].join("\n") : `- What ${identityName} remembers: nothing durable yet.`, + memoryAnchors.length > 0 + ? [`- Other durable memory anchors still in reach:`, ...memoryAnchors].join("\n") + : `- Other durable memory anchors still in reach: none.`, shortTermMemories.length > 0 ? ["- Short-term residue awaiting sleep:", ...shortTermMemories].join("\n") : "- Short-term residue awaiting sleep: none.", @@ -429,6 +441,22 @@ function renderTypedMemory( return lines.join("\n"); } +function renderTypedMemoryAnchor( + memory: VoidThoughtMemory["memories"][number], +): string { + const target = memory.target.label ?? memory.target.id; + const summary = truncateOptionalText(memory.summary, 180) ?? memory.summary; + const tags = memory.tags + .filter((tag) => + tag.startsWith("repo:") || + tag.startsWith("topic:") || + tag.startsWith("value:") || + tag.startsWith("identity:") + ) + .slice(0, 4); + return `- ${target}: ${summary}${tags.length > 0 ? ` [${tags.join(", ")}]` : ""}`; +} + function renderTypedIncubationThread(thread: VoidThoughtMemory["incubation"][number]): string { const target = thread.target.label ?? thread.target.id; const lines = [`- ${thread.topic}: ${thread.summary}`]; diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 5d85f3f..3eccd6f 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -283,3 +283,4 @@ {"ts":"2026-05-22T19:23:18Z","type":"maintenance","status":"ok","note":"Ran swarm-wide .cc hygiene after Mimir exposed retained tombstones. Repo Face state files now repair through pruned writes: all registered repo Faces retain 8 global typed documents with zero retired entries; collapse loop terms LocalCastBridge/wet-voice/canary were removed from active repo Face .cc state except Nibu's legitimate Aetheria witness vocabulary. Void's own self-state was also repaired, shrinking from about 171KB to 135KB and removing 5 retired memories, 5 retired agency pressures, and 11 retired interventions."} {"ts":"2026-05-22T19:24:10Z","type":"maintenance","status":"ok","note":"Completed swarm-wide state pocket-cleaning. Repaired all registered repo Face .cc files and Void self-state with pruned write semantics, removed old proof-loop receipts/state from Aqua/Epiphany/Libby/Bifrost and stale LocalCastBridge memories/cursor entries from Void, verified registered Face state files have 8 envelopes and zero retired entries; only Nibu retains witness wording as active Aetheria continuity/residue vocabulary."} {"ts":"2026-05-22T19:45:13Z","type":"fix","status":"ok","note":"Pruned terminal audit residue from current self-state: write normalization now drops terminal open cases and keeps only queued/deferred candidate interventions. Repaired Void self-state from about 125KB to 95KB by removing 21 terminal candidates and 2 answered cases; speech receipts remain bounded audit evidence. Updated speech and memory lifecycle fixtures for the new contract."} +{"ts":"2026-05-22T19:48:34Z","type":"fix","status":"ok","note":"Changed Void self-state projection so durable memory is not recency-only recall. Normal context now renders full detail for the newest/salient memories plus compact anchors for the remaining active durable memories; Void's current rendered self-state summary grows from about 14KB to 18KB while keeping all 25 durable memories visible by target/summary/tags."}