fix(memory): skip placeholder short-term promotions#95598
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 13, 2026, 3:04 AM ET / 07:04 UTC. Summary PR surface: Source +274, Tests +333. Total +607 across 4 files. Reproducibility: yes. at high source confidence: the linked issue, current promotion path, and refreshed red-green filesystem transcript provide a concrete recent-main path where a placeholder candidate reaches MEMORY.md. The reviewer did not independently execute the harness against SHA d614920. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Keep one canonical promotability resolver across every promotion boundary, preserve meaningful multilingual content, and merge only after a memory-core or SDK owner accepts the exported reason contract and exact-head upgrade coverage confirms that only structural candidates are removed. Do we have a high-confidence way to reproduce the issue? Yes at high source confidence: the linked issue, current promotion path, and refreshed red-green filesystem transcript provide a concrete recent-main path where a placeholder candidate reaches MEMORY.md. The reviewer did not independently execute the harness against SHA d614920. Is this the best way to solve the issue? Yes, with one compatibility qualification. A single resolver enforced at all state-entry and apply boundaries is the maintainable root fix; the exported diagnostic reason should remain only with explicit SDK-owner acceptance. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d614920c3ed5. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +274, Tests +333. Total +607 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (3 earlier review cycles) |
aa5ff16 to
f8fc15a
Compare
857ed12 to
5952040
Compare
|
@clawsweeper re-review The stale proof blocker has been addressed on head Evidence added to the PR body:
The spaced fence info-string gap from the previous review is fixed and covered by focused reject/preserve tests. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
5952040 to
2b60198
Compare
2b60198 to
144693f
Compare
|
@clawsweeper re-review — rebuilt on current main with red-green proof in the body (fails on main, passes on this branch). |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review — added a real filesystem MEMORY.md promotion transcript (before/after on main vs this branch): main writes the placeholder skeleton into long-term memory, this branch keeps only the real note. |
What Problem This Solves
Closes #80582.
Short-term memory promotion could treat markdown and QMD scaffolding as durable content. That included empty list/checklist/fence/table fragments, placeholder daily-note headings, generic daily/dreaming headings, QMD hunk wrappers, collapsed persisted heading prefixes, and mixed snippets that carried structural text alongside real content.
Why This Change Was Made
The fix centralizes short-term snippet promotability in the promotion resolver and applies that resolver across recall recording, store normalization, grounded candidates, ranking, relocation/rehydration, and direct promotion application.
Placeholder-only snippets are skipped. Mixed snippets keep real content while dropping structural wrappers such as QMD hunk headers, generic daily/dreaming headings, collapsed heading prefixes, and bullet-prefixed collapsed heading prefixes. Ordinary non-generic bullets remain intact.
The diagnostic skipped recall event now has an additive
unpromotable-short-term-snippetreason, with the Plugin SDK API baseline hash regenerated for the exported event type change.User Impact
Memory promotion should carry actual remembered content instead of daily-note scaffolding or QMD placeholder text. Existing meaningful snippets still promote, and legacy event readers continue to read recorded recall events while diagnostic readers can see skipped recall records.
Evidence
Real-behavior proof — actual
MEMORY.mdwritten to diskThis drives the real promotion pipeline end-to-end against a temp workspace —
rankShortTermPromotionCandidates->applyShortTermPromotions— with real note files on disk and the real SQLite recall store. No mocks; the only inputs are seeded recalls (one markdown placeholder skeleton## Tagesnotizen\n-, one meaningful note), both crossing promotion thresholds. The transcript below is theMEMORY.mdthe production code wrote.Before —
origin/main@e43bd3d57bc(applied: 2— the placeholder is promoted into long-term memory):After — this branch @
144693f8816(applied: 1— the placeholder is excluded, the real note is kept):The harness is a vitest spec asserting the real file contains
Keep gateway restarts supervised.and does not containTagesnotizen; it passes on this branch and fails on main (AssertionError: expected '# Long-Term Memory…' not to contain 'Tagesnotizen').Reproduce (drop into
extensions/memory-core/src/andpnpm testit on either checkout)Source-level red-green
CI=true pnpm test extensions/memory-core/src/short-term-promotion.test.ts— 99 pass on branch; copying that same test file ontoorigin/mainfails 3 (… to have a length of 1 but got 2), because main records the placeholder skeletons this branch filters.pnpm tsgo:core,pnpm tsgo:extensions, and the plugin-sdk surface budgets are clean.