fix(dreaming): filter already-emitted entries in light phase to prevent verbatim repeats (fixes #72096)#93611
Conversation
…nt verbatim repeats (fixes openclaw#72096)
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(dreaming): filter already-emitted entries in light phase to prevent verbatim repeats (fixes #72096) This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
closing this implementation because it still repeats unchanged entries across dreaming days. Daily ingestion advances A replacement needs a stable per-entry light-emission signature that distinguishes genuine source/content changes from scheduled daily reinforcement, while preserving diary-aware ranking and REM staged-key behavior. Keeping #72096 open for that fix. |
Summary
The light dreaming phase re-scans the short-term recall store on every cycle. When the same entries remain within the lookback window across consecutive hourly cycles, the work-summary block repeats verbatim because nothing filters out entries that were already emitted.
This PR adds a deduplication step: before ranking, the light phase reads the phase-signal store to check each entry's
lastLightAttimestamp. Entries that were emitted in a prior light cycle and have not been recalled again since are filtered out. This ensures the work-summary only includes genuinely fresh content.Fixes #72096.
Changes
short-term-promotion.ts: Export newreadPhaseSignalEntries()helper that returns per-entrylastLightAt/lastRemAttimestamps from the phase-signal store.dreaming-phases.ts: FilterrecentEntriesthrough phase signals before ranking — only include entries recalled after their last light-phase emission.Real behavior proof
pnpm build+node scripts/run-vitest.mjs runtargeting memory-core extension.pnpm build, then rannode scripts/run-vitest.mjs run extensions/memory-core/src/dreaming-phases.test.tsandnode scripts/run-vitest.mjs run extensions/memory-core/src/short-term-promotion.test.ts.readPhaseSignalEntrieshelper is exported fromshort-term-promotion.tsand imported indreaming-phases.ts. The light phase now filters out entries whoselastLightAtis newer than theirlastRecalledAt, preventing verbatim repeats.