feat: handoff, design graph, single-component slice and drift (WEB-03) #7

Merged
cflmy merged 1 commits from feature/web03-handoff-graph into main 2026-11-27 08:56:19 +08:00
Owner

范围(WEB-03 Handoff / 组件依赖图 / 单组件切片 / 漂移)

在唯一实现仓扩展 Design 交付能力(不复制 Markdown 解析、不新立合同):

  • handoff / handoff_relative_to:确定性 Markdown——design id、源摘要、递归组件树、视觉包含与依赖边分离的组件图、每组件职责/视觉说明(来自安全 ContentBlock)、输入/事件/场景/交互/依赖/验收、明确“原型/模拟、真实功能由目标应用实现”边界;输出到其它目录时重算源链接。
  • graph():视觉边 + 非视觉依赖边 + 依赖循环组报告(load 仍拒绝循环以保证协调)。
  • slice():选择一个已加载组件及其视觉子树作为独立 Design,只带实际使用的源(单组件交付)。
  • drift(previous,current) + design_id():组件增删改与源摘要变化检测,支持重新生成时标识漂移。
  • 非视觉依赖目标按定义加载,使图显式;该路径成环报告 web.dependency.cycle。
  • 6 个新增真实 CLI 契约测试(确定性 handoff、相对链接、漂移、切片、图分离、既有负例)。

验证

MARQDO_BIN=<root-fixed CLI> scripts/ci.sh:fmt/clippy PASS,24/24 契约测试 PASS。

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

## 范围(WEB-03 Handoff / 组件依赖图 / 单组件切片 / 漂移) 在唯一实现仓扩展 Design 交付能力(不复制 Markdown 解析、不新立合同): - `handoff` / `handoff_relative_to`:确定性 Markdown——design id、源摘要、递归组件树、**视觉包含与依赖边分离**的组件图、每组件职责/视觉说明(来自安全 ContentBlock)、输入/事件/场景/交互/依赖/验收、明确“原型/模拟、真实功能由目标应用实现”边界;输出到其它目录时重算源链接。 - `graph()`:视觉边 + 非视觉依赖边 + 依赖循环组报告(load 仍拒绝循环以保证协调)。 - `slice()`:选择一个已加载组件及其视觉子树作为独立 Design,只带实际使用的源(单组件交付)。 - `drift(previous,current)` + `design_id()`:组件增删改与源摘要变化检测,支持重新生成时标识漂移。 - 非视觉依赖目标按定义加载,使图显式;该路径成环报告 `web.dependency.cycle`。 - 6 个新增真实 CLI 契约测试(确定性 handoff、相对链接、漂移、切片、图分离、既有负例)。 ## 验证 `MARQDO_BIN=<root-fixed CLI> scripts/ci.sh`:fmt/clippy PASS,24/24 契约测试 PASS。 Refs cflmy/marqdo-web-design#2, cflmy/marqdo#6
cflmy added 1 commit 2026-11-27 08:56:14 +08:00
Extend the Design public API for delivery consumers:
- handoff/handoff_relative_to derive deterministic Markdown from the model only:
  design id, source digests, component tree, separated visual containment and
  non-visual dependency graph, per-component source links, responsibility/visual
  notes from safe content blocks, inputs, events, scenarios, interactions,
  dependencies, acceptance and an explicit prototype/not-implemented boundary.
  Source links are recomputed relative to the output directory when requested.
- graph() separates visual containment edges from dependency edges and reports
  dependency cycle groups (load still rejects cycles for coordination).
- slice() selects one loaded component and its visual subtree as an independent
  Design with only the used sources (single-component delivery).
- drift(previous,current) reports added/removed/changed components and changed
  source digests; design_id() is a deterministic identity for drift checks.
- Non-visual dependency targets are loaded as definitions so the graph is
  explicit even when the dependency is not placed in the visual tree; a cycle on
  that path reports web.dependency.cycle.
- Six new real-CLI tests cover deterministic handoff, relative links, drift,
  slicing, graph separation and the unchanged negative contract.

Refs cflmy/marqdo-web-design#2, cflmy/marqdo#6
cflmy merged commit 8cd72b87b6 into main 2026-11-27 08:56:19 +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#7