From 9d433fc1ab337692f1122585da5f0ac6429af4f2 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 18 May 2026 15:13:48 -0400 Subject: [PATCH] fix(test): sidecar idempotency needs phash_threshold=0 (orthogonal splits collapse at default) Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/test_sidecar_import.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_sidecar_import.py b/tests/test_sidecar_import.py index 817705b..f9ebabc 100644 --- a/tests/test_sidecar_import.py +++ b/tests/test_sidecar_import.py @@ -92,13 +92,17 @@ def test_sidecar_creates_provenance(importer, import_layout): def test_reimport_same_post_idempotent(importer, import_layout): import_root, _ = import_layout + # Threshold 0: only an exact phash match collapses. Orthogonal splits + # still sit within the default Hamming-10 at 64-bit, so without this + # the 2nd image would be skipped as a near-dup (phash dedup working). + importer.settings.phash_threshold = 0 payload = {"category": "patreon", "id": 777, "title": "P"} m1 = import_root / "Bob" / "p1.jpg" _split(m1, "v") _sidecar(m1, payload) importer.import_one(m1) m2 = import_root / "Bob" / "p2.jpg" - _split(m2, "h") # structurally distinct → not a phash dup + _split(m2, "h") # distinct phash; threshold 0 → both import _sidecar(m2, payload) r2 = importer.import_one(m2) assert r2.status == "imported"