o2o-infinith-demo/supabase/functions
Haewon Kam bcc0b6ea5e fix: pipeline P0/P1 — rating bug, retry, health score, blog scrape
## P0 버그 수정 (즉시 영향)

### fix(collect-channel-data): 강남언니 rating 오변환 제거
- 기존: `rating ≤ 5 → ×2` 로직으로 4.8/10을 9.6/10으로 잘못 변환
- Firecrawl 프롬프트가 이미 0-10 반환 지시 → rawValue 직접 신뢰

### fix(generate-report): Perplexity 단일 fetch → fetchWithRetry
- maxRetries:2, backoffMs:[5000,15000], timeoutMs:90s 설정
- 기존: 일시적 429/타임아웃 시 리포트 생성 전체 실패

## P1 기능 추가 (데이터 품질)

### feat(collect-channel-data): channel_snapshots health_score 계산
- `computeHealthScore(channel, data)` 함수 추가 (채널별 0-100 스코어)
- Instagram: followers 기반 선형 보간 + posts bonus
- YouTube: subscribers 기반 + video count bonus
- 강남언니: rating×7 + reviews bonus (max 30pt)
- Google Maps: rating×12 + reviews bonus (max 40pt)
- Naver Blog: presence (50pt) + 언급 수 bonus (max 30pt)
- 모든 channel_snapshots INSERT에 health_score 포함

### feat(collect-channel-data): 네이버 블로그 공식 컨텐츠 스크랩 추가
- 기존: Naver Search API로 3rd-party 언급만 수집
- 추가: Registry에서 확인된 공식 블로그 URL을 Firecrawl로 직접 스크랩
  - 총 게시글 수, 최근 게시물 (제목/날짜/요약), 카테고리 추출
  - 실패 시 non-critical — 기존 Naver Search 결과는 항상 유지

## docs: PIPELINE_IMPROVEMENT_PLAN 감사 결과 반영
- Sprint 0 (Vision), Sprint 1, Sprint 2 완료 표시
- WP-10, WP-11 완료 표시
- 2026-04-07 전수 감사 섹션 추가 (구현 완료/수정/남은 Gap 표)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 09:35:20 +09:00
..
_shared feat: clinic registry DB + pipeline audit P0 fixes 2026-04-07 09:33:25 +09:00
adjust-strategy feat: clinic registry DB + pipeline audit P0 fixes 2026-04-07 09:33:25 +09:00
analyze-market feat: Sprint 1 — 7 data quality quick wins 2026-04-04 23:35:40 +09:00
collect-channel-data fix: pipeline P0/P1 — rating bug, retry, health score, blog scrape 2026-04-07 09:35:20 +09:00
discover-channels feat: clinic registry DB + pipeline audit P0 fixes 2026-04-07 09:33:25 +09:00
enrich-channels feat: add API Dashboard + filled icons + pipeline improvements 2026-04-06 14:59:31 +09:00
generate-content-plan feat: clinic registry DB + pipeline audit P0 fixes 2026-04-07 09:33:25 +09:00
generate-report feat: clinic registry DB + pipeline audit P0 fixes 2026-04-07 09:33:25 +09:00
scrape-website feat: prototype gap closure — enrichment diagnosis + brand extraction + plan assets 2026-04-03 17:09:15 +09:00