Skip to content

Add corpus index text dedupe command - #46

Merged
telivity-otaip merged 2 commits into
mainfrom
feature/corpus-dedupe
Jul 30, 2026
Merged

Add corpus index text dedupe command#46
telivity-otaip merged 2 commits into
mainfrom
feature/corpus-dedupe

Conversation

@telivity-otaip

Copy link
Copy Markdown
Contributor

Summary

  • Piece ids include the source path, so re-ingesting the same post from a second export path lands it twice and append_index's id check cannot see it. dedupe-index groups pieces by normalized text (plus near-identical captures differing only in trailing link/hashtag noise), picks one deterministic keeper per group, and refuses to drop holdout ids.
  • Report-only by default. --apply backs up the index before rewriting it and prints the index-voice / select / build-style-profile rebuild those counts depend on.
  • README CLI table documents the command.

Local run (not in repo)

24 duplicate-text groups / 44 pieces removed; corpus index 1647 → 1603; voice index 1600; style draft_word_target 419. No personal text, index backups, or corpus data included here.

Test plan

  • pytest -q — 280 passed
  • ruff check . — clean
  • Contoso-only fixtures in tests/test_corpus_dedupe.py: exact + near duplicates, holdout keeper protection, cross-source keeper priority, report-only vs --apply backup

Made with Cursor

telivity-otaip and others added 2 commits July 30, 2026 13:25
Piece ids include the source path, so re-ingesting a post from a second
export path lands it twice and append_index's id check cannot see it.
dedupe-index groups pieces by normalized text (plus near-identical
captures that differ only in trailing link/hashtag noise), keeps one
deterministic keeper per group, and refuses to drop holdout ids.

Report-only by default; --apply backs up the index before rewriting it
and prints the index-voice / select / build-style-profile rebuild those
counts depend on.

Local run: 24 groups / 44 pieces removed, corpus 1647 -> 1603.

Co-authored-by: Cursor <cursoragent@cursor.com>
@telivity-otaip
telivity-otaip merged commit 2740454 into main Jul 30, 2026
5 checks passed
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