feat: WEB-04 domain composition cases and production delivery trial

Add three composition cases driven by the same generic web Tool:
- examples/doc-site (documentation site),
- examples/research-workspace (existing section 8 workbench prototype),
- examples/quantum-editor (finite scenario/interaction design).

Add a real production delivery trial in examples/research-workbench-app
(Express + JSON persistence + static UI): validation, search, status
transitions, linked statistics, JSON errors, real file persistence; node:test
API acceptance and a Playwright browser E2E. The production app is not a runtime
dependency of the web Tool; prototype PASS is kept separate from production
PASS. docs/WEB-04-delivery.md records the design-source to implementation
mapping, intentional non-goals and task splits.

scripts/domain-acceptance.sh is the explicit domain entry: installs the built
Tool, runs check/preview/handoff for the three cases, then installs/tests the
production app incl. browser E2E, and removes the Tool. Evidence records the
real CLI/Design/Preview identities and local PASS results.

Pin the domain submodules to the merged Design (WEB-01/03) and Preview (WEB-02)
candidates; activation and root gitlink belong to WEB-05.

Refs cflmy/marqdo-ext-web#2, cflmy/marqdo#6
This commit was merged in pull request #4.
This commit is contained in:
cflmy committed 2026-11-27 09:02:27 +08:00
1 parent df4324f3e3
commit 7a2c9280c0
26 files changed
+1559 -3

No files matched your search

+54
View File
@@ -0,0 +1,54 @@
# WEB-04 领域组合案例与生产交付试验
日期:2026-11-27。责任仓:`marqdo-ext-web`(领域组合与验收);工单:[marqdo-ext-web#2](https://git.cflmy.cn/cflmy/marqdo-ext-web/issues/2);父工单:[marqdo#6](https://git.cflmy.cn/cflmy/marqdo/issues/6)。
本文件描述 WEB-04 的三个组合案例、一个真实生产交付试验及其设计源映射。生产实现是独立应用,不是 `web` Tool 的运行依赖;原型 PASS 不等于生产 PASS。
## 三个组合案例(同一通用 renderer/Tool)
| 案例 | 设计根 | 设计单元 | 验证 |
| --- | --- | --- | --- |
| 文档型网站 | `examples/doc-site/` | `首页` | `marqdo web check/preview/handoff` |
| §8 科研任务台(原型) | `examples/research-workspace/` | `工作台` | 同上 |
| 量子电路编辑器设计 | `examples/quantum-editor/` | `编辑器` | 同上(含有限场景/交互) |
三例均由同一 `marqdo web` Tool(Design + Preview 固定 revision)驱动,没有按案例分叉的 renderer、HTML 注入或 CLI 语法。
## 生产交付试验:科研任务台
- 位置:`examples/research-workbench-app/`(Express 应用 + 真实 JSON 持久化 + 静态前端)。
- 设计源映射:
| 设计源 | 生产实现 |
| --- | --- |
| `examples/research-workspace/index.mq.md#工作台` | 页面布局与统计/任务/工作区三块 |
| `components/statistics.mq.md#统计` | `/api/stats` 与顶部统计条 |
| `components/tasks.mq.md#任务` | `/api/tasks`(列表/搜索/创建/状态流转)与任务列表 UI |
| `components/workspace.mq.md#科研工作区` | 工作区容器与错误提示区域 |
| `components/navigation.mq.md#导航` | 顶栏导航(占位,首版无多页面路由) |
- 真实能力:创建任务(校验标题/优先级)、按标题搜索、状态 open→doing→done、统计随数据联动、真实文件持久化、HTTP 错误 JSON 与 UI 错误提示。
- 有意未实现(明确记录,不冒充):认证/多用户、真实数据库、网络同步、导入导出、任务编辑/删除、真实实验设备接入。后续按 `docs/WEB-DESIGN.md` 边界在目标应用仓实现。
- 漂移追踪:重新生成 `marqdo web handoff examples/research-workspace/index.mq.md --unit 工作台`,比较 `design id` 与源摘要;本文件记录的设计源路径即映射锚点,源变更需按任务拆分更新本应用并记录差异。
- 任务拆分建议:认证与账户、数据库与迁移、任务编辑与删除、统计导出、多页面路由;各自独立应用工单,不改 Web Tool 运行时。
- 测试映射:
- 原型:`marqdo web preview` 的离线 HTML/场景(W31–W34 组合案例证据)。
- 生产 API:`npm test`(真实 HTTP + 临时文件持久化 + 错误/统计断言)。
- 生产 E2E:`npx playwright test`(真实浏览器:统计、搜索、创建校验联动)。
## 验证入口
```sh
MARQDO_BIN=<verified marqdo> \
MARQDO_WEB_TOOL_JSON=<built marqdo-web-preview tool.json> \
MARQDO_NPM_CACHE=<optional npm cache dir> \
scripts/domain-acceptance.sh
```
脚本以同一 Tool 跑三个案例的 check/preview/handoff,再安装并测试生产应用(API + 浏览器 E2E),最后卸载 Tool;任何原型测试都不会代替生产 E2E。
## 证据与未验证
- 本文件与领域 CI 脚本构成 WEB-04 候选;实际命令输出/退出码记录在父工单与根候选评论。
- 浏览器 E2E 需要可用的 Chromium;无浏览器环境必须标 UNVERIFIED,不得用静态断言冒充。
- 领域 gitlink 固定 Design/Preview 候选与根接入属于 WEB-04/WEB-05 同候选工作;根 `--checkouts` 与冷安装证据在 WEB-05 完成。
+40
View File
@@ -0,0 +1,40 @@
# WEB-04 领域组合案例与生产交付试验证据
日期:2026-11-27。责任仓:`marqdo-ext-web`;工单:[marqdo-ext-web#2](https://git.cflmy.cn/cflmy/marqdo-ext-web/issues/2)(WEB-04);父工单:根 [marqdo#6](https://git.cflmy.cn/cflmy/marqdo/issues/6)。
## 输入身份
| 对象 | 身份 |
| --- | --- |
| CLI | 由根固定 `cli/deadf6e` 构建的 `marqdo 3.0.0-rc.4`,`sha256:6ede3b9e8bcfad3942573e68b5f54b2c5bc2866b37d102f63acd49a55cb212db` |
| Design | `marqdo-web-design@1b6607fd3cc09801b4f6eacd2fba547caa0ec637`(WEB-03 handoff/图/切片) |
| Preview / web Tool | `marqdo-web-preview@eff273f7f2f3919bab62eacded781c61d5f03f91`(WEB-02 + WEB-03 消费) |
| 平台 | Linux x86_64,Node v24.22.3,Chromium(Playwright headless shell 1255) |
## 执行与结果(本地真实运行)
```sh
MARQDO_BIN=<verified marqdo> \
MARQDO_WEB_TOOL_JSON=<marqdo-web-preview/dist/marqdo-web-preview/tool.json> \
scripts/domain-acceptance.sh
```
结果 **PASS**:
- 同一 `marqdo web` Tool 对三个案例执行 `check/preview/handoff`:
- 文档型网站 `examples/doc-site`(单元 `首页`):PASS;
- §8 科研任务台原型 `examples/research-workspace`(单元 `工作台`):PASS;
- 量子电路编辑器设计 `examples/quantum-editor`(单元 `编辑器`):PASS(含有限场景/交互)。
- 每个 preview 均含 CSP、通用组件/场景标记;handoff 均非空并含 Design handoff;无按案例分叉的 renderer 或 CLI 语法。
- 生产交付试验 `examples/research-workbench-app`(Express):
- API 测试(真实 HTTP、真实临时文件持久化、错误/统计联动):`node --test` PASS;
- 真实浏览器 E2E(Playwright/Chromium):统计、搜索、创建、错误提示联动 PASS。
- Tool 生命周期:真实 CLI `tool install` → 三案例 + 生产应用 → `tool remove web`;CLI 二进制未改变(脚本断言)。
- 设计源→生产映射、有意未实现项与任务拆分记录在 `docs/WEB-04-delivery.md`。
## 边界与未验证
- 生产应用不依赖 `web` Tool 运行;原型 PASS 不冒充生产 PASS,二者证据分开。
- 认证、真实数据库、网络同步、任务编辑/删除、真实设备接入等有意未实现,已在交付文档标注。
- 浏览器 E2E 需要 Chromium;无浏览器环境须标 UNVERIFIED,本证据对应实际 Chromium 运行。
- 领域 gitlink 固定 Design/Preview 候选;根 gitlink、领域激活、`web` Tool 冷安装与根组合验收属 WEB-05,不在本证据内完成。