From 455a5a66ff776772361d42b47f75002cf4565322 Mon Sep 17 00:00:00 2001 From: hyungi Date: Tue, 16 Jun 2026 14:19:20 +0900 Subject: [PATCH] =?UTF-8?q?fix(classify):=20ai=5Fsuggestion=20library=20?= =?UTF-8?q?=EB=B8=94=EB=A1=9D=20is=20None=20=EA=B0=80=EB=93=9C=20=E2=80=94?= =?UTF-8?q?=20material=20=EC=A0=9C=EC=95=88=20clobber=20=EB=B0=A9=EC=A7=80?= =?UTF-8?q?=20(R9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 거래문서(LIBRARY_SUGGESTION_DOCTYPES) 제안이 doc.ai_suggestion is None 체크 없이 덮어써, material 제안 블록(material_type 제안)이 이미 점유한 ai_suggestion 을 clobber 하던 비대칭. material 블록과 동일하게 is None 가드 추가 — 주석의 '기존 제안 우선' 사상 일치. 검증: py_compile 통과. Co-Authored-By: Claude Opus 4.8 (1M context) --- app/workers/classify_worker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/workers/classify_worker.py b/app/workers/classify_worker.py index f0f0a96..8a14982 100644 --- a/app/workers/classify_worker.py +++ b/app/workers/classify_worker.py @@ -563,7 +563,9 @@ async def process( doc.facet_doctype = ai_doctype # ─── ai_suggestion 저장 (자료실 승인 대기함 제안, §1) ─── - if ai_doctype in LIBRARY_SUGGESTION_DOCTYPES: + # R9: 기존 제안(material_type 제안 등) 우선 — doc.ai_suggestion is None 가드 추가 + # (material 제안 블록과 대칭). 없으면 거래문서 제안이 기존 제안을 clobber('기존 제안 우선' 위반). + if ai_doctype in LIBRARY_SUGGESTION_DOCTYPES and doc.ai_suggestion is None: year = doc.facet_year or datetime.now(timezone.utc).year doc.ai_suggestion = { "proposed_category": "library",