Skip to content

fix: deduplicate embedded Tags footer in compaction restore - #249

Open
phil-lipp wants to merge 1 commit into
tickernelz:mainfrom
phil-lipp:fix/tags-dedup
Open

fix: deduplicate embedded Tags footer in compaction restore#249
phil-lipp wants to merge 1 commit into
tickernelz:mainfrom
phil-lipp:fix/tags-dedup

Conversation

@phil-lipp

Copy link
Copy Markdown

Auto-capture embeds a "Tags: ..." footer inside the memory body (added in #131); compaction restore appends its own canonical Tags line, duplicating the tags in the restored context. Strip the embedded footer when a canonical line follows.

Regression from #131.

Auto-capture embeds a "Tags: ..." footer inside the memory body (added
in tickernelz#131); compaction restore appends its own canonical Tags line,
duplicating the tags in the restored context. Strip the embedded footer
when a canonical line follows.

Regression from tickernelz#131.

@lindixu6-hash lindixu6-hash left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The duplication fix is valid for auto-captured records, and the submitted tests are failure-sensitive, but the current regex removes any trailing Tags: line whenever structured tags exist, even when the footer is user-authored and does not match those tags.

For example, a memory ending in Tags: user-authored evidence with structured tags ["canonical"] is rendered without that original line and only Tags: canonical remains. Manual/API/imported memories can store arbitrary content plus structured tags, so this is observable content loss.

Please strip the footer only when its normalized value matches the canonical structured tags (or when another reliable auto-capture provenance condition proves it is the generated footer), and add a regression showing a non-matching trailing Tags: line is preserved.

Local verification at 9ad5b8e with an isolated HOME:

  • frozen root and web installs
  • compaction target: 10/10 passed
  • full suite after build: 409/409 passed
  • typecheck, Prettier check, and production build passed
  • mutation check: reverting only the implementation while retaining the tests produced the expected duplicate-footer failure

So the existing duplication regression is covered; the remaining blocker is preserving unrelated user content.

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.

3 participants