Skip to content

fix: curateIndex() no longer overwrites MEMORY.md when no topics match (#1556)#1593

Open
ousamabenyounes wants to merge 1 commit intoruvnet:mainfrom
ousamabenyounes:fix/issue-1556
Open

fix: curateIndex() no longer overwrites MEMORY.md when no topics match (#1556)#1593
ousamabenyounes wants to merge 1 commit intoruvnet:mainfrom
ousamabenyounes:fix/issue-1556

Conversation

@ousamabenyounes
Copy link
Copy Markdown

Summary

Fixes #1556

  • Added early return guard in curateIndex() when sections is empty — skips writing the index instead of overwriting existing MEMORY.md with a stub header
  • Projects using Claude Code's native type_topic.md naming convention (e.g. user_role.md, project_finance.md) no longer have their hand-curated MEMORY.md destroyed on every Stop hook tick

Verification

  • Baseline tests: pre-existing failures unchanged
  • Post-fix tests: no regressions
  • New tests: 8 added, all pass (source-level verification of guard placement + mapping analysis)
  • Review agent: issue alignment verified

Files changed

File Change
v3/@claude-flow/memory/src/auto-memory-bridge.ts Added early return when Object.keys(sections).length === 0 in curateIndex()
v3/@claude-flow/memory/src/curate-index-guard.test.ts 8 new tests verifying guard exists and is correctly positioned

Generated by Claude Code
Vibe coded by ousamabenyounes

ruvnet#1556)

When no topic files matched DEFAULT_TOPIC_MAPPING (e.g. projects using
Claude Code's native type_topic.md naming), curateIndex() wrote an empty
stub header over any existing hand-curated MEMORY.md on every Stop hook
tick. Added early return guard when sections is empty.

Generated by Claude Code
Vibe coded by ousamabenyounes

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant