Conversation
…command) - parseMemoryBlocks/dreamSimilarity/dreamAnalyze/dreamDropIndices/dreamApply pure functions - memory_dream tool: report mode (read-only findings) + apply mode (removes duplicate older copies and superseded entries via existing recovery-record pipeline, undoable with memory_restore; refreshes snapshot + qmd index) - /pi-dream command: quick read-only health check with notification summary - 10 new unit tests (192 total pass), tsc + biome clean Signed-off-by: KrissTos <cristiano.tosoni@gmail.com>
- /pi-dream (or /pi-dream report) → sends user message asking agent to run memory_dream report mode and show full findings in conversation - /pi-dream apply → runs apply mode, shows removed entries + recovery ID - replaces cramped notify-only health check Signed-off-by: KrissTos <cristiano.tosoni@gmail.com>
…ded) Signed-off-by: KrissTos <cristiano.tosoni@gmail.com>
Signed-off-by: KrissTos <cristiano.tosoni@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a32eec405b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export function dreamSimilarity(a: string, b: string): number { | ||
| const setA = dreamTokenSet(a); | ||
| const setB = dreamTokenSet(b); | ||
| if (setA.size === 0 && setB.size === 0) return 1; |
There was a problem hiding this comment.
Avoid treating tokenless entries as duplicates
When entries contain only non-ASCII text or words shorter than three characters, such as Chinese/Japanese memories or short technical notes like “Use Go” and “Use AI,” the tokenizer produces empty or effectively identical sets and this branch assigns them similarity 1. memory_dream therefore groups unrelated entries as duplicates, and mode='apply' deletes all but one of them. Treat entries without sufficient comparable tokens as non-duplicates or fall back to a Unicode-aware/text comparison.
Useful? React with 👍 / 👎.
| }; | ||
| const findings: string[] = []; | ||
| for (const group of analysis.duplicateGroups) { | ||
| findings.push(`Duplicate group (keeping newest #${Math.max(...group)}):`); |
There was a problem hiding this comment.
Report the entry that timestamp ordering actually keeps
When duplicate blocks are not stored chronologically, this reports the largest file index as the retained entry, while dreamDropIndices retains the block with the newest timestamp. For example, if block #0 is dated June and block #1 is dated January, the report says #1 will be kept but apply keeps #0; this makes the required report-before-apply review misleading precisely in the out-of-order case covered by the new retention logic.
Useful? React with 👍 / 👎.
Follow-up to #34. Prevents transitive duplicate deletion, keeps the newest timestamped entry, validates thresholds, makes auto mode report-only, and removes the branch-local PI-DREAM.md file.