Repository navigation
fix(memory-core): drop dreaming theme echoes from promotion candidates - #75139
keane-751892 wants to merge 1 commit into
Conversation
Light Sleep and Deep Sleep phases write - Theme: `X` kept surfacing across N memories. into daily notes. The next dreaming cycle re-ingests just the first line as a fresh candidate before its indented status:staged and recalls fields land. The 5-field contamination check then misses it, so the theme echo gets promoted into MEMORY.md and the cycle keeps recursing. Real workspaces accumulate dozens of these per agent. Match the unique "kept surfacing across N memories" signature when a narrative lead is present, even without status/recalls. Add a regression test covering both the line-prefixed and bare-Reflections variants observed in production daily notes. Thanks @keane-751892
|
Thanks for the context here. I did a careful shell check against current Close: current main already blocks the reported managed Dreaming theme-echo promotion path with broader source-aware guards, while this old branch is conflicting and its remaining exact predicate-only change is minor/unproven. So I’m closing this older PR as already covered on Review detailsBest possible solution: Keep the current source-aware managed-block stripping and rehydration fence guard; if a remaining unfenced theme-only leak is observed, open a fresh narrow PR with current-main reproduction and real workspace proof. Do we have a high-confidence way to reproduce the issue? Yes, source-level: current main still emits the reported REM theme line, and the old exact predicate would miss a bare theme-only Candidate/Reflections snippet. The managed-block ingestion strip and rehydration fence guard now block the reported generated daily-note path without a live workspace replay in this read-only review. Is this the best way to solve the issue? No for merging this stale branch. The current main solution is broader and more source-aware than the predicate-only branch; any remaining exact-signature gap needs fresh proof that it still escapes outside managed Dreaming fences. Security review: Security review cleared: The diff only changes a local memory-core string predicate and colocated test; it adds no dependency, workflow, permission, secret, network, or code-execution surface. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 010b61746379; fix evidence: commit 010b61746379, main fix timestamp 2026-07-03T13:23:11-07:00. |
|
Heads up: this PR needs to be updated against current |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Light Sleep / Deep Sleep phases write
```
```
into daily notes. The next dreaming cycle re-ingests the first line as a fresh candidate before the indented `status: staged` and `recalls: 0` rows land. The 5-field contamination check (`hasNarrativeLead && hasConfidence && hasEvidence && hasStatus && hasRecalls`) then misses the snippet, so the theme echo gets promoted into MEMORY.md and the cycle keeps recursing. Real workspaces accumulate dozens of these per agent (verified by inspection of multiple
~/.openclaw/workspace-*/memory/2026-04-*.mdfiles).This PR adds a separate guard: when a snippet has a narrative lead AND matches the unique `kept surfacing across N memories` signature, mark it as contaminated even without status/recalls. The original 5-field check stays as additional safety.
Test plan
pnpm test extensions/memory-core/src/short-term-promotion.test.ts— 45 tests pass, including the new "treats Light Sleep theme echoes as contaminated even without status/recalls" casepnpm check:changed— typecheck and tests green for extension lanes🤖 Generated with Claude Code