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
This commit was merged in pull request #4.
This commit is contained in:
cflmy committed 2026-11-27 02:37:22 +08:00
1 parent 75cd26ef89
commit 9684e388ce
6 files changed
+948 -14

No files matched your search

+13 -1
View File
@@ -30,9 +30,21 @@ MARQDO_BIN=<verified marqdo> scripts/ci.sh
- 引擎失败与作者合同错误区分(`LoadError::Engine`/`Design`),宿主据此映射退出码 2/1;失败不产生部分模型。
- 不使用 `../design` 路径依赖,不复制 Markdown/语言解析器;只消费 Analysis 公开字段。
## 补充候选:保留合同表格(输入/事件/场景/交互/依赖/验收)
同一候选后续提交实现了 WEB-DESIGN §3.2/§5 的保留 H3 合同:
- `输入`(名称/类型/说明)、`事件`(名称/数据/说明):纯文本单元格、名称非空且组件内唯一;链接被拒绝。
- `场景`(状态/内容/初始):ASCII slug 状态、组件内唯一、恰好一个 initial;内容单元格必须且只能含一个 Link,指向 Knowledge 单元(拒绝 Exec/设计组件声明);只允许叶子组件;数量上限 32。
- `交互`(当前/事件/下一状态):状态必须存在、事件标签非空且同一当前状态唯一、每个状态从初始状态可达;多状态必须有交互;无场景不得有交互;转移上限 128。
- `依赖`(组件/原因):必须指向已加载设计组件、原因非空;跨组件设计依赖环确定性报错(报告协调需求,不宣称可并行)。
- `验收`:直接 H3 内容必须非空,作为交付文本保留,不自动解释为测试。
- 资源上限与合同建议对齐:文档 100 / 定义 200 / 实例 1000 / 深度 12 / 每行槽 12 / 场景 32 / 转移 128 / 单文件 1 MiB / 总输入 16 MiB;handoff 增加 inputs/events/scenarios/transitions/dependencies/acceptance。
- 测试增至 14 个真实 CLI 契约用例,覆盖上述正例与主要负例(重复 input/event、非法状态、非叶子场景、场景内容指向组件、不可达状态、缺交互、依赖未知/环、空验收、每行槽上限、单文件上限)。
## 未实现 / 未验证(不隐藏)
- 保留 H3 的 `输入`/`事件`/`依赖`/`验收` 合同模型、`场景`/`交互`(有限状态)解释与校验尚未实现;
- 场景内容目标的 Exec 子树/双重编码/符号链接等安全边界尚未全部以真实负例覆盖;
- handoff 当前为确定性组件树/来源摘要,WEB-03 的组件图、单组件切片与漂移标识未完成;
- 并发编辑/陈旧 Analysis 的二次一致性复核、资源上限的完整矩阵、symlink/双重编码等安全负例仅覆盖部分;
- 未配置组件 CI 服务(`scripts/ci.sh` 为显式入口,需 CI 传入固定 CLI 制品);领域/根接入(WEB-05)未开始。