From c8d769f95c1674bd3acd03737772574e8a8aa81a Mon Sep 17 00:00:00 2001 From: safishamsi Date: Mon, 12 Oct 2026 12:29:39 +0100 Subject: [PATCH] test(dedup): stamp _origin on the shrink-guard fixture (post-#3110) #3110 makes the semantic tier carry _origin:"semantic" explicitly, so a real graph.json's semantic nodes are no longer tier-guessed from the L-shape of source_location. This fixture wrote a baseline graph with no _origin, which backfilled to AST and mixed with the re-extracted (now semantic) nodes, so the pair no longer merged and the shrink guard had nothing to catch. Stamp the fixture nodes semantic to reflect what real post-#3110 graphs contain; the guard correctly fires again. Co-Authored-By: Claude Opus 4.8 --- tests/test_dedup_shrink_refuses_force_write.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_dedup_shrink_refuses_force_write.py b/tests/test_dedup_shrink_refuses_force_write.py index b2baba723..c20dbd2b6 100644 --- a/tests/test_dedup_shrink_refuses_force_write.py +++ b/tests/test_dedup_shrink_refuses_force_write.py @@ -23,6 +23,7 @@ def _notes(corpus): "file_type": "document", "source_file": readme, "source_location": "L1", + "_origin": "semantic", }, { "id": "readme_decisions_b", @@ -30,6 +31,7 @@ def _notes(corpus): "file_type": "document", "source_file": readme, "source_location": "L2", + "_origin": "semantic", }, { "id": "readme_overview", @@ -37,6 +39,7 @@ def _notes(corpus): "file_type": "document", "source_file": readme, "source_location": "L3", + "_origin": "semantic", }, ] @@ -144,6 +147,7 @@ def test_a_deleted_file_still_writes(monkeypatch, tmp_path): "file_type": "document", "source_file": readme, "source_location": "L1", + "_origin": "semantic", }, { "id": "gone_notes", @@ -151,6 +155,7 @@ def test_a_deleted_file_still_writes(monkeypatch, tmp_path): "file_type": "document", "source_file": gone, "source_location": "L1", + "_origin": "semantic", }, ] fresh = [nodes[0]]