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

- 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
This commit was merged in pull request #5.
This commit is contained in:
cflmy committed 2026-11-27 08:47:56 +08:00
1 parent 9684e388ce
commit 495d2e4bf7
6 files changed
+252 -4

No files matched your search

+1 -1
View File
@@ -37,4 +37,4 @@ Web 领域**唯一设计文档解释实现**。本仓库交付独立 Rust librar
- `src/document.rs`:精确 anchor 选 Knowledge H2、直接保留 H3、GFM `组件` 表 AST/表头/单元格/Link 选择。
- `src/lib.rs`:递归布局、实例、宽度/行/槽校验、包含环与深度/模块/字节上限、稳定诊断、源身份与确定性 handoff。
- `tests/design_contract.rs`:8 个真实 CLI 契约测试(正例 + 负例);`scripts/ci.sh` 为显式验收入口。
- 未完成:WEB-03 完整 handoff/组件图、并发/陈旧 Analysis 复核、完整安全负例矩阵、组件 CI 服务与 WEB-05;证据见 [docs/evidence/WEB-01-design-core.md](docs/evidence/WEB-01-design-core.md)。
- 未完成:WEB-03 完整 handoff/组件图/单组件切片、组件 CI 服务与 WEB-05;内容投影、并发一致性与主要安全负例已实现;证据见 [docs/evidence/WEB-01-design-core.md](docs/evidence/WEB-01-design-core.md)。