53 lines
1.7 KiB
Markdown
53 lines
1.7 KiB
Markdown
|
|
# T743 — product fit ai structured fallback
|
|||
|
|
|
|||
|
|
> Status: `done`
|
|||
|
|
> Milestone: `M4` · Phase C
|
|||
|
|
> Kind: `feat` · Est. change: `~190 lines`
|
|||
|
|
|
|||
|
|
## Goal
|
|||
|
|
|
|||
|
|
產品適配優先使用結構化 AI 判定,輸出不完整時安全回 deterministic scorer,不保存腦補證據。
|
|||
|
|
|
|||
|
|
## Depends on
|
|||
|
|
|
|||
|
|
- T741、T742
|
|||
|
|
|
|||
|
|
## Inputs
|
|||
|
|
|
|||
|
|
- `apps/backend/internal/module/radar/usecase/judge.go`、AI provider abstraction
|
|||
|
|
- `../spec.md` §3.2、§8
|
|||
|
|
|
|||
|
|
## Outputs
|
|||
|
|
|
|||
|
|
| 路徑 | 動作 | 說明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| `apps/backend/internal/module/radar/usecase/product_fit_ai.go` | add | prompt、JSON parse、evidence validation、fallback |
|
|||
|
|
| `apps/backend/internal/module/radar/usecase/judge.go` | edit | product mode 接 fit;generic 保留舊 fit |
|
|||
|
|
| AI tests | add | valid/missing dimensions/invented excerpt/provider failure |
|
|||
|
|
|
|||
|
|
## Behavior
|
|||
|
|
|
|||
|
|
- excerpt 必須可在候選文字找到;basis 必須可在 snapshot 找到。
|
|||
|
|
- AI 結果缺契約即丟棄,fallback 仍需四維完整。
|
|||
|
|
- 新 match 計 `ai_research`/`radar.product_fit`;既有 generic 計費不變。
|
|||
|
|
|
|||
|
|
## Out of scope
|
|||
|
|
|
|||
|
|
- merge 與 primary(T744)
|
|||
|
|
- 準確度樣本(T773)
|
|||
|
|
|
|||
|
|
## Acceptance
|
|||
|
|
|
|||
|
|
- [x] provider failure 不產生空 reasons,且 token 不當會員 auth。
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
cd apps/backend && go test ./internal/module/radar/usecase/... -count=1
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
Implementation result (2026-08-10): product watches now attach a structured
|
|||
|
|
four-dimension fit during judging and meter it as `ai_research`/
|
|||
|
|
`radar.product_fit`. AI output is accepted only when every positive excerpt is
|
|||
|
|
found in the candidate and every basis exists in the immutable snapshot;
|
|||
|
|
malformed, invented, or provider-failed responses fall back to T742's
|
|||
|
|
deterministic scorer, preserving complete reasons and hard exclusions.
|