Files
marqdo-web-preview/docs/evidence/WEB-02-preview-candidate.md
cflmy eff273f7f2 feat: consume the WEB-03 handoff with output-relative source links
Bump the fixed Design revision to the handoff/graph/slice/drift candidate and
make web handoff use handoff_relative_to with the output directory, so source
links stay relative when the delivery file is written elsewhere. CI asserts the
links are relative (no absolute/file targets) and that sources are present.

Refs cflmy/marqdo-web-preview#1, cflmy/marqdo-web-design#2, cflmy/marqdo#6
2026-11-27 08:57:22 +08:00

40 lines
3.1 KiB
Markdown
Raw Permalink 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.
# WEB-02 Preview 候选证据(离线制品 / 唯一 web Tool / 有限场景)
日期:2026-11-27。责任仓:`marqdo-web-preview`;工单:[marqdo-web-preview#1](https://git.cflmy.cn/cflmy/marqdo-web-preview/issues/1)(WEB-02);父工单:根 [marqdo#6](https://git.cflmy.cn/cflmy/marqdo/issues/6)。
本文件记录 WEB-02 的**首个候选**:唯一 `marqdo web` Tool 的 check/preview/handoff 入口、离线静态预览、有限场景、CSP 与原子发布。真实浏览器行为验收、资产复制与完整安全矩阵尚未完成,未在此声明。
## 输入身份
| 对象 | 身份 |
| --- | --- |
| CLI | 由根固定 `cli/deadf6e` 构建的 `marqdo 3.0.0-rc.4`,SHA-256 `sha256:6ede3b9e...` |
| Design 依赖 | `marqdo-web-design@1b6607fd3cc09801b4f6eacd2fba547caa0ec637`(WEB-03 handoff/图/切片)(`Cargo.lock` 固定 git rev;不是 `../design` 路径依赖) |
| 平台 | Linux x86_64(本机验证) |
## 执行
```sh
MARQDO_BIN=<verified marqdo> scripts/ci.sh
```
脚本真实执行:fmt/clippy → 构建 release → 生成 `tool.json` bundle → `marqdo tool install` → `marqdo web check/preview/handoff`(fixture 工程)→ 覆盖拒绝 → CLI 二进制 SHA 不变 → `tool remove web`。
## 已验证(PASS)
- **唯一入口**:`tool.json`(`command: web`)+ 独立 executable;`marqdo web check|preview|handoff ENTRY --unit ANCHOR [--root] [--out] [--theme]`。
- **离线制品**:`preview` 生成单个 `index.html`(不启动服务、无网络请求),`file://` 可打开;CSP `default-src 'none'; style-src/script-src sha256; img-src 'self'; connect-src 'none'; form-action 'none'; base-uri 'none'`。
- **有限场景**:Design 模型中的场景面板与交互按钮渲染为内联固定脚本(CSP hash 放行);点击仅切换预渲染面板,无定时器/网络/eval;含“重置原型”。
- **原型标识与摘要**:页首与摘要可见“原型 / 模拟”,列 root 与参与源 `sha256`;不显示完整 Analysis 或绝对路径。
- **安全渲染**:Design 的 `ContentBlock` 文本全部 HTML 转义;raw HTML 显示为 inert 文本;不输出 `href="javascript:`、无外部 script。
- **发布安全**:输出目录/文件必须不存在;staging 私有目录校验后原子 rename;失败清理;拒绝符号链接目标。
- **退出码**:设计错误 1、参数/环境/IO 错误 2、成功 0;诊断写 stderr。
- **Tool 生命周期**:真实 CLI `tool install` / 运行 / `tool remove web`;CLI 二进制 SHA 前后不变。
## 未验证 / 后续(不隐藏)
- WEB-03 交付内容由图/切片/漂移提供,Preview 已验证相对链接;真实浏览器(Playwright/file://)行为、responsive 390px 无横向溢出、按钮实际状态切换的 DOM 断言未执行;当前只有静态制品断言。
- 图片/本地 raster 资产复制、魔数/大小校验、远端图片文本占位尚未实现(当前不渲染图片)。
- 完整安全负例矩阵(`</script>`/Unicode/双引号 fixture、输出预算边界、超时/进程限制)未系统性覆盖。
- 冷安装(root 生态 `web` Tool 与 WEB-05)未开始;WEB-04 生产交付试验未开始。