feat: WEB-01 core Design interpreter over public Analysis 3

Implement the first real Design capability in the unique owner repository:
- src/analysis.rs runs the verified CLI check --emit with direct argv, validates
  Analysis 3 schema/source_digest, and snapshots one module without any implicit
  discovery or Markdown parser.
- src/document.rs selects the exact Knowledge H2 by anchor, direct retained H3
  sections, and the single GFM 组件 table from the analysis AST; cell text is
  read from the analysis-provided source by UTF-8 byte span.
- src/lib.rs binds design links by exact candidate_path + anchor (never label or
  filename guessing), validates rows/slots/widths, recursion, containment cycles
  and module/depth/byte limits, and builds deterministic component definitions,
  separate instances, source identities and a provisional handoff.
- Stable diagnostics separate Engine failures (exit 2) from author-contract
  errors (exit 1); no partial model on failure.
- tests/design_contract.rs exercises the real CLI for recursive layout,
  definition reuse, width forms and the main negative cases; scripts/ci.sh is the
  explicit entry (fmt/clippy/test) with a verified CLI.

Scenarios/input/event/dependency contracts and the full WEB-03 handoff remain
open and are recorded as unverified in the evidence document.

Refs cflmy/marqdo-web-design#1, cflmy/marqdo#6
This commit was merged in pull request #3.
This commit is contained in:
cflmy committed 2026-11-27 02:33:33 +08:00
1 parent 39c99e59d2
commit 75cd26ef89
13 files changed
+1649 -15

No files matched your search

+8
View File
@@ -30,3 +30,11 @@ Web 领域**唯一设计文档解释实现**。本仓库交付独立 Rust librar
## 工单
首版开发任务:WEB-01(Analysis 3 消费与设计编译)、WEB-03(handoff/组件图/单组件交付)。合同语义冲突归 `marqdo-ext-web` 协调;只有 CLI 公开 Analysis 合同本身不满足需求时才向 `marqdo-cli` 发工单,并附固定 SHA 与最小复现。
## 实现进展
- `src/analysis.rs`:真实 CLI `check --emit` 调用、Analysis 3 协议/摘要校验、单一模块快照。
- `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/组件图;证据见 [docs/evidence/WEB-01-design-core.md](docs/evidence/WEB-01-design-core.md)。