[feat] solution/backend: 발행 때 온톨로지 키워드 생성을 켠다 — 호텔 판정 · 업종별 유형어 게이트
generate:false 로 불러 새 숙소가 사전 밖 단어를 받지 못했다. 생성을 켜면 호텔이 펜션 사전의 `군산 독채펜션` 을 받는데, 메타 게이트가 '펜션' 을 업종어로 보고 자료 없이 통과시켰다. - site_ontology: generate+sync — 처음 보는 숙소만 저쪽이 기다리게 하고 publish 상한 60초 - seo_keywords: 외부 분류(없으면 상호)에 '호텔' 이면 stay.hotel, 자기 유형어만 자료 없이 통과 - snapshot: place.external_category 를 실음 — 호텔 판정 근거 - .env.example · ARCHITECTURE · DEVLOG: ONTOLOGY_LLM_PROVIDER, 발행 흐름, 실측 test_seo_keywords 20 passed(호텔 4건 추가). 전체 1041 passed / 47 failed — 47건은 이 변경 전 main 과 같은 목록 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
847943a8bc
commit
94c4116689
7 files changed
+86
-20
No files matched your search
@@ -177,8 +177,8 @@ async def test_업체를_저장한_뒤_그_업체로_추천을_받는다(ontolog
|
||||
await site_ontology.match_for_merchant(merchant)
|
||||
|
||||
assert [url for url, _ in sent] == ["http://onto.test/v1/merchants/publish", "http://onto.test/v1/match"]
|
||||
# generate:false 가 빠지면 SiteOntology 가 LLM 키워드 생성을 큐에 넣는다.
|
||||
assert sent[0][1] == {**merchant, "generate": False}
|
||||
# 처음 보는 업체는 생성을 기다려 첫 발행부터 새 키워드가 실린다(sync 는 저쪽이 처음 보는 업체에만 먹인다).
|
||||
assert sent[0][1] == {**merchant, "generate": True, "sync": True}
|
||||
assert sent[1][1] == {"query": "place-1", "limit": site_ontology.DEFAULT_LIMIT}
|
||||
|
||||
|
||||
@@ -296,3 +296,32 @@ async def test_SiteOntology_가_죽어도_발행된다(auth_headers, client, db_
|
||||
assert site["site"]["status"] == SiteStatus.PUBLISHED.value
|
||||
payload = json.loads(open(r["payload_path"], encoding="utf-8").read())
|
||||
assert "seo" not in payload
|
||||
|
||||
|
||||
# ── 호텔 ───────────────────────────────────────────────────────────────────
|
||||
def test_외부_분류에_호텔이_있으면_호텔_업종으로_보낸다():
|
||||
merchant = seo_keywords.build_merchant("place-1", _snapshot(external_category="여행 > 숙박 > 호텔"))
|
||||
assert merchant["industryId"] == "stay.hotel"
|
||||
|
||||
|
||||
def test_외부_분류가_없으면_상호로_가른다():
|
||||
assert seo_keywords.build_merchant("place-1", _snapshot(name="군산 베이 호텔"))["industryId"] == "stay.hotel"
|
||||
assert seo_keywords.build_merchant("place-1", _snapshot())["industryId"] == "stay.pension"
|
||||
|
||||
|
||||
def _item(canonical):
|
||||
return {"canonical": canonical, "status": "ok", "category": "코어"}
|
||||
|
||||
|
||||
def test_호텔에는_펜션_유형어를_싣지_않는다():
|
||||
merchant = seo_keywords.build_merchant("place-1", _snapshot(name="군산 베이 호텔"))
|
||||
result = {"matches": [_item("군산 독채펜션"), _item("군산 독채 호텔"), _item("말랭이마을 숙소")]}
|
||||
|
||||
assert seo_keywords.select(result, merchant)["keywords"] == ["군산 독채 호텔", "말랭이마을 숙소"]
|
||||
|
||||
|
||||
def test_펜션에는_호텔_유형어를_싣지_않는다():
|
||||
merchant = seo_keywords.build_merchant("place-1", _snapshot())
|
||||
result = {"matches": [_item("군산 독채 호텔"), _item("군산 독채펜션")]}
|
||||
|
||||
assert seo_keywords.select(result, merchant)["keywords"] == ["군산 독채펜션"]
|
||||
Reference in new issue
Block a user