# Tasks INDEX — opportunity-inbox

> Plan：`../plan.md`（approved 2026-08-11）  
> Spec：`../spec.md`（approved 2026-08-11）  
> Status：`in-progress`（Phase A–C 與 M7 驗收資產已完成；live rollout 文件同步中）
> Updated：2026-08-11

## 硬規則

| 規則 | 內容 |
|------|------|
| 交付順序 | M0 Phase A → M1/M2 Phase B frontend＋mock → **UX 批准** → M3–M6 Phase C live → M7 Phase D 品質與回歸 |
| 後端 | 只改 `apps/backend/generate/api/*.api` 後跑 `make gen-api`；業務只寫 `internal/logic/**`、`internal/module/**` |
| 舊系統 | `old/` 只讀；所有交付只在 `apps/` 與本產品文件 |
| 狀態 | ReviewState 與 OpportunityStatus 分離；accepted 仍是 CRM，completed 只是工作完成 |
| 去重 | owner＋source identity 一筆 Opportunity；同來源 tombstone 不新建、不重判 |
| 扣點 | review／列表／前處理免費；provider 成功才依既有 meter 計點；有效判定唯一鍵防重扣 |
| 時間／列表 | UTC unix ns；`page/pageSize` → `pagination/list`；排序由 server side 穩定執行 |
| Token | 會員 JWT 與 AI provider token 分離；BYOK 平台 credits=0 但保留 count/source |
| Task 大小 | 每題約 100–200 行 production change；跨 milestone 能力需拆開 |

## INDEX

| ID | Title | Phase / M | Kind | Status | Est. |
|----|-------|-----------|------|--------|------|
| T800 | radar inbox contract goctl | A / M0 | feat | done | ~180 |
| T801 | frontend inbox domain repository seam | A / M0 | feat | done | ~160 |
| T802 | legacy mapping and contract guards | A / M0 | test | done | ~160 |
| T810 | single opportunity inbox shell | B / M1 | feat | done | ~180 |
| T811 | mock review state repository | B / M1 | feat | done | ~180 |
| T812 | inbox card detail and actions | B / M1 | feat | done | ~190 |
| T813 | inbox filters sorting url empty tests | B / M1 | test | done | ~180 |
| T820 | demand map mock editor | B / M2 | feat | done | ~190 |
| T821 | query plan preview mock | B / M2 | feat | done | ~150 |
| T822 | cost preview and credit confirmation mock | B / M2 | feat | done | ~170 |
| T823 | sweep funnel mock and ux gate tests | B / M2 | test | done | ~180 |
| T830 | review state domain and mapping | C / M3 | feat | done | ~180 |
| T831 | memory review audit tombstone | C / M3 | feat | done | ~190 |
| T832 | mongo review fields migration indexes | C / M3 | feat | done | ~180 |
| T833 | review state api list and compatibility | C / M3 | feat | done | ~190 |
| T840 | demand map domain repository | C / M4 | feat | done | ~190 |
| T841 | baseline version and query planner | C / M4 | feat | done | ~180 |
| T842 | cost preview quota gate | C / M4 | feat | done | ~190 |
| T843 | demand map enrichment metering byok | C / M4 | feat | done | ~190 |
| T850 | candidate normalization prefilter | C / M5 | feat | done | ~190 |
| T851 | evidence extraction priority scorer | C / M5 | feat | done | ~190 |
| T852 | judge structured result cache | C / M5 | feat | done | ~200 |
| T853 | idempotent judgment metering fixtures | C / M5 | test | done | ~180 |
| T860 | sweep pipeline demand map prefilter | C / M6 | feat | done | ~200 |
| T861 | sweep checkpoint resume budget | C / M6 | feat | done | ~190 |
| T862 | sweep funnel counters and api | C / M6 | feat | done | ~180 |
| T863 | live repository inbox integration | C / M6 | feat | done | ~190 |
| T870 | opportunity inbox accuracy dataset | D / M7 | test | done | ~160 |
| T871 | precision and cost evaluation gate | D / M7 | test | done | ~170 |
| T872 | race retry and duplicate charge regression | D / M7 | test | done | ~190 |
| T873 | compatibility rollout and gaps docs | D / M7 | docs | done | ~140 |

## 建議執行順序

```text
T800 → T801 → T802
  → T810 → T811 → T812 → T813
  → T820 → T821 → T822 → T823
  ──【Phase B UX 批准】
  → T830 → T831 → T832 → T833
  → T840 → T841 → T842 → T843
  → T850 → T851 → T852 → T853
  → T860 → T861 → T862 → T863
  ──【P0 live 驗收】
  → T870 → T871 → T872 → T873
```

## 可並行組合

| 組合 | 收斂點 |
|------|--------|
| T800 ‖ T801 | T802 |
| T810 ‖ T811 | T812／T813 |
| T820 ‖ T821 | T822／T823 |
| T830 ‖ T831 | T832 |
| T840 ‖ T841 | T842 |
| T850 ‖ T851 | T852／T853 |
| T860 ‖ T861 | T862／T863 |
| T870 ‖ T871 | T872／T873 |

## Spec 驗收覆蓋

| Spec 場景 | 主要 tasks |
|-----------|------------|
| #1–#5 收件匣、完成、移除、復原、CRM 同步 | T810–T813、T830–T833、T863 |
| #6–#7 DemandMap、QueryPlan、incomplete | T820–T821、T840–T841、T860 |
| #8–#12 前處理、證據、排序、未知時間 | T850–T851、T863、T870–T871 |
| #13–#15 CostPreview、0 hit、前處理排除 | T822、T842、T860–T862 |
| #16–#20 計點、失敗退點、續跑、ceiling、BYOK | T822、T843、T852–T853、T861–T862、T872 |
| #21–#22 版本與重判 | T841–T843、T852、T872 |
| #23–#24 accuracy 與 today redirect | T813、T863、T870–T873 |

## 閘門

- [x] Task breakdown 已批准：使用者已要求「全部執行」（2026-08-11）。
- README phase=`in-progress`。
- M1–M2 完成後必須先取得 Phase B UX 批准，才可開始 M3。
- M6 完成後必須通過 P0 live 驗收，才可開始 M7。
- `brand-product-radar` T773–T775 與 T870–T873 重疊的 accuracy／race／回歸輸出只實作一次，完成時在兩份 INDEX 交叉引用。
- 實作時使用者需指定單一 T### 或明確要求一批；不可把未批准的 neighbor task 順手帶入。
