@mstar-harness/dsh 3.8.2 → 3.9.0

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 (69) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +1 -1
  3. package/README.zh.md +1 -1
  4. package/dist/client/panel/locale.d.ts +1 -1
  5. package/dist/client.js +5 -5
  6. package/dist/index.js +1293 -955
  7. package/dist/types.d.ts +2 -2
  8. package/harness-commands/amazing-e2e-check.md +10 -0
  9. package/harness-commands/iteration-drive.md +13 -7
  10. package/harness-commands/iteration-loop.md +10 -10
  11. package/harness-commands/iteration-start.md +10 -10
  12. package/harness-skills/mstar-artifacts/SKILL.md +3 -3
  13. package/harness-skills/mstar-artifacts/references/plan-files-and-reports.md +2 -2
  14. package/harness-skills/mstar-artifacts/references/plan-quality-bar.md +14 -12
  15. package/harness-skills/mstar-artifacts/references/status-and-residuals.md +12 -8
  16. package/harness-skills/mstar-artifacts/templates/plan.main.md +21 -6
  17. package/harness-skills/mstar-audit/SKILL.md +5 -5
  18. package/harness-skills/mstar-branch-worktree/SKILL.md +69 -28
  19. package/harness-skills/mstar-branch-worktree/references/parallel-writable-pre-dispatch.md +9 -8
  20. package/harness-skills/mstar-coding-behavior/SKILL.md +8 -8
  21. package/harness-skills/mstar-conventions/SKILL.md +2 -2
  22. package/harness-skills/mstar-dispatch-gates/SKILL.md +10 -8
  23. package/harness-skills/mstar-e2e/SKILL.md +40 -0
  24. package/harness-skills/mstar-e2e/references/report-template.md +32 -0
  25. package/harness-skills/mstar-engine-legacy/references/lease-protocol.md +12 -9
  26. package/harness-skills/mstar-engine-legacy/references/qc-seat-n-restatements.md +3 -3
  27. package/harness-skills/mstar-engine-legacy/references/status-field-history.md +3 -3
  28. package/harness-skills/mstar-harness-core/SKILL.md +14 -1
  29. package/harness-skills/mstar-host/references/_shared/host-role-binding-core.md +1 -1
  30. package/harness-skills/mstar-host/references/codex.md +6 -4
  31. package/harness-skills/mstar-host/references/cursor.md +1 -1
  32. package/harness-skills/mstar-host/references/dsh-workflow-scripts.md +4 -4
  33. package/harness-skills/mstar-host/references/dsh.md +10 -8
  34. package/harness-skills/mstar-host/references/kimi.md +3 -3
  35. package/harness-skills/mstar-host/references/omp.md +3 -3
  36. package/harness-skills/mstar-host/references/parallel-dispatch.md +6 -6
  37. package/harness-skills/mstar-host/references/zcode.md +4 -4
  38. package/harness-skills/mstar-iteration/SKILL.md +19 -13
  39. package/harness-skills/mstar-iteration/references/command-shared-invariants.md +2 -1
  40. package/harness-skills/mstar-iteration/references/phase-1-prepare.md +4 -2
  41. package/harness-skills/mstar-iteration/references/phase-2-worktree-lease.md +73 -49
  42. package/harness-skills/mstar-iteration/references/phase-3-iteration-close.md +4 -4
  43. package/harness-skills/mstar-iteration/references/phase-4-5-pr-delivery.md +6 -5
  44. package/harness-skills/mstar-iteration/references/phase-6-post-merge-close.md +71 -0
  45. package/harness-skills/mstar-review-qc/SKILL.md +5 -4
  46. package/harness-skills/mstar-review-qc/references/review-responsibility-boundaries.md +9 -7
  47. package/harness-skills/mstar-roles/SKILL.md +2 -0
  48. package/harness-skills/mstar-roles/references/_shared/leaf-executor-core.md +9 -0
  49. package/harness-skills/mstar-roles/references/ops-engineer.md +3 -0
  50. package/harness-skills/mstar-roles/references/project-manager/dispatch-and-assignment.md +22 -17
  51. package/harness-skills/mstar-roles/references/project-manager/qa-trigger-matrix.md +7 -5
  52. package/harness-skills/mstar-roles/references/project-manager/qc-and-residuals.md +2 -2
  53. package/harness-skills/mstar-roles/references/project-manager/routing-and-dev-allocation.md +2 -2
  54. package/harness-skills/mstar-roles/references/project-manager.md +5 -4
  55. package/harness-skills/mstar-roles/references/prompt-engineer.md +1 -1
  56. package/harness-skills/mstar-roles/references/qa-engineer/acceptance-gate.md +27 -13
  57. package/harness-skills/mstar-roles/references/qa-engineer.md +7 -4
  58. package/harness-skills/mstar-roles/references/qc-specialist/deep-review-lenses.md +5 -5
  59. package/harness-skills/mstar-roles/references/qc-specialist/report-template.md +2 -0
  60. package/harness-skills/mstar-roles/references/qc-specialist/reviewer-checklist.md +1 -1
  61. package/harness-skills/mstar-roles/references/qc-specialist/reviewer-workflow.md +5 -4
  62. package/harness-skills/mstar-roles/references/qc-specialist-shared.md +3 -1
  63. package/harness-skills/mstar-sdd/SKILL.md +19 -11
  64. package/harness-skills/mstar-sdd/references/file-handoffs.md +61 -23
  65. package/harness-skills/mstar-sdd/references/implementer-continuation-prompt.md +9 -4
  66. package/harness-skills/mstar-sdd/references/implementer-prompt.md +11 -6
  67. package/harness-skills/mstar-sdd/references/sticky-implementer-session.md +4 -2
  68. package/harness-skills/mstar-sdd/references/task-reviewer-prompt.md +8 -4
  69. package/package.json +1 -1
@@ -10,7 +10,7 @@
10
10
  | `inline` (hotfix) / explicit `QC mode: single` override | `qc-specialist` ×1 | **N=1** |
11
11
  | Targeted re-review (`QC re-review: targeted — reviewers: <ids>`) | the listed seats only | N = listed count (1–3) |
12
12
 
13
- Rules that never change: tri seats dispatch **in one message** with a branch review-package path (`{SDD_DIR}/review/qc1.md`…`qc3.md` + `qc-consolidated.md`); post-dispatch verify three distinct agent ids; `Execution mode: inline` with `QC mode: full tri-review` still launches the three seats; SDD implement/reviewer dispatches stay **serial** (never parallel implementers for the same plan); each invoke must carry the role-binding field set to `Execute as` even at N=1.
13
+ Rules that never change: tri seats dispatch **in one message** with a branch review-package path (`{SDD_DIR}/review/qc1.md`…`qc3.md` + `qc-consolidated.md`); post-dispatch verify three distinct agent ids; `Execution mode: inline` with `QC mode: full tri-review` still launches the three seats; SDD independent ready tasks run concurrently after isolation (`mstar-sdd` § Ready-task scheduling); tri seat count never grants full review scope; each invoke must carry the role-binding field set to `Execute as` even at N=1.
14
14
 
15
15
  ## Per-host restatements (full text)
16
16
 
@@ -19,7 +19,7 @@ Rules that never change: tri seats dispatch **in one message** with a branch rev
19
19
  - **`Execution mode: sdd`**: **N=3** task entries — prefer `agent: "qc-specialist"`, `"qc-specialist-2"`, `"qc-specialist-3"` when listed; each body still **Act as** the respective QC role + QC skill load. If a seat is missing from the live schema, fall back per C5 (generic + C5b) for that seat only. N rules → `parallel-dispatch.md`.
20
20
  - **`inline`**: **N=1** per `parallel-dispatch.md`.
21
21
  - Cannot emit required **N** → **`Blocked`**.
22
- - SDD implement: one implementer `task` entry per task id with `agent` matching the implementer role when listed; task reviewer = new entry with `agent: "code-reviewer"` (omp L2 review; not qc-specialist*) or `agent: "reviewer"`/`"task"` fallback + C5b; serial rule → `parallel-dispatch.md`.
22
+ - SDD implement: one implementer `task` entry per task id with `agent` matching the implementer role when listed; task reviewer = new entry with `agent: "code-reviewer"` (omp L2 review; not qc-specialist*) or `agent: "reviewer"`/`"task"` fallback + C5b; ready-task scheduling → `parallel-dispatch.md`.
23
23
 
24
24
  ### opencode (`task` tool, `subagent` field)
25
25
 
@@ -31,7 +31,7 @@ Rules that never change: tri seats dispatch **in one message** with a branch rev
31
31
 
32
32
  - **`Execution mode: sdd`**: **N=3** Tasks (`qc-specialist`, `qc-specialist-2`, `qc-specialist-3`) + branch review-package path (N rules → `parallel-dispatch.md`).
33
33
  - **`inline`**: **N=1** per `parallel-dispatch.md`.
34
- - SDD implement/reviewer: serial — implementer Task per task id with `subagent_type` matching the implementer role when listed; task reviewer = new Task with `subagent_type: "code-reviewer"` (Cursor L2; not qc-specialist*) when listed, else generic fallback per C5 — no `resume` for reviewers.
34
+ - SDD implement/reviewer: ready-task scheduling per `mstar-sdd` — implementer Task per task id with `subagent_type` matching the implementer role when listed; task reviewer = new Task with `subagent_type: "code-reviewer"` (Cursor L2; not qc-specialist*) when listed, else generic fallback per C5 — no `resume` for reviewers.
35
35
 
36
36
  ### codex (custom-agent / multi-agent tools only)
37
37
 
@@ -83,7 +83,7 @@ Closed residual entries added: `lifecycle`, `closed_at`, `closure_note`; optiona
83
83
  | --- | --- | --- | --- |
84
84
  | `holder` | non-empty string | Yes | Opaque cooperative owner identity (recommended `<host>:<stable-session-id>`, e.g. `cursor:bc-1234`); stable for claim lifetime; **no credentials**; used for ownership comparison — not `session_label`. |
85
85
  | `claimed_at` | RFC 3339 UTC (`Z`) | Yes | Acquisition time (audit only; **not** an expiry clock). |
86
- | `worktree_path` | absolute path string | Yes | Dedicated feature-worktree root; **MUST** differ from `metadata.control_worktree_path`. |
86
+ | `worktree_path` | absolute path string | Yes | Dedicated feature-worktree root; **MUST** differ from `metadata.control_worktree_path` (v1-historical name; canonical snapshot member = `integration_worktree_path`). |
87
87
  | `working_branch` | non-empty string | Yes | Feature branch at `worktree_path`; MUST agree with Assignment `Working branch`. |
88
88
  | `session_label` | string | No | Human display only — **MUST NOT** authorize or compare ownership. |
89
89
 
@@ -99,7 +99,7 @@ Writers **delete** `execution_lease` on release; `null` and tombstone objects ar
99
99
  | `notes` | array | **Legacy** — prefer `{HARNESS_DIR}/notes.json`. |
100
100
  | `residual_findings_history` | object | **Legacy** — prefer `archived/residuals/<plan-id>.json`. |
101
101
  | `tech_debt_summary` | object | Optional rollup over open R# (engine `techDebtRollup`). |
102
- | `control_worktree_path` | absolute path string | Iteration Phase 2: canonical repository root checked out to active `spec_integration_branch`; coordination + serial merge cwd. |
102
+ | `control_worktree_path` | absolute path string | **v1-historical (read-alias)**. Iteration Phase 2: canonical repository root checked out to active `spec_integration_branch`; coordination + serial merge cwd. Canonical snapshot member = **`integration_worktree_path`** (dedicated integration checkout, distinct from the main worktree); `readWorkflowSnapshot` normalizes the old key in memory with a medium diagnostic — canonical writers reject it. |
103
103
  | `integration_merge_lease` | object | While one integration merge is owned; **absent** = unclaimed. Writers **delete** the key on release — never `null`/tombstones. |
104
104
 
105
105
  ## v1 residual entry contract (9 required fields + severity/lifecycle)
@@ -163,7 +163,7 @@ Legacy read paths (root `residual_findings` / `metadata.residual_findings` / `ar
163
163
  | root `plans[]` rows | `{WORKFLOW_DIR}/<id>/snapshot.json` → `plans[]` (legacy PlanRow shape verbatim) |
164
164
  | root `plans[].execution_lease` | snapshot plan row `execution_lease` |
165
165
  | root `metadata.integration_merge_lease` | snapshot top-level `integration_merge_lease` |
166
- | root `metadata.control_worktree_path` | snapshot top-level `control_worktree_path` |
166
+ | root `metadata.control_worktree_path` | snapshot top-level `integration_worktree_path` (v1 key is a read-alias; canonical writers emit only the new name) |
167
167
  | root `metadata.iteration_base_branch` / `target_branch` / `spec_integration_branch` / `merge_target` | snapshot top-level `branch.{base,integration,target}` |
168
168
  | root `metadata.plan_parallelism` / `worktree_mode` / `push_policy` | snapshot `execution_policy` |
169
169
  | root `metadata.notes` / legacy row `notes` | `{WORKFLOW_DIR}/<id>/notes.jsonl` (runtime ledger; row `notes` kept verbatim as legacy copy) |
@@ -93,7 +93,7 @@ PM 在 Assignment 写 **`Task category`**(主类 + 可选 `secondary`):
93
93
  | `mstar-harness-core` | 本文件:入口、状态机、Task category、explore、索引、护栏 |
94
94
  | `mstar-phase-gates` | per-plan 双阶段门禁:Prepare/Execute、意图门禁、hotfix、可验证编辑 |
95
95
  | `mstar-iteration` | 迭代管理:Phase 1–5(start / Autonomous Execute / iteration-close / PR delivery / PR merge-ready loop) |
96
- | `mstar-dispatch-gates` | 派发、Delegation、反递归、SDD 串行、SDD 路径 plan QC 强制 tri |
96
+ | `mstar-dispatch-gates` | 派发、Delegation、反递归、依赖与隔离驱动并行、SDD 路径 plan QC 强制 tri |
97
97
  | `mstar-engine-legacy` | 条件契约档案(engine-absent fallback):status v1→v2 字段历史、lease 协议全文、各宿主 N=3/N=1 重述、反递归全清单、Engine-check 样板;engine 激活时不加载 |
98
98
  | `mstar-sdd` | Subagent-driven development:file handoff、per-task review、ledger |
99
99
  | `mstar-branch-worktree` | 功能分支、worktree、QC/QA 检出对齐 |
@@ -108,6 +108,7 @@ PM 在 Assignment 写 **`Task category`**(主类 + 可选 `secondary`):
108
108
  | `mstar-strategy` | `STRATEGY.md` 全局战略方向 —— 产品愿景、技术方向、决策原则 |
109
109
  | `mstar-skill-authoring` | 通用 skill 撰写门控(SkillsBench 六原则):trigger 契约、紧凑 5 问 body、渐进披露、paired 证据 |
110
110
  | `mstar-audit` | Variant carrier:common core(hard rules、recon、vet、variant dispatch)+ SKILL.md `## Plan output (all variants)`(Status block、plan files、handoff)+ `references/codebase-audit.md`(full-audit 变体:9 类别 fan-out、effort、scope variants、Phase 4 excerpt/reconcile、audit index 模板)+ `references/security-review.md`(security 深查:exploitability 门槛、FP 纪律、LLM/供应链面)+ `references/pr-review.md`(`pr` 变体);`audit-playbook` + `finding-format` + `plan-quality-bar` |
111
+ | `mstar-e2e` | 用户显式启动的独立真实浏览器 / 真机 / E2E 验证 workflow;PM 编排、ops 执行,不进入迭代 QA gate |
111
112
  | `mstar-roles` | 角色正文 hub |
112
113
  | `mstar-host` | 宿主适配(自动识别;`references/opencode.md` / `cursor.md` / `codex.md` / `kimi.md` / `parallel-dispatch.md`) |
113
114
 
@@ -130,6 +131,18 @@ Read **`mstar-host`** after this skill; detect host per its table, then Read the
130
131
  - **CLI 较新** → 提示用户更新宿主插件;**插件较新** → 提示用户更新全局 CLI(`npm i -g @mstar-harness/cli@latest`)。
131
132
  - 触发纪律:harness 行为异常/疑似过期、已知新版本发布后、或用户要求时运行——**不是**每个会话都跑。
132
133
 
134
+ ## 定向执行与验证边界
135
+
136
+ 本节是全部角色的范围与验证授权 SSOT;角色方法只展开其执行细节,`Skill presets: none` 仍由共享 leaf 边界承接这些限制。
137
+
138
+ - **本地全量测试默认禁止,完整套件交 CI。** 只有用户明确许可才能例外;Assignment 的 `Constraints` 引用许可,`Evidence Required` 写明命令、范围、环境与次数。PM 字段、风险等级、缺证据、fix wave 和早期探索都不产生许可;不得拆成多个无关“小测试”绕过全量边界。
139
+ - **全域只读调查限早期探索。** 实现、fix、QC、QA 只查本次变更、直接影响接口及相关 knowledge;不重新全仓扫描、测试或审查。通过知识索引只选相关 Active 条目;缺口超出范围时报告具体所缺信息,不自行扩展任务。
140
+ - **验证按变更映射。** 可执行逻辑使用对应单测;非可执行文档与 prompt/skill 策略使用真实定向静态或 before/after 证据,不制造测试文件。SDD 的 `Verification mode: scoped-check` 格式与适用性 → `mstar-sdd/references/file-handoffs.md`。报告结构校验不证明命令执行或 diff 适用性,也不是任意 shell 拦截器。
141
+ - **只使受影响证据失效。** HEAD 或 Review range 改变不等于全部重跑;复用仍有效的 L1/CI/先前 QA 证据,记明原范围及仍适用的理由。fix 只验证相关回归;QC 复审只看归属 finding、fix delta 与直接接口。`full tri-review` 表示席位数量,不授权全仓 review;QC 不运行 test/build/install。
142
+ - **QA 仅定向单元测试与验收证据映射。** 模式仅 `acceptance-only` / `targeted` / `report-only`。用户许可的本地全量由实现 owner 或 ops 另接明确行动,QA 只消费证据。真实浏览器、真机、安装/部署 E2E 仅由用户显式启动独立 `mstar-e2e` workflow,PM 编排、ops 执行;不作为迭代 QA gate。未验证的真实环境行为如实记录,不伪称通过。
143
+ - **依赖允许即并行。** PM 对无依赖、写所有权及 worktree 隔离的 ready tasks 并行派发;共享写目标、同一 session/ledger、前置接口与 integration merge 才按具体约束串行。leaf 不因并行策略获得派发权限。
144
+ - **完成即交付。** Assignment 给出任务、输入、所有权、允许检查与可观察结果;执行者只解答这些问题,不重复分析已解决内容、不顺手修复或增加“保险”检查。真实范围缺口返回 PM,已有证据充分即停止。
145
+
133
146
  ## 核心研发守则
134
147
 
135
148
  全局工程不变量,适用于所有角色;实现级操作细节(The Ladder、surgical、debugging 等)→ **`mstar-coding-behavior`**。
@@ -29,7 +29,7 @@ Paste-only Assignment **without** an invoke call is **not** dispatch.
29
29
  - **1 Assignment ⇒ 1 invoke**: one invoke call carrying the full Assignment body per assignee.
30
30
  - **Parallel batch N**: **N** invocations in **one** assistant message (mechanics → **`parallel-dispatch.md`**).
31
31
  - **No invoke call** → **Not dispatched** — paste-only / `dispatch incomplete`.
32
- - **Anti-recursion NEVER**: leaf executors are already `Execute as` — **no** recursive invoke of the same role; Assignment wins (`Delegation: forbidden` unless stated). **Never** multiple implementer invokes in one message for the same plan (SDD serial → **`parallel-dispatch.md`** § SDD implement).
32
+ - **Anti-recursion NEVER**: leaf executors are already `Execute as` — **no** recursive invoke of the same role; Assignment wins (`Delegation: forbidden` unless stated). Independent ready implementers may run concurrently after isolation; scheduling → **`parallel-dispatch.md`** § SDD implement.
33
33
 
34
34
  ## Assignment / prompt template
35
35
 
@@ -10,7 +10,7 @@ Parallel PM dispatch: read **`parallel-dispatch.md`** only when Codex exposes an
10
10
 
11
11
  - Plugin source: `.codex-plugin/plugin.json`.
12
12
  - Runtime skills: repo `skills/` mounted by the Codex plugin (`"skills": "./skills/"`).
13
- - Custom agent source: repo `codex/agents/*.toml`; CLI/manual install links these into `~/.codex/agents/` or project `.codex/agents/`.
13
+ - Custom agent source: repo `codex/agents/*.toml`; CLI install copies these as regular files into `~/.codex/agents/` or project `.codex/agents/`.
14
14
  - **`/pm`** or **`pm` skill**: force PM entry → `mstar-roles` → `project-manager.md` (Codex primary; Cursor/OpenCode for general per-plan work). **`commands/`** when running iteration Phase 1–5; project CLI install (`mstar-harness init --target codex --scope project`) materializes `iteration-start`, `iteration-drive`, and `iteration-loop` as `.agents/skills/<name>/SKILL.md` symlinks.
15
15
  - Role files under root `agents/` are for hosts that load OpenCode/Cursor-style agent shells; Codex uses `codex/agents/*.toml` and still loads `mstar-roles` references directly.
16
16
  - Tool and plugin availability can be lazy-loaded or session-dependent. Use the tools actually present in the current session; do not infer capability from documentation alone.
@@ -35,9 +35,11 @@ Use skill names in prompts and references. Avoid absolute local paths unless the
35
35
 
36
36
  ## Dispatch and role execution
37
37
 
38
- - **No invoke tool / no linked custom agent = no dispatch**: printing `## Assignment` does not start another Codex worker.
39
- - If Codex exposes custom-agent / multi-agent tools and matching Morning Star agents are linked, PM may dispatch through those tools and must follow `parallel-dispatch.md`.
38
+ - **No invoke tool / no available custom agent = no dispatch**: printing `## Assignment` does not start another Codex worker.
39
+ - If Codex exposes custom-agent / multi-agent tools and matching Morning Star agents are available, PM may dispatch through those tools and must follow `parallel-dispatch.md`.
40
40
  - If no invoke tool is present when dispatch is required, return **`Blocked`** — report missing invoke capability to the user. Do not substitute single-session role execution in the PM thread unless the user explicitly overrides harness dispatch for this turn.
41
+ - Bind the role using the actual invoke schema. For example, when `collaboration.spawn_agent` exposes `agent_type`, set `agent_type: "fullstack-dev"` for `Execute as: fullstack-dev`; do not guess another host's parameter name.
42
+ - Discovery does not prove loading: an advertised role may still fail to start. Record the actual invocation error; a role-load failure is not a missing-tool failure. For installed TOML issues, use `mstar-harness doctor --target codex --scope <global|project>` and repair via `init` for that scope, then retry the named role. Claim dispatch only after a successful invocation.
41
43
  - QC: N rules → **`parallel-dispatch.md`** (**`Execution mode: sdd`** → N=3; **`inline`** → N=1) when a callable invoke tool exists. Cannot emit required **N** → **`Blocked`**.
42
44
  - Leaf executors still follow `mstar-dispatch-gates`: no recursive Task/subagent calls unless Assignment says `Delegation: allowed (...)`.
43
45
 
@@ -56,6 +58,6 @@ Use skill names in prompts and references. Avoid absolute local paths unless the
56
58
 
57
59
  ## Gotchas
58
60
 
59
- - Codex plugin install gives skills; Morning Star role subagents require custom agent TOML files linked from `codex/agents/`.
61
+ - Codex plugin install gives skills; Morning Star role subagents require regular custom agent TOML files installed from `codex/agents/`.
60
62
  - Tool discovery (`tool_search`) can reveal capabilities, but availability is not authorization; Assignment `Delegation` still controls use.
61
63
  - Session plans, Goal Mode text, chat summaries, and UI todos are not durable harness SSOT unless mirrored to `{HARNESS_DIR}`.
@@ -45,7 +45,7 @@ Enforcement: `rules/mstar-cursor-plan-mode.mdc` when plugin active.
45
45
 
46
46
  - **`Execution mode: sdd`**: **N=3** Tasks (`qc-specialist`, `qc-specialist-2`, `qc-specialist-3`) + branch review-package path (N rules → `parallel-dispatch.md`).
47
47
  - **`inline`**: **N=1** per `parallel-dispatch.md`.
48
- - SDD implement/reviewer: **serial** — implementer Task per task id with `subagent_type` matching the implementer role when listed; task reviewer = new Task with `subagent_type: "code-reviewer"` (Cursor L2 review; not qc-specialist*) when listed, else generic fallback per C5 — no `resume` for reviewers. See **`mstar-sdd`**.
48
+ - SDD implement/reviewer: ready-task scheduling per **`mstar-sdd`** — implementer Task per task id with `subagent_type` matching the implementer role when listed; task reviewer = new Task with `subagent_type: "code-reviewer"` (Cursor L2 review; not qc-specialist*) when listed, else generic fallback per C5 — no `resume` for reviewers. See **`mstar-sdd`**.
49
49
 
50
50
  ## SDD sticky implementer (Cursor Task resume)
51
51
 
@@ -55,7 +55,7 @@ its sandbox permits).
55
55
  {
56
56
  "name": "mstar-qc-tri",
57
57
  "description": "Plan QC tri-review: three independent read-only QC seats over one review range, each returning a verdict envelope.",
58
- "whenToUse": "dsh host, Execution mode: sdd — the whole-branch plan QC tri instead of three subagent dispatches.",
58
+ "whenToUse": "dsh host, Execution mode: sdd — the changed-scope plan QC tri instead of three subagent dispatches.",
59
59
  "phases": [
60
60
  { "title": "qc-tri", "detail": "Three concurrent read-only QC seats over the same review range." }
61
61
  ]
@@ -143,7 +143,7 @@ You are the first of three INDEPENDENT read-only QC seats over the same review r
143
143
 
144
144
  Load in order: skill mstar-roles then references/qc-specialist-shared.md (identity first), then references/qc-specialist/report-template.md and references/qc-specialist/reviewer-checklist.md; the plan at ${a.planPath}.
145
145
 
146
- Review the whole-branch diff for the review range above against that plan. Every finding needs a verification cross-check and an expected-vs-observed line; prefer omission to fabrication. Do not run build or test suites (they are not your evidence channel). Never edit the worktree, never post, never merge, never touch project registers.
146
+ Review only changed hunks and directly affected interfaces in the review range above against that plan. Reuse unchanged task-review evidence; for re-review inspect only assigned findings and fix delta. Every finding needs a verification cross-check and an expected-vs-observed line; prefer omission to fabrication. Do not run build or test suites (they are not your evidence channel). Never edit the worktree, never post, never merge, never touch project registers.
147
147
 
148
148
  Return ONLY the JSON object matching the provided schema (seat, verdict, summary, findings). If your sandbox permits, also write the full report to the report path above — never depend on being able to write.`, { ...opts, label: 'qc1-architecture' }),
149
149
  () => agent(`## Assignment
@@ -163,7 +163,7 @@ You are the second of three INDEPENDENT read-only QC seats over the same review
163
163
 
164
164
  Load in order: skill mstar-roles then references/qc-specialist-shared.md (identity first), then references/qc-specialist/report-template.md, references/qc-specialist/reviewer-checklist.md and references/qc-specialist/deep-review-lenses.md; the plan at ${a.planPath}.
165
165
 
166
- Review the whole-branch diff for the review range above against that plan, with the security and correctness lenses. Every finding needs a verification cross-check and an expected-vs-observed line; prefer omission to fabrication. Do not run build or test suites. Never edit the worktree, never post, never merge, never touch project registers.
166
+ Review only changed hunks and directly affected interfaces in the review range above against that plan. Reuse unchanged task-review evidence; for re-review inspect only assigned findings and fix delta, with the security and correctness lenses. Every finding needs a verification cross-check and an expected-vs-observed line; prefer omission to fabrication. Do not run build or test suites. Never edit the worktree, never post, never merge, never touch project registers.
167
167
 
168
168
  Return ONLY the JSON object matching the provided schema (seat, verdict, summary, findings). If your sandbox permits, also write the full report to the report path above — never depend on being able to write.`, { ...opts, label: 'qc2-security-correctness' }),
169
169
  () => agent(`## Assignment
@@ -183,7 +183,7 @@ You are the third of three INDEPENDENT read-only QC seats over the same review r
183
183
 
184
184
  Load in order: skill mstar-roles then references/qc-specialist-shared.md (identity first), then references/qc-specialist/report-template.md, references/qc-specialist/reviewer-checklist.md and references/qc-specialist/deep-review-lenses.md; the plan at ${a.planPath}.
185
185
 
186
- Review the whole-branch diff for the review range above against that plan, with the performance and reliability lenses. Every finding needs a verification cross-check and an expected-vs-observed line; prefer omission to fabrication. Do not run build or test suites. Never edit the worktree, never post, never merge, never touch project registers.
186
+ Review only changed hunks and directly affected interfaces in the review range above against that plan. Reuse unchanged task-review evidence; for re-review inspect only assigned findings and fix delta, with the performance and reliability lenses. Every finding needs a verification cross-check and an expected-vs-observed line; prefer omission to fabrication. Do not run build or test suites. Never edit the worktree, never post, never merge, never touch project registers.
187
187
 
188
188
  Return ONLY the JSON object matching the provided schema (seat, verdict, summary, findings). If your sandbox permits, also write the full report to the report path above — never depend on being able to write.`, { ...opts, label: 'qc3-perf-reliability' }),
189
189
  ])
@@ -53,7 +53,7 @@ or a custom profile).
53
53
  rides it), and the pinned **meta dock** (version + harness dir; never
54
54
  scrolls). The workspace-state digest (plans ≤5 time-desc + `+N more`,
55
55
  open residual findings ≤10 with severity chips + overflow hint, policy
56
- with **enforcement first** then push / worktree / control worktree,
56
+ with **enforcement first** then push / worktree / integration worktree,
57
57
  leases, knowledge, direction) renders IN FLOW at the end of the scroll
58
58
  body, closed by the freshness footer (`snapshot {time} · turn {turn}` —
59
59
  the served snapshot's own timestamp + turn, never "live"). The three
@@ -119,9 +119,9 @@ or a custom profile).
119
119
  doneAt — deterministic, documented heuristic, only provably
120
120
  cross-iteration events are dropped, no historical back-scan of resumed
121
121
  long logs; the sidebar chip title is captured at open time; a docked
122
- body renders nothing while `tab.visible === false`. Panel acceptance is
123
- dual-track: in-loop browser harness verification against the rebuilt
124
- bundle plus user-restart final GUI acceptance.
122
+ body renders nothing while `tab.visible === false`. Routine panel QA uses affected unit evidence only. Real-browser rebuilt-bundle
123
+ verification or user-restart GUI acceptance belongs to an explicitly requested
124
+ independent **`mstar-e2e`** workflow (`/amazing-e2e-check`), never an iteration QA gate.
125
125
 
126
126
  ## Skill loading
127
127
 
@@ -380,11 +380,13 @@ work against the same worktree.
380
380
  as parallel tri. Cannot emit required **N** → **`Blocked`**.
381
381
  - **`inline`**: **N=1**.
382
382
 
383
- ### SDD implement (serial)
383
+ ### SDD implement
384
384
 
385
- - **`Execution mode: sdd`**: one implementer `subagent` dispatch per task id;
386
- task reviewer = a separate dispatch (SDD review role) — no sticky resume
387
- unless the host's continuable-subagent id is available and recorded.
385
+ - **`Execution mode: sdd`**: one implementer `subagent` dispatch per ready task id;
386
+ independent tasks use isolated tracks and `run_in_background: true` before
387
+ waiting, per **`mstar-sdd`** § Ready-task scheduling. Task reviewer is a fresh
388
+ separate dispatch; sticky resume is limited to one sequential owner track
389
+ with a recorded continuable-subagent id.
388
390
 
389
391
  ## Read-only fan-out via the `workflow` tool
390
392
 
@@ -97,10 +97,10 @@ Harness **dispatch** on Kimi = **one or more `Agent` tool calls** with correct *
97
97
 
98
98
  Cannot emit required **N** → **`Blocked`**.
99
99
 
100
- ### SDD implement (serial)
100
+ ### SDD implement
101
101
 
102
- - **`Execution mode: sdd`**: one implementer **`Agent`** per task id; task reviewer = new **`Agent`** with **Act as `code-reviewer`** (Kimi L2 review; not qc-specialist*), always via generic fallback `subagent_type: "coder"` per C5 — no sticky resume unless host adds it later. Serial rule → **`parallel-dispatch.md`** § SDD implement.
103
- - **Never** multiple implementer Agents in one message for the same plan.
102
+ - **`Execution mode: sdd`**: one implementer **`Agent`** per task id; task reviewer = new **`Agent`** with **Act as `code-reviewer`** (Kimi L2 review; not qc-specialist*), always via generic fallback `subagent_type: "coder"` per C5 — no sticky resume unless host adds it later. Ready-task scheduling → **`parallel-dispatch.md`** § SDD implement.
103
+ - Independent ready implementers use isolated parallel tracks; never share a writable worktree or session.
104
104
 
105
105
  ## Clarify
106
106
 
@@ -188,10 +188,10 @@ Harness **dispatch** on omp = **one or more `task` tool calls** with correct **`
188
188
 
189
189
  Cannot emit required **N** → **`Blocked`**.
190
190
 
191
- ### SDD implement (serial)
191
+ ### SDD implement
192
192
 
193
- - **`Execution mode: sdd`**: one implementer `task` entry per task id with `agent` matching the implementer role when listed; task reviewer = new entry with `agent: "code-reviewer"` (omp L2 review; not qc-specialist*) or `agent: "reviewer"`/`"task"` as fallback + C5b — no sticky resume unless host resume/id is available and recorded. Serial rule → **`parallel-dispatch.md`** § SDD implement.
194
- - **Never** multiple implementer entries in one message for the same plan.
193
+ - **`Execution mode: sdd`**: one implementer `task` entry per task id with `agent` matching the implementer role when listed; task reviewer = new entry with `agent: "code-reviewer"` (omp L2 review; not qc-specialist*) or `agent: "reviewer"`/`"task"` as fallback + C5b — no sticky resume unless host resume/id is available and recorded. Ready-task scheduling → **`parallel-dispatch.md`** § SDD implement.
194
+ - Independent ready implementers use isolated parallel tracks; never share a writable worktree or session.
195
195
 
196
196
  ## Clarify
197
197
 
@@ -46,16 +46,16 @@ Formal iteration Phase 2 uses the same SDD + tri rule — not a separate carve-o
46
46
 
47
47
  (**SDD 默认**已在上一节;本节仅覆盖显式 tri 的非 SDD 场景。)
48
48
 
49
- ## SDD implement (serial — not parallel)
49
+ ## SDD implement
50
50
 
51
- - **`Execution mode: sdd`**: implementer and task reviewer dispatches are **one at a time** per task.
52
- - **Never** multiple implementer Tasks in one message for the same plan.
53
- - See **`mstar-sdd`**.
51
+ - Follow **`mstar-sdd`** § Ready-task scheduling: independent ready tasks run concurrently after per-track worktree and artifact isolation; fresh implementers, one fresh reviewer per task.
52
+ - Serialize only actual dependencies, overlapping writers, one sticky session, and integration merges. PM alone updates shared progress.
53
+ - When the host only exposes separate asynchronous starts, issue every ready call before waiting for any result; same-message packaging is required only when supported.
54
54
 
55
55
  ## QC targeted re-review (after fixes)
56
56
 
57
57
  - Assignment: **`QC re-review: targeted — reviewers: <role-ids>`** → **N** = listed seats only (1–3), **one** dispatch turn with **N** invocations.
58
- - Do **not** default to three invocations after a routine fix round.
58
+ - Do **not** default to three invocations after a routine fix round. Each listed seat receives only its findings and fix delta; tri seat count never expands review scope.
59
59
  - Post-dispatch: verify only **dispatched** seats returned; PM updates same bundle `qc-consolidated.md` and durable plan summary (see `mstar-artifacts/references/plan-files-and-reports.md`).
60
60
 
61
61
  ## Self-check before send
@@ -65,4 +65,4 @@ Formal iteration Phase 2 uses the same SDD + tri rule — not a separate carve-o
65
65
  3. Dispatch message contains **exactly `N`** invocation calls?
66
66
  4. **Each** invocation carries its role-binding field set to **`Execute as`** (omp `agent` / Cursor `subagent_type` / OpenCode `subagent` / Kimi·ZCode `subagent_type`)? A bare `task`/prompt item with no role field = **incomplete**, even at **N=1**.
67
67
  5. QC initial: **`Execution mode: sdd`** → **N=3**? **`inline`** → **N=1**? Targeted re-review → **N** = Assignment reviewer count?
68
- 6. SDD implement → **serial** (never batch implementers); sticky = **resume** same implementer, not parallel
68
+ 6. SDD implement → independent ready tasks isolated and concurrent? Sticky resume limited to one sequential owner track?
@@ -67,7 +67,7 @@ ZCode C5/C5b SSOT is **this file** — do **not** load `_shared/host-role-bindin
67
67
  3. **Skill load list** — instruct the subagent to read `mstar-roles` → `references/<role-id>.md` (or shared reference + parameters) and topic skills per that reference.
68
68
  4. **`subagent_type`** — bare Morning Star role id per C5; `general-purpose` fallback.
69
69
 
70
- Paste-only Assignment **without** an invoke call is **not** dispatch. Anti-recursion NEVER: leaf executors are already `Execute as` — no recursive invoke of the same role; Assignment wins (`Delegation: forbidden` unless stated). **Never** multiple implementer invokes in one message for the same plan (SDD serial → **`parallel-dispatch.md`** § SDD implement).
70
+ Paste-only Assignment **without** an invoke call is **not** dispatch. Anti-recursion NEVER: leaf executors are already `Execute as` — no recursive invoke of the same role; Assignment wins (`Delegation: forbidden` unless stated). Independent ready implementers may run concurrently after isolation; scheduling → **`parallel-dispatch.md`** § SDD implement.
71
71
 
72
72
  ZCode invoke shape (same turn):
73
73
 
@@ -119,10 +119,10 @@ Harness **dispatch** on ZCode = **one or more `Agent` tool calls** with correct
119
119
 
120
120
  Cannot emit required **N** → **`Blocked`**.
121
121
 
122
- ### SDD implement (serial)
122
+ ### SDD implement
123
123
 
124
- - **`Execution mode: sdd`**: one implementer **`Agent`** per task id (bare role id per C5, `general-purpose` fallback); task reviewer = new **`Agent`** with **Act as `code-reviewer`** (`subagent_type: "code-reviewer"`, `general-purpose` fallback; ZCode L2 review; not qc-specialist*), always with C5b prompt binding — no sticky resume unless host adds it later. Serial rule → **`parallel-dispatch.md`** § SDD implement.
125
- - **Never** multiple implementer Agents in one message for the same plan.
124
+ - **`Execution mode: sdd`**: one implementer **`Agent`** per task id (bare role id per C5, `general-purpose` fallback); task reviewer = new **`Agent`** with **Act as `code-reviewer`** (`subagent_type: "code-reviewer"`, `general-purpose` fallback; ZCode L2 review; not qc-specialist*), always with C5b prompt binding — no sticky resume unless host adds it later. Ready-task scheduling → **`parallel-dispatch.md`** § SDD implement.
125
+ - Independent ready implementers use isolated parallel tracks; never share a writable worktree or session.
126
126
 
127
127
  ## Clarify
128
128
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mstar-iteration
3
- description: "Use when starting, driving, resuming, or closing a Morning Star iteration, or running an autonomous Phase 1–5 loop — including without a slash command (e.g. 'start an iteration', 'drive the iteration', 'run an autonomous loop'). Manages Phase 1 (default interactive direction lock; opt-in autonomous), Autonomous Execute, iteration-close (compound promotes knowledge), PR delivery, and the PR merge-ready loop. Branch SSOT: workflow snapshot (`workflows/<id>/snapshot.json`) + compass frontmatter."
3
+ description: "Use when starting, driving, resuming, or closing a Morning Star iteration, or running an autonomous Phase 1–6 loop — including without a slash command (e.g. 'start an iteration', 'drive the iteration', 'run an autonomous loop'). Manages Phase 1 (default interactive direction lock; opt-in autonomous), Autonomous Execute, iteration-close (compound promotes knowledge), PR delivery, the PR merge-ready loop, and the Phase 6 post-merge close. Branch SSOT: workflow snapshot (`workflows/<id>/snapshot.json`) + compass frontmatter."
4
4
  ---
5
5
 
6
6
  # mstar-iteration(迭代管理)
@@ -15,7 +15,7 @@ description: "Use when starting, driving, resuming, or closing a Morning Star it
15
15
 
16
16
  mstar 实践模式通常是:一次迭代锁定几个 spec 点(`specify + clarify`),产生多个 `plan`,每个 plan 含多个 tasks。**per-plan 生命周期有完整的闭环**(Prepare → Execute → QC → Done)。Compound 不是 per-plan 活动——它是**迭代级收口**,在迭代内所有 plan Done 后,沉淀一轮知识。
17
17
 
18
- 本 skill 管理迭代 **Phase 1–5**(command 层可聚合编排,但 **不得**反向引用 command 名;第三方 helper 仅由 command 按需发现):
18
+ 本 skill 管理迭代 **Phase 1–6**(command 层可聚合编排,但 **不得**反向引用 command 名;第三方 helper 仅由 command 按需发现):
19
19
 
20
20
  ```
21
21
  Phase 1: start
@@ -28,6 +28,8 @@ Phase 4: PR delivery(开 PR)
28
28
  ↓
29
29
  Phase 5: PR merge-ready loop —— 至 mergeable + CI 全绿 + reviews resolved
30
30
  ↓
31
+ Phase 6: post-merge close —— PR merged 后 §6.1–§6.4
32
+ ↓
31
33
  迭代交付完成
32
34
  ```
33
35
 
@@ -35,6 +37,7 @@ Phase 5: PR merge-ready loop —— 至 mergeable + CI 全绿 + reviews resolved
35
37
 
36
38
  - **Phase 3** 在 integration 分支收口 compound / roadmap;**开 PR(Phase 4)≠ 迭代交付完成**。
37
39
  - **Phase 5** 是 **merge-ready loop**(修复 → 等 CI/review 波次结束再 push → 再验证,至 §5.5 exit);**Loop 理念与 push cadence SSOT 在本 skill**(§2.6;push cadence 细则 §5.1a → `references/phase-4-5-pr-delivery.md`);宿主 command 可叠加额外 **non-`mstar-*`** helper(**优先** `babysit` / `*-babysit`;**`greploop` 可选**),但不写入 `mstar-*` load order。
40
+ - **Phase 6** 是 **post-merge close**(PR **merged** 后 §6.1–§6.4:terminal snapshot → unregister → 投影对齐 → cleanup(`mstar worktree cleanup`,dry-run 默认;守卫契约本体 → `mstar-branch-worktree`「Worktree / branch cleanup」));**§5.5 exit / PR mergeable ≠ 生命周期已关闭**(`references/phase-6-post-merge-close.md`)。
38
41
  - 一次迭代 = 一个 PR;compound 产物随 PR 合入 snapshot `branch.target`。
39
42
 
40
43
  ## Phase route map(唯一路由表 — 按当前动作加载)
@@ -42,9 +45,10 @@ Phase 5: PR merge-ready loop —— 至 mergeable + CI 全绿 + reviews resolved
42
45
  | 当前动作 | 必读 detail(按需加载,勿通读) |
43
46
  |---------|--------------------------------|
44
47
  | **start**(启动迭代 / 重开方向锁定) | **`references/phase-1-prepare.md`**(§1.1–§1.6:上下文、范围与 direction lock、compass、索引、v2 状态面、产物边界、§1.6 Review & Edit 链) |
45
- | **execute / resume**(推进或恢复 per-plan 循环) | **`references/phase-2-worktree-lease.md`**(§2.0 五道闸、§2.1–§2.5 loop/dispatch 细则、control worktree + lease 全文) |
48
+ | **execute / resume**(推进或恢复 per-plan 循环) | **`references/phase-2-worktree-lease.md`**(§2.0 五道闸、§2.1–§2.5 loop/dispatch 细则、control root + integration worktree + lease 全文) |
46
49
  | **close**(全部 plan Done 后收口迭代) | **`references/phase-3-iteration-close.md`**(§3.0–§3.6:entry checklist、compound、roadmap、完成标记、exit checklist + commit) |
47
50
  | **PR / merge-ready**(开 PR、推进合并就绪 loop) | **`references/phase-4-5-pr-delivery.md`**(§4–§5.2:开 PR、§5.1a push cadence、loop、exit checklist) |
51
+ | **Phase 6 / post-merge close**(PR merged 后关闭 lifecycle) | **`references/phase-6-post-merge-close.md`**(entry(verified merged)+ §6.1 terminal write → §6.2 unregister → §6.3 projection reconciliation → §6.4 cleanup:`mstar worktree cleanup`,dry-run 默认,`--apply` 才变更) |
48
52
  | **Phase 5 helper discovery**(仅 command 层按需) | **`references/phase5-helper-discovery.md`**(babysit / greploop 发现) |
49
53
 
50
54
  一次只加载当前 route 一行;phase 切换按下方 **Phase transition gates** 走。
@@ -53,20 +57,21 @@ Phase 5: PR merge-ready loop —— 至 mergeable + CI 全绿 + reviews resolved
53
57
 
54
58
  | 边界 | 触发 | 必须 | 禁止 |
55
59
  |------|------|------|------|
56
- | **→ Phase 2**(entry / resume) | §2.0 五道闸全过(细则 → `references/phase-2-worktree-lease.md`) | 继续 Autonomous Execute per-plan loop(phase-2 reference §2.4) | 五道闸任一 false 仍派发;branch metadata 缺失用 `main`/`master` 补位 |
57
- | **→ Phase 3** | workflow snapshot(`workflows/<id>/snapshot.json`)中 compass 登记的全部 plan 均为 `Done` | 打印 `## Phase 3: iteration-close`;执行 §3.0→§3.5(`references/phase-3-iteration-close.md`);host todo `phase-3-iteration-close` 保持 open 直至 §3.5 | 开 PR;宣称迭代交付完成;仅依赖 final plan closure |
60
+ | **→ Phase 2**(entry / resume) | §2.0 五道闸全过(细则 → `references/phase-2-worktree-lease.md`) | 继续 Autonomous Execute per-plan loop(phase-2 reference §2.4);主 worktree 驻留 = 记录的 **`Main worktree branch`**,integration 分支检出在专属 integration worktree | 五道闸任一 false 仍派发;branch metadata 缺失用 `main`/`master` 补位;把生命周期分支切到主 checkout |
61
+ | **→ Phase 3** | workflow snapshot(`workflows/<id>/snapshot.json`)中 compass 登记的全部 plan 均为 `Done` | 打印 `## Phase 3: iteration-close`;执行 §3.0→§3.5(`references/phase-3-iteration-close.md`);host todo `phase-3-iteration-close` 保持 open 直至 §3.5;close commit 在 **integration worktree** 执行 | 开 PR;宣称迭代交付完成;仅依赖 final plan closure;在主 checkout 上 commit close 产物 |
58
62
  | **→ Phase 4** | §3.5 exit checklist 全 `[x]`;frontmatter `status: completed` + `end_date` | 打印 `## Phase 4: PR delivery`;开 PR 到 snapshot `branch.target`(§4 → `references/phase-4-5-pr-delivery.md`) | 跳过 §3.1 entry checklist 或 compound Phase 6 |
59
63
  | **→ Phase 5** | Phase 4 PR 已创建 | 打印 `## Phase 5: PR merge-ready`;执行 §5 loop 至 §5.5 exit(含 §5.1a push cadence) | 开 PR 后停止;跳过 review resolve / CI loop;**CI/AI review 仍在跑时 push** |
60
- | **→ 迭代交付完成** | §5.5 exit checklist 全 `[x]` | PR mergeable;required CI 全绿;reviews resolved | Phase 4 开 PR 即宣称完成 |
64
+ | **→ Phase 6** | PR **已 merge**(verified merged;mergeable ≠ merged,由 PM 核实) | 打印 `## Phase 6: post-merge close`;按 §6.1→§6.4 执行(`references/phase-6-post-merge-close.md`);todo `phase-6-post-merge-close` 保持 open 直至 §6.4 | mergeable 即视为 merged;未核实 merge 就调用 close;§6.1–§6.3 之间夹带 tracked commit |
65
+ | **→ 迭代交付完成** | Phase 6 §6.1–§6.4 完成(`references/phase-6-post-merge-close.md`) | snapshot `completed` + `ended_at`;根 `status.json` 条目注销(`mstar status workflow-close --workflow <id>` exit 0);投影一致 | §5.5 exit 或 PR merge 即宣称交付完成;为 close 释放 lease 或伪造 Done/关闭 residual |
61
66
  | **start → integration branch** | §1.6 Review & Edit chain(`references/phase-1-prepare.md`) | 三角色按序 invoke;**specs** 为主产出;**禁止** start 链向 `{KNOWLEDGE_DIR}/` 新增;writing-specialist corpus hygiene + compass `status: locked` | PM 代做专业编辑;并行三角色;product/architect 写 knowledge;临时笔记进 specs |
62
67
 
63
68
  > **Engine check (when available):** run `mstar iteration gate --workflow <id> --compass <delivery-compass.md> --branch "$(git branch --show-current)" --integration <spec_integration_branch> --target <target_branch>` (or `import { evaluatePhaseGate } from "@mstar-harness/engine"` with the `currentBranch` / `specIntegrationBranch` / `prBaseBranch` probe inputs in a host hook) to evaluate the transition gate above against the workflow snapshot — the branch probes cover §3.5 exit item 5 (`EXIT_BRANCH_MISMATCH` when the commit checkout is not on `spec_integration_branch`; verify **before** the §3.5 close commit, not after). On `fail` (gate-blocking violations) -> do not proceed; fix and re-run. Note: during the Phase-3 window (`transition: phase-3-close`) the gate exits 1 until the §3.4 close items (`status: completed` + `end_date`) are written — that exit-1 is the expected "close work pending" signal (the exit checklist gates Phase 4, not the Phase-3 entry), so proceed with Phase 3 per the table below. Skill text below remains authoritative when the runtime is absent.
64
69
 
65
70
  **误判信号**:对话里出现 compound 摘要、roadmap 更新、或「所有 plan 已完成」但 **未** 打印 §3.1 / §3.5 checklist → 视为 **Phase 3 未执行**,回到 `references/phase-3-iteration-close.md` §3.0。
66
71
 
67
- **per-plan 状态 SSOT**:`{WORKFLOW_DIR}/<id>/snapshot.json` 的 `plans[]` 行(per-plan Todo/InProgress/InReview/Done);根 `{HARNESS_DIR}/status.json` `workflows[]` 登记活跃 lifecycle。
72
+ **per-plan 状态 SSOT**:`{WORKFLOW_DIR}/<id>/snapshot.json` 的 `plans[]` 行(per-plan Todo/InProgress/InReview/Done);根 `{HARNESS_DIR}/status.json` `workflows[]` 登记活跃 lifecycle。Phase 6 close 后 snapshot 终态(`completed` + `ended_at`)保留为归档,根条目注销(removal-at-terminal;`references/phase-6-post-merge-close.md` §6.1–§6.2)。
68
73
  **迭代状态 SSOT**:`{ITERATION_DIR}/<id>/delivery-compass.md` frontmatter `status` + `{ITERATION_DIR}/README.md` 索引(一行 = 一次迭代)。
69
- **迭代分支 SSOT**:snapshot `branch.base`(= `iteration_base_branch`)+ `branch.target`(= `target_branch`)与 `branch.integration`(= `spec_integration_branch`)(`workflows/<id>/snapshot.json`);compass frontmatter 镜像同名字段。解析顺序见 phase-2 reference §2.3。**禁止**因仓库存在 `main`/`master` 就假定 base 或 PR 目标。
74
+ **迭代分支 SSOT**:snapshot `branch.base`(= `iteration_base_branch`)+ `branch.target`(= `target_branch`)与 `branch.integration`(= `spec_integration_branch`)(`workflows/<id>/snapshot.json`);compass frontmatter 镜像同名字段。解析顺序见 phase-2 reference §2.3。**禁止**因仓库存在 `main`/`master` 就假定 base 或 PR 目标。**`branch.base` 是创建/merge 锚点,不是驻留事实**——主 worktree(control root)驻留分支在生命周期写入前由 PM 记录为主 plan 头的 **`Main worktree branch`**,全程不切换;integration 分支检出在专属 integration worktree(snapshot `integration_worktree_path`)。
70
75
 
71
76
  ## 产物存储位置
72
77
 
@@ -81,7 +86,7 @@ Phase 5: PR merge-ready loop —— 至 mergeable + CI 全绿 + reviews resolved
81
86
  - 未知 → 读 `mstar-*`;仅 **`Blocked`**、secrets、不可逆范围缺口、branch metadata 缺失、或 Phase 5 多轮仍 blocked 时升级用户
82
87
  - 实际 Git ≠ `working_branch` → **同轮**更新 plan + snapshot + `execution_lease.working_branch`(如适用)
83
88
  - **跨 plan implement 并行安全闸**与 **integration merge 串行** → `references/phase-2-worktree-lease.md` §2.0 #5 /「Multi-plan parallelism」(**无论** `Worktree mode: waived`)
84
- - plan 内 SDD task **串行** — phase-2 reference §2.4、§2.5、`mstar-sdd` Continuous execution
89
+ - plan 内 SDD 独立 ready tasks **并行**,真实依赖与共享写目标串行 — phase-2 reference §2.4、§2.5、`mstar-sdd` Ready-task scheduling
85
90
  - **zero-residual(默认)**:单 plan QC findings 尽量当轮清干净;仅真 blocker 才 defer(须 Durable Roadmap)— 见 **`mstar-artifacts`** Findings cleanup modes
86
91
  - iteration 命令共享的 PM invariants / preflight / todos / STOP → **`references/command-shared-invariants.md`**
87
92
 
@@ -97,7 +102,7 @@ Phase 5: PR merge-ready loop —— 至 mergeable + CI 全绿 + reviews resolved
97
102
 
98
103
  - **`mstar-compound`** — iteration-close 中触发知识结晶(**唯一**默认 knowledge 新增路径)
99
104
  - **`references/phase-1-prepare.md`** — start route detail(§1.1–§1.6)
100
- - **`references/phase-2-worktree-lease.md`** — execute/resume route detail(per-plan loop + control worktree、`execution_lease`、`integration_merge_lease`)
105
+ - **`references/phase-2-worktree-lease.md`** — execute/resume route detail(per-plan loop + integration worktree、`execution_lease`、`integration_merge_lease`)
101
106
  - **`references/autonomous-direction-lock.md`** — §1.2 autonomous direction lock、scale budget、branch resolve
102
107
  - **`references/iteration-artifact-boundaries.md`** — Phase 1 specs / iteration package / knowledge 分工
103
108
  - **`references/iteration-corpus-hygiene.md`** — §1.6 writing-specialist specs 卫生细则
@@ -107,16 +112,17 @@ Phase 5: PR merge-ready loop —— 至 mergeable + CI 全绿 + reviews resolved
107
112
  共享反递归红线全清单见 **`mstar-roles/references/_shared/leaf-executor-core.md`**「Shared anti-recursion NEVER」。迭代级高频陷阱(其余各 Phase 内已含对应 hard rule):
108
113
 
109
114
  - **不要将 Phase 4 开 PR 等同于迭代交付完成** — 必须完成 Phase 5 §5.2 merge-ready loop
115
+ - **不要将 §5.5 exit 或 PR merge 当作生命周期终点** — merged 后必须进入 Phase 6(`references/phase-6-post-merge-close.md` §6.1–§6.4);禁止为通过 close 释放 lease 或伪造 Done/关闭 residual
110
116
  - **不要在 Phase 5 CI 仍跑或 AI review 波次未结束时 push**(§5.1a)— 本地可提前修,push 等 idle
111
- - **不要为 Phase 5 另开 feature/fix worktree**,也不要把 Phase 2 control 产品编辑禁令套到 Phase 5 — 直接在集成分支 checkout 上修
117
+ - **不要在 integration worktree 或主 checkout(control root)上直接编辑产品代码** — Phase 5 修复走 fix feature worktree,review 后 merge 回 integration worktree(`phase-4-5-pr-delivery.md` §5.0)
112
118
  - **不要在缺 `iteration_base_branch` / `target_branch` 时默认 `main` / `master`**
113
119
  - **不要在 Phase 1 §1.6 由 product/architect 向 `{KNOWLEDGE_DIR}/` 新增**(知识 → iteration-close **`mstar-compound`**)
114
120
  - **不要在 per-plan Done 后立即 compound** — 等 iteration-close 统一做
115
121
 
116
122
  ## Workflow
117
123
 
118
- Phase 1–5 总览见上文 **`## 设计思路`** 图。执行时按 **`## Phase route map`** 选当前动作的一行 detail:`start`(范围 + compass + §1.6 Review & Edit 链)→ `Autonomous Execute`(五道闸 → §2.4 per-plan 循环:分支 → 实现 → QC → QA gate → Done → 串行 merge)→ `iteration-close`(§3.1–§3.5 + `mstar-compound`)→ `PR delivery`(Phase 4)→ `PR merge-ready loop`(Phase 5 至 §5.5 exit)。每波用 §2.1 session todos 设护栏防范围漂移;phase 切换以上方 **Phase transition gates** 为准。
124
+ Phase 1–6 总览见上文 **`## 设计思路`** 图。执行时按 **`## Phase route map`** 选当前动作的一行 detail:`start`(范围 + compass + §1.6 Review & Edit 链)→ `Autonomous Execute`(五道闸 → §2.4 per-plan 循环:分支 → 实现 → QC → QA gate → Done → 串行 merge)→ `iteration-close`(§3.1–§3.5 + `mstar-compound`)→ `PR delivery`(Phase 4)→ `PR merge-ready loop`(Phase 5 至 §5.5 exit)→ `post-merge close`(Phase 6,PR merged 后 §6.1–§6.4)。每波用 §2.1 session todos 设护栏防范围漂移;phase 切换以上方 **Phase transition gates** 为准。
119
125
 
120
126
  ## Evidence
121
127
 
122
- 迭代交付完成 = Phase 5 §5.5 exit checklist 全 `[x]` + PR mergeable + required CI 全绿 + reviews resolved。Phase 3 完成标志 = compass frontmatter `status: completed` + `end_date`(§3.4)+ §3.5 exit checklist。close 证据在磁盘产物(compass / plans / specs 修订 + 索引 + metadata),不要求单独迭代审查报告(§1.6,`references/phase-1-prepare.md`)。
128
+ 迭代交付完成 = Phase 5 §5.5 exit checklist 全 `[x]` **且 PR merged 已核实** **且 Phase 6 §6.1–§6.4 完成**(snapshot `completed` + `ended_at`、根 `status.json` 条目注销、投影一致;`references/phase-6-post-merge-close.md`)。Phase 3 完成标志 = compass frontmatter `status: completed` + `end_date`(§3.4)+ §3.5 exit checklist。close 证据在磁盘产物(compass / plans / specs 修订 + 索引 + metadata),不要求单独迭代审查报告(§1.6,`references/phase-1-prepare.md`)。
@@ -17,7 +17,7 @@ Phase 2–5 全程有效(drive + loop 共有的行):
17
17
  | Write/Edit/Shell 产品代码、写测试、跑 QC(Phase 2) | 每条 implement/QC/QA Assignment ⇒ **1 次 `Task`** |
18
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
19
  | 只写 Assignment 就进入下一 gate | 同轮 dispatch:每条 Assignment ⇒ **1 次 invoke**(`Subagent invokes issued: N`,N = Assignment 条数) |
20
- | 最后一个 plan `Done` 后直接开 PR / 汇报结束 | **Phase 3 → 4 → 5** 顺序执行 |
20
+ | 最后一个 plan `Done` 后直接开 PR / 汇报结束;§5.2 exit 或 PR merged 即宣称交付完成 | **Phase 3 → 4 → 5 → 6** 顺序执行(Phase 6 = PR merged 后 post-merge close,`references/phase-6-post-merge-close.md`) |
21
21
  | Phase 5 自己改产品代码 | 需改产品代码时 **dispatch** `fullstack-dev` / `ops-engineer` |
22
22
 
23
23
  派发细则 → **`mstar-dispatch-gates`** + **`mstar-host`**。Phase 3 细则 → **`mstar-iteration/references/phase-3-iteration-close.md`** + **`mstar-compound`**。
@@ -48,6 +48,7 @@ if command -v mstar-harness >/dev/null 2>&1; then mstar-harness dispatch validat
48
48
  | `phase-3-iteration-close` | 仅剩 1 个非 `Done` plan | Phase 3 §3.5 exit 全 `[x]` |
49
49
  | `phase-4-create-pr` | Phase 3 完成后 | PR 已创建并记录 URL/number |
50
50
  | `phase-5-pr-merge-ready` | Phase 4 完成后 | Phase 5 §5.5 exit 全 `[x]` |
51
+ | `phase-6-post-merge-close` | §5.2 exit 后 PR **已 merge**(mergeable ≠ merged) | Phase 6 §6.1–§6.4 完成(`mstar status workflow-close --workflow <id>` exit 0 + 投影一致) |
51
52
 
52
53
  ## Continuous execution STOP list(重叠行;start / drive / loop 共有)
53
54
 
@@ -145,11 +145,13 @@ Phase 1 与 §1.6 须遵守 **`references/iteration-artifact-boundaries.md`**(
145
145
  派发机制 → **`mstar-dispatch-gates`**(specialist review-and-edit dispatch,**顺序链**)。PM **不得**将迭代 harness 文档 commit 到 `spec_integration_branch`,直到:
146
146
 
147
147
  1. **product-manager** → **architect** → **writing-specialist** 已按序 invoke 编辑 compass、plans、`{SPECS_DIR}/` 与 **`{ITERATION_DIR}/<iteration-id>/`** package(guides/specs,按需);**不得**在 start 链向 `{KNOWLEDGE_DIR}/` 新增
148
- 2. **writing-specialist** 完成 **corpus hygiene**:全库 `{SPECS_DIR}/` + 既有 `{KNOWLEDGE_DIR}/` 卫生;错放迁回 **`<iteration-id>/`** package;细则 → **`iteration-corpus-hygiene.md`**、**`iteration-artifact-boundaries.md`**
148
+ 2. **writing-specialist** 完成 **corpus hygiene**:仅本轮修改的 `{SPECS_DIR}/` / iteration package 与直接相关 knowledge 引用;错放迁回 **`<iteration-id>/`** package;细则 → **`iteration-corpus-hygiene.md`**、**`iteration-artifact-boundaries.md`**
149
149
  3. PM 将 compass `status` 设为 `locked`,并确认各 plan 的 Prepare gate(specify / clarify / plan)
150
150
 
151
- **顺序理由**:产品范围与优先级 → 架构与长期契约(specs)→ 行文、规格库卫生与错放纠正(须在 PM/architect 定稿后扫全库 specs)。并行会导致后手重复劳动或覆盖前手未定稿内容。OpenCode:plain role id — **`mstar-host/references/opencode.md`** § Role-mention hygiene。
151
+ **顺序理由**:产品范围与优先级 → 架构与长期契约(specs)→ 行文、规格库卫生与错放纠正(在 PM/architect 定稿后核对受影响文档)。本共享产物链存在真实依赖;独立文档可按 ownership 隔离并行。早期全局探索的既有结果复用,不因每次编辑重新扫全库。OpenCode:plain role id — **`mstar-host/references/opencode.md`** § Role-mention hygiene。
152
152
 
153
153
  **完成证据** = 磁盘上的 compass / plans / specs / iteration 文档修订 + specs(与既有 knowledge)卫生/归档(如有)+ 索引与 metadata 更新 + compass `status: locked`。**不**要求单独的迭代审查报告——迭代审查的 SSOT 是被编辑的文档本身,无 per-plan QC 式审计链。
154
154
 
155
+ **Uncommitted-docs exception(bounded — Phase 1 only)**:Review & Edit 链的文档编辑(compass / plans / specs / `<iteration-id>/` package)可以**未提交**状态落在主 checkout(control root = 主 worktree)——这是 worktree 默认在 Phase 1 的唯一例外,主 checkout 分支**不**切换、不产生 feature commit。**§6 创建 integration worktree 后**:只把**已 review 的本轮文档改动** transfer 到 integration worktree 并在其上 commit(tracked results 写在目标分支所在的检出),随后恢复主 checkout 上对应的未提交文档改动(不切分支);**禁止**搬运主 checkout 上无关的既有用户改动。
156
+
155
157
  **反模式**:PM 线程代替三角色完成全部编辑而不 invoke;或将本链三角色并行派发 —— 见 **`mstar-roles/references/_shared/leaf-executor-core.md`**「Shared anti-recursion NEVER」。