From 7d15c1bb26f9740ecd072ec8515b9e9e13c11339 Mon Sep 17 00:00:00 2001 From: ayushcodes10 Date: Mon, 14 Sep 2026 22:41:57 +0530 Subject: [PATCH] Add regression test for defines_id on a non Latin path Confirms the layer above _id_prefixes actually benefits from the fix: a node whose id and source_file both encode a Korean path is recognized as defining that id, and a node sharing that id from a different file is correctly recognized as merely referencing it. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_017qfdzgbA5KedGEjD1AayNh --- tests/test_dedup.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_dedup.py b/tests/test_dedup.py index 9b14f68b6..6abcd09fc 100644 --- a/tests/test_dedup.py +++ b/tests/test_dedup.py @@ -540,6 +540,23 @@ def test_id_prefixes_preserves_non_latin_segments(): assert "작업_단위_폴더_readme_진입점_컨벤션" in prefixes +_KOREAN_DEFINING = { + "id": "concepts_작업_단위_폴더_readme_진입점_컨벤션", + "label": "README 진입점 컨벤션", "file_type": "concept", + "source_file": "concepts/작업 단위 폴더 + README 진입점 컨벤션.md", +} +_KOREAN_REFERENCING = { + "id": "concepts_작업_단위_폴더_readme_진입점_컨벤션", + "label": "README 진입점 컨벤션", "file_type": "concept", + "source_file": "concepts/LLM Schema - CLAUDE.md를 가이드로 활용하기.md", +} + + +def test_defines_id_recognizes_a_non_latin_path(): + assert _defines_id(_KOREAN_DEFINING) + assert not _defines_id(_KOREAN_REFERENCING) + + def test_same_file_relabel_is_noted(capsys): """Two labels for one ID from one file: the loser's label is discarded, which is the one drop that used to be silent. It is a note, not a collision warning."""