* fix(dedup): reinforce times_derived on duplicate detection times_derived was never incremented: the reject-new branch dropped the reinforcement and the new-wins branch reset the count to 1, so the column stayed pinned at 1 for nearly every conclusion. With every value equal, ORDER BY times_derived DESC resolved to arbitrary heap order (oldest rows first), which froze stale conclusions to the front of injected context. - reject-new: increment existing_doc.times_derived - new-wins: carry existing count forward onto the replacement - add created_at DESC tiebreaker to both most_derived queries * test(dedup): guard times_derived reinforcement + recency tiebreak Three regression tests, each fails on pre-fix code: - most-derived ties break toward recency, not insertion order - rejecting a duplicate reinforces the surviving doc - a winning duplicate inherits the replaced doc's count + 1 * fix(dedup): atomic reinforcement increment + deterministic tiebreak --------- Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| test_document.py | ||
| test_peer_card.py | ||
| test_representation_manager.py | ||
| test_session.py | ||
| test_workspace.py | ||