Files
marqdo-web-design/README.md
T
cflmy 9684e388ce feat: interpret the remaining retained H3 contracts (WEB-01)
Add the input/event/scenario/interaction/dependency/acceptance model and
validation on top of the core loader:
- 输入/事件 plain-text tables with non-empty unique names; links rejected;
- 场景 only on leaf components, ASCII slug states unique, exactly one initial,
  content cell is exactly one link to a Knowledge unit (Exec and design
  component declarations rejected), scene limit 32;
- 交互 state references, non-empty unique event labels per state, reachability
  from the initial state, multi-state requires transitions, 128 limit;
- 依赖 must target loaded design components with non-empty reasons and an
  acyclic design dependency graph;
- 验收 keeps the direct section text, rejects empty content, never interprets
  it as a test;
- contract-aligned limits (100 docs/200 defs/1000 instances/12 depth/12 slots
  per row/1 MiB file/16 MiB total) and a richer deterministic handoff.

14 real-CLI contract tests now cover the positives and main negatives. Docs and
the WEB-01 evidence record which security/concurrency cases and WEB-03 handoff
remain open; WEB-01 stays open.

Refs cflmy/marqdo-web-design#1, cflmy/marqdo#6
2026-11-27 02:37:22 +08:00

41 lines
3.3 KiB
Markdown
Raw 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.
# marqdo-web-design
Web 领域**唯一设计文档解释实现**。本仓库交付独立 Rust library,消费真实 CLI 的公开 Analysis,把符合 [WEB-DESIGN 合同](https://git.cflmy.cn/cflmy/marqdo-ext-web/src/branch/main/docs/WEB-DESIGN.md) 的 `.mq.md` 解释为设计模型、诊断与交付快照。
**当前状态:`planned`。** 尚未实现、尚未发布、没有 CI 入口或制品;仓库中的 API 与目录均为暂定计划,未经真实 CLI 夹具验证。
## 职责与禁止
| 职责 | 禁止 |
| --- | --- |
| 读取并校验 CLI `check --emit` 的公开 Analysis 3(AST、units、anchors、references、source digest) | 启动服务、渲染 DOM、写预览 HTML |
| 解释 WEB-DESIGN 合同:显式 ENTRY/`--unit`/`--root`、保留节、递归组件、有限场景、依赖与验收 | 复制 Markdown/语言 parser 或另立第二套作者合同 |
| 产出设计模型(定义、实例、布局、场景、来源身份)、稳定诊断、组件/依赖图 | 调用 LLM、读密钥、启动插件/Worker/Foreign、修改源文档 |
| 生成派生 Markdown 交付(handoff)供独立任务读取 | 自动生成生产代码、自动分派任务、修改项目其它文件 |
| 只通过公开 crate API 向 Preview 提供模型 | 通过 `../design` 路径或 CLI 私有 crate 形成发布依赖 |
## 输入与关系
- 输入是**固定 CLI 制品**:由宿主显式传入 `MARQDO_BIN` 与项目 `ENTRY`;不探测历史协议、不隐式联网、不自动 `lock`/`install`。
- [marqdo-web-preview](https://git.cflmy.cn/cflmy/marqdo-web-preview) 是唯一消费者:它依赖本仓库的发布 crate 或固定 Git revision,并以 `Cargo.lock` 锁定真实身份;本仓库不依赖 Preview,也不依赖 CLI 私有实现。
- 领域治理与组合验收在 [marqdo-ext-web](https://git.cflmy.cn/cflmy/marqdo-ext-web),作者合同不在本仓库维护。
## 文档
- [领域开发指南](https://git.cflmy.cn/cflmy/marqdo-ext-web/src/branch/main/docs/DEVELOPMENT.md) — Web 领域总体流程与激活门禁
- [本仓库开发指南](docs/DEVELOPMENT.md) — 实现范围、测试与证据要求
- [暂定公开 API](docs/API.md) — Preview 消费边界(provisional,WEB-01 后收敛)
- [生态迁移台账](https://git.cflmy.cn/cflmy/marqdo/src/branch/main/docs/MIGRATION.md)
## 工单
首版开发任务: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/组件图、并发/陈旧 Analysis 复核、完整安全负例矩阵、组件 CI 服务与 WEB-05;证据见 [docs/evidence/WEB-01-design-core.md](docs/evidence/WEB-01-design-core.md)。