Skip to content

feat: improve cross-session memory quality - #12

Merged
AIPMAndy merged 1 commit into
mainfrom
codex/v3-1-memory-quality
Jul 22, 2026
Merged

feat: improve cross-session memory quality#12
AIPMAndy merged 1 commit into
mainfrom
codex/v3-1-memory-quality

Conversation

@AIPMAndy

@AIPMAndy AIPMAndy commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Deduplicate active memories by exact normalized summary within the same type.
  • Merge duplicate provenance and expose the deduplicated daily maintenance metric.
  • Filter operational handoff, planning narration, and unsubstantive publication status from native extraction.
  • Document the v3.1 quality behavior in Chinese and English.

Verification

  • python3 -m pytest -q: 167 passed
  • python3 -m compileall -q dna.py dna scripts tests: passed
  • python3 scripts/check_public_safety.py: passed
  • git diff --check: passed

This PR is intentionally draft pending CI and maintainer review. No personal paths, vault data, or real memory/session IDs are included.

@AIPMAndy
AIPMAndy marked this pull request as ready for review July 22, 2026 05:38
@AIPMAndy
AIPMAndy merged commit 68ac30d into main Jul 22, 2026
2 checks passed
@AIPMAndy
AIPMAndy deleted the codex/v3-1-memory-quality branch July 22, 2026 05:38

@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: 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".

Comment thread scripts/memory_service.py
Comment on lines +54 to +55
duplicate = self._find_active_duplicate(mem_type, normalized_summary)
if duplicate:

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

Comment thread scripts/memory_service.py
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'",

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

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.

1 participant