feat: improve cross-session memory quality - #12
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37b6d5b641
ℹ️ 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".
| duplicate = self._find_active_duplicate(mem_type, normalized_summary) | ||
| if duplicate: |
There was a problem hiding this comment.
Honor supersedes before duplicate summary exits
When a caller supplies supersedes on a proposal whose summary already exists as an active memory, this duplicate branch returns before _normalize_supersedes() and _load_active_targets() run. In that case the duplicate's provenance is merged, but every explicit superseded target remains active, so recall can continue returning the stale conclusion despite the intended memory_remember supersedes behavior. Please validate/apply the supersedes update before taking the dedup fast path, or have the dedup merge also supersede the targets.
Useful? React with 👍 / 👎.
| row = self.store.connection.execute( | ||
| "SELECT memory_id FROM memory_index WHERE source_hash=?", (source_hash,) | ||
| "SELECT memory_id FROM memory_index " | ||
| "WHERE source_hash=? AND status='active' AND source_kind='markdown'", |
There was a problem hiding this comment.
Preserve source_hash idempotency for superseded memories
Filtering the source-hash idempotency lookup to status='active' means retrying or reimporting the same source after its memory was intentionally superseded no longer no-ops; if the old summary is no longer active, the method proceeds to create a fresh active Markdown page from that superseded source. Since source_hash identifies already-processed source material, this can resurrect obsolete facts during replays; the lookup should still detect existing Markdown records with the same source hash rather than only active ones.
Useful? React with 👍 / 👎.
Summary
Verification
This PR is intentionally draft pending CI and maintainer review. No personal paths, vault data, or real memory/session IDs are included.