Skip to content

Fix #34 conservative pi-dream consolidation - #43

Open
jayzeng wants to merge 9 commits into
mainfrom
review/fix-pr34
Open

jayzeng wants to merge 9 commits into
mainfrom
review/fix-pr34

Conversation

@jayzeng

@jayzeng jayzeng commented Sep 21, 2026

Copy link
Copy Markdown
Owner

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.

KrissTos and others added 7 commits August 24, 2026 17:35
…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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread index.ts
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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread index.ts
};
const findings: string[] = [];
for (const group of analysis.duplicateGroups) {
findings.push(`Duplicate group (keeping newest #${Math.max(...group)}):`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@jayzeng
jayzeng changed the base branch from main to review/base-pr34 September 21, 2026 02:06
@jayzeng jayzeng closed this Sep 21, 2026
@jayzeng jayzeng reopened this Sep 21, 2026
@jayzeng
jayzeng changed the base branch from review/base-pr34 to main September 21, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants