fix(memory-core): dreaming daily ingestion across calendar days#76359
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. from source inspection. Current main skips unchanged daily notes using only Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the per-dreaming-day checkpoint fix after contributor-provided real behavior proof is added and the memory-core changed checks are green. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection. Current main skips unchanged daily notes using only Is this the best way to solve the issue? Yes for the functional code direction. Tracking the last dreaming calendar day per daily note preserves same-day dedupe while allowing cross-day promotion signals; merge should wait for real behavior proof. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against a3870686947b. |
590a519 to
59d6529
Compare
59d6529 to
271ca6e
Compare
obviyus
left a comment
There was a problem hiding this comment.
Verified the dreaming daily-ingestion regression: current main skipped unchanged daily files by mtime/size only, and this head records the last dreaming day so same-day dedupe stays intact while later-day signals are counted.
Maintainer follow-up: rebased on current main, moved the changelog entry to the active Fixes tail with #76359 credit, trimmed noisy comments, and kept the branch to one signed commit.
Local gate: OPENCLAW_TEST_HEAVY_CHECK_LOCK_HELD=1 OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=.artifacts/vitest-cache-pr76359-land OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test extensions/memory-core/src/dreaming-phases.test.ts -t 'checkpoints daily ingestion|increments dailyCount'.
|
Landed on main. Thanks @neeravmakwana. |
Summary
Deep dreaming promotion could stay at “Promoted 0” when daily notes were unchanged on disk:
daily-ingestion.jsononly storedmtimeMs/size, so later dreaming days skipped re-reading those files. Short-term entries then failed default deep gates (minRecallCount/minUniqueQueriesagainst combined signal counts) even though the underlying content was still eligible.Root cause
collectDailyIngestionBatchestreated “unchanged since last run” as “never ingest again,” which is correct for same-day duplicate runs but wrong across calendar dreaming days when the file content is stable.Linked issue
Fixes #76225 (related context: #67061 ingestion-day dedupe, #64068).
Why this is safe
recordShortTermRecalls/ dedupe rules; we only decide when to open a file again.lastDreamingDayIngestedre-ingest once on upgrade, then persist the new field.Security / runtime controls
Unchanged: memory file read policy, workspace scoping, dreaming triggers, and LLM-facing prompts. This is checkpoint bookkeeping only.
Testing
git diff --check origin/main...HEADpnpm exec vitest run extensions/memory-core/src/dreaming-phases.test.ts -t "increments dailyCount|checkpoints daily ingestion"pnpm check:changedOut of scope