feat(lps): 오픈마켓 폴백 오케스트레이션 + 몰 dedup
사용자 규칙 '네이버로 그 몰 값 확보 성공→그 값, 실패(몰 없음)→실사이트 크롤' 구현. - handler: found 라운드 뒤 _enrich_with_fallback — 네이버 매칭이 커버 못 한 타깃 몰만 (canonical_mall 로 판정) 크롤 어댑터로 검색→같은상품 판정→병합. 크롤 실패는 격리(무시). fallback_crawl STAGE 기록. - summarize_by_mall: 키를 (source,mall)→몰명(canonical)으로 — 네이버노출 vs 직접크롤 같은 몰 중복을 최저가 1건으로 병합(dedup). - card_parser: MALL_BY_SOURCE + canonical_mall() 추가. - worker_main: gmarket/auction/st11 폴백 어댑터 등록(lazy 기동, 리소스차단 OFF). - 테스트: 커버몰 크롤생략·미커버 크롤·실패격리·몰 dedup 4종. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e365e5c6e0
commit
f9714c3f06
5 files changed
+108
-11
No files matched your search
@@ -12,6 +12,14 @@ from selectolax.parser import HTMLParser
|
||||
from services.search.contract import NormalizedProduct
|
||||
from services.search.util import extract_price, clean_name, shipping_from_text
|
||||
|
||||
# 소스 코드 → 표시 몰명(canonical). 폴백 커버리지 판정·dedup 에 쓴다.
|
||||
MALL_BY_SOURCE = {"naver": "네이버", "coupang": "쿠팡", "gmarket": "G마켓", "auction": "옥션", "st11": "11번가"}
|
||||
|
||||
|
||||
def canonical_mall(product) -> str:
|
||||
"""상품의 판매몰 정체성(몰명 우선, 없으면 소스 매핑)."""
|
||||
return product.mall_name or MALL_BY_SOURCE.get(product.source, product.source)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class CardConfig:
|
||||
|
||||
Reference in new issue
Block a user