thread-master/docs/product/scout-topic-quality/tasks/T060-live-scout-run-repo.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.

# T060 — Live Run repository mapping
> Status: `done`
> Milestone: `M6`
> Est. change: `~170 lines`
## Goal
完成後,前端 live ScoutRepo 能正確呼叫 run APIs、映射 pagination/counters/times 並保留舊 listPosts。
## Depends on
- T020、T034、T052
## Inputs
- 讀取 / 依賴:
- 檔案:`apps/web/src/data/live/m5Repos.ts`、`apps/web/src/data/repos.ts`
- 既有能力 / APIapiRequest、mapScoutPost、query helpers
- Spec 段落§5.1、§5.2
## Outputs
### 程式變更(預期路徑)
| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/web/src/data/live/m5Repos.ts` | edit | mapScoutRun實作 listRuns/listRunPosts/removeRunscan 映射 run。 |
| `apps/web/src/data/live/m5Repos.test.ts` | add/edit | 驗證 URL/query/envelope、unknown time、shortfall 與 error propagation。 |
### 行為變更
- live list 呼叫只取得目前頁HTTP 錯誤不轉成成功空 page。
### API / 契約(若有)
- page/pageSize 使用 camelCasepath run ID encode時間原樣映射供顯示。
## Out of scope
- 不重寫 apiRequest、不移除 listPosts。
## Acceptance
- [x] request/response mapping 與 mock ScoutRepo contract tests 等價。
- [x] 指令:
```bash
cd apps/web && npm test -- src/data/live/m5Repos.test.ts
```
驗收結果live ScoutRepo 已實作 runsrun posts 分頁、filter、encoded run path、Run countersshortfall時間映射與刪除HTTP error 直接拋出,舊 listPosts 保留。Live mapping tests 與 web build 通過。
## Notes
前端不得使用 Number 排序 unix ns順序完全採 server list。