feat(PR-04): explicit-run flow, Trace v2 validation and run visualization

- trace.rs: strict Trace v2 validation (schema/product/root_id/analysis_digest,
  known module ids, increasing seq, span bounds) + run states and anchor summaries
- POST /api/run: explicit confirm, CSRF token, Origin/Host checks, JSON limits,
  pure-only mode, one active run, process-group timeout, in-memory run cache
- POST /api/clear-run: session cache cleanup without touching project files
- server-rendered run panel (escaped stdout/stderr, Core error code, public final
  value only, capped event list, truncation/stale/failure states) and inline chips
  anchored to real statement spans; no per-assignment values or memory claims
- page refresh/open never invokes run (tested 10x); rejected requests never spawn
- real Trace v2 goldens (ok/truncated/arity error) from frozen CLI + contract
  and raw-HTTP tests; ADR-0004; docs updated
This commit is contained in:
marqdo-view dev committed 2026-11-22 11:38:39 +08:00
1 parent 80ce564f09
commit df1cf9ec24
25 files changed
+5724 -62

No files matched your search

+2 -2
View File
@@ -29,8 +29,8 @@ Beta 版 CLI 必须使用 prerelease 范围(`>=3.0.0-beta.1,<4.0.0`);`>=3.
| Analysis v2 静态语义(函数/Unit/诊断/引用/资源) | **已实现**(PR-02) |
| 文档态 / 源码态切换 | **已实现**(PR-02) |
| 暖纸 Reader 视觉(单一 CSS/JS) | 计划 PR-03 |
| 用户显式触发运行 + Trace v2 事件可视化 | 计划 PR-04 |
| Live 本机安全 API | 计划 PR-05 |
| 用户显式触发运行 + Trace v2 事件可视化 | **已实现**(PR-04,仅 `pure` 模式,需页面内确认 + CSRF) |
| Live 本机安全 API | 部分实现(PR-02 只读 + PR-04 run;PR-05 强化/导出) |
| 静态离线导出(纯只读) | 计划 PR-05 |
| 逐语句变量值 / 参数实际值 / 内存快照 | **UNSUPPORTED**(Trace v2 不提供,绝不伪造) |
| 知识“已证明”状态 | **UNSUPPORTED**(需要独立 Prove 协议与证书) |