docs(news): url normalizer 채널별 의도적 divergence 명시 — 통합 금지 박제 (R11b)

audit 의 dup-url-normalizer-divergent 는 design intent 오탐: news._normalize_url 은 query-식별
사이트(hada.io?id=·HN item?id=) 별개 기사 붕괴 방지 위해 보수적(query 보존·sort/trailing-slash/
소문자화 안 함), file_watcher._canonicalize_url 은 web_clip dedup 위해 공격적 정규화 — 채널별
의도된 차이. 통합하면 news dedup 가 깨진다(docstring 경고). 두 함수 docstring 에 상호 cross-ref +
'통합 금지' 명시해 미래 잘못된 통합 차단. 동작 변경 0(주석만).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
hyungi
2026-06-16 14:40:56 +09:00
parent 523c509954
commit 884ea1e669
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -137,6 +137,10 @@ def _canonicalize_url(url: str) -> str:
같은 글의 utm 변형 (`?utm_source=foo`) 과 fragment 변형 (`#section`) 을
한 row 로 수렴시키기 위해 file_hash 산출 전 반드시 거친다.
★R11c: news_collector._normalize_url(news 채널)과 의도적으로 다르다 — 이쪽(web_clip)은
query-sort/trailing-slash/소문자화로 공격적 정규화하지만, news 쪽은 query-식별 사이트의
별개 기사 붕괴 방지를 위해 보수적이다. 두 함수 통합 금지(채널별 dedup 의도가 다름).
"""
if not url:
return ""
+4
View File
@@ -83,6 +83,10 @@ def _normalize_url(url: str) -> str:
query 전체 제거 금지: hada.io/topic?id= · aitimes articleView.html?idxno= ·
HN item?id= 등 query-식별 사이트에서 별개 기사가 같은 URL 로 붕괴된다.
저장(edit_url)·조회 양쪽이 이 함수를 공유해야 dedup 이 성립.
★R11c: file_watcher._canonicalize_url(web_clip 채널)과 의도적으로 다르다 — 이쪽은 콘텐츠
식별 query 보존(별개 기사 붕괴 방지)이 핵심이라 query-sort/trailing-slash/소문자화를 안 한다.
두 함수 통합 금지(news dedup 가 깨짐). 채널별 normalization 은 의도된 설계.
"""
parsed = urlparse(url)
kept = [