Skip to content

Dedupe conflict document pairs - #17

Merged
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
mmaxjr:fix/dedupe-conflict-pairs
Aug 7, 2026
Merged

Dedupe conflict document pairs#17
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
mmaxjr:fix/dedupe-conflict-pairs

Conversation

@mmaxjr

@mmaxjr mmaxjr commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Closes #3

Summary

  • dedupe conflicts by unordered document pair inside detect_conflicts
  • cover duplicate chunks from two official documents with a regression test
  • apply the same pair guard before official/informal conflict output

Verification

  • python -m pytest tests/test_conflicts.py::test_duplicate_chunks_from_two_documents_report_one_conflict_pair -q
  • python -m pytest tests/test_conflicts.py::test_two_official_documents_answering_the_same_question_is_flagged tests/test_conflicts.py::test_a_conflict_names_the_owners_so_a_human_can_resolve_it tests/test_conflicts.py::test_official_versus_informal_is_flagged_with_a_preference tests/test_conflicts.py::test_chunks_from_one_document_are_not_a_conflict_with_themselves tests/test_conflicts.py::test_duplicate_chunks_from_two_documents_report_one_conflict_pair tests/test_conflicts.py::test_a_single_source_of_truth_produces_no_conflict tests/test_conflicts.py::test_two_informal_documents_are_not_flagged_as_a_policy_conflict -q
  • python -m py_compile vaultrag\conflicts.py tests\test_conflicts.py

Note: running the broader tests/test_conflicts.py -q -k conflict command on Windows also collected async Postgres tests and failed before execution with psycopg's ProactorEventLoop guard; the pure conflict tests above passed.

@royalpinto007
royalpinto007 merged commit 6ef67fc into AgentPostmortem:main Aug 7, 2026
@royalpinto007

Copy link
Copy Markdown
Collaborator

Merged, thanks @mmaxjr. Using a frozenset for the pair key handles the unordered case cleanly, and applying the same guard to the official/informal loop is the part that would have been easy to miss. Verified locally: the conflicts suite passes, including the new duplicate-chunks case.

If the project is useful to you, a star helps more people find it.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Nice work @mmaxjr, this is merged.

Genuinely helpful change for VaultRAG.

If this project helps you out, a star helps others find it too.

Happy to see more from you whenever you have the time.

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.

detect_conflicts reports the same document pair once per chunk pair, so one disagreement prints four times

2 participants