阶段G收尾: 链路透视补任务包全量呈现+§11全矩阵验收走查(五类可见项全可见,验收记录留档)

This commit is contained in:
zizi 2026-08-23 17:53:20 +08:00
parent 9720e57af7
commit 22b4e31012
3 changed files with 67 additions and 1 deletions

View File

@ -2632,6 +2632,34 @@ def _dispatch_chain_html(run_id, trigger_detail):
return "".join(parts)
def _run_task_packs_html(run_id: str) -> str:
"""链路透视 · 任务包与运行工件:artifacts 目录中与本运行同名的全部留档(只读)。"""
if not WRITE_CHAPTER_ARTIFACTS.is_dir():
return ""
files = sorted(p for p in WRITE_CHAPTER_ARTIFACTS.glob(f"{run_id}-*.json") if p.is_file())
details = []
for path in files[:30]:
try:
text = path.read_text(encoding="utf-8")
except OSError:
continue
try:
pretty = json.dumps(json.loads(text), ensure_ascii=False, indent=1)
except (ValueError, TypeError):
pretty = text
if len(pretty) > 20000:
pretty = pretty[:20000] + "\n…(超长截断)"
details.append(
f"<details><summary>{esc(path.name)} · {len(text)} 字</summary>"
f"<pre class='data-block'><code>{esc(pretty)}</code></pre></details>"
)
if not details:
return ""
return ("<div class='card run-evidence'><div class='hd'>任务包与运行工件(artifacts 目录)</div>"
+ "".join(details) + "</div>")
def view_run_detail(run_id):
_, rr = q(
"""SELECT r.run_id,r.work_id,r.target_chapter,r.trigger_source,r.started_at,r.finished_at,r.terminal_state,
@ -2845,10 +2873,11 @@ def view_run_detail(run_id):
turn_html = _run_turn_panels_html(rid, candidates, state)
events_html = _agent_events_html(rid)
chain_html = _dispatch_chain_html(rid, trigger_detail)
packs_html = _run_task_packs_html(rid)
body = (f"<div class='crumb'><a href='/runs'>运行记录</a> / <code>{esc(rid)}</code></div>"
f"<h1>运行详情</h1>{info}{error_html}{turn_html}"
f"<h2>回执链</h2>{rc_html}<h2>质量评判</h2>{q_html}<h2>模型调用</h2>{call_html}"
f"<h2>链路透视</h2>{chain_html}{events_html}"
f"<h2>链路透视</h2>{chain_html}{events_html}{packs_html}"
f"<h2>候选与决策</h2>{cand}{dec}<h2>证据与上下文</h2>{raw_html}{raw_detail_html}{freeze_html}")
return layout("运行详情", body, "/runs")

View File

@ -0,0 +1,36 @@
# §11 可见性对照验收:书 12(深渊机神)基线走查
日期:2026-08-23
走查对象:只读看板 `http://127.0.0.1:8765` + muse-example 数据库
走查依据:`docs/plans/2026-08-22-agent-example整体收敛总plan.md` §11 可见性对照矩阵
## 矩阵逐项结论
| 内容 | 可见性 | 证据 | 备注 |
|---|---|---|---|
| 作品、章节、正式正文 | ✅ 可见 | `/works` 列「深渊机神」;`/works/12/ch/3` 呈现第 3 章「波纹」全文(5131 字,候选 164 采纳产物) | 正文表合同不变 |
| 候选与待审状态 | ✅ 可见 | `/candidates` 待审队列(118/121/122 待确认);`/candidates/164` 直链呈现正文、运行链接、语义审查发现、本次生成摘要 | 待审队列只显示待确认候选;已采纳/被拒候选经直链与运行页可达 |
| 运行回执、质量结果、模型调用账 | ✅ 可见 | `/runs/run-prod-work12-ch3-42beb650` 回执链 / 质量评判 / 模型调用三区块完整 | 三表继续写入 |
| 知识卡(草稿/转正) | ✅ 可见 | `/knowledge?work_id=12` 呈现卡片行;第 3 章 18 条草稿经人审(署名 qingse)转正为实体卡 40–57 | — |
| 探索轨迹与事件链(example_agent_event) | ✅ 可见(新增可见项) | `/runs/…-42beb650-writer-v9` 链路透视:探索轨迹工具事件(read_chapter_text×8、read_fine_outline×4 等)+ 参数明细 + 模型回合(令牌/成本);派发链父子导航双向可达 | 书 12 时代无事件账本,无基线可比;阶段 G 第一部分接线 |
| 依赖清单(本次运行实际读了什么) | ✅ 可见(新增可见项) | 工具事件明细(工具名 + 参数)即依赖清单数据源;探索运行另有探索清单工件(`…-exploration-summary-v9.json`) | 同上 |
| 生产 artifacts(任务包等) | ✅ 可见 | `/runs/…-42beb650` 任务包与运行工件区块:探索任务包、探索清单、探索摘要、生成任务包、writer-context、pipeline-result 全量可展 | 读侧迁移:看板直接渲染留档;新派发运行的运行目录与事件账本为权威 |
| 授权终态与缺口报告 | ⏳ 机制就绪、无真实样例 | `AUTHORIZATION_REQUIRED` 授权终态(阶段 E 第一部分)与 `authorization-request` 工件、看板 Pipeline 面板均已就绪;改造后尚无运行命中证据缺口 | 不可见原因:无真实缺口运行产生(非接线缺口);待首个缺口运行出现即复验 |
## 结论
§11 要求的五类可见项——候选、待审、正文、卡片、链路记录——**全部可见**;授权终态行机制就绪,等待真实缺口运行产生后复验(原因成立:不是接线缺口)。
新作品走新框架链路时,本报告即对照基线:书 12 可见的,新作品必须可见;新增可见项(探索轨迹、依赖清单、派发链)已由两阶段写手/抽取/盲评派发运行真实填充样例。
## 证据命令留档(可复现)
```bash
curl -s http://127.0.0.1:8765/works # 作品行
curl -s http://127.0.0.1:8765/works/12/ch/3 # 第3章正文
curl -s http://127.0.0.1:8765/candidates # 待审队列
curl -s http://127.0.0.1:8765/candidates/164 # 候选详情
curl -s http://127.0.0.1:8765/runs/run-prod-work12-ch3-42beb650 # 运行详情(链路透视)
curl -s http://127.0.0.1:8765/runs/run-prod-work12-ch3-42beb650-writer-v9 # 派发运行(探索轨迹)
curl -s "http://127.0.0.1:8765/knowledge?work_id=12" # 知识卡
```

View File

@ -182,6 +182,7 @@ A、B 可并行;C 依赖 A;E 依赖 D;F 依赖 E;G 依赖 D(链路透
- 意图:把现有看板与决策通道收敛为创作台五视图:阅读、待审、卡片、链路透视、决策。
- 第一部分(已完成,看板测试绿):链路透视接线——运行详情页接事件账本(探索轨迹/模型回合/成本)与派发链父子导航;消解 §11 中"探索轨迹与事件链""依赖清单"两个接线缺口;详见 `docs/plans/2026-08-22-阶段G-第一部分-链路透视接线-事件账本与派发链.md`。
- 收尾(已完成):任务包与运行工件在链路透视区块全量呈现(探索任务包/清单/摘要、生成任务包、上下文、管道结果);§11 全矩阵走查完成并留验收记录 `docs/acceptance/2026-08-23-§11可见性对照验收-书12基线走查记录.md`:五类可见项全可见,授权终态行机制就绪待真实缺口运行。
- 边界:只读库;不拼模型调用命令;决策仍走唯一决策通道;artifacts 读侧迁到数据库与依赖清单投影。
- 验证:待审章节能看到候选、检查报告、依赖清单;链路透视能回放一次运行的任务包、探索轨迹与成本;既有看板测试与决策人闸测试通过。