@loomhelm/multi-task-flow 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +14 -14
  2. package/package.json +2 -2
  3. package/src/cli/service.ts +26 -0
  4. package/src/cli.ts +3 -1
  5. package/toolkit/artifact-manifest.json +67 -71
  6. package/toolkit/package.json +1 -1
  7. package/toolkit/skills/bin/check_source_policy.ts +13 -7
  8. package/toolkit/skills/bin/multi_task_platform_gate.ts +2 -2
  9. package/toolkit/skills/bin/tests/core/package_scripts.test.ts +1 -1
  10. package/toolkit/skills/bin/tests/plan/multi-task-flow.test.ts +3 -3
  11. package/toolkit/skills/catalog.json +0 -1
  12. package/toolkit/skills/docs/vendor/dot-codex/design/multi-task-flow/data-and-scripts.md +8 -6
  13. package/toolkit/skills/docs/vendor/dot-codex/design/multi-task-flow/execution.md +1 -1
  14. package/toolkit/skills/docs/vendor/dot-codex/design/multi-task-flow/plan-revision-and-change-audit.md +1 -1
  15. package/toolkit/skills/docs/vendor/dot-codex/design/multi-task-flow/web-template.md +1 -1
  16. package/toolkit/skills/docs/vendor/dot-codex/specs/a4ge9-stable-preview-runtime/IMPLEMENTATION.md +0 -2
  17. package/toolkit/skills/docs/vendor/dot-codex/specs/a4ge9-stable-preview-runtime/SPEC.md +0 -1
  18. package/toolkit/skills/docs/vendor/dot-codex/specs/dev-plan-standalone-typescript-finalizer/IMPLEMENTATION.md +1 -1
  19. package/toolkit/skills/docs/vendor/dot-codex/specs/multi-task-flow/IMPLEMENTATION.md +3 -3
  20. package/toolkit/skills/docs/vendor/dot-codex/specs/multi-task-flow/SCHEMA.md +4 -4
  21. package/toolkit/skills/docs/vendor/dot-codex/specs/stable-preview-runtime/IMPLEMENTATION.md +0 -2
  22. package/toolkit/skills/docs/vendor/dot-codex/specs/stable-preview-runtime/SPEC.md +0 -1
  23. package/toolkit/skills/multi-task-flow/SKILL.md +65 -47
  24. package/toolkit/skills/multi-task-flow/dist/app.css +1 -1
  25. package/toolkit/skills/multi-task-flow/dist/app.js +74 -74
  26. package/toolkit/skills/multi-task-flow/dist/index.html +3 -3
  27. package/toolkit/skills/multi-task-flow/lib/atomic-orchestration.ts +1 -0
  28. package/toolkit/skills/multi-task-flow/lib/engine.ts +65 -7
  29. package/toolkit/skills/multi-task-flow/lib/package-source.ts +5 -5
  30. package/toolkit/skills/multi-task-flow/lib/schema.ts +82 -2
  31. package/toolkit/skills/multi-task-flow/lib/service-pages.ts +1 -26
  32. package/toolkit/skills/multi-task-flow/lib/view.ts +16 -0
  33. package/toolkit/skills/multi-task-flow/references/shared-viewer.md +1 -1
  34. package/toolkit/skills/multi-task-flow/scripts/check-client-skills.ts +7 -4
  35. package/toolkit/skills/multi-task-flow/scripts/check-skills-installation.ts +14 -8
  36. package/toolkit/skills/multi-task-flow/scripts/import-client-skills.ts +1 -1
  37. package/toolkit/skills/multi-task-flow/scripts/package-client-skills.ts +4 -4
  38. package/toolkit/skills/multi-task-flow/scripts/test-viewer-source.ts +1 -1
  39. package/toolkit/skills/multi-task-flow/tests/atomic-orchestration-schema.test.ts +5 -0
  40. package/toolkit/skills/multi-task-flow/tests/browser/README.md +1 -1
  41. package/toolkit/skills/multi-task-flow/tests/check-skills-installation.test.ts +12 -38
  42. package/toolkit/skills/multi-task-flow/tests/delivery-topology.test.ts +33 -0
  43. package/toolkit/skills/multi-task-flow/tests/orchestrate.test.ts +3 -5
  44. package/toolkit/skills/multi-task-flow/tests/ui/details-content.test.ts +9 -0
  45. package/toolkit/skills/multi-task-flow/tests/ui/responsive-width-contract.test.ts +25 -1
  46. package/toolkit/skills/multi-task-flow/tests/ui/task-context-menu.test.ts +2 -1
  47. package/toolkit/skills/multi-task-flow/web/app.css +64 -9
  48. package/toolkit/skills/multi-task-flow/web/app.ts +33 -14
  49. package/toolkit/skills/multi-task-flow/web/atomic-graph-view.tsx +1 -1
  50. package/toolkit/skills/multi-task-flow/web/details-content.ts +49 -38
  51. package/toolkit/skills/multi-task-flow/web/graph-view.tsx +1 -1
  52. package/toolkit/skills/multi-task-flow/web/index.html +3 -3
  53. package/toolkit/skills/multi-task-flow/web/model.ts +1 -1
  54. package/toolkit/skills/multi-task-flow/web/timeline.ts +11 -8
  55. package/toolkit/skills/package.json +2 -2
  56. package/toolkit/skills/source-manifest.json +691 -398
  57. package/toolkit/skills/support-manifest.json +1 -0
  58. package/toolkit/skills/multi-task-flow/scripts/serve.ts +0 -218
  59. package/toolkit/skills/multi-task-flow/tests/serve.test.ts +0 -194
@@ -18,13 +18,19 @@ const grandfathered = new Set([
18
18
  "skills/bin/modules/plan/contract.ts",
19
19
  "skills/bin/modules/workspace/port_registry.ts",
20
20
  "skills/bin/modules/visual/secure_io.ts",
21
- "skills/multi-task-flow/web/app.ts",
22
- "skills/multi-task-flow/web/graph-projection.ts",
23
- "skills/multi-task-flow/lib/schema.ts",
24
- "skills/multi-task-flow/lib/engine.ts",
25
- "skills/multi-task-flow/scripts/orchestrate.ts",
26
- "skills/multi-task-flow/tests/engine.test.ts",
27
- "skills/multi-task-flow/tests/orchestrate.test.ts",
21
+ "skills/multi-task-flow-runtime/web/app.ts",
22
+ "skills/multi-task-flow-runtime/web/graph-projection.ts",
23
+ "skills/multi-task-flow-runtime/lib/schema.ts",
24
+ "skills/multi-task-flow-runtime/lib/engine.ts",
25
+ "skills/multi-task-flow-runtime/scripts/orchestrate.ts",
26
+ "skills/multi-task-flow-runtime/tests/engine.test.ts",
27
+ "skills/multi-task-flow-runtime/tests/orchestrate.test.ts",
28
+ "skills/multi-task-flow-runtime/scripts/viewer-socket.ts",
29
+ "skills/multi-task-flow-runtime/lib/service-http.ts",
30
+ "skills/multi-task-flow-runtime/lib/store-migration.ts",
31
+ "skills/multi-task-flow-runtime/lib/view.ts",
32
+ "skills/multi-task-flow-runtime/lib/server.ts",
33
+ "skills/multi-task-flow-runtime/lib/store.ts",
28
34
  ]);
29
35
 
30
36
  async function checkFile(path: string): Promise<void> {
@@ -15,8 +15,8 @@ const child = Runtime.spawn(
15
15
  process.execPath,
16
16
  "test",
17
17
  "--path-ignore-patterns",
18
- "skills/multi-task-flow/tests/ui/**",
19
- "skills/multi-task-flow/tests",
18
+ "skills/multi-task-flow-runtime/tests/ui/**",
19
+ "skills/multi-task-flow-runtime/tests",
20
20
  ],
21
21
  { stdin: "inherit", stdout: "inherit", stderr: "inherit" },
22
22
  );
@@ -8,6 +8,6 @@ test("migrated regression surfaces are exposed without installing a user viewer"
8
8
  }
9
9
  expect(scripts["skills:test"]).toContain("bun test ./bin/tests");
10
10
  expect(scripts["skills:test"]).not.toContain("dashboard:install");
11
- expect(scripts["skills:build"]).toBe("bun run --cwd multi-task-flow build");
11
+ expect(scripts["skills:build"]).toBe("bun run --cwd multi-task-flow-runtime build");
12
12
  expect(JSON.stringify(scripts)).not.toContain("build-skills-native");
13
13
  });
@@ -26,9 +26,9 @@ describe("dev-plan and multi-task-flow separation", () => {
26
26
 
27
27
  test("runtime schema and initializer contain no dev-plan handoff contract", async () => {
28
28
  for (const path of [
29
- "skills/multi-task-flow/lib/schema.ts",
30
- "skills/multi-task-flow/scripts/orchestrate.ts",
31
- "skills/multi-task-flow/lib/engine.ts",
29
+ "skills/multi-task-flow-runtime/lib/schema.ts",
30
+ "skills/multi-task-flow-runtime/scripts/orchestrate.ts",
31
+ "skills/multi-task-flow-runtime/lib/engine.ts",
32
32
  ]) {
33
33
  const source = await readFile(resolve(ROOT, path), "utf8");
34
34
  expect(source).not.toContain("dev_plan_handoff");
@@ -479,7 +479,6 @@
479
479
  "skills/multi-task-flow/scripts/diagnose-candidate-sandbox.ts",
480
480
  "skills/multi-task-flow/scripts/orchestrate.ts",
481
481
  "skills/multi-task-flow/scripts/preview-source.ts",
482
- "skills/multi-task-flow/scripts/serve.ts",
483
482
  "skills/multi-task-flow/scripts/service.ts",
484
483
  "skills/multi-task-flow/scripts/verify-service-browser.ts",
485
484
  "skills/multi-task-flow/scripts/verify-service-native.ts"
@@ -8,6 +8,8 @@
8
8
 
9
9
  Skill 自带 Bun + TypeScript 固定脚本,所有账本操作通过脚本完成。Agent 不直接编辑 JSON;要求 Markdown 可由 Agent 普通编辑,不强制生成或硬校验。脚本接口须支持机器可读的成功、等待、冲突与错误结果,并附可读原因。
10
10
 
11
+ 交付单元的数量由主 Agent 在计划上下文中根据需求结果和 contribution Task 归纳,账本只保存批准后的原子 scope 归属。每个 contribution 或 documentation work 原子必须携带唯一 `task_id` 和 `delivery_unit_id`;DeliveryUnit 定义不复制任务清单,也不新增 Proposal 类型。计划批准后,同一 `delivery_unit_id` 下一个 contribution Task 使用共享交付拓扑,多个 contribution Task 使用独立任务对话和 child PR 的多任务集成拓扑;验证、发布和部署任务不计入该数量。
12
+
11
13
  ## 目录与身份
12
14
 
13
15
  ```text
@@ -147,7 +149,7 @@ type Ledger = {
147
149
  | `ExternalRef` | `provider`, `repository`, `id`, `url: string \| null`;`url` 仅存实际取得并校验的链接,证据中的 SHA 使用 Git 平台支持的完整对象 ID |
148
150
  | `FollowPR` | `id`, `origin_task_id`, `origin_group_id`, `pr: ExternalRef`, `target_branch`, `state: 'open' \| 'merged' \| 'blocked'`, `merge_fact_id: string \| null`, `affected_task_ids: string[]`;归属原交付单元,目标按原父 PR 是否已合并选择 |
149
151
  | `ProviderReceipt` | `provider`, `repository`, `resource_type: 'branch' \| 'pr'`, `resource_id`, `branch`, `target_branch`, `base_sha`, `head_sha: string \| null`, `pr`, `state: 'exists' \| 'open' \| 'merged' \| 'absent' \| 'unknown'`, `evidence_ref`;publication resolve 必须保存远端查询得到的完整 receipt,失败/不确定查询分别使用 `absent`/`unknown` |
150
- | `Fact` | `id`, `kind: 'task_quality' \| 'pr_merged' \| 'branch_published' \| 'pr_published' \| 'ci_passed' \| 'published' \| 'deployed' \| 'verified'`, `subject_id`, `status: 'passed' \| 'failed' \| 'unknown'`, `source`, `observed_at`, `sha: string \| null`, `evidence_ref: string \| null`, optional task-owned quality proof, `receipt: ProviderReceipt \| null`;不同阶段和目标独立记录;贡献任务的 `pr_merged` 必须绑定该任务自己的 child merge receipt,不比较后续父交付单元 SHA;发布或部署产物 SHA 可以因构建产生新对象,但必须由对应 `Operation.receipt_fact_id` 和 `expected_sha` 证明来源 lineage |
152
+ | `Fact` | `id`, `kind: 'task_quality' \| 'pr_merged' \| 'branch_published' \| 'pr_published' \| 'ci_passed' \| 'published' \| 'deployed' \| 'verified'`, `subject_id`, `status: 'passed' \| 'failed' \| 'unknown'`, `source`, `observed_at`, `sha: string \| null`, `evidence_ref: string \| null`, optional task-owned quality proof, `receipt: ProviderReceipt \| null`;不同阶段和目标独立记录;多任务拓扑的贡献任务 `pr_merged` 绑定自己的 child merge receipt,单贡献拓扑的共享任务复用所属交付单元 PR 的 merge receipt;发布或部署产物 SHA 可以因构建产生新对象,但必须由对应 `Operation.receipt_fact_id` 和 `expected_sha` 证明来源 lineage |
151
153
 
152
154
  #### 操作与服务
153
155
 
@@ -179,7 +181,7 @@ type Ledger = {
179
181
 
180
182
  ### 调用格式
181
183
 
182
- 入口为 `bun run <skill>/scripts/orchestrate.ts <command> --input -`,标准输入为一个 JSON 对象;禁止通过命令行传递凭据。输出只有一个 JSON 对象到 stdout,诊断写 stderr。读命令不修改账本;写命令必须先有本编排操作权限,且共同遵循以下信封:
184
+ 入口为 `multi-task-flow flow <command> --input -`,标准输入为一个 JSON 对象;禁止通过命令行传递凭据。输出只有一个 JSON 对象到 stdout,诊断写 stderr。读命令不修改账本;写命令必须先有本编排操作权限,且共同遵循以下信封:
183
185
 
184
186
  ```json
185
187
  {
@@ -220,7 +222,7 @@ type Ledger = {
220
222
  | `group-execution-update` | 字段:`group_id`, `state`, `reason`, `waiting_for_task_ids`;效果:明确记录交付协调实际执行、等待、恢复和阻塞;等待贡献任务必须引用同组有效任务 |
221
223
  | `group-update` / `group-base` | 字段:前者 `group`,后者 `group_id`, `provider_observation`;效果:更新交付单元信息或记录首次/同 SHA 的核实分支基线;已建立 SHA 的推进必须使用 `group-base-reconcile` |
222
224
  | `group-base-reconcile` | 字段:`group_id`, `provider_observation`(`operation: "update-branch"`, `previous_sha`, `sha`, `branch`, `parent_pr`, `source`, `evidence_ref`);效果:在无未决 merge/cut operation 时,使用精确 provider 证据原子记录同一父分支的外部 update-branch SHA 推进;不表示 PR 合并 |
223
- | `task-pr` / `task-base` / `task-quality-record` | 字段:`task_id` 和 PR、基线或任务 Agent 自证;效果:v2 下只允许绑定已有 PR publication receipt;任务 Agent 自己记录当前 head/base、验收引用和 checks,不需要交付协调 Agent 审核 child PR |
225
+ | `task-pr` / `task-base` / `task-quality-record` | 字段:`task_id` 和 PR、基线或任务 Agent 自证;效果:v2 下只允许绑定已有 PR publication receipt;多任务拓扑绑定 child PR,单贡献拓扑复用交付单元 PR;任务 Agent 自己记录当前 head/base、验收引用和 checks,不需要交付协调 Agent 审核 child PR |
224
226
 
225
227
  #### 合并、通知与收口
226
228
 
@@ -242,7 +244,7 @@ type Ledger = {
242
244
 
243
245
  ### 状态与就绪判定
244
246
 
245
- 任务派发检查明确前驱和空闲名额;绑定会话后进入 `starting`,实际开始时进入 `running`。`running → waiting/blocked` 时释放运行名额,恢复前重新检查依赖和容量。交付单元与贡献任务按 `workspace_ready → pr_created → pr_merged → closed` 记录生命周期;workspace-ready 绑定 active worktree/branch Resource,pr-created 只由 `publish_pr` 成功 receipt 推导,pr-merged 只由 `merge-resolve` 成功 receipt 推导,closed 只由现有 closeout 条件推导。贡献任务以核实的子 PR 合入进入 `integrated`,非贡献任务以明确证据进入 `completed`。已集成的后继可以开始;`closed` 还需检查已知 follow PR。失败不自动推导 `completed` 或 `closed`。
247
+ 任务派发检查明确前驱和空闲名额;绑定会话后进入 `starting`,实际开始时进入 `running`。`running → waiting/blocked` 时释放运行名额,恢复前重新检查依赖和容量。交付单元与贡献任务按 `workspace_ready → pr_created → pr_merged → closed` 记录生命周期;workspace-ready 绑定 active worktree/branch Resource,pr-created 只由 `publish_pr` 成功 receipt 推导,pr-merged 只由 `merge-resolve` 成功 receipt 推导,closed 只由现有 closeout 条件推导。多任务拓扑的贡献任务以核实的 child PR 合入进入 `integrated`;单贡献拓扑的共享任务复用交付单元 PR 的发布、检查和合并事实。非贡献任务以明确证据进入 `completed`。已集成的后继可以开始;`closed` 还需检查已知 follow PR。失败不自动推导 `completed` 或 `closed`。
246
248
 
247
249
  同一编排的 `merge-claim` 对同一目标父分支与 `cut-claim` 互斥;切割期间新合入返回等待,已有合入处于未知状态时不能切割。切割 SHA 是归属交接点;后续 follow PR 使原父分支前进时,追加事实、更新 `current_sha` 并刷新合并证据,不更改已切出的归属。新交付单元任务可以继续推进,目标分支和合入须按上一批合入主干后的规则更新。
248
250
 
@@ -311,7 +313,7 @@ flowchart TD
311
313
 
312
314
  服务通过脚本取得一致的账本视图,向浏览器提供初始快照及变更推送;断线重连时发送当前完整版本。页面不得写入账本或运行事实;服务仅额外提供 tokenized 的 `GET/POST /api/preferences`,且只允许写入 schema-1 的全局主题偏好。其余视图、事件和文档接口保持只读。服务仅监听本机,并限制允许的资源和来源;要求文档只按账本中明确引用的路径提供,不能提供任意文件读取。数据中不存放凭据或敏感令牌。
313
315
 
314
- 服务启动前按现有全局端口租约流程申请并注册端口;`serve.ts` 负责登记自身 PID、心跳和退出释放自己的服务租约,不接管其他进程或端口。向主人提供可持续访问的 URL 前,Agent 必须确认当前任务由 Codex host 提供且仍被保留的 native background session 和有效租约。Skill 不创建或推断该宿主会话;没有受支持的宿主后台路径时只能保留 live preview。
316
+ 服务启动前按现有全局端口租约流程申请并注册端口;the installed user service 负责登记自身 PID、心跳和退出释放自己的服务租约,不接管其他进程或端口。向主人提供可持续访问的 URL 前,Agent 必须确认当前任务由 Codex host 提供且仍被保留的 native background session 和有效租约。Skill 不创建或推断该宿主会话;没有受支持的宿主后台路径时只能保留 live preview。
315
317
 
316
318
  需要主动通知的事件先提交账本事实和通知意图,再由 CLI 调用 Codex Agent API;确认状态也写入账本。一般阻塞只需记账并留在相应任务或交付单元对话;确实影响调度时才使用 `notification.mode: "deliver"` 通知指定收件会话。断线、发送失败或确认缺失时,待处理通知保留并可通过 `notification-reconcile` 恢复查询;`unknown` 在平台对账前不得直接重试,恢复器不得伪造发送或 ack。
317
319
 
@@ -334,7 +336,7 @@ flowchart TD
334
336
 
335
337
  桌面与独立 app-server daemon 可能是不同实例。`CodexDesktopFollower` 只使用当前用户拥有的桌面 IPC socket,按已绑定 thread 发现现有 owner,以跟随通道获取公开 assistant 快照和文本补丁。只支持已核实的 stream version 11;按平台 islands/entries/item 顺序选择消息。保留索引占位但丢弃工具、用户与推理正文;验证 owner 和本地 host,重复旧版本丢弃,revision 缺口重新订阅取得快照。取消绑定及连接结束释放跟随关系;它不暴露任何执行或配置控制请求。
336
338
 
337
- - 会话链接:当前候选已证明真实 ID、原生 `codex://threads/<thread_id>` 锚点合同,并记录了 Codex 原生导航结果,证据见 `skills/multi-task-flow/examples/orchestration-viewer/link-verification.json`。该记录不声称证明宿主浏览器点击桥接;后续候选只有在链接合同或绑定身份变化时才需要新的观察;不得编造链接或自动重复创建。
339
+ - 会话链接:当前候选已证明真实 ID、原生 `codex://threads/<thread_id>` 锚点合同,并记录了 Codex 原生导航结果,证据见 `skills/multi-task-flow-runtime/examples/orchestration-viewer/link-verification.json`。该记录不声称证明宿主浏览器点击桥接;后续候选只有在链接合同或绑定身份变化时才需要新的观察;不得编造链接或自动重复创建。
338
340
 
339
341
  ## 执行配置与创建接口
340
342
 
@@ -95,7 +95,7 @@ follow PR 合入后,负责它的 Agent 通知主 Agent(main Agent);主 A
95
95
 
96
96
  Skill 提供以 daisyUI 和 Tailwind CSS 为基础的模板,尽量使用单个 HTML 和少量 JS、CSS。图形依赖及是否使用前端框架由实现时按实际需要选择。每次编排从共享模板生成自己的页面,主 Agent(main Agent) 可按项目调整外观和展示;模板保持不变,页面不能隐藏依赖、阻塞和实际进度等关键信息。
97
97
 
98
- 由 Bun 启动只监听本机的只读服务,从账本提供当前视图并推送后续更新。服务使用端口租约;`serve.ts` 在 registry 锁内原子校验预分配租约,拒绝已有 owner 的重复启动,持锁绑定 listener,并只在 listener 确认后登记自身 PID,运行期间心跳,退出时只释放自身服务租约。连接中断时页面明确显示,不能把旧信息冒充实时信息。页面支持流程图、理论和实际甘特图、筛选、详情,以及对话、PR 和要求文档链接。技术实现须验证各类链接在实际运行环境中可打开。
98
+ 由 Bun 启动只监听本机的只读服务,从账本提供当前视图并推送后续更新。服务使用端口租约;the installed user service 在 registry 锁内原子校验预分配租约,拒绝已有 owner 的重复启动,持锁绑定 listener,并只在 listener 确认后登记自身 PID,运行期间心跳,退出时只释放自身服务租约。连接中断时页面明确显示,不能把旧信息冒充实时信息。页面支持流程图、理论和实际甘特图、筛选、详情,以及对话、PR 和要求文档链接。技术实现须验证各类链接在实际运行环境中可打开。
99
99
 
100
100
  Agent/host 负责取得并保留真正的 Codex native background session;Skill 只接收宿主实际提供的 `agent_session` 元数据,不创建、猜测或用可见终端/前台 exec 替代它。没有受支持的宿主后台路径时,服务只能用于当前回合验证,不能交付 owner-facing URL。
101
101
 
@@ -44,7 +44,7 @@ runtime 根据规范化 diff 推导变更级别,调用方不得在请求中自
44
44
 
45
45
  ## 自解释合同
46
46
 
47
- `skills/multi-task-flow/lib/schema.ts` 是唯一执行合同源。相邻的 `contract.ts` 只提供该合同的元数据、JSON Schema 和按操作裁剪的 `localSemanticProjection`,不建立第二套字段解析器。
47
+ `skills/multi-task-flow-runtime/lib/schema.ts` 是唯一执行合同源。相邻的 `contract.ts` 只提供该合同的元数据、JSON Schema 和按操作裁剪的 `localSemanticProjection`,不建立第二套字段解析器。
48
48
 
49
49
  同一合同提供:
50
50
 
@@ -124,7 +124,7 @@
124
124
 
125
125
  ## 服务接口与更新
126
126
 
127
- 本机服务由 `bun run <skill>/scripts/serve.ts --run <id> --scope-id <scope> --service <service> --port <leased-port> [--agent-session <host-provided-id>]` 启动,先申请当前编排服务的端口租约,只绑定 `127.0.0.1`。脚本登记自身 PID、心跳并在停止时仅释放自己的服务租约;Agent/host 负责创建和保留真正的原生后台会话,Skill 不得从进程或可见终端猜测会话。项目定制的资源放在该 run 的 `view/`,使用 `--custom-view` 加载。对外展示的 URL 必须同时对应活动租约和仍存活的宿主 native background session;没有受支持的宿主后台路径时只能用于当前回合验证。
127
+ 本机服务由 `multi-task-flow service ensure --input -` 启动,先申请当前编排服务的端口租约,只绑定 `127.0.0.1`。脚本登记自身 PID、心跳并在停止时仅释放自己的服务租约;Agent/host 负责创建和保留真正的原生后台会话,Skill 不得从进程或可见终端猜测会话。项目定制的资源放在该 run 的 `view/`,使用 `--custom-view` 加载。对外展示的 URL 必须同时对应活动租约和仍存活的宿主 native background session;没有受支持的宿主后台路径时只能用于当前回合验证。
128
128
 
129
129
  服务启动时生成至少 128 位随机访问令牌,URL 前缀为 `/s/<token>/`;令牌不写进账本、日志或项目文件。只有携带有效前缀的请求可读取页面和数据;严格检查 Host 为当前绑定的 `127.0.0.1:<port>`,拒绝非本机连接和跨源请求。响应设置 `Cache-Control: no-store`、`Referrer-Policy: no-referrer`、`X-Content-Type-Options: nosniff`,所有显示的任务文本按文本处理,禁止注入 HTML。令牌和本机服务并不提供跨用户的强身份隔离。
130
130
 
@@ -37,8 +37,6 @@
37
37
  - `skills/global-port-manager/SKILL.md`
38
38
  - `skills/storybook-stories/SKILL.md`
39
39
  - `docs/solutions/workflow-issues/stable-preview-handoff-runtime.md`
40
- - `skills/multi-task-flow/scripts/serve.ts`
41
- - `skills/multi-task-flow/tests/serve.test.ts`
42
40
  - `bin/modules/workspace/port_registry.ts`
43
41
  - `bin/modules/workspace/port_registry_cli.ts`
44
42
  - `bin/tests/workspace/workspace.test.ts`
@@ -146,7 +146,6 @@ None
146
146
  ### Testing
147
147
 
148
148
  - `bun test skills/global-port-manager/scripts/test_port_registry.ts`
149
- - `bun test skills/multi-task-flow/tests/serve.test.ts`
150
149
  - `git diff --check`
151
150
 
152
151
  ### Quality checks
@@ -16,7 +16,7 @@
16
16
  ## Verification
17
17
 
18
18
  - `bun test bin/tests/plan --timeout 30000`:74 tests passed。
19
- - `bun test skills/multi-task-flow/tests/engine.test.ts skills/multi-task-flow/tests/orchestrate.test.ts --timeout 30000`:26 tests passed。
19
+ - `bun test skills/multi-task-flow-runtime/tests/engine.test.ts skills/multi-task-flow-runtime/tests/orchestrate.test.ts --timeout 30000`:26 tests passed。
20
20
  - `bun check bin/modules/plan/contract.ts bin/modules/plan/review.ts bin/plan_review_view.ts bin/plan_contract_check.ts`:无类型错误。
21
21
  - `bun run bin/spec_contract_check.ts --path docs/specs/dev-plan-standalone-typescript-finalizer/SPEC.md`:通过。
22
22
  - `git diff --check`:通过。
@@ -43,7 +43,7 @@
43
43
 
44
44
  - REQ-ORCH-015:bootstrap 的 owner 通过 run 主线程解析;schema 完整账本校验、运行时生命周期/合并/收口、计划身份保护及 dashboard readiness 使用相同边界。legacy 字段默认 regular/group,不自动转换历史运行;当前未提供 group 原地迁移命令。
45
45
 
46
- - 合成界面证据通过 `bun skills/multi-task-flow/scripts/demo-static.ts --bootstrap` 生成,仅修改展示 fixture,不转换真实账本。[交付单元类型展示](./assets/bootstrap-ownership.png) 对照首个 bootstrap 与后续 regular 卡片。
46
+ - 合成界面证据通过 `bun skills/multi-task-flow-runtime/scripts/demo-static.ts --bootstrap` 生成,仅修改展示 fixture,不转换真实账本。[交付单元类型展示](./assets/bootstrap-ownership.png) 对照首个 bootstrap 与后续 regular 卡片。
47
47
 
48
48
  - 交付单元卡片的耗时只显示数值,移除“交付单元用时”和“进行中”前缀;定时刷新沿用同一显示规则。
49
49
 
@@ -67,7 +67,7 @@
67
67
  - Ledger publication verifies the published directory identity, binds parent-directory fsync to the directory opened for rename, retains a published run when parent-directory durability is uncertain, cleans only the verified staging or published inode, and uses an existing ledger lock without recreating a missing lock file. Ledger reads and writes also bind the run, lock directory, and lock-file identities across the operation.
68
68
  - Local tests cover graph scheduling, concurrent persistence, interruption recovery, operation coordination and dashboard endpoints. The legacy flow remains separate.
69
69
  - The committed example models two groups, a dynamic cut and group-owned post-merge tasks. Group and task details expose their requirements documents and real Codex conversation links; project and PR records are display-only fixture data.
70
- - The dashboard can serve a live ledger through its token-protected loopback service. `scripts/serve.ts` atomically claims the inspected empty-PID lease under the registry lock, rejects an existing owner or already-listening duplicate, binds the listener while that claim is held, records its own PID and optional host-provided session ID only after the listener is confirmed, retains the cleanup handle from the bind callback, immediately and periodically heartbeats the service lease with the recorded port and expected PID, and releases only that service lease on shutdown or failed startup persistence. The registry keeps `pid` as the value to record and `expected-pid` as the ownership guard, so an empty PID can be bound during first claim while a replaced lease remains protected. The static example is a disconnected snapshot; native conversation navigation evidence is recorded separately in `skills/multi-task-flow/examples/orchestration-viewer/link-verification.json`.
70
+ - The installed user service owns the loopback gateway, leases, PID/generation fencing and worker lifecycle; the former foreground viewer launcher is not part of the runtime.
71
71
  - The Agent/host remains responsible for creating and retaining a real Codex native background session. The Skill does not infer one from a PID, visible terminal or foreground exec; without a supported host route, the service is valid only for same-turn live verification.
72
72
  - 账本合同新增 `contract_version`、`execution_plan_id`、计划生命周期/修订元数据、任务处置和迁移身份,同时保持存储 `schema_version` 不变。当前写入器使用 `schema_version=2`/`contract_version=2`;schema 1 或 contract 1 只读快照必须通过显式 `migrate` 才能写入,旧快照只在缺少新字段时于读取阶段做确定性归一化。
73
73
  - `Group.atoms`、`Group.coordination_execution` 与 `group-atom-update`/`group-execution-update` 独立于 `Task.atoms` 实现;计划投影按选定计划的稳定 ID 和归属关联执行事实。卡片、详情和预览只投影交付单元自己的原子进度,等待贡献任务使用非旋转沙漏动画,依赖详情复用可访问 tooltip。
@@ -83,7 +83,7 @@
83
83
  - 桌面实时接管必须由当前候选真实 CLI 创建、退出、原生消息回执和主人确认共同证明,不能用源码测试或历史冒烟替代。
84
84
 
85
85
  - The dashboard emits the canonical native `codex://threads/<thread_id>` links without forcing a new browser window, matching the working local dashboard pattern. The current candidate records one native-navigation observation for each fixture ID; the evidence is reused for this candidate and is not re-run by ordinary checks. This does not claim to prove host-specific browser click bridging, which is outside the Skill gate.
86
- - Responsive width acceptance is exercised through the real-browser runner in `skills/multi-task-flow/tests/browser/card-width-regression.mjs`, covering board/grid layouts, detail toggles, cross-layout outer widths, fixed inspector limits and maximal task-column allocation at five medium viewport widths. Local DOM/source tests cover detail interaction and URL serialization; the owner-confirmed mock-demo evidence is recorded in the Spec.
86
+ - Responsive width acceptance is exercised through the real-browser runner in `skills/multi-task-flow-runtime/tests/browser/card-width-regression.mjs`, covering board/grid layouts, detail toggles, cross-layout outer widths, fixed inspector limits and maximal task-column allocation at five medium viewport widths. Local DOM/source tests cover detail interaction and URL serialization; the owner-confirmed mock-demo evidence is recorded in the Spec.
87
87
 
88
88
  ## References
89
89
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## 1. 根对象
4
4
 
5
- 账本根对象类型为 `Ledger`,对应 `skills/multi-task-flow/lib/schema.ts` 中的 `ledgerSchema`。一个运行只有一个根对象;所有计划、任务、操作、事实和事件都从该对象的数组字段进入账本。
5
+ 账本根对象类型为 `Ledger`,对应 `skills/multi-task-flow-runtime/lib/schema.ts` 中的 `ledgerSchema`。一个运行只有一个根对象;所有计划、任务、操作、事实和事件都从该对象的数组字段进入账本。
6
6
 
7
7
  ```text
8
8
  Ledger
@@ -243,7 +243,7 @@ Ledger
243
243
 
244
244
  ## 9. 权威来源
245
245
 
246
- - 运行时 schema:`skills/multi-task-flow/lib/schema.ts`
247
- - 语义字段元数据:`skills/multi-task-flow/lib/contract.ts`
248
- - 持久化实现:`skills/multi-task-flow/lib/store.ts`
246
+ - 运行时 schema:`skills/multi-task-flow-runtime/lib/schema.ts`
247
+ - 语义字段元数据:`skills/multi-task-flow-runtime/lib/contract.ts`
248
+ - 持久化实现:`skills/multi-task-flow-runtime/lib/store.ts`
249
249
  - 结构约束:[`SCHEMA-CONSTRAINTS.md`](./SCHEMA-CONSTRAINTS.md)
@@ -37,8 +37,6 @@
37
37
  - `skills/global-port-manager/SKILL.md`
38
38
  - `skills/storybook-stories/SKILL.md`
39
39
  - `docs/solutions/workflow-issues/stable-preview-handoff-runtime.md`
40
- - `skills/multi-task-flow/scripts/serve.ts`
41
- - `skills/multi-task-flow/tests/serve.test.ts`
42
40
  - `bin/modules/workspace/port_registry.ts`
43
41
  - `bin/modules/workspace/port_registry_cli.ts`
44
42
  - `bin/tests/workspace/workspace.test.ts`
@@ -144,7 +144,6 @@ None
144
144
  ### Testing
145
145
 
146
146
  - `bun test skills/global-port-manager/scripts/test_port_registry.ts`
147
- - `bun test skills/multi-task-flow/tests/serve.test.ts`
148
147
  - `git diff --check`
149
148
 
150
149
  ### Quality checks