feat: project safe content, verify load stability and cover scope escapes #5

Merged
cflmy merged 1 commits from feature/web01-content-stability into main 2026-11-27 08:48:09 +08:00
Owner

范围(WEB-01 内容投影/一致性/安全)

  • ContentBlock/ContentLink 安全结构投影:只消费 Analysis AST 与源码 span;raw HTML 一律 inert 占位;链接保留 url/span 供 Preview allowlist,不复制 Markdown 解析。
  • 并发/陈旧一致性:一次 load 完成后对每个参与模块重新 check --emit 比对 source_digest;中途变化返回 Engine web.engine.stale,无部分模型。
  • 安全负例:symlink 越出 root 拒绝、绝对路径拒绝、%2e%2e 编码穿越不可解析、raw HTML inert。
  • 测试增至 18 个真实 CLI 契约用例;scripts/ci.sh fmt/clippy/test 全 PASS。

证据

docs/evidence/WEB-01-design-core.md(补充候选 2)。

未完成(工单保持 open)

WEB-03 完整组件/依赖图、单组件切片与漂移标识;WEB-02 输出预算/CSP/浏览器验收;组件 CI 服务接入;WEB-05 根接入与冷安装。

Refs cflmy/marqdo-web-design#1, cflmy/marqdo#6

## 范围(WEB-01 内容投影/一致性/安全) - `ContentBlock`/`ContentLink` 安全结构投影:只消费 Analysis AST 与源码 span;raw HTML 一律 inert 占位;链接保留 url/span 供 Preview allowlist,不复制 Markdown 解析。 - 并发/陈旧一致性:一次 `load` 完成后对每个参与模块重新 `check --emit` 比对 `source_digest`;中途变化返回 Engine `web.engine.stale`,无部分模型。 - 安全负例:symlink 越出 root 拒绝、绝对路径拒绝、`%2e%2e` 编码穿越不可解析、raw HTML inert。 - 测试增至 18 个真实 CLI 契约用例;`scripts/ci.sh` fmt/clippy/test 全 PASS。 ## 证据 [docs/evidence/WEB-01-design-core.md](docs/evidence/WEB-01-design-core.md)(补充候选 2)。 ## 未完成(工单保持 open) WEB-03 完整组件/依赖图、单组件切片与漂移标识;WEB-02 输出预算/CSP/浏览器验收;组件 CI 服务接入;WEB-05 根接入与冷安装。 Refs cflmy/marqdo-web-design#1, cflmy/marqdo#6
cflmy added 1 commit 2026-11-27 08:48:03 +08:00
- Expose ContentBlock/ContentLink projected from the analysis AST and source
  byte spans; raw HTML becomes an inert placeholder, links keep url/span for the
  Preview protocol allowlist. Components and scenario content units use it.
- After building the graph, re-analyze every participating module and require
  the same source_digest; a mid-load edit returns Engine web.engine.stale and no
  partial model.
- Security cases: symlink escape outside --root is rejected, absolute link
  targets are rejected, percent-encoded traversal stays unresolved, raw HTML is
  inert.
- Tests grow to 18 real-CLI cases (content projection, html placeholder,
  symlink/absolute/encoded scope escapes, forged CLI output stale detection).
- Evidence/docs record what remains: WEB-03 graph/slicing, component CI
  service, WEB-02 output budget/CSP, WEB-05 root integration.

Refs cflmy/marqdo-web-design#1, cflmy/marqdo#6
cflmy merged commit 495d2e4bf7 into main 2026-11-27 08:48:09 +08:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cflmy/marqdo-web-design#5