@namewta/speculo 0.8.6 → 0.8.8

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 (98) hide show
  1. package/dist/src/structured.js +8 -4
  2. package/dist/src/structured.js.map +1 -1
  3. package/package.json +1 -1
  4. package/template/canonical/canonical-specdev-goal-plan.md +67 -20
  5. package/template/canonical/canonical-specdev-grill-with-docs.md +17 -9
  6. package/template/canonical/canonical-specdev-orchestrate-implementation.md +2784 -0
  7. package/template/canonical/canonical-specdev-spec.md +19 -9
  8. package/template/canonical/canonical-specdev-tickets.md +58 -16
  9. package/template/canonical/canonical-specdev-wayfinder.md +11 -11
  10. package/template/workflows/specdev/A-archive-and-consolidate/A-archive-and-consolidate.md +1 -1
  11. package/template/workflows/specdev/I-implement/I-implement.md +10 -5
  12. package/template/workflows/specdev/I-implement/execution-preflight.md +2 -0
  13. package/template/workflows/specdev/I-init-setup/I-init-setup.md +1 -1
  14. package/template/workflows/specdev/I-init-setup/config-template.json +2 -2
  15. package/template/workflows/specdev/O-orchestrate-implementation/O-orchestrate-implementation.md +129 -0
  16. package/template/workflows/specdev/O-orchestrate-implementation/conflict-and-drift.md +18 -0
  17. package/template/workflows/specdev/O-orchestrate-implementation/execution-loop.md +30 -0
  18. package/template/workflows/specdev/O-orchestrate-implementation/implementation-evidence-template.md +39 -0
  19. package/template/workflows/specdev/O-orchestrate-implementation/implementation-map-template.md +50 -0
  20. package/template/workflows/specdev/O-orchestrate-implementation/implementation-plan-template.md +61 -0
  21. package/template/workflows/specdev/O-orchestrate-implementation/input-readiness.md +25 -0
  22. package/template/workflows/specdev/O-orchestrate-implementation/super-dag.md +27 -0
  23. package/template/workflows/specdev/P-goal-plan/planning-modes.md +1 -1
  24. package/template/workflows/specdev/P-prototype/P-prototype.md +30 -26
  25. package/template/workflows/specdev/P-prototype/design-library/INDEX.md +43 -0
  26. package/template/workflows/specdev/P-prototype/design-library/color-and-theme.md +65 -0
  27. package/template/workflows/specdev/P-prototype/design-library/foundations.md +66 -0
  28. package/template/workflows/specdev/P-prototype/design-library/interaction-patterns.md +61 -0
  29. package/template/workflows/specdev/P-prototype/design-library/product-pattern-index.md +73 -0
  30. package/template/workflows/specdev/P-prototype/design-library/research-provenance.md +54 -0
  31. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/METHODOLOGY.md +90 -0
  32. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/README.md +31 -0
  33. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/data/extended-projects.json +241 -0
  34. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/data/projects.json +253 -0
  35. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/reference/USAGE.md +40 -0
  36. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/reference/design-tokens.css +145 -0
  37. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/report/OPEN_SOURCE_UI_RESEARCH_2026.md +519 -0
  38. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/research/PROJECT_TEMPLATE.md +29 -0
  39. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/research/README.md +9 -0
  40. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/research/claude-code-modern-clients.md +407 -0
  41. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/research/creative-ai-communication.md +574 -0
  42. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/research/data-dev-tools.md +432 -0
  43. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/research/personal-multiplatform-apps.md +185 -0
  44. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/research/productivity-collaboration.md +398 -0
  45. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/01-dense-ide.html +68 -0
  46. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/02-monochrome-console.html +18 -0
  47. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/03-soft-personal-ai.html +17 -0
  48. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/04-responsive-web.html +14 -0
  49. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/05-mobile-supervisor.html +16 -0
  50. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/06-cross-platform-workspace.html +17 -0
  51. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/07-local-first-content.html +9 -0
  52. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/08-media-first.html +17 -0
  53. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/README.md +49 -0
  54. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/assets/ATTRIBUTION.md +9 -0
  55. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/assets/landscape.jpg +0 -0
  56. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/assets/lucide.js +20494 -0
  57. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/assets/mountain.jpg +0 -0
  58. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/assets/workspace.jpg +0 -0
  59. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/index.html +70 -0
  60. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/package-lock.json +78 -0
  61. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/package.json +12 -0
  62. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/screenshots/index-desktop.png +0 -0
  63. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/scripts/gallery.js +134 -0
  64. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/styles/base.css +795 -0
  65. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/styles/pages.css +533 -0
  66. package/template/workflows/specdev/P-prototype/design-library/research-snapshot/ui-gallery/tests/gallery.spec.js +56 -0
  67. package/template/workflows/specdev/P-prototype/design-library/responsive-and-platforms.md +53 -0
  68. package/template/workflows/specdev/P-prototype/design-library/style-index.md +32 -0
  69. package/template/workflows/specdev/P-prototype/design-package.schema.json +70 -0
  70. package/template/workflows/specdev/P-prototype/design-system-template.md +366 -0
  71. package/template/workflows/specdev/P-prototype/detect-existing-style.md +53 -0
  72. package/template/workflows/specdev/P-prototype/generate-design-package.md +50 -0
  73. package/template/workflows/specdev/P-prototype/style-selection-protocol.md +41 -0
  74. package/template/workflows/specdev/P-prototype/tools/materialize-prototype.mjs +126 -0
  75. package/template/workflows/specdev/P-prototype/tools/validate-design-package.mjs +155 -0
  76. package/template/workflows/specdev/README.md +28 -15
  77. package/template/workflows/specdev/T-triage/T-triage.md +1 -1
  78. package/template/workflows/specdev/W-wayfinder/W-wayfinder.md +2 -2
  79. package/template/workflows/specdev/W-wayfinder/local-tracker-contract.md +3 -4
  80. package/template/workflows/specdev/common/README.md +6 -3
  81. package/template/workflows/specdev/common/rules/artifact-contract.md +9 -3
  82. package/template/workflows/specdev/common/rules/change-completion.md +3 -0
  83. package/template/workflows/specdev/common/rules/deviation-control.md +2 -0
  84. package/template/workflows/specdev/common/rules/evidence-and-verification.md +2 -0
  85. package/template/workflows/specdev/common/rules/parent-implementation-orchestration.md +27 -0
  86. package/template/workflows/specdev/common/rules/path-ownership.md +3 -1
  87. package/template/workflows/specdev/common/schemas/config.schema.json +4 -4
  88. package/template/workflows/specdev/common/schemas/implementation-map.schema.json +40 -0
  89. package/template/workflows/specdev/common/schemas/implementation-plan.schema.json +44 -0
  90. package/template/workflows/specdev/common/skills/dev-worktree/SKILL.md +4 -4
  91. package/template/workflows/specdev/common/skills/dev-worktree/references/create.md +1 -3
  92. package/template/workflows/specdev/common/skills/subagent-delivery/SKILL.md +5 -3
  93. package/template/workflows/specdev/common/tools/README.md +2 -2
  94. package/template/workflows/specdev/common/tools/validate-specdev.mjs +572 -30
  95. package/template/workflows/specdev/P-prototype/logic-prototype.md +0 -24
  96. package/template/workflows/specdev/P-prototype/prototype-record-template.md +0 -46
  97. package/template/workflows/specdev/P-prototype/ui-prototype.md +0 -21
  98. package/template/workflows/specdev/common/schemas/prototype-record.schema.json +0 -24
@@ -365,15 +365,20 @@ SpecDev 通过分层工件避免同一决策被多个模型反复重做。每个
365
365
  | Ticket | `specdev/changes/{change}/ticket/NN-<ticket-name>.md` | 单一垂直切片的行为、决策、范围、路径所有权、执行路线和验证证据 | 跨 Ticket 里程碑治理 |
366
366
  | Tickets Map | `specdev/changes/{change}/tickets-map.md` | 依赖 DAG、合同覆盖、Ready 投影、并行候选和路径冲突 | 单 Ticket 的完整实现契约 |
367
367
  | Goal Plan | `specdev/changes/{change}/goal-plan.md` | 跨 Ticket 调度、Gate、共享所有权、迁移顺序、集成和偏差治理 | 复制 Ticket 全文 |
368
+ | Implementation Map | `specdev/changes/{change}/implementation-map.md` | Ready 成员、组合 Ticket inventory、跨 change dependency/serialization 与 revision | 创建或改写子 Spec、Ticket 或实现细节 |
369
+ | Implementation Plan | `specdev/changes/{change}/implementation-plan.md` | 父 Lead、全局 workspace/实现上限、frontier/Wave/locks/integration queue 和可恢复进度投影 | 改写子 change 权威或伪造完成 |
370
+ | Implementation Orchestration Evidence | `specdev/changes/{change}/evidence/implementation-orchestration.md` | 成员完成、组合 Ticket 顺序/锁、repository integration、整体验证、漂移和残余风险 | 新产品/架构决定或单 Ticket Evidence 替代品 |
368
371
  | Evidence | `specdev/changes/{change}/evidence/T-NN.md` | 实际修改、命令、结果、验收映射、偏差、风险和提交引用 | 新的产品或架构决策 |
369
372
  | 代码审查 | `specdev/changes/{change}/reviews/CR-###.md` | 固定点、标准轴和规范轴 finding | 实施修复或合并两轴排名 |
370
- | 原型记录 | `specdev/changes/{change}/prototypes/{prototype-id}/record.md` | 一个问题、分支、资产、答案、promotion 和清理 | 生产实现或多个问题的计划 |
373
+ | UI 设计包 | `specdev/changes/{change}/prototypes/{design-id}/design-system.md`、`specdev/changes/{change}/prototypes/{design-id}/comparison/` 与 `specdev/changes/{change}/prototypes/{design-id}/final/` | 项目 UI 证据、功能风格候选、逐层用户决定、设计 token、交互合同和可运行 HTML/CSS/JS 投影 | 生产 UI 实现或替用户确认高影响偏好 |
371
374
  | Stakeholder 问卷 | `specdev/changes/{change}/questionnaires/{slug}.md` | 第三方原始回答和恢复条件 | 未经转录确认的产品/架构决定 |
372
375
  | Wayfinder 地图 | `specdev/changes/{change}/wayfinder-map.md` | 目的地、说明、已关闭决策索引、战争迷雾和范围之外 | 开放 Ticket 正文或答案详情 |
373
376
  | Wayfinder Ticket | `specdev/changes/{change}/investigation/{investigation-id}.md` | 一个可精确陈述的问题、类型、阻塞和关闭状态 | 解决方案评论或交付目标 |
374
377
  | Wayfinder solution comment | `specdev/changes/{change}/investigation/comments/{investigation-id}/NN-solution.md` | Ticket 的答案、结果事实和资产指针 | 地图索引或产品实现 |
375
378
  | 架构审查 | `specdev/changes/{change}/architecture-review.md` 与 `specdev/changes/{change}/architecture-review.html` | 深化候选、证据、可视化、选择和访谈状态 | 未经用户选择的执行契约 |
376
379
 
380
+ UI 设计包中的 `{design-id}` 由 P-prototype 分配为当前 change 内最小未占用的 `UI-NNN`;设计系统文档是唯一设计权威,comparison 与 final 不建立第二套规则。
381
+
377
382
  Change CONTEXT/ADR 是 active change 内的执行权威,不是 workflow 级永久知识。G 和其他设计/执行 Works 只读 `specdev/context/` 与 `specdev/adr/`;只有 A 在 change 完成、实现证据验证、毕业评估和用户确认后才能写入永久 namespace。未毕业内容随归档 change 保留,不能从 change 工件消失。
378
383
 
379
384
  ## 2. 权威顺序
@@ -386,8 +391,9 @@ Change CONTEXT/ADR 是 active change 内的执行权威,不是 workflow 级永
386
391
  4. 当前外部行为权威:`specdev/changes/{change}/spec.md`;
387
392
  5. 当前 Ticket 契约:`specdev/changes/{change}/ticket/NN-<ticket-name>.md`;
388
393
  6. 当前跨 Ticket 编排:`specdev/changes/{change}/goal-plan.md`;
389
- 7. 当前代码与运行事实;
390
- 8. 旧计划、旧日志和未经确认的推断。
394
+ 7. 若当前 change 属于父实现 change,父 Implementation Map 对组合 Ticket dependency/serialization 具有权威,父 Implementation Plan 拥有全局 workspace、frontier 与 integration queue;
395
+ 8. 当前代码与运行事实;
396
+ 9. 旧计划、旧日志和未经确认的推断。
391
397
 
392
398
  当前 change 决定与永久知识冲突时,必须在 LOG/ADR 中显式说明替代关系;它只约束当前 change,直到 A 决定是否提升并更新永久版本。
393
399
 
@@ -532,6 +538,8 @@ required Ticket Done 必须有 source commit、通过 candidate、父分支 resu
532
538
 
533
539
  Direct Spec Evidence 至少包含:用户批准与轻量合同、Lead、实施前/最终 checkpoint、实际路径、定向/回归/E2E 命令及环境、验收映射、未运行项、偏差、残余风险和提交授权状态。
534
540
 
541
+ 父实现 change 的 Implementation Orchestration Evidence 不能替代子 Evidence。它至少记录最终 Map revision、全部成员最终状态和子证据指针、dependency/serialization 实际顺序、跨 change 合同检查、aggregate 命令/环境/结果、stale candidate 处理、偏差和残余风险。任何成员未 completed 或整体验证未通过时不得形成父完成证据。
542
+
535
543
  </evidence-and-verification>
536
544
 
537
545
  <deviation-control>
@@ -559,6 +567,7 @@ Direct Spec Evidence 至少包含:用户批准与轻量合同、Lead、实施
559
567
  - 发现新的安全、数据、兼容、性能或迁移风险;
560
568
  - 依赖、合同或外部参考权威已变化;
561
569
  - 实际行为将与 Spec 或 ADR 不一致。
570
+ - 父 Implementation Map 的成员、组合 Ticket、dependency、serialization 或 revision 已与子状态、路径或 Git 事实不一致。
562
571
 
563
572
  ## 3. 偏差记录
564
573
 
@@ -579,6 +588,7 @@ Direct Spec Evidence 至少包含:用户批准与轻量合同、Lead、实施
579
588
  - 未批准的 ticket、spec、architecture 或 release 偏差不得继续实现。
580
589
  - 不得通过扩大 `writable_paths`、删除测试、降低断言或把风险改写成“已知限制”来绕过停止。
581
590
  - 偏差影响并行执行、source checkpoint 或 candidate 集成时,Lead 必须暂停受影响 Wave,重新计算路径所有权、依赖、Gate 与父分支顺序;任何 subagent 都不能自行改写上层合同。
591
+ - 偏差跨越多个成员时,父 Lead 先递增 Implementation Map revision,再重算 Implementation Plan;旧派单和 candidate 全部标记 stale。
582
592
 
583
593
  </deviation-control>
584
594
 
@@ -663,8 +673,8 @@ Direct Spec Evidence 至少包含:用户批准与轻量合同、Lead、实施
663
673
  "default_depth": "standard",
664
674
  "require_ready_gate": true,
665
675
  "require_evidence": true,
666
- "ui_prototype_default_variants": 3,
667
- "ui_prototype_max_variants": 5
676
+ "ui_design_default_candidates": 3,
677
+ "ui_design_max_candidates": 4
668
678
  }
669
679
  }
670
680
  ```
@@ -716,19 +726,19 @@ Direct Spec Evidence 至少包含:用户批准与轻量合同、Lead、实施
716
726
  },
717
727
  "planning": {
718
728
  "type": "object",
719
- "required": ["default_depth", "require_ready_gate", "require_evidence", "ui_prototype_default_variants", "ui_prototype_max_variants"],
729
+ "required": ["default_depth", "require_ready_gate", "require_evidence", "ui_design_default_candidates", "ui_design_max_candidates"],
720
730
  "properties": {
721
731
  "default_depth": {"enum": ["lite", "standard", "deep"]},
722
732
  "require_ready_gate": {"type": "boolean"},
723
733
  "require_evidence": {"type": "boolean"},
724
- "ui_prototype_default_variants": {"type": "integer", "minimum": 1},
725
- "ui_prototype_max_variants": {"type": "integer", "minimum": 1}
734
+ "ui_design_default_candidates": {"type": "integer", "minimum": 2, "maximum": 4},
735
+ "ui_design_max_candidates": {"type": "integer", "minimum": 2, "maximum": 4}
726
736
  },
727
737
  "additionalProperties": true
728
738
  }
729
739
  },
730
740
  "allOf": [{
731
- "$comment": "ui_prototype_default_variants <= ui_prototype_max_variants is enforced by validate-specdev.mjs because JSON Schema cannot compare sibling numeric values."
741
+ "$comment": "ui_design_default_candidates <= ui_design_max_candidates is enforced by validate-specdev.mjs because JSON Schema cannot compare sibling numeric values."
732
742
  }],
733
743
  "additionalProperties": false
734
744
  }
@@ -652,15 +652,20 @@ SpecDev 通过分层工件避免同一决策被多个模型反复重做。每个
652
652
  | Ticket | `specdev/changes/{change}/ticket/NN-<ticket-name>.md` | 单一垂直切片的行为、决策、范围、路径所有权、执行路线和验证证据 | 跨 Ticket 里程碑治理 |
653
653
  | Tickets Map | `specdev/changes/{change}/tickets-map.md` | 依赖 DAG、合同覆盖、Ready 投影、并行候选和路径冲突 | 单 Ticket 的完整实现契约 |
654
654
  | Goal Plan | `specdev/changes/{change}/goal-plan.md` | 跨 Ticket 调度、Gate、共享所有权、迁移顺序、集成和偏差治理 | 复制 Ticket 全文 |
655
+ | Implementation Map | `specdev/changes/{change}/implementation-map.md` | Ready 成员、组合 Ticket inventory、跨 change dependency/serialization 与 revision | 创建或改写子 Spec、Ticket 或实现细节 |
656
+ | Implementation Plan | `specdev/changes/{change}/implementation-plan.md` | 父 Lead、全局 workspace/实现上限、frontier/Wave/locks/integration queue 和可恢复进度投影 | 改写子 change 权威或伪造完成 |
657
+ | Implementation Orchestration Evidence | `specdev/changes/{change}/evidence/implementation-orchestration.md` | 成员完成、组合 Ticket 顺序/锁、repository integration、整体验证、漂移和残余风险 | 新产品/架构决定或单 Ticket Evidence 替代品 |
655
658
  | Evidence | `specdev/changes/{change}/evidence/T-NN.md` | 实际修改、命令、结果、验收映射、偏差、风险和提交引用 | 新的产品或架构决策 |
656
659
  | 代码审查 | `specdev/changes/{change}/reviews/CR-###.md` | 固定点、标准轴和规范轴 finding | 实施修复或合并两轴排名 |
657
- | 原型记录 | `specdev/changes/{change}/prototypes/{prototype-id}/record.md` | 一个问题、分支、资产、答案、promotion 和清理 | 生产实现或多个问题的计划 |
660
+ | UI 设计包 | `specdev/changes/{change}/prototypes/{design-id}/design-system.md`、`specdev/changes/{change}/prototypes/{design-id}/comparison/` 与 `specdev/changes/{change}/prototypes/{design-id}/final/` | 项目 UI 证据、功能风格候选、逐层用户决定、设计 token、交互合同和可运行 HTML/CSS/JS 投影 | 生产 UI 实现或替用户确认高影响偏好 |
658
661
  | Stakeholder 问卷 | `specdev/changes/{change}/questionnaires/{slug}.md` | 第三方原始回答和恢复条件 | 未经转录确认的产品/架构决定 |
659
662
  | Wayfinder 地图 | `specdev/changes/{change}/wayfinder-map.md` | 目的地、说明、已关闭决策索引、战争迷雾和范围之外 | 开放 Ticket 正文或答案详情 |
660
663
  | Wayfinder Ticket | `specdev/changes/{change}/investigation/{investigation-id}.md` | 一个可精确陈述的问题、类型、阻塞和关闭状态 | 解决方案评论或交付目标 |
661
664
  | Wayfinder solution comment | `specdev/changes/{change}/investigation/comments/{investigation-id}/NN-solution.md` | Ticket 的答案、结果事实和资产指针 | 地图索引或产品实现 |
662
665
  | 架构审查 | `specdev/changes/{change}/architecture-review.md` 与 `specdev/changes/{change}/architecture-review.html` | 深化候选、证据、可视化、选择和访谈状态 | 未经用户选择的执行契约 |
663
666
 
667
+ UI 设计包中的 `{design-id}` 由 P-prototype 分配为当前 change 内最小未占用的 `UI-NNN`;设计系统文档是唯一设计权威,comparison 与 final 不建立第二套规则。
668
+
664
669
  Change CONTEXT/ADR 是 active change 内的执行权威,不是 workflow 级永久知识。G 和其他设计/执行 Works 只读 `specdev/context/` 与 `specdev/adr/`;只有 A 在 change 完成、实现证据验证、毕业评估和用户确认后才能写入永久 namespace。未毕业内容随归档 change 保留,不能从 change 工件消失。
665
670
 
666
671
  ## 2. 权威顺序
@@ -673,8 +678,9 @@ Change CONTEXT/ADR 是 active change 内的执行权威,不是 workflow 级永
673
678
  4. 当前外部行为权威:`specdev/changes/{change}/spec.md`;
674
679
  5. 当前 Ticket 契约:`specdev/changes/{change}/ticket/NN-<ticket-name>.md`;
675
680
  6. 当前跨 Ticket 编排:`specdev/changes/{change}/goal-plan.md`;
676
- 7. 当前代码与运行事实;
677
- 8. 旧计划、旧日志和未经确认的推断。
681
+ 7. 若当前 change 属于父实现 change,父 Implementation Map 对组合 Ticket dependency/serialization 具有权威,父 Implementation Plan 拥有全局 workspace、frontier 与 integration queue;
682
+ 8. 当前代码与运行事实;
683
+ 9. 旧计划、旧日志和未经确认的推断。
678
684
 
679
685
  当前 change 决定与永久知识冲突时,必须在 LOG/ADR 中显式说明替代关系;它只约束当前 change,直到 A 决定是否提升并更新永久版本。
680
686
 
@@ -799,7 +805,9 @@ workspace/implementation owner 可以是 Lead 或动态 implementation subagent
799
805
 
800
806
  required 模式 implementation subagent 上限取 Goal Plan、config 和平台能力共同约束,Lead 不计入。current 模式保持单 writer 串行安全不变量,Ticket 严格串行。review/research/test-observation agent 不设置 SpecDev 数字上限,但 Lead 必须避免重复工作与可变环境争用。
801
807
 
802
- **完成标准**:每个项目写入映射到唯一 Ticket、owner 和来源 worktree;shared 与父分支写入 owner 唯一。
808
+ change 属于父 Implementation Map 时,再取父 Implementation Plan 的全局 implementation subagent 上限与 workspace 策略;该上限跨全部成员合计。无 dependency 的组合 Ready Tickets 若 writable/shared paths 重叠,也必须在父 Map 建立 serialization。相同 repository/ref 的 parent integration 严格串行;一次父 HEAD 推进会使其他成员旧 candidate 失效。
809
+
810
+ **完成标准**:每个项目写入映射到唯一 change、Ticket、owner 和来源 worktree;shared 与父分支写入 owner 唯一。
803
811
 
804
812
  </path-ownership>
805
813
 
@@ -857,6 +865,8 @@ required Ticket Done 必须有 source commit、通过 candidate、父分支 resu
857
865
 
858
866
  Direct Spec Evidence 至少包含:用户批准与轻量合同、Lead、实施前/最终 checkpoint、实际路径、定向/回归/E2E 命令及环境、验收映射、未运行项、偏差、残余风险和提交授权状态。
859
867
 
868
+ 父实现 change 的 Implementation Orchestration Evidence 不能替代子 Evidence。它至少记录最终 Map revision、全部成员最终状态和子证据指针、dependency/serialization 实际顺序、跨 change 合同检查、aggregate 命令/环境/结果、stale candidate 处理、偏差和残余风险。任何成员未 completed 或整体验证未通过时不得形成父完成证据。
869
+
860
870
  </evidence-and-verification>
861
871
 
862
872
  <deviation-control>
@@ -884,6 +894,7 @@ Direct Spec Evidence 至少包含:用户批准与轻量合同、Lead、实施
884
894
  - 发现新的安全、数据、兼容、性能或迁移风险;
885
895
  - 依赖、合同或外部参考权威已变化;
886
896
  - 实际行为将与 Spec 或 ADR 不一致。
897
+ - 父 Implementation Map 的成员、组合 Ticket、dependency、serialization 或 revision 已与子状态、路径或 Git 事实不一致。
887
898
 
888
899
  ## 3. 偏差记录
889
900
 
@@ -904,9 +915,42 @@ Direct Spec Evidence 至少包含:用户批准与轻量合同、Lead、实施
904
915
  - 未批准的 ticket、spec、architecture 或 release 偏差不得继续实现。
905
916
  - 不得通过扩大 `writable_paths`、删除测试、降低断言或把风险改写成“已知限制”来绕过停止。
906
917
  - 偏差影响并行执行、source checkpoint 或 candidate 集成时,Lead 必须暂停受影响 Wave,重新计算路径所有权、依赖、Gate 与父分支顺序;任何 subagent 都不能自行改写上层合同。
918
+ - 偏差跨越多个成员时,父 Lead 先递增 Implementation Map revision,再重算 Implementation Plan;旧派单和 candidate 全部标记 stale。
907
919
 
908
920
  </deviation-control>
909
921
 
922
+ <parent-implementation-orchestration>
923
+
924
+ # Parent Implementation Orchestration
925
+
926
+ 本规则只约束 Ready Spec/Tickets 之后的跨 change 实现,供 O-orchestrate-implementation、I-implement 与 A-archive-and-consolidate 读取。
927
+
928
+ ## 输入边界
929
+
930
+ 父实现 change 只能在所有成员通过 Ready Spec/Tickets 输入门后创建。父 Work 不调用或代行 Triage、Grill、Wayfinder、Spec、Tickets 或普通 Goal Plan;输入不足时不留下父状态或父工件。
931
+
932
+ ## 权威边界
933
+
934
+ - 父 Implementation Map:成员、组合 Ticket inventory、跨 change dependency/serialization 与 revision 的唯一权威投影。
935
+ - 父 Implementation Plan:Lead、全局 workspace 策略、implementation agent/integration attempt 上限、frontier、Wave、locks 和 integration queue 的唯一权威。
936
+ - 子 change:自己的 Spec、Ticket、内部 Goal Gate、workspace、Git、Evidence 和完成状态的唯一权威。
937
+
938
+ 父工件不得复制完整子合同。子权威变化时停止旧派单、递增父 Map revision 并重算父 Plan;不能从旧父投影覆盖子工件。
939
+
940
+ ## 唯一所有权
941
+
942
+ 一个 active/blocked 子 change 最多属于一个未完成父实现 change。v1 不支持父实现 change 嵌套。父 Lead 是父工件、全部 SpecDev 状态写入、E2E、repository/ref integration queue 和父分支推进的唯一 owner;implementation agent 只写授权项目 workspace。
943
+
944
+ ## I-implement 调用
945
+
946
+ 父 Plan 可以替代缺失的子 Goal Plan 提供 workspace/integration 策略和全局执行边界。子 Goal Plan 存在时继续拥有子 change 内 Gate,但不得与父策略冲突。I-implement 完成或阻塞一个组合 Ticket 后返回父 O Work,不要求用户重新激活 change。
947
+
948
+ ## 归档与完成
949
+
950
+ 未完成父实现 change 的成员不得归档。成员满足普通 change completion 时可以先 completed,但不自动归档。父 change 只有全部成员 completed、Map/Plan completed、aggregate Evidence 完整且无 active dispatch/candidate/lock 后才能 completed;完成或归档均不自动级联。
951
+
952
+ </parent-implementation-orchestration>
953
+
910
954
  <research>
911
955
 
912
956
  # SpecDev Research
@@ -966,12 +1010,12 @@ Direct Spec Evidence 至少包含:用户批准与轻量合同、Lead、实施
966
1010
 
967
1011
  # Dev Worktree
968
1012
 
969
- 本 Skill 由 T-tickets/P-goal-plan/I-implementP-prototype 复用。`purpose=ticket` 仅在 Goal Plan 选择 `required` 时使用完整 source → candidate → parent 状态机;`current` Ticket 不调用本 Skill。`purpose=prototype` 只使用调用方批准的临时生命周期。
1013
+ 本 Skill 由 T-ticketsP-goal-plan 和 I-implement 复用。仅在 Goal Plan 选择 `required` 时使用完整 source → candidate → parent 状态机;`current` Ticket 不调用本 Skill
970
1014
 
971
1015
  ## 输入
972
1016
 
973
1017
  - `operation=create | restore | finalize | remove`;
974
- - `purpose=ticket | prototype`;
1018
+ - `purpose=ticket`;
975
1019
  - repository、父分支、`base_sha`、branch、portable workspace locator;
976
1020
  - workspace、implementation 和 integration owner;
977
1021
  - 允许动作、路径合同、验证合同、调用方状态记录位置。
@@ -1000,7 +1044,7 @@ implementation owner 只在来源 worktree 修改授权项目路径,运行 Tic
1000
1044
 
1001
1045
  ## 4. 移除
1002
1046
 
1003
- `operation=remove` 先验证 Ticket 已 `integrated` 或 prototype 已结束、目标 worktree clean、checkpoint 可恢复且删除目标精确。只有明确 cleanup 授权时删除来源 branch/worktree;强制删除需要单独确认。删除后重读 `git worktree list` 与 refs,并只把调用方生命周期状态更新为 `removed`;`base_sha`、source checkpoint、candidate/result、验证、E2E 与 Evidence 字段必须原样保留。
1047
+ `operation=remove` 先验证 Ticket 已 `integrated`、目标 worktree clean、checkpoint 可恢复且删除目标精确。只有明确 cleanup 授权时删除来源 branch/worktree;强制删除需要单独确认。删除后重读 `git worktree list` 与 refs,并只把调用方生命周期状态更新为 `removed`;`base_sha`、source checkpoint、candidate/result、验证、E2E 与 Evidence 字段必须原样保留。
1004
1048
 
1005
1049
  **完成标准**:只删除精确授权目标;失败保留现场与恢复命令。
1006
1050
 
@@ -1026,14 +1070,12 @@ implementation owner 只在来源 worktree 修改授权项目路径,运行 Tic
1026
1070
  - `specdev-worktree/` 已由 Speculo init 加入项目 `.gitignore`;
1027
1071
  - 目标 branch/worktree 不覆盖现有用户 workspace,路径合同无冲突。
1028
1072
 
1029
- Prototype 只要求调用方已记录本次临时 branch/worktree 授权、问题、owner、locator 和清理策略;它不写 Ticket worktree 状态。
1030
-
1031
1073
  ## 创建 Ticket 来源 worktree
1032
1074
 
1033
1075
  1. 重读父分支 HEAD、工作树、现有 worktrees 与 refs;父 HEAD 与计划基线不一致时由 Lead决定更新 `base_sha` 或阻塞;
1034
1076
  2. 固定 branch `speculo/<change>/<ticket-id>` 与 locator `specdev-worktree/<ticket-id>`;
1035
1077
  3. 确认目标 branch/path 不存在,或其实际记录精确匹配当前 Ticket;
1036
- 4. 从 `base_sha` 创建 Git worktree,不复用其他 Ticket/原型目录;
1078
+ 4. 从 `base_sha` 创建 Git worktree,不复用其他 Ticket 目录;
1037
1079
  5. 在来源 worktree 读取项目 Agent 指令、依赖、构建与路径合同;
1038
1080
  6. 安装实际需要的依赖,运行最小非 E2E 基线;
1039
1081
  7. Lead 写入 `specdev/changes/{change}/.status.json`,状态为 `active`。
@@ -1194,8 +1236,8 @@ Prototype 只要求调用方已记录本次临时 branch/worktree 授权、问
1194
1236
  "default_depth": "standard",
1195
1237
  "require_ready_gate": true,
1196
1238
  "require_evidence": true,
1197
- "ui_prototype_default_variants": 3,
1198
- "ui_prototype_max_variants": 5
1239
+ "ui_design_default_candidates": 3,
1240
+ "ui_design_max_candidates": 4
1199
1241
  }
1200
1242
  }
1201
1243
  ```
@@ -1247,19 +1289,19 @@ Prototype 只要求调用方已记录本次临时 branch/worktree 授权、问
1247
1289
  },
1248
1290
  "planning": {
1249
1291
  "type": "object",
1250
- "required": ["default_depth", "require_ready_gate", "require_evidence", "ui_prototype_default_variants", "ui_prototype_max_variants"],
1292
+ "required": ["default_depth", "require_ready_gate", "require_evidence", "ui_design_default_candidates", "ui_design_max_candidates"],
1251
1293
  "properties": {
1252
1294
  "default_depth": {"enum": ["lite", "standard", "deep"]},
1253
1295
  "require_ready_gate": {"type": "boolean"},
1254
1296
  "require_evidence": {"type": "boolean"},
1255
- "ui_prototype_default_variants": {"type": "integer", "minimum": 1},
1256
- "ui_prototype_max_variants": {"type": "integer", "minimum": 1}
1297
+ "ui_design_default_candidates": {"type": "integer", "minimum": 2, "maximum": 4},
1298
+ "ui_design_max_candidates": {"type": "integer", "minimum": 2, "maximum": 4}
1257
1299
  },
1258
1300
  "additionalProperties": true
1259
1301
  }
1260
1302
  },
1261
1303
  "allOf": [{
1262
- "$comment": "ui_prototype_default_variants <= ui_prototype_max_variants is enforced by validate-specdev.mjs because JSON Schema cannot compare sibling numeric values."
1304
+ "$comment": "ui_design_default_candidates <= ui_design_max_candidates is enforced by validate-specdev.mjs because JSON Schema cannot compare sibling numeric values."
1263
1305
  }],
1264
1306
  "additionalProperties": false
1265
1307
  }
@@ -36,7 +36,7 @@ Wayfinder 默认进行**规划**:每个 Ticket 解决一个决策,当地图
36
36
  - 地图:`specdev/changes/{change}/wayfinder-map.md`
37
37
  - 子 Tickets:`specdev/changes/{change}/investigation/`
38
38
  - solution comments:`specdev/changes/{change}/investigation/comments/`
39
- - assignment registry:`specdev/status.json` 的 `claimed_investigations`
39
+ - assignment registry:`specdev/changes/{change}/.status.json` 的 `claimed_investigations`
40
40
 
41
41
  每次绘制或遍历前加载 下方 `<local-tracker-contract>` 标签。Ticket 和地图模板:
42
42
 
@@ -49,7 +49,7 @@ Wayfinder 默认进行**规划**:每个 Ticket 解决一个决策,当地图
49
49
  每个 Ticket 要么是 **HITL**,与一个代表自己发言的人类一起工作;要么是 **AFK**,由 Agent 独立驱动。HITL Ticket 只能通过实时交流解决,Agent 绝不代替人类一方发言。
50
50
 
51
51
  - **Research(AFK)**:阅读文档、第三方 API 或知识库等资源,揭示某个决策等待的事实。调用 下方 `<research>` 标签。当需要当前工作目录之外的知识时使用。
52
- - **Prototype(HITL)**:调用 “原型阶段” 回答一个 UI/逻辑问题,并把 record、临时 branch/worktree 和运行 URL 链接为 solution comment 资产;P 不实现目的地。
52
+ - **Prototype(HITL)**:调用 “原型阶段” 检测项目 UI、比较功能风格候选并逐步确认设计方向,把 `specdev/changes/{change}/prototypes/{design-id}/design-system.md` comparison locator 链接为 solution comment 资产;`{design-id}` 使用 P 返回的 `UI-NNN`,P 不实现目的地。
53
53
  - **Grilling(HITL)**:对话。调用 “设计访谈能力” 的 grilling 与 domain-modeling 能力,但本会话只关闭当前 Wayfinder Ticket。
54
54
  - **Task(HITL 或 AFK)**:在决策做出前必须完成的手动工作。它通过为决策解除阻塞赢得位置,不以交付目的地为目标。Agent 能独立驱动时使用 AFK,否则给人类精确清单。
55
55
 
@@ -211,7 +211,7 @@ status: active
211
211
  | 子 issue | `specdev/changes/{change}/investigation/{investigation-id}.md` |
212
212
  | label | Ticket frontmatter 的 `wayfinder:research|prototype|grilling|task` |
213
213
  | 阻塞关系 | Ticket frontmatter 的 `blocked_by` |
214
- | assignment | `specdev/status.json` 当前 change 的 `claimed_investigations` |
214
+ | assignment | `specdev/changes/{change}/.status.json` 的 `claimed_investigations` |
215
215
  | solution comment | `specdev/changes/{change}/investigation/comments/{investigation-id}/NN-solution.md` |
216
216
  | 关闭 issue | Ticket frontmatter 的 `status: closed` 与 `resolution` |
217
217
 
@@ -227,9 +227,9 @@ status: active
227
227
 
228
228
  ## 原子领取
229
229
 
230
- 开始任何工作前,重读全局状态并原子写入 `id`、`owner`、可选 `session` 和 `claimed_at`。已领取则选择下一前沿 Ticket。写回结果前再次重读;完成、释放或取消时删除 claim。
230
+ 开始任何工作前,重读当前 change 状态并原子写入 `id`、`owner`、可选 `session` 和 `claimed_at`。已领取则选择下一前沿 Ticket。写回结果前再次重读;完成、释放或取消时删除 claim。
231
231
 
232
- Ticket 文件不重复保存 assignee,地图不重复保存 claim。全局 assignment registry 是领取的单一事实源。
232
+ Ticket 文件不重复保存 assignee,地图不重复保存 claim。change assignment registry 是领取的单一事实源。
233
233
 
234
234
  ## 解决方案评论
235
235
 
@@ -346,8 +346,8 @@ resolution: answered
346
346
  "default_depth": "standard",
347
347
  "require_ready_gate": true,
348
348
  "require_evidence": true,
349
- "ui_prototype_default_variants": 3,
350
- "ui_prototype_max_variants": 5
349
+ "ui_design_default_candidates": 3,
350
+ "ui_design_max_candidates": 4
351
351
  }
352
352
  }
353
353
  ```
@@ -399,19 +399,19 @@ resolution: answered
399
399
  },
400
400
  "planning": {
401
401
  "type": "object",
402
- "required": ["default_depth", "require_ready_gate", "require_evidence", "ui_prototype_default_variants", "ui_prototype_max_variants"],
402
+ "required": ["default_depth", "require_ready_gate", "require_evidence", "ui_design_default_candidates", "ui_design_max_candidates"],
403
403
  "properties": {
404
404
  "default_depth": {"enum": ["lite", "standard", "deep"]},
405
405
  "require_ready_gate": {"type": "boolean"},
406
406
  "require_evidence": {"type": "boolean"},
407
- "ui_prototype_default_variants": {"type": "integer", "minimum": 1},
408
- "ui_prototype_max_variants": {"type": "integer", "minimum": 1}
407
+ "ui_design_default_candidates": {"type": "integer", "minimum": 2, "maximum": 4},
408
+ "ui_design_max_candidates": {"type": "integer", "minimum": 2, "maximum": 4}
409
409
  },
410
410
  "additionalProperties": true
411
411
  }
412
412
  },
413
413
  "allOf": [{
414
- "$comment": "ui_prototype_default_variants <= ui_prototype_max_variants is enforced by validate-specdev.mjs because JSON Schema cannot compare sibling numeric values."
414
+ "$comment": "ui_design_default_candidates <= ui_design_max_candidates is enforced by validate-specdev.mjs because JSON Schema cannot compare sibling numeric values."
415
415
  }],
416
416
  "additionalProperties": false
417
417
  }
@@ -23,7 +23,7 @@ A 是 SpecDev 的归档 wrapper:它拥有模式选择、SpecDev 完成门和
23
23
  ## Archive 模式
24
24
 
25
25
  1. 读取全局/change 状态、Ticket、Map、Goal Plan、Evidence、ADR、CONTEXT、LOG、triage 和项目验证事实。
26
- 2. 加载 `<Path>{roots.workflows}/specdev/common/rules/change-completion.md</Path>`,确认 `change_status: completed`、完成 owner 已写入时间和证据、无 blocker/deviation
26
+ 2. 加载 `<Path>{roots.workflows}/specdev/common/rules/change-completion.md</Path>` 与 `<Path>{roots.workflows}/specdev/common/rules/parent-implementation-orchestration.md</Path>`,确认 `change_status: completed`、完成 owner 已写入时间和证据、无 blocker/deviation;若该 change 是未完成父实现 change 的成员则停止,若其自身是父实现 change 则还需所有成员与 aggregate Evidence 完成。
27
27
  3. 检查 `<Path>{roots.state}/specdev/changes/{change}/triage.md</Path>` 的 `external_action`:`pending-close` 或 `close-failed` 返回 `<Path>{roots.workflows}/specdev/T-triage/T-triage.md</Path>`;只有 `closed | waived | not-applicable` 继续。
28
28
  4. 调用 `<Path>{roots.skills}/archive-and-consolidate/SKILL.md</Path>` 的 `archive-single + dry-run`,传入已解析 workflow/state/changes/archive/knowledge roots。展示完整移动、提升和清理计划。
29
29
  5. 只有用户明确批准该计划后调用 `confirmed`。移动、知识写入和清理均使用计划内路径;计划后出现 drift 时停止。
@@ -11,13 +11,15 @@ keywords: [实现, TDD, Lead, subagent, worktree, current workspace, direct-pare
11
11
 
12
12
  > 激活本 Work 后,先读取 `<Path>{roots.workflows}/specdev/README.md</Path>`,再执行本入口。
13
13
 
14
- 本 work 保留模块设计检查、design-it-twice、TDD 红绿循环、双轴审查和证据治理。Ticket 模式按 Goal Plan 的 `ticket_workspace_policy` 选择 current workspace 串行直接父分支或独立 worktree candidate-merge;Lead 根据实际情况自行实现或动态派单。
14
+ 本 work 保留模块设计检查、design-it-twice、TDD 红绿循环、双轴审查和证据治理。Ticket 模式按子 Goal Plan 或父 Implementation Plan 的 `ticket_workspace_policy` 选择 current workspace 串行直接父分支或独立 worktree candidate-merge;Lead 根据实际情况自行实现或动态派单。
15
+
16
+ 若当前 change 是未完成父 Implementation Map 的成员,必须读取 `<Path>{roots.workflows}/specdev/common/rules/parent-implementation-orchestration.md</Path>`、父 Map 与父 Plan。父 Plan 提供跨 change dependency/serialization、全局 workspace 策略、组合派单标识、implementation agent cap 和 integration queue;子 Goal Plan 只能增加子内 Gate,不能放宽或冲突。
15
17
 
16
18
  ## 执行模式
17
19
 
18
20
  ### Ticket 模式(默认)
19
21
 
20
- 读取 Ready Ticket、Tickets Map 和可选 Goal Plan。存在 Goal Plan 时使用其中的 Lead workspace 策略;没有 Goal Plan 时,当前主会话作为该 Ticket 的 Lead,并按 Direct Spec 规则执行,不推断 worktree 策略。`required` 模式每个 Ticket 建立独立 worktree;`current` 模式所有 Ticket 严格串行,使用当前分支和当前 workspace。
22
+ 读取 Ready Ticket、Tickets Map、可选子 Goal Plan 和可选父 Implementation Plan。存在父 Plan 时使用其 Lead、workspace/integration 策略和全局门,即使子 Goal Plan 不存在也可以执行;两者都存在时必须策略一致。没有父 Plan 时沿用子 Goal Plan;两者都不存在时,当前主会话作为该 Ticket 的 Lead,并按 Direct Spec 规则执行,不推断 worktree 策略。`required` 模式每个 Ticket 建立独立 worktree;`current` 模式所有受同一计划约束的 Ticket 严格串行,使用当前分支和当前 workspace。
21
23
 
22
24
  ### Direct Spec 模式
23
25
 
@@ -30,7 +32,7 @@ keywords: [实现, TDD, Lead, subagent, worktree, current workspace, direct-pare
30
32
  - 当前 Spec:`<Path>{roots.state}/specdev/changes/{change}/spec.md</Path>`
31
33
  - 项目配置:`<Path>{roots.state}/specdev/config.json</Path>`
32
34
 
33
- Ticket 模式还必须读取当前 Ticket `<Path>{roots.state}/specdev/changes/{change}/ticket/{ticket-file}.md</Path>` 与 `<Path>{roots.state}/specdev/changes/{change}/tickets-map.md</Path>`;存在 `<Path>{roots.state}/specdev/changes/{change}/goal-plan.md</Path>` 时必须读取。Direct Spec 模式必须读取用户对轻量执行合同和直接实现的明确批准。
35
+ Ticket 模式还必须读取当前 Ticket `<Path>{roots.state}/specdev/changes/{change}/ticket/{ticket-file}.md</Path>` 与 `<Path>{roots.state}/specdev/changes/{change}/tickets-map.md</Path>`;存在 `<Path>{roots.state}/specdev/changes/{change}/goal-plan.md</Path>` 时必须读取。若当前 change 被父 Implementation Map 声明,还必须读取该父 change 的 Map/Plan。Direct Spec 模式必须读取用户对轻量执行合同和直接实现的明确批准。
34
36
 
35
37
  按存在情况读取:
36
38
 
@@ -54,7 +56,7 @@ Git 已处于 merge/rebase 冲突时,先加载 `<Path>{roots.workflows}/specde
54
56
  Ticket 模式:
55
57
 
56
58
  1. 验证 Ready、依赖 Evidence、Spec/ADR/Goal Plan、一致性、路径 owner 和验证接缝;
57
- 2. 确认 Goal Plan schema v6(若存在)、Lead、动态 implementation/integration 上限与授权;
59
+ 2. 确认子 Goal Plan schema v6(若存在)与父 Implementation Plan schema v1(若存在)、唯一 Lead、workspace 策略、动态 implementation/integration 上限与授权;
58
60
  3. `required` 模式以 `purpose=ticket, operation=create|restore` 调用 `<Path>{roots.workflows}/specdev/common/skills/dev-worktree/SKILL.md</Path>`;`current` 模式读取当前 branch、HEAD、dirty 状态并确认没有其他 Ticket implementation writer;
59
61
  4. Lead 把 Ticket 设为 `in_progress`;`required` 模式将 change worktree 记录设为 `active`,`current` 模式建立 current workspace 执行记录;
60
62
  5. 当前代码使合同失效时停止并返回对应上游 owner。
@@ -67,7 +69,8 @@ Direct Spec 模式验证用户批准、轻量合同和 current workspace 唯一
67
69
 
68
70
  Ticket 模式下,Lead 根据 Ticket 独立性、路径冲突、上下文、风险和平台能力决定。派单时以 `operation=dispatch` 调用 `<Path>{roots.workflows}/specdev/common/skills/subagent-delivery/SKILL.md</Path>`。`current` 模式仍可派遣一个 implementation subagent 写当前 workspace,但必须等待其返回、Lead 验收并形成 commit 后才进入下一个 Ticket;`required` 模式 implementation subagent 绑定独立 Ticket worktree。Direct Spec 模式由 Lead 作为 current workspace 唯一写入 owner,不派遣 implementation subagent 写入。
69
71
 
70
- - implementation subagent 同时取 Goal Plan/config/平台能力的共同上限;current 模式保持单 writer 串行安全不变量;Lead 不计入;
72
+ - implementation subagent 同时取适用子 Goal Plan、父 Implementation Plan、config 和平台能力的共同上限;current 模式保持单 writer 串行安全不变量;Lead 不计入;
73
+ - 父实现编排存在时,派单与返回都使用 `<member-change>::<ticket-id>`,并占用父 Plan 的 task/serialization/integration slot;
71
74
  - review/research/test-observation agent 不设置 SpecDev 数字上限,但保持只读;
72
75
  - implementation Packet 按策略绑定唯一 Ticket workspace 或 current workspace、checkpoint、路径、非 E2E 检查与 commit 返回;
73
76
  - subagent 不写 SpecDev 工件、Evidence、父分支或 E2E 结果;
@@ -146,6 +149,8 @@ Ticket 正常状态:`ready → in_progress → review → done`。`required`
146
149
 
147
150
  按存在和当前模式同步 Ticket、Tickets Map、Goal Plan、`<Path>{roots.state}/specdev/changes/{change}/.status.json</Path>` 和全局状态;Direct Spec 不创建缺失的 Ticket/Map/Goal Plan。最后一个计划内 Ticket 完成后,Goal Plan 的 Lead 按 change completion 关闭;无 Goal Plan 的当前 I owner 承担同一门禁。需要远程 reconcile 时返回 T-triage,否则进入 Archive。
148
151
 
152
+ 当前 change 属于未完成父实现 change 时,单个组合 Ticket 的子状态与 Evidence 验证完成后必须自动返回 `<Path>{roots.workflows}/specdev/O-orchestrate-implementation/O-orchestrate-implementation.md</Path>`,由父 Lead 重读全部成员并继续下一 frontier;不得要求用户逐个重新激活,不得直接归档子 change,也不得从本 Work 实现另一个成员。
153
+
149
154
  运行:
150
155
 
151
156
  ```bash
@@ -14,6 +14,7 @@
14
14
  - [ ] current 模式 source 检查在 current workspace 且不宣称 E2E;required 模式 source 检查明确为非 E2E,required E2E 有 parent-candidate 场景与预期。
15
15
  - [ ] 验证命令/环境可用,关键静默失败风险有受控反向验证。
16
16
  - [ ] Deep Ticket 批准点已满足。
17
+ - [ ] 若属于父 Implementation Map:父 revision 与 Plan source revision 一致,组合 Ticket 在 tasks/frontier 中,dependency Gate 已满足,serialization lock 可用,派单未重复,workspace 策略一致,全部成员 active implementation 数未超过父上限。
17
18
 
18
19
  ## Direct Spec 硬检查
19
20
 
@@ -36,3 +37,4 @@
36
37
  - **delivery-unverified**:候选、provider 声明或附件不能独立核对;保持 unverified。
37
38
  - **e2e-owner-invalid**:required 模式 E2E 被安排在 source worktree,或任一模式不是 Lead owner;停止并修 Ticket/Goal Plan。
38
39
  - **direct-parent-invalid**:current 模式的 Ticket commit、父 HEAD、验证或 Evidence 不一致;保留最后可信 commit 并阻塞当前 Ticket。
40
+ - **parent-plan-stale**:父 Implementation Map revision、成员 Ticket、serialization、workspace 策略、全局实现配额或 repository/ref 已变化;停止当前派单并返回 O-orchestrate-implementation 重算。
@@ -55,7 +55,7 @@ keywords: [初始化, 配置, status, tracking, 验证命令]
55
55
  仅在上下文未提供时询问:
56
56
 
57
57
  - 交互语言与持久化工件语言;
58
- - implementation subagent、集成尝试次数和原型变体上限(初始化时写入 config,Lead 不计入);
58
+ - implementation subagent、集成尝试次数和 UI 设计候选上限(初始化时写入 config,Lead 不计入);
59
59
  - Deep Ticket 的迁移、发布和不可逆操作是否必须人工批准;
60
60
 
61
61
  不询问可由仓库事实回答的文件位置、脚本名或默认分支。
@@ -21,7 +21,7 @@
21
21
  "default_depth": "standard",
22
22
  "require_ready_gate": true,
23
23
  "require_evidence": true,
24
- "ui_prototype_default_variants": 3,
25
- "ui_prototype_max_variants": 5
24
+ "ui_design_default_candidates": 3,
25
+ "ui_design_max_candidates": 4
26
26
  }
27
27
  }
@@ -0,0 +1,129 @@
1
+ ---
2
+ id: specdev/orchestrate-implementation
3
+ type: workflow-entry
4
+ workflow: specdev
5
+ name: 编排实现
6
+ description: 将两个或以上已完成 Ready Spec 与 Ready Tickets 的 change 编译为跨 change implementation super-DAG,并由单一 Lead 在一个会话中持续调度实现、验证和集成。
7
+ keywords: [实现编排, 父 change, super-DAG, Ticket, Lead, agent team, worktree, 冲突]
8
+ ---
9
+
10
+ # 编排实现
11
+
12
+ > 激活本 Work 后,先读取 `<Path>{roots.workflows}/specdev/README.md</Path>`,再执行本入口。
13
+
14
+ 本 Work 只编排实现。它不创建或补写子 change 的 Triage、Grill、Wayfinder、Spec、Ticket 或普通 Goal Plan。父 change 创建前,每个输入 change 都必须已有 Ready Spec、Tickets Map 和决策完备的 Ready Tickets;缺一项就停止并报告具体缺口。
15
+
16
+ 父 change 将所有子 Ticket 投影为 `<member-change>::<ticket-id>` 组合节点,以跨 change implementation super-DAG、全局 workspace 策略、serialization、agent 配额和 integration queue 持续驱动 I-implement。子 Spec/Ticket/Evidence/Git 继续是行为与实现权威,父工件只拥有跨 change 实现编排。
17
+
18
+ 父 change 的主产物是 `<Path>{roots.state}/specdev/changes/{change}/implementation-map.md</Path>` 与 `<Path>{roots.state}/specdev/changes/{change}/implementation-plan.md</Path>`;整体验证写入 `<Path>{roots.state}/specdev/changes/{change}/evidence/implementation-orchestration.md</Path>`。
19
+
20
+ ## 激活输入
21
+
22
+ 创建模式必须获得至少两个用户明确指定的 change。恢复模式由用户指定父 change,或从 active change 中唯一满足 `current_work=specdev/orchestrate-implementation` 且存在父实现产物者确定。
23
+
24
+ 创建父 change 前必须读取并验证:
25
+
26
+ - `<Path>{roots.state}/specdev/status.json</Path>` 与 `<Path>{roots.state}/specdev/config.json</Path>`;
27
+ - 每个成员的 `<Path>{roots.state}/specdev/changes/{member-change}/.status.json</Path>`;
28
+ - 每个成员的 `<Path>{roots.state}/specdev/changes/{member-change}/spec.md</Path>`;
29
+ - 每个成员的 `<Path>{roots.state}/specdev/changes/{member-change}/tickets-map.md</Path>`;
30
+ - 每个成员的 `<Path>{roots.state}/specdev/changes/{member-change}/ticket/</Path>`;
31
+ - 存在时读取子 Goal Plan、ADR、CONTEXT、LOG、Diagnosis 与 Evidence;
32
+ - 当前 repository、branch、HEAD、dirty 状态、项目 Agent 指令与可用验证命令。
33
+
34
+ 加载 `<Path>{roots.workflows}/specdev/O-orchestrate-implementation/input-readiness.md</Path>` 和 `<Path>{roots.workflows}/specdev/common/rules/parent-implementation-orchestration.md</Path>`。任何成员未实现就绪、已归档、等于父 change、属于另一个未完成父实现 change,或本身是父实现 change 时,不创建父 change。
35
+
36
+ ## 流程
37
+
38
+ ### 1. 先验证全部子 Change,再创建父 Change
39
+
40
+ 对每个成员穷尽检查 Ready Spec、Tickets Map、Ticket frontmatter、合同覆盖、内部 DAG、路径所有权、验证矩阵和高影响未知项。部分 Ticket 可以已经 done/cancelled;其余待实现 Ticket 必须 `ready: true` 且处于可执行状态。全部 Ticket 已终态的成员只作为 satisfied baseline,不占执行 frontier。
41
+
42
+ 只有所有成员通过输入门后,才从 change status 模板创建普通父 change,在全局 `active` 添加仅含 `change` 的索引,把父 `current_work` 设置为 `specdev/orchestrate-implementation`,再写父 Map/Plan。任何预检失败都不得留下半创建父 change。
43
+
44
+ **完成标准**:父创建是 all-or-nothing;输入成员不少于两个;没有用父 Work 修补任何上游工件。
45
+
46
+ ### 2. 编译 Implementation Super-DAG
47
+
48
+ 加载 `<Path>{roots.workflows}/specdev/O-orchestrate-implementation/super-dag.md</Path>` 与 `<Path>{roots.workflows}/specdev/O-orchestrate-implementation/conflict-and-drift.md</Path>`。
49
+
50
+ 1. 将每个子 Ticket 映射为唯一组合节点;
51
+ 2. 将所有子 Ticket `blocked_by` 精确提升为组合 dependency;
52
+ 3. 只为真实合同/产物前置关系增加跨 change dependency;
53
+ 4. 为无语义依赖但不能并发的 Ticket 增加无方向 serialization pair;
54
+ 5. 比较所有待实现 Ticket 的 writable/shared paths、公共合同、repository/ref 和迁移资源;
55
+ 6. 检测循环、缺失节点、重复边、无 owner overlap 和子图漂移。
56
+
57
+ 使用 `<Path>{roots.workflows}/specdev/O-orchestrate-implementation/implementation-map-template.md</Path>` 写父 Map。Map 是子 Ticket 图的可重算投影;子 Ticket 变化时先重读权威,再递增 Map revision。
58
+
59
+ **完成标准**:父 Map 的 members/tasks/internal edges 与全部子工件精确一致;跨 change 边有来源;DAG 无环;每个并行冲突已依赖化、串行化或阻塞。
60
+
61
+ ### 3. 一次决定全局执行策略
62
+
63
+ 只询问一次是否开启 Ticket worktree,默认不开启,并把选择写入父 Plan:
64
+
65
+ - `current/direct-parent`:全部成员的待实现 Ticket 全局严格串行,只允许一个 current workspace implementation writer;
66
+ - `required/candidate-merge`:依赖满足且无 serialization/path/resource 冲突的 Tickets 可跨 change 并行,每个 Ticket 使用自己的 source worktree。
67
+
68
+ 从 config 读取 implementation agent 与 integration attempt 上限,父 Plan 可以降低但不能提高。Lead 不计入实现 agent 数;review/research/test-observation agents 只读且不受该数字限制。同一 repository/ref 的 integration 永远串行。
69
+
70
+ 使用 `<Path>{roots.workflows}/specdev/O-orchestrate-implementation/implementation-plan-template.md</Path>` 写父 Plan。已有子 Goal Plan 只提供子 change 内的额外 Gate/约束;其 workspace 策略与父 Plan 冲突时阻塞,不能覆盖父级全局选择。
71
+
72
+ Implementation Plan 固定使用 `orchestration: lead-directed`,并显式持久化 `implementation_agent_limit`、`integration_attempt_limit`、workspace/integration 策略和唯一 Lead;恢复时不得从会话记忆重建这些值。
73
+
74
+ **完成标准**:Lead、workspace/integration 策略、全局 agent 上限、frontier、Wave、serialization owner 和 integration queue 可从父 Plan 恢复。
75
+
76
+ ### 4. 在一个会话中持续执行
77
+
78
+ 加载 `<Path>{roots.workflows}/specdev/O-orchestrate-implementation/execution-loop.md</Path>`。父 Lead 自动循环,不要求用户逐个激活子 change:
79
+
80
+ 1. 重读父 Map/Plan、所有子 Ticket/status 和 Git;
81
+ 2. 计算依赖满足、lock 可用且配额允许的 ready frontier;
82
+ 3. current 模式选择一个 Ticket,required 模式选择一组互不冲突的 Tickets;
83
+ 4. 将子 `current_work` 设置为 `specdev/implement`,按组合 ID 调用 I-implement;
84
+ 5. implementation agent 仅写授权 workspace,Lead 验收 commit/diff/验证/Evidence;
85
+ 6. 按 repository/ref queue 串行完成 direct-parent 或 candidate integration;
86
+ 7. 先原子提交子 Ticket/change 状态,再更新父 Plan 投影;
87
+ 8. 父 HEAD、Map revision 或子合同变化后使旧 dispatch/candidate stale,并重新 preflight;
88
+ 9. 仍有 frontier 时立即进入下一轮,否则完成或持久化 blocker。
89
+
90
+ I-implement 是实际实现 owner;父 Work 不复制 TDD、代码审查、Evidence 或 worktree 逻辑。用户只在合同冲突、高影响偏差、缺失授权、不可逆动作或无合法 frontier 时被打断。
91
+
92
+ **完成标准**:单次父激活可以连续完成多个子 Ticket;没有第二个 SpecDev 状态 writer、超限 agent、并发 parent integration 或绕过子 I-implement 完成门。
93
+
94
+ ### 5. 关闭子 Changes 与父 Change
95
+
96
+ 一个成员的全部计划内 Ticket done/cancelled 且其 Goal/Evidence/Git 门通过时,父 Lead 按 change completion 关闭该子 change;不等待其他成员才关闭,也不自动归档。
97
+
98
+ 全部成员 completed 后,Lead 运行跨 change aggregate test/typecheck/lint/build 与适用 E2E,核对跨 change 合同、依赖顺序、共享路径、迁移/恢复和最终 Git checkpoint,并使用 `<Path>{roots.workflows}/specdev/O-orchestrate-implementation/implementation-evidence-template.md</Path>` 写整体验证。
99
+
100
+ 只有父 Map/Plan completed、全部成员 completed、无 blocker/deviation/active dispatch/candidate/lock 且整体验证通过时,才清空父 `current_work`、去重加入 `specdev/orchestrate-implementation` 到 `works_run` 并关闭父 change。归档、push、PR、remote merge、deploy 和生产迁移保持独立授权。
101
+
102
+ 运行:
103
+
104
+ ```bash
105
+ node <Path>{roots.workflows}/specdev/common/tools/validate-specdev.mjs</Path> \
106
+ --stage orchestrate-implementation \
107
+ <Path>{roots.state}/specdev/changes/{change}</Path>
108
+ ```
109
+
110
+ ## 完成标准
111
+
112
+ - 父 change 只接受 Spec/Tickets 已 Ready 的成员;
113
+ - Implementation Map/Plan 可恢复完整组合 DAG、全局策略、frontier 和 integration queue;
114
+ - 子工件保持权威,父投影与子 Ticket 精确一致;
115
+ - current 全局串行,required 只并行无冲突 Ticket,全部实现受父级 agent cap 约束;
116
+ - I-implement 自动回到父循环,全部子 change 和父 change completed;
117
+ - aggregate Evidence 与 validator 通过;
118
+ - 无未经授权的归档、远程 Git、部署或生产副作用。
119
+
120
+ ## 子文件引用
121
+
122
+ - 输入就绪门:`<Path>{roots.workflows}/specdev/O-orchestrate-implementation/input-readiness.md</Path>`
123
+ - Super-DAG:`<Path>{roots.workflows}/specdev/O-orchestrate-implementation/super-dag.md</Path>`
124
+ - 执行循环:`<Path>{roots.workflows}/specdev/O-orchestrate-implementation/execution-loop.md</Path>`
125
+ - 冲突与漂移:`<Path>{roots.workflows}/specdev/O-orchestrate-implementation/conflict-and-drift.md</Path>`
126
+ - Map 模板:`<Path>{roots.workflows}/specdev/O-orchestrate-implementation/implementation-map-template.md</Path>`
127
+ - Plan 模板:`<Path>{roots.workflows}/specdev/O-orchestrate-implementation/implementation-plan-template.md</Path>`
128
+ - Evidence 模板:`<Path>{roots.workflows}/specdev/O-orchestrate-implementation/implementation-evidence-template.md</Path>`
129
+ - 共享规则:`<Path>{roots.workflows}/specdev/common/rules/parent-implementation-orchestration.md</Path>`
@@ -0,0 +1,18 @@
1
+ # Implementation Conflict and Drift
2
+
3
+ ## 冲突分类
4
+
5
+ 1. **真实依赖**:加入 dependency,前置 Ticket 完成前不启动后置 Ticket。
6
+ 2. **资源冲突**:加入 serialization,记录唯一 owner 与释放条件,不改变产品语义。
7
+ 3. **合同冲突**:行为、公共接口、数据、安全、范围或验收不一致;阻塞父 Plan,返回子 ADR/Spec/用户 owner。
8
+ 4. **基线漂移**:Ticket、Map revision、branch、HEAD、workspace 或 candidate 变化;废弃旧 dispatch/candidate,基于最新事实重新 preflight。
9
+
10
+ ## 路径与共享合同
11
+
12
+ 比较所有非终态 Ticket 的 writable/shared paths。无传递 dependency 的 overlap 必须有父 serialization;若两边 Ticket 的路径 owner 自身不合法,先阻塞并返回原 Ticket owner,父 Map 不能替它补 owner。
13
+
14
+ 同一共享 API/schema/锁文件/迁移索引即使路径预测不重叠,也必须根据实际消费者和集成事实决定 dependency 或 serialization。
15
+
16
+ ## 集成冲突
17
+
18
+ 同一 repository/ref 的 direct-parent/candidate integration 严格串行。一次父 HEAD 推进后,其他 candidate 全部 stale;必须在最新父状态重新组合并重跑要求的 full suite/E2E。需要新行为或上层决定的 merge conflict 立即停止。