@mstar-harness/omp 3.6.0-alpha.4

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 (280) hide show
  1. package/README.md +63 -0
  2. package/agents/architect.md +35 -0
  3. package/agents/code-reviewer.md +90 -0
  4. package/agents/frontend-dev.md +33 -0
  5. package/agents/fullstack-dev-2.md +33 -0
  6. package/agents/fullstack-dev.md +33 -0
  7. package/agents/ops-engineer.md +33 -0
  8. package/agents/product-manager.md +35 -0
  9. package/agents/project-manager.md +32 -0
  10. package/agents/prompt-engineer.md +33 -0
  11. package/agents/qa-engineer.md +35 -0
  12. package/agents/qc-specialist-2.md +62 -0
  13. package/agents/qc-specialist-3.md +62 -0
  14. package/agents/qc-specialist.md +62 -0
  15. package/agents/writing-specialist.md +35 -0
  16. package/assets/icon.png +0 -0
  17. package/assets/logo-dark.png +0 -0
  18. package/assets/logo-dark.svg +6 -0
  19. package/assets/logo.png +0 -0
  20. package/assets/logo.svg +6 -0
  21. package/commands/amazing-pr-review.md +31 -0
  22. package/commands/codebase-audit.md +40 -0
  23. package/commands/iteration-drive.md +48 -0
  24. package/commands/iteration-loop.md +99 -0
  25. package/commands/iteration-start.md +122 -0
  26. package/dist/hooks/pre/mstar-gates.js +6579 -0
  27. package/dist/tools/mstar_dispatch_validate/index.js +6291 -0
  28. package/dist/tools/mstar_iteration_gate/index.js +6321 -0
  29. package/dist/tools/mstar_lease_verify/index.js +6343 -0
  30. package/dist/tools/mstar_path_resolve/index.js +6297 -0
  31. package/dist/tools/mstar_status_validate/index.js +6402 -0
  32. package/dist/tools/mstar_worktree_check/index.js +6343 -0
  33. package/harness-agents/architect.md +35 -0
  34. package/harness-agents/code-reviewer.md +90 -0
  35. package/harness-agents/frontend-dev.md +33 -0
  36. package/harness-agents/fullstack-dev-2.md +33 -0
  37. package/harness-agents/fullstack-dev.md +33 -0
  38. package/harness-agents/ops-engineer.md +33 -0
  39. package/harness-agents/product-manager.md +35 -0
  40. package/harness-agents/project-manager.md +32 -0
  41. package/harness-agents/prompt-engineer.md +33 -0
  42. package/harness-agents/qa-engineer.md +35 -0
  43. package/harness-agents/qc-specialist-2.md +62 -0
  44. package/harness-agents/qc-specialist-3.md +62 -0
  45. package/harness-agents/qc-specialist.md +62 -0
  46. package/harness-agents/writing-specialist.md +35 -0
  47. package/harness-commands/amazing-pr-review.md +31 -0
  48. package/harness-commands/codebase-audit.md +40 -0
  49. package/harness-commands/iteration-drive.md +48 -0
  50. package/harness-commands/iteration-loop.md +99 -0
  51. package/harness-commands/iteration-start.md +122 -0
  52. package/harness-skills/grill-me/SKILL.md +10 -0
  53. package/harness-skills/mstar-artifacts/SKILL.md +66 -0
  54. package/harness-skills/mstar-artifacts/references/knowledge-and-designs.md +110 -0
  55. package/harness-skills/mstar-artifacts/references/plan-files-and-reports.md +98 -0
  56. package/harness-skills/mstar-artifacts/references/plan-quality-bar.md +99 -0
  57. package/harness-skills/mstar-artifacts/references/status-and-residuals.md +472 -0
  58. package/harness-skills/mstar-artifacts/templates/README.md +7 -0
  59. package/harness-skills/mstar-artifacts/templates/plan.main.md +54 -0
  60. package/harness-skills/mstar-artifacts/templates/status.empty.json +5 -0
  61. package/harness-skills/mstar-audit/SKILL.md +151 -0
  62. package/harness-skills/mstar-audit/references/audit-playbook.md +175 -0
  63. package/harness-skills/mstar-audit/references/codebase-audit.md +103 -0
  64. package/harness-skills/mstar-audit/references/finding-format.md +69 -0
  65. package/harness-skills/mstar-audit/references/pr-review-seat-evidence.md +28 -0
  66. package/harness-skills/mstar-audit/references/pr-review.md +475 -0
  67. package/harness-skills/mstar-audit/references/security-review.md +219 -0
  68. package/harness-skills/mstar-branch-worktree/SKILL.md +236 -0
  69. package/harness-skills/mstar-branch-worktree/references/parallel-writable-pre-dispatch.md +68 -0
  70. package/harness-skills/mstar-coding-behavior/SKILL.md +167 -0
  71. package/harness-skills/mstar-compound/SKILL.md +109 -0
  72. package/harness-skills/mstar-compound/assets/resolution-template.md +94 -0
  73. package/harness-skills/mstar-compound/references/category-mapping.md +37 -0
  74. package/harness-skills/mstar-compound/references/compound-workflow.md +171 -0
  75. package/harness-skills/mstar-compound/references/concepts-vocabulary.md +44 -0
  76. package/harness-skills/mstar-compound/references/schema.yaml +122 -0
  77. package/harness-skills/mstar-compound-refresh/SKILL.md +154 -0
  78. package/harness-skills/mstar-compound-refresh/references/project-knowledge-bootstrap.md +164 -0
  79. package/harness-skills/mstar-conventions/SKILL.md +215 -0
  80. package/harness-skills/mstar-conventions/references/artifact-storage-paths.md +53 -0
  81. package/harness-skills/mstar-conventions/references/effort-estimation.md +38 -0
  82. package/harness-skills/mstar-conventions/references/harness-bootstrap-and-agents-layering.md +96 -0
  83. package/harness-skills/mstar-design-md/SKILL.md +142 -0
  84. package/harness-skills/mstar-design-md/references/completeness-checklist.md +181 -0
  85. package/harness-skills/mstar-design-md/references/design-md-spec.md +508 -0
  86. package/harness-skills/mstar-design-md/references/vercel-example.md +200 -0
  87. package/harness-skills/mstar-design-md/templates/DESIGN.dark.md.template +354 -0
  88. package/harness-skills/mstar-design-md/templates/DESIGN.md.template +474 -0
  89. package/harness-skills/mstar-dispatch-gates/SKILL.md +134 -0
  90. package/harness-skills/mstar-dispatch-gates/references/leaf-executor-checklist.md +23 -0
  91. package/harness-skills/mstar-engine-legacy/SKILL.md +53 -0
  92. package/harness-skills/mstar-engine-legacy/references/anti-recursion-checklists.md +58 -0
  93. package/harness-skills/mstar-engine-legacy/references/engine-check-boilerplate.md +26 -0
  94. package/harness-skills/mstar-engine-legacy/references/lease-protocol.md +92 -0
  95. package/harness-skills/mstar-engine-legacy/references/qc-seat-n-restatements.md +57 -0
  96. package/harness-skills/mstar-engine-legacy/references/status-field-history.md +186 -0
  97. package/harness-skills/mstar-harness-core/SKILL.md +196 -0
  98. package/harness-skills/mstar-host/SKILL.md +96 -0
  99. package/harness-skills/mstar-host/references/_shared/host-role-binding-core.md +51 -0
  100. package/harness-skills/mstar-host/references/_shared/plan-mode-bridge-core.md +91 -0
  101. package/harness-skills/mstar-host/references/codex.md +61 -0
  102. package/harness-skills/mstar-host/references/cursor-plan-mode-bridge.md +170 -0
  103. package/harness-skills/mstar-host/references/cursor.md +183 -0
  104. package/harness-skills/mstar-host/references/dsh.md +507 -0
  105. package/harness-skills/mstar-host/references/kimi-plan-mode-bridge.md +36 -0
  106. package/harness-skills/mstar-host/references/kimi.md +136 -0
  107. package/harness-skills/mstar-host/references/omp-plan-mode-bridge.md +32 -0
  108. package/harness-skills/mstar-host/references/omp.md +245 -0
  109. package/harness-skills/mstar-host/references/opencode.md +76 -0
  110. package/harness-skills/mstar-host/references/parallel-dispatch.md +68 -0
  111. package/harness-skills/mstar-host/references/zcode-plan-mode-bridge.md +36 -0
  112. package/harness-skills/mstar-host/references/zcode.md +129 -0
  113. package/harness-skills/mstar-iteration/SKILL.md +408 -0
  114. package/harness-skills/mstar-iteration/references/autonomous-direction-lock.md +90 -0
  115. package/harness-skills/mstar-iteration/references/command-shared-invariants.md +62 -0
  116. package/harness-skills/mstar-iteration/references/iteration-artifact-boundaries.md +103 -0
  117. package/harness-skills/mstar-iteration/references/iteration-compass-template.md +142 -0
  118. package/harness-skills/mstar-iteration/references/iteration-corpus-hygiene.md +45 -0
  119. package/harness-skills/mstar-iteration/references/iteration-workspace-readme-template.md +27 -0
  120. package/harness-skills/mstar-iteration/references/phase-2-worktree-lease.md +205 -0
  121. package/harness-skills/mstar-iteration/references/phase-3-iteration-close.md +105 -0
  122. package/harness-skills/mstar-iteration/references/phase-4-5-pr-delivery.md +85 -0
  123. package/harness-skills/mstar-iteration/references/phase5-helper-discovery.md +24 -0
  124. package/harness-skills/mstar-phase-gates/SKILL.md +118 -0
  125. package/harness-skills/mstar-project-governance/SKILL.md +119 -0
  126. package/harness-skills/mstar-review-qc/SKILL.md +76 -0
  127. package/harness-skills/mstar-review-qc/references/review-responsibility-boundaries.md +54 -0
  128. package/harness-skills/mstar-roles/SKILL.md +103 -0
  129. package/harness-skills/mstar-roles/references/_shared/leaf-executor-core.md +65 -0
  130. package/harness-skills/mstar-roles/references/architect.md +109 -0
  131. package/harness-skills/mstar-roles/references/code-reviewer.md +118 -0
  132. package/harness-skills/mstar-roles/references/frontend-dev.md +70 -0
  133. package/harness-skills/mstar-roles/references/fullstack-dev-shared.md +89 -0
  134. package/harness-skills/mstar-roles/references/ops-engineer.md +72 -0
  135. package/harness-skills/mstar-roles/references/product-manager.md +102 -0
  136. package/harness-skills/mstar-roles/references/project-manager/dispatch-and-assignment.md +200 -0
  137. package/harness-skills/mstar-roles/references/project-manager/plan-management.md +59 -0
  138. package/harness-skills/mstar-roles/references/project-manager/qa-trigger-matrix.md +56 -0
  139. package/harness-skills/mstar-roles/references/project-manager/qc-and-residuals.md +99 -0
  140. package/harness-skills/mstar-roles/references/project-manager/routing-and-dev-allocation.md +99 -0
  141. package/harness-skills/mstar-roles/references/project-manager.md +310 -0
  142. package/harness-skills/mstar-roles/references/prompt-engineer.md +65 -0
  143. package/harness-skills/mstar-roles/references/qa-engineer/acceptance-gate.md +62 -0
  144. package/harness-skills/mstar-roles/references/qa-engineer.md +71 -0
  145. package/harness-skills/mstar-roles/references/qc-specialist/deep-review-lenses.md +104 -0
  146. package/harness-skills/mstar-roles/references/qc-specialist/report-template.md +88 -0
  147. package/harness-skills/mstar-roles/references/qc-specialist/reviewer-checklist.md +44 -0
  148. package/harness-skills/mstar-roles/references/qc-specialist/reviewer-workflow.md +57 -0
  149. package/harness-skills/mstar-roles/references/qc-specialist-shared.md +120 -0
  150. package/harness-skills/mstar-roles/references/writing-specialist.md +88 -0
  151. package/harness-skills/mstar-sdd/SKILL.md +137 -0
  152. package/harness-skills/mstar-sdd/references/file-handoffs.md +85 -0
  153. package/harness-skills/mstar-sdd/references/implementer-continuation-prompt.md +44 -0
  154. package/harness-skills/mstar-sdd/references/implementer-prompt.md +56 -0
  155. package/harness-skills/mstar-sdd/references/sticky-implementer-session.md +103 -0
  156. package/harness-skills/mstar-sdd/references/task-reviewer-prompt.md +53 -0
  157. package/harness-skills/mstar-skill-authoring/SKILL.md +182 -0
  158. package/harness-skills/mstar-skill-authoring/references/regression-fixation.md +46 -0
  159. package/harness-skills/mstar-skill-authoring/references/skillsbench-authoring.md +154 -0
  160. package/harness-skills/mstar-strategy/SKILL.md +114 -0
  161. package/harness-skills/pm/SKILL.md +40 -0
  162. package/hooks/pre/mstar-gates.js +6579 -0
  163. package/package.json +45 -0
  164. package/plugin.json +49 -0
  165. package/skills/grill-me/SKILL.md +10 -0
  166. package/skills/mstar-artifacts/SKILL.md +66 -0
  167. package/skills/mstar-artifacts/references/knowledge-and-designs.md +110 -0
  168. package/skills/mstar-artifacts/references/plan-files-and-reports.md +98 -0
  169. package/skills/mstar-artifacts/references/plan-quality-bar.md +99 -0
  170. package/skills/mstar-artifacts/references/status-and-residuals.md +472 -0
  171. package/skills/mstar-artifacts/templates/README.md +7 -0
  172. package/skills/mstar-artifacts/templates/plan.main.md +54 -0
  173. package/skills/mstar-artifacts/templates/status.empty.json +5 -0
  174. package/skills/mstar-audit/SKILL.md +151 -0
  175. package/skills/mstar-audit/references/audit-playbook.md +175 -0
  176. package/skills/mstar-audit/references/codebase-audit.md +103 -0
  177. package/skills/mstar-audit/references/finding-format.md +69 -0
  178. package/skills/mstar-audit/references/pr-review-seat-evidence.md +28 -0
  179. package/skills/mstar-audit/references/pr-review.md +475 -0
  180. package/skills/mstar-audit/references/security-review.md +219 -0
  181. package/skills/mstar-branch-worktree/SKILL.md +236 -0
  182. package/skills/mstar-branch-worktree/references/parallel-writable-pre-dispatch.md +68 -0
  183. package/skills/mstar-coding-behavior/SKILL.md +167 -0
  184. package/skills/mstar-compound/SKILL.md +109 -0
  185. package/skills/mstar-compound/assets/resolution-template.md +94 -0
  186. package/skills/mstar-compound/references/category-mapping.md +37 -0
  187. package/skills/mstar-compound/references/compound-workflow.md +171 -0
  188. package/skills/mstar-compound/references/concepts-vocabulary.md +44 -0
  189. package/skills/mstar-compound/references/schema.yaml +122 -0
  190. package/skills/mstar-compound-refresh/SKILL.md +154 -0
  191. package/skills/mstar-compound-refresh/references/project-knowledge-bootstrap.md +164 -0
  192. package/skills/mstar-conventions/SKILL.md +215 -0
  193. package/skills/mstar-conventions/references/artifact-storage-paths.md +53 -0
  194. package/skills/mstar-conventions/references/effort-estimation.md +38 -0
  195. package/skills/mstar-conventions/references/harness-bootstrap-and-agents-layering.md +96 -0
  196. package/skills/mstar-design-md/SKILL.md +142 -0
  197. package/skills/mstar-design-md/references/completeness-checklist.md +181 -0
  198. package/skills/mstar-design-md/references/design-md-spec.md +508 -0
  199. package/skills/mstar-design-md/references/vercel-example.md +200 -0
  200. package/skills/mstar-design-md/templates/DESIGN.dark.md.template +354 -0
  201. package/skills/mstar-design-md/templates/DESIGN.md.template +474 -0
  202. package/skills/mstar-dispatch-gates/SKILL.md +134 -0
  203. package/skills/mstar-dispatch-gates/references/leaf-executor-checklist.md +23 -0
  204. package/skills/mstar-engine-legacy/SKILL.md +53 -0
  205. package/skills/mstar-engine-legacy/references/anti-recursion-checklists.md +58 -0
  206. package/skills/mstar-engine-legacy/references/engine-check-boilerplate.md +26 -0
  207. package/skills/mstar-engine-legacy/references/lease-protocol.md +92 -0
  208. package/skills/mstar-engine-legacy/references/qc-seat-n-restatements.md +57 -0
  209. package/skills/mstar-engine-legacy/references/status-field-history.md +186 -0
  210. package/skills/mstar-harness-core/SKILL.md +196 -0
  211. package/skills/mstar-host/SKILL.md +96 -0
  212. package/skills/mstar-host/references/_shared/host-role-binding-core.md +51 -0
  213. package/skills/mstar-host/references/_shared/plan-mode-bridge-core.md +91 -0
  214. package/skills/mstar-host/references/codex.md +61 -0
  215. package/skills/mstar-host/references/cursor-plan-mode-bridge.md +170 -0
  216. package/skills/mstar-host/references/cursor.md +183 -0
  217. package/skills/mstar-host/references/dsh.md +507 -0
  218. package/skills/mstar-host/references/kimi-plan-mode-bridge.md +36 -0
  219. package/skills/mstar-host/references/kimi.md +136 -0
  220. package/skills/mstar-host/references/omp-plan-mode-bridge.md +32 -0
  221. package/skills/mstar-host/references/omp.md +245 -0
  222. package/skills/mstar-host/references/opencode.md +76 -0
  223. package/skills/mstar-host/references/parallel-dispatch.md +68 -0
  224. package/skills/mstar-host/references/zcode-plan-mode-bridge.md +36 -0
  225. package/skills/mstar-host/references/zcode.md +129 -0
  226. package/skills/mstar-iteration/SKILL.md +408 -0
  227. package/skills/mstar-iteration/references/autonomous-direction-lock.md +90 -0
  228. package/skills/mstar-iteration/references/command-shared-invariants.md +62 -0
  229. package/skills/mstar-iteration/references/iteration-artifact-boundaries.md +103 -0
  230. package/skills/mstar-iteration/references/iteration-compass-template.md +142 -0
  231. package/skills/mstar-iteration/references/iteration-corpus-hygiene.md +45 -0
  232. package/skills/mstar-iteration/references/iteration-workspace-readme-template.md +27 -0
  233. package/skills/mstar-iteration/references/phase-2-worktree-lease.md +205 -0
  234. package/skills/mstar-iteration/references/phase-3-iteration-close.md +105 -0
  235. package/skills/mstar-iteration/references/phase-4-5-pr-delivery.md +85 -0
  236. package/skills/mstar-iteration/references/phase5-helper-discovery.md +24 -0
  237. package/skills/mstar-phase-gates/SKILL.md +118 -0
  238. package/skills/mstar-project-governance/SKILL.md +119 -0
  239. package/skills/mstar-review-qc/SKILL.md +76 -0
  240. package/skills/mstar-review-qc/references/review-responsibility-boundaries.md +54 -0
  241. package/skills/mstar-roles/SKILL.md +103 -0
  242. package/skills/mstar-roles/references/_shared/leaf-executor-core.md +65 -0
  243. package/skills/mstar-roles/references/architect.md +109 -0
  244. package/skills/mstar-roles/references/code-reviewer.md +118 -0
  245. package/skills/mstar-roles/references/frontend-dev.md +70 -0
  246. package/skills/mstar-roles/references/fullstack-dev-shared.md +89 -0
  247. package/skills/mstar-roles/references/ops-engineer.md +72 -0
  248. package/skills/mstar-roles/references/product-manager.md +102 -0
  249. package/skills/mstar-roles/references/project-manager/dispatch-and-assignment.md +200 -0
  250. package/skills/mstar-roles/references/project-manager/plan-management.md +59 -0
  251. package/skills/mstar-roles/references/project-manager/qa-trigger-matrix.md +56 -0
  252. package/skills/mstar-roles/references/project-manager/qc-and-residuals.md +99 -0
  253. package/skills/mstar-roles/references/project-manager/routing-and-dev-allocation.md +99 -0
  254. package/skills/mstar-roles/references/project-manager.md +310 -0
  255. package/skills/mstar-roles/references/prompt-engineer.md +65 -0
  256. package/skills/mstar-roles/references/qa-engineer/acceptance-gate.md +62 -0
  257. package/skills/mstar-roles/references/qa-engineer.md +71 -0
  258. package/skills/mstar-roles/references/qc-specialist/deep-review-lenses.md +104 -0
  259. package/skills/mstar-roles/references/qc-specialist/report-template.md +88 -0
  260. package/skills/mstar-roles/references/qc-specialist/reviewer-checklist.md +44 -0
  261. package/skills/mstar-roles/references/qc-specialist/reviewer-workflow.md +57 -0
  262. package/skills/mstar-roles/references/qc-specialist-shared.md +120 -0
  263. package/skills/mstar-roles/references/writing-specialist.md +88 -0
  264. package/skills/mstar-sdd/SKILL.md +137 -0
  265. package/skills/mstar-sdd/references/file-handoffs.md +85 -0
  266. package/skills/mstar-sdd/references/implementer-continuation-prompt.md +44 -0
  267. package/skills/mstar-sdd/references/implementer-prompt.md +56 -0
  268. package/skills/mstar-sdd/references/sticky-implementer-session.md +103 -0
  269. package/skills/mstar-sdd/references/task-reviewer-prompt.md +53 -0
  270. package/skills/mstar-skill-authoring/SKILL.md +182 -0
  271. package/skills/mstar-skill-authoring/references/regression-fixation.md +46 -0
  272. package/skills/mstar-skill-authoring/references/skillsbench-authoring.md +154 -0
  273. package/skills/mstar-strategy/SKILL.md +114 -0
  274. package/skills/pm/SKILL.md +40 -0
  275. package/tools/mstar_dispatch_validate.js +6291 -0
  276. package/tools/mstar_iteration_gate.js +6321 -0
  277. package/tools/mstar_lease_verify.js +6343 -0
  278. package/tools/mstar_path_resolve.js +6297 -0
  279. package/tools/mstar_status_validate.js +6402 -0
  280. package/tools/mstar_worktree_check.js +6343 -0
@@ -0,0 +1,62 @@
1
+ # Iteration 命令共享 invariants + preflight
2
+
3
+ 本文件是 `commands/iteration-*.md`(`iteration-start` / `iteration-drive` / `iteration-loop`)**重叠内容**的单一共享副本(SSOT)。**只收录出现在 ≥2 个命令中的行**;命令专属内容保留在命令正文,**不**复制进本文件:
4
+
5
+ - `iteration-start` Phase 1 review-chain 表(§5.1→§5.2→§5.3 顺序 invoke、三角色冒充禁止、`{KNOWLEDGE_DIR}/` 新增禁止)— start 专属
6
+ - `iteration-loop`「Do not Read `skills/grill-me/SKILL.md`」— loop 专属
7
+ - `iteration-loop` session todo `phase-1-autonomous-start`(Boot → compass `locked` + integration committed)— loop 专属
8
+
9
+ 命令正文经一行指针引用本文件,不重复定义以下 invariants / preflight / todos / STOP。
10
+
11
+ ## PM invariants(重叠行)
12
+
13
+ Phase 2–5 全程有效(drive + loop 共有的行):
14
+
15
+ | 禁止(PM 线程) | 必须 |
16
+ |-----------------|------|
17
+ | Write/Edit/Shell 产品代码、写测试、跑 QC(Phase 2) | 每条 implement/QC/QA Assignment ⇒ **1 次 `Task`** |
18
+ | **多 task plan 用 inline 大包派发**(整份 plan / T1–Tn 贴进一个 dev Assignment) | **SDD**:`mstar-sdd` per-task 循环 — `mstar sdd task-brief` → implementer → `mstar sdd review-package` → task reviewer → `progress.md` |
19
+ | 只写 Assignment 就进入下一 gate | 同轮 dispatch:每条 Assignment ⇒ **1 次 invoke**(`Subagent invokes issued: N`,N = Assignment 条数) |
20
+ | 最后一个 plan `Done` 后直接开 PR / 汇报结束 | **Phase 3 → 4 → 5** 顺序执行 |
21
+ | Phase 5 自己改产品代码 | 需改产品代码时 **dispatch** `fullstack-dev` / `ops-engineer` |
22
+
23
+ 派发细则 → **`mstar-dispatch-gates`** + **`mstar-host`**。Phase 3 细则 → **`mstar-iteration` §3** + **`mstar-compound`**。
24
+
25
+ ## Assignment preflight(bash 块 — byte-identical 共享副本)
26
+
27
+ `mstar-harness` bin 未安装时静默跳过;在每次 implement/QC/QA 派发前(**SDD** 下为最新 `{SDD_DIR}/task-N-brief.md` 或临时写盘的 Assignment)校验。模式由迭代 compass frontmatter 的 `enforcement` 键决定(Slice 5):
28
+
29
+ - **默认(compass 无 `enforcement: hard`)— 可选 warn-only**:exit 1 仅提示,不阻断派发(Slice 3 行为不变):
30
+
31
+ ```bash
32
+ command -v mstar-harness >/dev/null 2>&1 && mstar-harness dispatch validate "<latest-assignment-file>"
33
+ ```
34
+
35
+ - **`enforcement: hard`(迭代 compass frontmatter 声明)— fail-fast**:校验失败即 `exit 1` 阻断派发(bin 缺失仍静默跳过):
36
+
37
+ ```bash
38
+ if command -v mstar-harness >/dev/null 2>&1; then mstar-harness dispatch validate "<latest-assignment-file>" || exit 1; fi
39
+ ```
40
+
41
+ > 路径必须加引号且替换为具体文件(如最新 `{SDD_DIR}/task-N-brief.md`,勿留尖括号)——agent 代入的路径不得进入 shell 无引号展开。
42
+
43
+ ## Session todos(重叠行;drive + loop 共有)
44
+
45
+ | Todo id | 何时追加 | 何时可勾掉 |
46
+ |---------|----------|------------|
47
+ | plan-wave todos | 进入 Phase 2 | 各 plan `Done` |
48
+ | `phase-3-iteration-close` | 仅剩 1 个非 `Done` plan | Phase 3 §3.5 exit 全 `[x]` |
49
+ | `phase-4-create-pr` | Phase 3 完成后 | PR 已创建并记录 URL/number |
50
+ | `phase-5-pr-merge-ready` | Phase 4 完成后 | Phase 5 §5.5 exit 全 `[x]` |
51
+
52
+ ## Continuous execution STOP list(重叠行;start / drive / loop 共有)
53
+
54
+ Execute **`mstar-iteration` §2.6**(Continuous execution SSOT:自 Phase 2 进入至 Phase 5 §5.5 exit 前 PM **连续编排**,进度汇报后下一条必须是 dispatch 或下一 phase 步骤,不向用户例行 yes/no check-in)。
55
+
56
+ **合法 STOP(仅此升级用户)**:
57
+
58
+ - 迭代 branch metadata 缺失(`iteration_base_branch` / `target_branch`)
59
+ - **`Blocked`**:真冲突、secrets、不可逆范围缺口、Phase 5 多轮仍无法 merge-ready
60
+ - 用户本轮显式打断
61
+
62
+ **Turn 收束纪律**:最后一条 assistant 内容必须是 **in-flight 动作**(invoke 已发出、或写明下一 dispatch 的 Assignment 字段),**不得**以对用户的确认问句收束 turn。
@@ -0,0 +1,103 @@
1
+ # iteration-start 产物边界(specs · iterations · knowledge)
2
+
3
+ > **When**: Phase 1 — PM 初稿落盘、§1.6 Review & Edit chain;Phase 2 迭代执行期可继续写入 iteration package;Phase 3 iteration-close 经 **`mstar-compound`** 提升。
4
+ > **Conflict**: 与 `mstar-artifacts/references/knowledge-and-designs.md` 一致;冲突以 **`mstar-harness-core`** 为准。
5
+
6
+ ## 三棵树分工(HARD)
7
+
8
+ | 树 | 路径 | 长期价值 | 谁写(何时) | 典型内容 |
9
+ |----|------|----------|--------------|----------|
10
+ | **Specs(仓库级)** | `{SPECS_DIR}/` | **是** — 跨迭代规范性权威 | product / architect @ **iteration-start** | 已锁定产品/API 规格、ADR、契约 |
11
+ | **Iterations** | `{ITERATION_DIR}/` | **迭代级** — 历史快照;可提升 | product / architect / PM @ start & execute | **`<iteration-id>/` package**(compass + specs/guides) |
12
+ | **Knowledge** | `{KNOWLEDGE_DIR}/` | **是** — 可复用实施 SSOT | **`mstar-compound`** @ **iteration-close**(含 package 提升) | 结晶、提升后的长期实施知识 |
13
+
14
+ ```text
15
+ iteration-start / execute
16
+ product / architect ──► {SPECS_DIR}/ 已锁定的长期规格
17
+ ──► {ITERATION_DIR}/<id>/ 迭代 package(compass + specs + guides)
18
+ ✗ {KNOWLEDGE_DIR}/ 不直接新增
19
+
20
+ iteration-close (§3.2)
21
+ mstar-compound ──► 读 plan 素材 + {ITERATION_DIR}/<id>/**
22
+ ──► {KNOWLEDGE_DIR}/ 提升值得保留的 specs/guides
23
+ ```
24
+
25
+ ## `{ITERATION_DIR}/<iteration-id>/` 迭代 package(目录优先)
26
+
27
+ **Canonical layout**(新 iteration-start **只写**此形态):
28
+
29
+ ```text
30
+ {ITERATION_DIR}/
31
+ README.md # 根索引:每迭代一行 → 指向 <iteration-id>/
32
+ <iteration-id>/
33
+ delivery-compass.md # 迭代状态 SSOT(frontmatter status)
34
+ README.md # 本迭代文档索引(有 guides/specs 时推荐)
35
+ guides/ # 探索笔记、过程指南、未锁定权衡
36
+ specs/ # 迭代级规格草案
37
+ ```
38
+
39
+ | 子路径 | 放什么 | 不放什么 |
40
+ |--------|--------|----------|
41
+ | **`delivery-compass.md`** | 范围、plans 表、验收、分支策略、close 摘要 | 长文探索正文(链到 `guides/` / `specs/`) |
42
+ | **`guides/`** | 候选方案、调研、会议记录、实施过程说明 | 已锁定的仓库级规范 |
43
+ | **`specs/`** | 本迭代演进中的规格、迭代内契约草稿 | 已锁定、跨迭代 `{SPECS_DIR}/` 级权威(应升格或已在 `{SPECS_DIR}/`) |
44
+ | **`README.md`** | 本 package 内 documents 索引(单表即可) | 替代根 `{ITERATION_DIR}/README.md` |
45
+
46
+ **索引**:
47
+
48
+ - **`{ITERATION_DIR}/README.md`**:**一行 = 一次迭代**(指向 `<iteration-id>/` 目录,**不**再拆 compass 行 + workspace 行)。
49
+ - **`<iteration-id>/README.md`**:列出本目录下 `guides/`、`specs/`(及其它文档);模板 → **`iteration-workspace-readme-template.md`**。
50
+
51
+ **Compass 解析顺序**(读):
52
+
53
+ 1. `{ITERATION_DIR}/<iteration-id>/delivery-compass.md`(canonical)
54
+ 2. Legacy flat:`{ITERATION_DIR}/<iteration-id>-delivery-compass.md`(仅兼容读;新写禁止)
55
+
56
+ **禁止(新写)**:根目录 `<iteration-id>-delivery-compass.md`、根目录 `<iteration-id>-working-guide.md`。轻量入口一律进 `<iteration-id>/guides/`。
57
+
58
+ ## `{SPECS_DIR}/` 准入(仓库级长期)
59
+
60
+ 写入 `{SPECS_DIR}/` 前须满足 **至少一条**(与 iteration package 区分):
61
+
62
+ - 决策**已锁定**,变更需显式评审
63
+ - 跨 plan、跨迭代仍成立
64
+ - 本迭代及后续 plan 的 **`primary_spec` / `spec_refs`** 权威来源
65
+
66
+ **不应**进 `{SPECS_DIR}/`:
67
+
68
+ - 仍在迭代内演进的草案 → **`<iteration-id>/specs/`**
69
+ - 探索 scratch → **`<iteration-id>/guides/`**
70
+ - 实施踩坑(未整理)→ 留 package 或 plan 素材,**close 时 compound 提升**
71
+
72
+ ## Knowledge 与 compound 提升
73
+
74
+ - **`{KNOWLEDGE_DIR}/` 新增**:默认仅在 **iteration-close** §3.2 **`mstar-compound`**。
75
+ - **提升来源(iteration-close)**:除 plan 实现/debug/review 素材外,**必须盘点** `{ITERATION_DIR}/<iteration-id>/**`(`guides/`、`specs/`、扁平文件;**默认排除** `delivery-compass.md` 除非 PM 显式纳入)。值得跨迭代复用的内容 → 按 compound 双轨模板**重写**进 `{KNOWLEDGE_DIR}/`(非整文件复制);细则 → **`mstar-compound`**「Iteration package promotion」。
76
+ - **提升后**:在源文件顶部或 package `README.md` 标注 `Promoted to: {KNOWLEDGE_DIR}/...`;源文件**保留**为迭代历史(或迁入 `<iteration-id>/archived/` 若团队约定)。
77
+ - **iteration-start §1.6**:product / architect **不得**向 `{KNOWLEDGE_DIR}/` **新增**;误写由 writing-specialist 迁回 **package**。
78
+
79
+ ## §1.6 各角色编辑范围
80
+
81
+ | 角色 | 必须编辑 | 禁止 |
82
+ |------|----------|------|
83
+ | **product-manager** | compass、plans、`{SPECS_DIR}/`、`{ITERATION_DIR}/<iteration-id>/`(guides/specs) | `{KNOWLEDGE_DIR}/` **新增**;迭代草案写入 `{SPECS_DIR}/` |
84
+ | **architect** | 同上 + package `specs/` 技术向 | 同上;在 `{SPECS_DIR}/` 堆实施踩坑 |
85
+ | **writing-specialist** | 当轮文档 + `{SPECS_DIR}/` corpus hygiene + 既有 knowledge 卫生 | 代替 compound **提升**;跳过 specs 全库审查 |
86
+
87
+ Phase 2 执行期:各角色可继续向 **`<iteration-id>/`** 追加 guides/specs;**仍不**直写 `{KNOWLEDGE_DIR}/`。
88
+
89
+ ## plans[].metadata 挂接
90
+
91
+ | 内容 | 挂接键 | 路径 |
92
+ |------|--------|------|
93
+ | 仓库级锁定规格 | `primary_spec` / `spec_refs` | `{SPECS_DIR}/` |
94
+ | 迭代上下文 | `iteration_compass` / `iteration_refs` | `{ITERATION_DIR}/<iteration-id>/delivery-compass.md` + 同目录下 docs |
95
+ | 知识库(已有) | 仅历史链接 | `{KNOWLEDGE_DIR}/` — **start 不新增** |
96
+
97
+ ## 反模式
98
+
99
+ - 用 `{KNOWLEDGE_DIR}/` 存迭代探索(应进 `<iteration-id>/guides/`)
100
+ - 把迭代 package 草案直接复制进 `{SPECS_DIR}/` 而不锁定评审
101
+ - iteration-close **只做** plan 素材 compound、**不**盘点 `<iteration-id>/` package
102
+ - 提升时整文件复制到 knowledge(应 compound 结构化重写)
103
+ - 新写仍把 compass 放在 `{ITERATION_DIR}/` 根目录(应用 `<iteration-id>/delivery-compass.md`)
@@ -0,0 +1,142 @@
1
+ # Iteration Compass Template
2
+
3
+ Copy this template when creating `{ITERATION_DIR}/<iteration-id>/delivery-compass.md`.
4
+
5
+ ```markdown
6
+ ---
7
+ iteration_id: <id>
8
+ start_date: YYYY-MM-DD
9
+ status: active
10
+ iteration_base_branch: <branch-or-ref>
11
+ target_branch: <branch>
12
+ plans: []
13
+ ---
14
+
15
+ # <iteration-id> Delivery Compass
16
+
17
+ ## Scope
18
+
19
+ 本迭代锁定的 spec 点:
20
+
21
+ - <spec point 1>
22
+ - <spec point 2>
23
+
24
+ ## Plans
25
+
26
+ | plan_id | Name | Status | Notes |
27
+ |---------|------|--------|-------|
28
+ | <plan-id-1> | <plan name> | Todo | |
29
+ | <plan-id-2> | <plan name> | Todo | |
30
+
31
+ Status values: `Todo` | `InProgress` | `InReview` | `Done` | `Blocked`
32
+
33
+ ## Milestones
34
+
35
+ | Milestone | Target date | Status |
36
+ |-----------|-------------|--------|
37
+ | Spec freeze | YYYY-MM-DD | pending |
38
+ | Dev complete | YYYY-MM-DD | pending |
39
+ | QC complete | YYYY-MM-DD | pending |
40
+ | Iteration close | YYYY-MM-DD | pending |
41
+
42
+ ## Acceptance Criteria
43
+
44
+ - <迭代级验收项 1>
45
+ - <迭代级验收项 2>
46
+
47
+ ## Non-Goals
48
+
49
+ - <明确排除项 1>
50
+ - <明确排除项 2>
51
+
52
+ ## Roadmap Position
53
+
54
+ - **Current iteration(<iteration-id>)**:<what this iteration delivers>
55
+ - **Next iteration**:<what comes next>,触发条件:<condition>,owner:<who>
56
+ - **最终目标**:<the long-term Done definition this iteration contributes to>
57
+
58
+ ## Delivery Branch Policy
59
+
60
+ > Mirror of frontmatter; keep in sync with workflow snapshot `{WORKFLOW_DIR}/<id>/snapshot.json` `branch` anchors.
61
+
62
+ | Field | Value |
63
+ |-------|-------|
64
+ | `iteration_base_branch` | <branch-or-ref integration branch is cut from> |
65
+ | `spec_integration_branch` | <e.g. iteration/<iteration-id>> |
66
+ | `target_branch` | <PR target after iteration-close> |
67
+
68
+ ## Risk Register
69
+
70
+ | Risk | Likelihood | Impact | Mitigation |
71
+ |------|-----------|--------|------------|
72
+ | <risk> | Low/Med/High | Low/Med/High | <mitigation> |
73
+
74
+ ## Iteration package
75
+
76
+ > Sibling paths under `{ITERATION_DIR}/<iteration-id>/` — not in `{SPECS_DIR}/` or `{KNOWLEDGE_DIR}/`. Promoted to knowledge at iteration-close via **`mstar-compound`**.
77
+
78
+ | Path | Purpose |
79
+ |------|---------|
80
+ | `guides/` | Exploration, process notes |
81
+ | `specs/` | Iteration-scoped spec drafts |
82
+ | `README.md` | Package document index (recommended when non-trivial) |
83
+
84
+ ## Quality Gate Summary
85
+
86
+ > Filled at iteration-close. Human summary only; per-plan gate details stay in each main plan, and open residual SSOT stays in `{PROJECT_DIR}/<id>/residuals.json`.
87
+
88
+ | plan_id | QC decision | QA gate | Residuals | Durable summary |
89
+ |---------|-------------|---------|-----------|-----------------|
90
+ | <plan-id-1> | Approve / Approve with residuals / Request Changes / N/A | mandatory / pm-acceptance / report-only / N/A | none / R1,R2 / accepted | `{PLAN_DIR}/<plan>.md#review-gate-summary` |
91
+
92
+ Notes:
93
+
94
+ - Raw review bundle: `{SDD_DIR}/review/` (ephemeral; do not rely on it after Done).
95
+ - Open residual SSOT: `{PROJECT_DIR}/<id>/residuals.json` `entries[<plan-id>]` (default `{HARNESS_DIR}/projects/<id>/`).
96
+
97
+ ## Compound Round Summary
98
+
99
+ > Filled at iteration-close.
100
+
101
+ - 结晶文档数:<N>
102
+ - 新增 CONCEPTS.md 条目:<N>
103
+ - 触发 compound-refresh:<是/否>
104
+
105
+ ## Iteration Retrospective (minimal)
106
+
107
+ > Filled at iteration-close.
108
+
109
+ - 做得好的:
110
+ - 可改进的:
111
+ - 下迭代建议:
112
+ ```
113
+
114
+ ## Fields guide
115
+
116
+ | Field | Required | When to fill |
117
+ |-------|----------|-------------|
118
+ | `iteration_id` | Yes | Phase 1 |
119
+ | `start_date` | Yes | Phase 1 |
120
+ | `end_date` | No | Phase 3 §3.4 only |
121
+ | `status` | Yes | Phase 1 → `active` / `locked`(§1.6 PM lock);Phase 3 §3.4 → **`completed`**(YAML frontmatter,非 prose completion status) |
122
+ | `iteration_base_branch` | Yes | Phase 1; integration branch must be created from this ref |
123
+ | `target_branch` | Yes | Phase 1; final PR target after Phase 3 |
124
+ | `plans` (frontmatter) | Recommended | Phase 1 (initial), Phase 2 (add new) |
125
+ | `## Plans` table | Yes | Phase 2 (sync status), Phase 3 (final) |
126
+ | `## Milestones` | Recommended | Phase 1, Phase 2 (update) |
127
+ | `## Acceptance Criteria` | Yes | Phase 1 |
128
+ | `## Non-Goals` | Yes | Phase 1 |
129
+ | `## Roadmap Position` | **Yes** | Phase 1(必填节,非散落于 general context prose);Phase 3 §3.3(current iteration → `delivered`) |
130
+ | `## Risk Register` | Optional | Phase 1, Phase 2 (update) |
131
+ | Iteration package (`guides/` / `specs/`) | Optional | Phase 1 §1.5.5; root index one row → `{ITERATION_DIR}/README.md` |
132
+ | `## Quality Gate Summary` | Yes | Phase 3 §3.4 |
133
+ | `## Compound Round Summary` | Yes | Phase 3 §3.4 |
134
+ | `## Iteration Retrospective` | Recommended | Phase 3 §3.4 |
135
+
136
+ ## Legacy compass drift
137
+
138
+ 若仓库中已有 compass **无** YAML frontmatter、**无** `## Roadmap Position`,或只有 prose completion status:
139
+
140
+ - **新迭代**:Phase 1 必须按本模板写入 **`{ITERATION_DIR}/<iteration-id>/delivery-compass.md`**,不延续 prose-only 或根目录 flat 文件惯例。
141
+ - **收口时**:`mstar-iteration` §3.0.5 在 Phase 3 入口规范化,再执行 §3.3–§3.4。
142
+ - **Legacy path**:若仍存在 `{ITERATION_DIR}/<iteration-id>-delivery-compass.md`,读时兼容;本轮若改写该迭代,迁入 `<iteration-id>/delivery-compass.md`。
@@ -0,0 +1,45 @@
1
+ # Iteration corpus hygiene(writing-specialist · §1.6)
2
+
3
+ > **When**: Phase 1 §1.6 — **writing-specialist** only, after product/architect landed compass / plans / `{SPECS_DIR}/` / **`{ITERATION_DIR}/<iteration-id>/`** package.
4
+ > **Boundaries**: **`iteration-artifact-boundaries.md`** — no `{KNOWLEDGE_DIR}/` adds @ start; iteration drafts → **`<iteration-id>/guides/`** or **`specs/`**.
5
+
6
+ ## Scope
7
+
8
+ | | Path | Notes |
9
+ |--|------|-------|
10
+ | **Primary** | `{SPECS_DIR}/**` | Full-tree hygiene (lock vs draft, naming, index) |
11
+ | **Included** | `{ITERATION_DIR}/<iteration-id>/**` | Package guides/specs + compass cross-links |
12
+ | **Existing only** | `{KNOWLEDGE_DIR}/**` | Archive / misplaced correction — **no** new knowledge docs |
13
+ | **Out of scope** | New `{KNOWLEDGE_DIR}/` writes | → **`mstar-compound`** @ iteration-close |
14
+
15
+ ## Placement corrections
16
+
17
+ | Found in | Misplaced as | Move to |
18
+ |----------|--------------|---------|
19
+ | `{SPECS_DIR}/` | Iteration-only draft → `{ITERATION_DIR}/<iteration-id>/specs/` or `guides/` |
20
+ | `{SPECS_DIR}/` | Implementation pitfall prose → package `guides/` or leave for compound |
21
+ | `{KNOWLEDGE_DIR}/` | New exploration from start chain → `<iteration-id>/guides/` or archive |
22
+ | Flat `{ITERATION_DIR}/*-working-guide.md`(legacy) | → `<iteration-id>/guides/` |
23
+ | Flat `{ITERATION_DIR}/*-delivery-compass.md`(legacy) | Prefer migrate to `<iteration-id>/delivery-compass.md` when touching that iteration |
24
+
25
+ ## Index updates(after edits)
26
+
27
+ 1. `{SPECS_DIR}/README.md`(若存在)— 规格索引
28
+ 2. `{KNOWLEDGE_DIR}/README.md` — Status / archive only(无新增行来自 start 链)
29
+ 3. `{ITERATION_DIR}/README.md` — **一行 = 一次迭代**(目录链接,非 compass+workspace 双行)
30
+ 4. `{ITERATION_DIR}/<iteration-id>/README.md` — Documents 单表列出 guides/specs(非 trivial 时创建)
31
+
32
+ ## Done signals
33
+
34
+ - Specs tree hygiene complete(draft vs locked clear)
35
+ - Package used for iteration-level drafts (`<iteration-id>/guides|specs/`)
36
+ - Misplaced knowledge / specs moved or archived with index Status updated
37
+ - No new `{KNOWLEDGE_DIR}/` documents from this chain
38
+
39
+ ## Close vs start
40
+
41
+ | Tree | Start (§1.6) | Close (§3.2 compound) |
42
+ |------|--------------|------------------------|
43
+ | `{SPECS_DIR}/` | Hygiene + lock clarity | Usually unchanged |
44
+ | `{ITERATION_DIR}/<id>/` | Create/edit drafts | **Inventory → promote** to `{KNOWLEDGE_DIR}/` |
45
+ | `{KNOWLEDGE_DIR}/` | Hygiene / archive only | **Primary write path** |
@@ -0,0 +1,27 @@
1
+ # Iteration package README (template)
2
+
3
+ Optional index inside `{ITERATION_DIR}/<iteration-id>/`. Copy when the package has more than a few files beyond `delivery-compass.md`.
4
+
5
+ ```markdown
6
+ # <iteration-id>
7
+
8
+ Iteration package — `delivery-compass.md` + specs/guides. Not `{KNOWLEDGE_DIR}/`. Worthy content is **promoted** at iteration-close via `mstar-compound`.
9
+
10
+ ## Documents
11
+
12
+ | Document | Kind | Description | Status |
13
+ |----------|------|-------------|--------|
14
+ | [delivery-compass.md](delivery-compass.md) | compass | Scope, plans, branch policy | active / locked / completed |
15
+ | [guides/<name>.md](guides/<name>.md) | guide | <purpose> | draft / active / promoted |
16
+ | [specs/<name>.md](specs/<name>.md) | spec | <purpose> | draft / locked-in-{SPECS_DIR} / promoted |
17
+
18
+ ## Promotion log (filled at iteration-close)
19
+
20
+ | Source | Promoted to | Date | Notes |
21
+ |--------|-------------|------|-------|
22
+ | | | | |
23
+ ```
24
+
25
+ **Kind**: `compass` | `guide` | `spec` | `other`
26
+
27
+ **Status values**: `draft` | `active` | `locked` | `completed` | `promoted` (link knowledge path) | `superseded` | `snapshot-only`
@@ -0,0 +1,205 @@
1
+ # Phase 2 control worktree + execution lease
2
+
3
+ Normative field names → field SSOT
4
+ `mstar-artifacts/references/status-and-residuals.md`; the **full lease
5
+ protocol prose** (single canonical copy) → `mstar-engine-legacy/references/lease-protocol.md`
6
+ (engine-absent fallback). This reference is the **iteration-command execution
7
+ checklist** — do not invent alternate lease field names; do not re-state the
8
+ full protocol here.
9
+
10
+ ## When it applies
11
+
12
+ **Phase 2+ command-layer only**(`iteration-start` ends before this; `iteration-drive`
13
+ / `iteration-loop` are Phase 2+ command layer). Defaults are **hard** unless the current turn
14
+ explicitly waives via Assignment `Worktree mode: waived` (or equivalent user
15
+ instruction). `Plan parallelism: serial` is **not** a waiver — it only forces
16
+ serial cross-plan **implement** scheduling while control worktree + leases remain
17
+ required.
18
+
19
+ Phase 1 Review & Edit may stay on the primary checkout. The control-worktree gate
20
+ starts at **Phase 2 entry**.
21
+
22
+ **Phase scope**:本参考仅约束 **Phase 2**(含 serial integration merge 与「control 禁止产品编辑 / 每 plan feature worktree」)。**Phase 5** PR merge-ready 修复 **不**沿用该产品编辑隔离——直接在 control / `spec_integration_branch` 上改,**禁止**另开 Phase 5 fix worktree → **`phase-4-5-pr-delivery.md`** §5.0。
23
+
24
+ ## Control worktree (Phase 2 entry)
25
+
26
+ 1. Resolve all active plans' `metadata.spec_integration_branch` to the **same**
27
+ integration branch (STOP if mismatch).
28
+ 2. Resolve or create the **control worktree** (usually primary checkout or
29
+ PM-designated path) checked out to that `spec_integration_branch`.
30
+ 3. Verify `git branch --show-current` equals `spec_integration_branch`; working
31
+ tree clean before merge operations.
32
+ 4. Record canonical absolute repository-root path in the workflow
33
+ snapshot top-level `control_worktree_path` (not `{HARNESS_DIR}`; canonicalize symlinks).
34
+ 5. Resolve coordination paths from that root (default-gitignored process artifacts live on the **control filesystem**, not as Git blobs):
35
+ - status register: `<control_worktree_path>/{HARNESS_DIR}/status.json` (v2 root — active workflow entries)
36
+ - snapshot SSOT: `<control_worktree_path>/{WORKFLOW_DIR}/<id>/snapshot.json` (plan rows + leases + branch anchors)
37
+ - project register: `<control_worktree_path>/{PROJECT_DIR}/<id>/residuals.json`
38
+ - plans SSOT: `<control_worktree_path>/{PLAN_DIR}/` (or `<control>/{HARNESS_DIR}/plans/`)
39
+ - iterations SSOT: `<control_worktree_path>/{ITERATION_DIR}/`
40
+ - SDD tree: `<control_worktree_path>/{HARNESS_DIR}/sdd/<plan-id>/`
41
+
42
+ All sessions MUST reread the **control copy** of the workflow snapshot immediately before
43
+ claim, release, transfer, plan-status transition, or merge-lease mutation.
44
+
45
+ **Do not** set `Worktree mode: waived` because a feature worktree lacks
46
+ `plans/` under default gitignore — keep feature worktrees and pass absolute
47
+ control **`Plan Path`** / **`SDD dir`** in Assignments
48
+ (`mstar-branch-worktree` 「Harness path SSOT under default gitignore」).
49
+
50
+ ### Same-host exclusive write lock
51
+
52
+ All control-path lease mutations (claim, release, transfer, merge-lease
53
+ claim/release) **MUST** run inside a same-host exclusive write lock for the full
54
+ read-check-replace-verify sequence. Engine writers acquire the lock
55
+ automatically (`writeWorkflowSnapshot` / `registerWorkflow` use
56
+ `<status-file dir>/.status-write.lockdir/` — for snapshots the lockdir lands
57
+ inside `workflows/<id>/`); for manual edits prefer the engine-check commands
58
+ (`mstar lease verify --workflow <id>`, `mstar worktree check`) over hand-rolled
59
+ `flock`. The atomic-mkdir alternative (`.status-write.lockdir/` in the same
60
+ directory as the file) remains the documented fallback. Do **not** invent a
61
+ distributed CAS CLI.
62
+
63
+ **Cross-plan parallel hard gate:** Applies **whether or not** `Worktree mode: waived`.
64
+ Lease-gated **cross-plan parallel** writable implement is allowed **only when**
65
+ this same-host lock is **available on the coordination snapshot path and
66
+ used for every coordination mutation** in that Phase 2 session (control path
67
+ when lease gate active; primary checkout `{HARNESS_DIR}/status.json` + snapshot
68
+ when waived). Agents on **different hosts** or with **no shared flock/lockdir** →
69
+ default **`Plan parallelism: serial`** (preferred when waived). **No flock
70
+ does not waive** control worktree / feature worktree / leases — serial
71
+ scheduling only. Assignment still
72
+ claiming cross-plan parallel without lock availability → **Blocked** until PM
73
+ sets serial scheduling or the user gives current-turn override
74
+ `Cross-host lease race: accepted` (or equivalent) + audit on snapshot plan
75
+ `notes` / `notes.jsonl`.
76
+ **`Worktree mode: waived` alone is not** this override.
77
+
78
+ Immediately before **any** writable implement dispatch, re-read the control
79
+ snapshot and re-verify `execution_lease` holder + paths match this session;
80
+ mismatch → **STOP**.
81
+
82
+ > **Lease Engine-check:** canonical callout lives in `mstar-artifacts` `SKILL.md`(Engine-check lease 行)— this file carries the execution checklist only.
83
+
84
+ ## Feature worktree (per plan)
85
+
86
+ - Each concurrently active plan uses a **distinct** absolute feature-worktree
87
+ path and dedicated feature branch from `spec_integration_branch`.
88
+ - `execution_lease.worktree_path` MUST differ from
89
+ `control_worktree_path` (never reuse the control checkout for product
90
+ edits).
91
+ - `Worktree path` MUST appear in the writable Assignment and in the snapshot
92
+ plan row's `execution_lease.worktree_path` before first writable implement dispatch.
93
+ - Product/source edits run from the feature worktree; plans, iterations,
94
+ status, and SDD coordination reads/writes run through **absolute control
95
+ paths** (never relative `.mstar/...` from the feature cwd when L1 is active).
96
+ - Assignment MUST include absolute feature **`Worktree path`** and absolute
97
+ control **`Plan Path`** / **`SDD dir`** before writable implement dispatch.
98
+ - Default **L1**: one writable track per plan. Within-plan multi-writable tracks
99
+ still follow L2 `parallel-writable-pre-dispatch` (`mstar-branch-worktree`).
100
+
101
+ ## Execution lease (`plans[].execution_lease` in the workflow snapshot)
102
+
103
+ Required shape (v1): `holder`, `claimed_at` (RFC 3339 UTC with `Z`),
104
+ `worktree_path`, `working_branch`; optional `session_label` (display only).
105
+ Lives on the snapshot plan row — `{WORKFLOW_DIR}/<id>/snapshot.json` → `plans[]`.
106
+
107
+ ### Claim (before `InProgress` or writable dispatch)
108
+
109
+ 1. Read the control snapshot; locate exactly one plan row (`id` read compatibility).
110
+ 2. If `execution_lease` exists:
111
+ - **Same `holder` as this session** → **resume**: verify `worktree_path` and
112
+ `working_branch` match the Assignment; continue (not steal/block).
113
+ - **Different `holder`** → **Blocked** (no timestamp makes it stealable).
114
+ 3. Create or verify dedicated feature worktree + branch (default `<repoRoot>/.worktrees/<plan-id>-<slug>`).
115
+ 4. Re-read the snapshot under write lock; if row/status/lease changed, restart claim.
116
+ 5. One complete-file update (still under lock): `status: "InProgress"` + full `execution_lease`.
117
+ Use temp file + atomic replace; never expose partial JSON.
118
+ 6. Re-read and verify `holder`, `worktree_path`, `working_branch` match before
119
+ any writable dispatch.
120
+
121
+ ### Hold, release, override
122
+
123
+ - Lease stays active across `InProgress` and `InReview` (including post-QC/QA
124
+ ready-to-merge) unless released or transferred.
125
+ - Normal release: re-read the control snapshot under write lock; confirm stored `holder` matches
126
+ this session — mismatch → **Blocked**; then **delete** `execution_lease`
127
+ (never `null` or tombstone).
128
+ - `Done` authority deletes `execution_lease` in the same update as `status: "Done"`
129
+ — **only after** successful integration merge (when lease gate not waived).
130
+ - Override of another holder requires **explicit user instruction this turn** +
131
+ audit note on snapshot plan `notes` / `notes.jsonl` (prior holder, new holder/release, user authorized).
132
+ - V1: **manual release only** — no `expires_at`, TTL, or heartbeat authority.
133
+
134
+ ### Orphan `InProgress` without lease
135
+
136
+ If a plan row is `InProgress` but has **no** `execution_lease` in the snapshot, STOP and
137
+ escalate — do not invent a lease or writable-dispatch. Unattended "Recover with
138
+ claim" is permitted **only** for the **same** stable `holder`; different holder
139
+ requires verified quiescence + handoff or current-turn user override + audit.
140
+ Recovery semantics → `mstar-artifacts` (not iteration skill).
141
+
142
+ ## Multi-plan parallelism
143
+
144
+ **Cross-plan parallel safety gate** applies **whether or not** `Worktree mode:
145
+ waived` is in effect — waiver does **not** authorize lockless cross-host parallel.
146
+
147
+ - **Feature implementation** MAY proceed in parallel across **different plan IDs**
148
+ only when **one** of:
149
+ 1. Same-host exclusive write lock is available on the coordination
150
+ snapshot path (control path when lease gate active; primary checkout
151
+ `{HARNESS_DIR}/status.json` + snapshot when waived) and used for every coordination
152
+ mutation in that session; **and** when lease gate is not waived, each plan
153
+ holds a verified, distinct `execution_lease` and feature worktree.
154
+ 2. **`Plan parallelism: serial`** (default when waived; preferred default under
155
+ waiver).
156
+ 3. Current-turn `Cross-host lease race: accepted` (or equivalent) + audit
157
+ snapshot plan `notes` / `notes.jsonl`.
158
+ Cross-host / no shared lock without (2) or (3) → **Blocked** if Assignment still
159
+ claims cross-plan parallel writable implement.
160
+ - **Integration merge** into `spec_integration_branch` is **serial** (one at a time),
161
+ with or without lease gate.
162
+
163
+ ## Integration merge lease (snapshot top-level `integration_merge_lease`)
164
+
165
+ Required shape (v1): `holder`, `claimed_at`, `plan_id`, `source_branch`,
166
+ `target_branch` (= resolved `spec_integration_branch`); optional `session_label`.
167
+ Lives top-level on the snapshot — `{WORKFLOW_DIR}/<id>/snapshot.json`.
168
+
169
+ 1. From control worktree: clean tree; branch = `spec_integration_branch`.
170
+ 2. Under write lock, re-read the snapshot. If `integration_merge_lease` exists:
171
+ - **Same `holder` as this session** → **resume**: verify `plan_id`,
172
+ `source_branch`, `target_branch` match intended merge; confirm control
173
+ worktree state; continue (not steal/block).
174
+ - **Different `holder`** → **Blocked** (cannot expire or steal).
175
+ 3. If unclaimed, claim merge lease (same read-check-replace-verify as execution claim).
176
+ 4. Only merge-lease holder runs integration from `control_worktree_path`.
177
+ 5. On success: record merge commit/evidence; delete merge lease; set plan
178
+ **`Done`** and delete `execution_lease` in the same locked update.
179
+ 6. On conflict/failure: retain leases; plan stays **`InReview`** — do not set
180
+ `Done`. Release merge lease only after control worktree is clean and known state.
181
+
182
+ Execution and merge leases may coexist; merge lease does not grant execution
183
+ ownership for the source plan.
184
+
185
+ ## Waiver
186
+
187
+ Explicit `Worktree mode: waived` (or equivalent user instruction) this turn
188
+ waives **only**:
189
+
190
+ - Control worktree establishment and control-path SSOT routing
191
+ - Per-plan feature worktree defaults
192
+ - Snapshot lease claim/hold/release defaults (`plans[].execution_lease` and top-level `integration_merge_lease`)
193
+
194
+ It does **not** waive the **cross-plan parallel safety gate**. Under waiver,
195
+ cross-plan **parallel writable** implement still requires same-host exclusive
196
+ write lock on the coordination snapshot path, default **`Plan parallelism:
197
+ serial`**, or current-turn `Cross-host lease race: accepted` + audit
198
+ snapshot plan `notes` / `notes.jsonl`. **Prefer serial scheduling when waived**; parallel under waiver
199
+ only with the race-accepted override (or same-host lock when mutating shared
200
+ state).
201
+
202
+ `Plan parallelism: serial` does **not** waive control worktree or leases.
203
+
204
+ Iteration commands MUST NOT infer waiver from missing worktrees or single-session
205
+ starts. Explicit override this turn only.