|
|
@@ -378,51 +378,51 @@ web/
|
|
|
|
|
|
本文档第一版写「本轮只写规划,不初始化 Next.js」,但实际 web 已落地骨架与基础消费,Web V2 是在此之上「消费 CFA V2 新增事实」,不是从零搭:
|
|
|
|
|
|
-- 前端已初始化(Next.js 15 + App Router):`app/runs/page.tsx`、`app/runs/[runId]/page.tsx`,feature 页 `features/runs/RunListPage.tsx`、`RunDashboardPage.tsx`,组件 `components/pipeline/PipelineHeader.tsx`、`components/cards/*`、`components/badges/StatusBadge.tsx`,`lib/api/client.ts`、`lib/adapters/pipeline.ts`。
|
|
|
-- 后端 Web-1 API 已存在(当前为未提交 WIP):`content_agent/dashboard_service.py`(`list_runs` / `dashboard` / `queries` / `timeline` / `content_items` / `runtime_files` / `runtime_file`),`api.py` 已注册 `GET /runs`、`/runs/{id}/dashboard|queries|timeline|content-items|runtime-files|runtime-files/{filename}`,`schemas.py` 有对应 response model,CORS 已配。
|
|
|
+- 前端已初始化并提交(Next.js 15 + App Router,commit c6c5e39,2026-06-10):`app/runs/page.tsx`、`app/runs/[runId]/page.tsx`,feature 页 `features/runs/RunListPage.tsx`、`RunDashboardPage.tsx`,组件 `components/pipeline/PipelineHeader.tsx`、`components/cards/*`、`components/badges/StatusBadge.tsx`,`lib/api/client.ts`、`lib/adapters/pipeline.ts`。
|
|
|
+- 后端 Web-1 API 已提交(commit 6ee0079,2026-06-10):`content_agent/dashboard_service.py`(`list_runs` / `dashboard` / `queries` / `timeline` / `content_items` / `runtime_files` / `runtime_file`),`api.py` 已注册 `GET /runs`、`/runs/{id}/dashboard|queries|timeline|content-items|runtime-files|runtime-files/{filename}`,`schemas.py` 有对应 response model,CORS 已配。
|
|
|
- 即 Web-0…Web-5 的「骨架 + 基础消费」事实上已落地;Web V2 聚焦三块新消费。
|
|
|
-- **依赖关系**:Web V2 各项依赖 CFA V2 对应模块先落地(新增字段为增量,旧消费不破坏);CFA 未交付前,adapter 对缺字段降级为空状态,不白屏。
|
|
|
+- **依赖关系**:CFA V2 已全部交付(M3=42d0802 / M4=410cd72 / M5=7e86c9a / M6=ed13f10,2026-06-10),新增字段均为增量,旧消费不破坏;adapter 对缺字段仍降级为空状态,不白屏。
|
|
|
|
|
|
-### Web-V2-A:全流程时间线与卡点可视化(消费 CFA V2-M6)
|
|
|
+### Web-V2-A:全流程时间线与耗时/失败事实可视化(消费 CFA V2-M6,已落地)
|
|
|
|
|
|
职责:
|
|
|
|
|
|
-- 把现 `timeline` 的扁平事件流升级为「甘特 / 阶段耗时」视图。
|
|
|
-- 展示每节点 `duration_ms`、`total_duration_ms`、`stalls[]`(decode 超时 / 限流命中 / query 高失败率)。
|
|
|
-- decode 逐条进度(`decode_submitted` / `polling` / `succeeded` / `timeout` 中间事件)。
|
|
|
+- 把现 `timeline` 的扁平事件流升级为「阶段耗时 + 事件流(日志线)」视图(横条即可,不引甘特图库)。
|
|
|
+- 展示 summary 七字段:`total_duration_ms` / `stage_duration_ms` / `query_failure_count` / `platform_rate_limited_count` / `decode_status_counts` / `error_counts` / `walk_status_counts`。
|
|
|
+- decode 逐条中间事件(五类:`decode_submitted` / `decode_polling` / `decode_succeeded` / `decode_failed` / `decode_timeout`)。
|
|
|
+- `stage_failed` 事件高亮并展示 error_code / 脱敏 message——前端只呈现事实。
|
|
|
|
|
|
-依赖接口:
|
|
|
+依赖接口(CFA V2-M6 已落地,commit ed13f10):
|
|
|
|
|
|
-- `GET /runs/{run_id}/timeline`(M6 后新增 `stage` / `started_at` / `ended_at` / `duration_ms` / `attempt` / `stall_flag` / `stall_reason` / `total_duration_ms` / `stalls[]`;这些字段当前代码均不存在,由 CFA V2-M6 补,属增量)。
|
|
|
+- `GET /runs/{run_id}/timeline`:summary 七字段在响应顶层 `summary`;单条事件的耗时细节在 `items[i].record.raw_payload`(`stage` / `started_at` / `ended_at` / `duration_ms` / `attempt`)。
|
|
|
+- **M6 拍板红线:后端不产生 `stall_flag` / `stall_reason` / `stalls[]` 等"卡住"判断字段;"卡住"的业务阈值留待真实运行数据积累后由产品定义,前端不得自行发明判断。**
|
|
|
|
|
|
### Web-V2-B:配置即真相只读视图(消费 CFA V2-M1 / M3 / M4)
|
|
|
|
|
|
职责:
|
|
|
|
|
|
- 展示当前生效的规则包(Content 包 hard gates / scorecard / thresholds)与游走 `walk_rule_pack_binding`(边→包)。
|
|
|
-- 在 walk 视图按边展示 `walk_actions.rule_pack_id`(M4 后非 NULL 按边正确),让「哪条边跑了哪个包」可见;future 包(`dispatch_enabled=false`)标注为「已归属未运行」。
|
|
|
+- 在 walk 视图按边展示 `walk_actions.rule_pack_id`(M4 已落地,按边正确非 NULL),并区分「边归属包」与「实际执行包」(`raw_payload.rule_pack_execution.executed` / `executed_rule_pack_id`);future 包(`dispatch_enabled=false`)标注为「已归属未运行」。
|
|
|
|
|
|
依赖接口:
|
|
|
|
|
|
- `GET /runs/{run_id}/content-items` + `runtime-files/rule_decisions.jsonl`(已存在)。
|
|
|
-- `runtime-files/walk_actions.jsonl`(已存在;`rule_pack_id` 字段由 CFA V2-M4 补正)。
|
|
|
-- 建议后端补一个只读「当前配置」摘要接口(暴露 rule_pack / binding 概要),避免前端直接解析 JSON 源文件。
|
|
|
+- `runtime-files/walk_actions.jsonl`(已存在;`rule_pack_id` 与 `raw_payload.rule_pack_binding` / `rule_pack_execution` 已由 CFA V2-M4 落地)。
|
|
|
+- 后端只读配置接口(Web V2 实做):`GET /config/rule-packs`、`GET /config/walk-strategy`、`GET /config/query-prompts`,返回 product_documents 配置 JSON 原文 + source_file 标注;接口合同见 `02_数据与接口规划.md` 第 8 节。
|
|
|
|
|
|
-### Web-V2-C:真实 case 回放 diff 视图(消费 CFA V2-M0)
|
|
|
+### Web-V2-C:回放数据来源标注(缩范围;diff 视图推迟)
|
|
|
|
|
|
-职责:
|
|
|
+职责(本轮范围):
|
|
|
|
|
|
-- 对接 M0 语料库回放:同一 case、不同配置(config × case 矩阵)的产物对照。
|
|
|
-- 复用现有 `data_origin` badge 区分「生产事实 / 回放导出」。
|
|
|
-- 展示 snapshot diff(改一档配置后入池 / 淘汰 / `rule_pack_id` 的变化)。
|
|
|
+- 复用现有 `data_origin` badge 区分「生产事实(production_db) / 回放导出(runtime_export) / 混合(mixed_with_runtime_export)」——已实现,保持。
|
|
|
|
|
|
-依赖接口:
|
|
|
+推迟项与原因:
|
|
|
|
|
|
-- 现 `data_origin` 机制(已支持 `runtime_export` / `mixed_with_runtime_export`)。
|
|
|
-- 回放产物经 runtime export 读取,沿用 runtime file 白名单。
|
|
|
+- 「同一 case 不同配置的 snapshot diff 视图」推迟:M0 回放是 pytest 测试设施(`tests/replay_harness.py` 只写临时目录),**没有生产侧回放导出 API 或持久化产物**;做 diff 视图需先给后端补"回放产物导出 / 回放触发"配套,列入后续迭代再拍板。
|
|
|
|
|
|
### Web V2 不做
|
|
|
|
|
|
+- run 异步化与「运行中进度轮询」——POST /runs 当前同步阻塞,运行中无进度可查;本轮已拍板不做,留待后续迭代(需后端异步任务 + 轮询端点配套)。
|
|
|
- 配置可视化「编辑」(写)能力——CFA V2 傻瓜配置上限是「业务改 Excel + CI 兜底」,可视化编辑 UI 留 Web V3;Web V2 只做配置「只读展示」。
|
|
|
- 移动端适配。
|
|
|
- 前端直连 MySQL。
|