thread-master/docs/product/scout-topic-quality/tasks/T045-search-quality-tests.md

57 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# T045 — 搜尋目標與關聯性回歸
> Status: `done`
> Milestone: `M4`
> Est. change: `~200 test lines`
## Goal
完成後,搜尋補量、強關聯、去重、不足原因與 score 排序都有端到端 usecase 測試。
## Depends on
- T044
## Inputs
- 讀取 / 依賴:
- 檔案:`apps/backend/internal/module/scout/usecase/testdata/topic_quality_cases.json`
- 既有能力 / APIMemoryStore、fake Provider/Crawler、RunScan pipeline
- Spec 段落§9 #1#11、§9 #17
## Outputs
### 程式變更(預期路徑)
| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/backend/internal/module/scout/usecase/search_quality_integration_test.go` | add | 覆蓋 target、shortfall、multi-source、history dedupe、time order。 |
| `apps/backend/internal/module/scout/usecase/testdata/topic_quality_cases.json` | edit | 補齊關聯性案例與標註。 |
### 行為變更
- 無新增產品邏輯;固定 M4 完成行為。
### API / 契約(若有)
- 測試確認 eligible_count 等於公開 result totalshortfall reasons 非空且可解釋。
## Out of scope
- 不以真 provider、真 Mongo 或網路作成功條件。
## Acceptance
- [x] Spec #1#11 對應案例全部通過existing provider/demand 測試不回歸。
- [x] 指令:
```bash
cd apps/backend && go test ./internal/module/scout/... -count=1
```
驗收結果:整合回歸涵蓋 fixtures、eligible-driven 補量與 320 cap、shortfall reason、historical canonical dedupe、run 原子 publish 及跨頁 score同分時間排序Scout module 全測試通過。
## Notes
品質百分比總 gate 留到 T070此 task 驗證管線語意。