@mstar-harness/opencode 0.7.4 → 0.7.6

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.
@@ -1,12 +1,39 @@
1
1
  ---
2
2
  name: iteration-drive
3
- description: Drive the active iteration to completion — run the Autonomous Execute loop (Phase 2 of mstar-iteration) until all plans are Done, then run iteration-close (Phase 3: compound + compass + roadmap update) on the integration branch, then create PR to target branch (default main)
3
+ description: Drive the active iteration to completion — run the Autonomous Execute loop (Phase 2 of mstar-iteration) until all plans are Done, then run iteration-close (Phase 3: compound + compass + roadmap update) on the integration branch, then create PR to the recorded target branch
4
4
  agent: project-manager
5
5
  ---
6
6
 
7
7
  # Drive Iteration
8
8
 
9
- Drive the active Morning Star iteration forward. The canonical flow is in **`mstar-iteration`** this command loads it and executes its phases.
9
+ Drive the active Morning Star iteration forward. **Boot loads skills; this command sequences Phase 2 Phase 3 PR.** Domain SSOT → **`mstar-iteration`**.
10
+
11
+ ## Phase state machine(禁止跳步)
12
+
13
+ ```
14
+ Phase 2: Autonomous Execute → Phase 3: iteration-close → Completion: PR
15
+ (per-plan dispatch loop) (独立 gate,非 final plan) (close 之后)
16
+ ```
17
+
18
+ | 当前状态 | 允许 | 禁止 |
19
+ |----------|------|------|
20
+ | 存在非 `Done` plan | Phase 2:dispatch implement / QC / QA | 进入 Phase 3 或开 PR |
21
+ | **全部** plan `Done` | **立刻** `## Phase 3: iteration-close`(§3.0→§3.5) | 宣称 iteration 完成、写 PR、结束会话 |
22
+ | Phase 3 exit checklist 全 `[x]` + compass `status: completed` | `git commit` → push → PR | 跳过 compound / roadmap / frontmatter |
23
+
24
+ **常见误判**:final plan 的 closure notes、compound 草稿、roadmap 口头更新 **≠** iteration-close。必须打印 §3.1 entry + §3.5 exit checklist。
25
+
26
+ ## PM invariants(Phase 2 全程有效)
27
+
28
+ | 禁止(PM 线程) | 必须 |
29
+ |-----------------|------|
30
+ | Write/Edit/Shell 产品代码、写测试、跑 QC 审查 | 每条 implement/QC/QA Assignment ⇒ **1 次 `Task`** |
31
+ | 只写 Assignment 就进入下一 gate | 同轮 dispatch:`Subagent invokes issued: N`(N = Assignment 条数) |
32
+ | 最后一个 plan `Done` 后直接 PR / 汇报结束 | **先** Phase 3(`mstar-iteration` §3),**再** PR(见 Completion) |
33
+
34
+ 派发细则 → **`mstar-dispatch-gates`** + **`mstar-host`**。Phase 3 细则 → **`mstar-iteration` §3** + **`mstar-compound`**。
35
+
36
+ **Session todos**:进入 Phase 2 时设 plan-wave todos;当仅剩 1 个非 `Done` plan 时 **追加** `phase-3-iteration-close`(`mstar-iteration` §2.1);§3.5 完成前不得勾掉。
10
37
 
11
38
  ## Boot
12
39
 
@@ -20,12 +47,20 @@ Drive the active Morning Star iteration forward. The canonical flow is in **`mst
20
47
 
21
48
  ## Phase 2: Autonomous Execute
22
49
 
50
+ **Branch policy first** — before any plan dispatch(`mstar-iteration` §2.3):
51
+
52
+ | Field | SSOT | If missing |
53
+ |-------|------|------------|
54
+ | `iteration_base_branch` | `status.json` `metadata` → compass frontmatter | **STOP** — ask user; **never** default `main` |
55
+ | `spec_integration_branch` | plan `metadata` | backfill from iteration-start / compass |
56
+ | `target_branch` | `status.json` `metadata` → compass frontmatter | **STOP** — ask user |
57
+
23
58
  Execute **`mstar-iteration` § Phase 2** exactly. Summary:
24
59
 
25
- 1. **Precondition gate** (§ 2.0) — three checks before entering
60
+ 1. **Precondition gate** (§ 2.0) — **four** checks(含 branch metadata #4)
26
61
  2. **Session todos** (§ 2.1) — set host todos per plan wave
27
- 3. **Read backlog** (§ 2.2) — `status.json` + `spec_integration_branch`
28
- 4. **Integration branch** (§ 2.3) — checkout/create
62
+ 3. **Read backlog** (§ 2.2) — `status.json` + branch metadata
63
+ 4. **Integration branch** (§ 2.3) — `git checkout -b <spec_integration_branch> <iteration_base_branch>` when creating(**not** implicit `main`)
29
64
  5. **Per-plan loop** (§ 2.4) — for each non-`Done` plan:
30
65
  - Create plan feature branch from integration
31
66
  - Dispatch implement subagents (dispatch-first)
@@ -34,13 +69,18 @@ Execute **`mstar-iteration` § Phase 2** exactly. Summary:
34
69
  - Merge plan branch → integration branch
35
70
  - Cross-plan progress sync → compass
36
71
  - Next plan
37
- 6. Repeat until **all** plans `Done` → exit loop, enter Phase 3
72
+ 6. Repeat until **all** plans `Done` → **STOP**(见 Phase state machine)→ 打印 `## Phase 3: iteration-close` → 执行 **`mstar-iteration` §3**;**不得**开 PR
38
73
 
39
- **Dispatch-first constraint** (§ 2.5): PM never implements directly; `1 Assignment ⇒ 1 invoke`.
74
+ 派发回合纪律 → **`mstar-dispatch-gates`** + **`mstar-iteration` §2.5**。
40
75
 
41
76
  ## Phase 3: iteration-close
42
77
 
43
- 当 **every** plan 为 `Done` 时,**STOP** per-plan loop,打印 `## Phase 3: iteration-close`,按 **`mstar-iteration` § Phase 3** 逐步执行。final plan 的 closure 只能提供输入,不能替代 close gate。
78
+ 当 **every** plan 为 `Done` 时:
79
+
80
+ 1. **STOP** per-plan loop — 不得合并 plan 分支、写 PR、或输出「迭代完成」摘要。
81
+ 2. 打印标题 **`## Phase 3: iteration-close`**(用户可见的 phase 边界)。
82
+ 3. 按 **`mstar-iteration` § Phase 3** 逐步执行 §3.0→§3.5。final plan 的 closure 只能提供输入,不能替代 close gate。
83
+ 4. §3.5 exit checklist 全 `[x]` 且 compass frontmatter `status: completed` 后,才进入下方 **Completion: Create PR**。
44
84
 
45
85
  | Step | Section | 要点 |
46
86
  |------|---------|------|
@@ -61,10 +101,13 @@ git push origin <spec_integration_branch>
61
101
 
62
102
  ## Completion: Create PR
63
103
 
104
+ **Precondition(HARD)**: Phase 3 complete — §3.5 exit checklist 全 `[x]`;compass YAML `status: completed` + `end_date`;compound Phase 6 索引已登记(或已记录无可结晶原因)。**不满足 → 禁止开 PR。**
105
+
64
106
  All iteration-close changes committed to integration branch:
65
107
 
66
- - Resolve PR target branch from `status.json` → `target_branch`(default `main`)
67
- - Create PR from `spec_integration_branch` to target
108
+ - Resolve PR target: `status.json` → `metadata.target_branch`(fallback:compass frontmatter `target_branch`)
109
+ - If missing **stop and ask**; never default `main` / `master`
110
+ - Create PR: `spec_integration_branch` → `target_branch`
68
111
  - Report summary: plans completed, compound round(结晶文档数), target branch, PR link
69
112
 
70
113
  PR 合并后(babysit loop 或手动),本次迭代完整结束。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: iteration-start
3
- description: Start a new harness iteration — research backlog, lock direction with grill-me, produce compass/plans, run mandatory Review & Edit chain via Task dispatch (product-manager → architect → writing-specialist each review-and-edit, then PM final lock), then integration branch. Not Done until review chain completes and compass is locked.
3
+ description: Start a new harness iteration — research backlog, lock direction with grill-me, produce compass/plans, run mandatory Review & Edit chain via sequential Task dispatch (product-manager → architect → writing-specialist, each review-and-edit, then PM final lock), then create the integration branch from an explicit base. Not Done until review chain completes, compass is locked, and base/target branches are recorded.
4
4
  agent: project-manager
5
5
  ---
6
6
 
@@ -8,6 +8,20 @@ agent: project-manager
8
8
 
9
9
  Start a new Morning Star harness iteration. **Not Done until the Review & Edit chain runs via dispatched roles and PM lock — not when compass files are first written.**
10
10
 
11
+ ## PM invariants(本命令全程有效 — 读完再动手)
12
+
13
+ 你是 **`project-manager` 编排者**,不是三专业角色的合并替身。
14
+
15
+ | 禁止(PM 线程) | 必须(宿主有 Task 时) |
16
+ |-----------------|------------------------|
17
+ | 自己 Edit compass/plans/specs 冒充 @product-manager / @architect / @writing-specialist 的审查编辑 | §5.1 → §5.2 → §5.3 **顺序**各 **1 次 invoke**;上一角色返回后再派发下一角色 |
18
+ | 只写 `## Assignment` 或 checklist 就声称 review chain 完成 | **几条角色 ⇒ 几条 invoke**;零 invoke = `dispatch incomplete`(`mstar-dispatch-gates`) |
19
+ | §5 完成前 commit / 创建 integration 分支 | 5.4 PM lock 在 subagent 返回且磁盘产物已修订之后(`mstar-iteration` §1.6) |
20
+
21
+ 派发细则 → **`mstar-dispatch-gates`**(specialist review-and-edit dispatch)+ **`mstar-host`**(宿主 invoke 能力)。**不得**在 PM 线程加载其他 role reference 代劳。
22
+
23
+ **完成定义**:compass `status: locked` + 三角色 invoke 已返回 + pre-commit checklist 全 `[x]` — 不是初稿落盘。
24
+
11
25
  Detailed workflow → **`mstar-iteration` § Phase 1: iteration-start**(含 §1.6 Review & Edit chain);per-plan Prepare gates → **`mstar-phase-gates`**(specify → clarify → plan)。
12
26
 
13
27
  ## 0. Boot
@@ -16,9 +30,10 @@ Detailed workflow → **`mstar-iteration` § Phase 1: iteration-start**(含 §
16
30
  2. `mstar-roles` → `references/project-manager.md`
17
31
  3. `skills/pm/SKILL.md` → **§ Host entry** + **§ Boot**
18
32
  4. `mstar-iteration` → **§ Phase 1: iteration-start**(迭代范围、compass 模板、§1.6 Review & Edit chain、状态初始化)
19
- 5. `mstar-dispatch-gates` → iteration-start review chain + implement dispatch
33
+ 5. `mstar-dispatch-gates`
20
34
  6. `mstar-phase-gates` → Prepare(specify → clarify → plan)
21
35
  7. `mstar-plan-conventions`, `mstar-plan-artifacts`
36
+ 8. `mstar-host` → active host reference(invoke 能力)
22
37
 
23
38
  ## 1. Research
24
39
 
@@ -56,34 +71,45 @@ Run the **grill-me skill** to stress-test candidate directions with the user:
56
71
  - Walk through trade-offs for each candidate
57
72
  - Converge on a **single iteration direction** with shared understanding
58
73
  - Document: locked direction, success criteria, non-goals
74
+ - Confirm delivery branch policy:
75
+ - `iteration_base_branch`: branch/ref used to create `spec_integration_branch`
76
+ - `target_branch`: PR target after iteration-close
77
+ - If either is not explicit, inspect the current branch and ask. **Do not default to `main` / `master` just because those names exist.**
59
78
 
60
79
  ## 4. Write Compass & Plans
61
80
 
62
- Produce harness artifacts per **`mstar-iteration` § 1.3 创建迭代 compass**(template: `mstar-iteration/references/iteration-compass-template.md`):
81
+ Produce harness artifacts per **`mstar-iteration` § 1.3**(template: `mstar-iteration/references/iteration-compass-template.md`):
63
82
 
64
- - `{ITERATION_DIR}/<iteration-id>-delivery-compass.md` — iteration scope, plans table, milestones, acceptance criteria, non-goals, roadmap position
83
+ - `{ITERATION_DIR}/<iteration-id>-delivery-compass.md` — YAML frontmatter **must** include `iteration_base_branch`, `target_branch`, `status: active`
65
84
  - `{PLAN_DIR}/<plan-id>-<name>.md` for each plan in this iteration
66
- - Register all plans in `{HARNESS_DIR}/status.json`(per `mstar-plan-artifacts`)
85
+ - Register all plans in `{HARNESS_DIR}/status.json`(per `mstar-plan-artifacts` §1.5:root `metadata` + plan `spec_integration_branch`)
67
86
  - Update `{ITERATION_DIR}/README.md` index(per `mstar-iteration` § 1.4)
68
87
 
69
88
  ## 5. Review & Edit Chain(HARD GATE — do not commit before this)
70
89
 
71
90
  **STOP**: Do not run §6 Integration Branch until **all** rows below are true.
72
91
 
92
+ **顺序(HARD)**:`product-manager` → `architect` → `writing-specialist` → PM lock。后一角色基于前一角色已落盘的修订继续编辑;**禁止**三角色并行 invoke。
93
+
73
94
  Each role below **reviews and directly edits** the documents. Do not just flag issues — apply the fixes yourself. PM only steps in for the final lock.
74
95
 
75
- | # | Role | Required action |
76
- |---|------|-----------------|
77
- | 5.1 | **@product-manager** | Task subagent: **edit** compass, plans, `{SPECS_DIR}/`; scope, UX, priorities |
78
- | 5.2 | **@architect** | Task subagent: **edit** compass, plans, specs; contracts, SQL, module boundaries |
79
- | 5.3 | **@writing-specialist** | Task subagent: **edit** all iteration docs; terminology, structure, clarity |
80
- | 5.4 | **@project-manager** | Merge subagent edits; resolve conflicts; **lock** compass (`status: locked`); confirm Prepare gates |
96
+ | # | Role | Required action | Gate |
97
+ |---|------|-----------------|------|
98
+ | 5.1 | **@product-manager** | invoke: **edit** compass, plans, `{SPECS_DIR}/`; scope, UX, priorities | 完成后方可 5.2 |
99
+ | 5.2 | **@architect** | invoke: **edit** compass, plans, specs(含 5.1 修订后版本); contracts, SQL, module boundaries | 5.1 返回后;完成后方可 5.3 |
100
+ | 5.3 | **@writing-specialist** | invoke: **edit** all iteration docs(含 5.1–5.2 修订后版本); terminology, structure, clarity | 5.2 返回后 |
101
+ | 5.4 | **@project-manager** | Merge subagent edits; resolve conflicts; **lock** compass (`status: locked`); confirm Prepare gates | 5.3 返回后 |
81
102
 
82
103
  **Evidence of done** = edited compass / plans / specs on disk + compass `status: locked`. **No** separate iteration review reports under `reports/` — unlike per-plan QC, there is no downstream audit chain to preserve.
83
104
 
84
- **Tool rule (Cursor / hosts with Task)**:
85
- - Steps 5.1–5.3: **MUST** use `Task` (parallel when independent). See **`mstar-dispatch-gates`** · iteration-start review chain.
86
- - PM thread **MUST NOT** substitute by performing all three specialist edits itself.
105
+ **Tool rule (hosts with invoke)** — per **`mstar-dispatch-gates`** · specialist review-and-edit dispatch(**顺序链**,非 parallel batch):
106
+
107
+ 1. 为当前角色写好 Assignment(含须直接编辑的文件路径;5.2/5.3 注明基于上一角色已落盘修订)。
108
+ 2. **派发 1 次 invoke** → 等待 Completion Report / 磁盘修订完成。
109
+ 3. 按序重复下一角色:**5.1 → 5.2 → 5.3**(每步一条派发消息、一次 invoke)。
110
+ 4. 本条链 **禁止** PM 线程代做专业编辑;**禁止** 同条消息并行三角色;**禁止** 未等 5.1 返回就发 5.2/5.3。
111
+ 5. 5.3 返回后,PM 线程再做 5.4 merge + lock。
112
+
87
113
  - Exception: user explicitly waives subagent dispatch ("PM-only review").
88
114
 
89
115
  **Prepare gate (per plan in compass)**:
@@ -103,12 +129,22 @@ PM must print this block before §6; all `[ ]` must be `[x]`:
103
129
  - [ ] @architect Task completed — compass / specs edited
104
130
  - [ ] @writing-specialist Task completed — iteration docs edited
105
131
  - [ ] PM final lock: compass `status: locked`; Prepare gates pass (blocked plans documented)
132
+ - [ ] Branch policy locked: `iteration_base_branch`, `spec_integration_branch`, and `target_branch` recorded in compass / `status.json`
106
133
  - [ ] **THEN**: git commit + push `iteration/<iteration-id>`
107
134
 
108
135
  ## 6. Integration Branch
109
136
 
110
137
  **Precondition**: §5 complete — compass `status: locked`; specialist Tasks returned; Prepare gates confirmed.
111
138
 
112
- - Create `iteration/<iteration-id>` from `main`
113
- - Register `spec_integration_branch` in `{HARNESS_DIR}/status.json`
139
+ - Create `spec_integration_branch` (e.g. `iteration/<iteration-id>`) **from** the locked `iteration_base_branch`:
140
+
141
+ ```bash
142
+ git fetch origin # if needed
143
+ git checkout -b <spec_integration_branch> <iteration_base_branch>
144
+ # or: git checkout <spec_integration_branch> if it already exists
145
+ ```
146
+
147
+ - Register `iteration_base_branch`, `spec_integration_branch`, and `target_branch` in compass frontmatter **and** `{HARNESS_DIR}/status.json` root `metadata`
114
148
  - Commit all documents to the integration branch and push to remote
149
+
150
+ **STOP** if `iteration_base_branch` or `target_branch` is missing. Ask the user or derive only from an already documented project/iteration policy; never silently substitute `main`.
@@ -7,7 +7,7 @@ description: Morning Star business-repo Git feature branches, same-repo concurre
7
7
 
8
8
  **首次 Read 本 skill 前:必须先 Read `mstar-harness-core`(SKILL.md)。** 冲突时 **以 `mstar-harness-core` 为准**。
9
9
 
10
- **Spec 多 plan 命名**(`spec_integration_branch`、合入 `main` PR 门禁)→ **`mstar-plan-conventions`**。下文为 **Git 操作与 QC/QA 检出对齐** 全文(无单独 reference 层)。
10
+ **Spec 多 plan 命名**(`iteration_base_branch`、`spec_integration_branch`、`target_branch` PR 门禁)→ **`mstar-plan-conventions`**。下文为 **Git 操作与 QC/QA 检出对齐** 全文(无单独 reference 层)。
11
11
 
12
12
  ## Scope(摘要)
13
13
 
@@ -124,10 +124,10 @@ description: Morning Star business-repo Git feature branches, same-repo concurre
124
124
 
125
125
  - **语义区分(必须理解)**:开发阶段可以存在 **多个** `Worktree path`(每条约流一条检出目录);**一轮**正式 QC 三审及与之 **逐字对齐** 的 QA 验证,在 harness 中仍只对应 **一套** `Review cwd` / `Worktree path` + **`Working branch`** + **`Review range` / `Diff basis`**(三票 QC 与 QA **共用且逐字相同**)。**不要**把「多个开发 worktree」误解成「QC 应轮流进多个目录各审一半」。
126
126
  - **推荐默认编排:先建 plan 集成分支,再挂各 worktree(PM;强推荐)**:在 **同仓**、**同一 plan** 且 **≥2 条可写并行轨** 时,按下列顺序编排可最大幅度降低 QC/QA 误用单一开发目录的风险。**此为推荐套路,不是唯一合法 Git 拓扑**;若采用其它拓扑,仍须满足本节下文 **强制**条款(派 QC 前 **单一**待审 `HEAD` + 一套对齐字段)。
127
- 1. **先起集成分支(再挂 worktree)**:在派发各轨 **实现** Assignment 之前,PM 与用户确认 **`Branch policy`**,并建立 **plan 集成分支**(Assignment 使用 **`Working branch: create <plan-integration-branch> from <base>`** 或等价明确写法;`<base>` 通常为 `origin/main` 或团队既定主线,**不得**未授权假设)。**分支名由 PM 指定**;下文 **`feature/<plan-id>-integrate`**、**`integrate/<plan-id>`** 仅为命名示例,**非强制**。**多 `plan_id` 同源一条 `primary_spec`(Spec 文档)时**:该集成分支在计划语义上即 **Spec 集成分支**;各 Plan 的 feature 线 merge 回此线,**全部 Plans 完成后** 合入默认保护分支须 **走 PR**(见 `mstar-plan-conventions` SKILL.md「Spec 文档驱动的分支模型」)。
127
+ 1. **先起集成分支(再挂 worktree)**:在派发各轨 **实现** Assignment 之前,PM 与用户确认 **`Branch policy`**,并建立 **plan 集成分支**(Assignment 使用 **`Working branch: create <plan-integration-branch> from <base>`** 或等价明确写法;`<base>` 必须是 PM 明确记录的 base,例如 root `metadata.iteration_base_branch`、现有 feature 分支、远程跟踪分支或团队既定主线,**不得**未授权假设)。**分支名由 PM 指定**;下文 **`feature/<plan-id>-integrate`**、**`integrate/<plan-id>`** 仅为命名示例,**非强制**。**多 `plan_id` 同源一条 `primary_spec`(Spec 文档)时**:该集成分支在计划语义上即 **Spec 集成分支**;各 Plan 的 feature 线 merge 回此线,**全部 Plans 完成后** 向显式 `target_branch` **走 PR**(见 `mstar-plan-conventions` SKILL.md「Spec 驱动的分支模型」)。
128
128
  2. **再挂各轨 worktree**:为每条并行轨分配 **独立** `git worktree` + **`Worktree path`**;各轨 **`Working branch`** 一般为 **从集成分支出** 的 topic 分支(`create <topic-i> from <plan-integration-branch>`)或 PM 书面约定的等价结构(例如从同一 `<base>` 出 topic、但 **书面指定** 合并时 **以集成分支为靶**)。**禁止**承接方擅自把未授权功能提交直接堆在 `main`/`master`。
129
129
  3. **进 QC 之前**:将全部 **须同一轮三审覆盖** 的提交 **merge / rebase / cherry-pick**(以 PM 指定的团队方式)**归并**到 **同一条** PM 将作为 QC **`Working branch`** 的分支的 **`HEAD`**(**通常即 plan 集成分支**;若 PM 已将集成分支重命名或快进为最终 `feature/*`,以 Assignment 为准)。**在此**解决冲突;**勿**在 QC Assignment 仍指向「只含部分轨」的旧 `HEAD` 时派三审。
130
- 4. **QC / QA 的 `Working branch` 与合并主线**:派发 QC 三审与对齐的 QA 时,**`Working branch`** **即为**上一步 **已含全部待审提交** 的那条分支(常见为 plan 集成分支)。**`Review range` / `Diff basis`** 通常相对 **尚未合并 feature 的** 主线参照(例如 `merge-base: origin/main` + `tip: HEAD`),审查的是 **「feature 线 vs 主线」** 的差异;**默认不要求**在 QC **通过前** 已把该分支 merge `main`(除非 **`Branch policy`** 或用户明确约定 trunk 式例外)。
130
+ 4. **QC / QA 的 `Working branch` 与合并主线**:派发 QC 三审与对齐的 QA 时,**`Working branch`** **即为**上一步 **已含全部待审提交** 的那条分支(常见为 plan 集成分支)。**`Review range` / `Diff basis`** 通常相对 **尚未合并 feature 的**显式目标或 base 参照(例如 `merge-base: <target_branch-or-base-ref>` + `tip: HEAD`),审查的是 **「feature 线 vs 目标线」** 的差异;**默认不要求**在 QC **通过前** 已把该分支 merge 进目标分支(除非 **`Branch policy`** 或用户明确约定 trunk 式例外)。
131
131
  5. **本推荐不适用时**:单轨、多仓库、或 plan 已 **拆 scope / 多轮增量三审**(见 `mstar-plan-conventions`)— 仍须 **逐轮**满足 **强制**条款:每轮 QC 对应 **一条**快照、**一套**逐字相同的 `plan_id` + `Review range` / `Diff basis`。
132
132
  - **单一待审 Git 快照(派 QC 前置条件)**:若本 plan 下曾有多条 **可写** 并行轨落在 **同一业务仓** 且其成果分布在 **不同分支**、或 **未互相合并进同一条分支的 `HEAD`**,则在派发 **QC 三审**(及同范围的 QA)**之前**,**必须**先在 Git 中完成 **归并**(merge / rebase / 按团队约定的集成方式),使 **全部**待审提交都出现在 **同一条** PM 指定的 **`Working branch`** 的 **`HEAD`** 上;**然后**再填写 **一个** `Review cwd`(可为该分支上新开的只读审查 worktree)与 **一个** 可复现的 **`Review range` / `Diff basis`**。**禁止**仅填写并行轨 **A** 的开发用 `Worktree path` 作为 `Review cwd`,却期望审查覆盖仍只存在于并行轨 **B** 的分支或提交上的变更(在该变更 **未进入** 轨 A 所检出分支的 `HEAD` 时,这在 Git 上不可复现,属 **Assignment 错误**)。
133
133
  - **不应合并为一次审时的做法**:若两轨 **有意**保持独立可合并单元(例如两条独立 PR),**不得**共用 **同一套** `plan_id` + **`Review range` / `Diff basis`** 假装「一轮三审覆盖全部」。应 **拆分 scope**:分轮次审查、不同 **`Feature / scope label`**、不同 `plan_id`、或按 `mstar-plan-conventions` 写明的 **显式增量三审** 例外,使每轮 QC 各对应 **一条**分支快照与 **一套**对齐字段。
@@ -140,7 +140,7 @@ description: Morning Star business-repo Git feature branches, same-repo concurre
140
140
  - **`@project-manager`** 分派 **QC** 时须在 Assignment 写明与待审实现一致的 **`Working branch`**,并写明 **`Review cwd` / `Worktree path`**:**优先**沿用开发 **Completion Report** 中回报的业务仓 **实现检出路径**(即「该 feature 的 worktree」)**当且仅当**该路径上的检出分支 **`HEAD` 已包含本轮待审的全部提交**(含曾发生在其他并行 worktree、现已归并到该分支的变更)。否则 **必须**改用 **集成完成后的** `Working branch` 与对应检出路径(或在该分支上 **另开** 审查专用 worktree)。若开发未用 worktree,则写明单一明确的业务仓根路径。若审查需与开发目录 **物理分离** 但仍审 **同一分支**,可指示在 **`Working branch`** 上 **另加** 一个 worktree 专供审查(只读使用业务仓)。**多流并行开发**时的前置归并、**推荐默认编排(plan 集成分支先行)** 与误派禁令见上一小节。
141
141
  - **三票审同一功能(强制对齐)**:分派 **QC 三审**时,除上述字段外,**必须**在 **三份 Assignment 中逐字写入相同**的 **`plan_id`** 与 **`Review range` / `Diff basis`**:
142
142
  - **`plan_id`**:与 `{PLAN_DIR}/reports/<plan-id>/` 及主 **Plan Path** 一致;无 `{PLAN_DIR}` 流程时写 **`plan_id: N/A`**,并另给一行 **`Feature / scope label`**(不可歧义,足以与并行其它 feature 区分)。
143
- - **`Review range` / `Diff basis`**:明确本次审查所针对的 **diff/提交范围**(例如 `merge-base: origin/main` + `tip: HEAD`;或 `rev-range: <full-40>..<full-40>`;或一句 `equivalent to: git diff <merge-base>...HEAD`,以团队可复现为准)。**三名 reviewer 的 Assignment 间该字段必须完全一致**;**@qa-engineer** 验证同一 feature 时 **复用同一 `plan_id` 与同一 `Review range` / `Diff basis`**。**热修 / QC 单审**路径也须含 **同一组字段**,仅承接方份数为 1。
143
+ - **`Review range` / `Diff basis`**:明确本次审查所针对的 **diff/提交范围**(例如 `merge-base: <target_branch-or-base-ref>` + `tip: HEAD`;或 `rev-range: <full-40>..<full-40>`;或一句 `equivalent to: git diff <merge-base>...HEAD`,以团队可复现为准)。**三名 reviewer 的 Assignment 间该字段必须完全一致**;**@qa-engineer** 验证同一 feature 时 **复用同一 `plan_id` 与同一 `Review range` / `Diff basis`**。**热修 / QC 单审**路径也须含 **同一组字段**,仅承接方份数为 1。
144
144
  - **三审并行**时,三名 reviewer **共用同一组 `Review cwd` / `Worktree path` + `Working branch` + `plan_id` + `Review range` / `Diff basis`**(对业务仓只读分析);**一般不必**为每位 reviewer 各开一个 worktree,除非宿主或执行环境要求进程级隔离。
145
145
  - QC 的 **报告落盘**仍仅限 `{PLAN_DIR}/reports/`;上述约定保证 `git diff`、`git log`、lint 与所读文件与 **待合并 feature** 一致。
146
146
  - **`@project-manager`** 分派 **`@qa-engineer`** 做 **本 feature 的验证**(跑测试、复现、可观察取证、或向业务仓提交测试/配置)时,须在 Assignment 中写明 **同一套** **`Review cwd` / `Worktree path`**、**`Working branch`**、**`plan_id`** 与 **`Review range` / `Diff basis`**(与 QC 三审 **逐字相同**;若 QC 已写清,QA **照抄**)。**@qa-engineer** 在执行业务仓命令前须核对当前目录与分支与 Assignment 一致;**Report-only**、且本轮 **不涉及** 业务仓内命令/路径依赖时,若 Assignment 未写 `Review cwd`,须在回报中说明验证所基于的检出或环境,缺失则 `Blocked` 并请 PM 补全。
@@ -70,20 +70,26 @@ description: Morning Star 派发与委派门禁 —— 仅 PM 可增派 subagent
70
70
  - **QC 三审**在 feature 开发完成后执行;三名 reviewer 共用同一组 `Review cwd` / `Working branch` / `plan_id` / `Review range` / `Diff basis`(**`mstar-branch-worktree`**)。
71
71
  - **同一 plan 多 batch**:默认整 plan 交付完成跑一轮完整三审;**fix 后默认 targeted re-review**(N = 被指派的 QC 席位数,同条消息发满 N);**仅** Assignment 写明 **`QC re-review: full tri-review`** 时复跑三审且用新文件名(**`mstar-plan-artifacts/references/plan-files-and-reports.md`**、**`mstar-review-qc`**)。
72
72
 
73
- ## iteration-start Review & Edit chain
73
+ ## Specialist review-and-edit dispatch
74
74
 
75
- QC 三审同理:**dispatch-first** 适用于文档审查角色,不限于 implement/QC。
75
+ PM 派发**文档编辑类**专业角色(如 product-manager、architect、writing-specialist)直接修订 harness 产物时:
76
76
 
77
- - PM compass/plans **初稿**;**@product-manager**、**@architect**、**@writing-specialist** 各通过 Task **直接编辑** compass / plans / specs(**不**另写 `reports/` 审查报告)。
78
- - PM 线程跳过派发、自行完成三角色全部编辑 = **反模式**(见 **`mstar-harness-core`** 反模式索引、`mstar-iteration` §1.6)。
79
- - Steps 5.1–5.3 **Task**(可并行);PM lock(5.4)在 PM 线程完成。**不得**在 review chain 完成前 commit integration 分支。
77
+ - PM 写初稿;各角色通过宿主 invoke **直接编辑**目标文件(**不**另写仅评论式 `reports/` 替代修订)。
78
+ - **1 Assignment 1 invoke**。
79
+ - **Phase 1 Review & Edit chain**(`mstar-iteration` §1.6):**顺序** `product-manager` `architect` `writing-specialist`;上一角色落盘修订完成后再派发下一角色。**禁止**本链并行 batch(与 QC 三审不同)。
80
+ - 其他彼此独立、无先后依赖的文档编辑任务:可并行(同条消息发满 N),见 **`parallel-dispatch.md`**。
81
+ - PM 线程代做全部专业编辑 = **反模式**(`mstar-iteration` §1.6、`mstar-harness-core` 反模式索引)。
82
+ - PM merge / lock(如 compass `status: locked`)在链末 subagent 返回后于 PM 线程完成。**不得**在 review-and-edit 链完成前 commit integration 分支。
80
83
 
81
84
  ## 反模式(派发)
82
85
 
83
86
  - QC 三审拆在多条消息或等 #1 返回再发 #2/#3。
84
87
  - 仅 1 次 invoke 却声称「并行三审已启动」。
85
88
  - 递归同角色 subagent;把 Handoff / 多轨编排措辞当 invoke。
86
- - iteration-start Review & Edit chain 完成前 commit;PM 代做三角色全部编辑而不派发 Task
89
+ - Review-and-edit 链未完成即 commit integration 分支;PM 代做专业角色编辑而不 invoke
90
+ - Phase 1 review-and-edit 链三角色并行派发,或未等上一角色返回即派发下一角色。
91
+ - 全部 plan `Done` 后跳过 Phase 3 直接 PR;final plan closure 替代 `mstar-iteration` §3.1–§3.5。
92
+ - Assignment 已写、invoke 为零(paste-only)却进入下一 gate。
87
93
 
88
94
  ## References
89
95
 
@@ -33,7 +33,7 @@ description: Morning Star (启明星) harness **强制全局入口** —— 信
33
33
  | 角色 | 始终 | 按任务追加(典型) |
34
34
  |------|------|-------------------|
35
35
  | **全部** | 本 skill | — |
36
- | **`@project-manager`** | 本 skill | `mstar-dispatch-gates`、`mstar-phase-gates`、`mstar-plan-conventions`、`mstar-roles`;派 QC 前 `mstar-review-qc`;并行/审查 `mstar-branch-worktree`;plan/status/reports `mstar-plan-artifacts`;UI 类 plan Prepare 阶段 `mstar-design-md`(DESIGN.md 门禁);新建/大改 skill 时 `mstar-skill-authoring`;迭代管理 `mstar-iteration`(iteration-start/drive/close 含 compound);战略性工作 `mstar-strategy`。**不**读 `mstar-coding-behavior` |
36
+ | **`@project-manager`** | 本 skill | `mstar-dispatch-gates`、`mstar-phase-gates`、`mstar-plan-conventions`、`mstar-roles`;派 QC 前 `mstar-review-qc`;并行/审查 `mstar-branch-worktree`;plan/status/reports `mstar-plan-artifacts`;UI 类 plan Prepare 阶段 `mstar-design-md`(DESIGN.md 门禁);新建/大改 skill 时 `mstar-skill-authoring`;迭代管理 `mstar-iteration`(Phase 1–3 含 compound);战略性工作 `mstar-strategy`。**不**读 `mstar-coding-behavior` |
37
37
  | **实现/审查/QA/运维** | 本 skill + `mstar-coding-behavior` + 角色 ref | 有 git 写:`mstar-branch-worktree`;有 plan 路径:`mstar-plan-conventions`(路径符号节);QC/QA:`mstar-review-qc`;改 status/residual:`mstar-plan-artifacts`;UI 任务:`mstar-design-md`(读取 DESIGN.md tokens);写入知识库 `{KNOWLEDGE_DIR}`:`mstar-compound`(PM 触发) |
38
38
  | **leaf 承接方** | 上栏 + **`mstar-dispatch-gates`**(反递归节) | — |
39
39
 
@@ -139,9 +139,11 @@ Read **`mstar-host`** after this skill; detect host per its table, then Read the
139
139
  | 无证据宣称完成 | `mstar-coding-behavior` / verification |
140
140
  | CreatePlan 不落盘 / 无 `{HARNESS_DIR}` mirror | `mstar-host` · `cursor-plan-mode-bridge` |
141
141
  | 临时方案 / 后续计划只写在对话里 | `mstar-phase-gates` · Durable Roadmap Gate |
142
- | iteration-start commit before review chain | `mstar-iteration` §1.6;PM 模拟三角色编辑而不派发 Task |
143
- | Phase 3 折叠进 final plan closure / 跳过 §3.1 gate | `mstar-iteration` §3.0–§3.5;`iteration-drive` Phase 3 |
142
+ | Phase 1 review chain 未完成即 commit | `mstar-iteration` §1.6;PM 代做专业角色编辑;或三角色并行派发 |
143
+ | Phase 2 paste-only / PM 自实现 | `mstar-dispatch-gates` |
144
+ | Phase 3 折叠进 final plan closure / 跳过 §3.1 gate | `mstar-iteration` §3.0–§3.5 |
144
145
  | iteration-close 无 frontmatter completed / 漏 compound Phase 6 | `mstar-iteration` §3.0.5、§3.4、§3.2 #5 |
146
+ | iteration 默认 `main` 作 base 或 PR 目标 | `mstar-iteration` §1.2、§2.3;`mstar-plan-conventions` Spec 分支模型 |
145
147
 
146
148
  ## 可选:OpenViking Memory
147
149
 
@@ -35,7 +35,7 @@ Use **capability signals** (not filesystem paths):
35
35
 
36
36
  ## Parallel dispatch (invoke-capable hosts)
37
37
 
38
- When PM dispatches **N >= 2** concurrent assignees (QC tri-review, dual-track implement, etc.) and the host exposes actual invoke / Task / subagent tools, read **`references/parallel-dispatch.md`** in the dispatch round (shared with `mstar-dispatch-gates`). Without a callable invoke tool, Assignment Markdown is not dispatch.
38
+ When PM dispatches **N >= 2** concurrent assignees (QC tri-review, dual-track implement, etc.) and the host exposes actual invoke / Task / subagent tools, read **`references/parallel-dispatch.md`** in the dispatch round (shared with `mstar-dispatch-gates`). Without a callable invoke tool when dispatch is required → **`Blocked`**; Assignment Markdown alone is not dispatch.
39
39
 
40
40
  ## Library docs (Context7)
41
41
 
@@ -37,8 +37,8 @@ Use skill names in prompts and references. Avoid absolute local paths unless the
37
37
 
38
38
  - **No invoke tool / no linked custom agent = no dispatch**: printing `## Assignment` does not start another Codex worker.
39
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`.
40
- - If no invoke tool is present, use single-session role execution: state the active role, load that role reference, complete the assignment, and return Completion Report v2.
41
- - QC tri-review is only "parallel" when three distinct callable reviewer sessions are actually launched in one dispatch turn. Without that, run a clearly labeled serial/manual review path or return `Blocked` for PM rerouting.
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
+ - QC tri-review requires three callable reviewer sessions in one dispatch turn. Cannot emit **N=3** **`Blocked`** for PM rerouting; do not claim tri-review complete or substitute serial/manual review in the PM thread.
42
42
  - Leaf executors still follow `mstar-dispatch-gates`: no recursive Task/subagent calls unless Assignment says `Delegation: allowed (...)`.
43
43
 
44
44
  ## Files, shell, and approvals
@@ -46,15 +46,16 @@ Enforcement: `rules/mstar-cursor-plan-mode.mdc` when plugin active.
46
46
  - Parallel QC ≠ different review cwd per reviewer; one integrated HEAD for scope.
47
47
  - Status Update may note QC ran via parallel Task subagents.
48
48
 
49
- ## Supplemental execution modes
49
+ ## Dispatch execution(canonical)
50
50
 
51
- **Mode A Single session, multiple roles:** PM writes Assignment; executor states `Acting as role: …` and loads `mstar-roles` reference. QC/QA without Task: same field alignment rules.
51
+ Cursor PM dispatch = **`Task`** with `subagent_type` matching the Assignment `Execute as` role.
52
52
 
53
- **Mode B Multi-window:** One Assignment per chat; first turn loads role via `mstar-roles`; PM consolidates in main thread.
54
-
55
- **Mode C Worktrees:** `mstar-branch-worktree` + `mstar-dispatch-gates` for concurrent writers; do not assign different tri-review cwd by default.
56
-
57
- **No recursive Task in implement subagents:** Task recipient is already `Execute as`; must not re-spawn same dev role. Assignment wins over conflicting outer messages (`Delegation: forbidden`).
53
+ - **1 Assignment 1 Task**; parallel batches **N Tasks in one message** (`parallel-dispatch.md`, `mstar-dispatch-gates`).
54
+ - Assignment Markdown **does not** start work. PM thread **must not** implement, review, or edit specialist deliverables by loading another role reference in the same session (`Acting as role: …` is **not** dispatch).
55
+ - No callable `Task` / subagent for required work → **`Blocked`** — report to user; do not substitute in-thread execution.
56
+ - **Only exception:** user explicitly overrides harness dispatch for this turn (document the override).
57
+ - Concurrent writers / QC cwd alignment **`mstar-branch-worktree`** (not a separate “mode”).
58
+ - Implement subagents: recipient is already `Execute as`; **no** recursive Task with same `subagent_type`. Assignment wins (`Delegation: forbidden` unless stated).
58
59
 
59
60
  ## Clarify
60
61
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Shared PM dispatch contract for **any** host that uses subagent / Task / named-role invoke (OpenCode, Cursor Task, Codex only when a callable multi-agent / Task tool is actually available). Process SSOT also in `mstar-dispatch-gates`.
4
4
 
5
- If the active host has no callable invoke tool, this reference does not create delegation capability: use single-session execution, multi-window handoff, or mark dispatch `Blocked`.
5
+ If the active host has no callable invoke tool, this reference does not create delegation capability mark dispatch **`Blocked`** and report to the user. Do not substitute PM-thread or single-session role execution unless the user explicitly overrides harness dispatch for this turn.
6
6
 
7
7
  ## Paste-only failure
8
8
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mstar-iteration
3
- description: Morning Star 迭代管理 —— iteration-start(锁定范围、Review & Edit chain 硬门禁)、Autonomous Execute(per-plan 派发循环)、iteration-close(独立 Phase:close gate、compound、roadmap、compass completed)。触发:PM 启动新迭代、跨 plan 编排、或全部 plan Done 后收口。compass:`{ITERATION_DIR}/<iteration-id>-delivery-compass.md`;per-plan SSOT:`{HARNESS_DIR}/status.json`。
3
+ description: Morning Star 迭代管理 —— iteration-start(显式 `iteration_base_branch` / `target_branch`、Review & Edit chain 硬门禁)、Autonomous Execute(per-plan 派发;禁止默认 `main`)、iteration-close(独立 Phase gate)。compass:`{ITERATION_DIR}/`;分支 SSOT:`status.json` metadata + compass frontmatter。
4
4
  ---
5
5
 
6
6
  # mstar-iteration(迭代管理)
@@ -22,13 +22,24 @@ iteration-start → [per-plan lifecycle × N] → iteration-close → PR → mer
22
22
  │ Review & Edit chain → PM lock │ 标记迭代完成
23
23
  │ 创建 integration 分支 │ commit 到 integration 分支
24
24
  │ │
25
- └──────── iteration-drive(跨 plan 追踪)────────┘
25
+ └──────── Phase 2(Autonomous Execute)────────┘
26
26
  ```
27
27
 
28
- **关键定位**:iteration-close 是 iteration-drive 命令的**最后一个 Phase**,在 integration 分支上执行,**完成后再创建 PR**。所有 compound 产物(knowledge docs、compass 更新、CONCEPTS.md)作为迭代交付的一部分随 PR 合入 main。一次迭代 = 一个 PR。
28
+ **关键定位**:Phase 3 iteration-close 是 **Autonomous Execute 之后的独立 Phase**,在 integration 分支上执行,**完成后再创建 PR**。所有 compound 产物(knowledge docs、compass 更新、CONCEPTS.md)作为迭代交付的一部分随 PR 合入已记录的 `target_branch`。一次迭代 = 一个 PR。
29
+
30
+ ## Phase transition gates(HARD — 防跳步)
31
+
32
+ | 边界 | 触发 | 必须 | 禁止 |
33
+ |------|------|------|------|
34
+ | **→ Phase 3** | `status.json` 中 compass 登记的全部 plan 均为 `Done` | 打印 `## Phase 3: iteration-close`;执行 §3.0→§3.5;host todo `phase-3-iteration-close` 保持 open 直至 §3.5 | 开 PR;宣称 iteration 完成;仅依赖 final plan closure |
35
+ | **→ PR** | §3.5 exit checklist 全 `[x]`;frontmatter `status: completed` + `end_date` | commit integration 分支 → PR 到 `metadata.target_branch` | 跳过 §3.1 entry checklist 或 compound Phase 6 |
36
+ | **iteration-start → integration branch** | §1.6 Review & Edit chain | 三角色 **按序** invoke 完成 + compass `status: locked` | PM 线程代做三角色编辑;并行三角色;review 前 commit |
37
+
38
+ **误判信号**:对话里出现 compound 摘要、roadmap 更新、或「所有 plan 已完成」但 **未** 打印 §3.1 / §3.5 checklist → 视为 **Phase 3 未执行**,回到 §3.0。
29
39
 
30
40
  **per-plan 状态 SSOT**:`{HARNESS_DIR}/status.json`(per-plan Todo/InProgress/InReview/Done)。
31
41
  **迭代状态 SSOT**:`{ITERATION_DIR}/<id>-delivery-compass.md` frontmatter `status` + `{ITERATION_DIR}/README.md` 索引。
42
+ **迭代分支 SSOT**:root `metadata.iteration_base_branch` + `metadata.target_branch`(`status.json`);compass frontmatter 镜像同名字段。解析顺序见 §2.3。**禁止**因仓库存在 `main`/`master` 就假定 base 或 PR 目标。
32
43
 
33
44
  ## 产物存储位置
34
45
 
@@ -59,6 +70,9 @@ PM 在新迭代启动时执行。
59
70
  | **验收标准** | 迭代级别的 Done 定义 |
60
71
  | **非目标** | 明确排除在本次迭代外的事项 |
61
72
  | **Roadmap 上下文** | 本迭代在整体 roadmap 中的位置(current iteration / next iteration) |
73
+ | **Delivery branch policy** | `iteration_base_branch`(integration 分支从何处分出)、`spec_integration_branch`、`target_branch`(最终 PR 目标) |
74
+
75
+ **Branch policy gate**:若用户、现有 roadmap、或项目约定未明确 `iteration_base_branch` / `target_branch`,PM 必须检查当前分支并向用户确认。**不得**因为存在 `main` / `master` 就默认从默认分支开 iteration 或向默认分支提 PR。
62
76
 
63
77
  ### 1.3 创建迭代 compass
64
78
 
@@ -69,6 +83,8 @@ PM 在新迭代启动时执行。
69
83
  iteration_id: <id>
70
84
  start_date: YYYY-MM-DD
71
85
  status: active
86
+ iteration_base_branch: <branch-or-ref>
87
+ target_branch: <branch>
72
88
  plans: []
73
89
  ---
74
90
 
@@ -97,6 +113,14 @@ plans: []
97
113
  ## Roadmap Position
98
114
  - Current iteration: <what this iteration delivers>
99
115
  - Next iteration: <what comes next, owner, trigger>
116
+
117
+ ## Delivery Branch Policy
118
+
119
+ | Field | Value |
120
+ |-------|-------|
121
+ | iteration_base_branch | <branch-or-ref> |
122
+ | spec_integration_branch | iteration/<iteration-id> |
123
+ | target_branch | <PR target> |
100
124
  ```
101
125
 
102
126
  ### 1.4 更新索引
@@ -107,24 +131,30 @@ plans: []
107
131
  |----------|-----------|-------------|--------|
108
132
  | `<iteration-id>-delivery-compass.md` | `<iteration-id>` | `<简短描述>` | `active` |
109
133
 
110
- ### 1.5 登记到 status.json(可选)
134
+ ### 1.5 登记到 status.json(formal iteration 必填)
111
135
 
112
- 若使用 `status.json`,在 `plans[].metadata` 中为受影响的 plan 设置 `iteration_refs`。
136
+ iteration 正式全流程**必须**写入 `{HARNESS_DIR}/status.json`:
113
137
 
114
- ### 1.6 Review & Edit chain(integration 分支前强制)
138
+ - root `metadata.iteration_base_branch` 创建 `spec_integration_branch` 的祖先 ref(**不是**隐式 `main`)
139
+ - root `metadata.target_branch` — iteration-close 后 PR 的目标分支
140
+ - 各 plan `metadata.iteration_refs`、`spec_integration_branch`、`merge_target`(`merge_target` 通常为 `spec_integration_branch`)
115
141
 
116
- **iteration-start PM lock 前不算完成**——compass/plans 初稿落盘 Done
142
+ compass frontmatter `iteration_base_branch` / `target_branch` **必须与** `status.json` 一致;若仅写在 compass 而 status 缺失,§2.3 同轮 backfill
143
+
144
+ ### 1.6 Review & Edit chain(integration 分支前强制)
117
145
 
118
- host 命令 `iteration-start` §5 对齐:产物 SSOT 在本节;派发机制 SSOT 在命令 + **`mstar-dispatch-gates`**。
146
+ **Phase 1 PM lock 前不算完成**——compass/plans 初稿落盘 Done。
119
147
 
120
- PM **不得**将迭代 harness 文档 commit 到 `spec_integration_branch`,直到:
148
+ 派发机制 → **`mstar-dispatch-gates`**(specialist review-and-edit dispatch,**顺序链**)。PM **不得**将迭代 harness 文档 commit 到 `spec_integration_branch`,直到:
121
149
 
122
- 1. **@product-manager**、**@architect**、**@writing-specialist** 已通过宿主 Task(或等价角色 invoke)**直接编辑**(非仅评论)compass、plans 及受影响 specs
150
+ 1. **@product-manager** → **@architect** → **@writing-specialist** 已按序通过宿主 invoke **直接编辑**(非仅评论)compass、plans 及受影响 specs;每一环基于上一环落盘修订
123
151
  2. PM 将 compass `status` 设为 `locked`,并确认各 plan 的 Prepare gate(specify / clarify / plan)
124
152
 
153
+ **顺序理由**:产品范围与优先级 → 架构与契约 → 术语与行文;并行会导致后手重复劳动或覆盖前手未定稿内容。
154
+
125
155
  **完成证据** = 磁盘上的 compass / plans / specs 修订 + compass `status: locked`。**不**要求 `reports/<iteration-id>/` 审查报告——迭代审查的 SSOT 是被编辑的文档本身,无 per-plan QC 式审计链。
126
156
 
127
- **反模式**:PM 线程代替三角色完成全部编辑而不派发 Task —— 见 **`mstar-harness-core`** 反模式索引。
157
+ **反模式**:PM 线程代替三角色完成全部编辑而不 invoke;或将本链三角色并行派发 —— 见 **`mstar-harness-core`** 反模式索引。
128
158
 
129
159
  ---
130
160
 
@@ -132,15 +162,16 @@ PM **不得**将迭代 harness 文档 commit 到 `spec_integration_branch`,直
132
162
 
133
163
  **本 Phase 是本 skill 的核心**——定义 per-plan 派发循环的完整流程:前置条件检查、session todos、backlog 读取、integration 分支管理、per-plan dispatch 循环(分支→实现→QC→QA→Done→合并)、dispatch-first 约束、push 纪律。PM 读取本 Phase 即可执行迭代。
134
164
 
135
- ### 2.0 前置条件(三道闸)
165
+ ### 2.0 前置条件(四道闸)
136
166
 
137
167
  进入 Autonomous Execute 前必须满足:
138
168
 
139
169
  1. `{HARNESS_DIR}/status.json` 中至少一条 plan `status` ≠ `Done`
140
170
  2. **Pre-implement gate = GO**:plan 已 locked、tasks ready(见 `mstar-phase-gates`)
141
- 3. 用户意图为 **continue Execute**(`/pm`、"推进 iteration"、"继续 plans" 等)
171
+ 3. 用户意图为 **continue Autonomous Execute**(推进迭代 Execute、继续 per-plan 循环等)
172
+ 4. **Branch metadata gate**:root `metadata.iteration_base_branch`、`metadata.target_branch` 已登记,且至少一条 active plan 有 `metadata.spec_integration_branch`(或可从 compass 同轮 backfill)。**缺失 → STOP**,不得用 `main`/`master` 补位。
142
173
 
143
- 任一 false → **stop**。Prepare 未完成 → 引导先跑 `/iteration-start`。
174
+ 任一 false → **stop**。Phase 1 / Prepare 未完成 → 先完成 Phase 1 或 per-plan Prepare,再进入本 Phase。
144
175
 
145
176
  ### 2.1 Session todos(派发前设护栏)
146
177
 
@@ -148,7 +179,7 @@ PM **不得**将迭代 harness 文档 commit 到 `spec_integration_branch`,直
148
179
 
149
180
  | Host | 工具 | 最小集合 |
150
181
  |------|------|---------|
151
- | **Cursor** | `TodoWrite` / CreatePlan todos | 当前 `plan_id`;下一批 gates(implement/QC/QA);分支 checkpoint |
182
+ | **Cursor** | `TodoWrite` / CreatePlan todos | 当前 `plan_id`;下一批 gates(implement/QC/QA);分支 checkpoint;**仅剩 1 个非 Done plan 时追加 `phase-3-iteration-close`**(Done 后保持 open 直至 §3.5) |
152
183
  | **Codex** | `update_plan` / Goal UI | 同上 |
153
184
  | **OpenCode** | host todo/plan UI(如有) | 同上 |
154
185
 
@@ -158,15 +189,26 @@ SSOT = `{HARNESS_DIR}/status.json` + `{PLAN_DIR}/`。todos 只追踪本轮下一
158
189
 
159
190
  1. 读 `mstar-plan-artifacts` + `{HARNESS_DIR}/status.json`
160
191
  2. 列出 `status` ∈ `{Todo, InProgress, InReview, Blocked}` 的 plan(优先级:`InProgress` → `InReview` → `Todo` → unblock `Blocked`)
161
- 3. 读 `metadata.spec_integration_branch` / `merge_target` / `primary_spec` 链接
192
+ 3. 读 root `metadata.iteration_base_branch` / `metadata.target_branch`,以及 plan `metadata.spec_integration_branch` / `merge_target` / `primary_spec` 链接
162
193
 
163
194
  ### 2.3 Integration branch
164
195
 
165
- 1. `status.json` 解析 `spec_integration_branch`
166
- 2. **checkout 或创建**该分支;`git branch --show-current` 确认
167
- 3. metadata 缺失 **stop**,读 `mstar-plan-conventions` + 用户确认(`mstar-branch-worktree`);同轮写入 plan + status
196
+ **Metadata 解析顺序**(任一环节缺失则 STOP,**禁止**默认 `main`/`master`):
197
+
198
+ 1. `{HARNESS_DIR}/status.json` → `metadata.iteration_base_branch`、`metadata.target_branch`;plan → `metadata.spec_integration_branch`
199
+ 2. 若 (1) 缺字段 → 读当前迭代 `{ITERATION_DIR}/<iteration-id>-delivery-compass.md` frontmatter 同名键
200
+ 3. 若 compass 有值而 `status.json` 无 → **同轮 backfill** `status.json`
201
+ 4. 仍缺 → 向用户确认 base / PR target;**不得**因 `git symbolic-ref refs/remotes/origin/HEAD` 指向 `main` 就自动采用
202
+
203
+ **Git 操作**:
204
+
205
+ 1. `git fetch`(按需)确认 `iteration_base_branch` 存在
206
+ 2. **checkout 或创建** `spec_integration_branch`:
207
+ - 已存在 → `git checkout <spec_integration_branch>`
208
+ - 不存在 → `git checkout -b <spec_integration_branch> <iteration_base_branch>`(**必须**从记录的 base 创建,不是从当前未记录的 `main` 检出)
209
+ 3. `git branch --show-current` 确认在 `spec_integration_branch`
168
210
 
169
- 此分支是本迭代内所有 plan feature branch 的 merge target。
211
+ 此分支是本迭代内所有 plan feature branch 的 merge target。QC **`Review range` / `Diff basis`** 的 merge-base 参照优先用 `metadata.target_branch`(或 PM 书面指定的 base ref),**禁止**无 Assignment 依据写死 `origin/main`。
170
212
 
171
213
  ### 2.4 Per-plan loop(直到全部 Done)
172
214
 
@@ -179,10 +221,20 @@ SSOT = `{HARNESS_DIR}/status.json` + `{PLAN_DIR}/`。todos 只追踪本轮下一
179
221
  5. **Cross-plan 进度同步**:更新 `{ITERATION_DIR}/<iteration-id>-delivery-compass.md` 的 `## Plans` 表状态列
180
222
  6. **Next plan** 从步骤 1 继续
181
223
 
182
- 全部 plan `Done` → **STOP** per-plan loop(§2.4 结束),打印 **`## Phase 3: iteration-close`**,按 §3.0 起独立执行。final plan 的 Assignment / closure 可以提供素材,但不能替代 Phase 3 gate。
224
+ 全部 plan `Done` → **Phase transition gate**(见上文 **Phase transition gates**):
225
+
226
+ 1. **STOP** per-plan loop — 禁止 merge 后继续下一 plan、禁止开 PR、禁止会话结束语。
227
+ 2. 打印 **`## Phase 3: iteration-close`**。
228
+ 3. 按 §3.0 起独立执行至 §3.5。final plan 的 Assignment / closure 仅作输入,**不能**替代 Phase 3 gate。
183
229
 
184
230
  ### 2.5 Dispatch-first(implement 派发约束)
185
231
 
232
+ **派发回合纪律**(Cursor Task / 具名 invoke 宿主):
233
+
234
+ 1. 准备 Assignment 的消息可只含 read/bash — **不计入**派发。
235
+ 2. **下一条派发消息**的第一动作 = 发出全部 `Task`(QC 初轮 **N=3** 同条消息;双轨 implement **N=2**)。
236
+ 3. `Subagent invokes issued: 0` 而 Assignment 已写出 → **`dispatch incomplete`**;下一条必须补发 invoke,**禁止** PM 线程亲自实现顶替。
237
+
186
238
  | Do | Don't |
187
239
  |----|------|
188
240
  | **Loop:** `## Assignment` → invoke → Completion Report v2 → 更新 status → next | PM 亲自 Write/Edit/Shell 产品代码 |
@@ -203,7 +255,7 @@ SSOT = `{HARNESS_DIR}/status.json` + `{PLAN_DIR}/`。todos 只追踪本轮下一
203
255
 
204
256
  ## Phase 3: iteration-close(收口迭代)
205
257
 
206
- PM 在迭代内全部 plan Done 后执行。**本 Phase 在 integration 分支上运行**,产出物 commit 到 integration 分支,随迭代 PR 合入 main。触发方:`commands/iteration-drive.md`(Autonomous Execute 全部 Done 后进入)。
258
+ PM 在迭代内全部 plan Done 后执行。**本 Phase 在 integration 分支上运行**,产出物 commit 到 integration 分支,随迭代 PR 合入 root `metadata.target_branch`。入口:Phase 2 全部 plan `Done` 后按 **Phase transition gates** 进入。
207
259
 
208
260
  **Close Done 定义**:§3.1→§3.5 全部完成;compass frontmatter 写入 `status: completed` + `end_date`;每篇新增 knowledge doc 已登记 `{KNOWLEDGE_DIR}/README.md`。只在 final plan 中写了 compound / roadmap / PR 说明,不算 iteration-close 完成。
209
261
 
@@ -287,6 +339,7 @@ PM 打印 **iteration-close exit checklist**;全部为 `[x]` 后方可 `git co
287
339
  - [ ] §3.3 `## Roadmap Position` current iteration 已标 `delivered`;tracker / STRATEGY 已按需更新
288
340
  - [ ] §3.4 frontmatter `status: completed` + `end_date`;Compound Summary + Retrospective 已填
289
341
  - [ ] 当前分支是 `spec_integration_branch`
342
+ - [ ] PR base = `metadata.target_branch`(与 compass frontmatter 一致);**不是**未记录的 `main`
290
343
 
291
344
  **Commit 到 integration 分支**:
292
345
 
@@ -296,6 +349,8 @@ git commit -m "chore(iteration): close <iteration-id> — compound round, roadma
296
349
  git push origin <spec_integration_branch>
297
350
  ```
298
351
 
352
+ PR 目标使用 root `metadata.target_branch`;缺失时停止并补齐,不得默认 `main`。
353
+
299
354
  ### 3.6 可选:触发 compound-refresh
300
355
 
301
356
  若本轮 compound 新增了较多知识文档,或 compass 标记了可能过时的旧知识,触发 `mstar-compound-refresh` 对有重叠的知识文档做维护。
@@ -323,9 +378,10 @@ git push origin <spec_integration_branch>
323
378
  ## NOT to do
324
379
 
325
380
  - 不要在 per-plan Done 后立即单独 compound——等 iteration-close 统一做
326
- - 不要在 iteration-drive 中修改 per-plan gate 判定
381
+ - 不要在 Autonomous Execute(Phase 2)中修改 per-plan gate 判定
327
382
  - 不要用 compass 替代 `status.json` 作为 plan 状态 SSOT
328
383
  - 不要在没有完成 per-plan 前置检查的情况下进入 iteration-close
384
+ - 不要在缺少 `iteration_base_branch` / `target_branch` 时默认使用 `main` / `master`
329
385
  - 不要将 Phase 3 折叠进 final plan closure——须显式 §3.0→§3.5
330
386
  - 不要用 prose completion status 替代 compass frontmatter `status: completed` + `end_date`
331
387
  - 不要跳过 compound Phase 6(`{KNOWLEDGE_DIR}/README.md` 索引)——即使只结晶一篇文档
@@ -7,6 +7,8 @@ Copy this template when creating a new iteration compass in `{ITERATION_DIR}/`.
7
7
  iteration_id: <id>
8
8
  start_date: YYYY-MM-DD
9
9
  status: active
10
+ iteration_base_branch: <branch-or-ref>
11
+ target_branch: <branch>
10
12
  plans: []
11
13
  ---
12
14
 
@@ -53,6 +55,16 @@ Status values: `Todo` | `InProgress` | `InReview` | `Done` | `Blocked`
53
55
  - **Next iteration**:<what comes next>,触发条件:<condition>,owner:<who>
54
56
  - **最终目标**:<the long-term Done definition this iteration contributes to>
55
57
 
58
+ ## Delivery Branch Policy
59
+
60
+ > Mirror of frontmatter; keep in sync with `{HARNESS_DIR}/status.json` `metadata`.
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
+
56
68
  ## Risk Register
57
69
 
58
70
  | Risk | Likelihood | Impact | Mitigation |
@@ -80,23 +92,25 @@ Status values: `Todo` | `InProgress` | `InReview` | `Done` | `Blocked`
80
92
 
81
93
  | Field | Required | When to fill |
82
94
  |-------|----------|-------------|
83
- | `iteration_id` | Yes | iteration-start |
84
- | `start_date` | Yes | iteration-start |
85
- | `end_date` | No | Add at iteration-close §3.4 only |
86
- | `status` | Yes | iteration-start → `active` / `locked`(§1.6 PM lock);iteration-close §3.4 → **`completed`**(YAML frontmatter,非 prose completion status) |
87
- | `plans` (frontmatter) | Recommended | iteration-start (initial), iteration-drive (add new) |
88
- | `## Plans` table | Yes | iteration-drive (sync status), iteration-close (final) |
89
- | `## Milestones` | Recommended | iteration-start, iteration-drive (update) |
90
- | `## Acceptance Criteria` | Yes | iteration-start |
91
- | `## Non-Goals` | Yes | iteration-start |
92
- | `## Roadmap Position` | **Yes** | iteration-start(必填节,非散落于 general context prose);iteration-close §3.3(current iteration → `delivered`) |
93
- | `## Risk Register` | Optional | iteration-start, iteration-drive (update) |
94
- | `## Compound Round Summary` | Yes | iteration-close §3.4 |
95
- | `## Iteration Retrospective` | Recommended | iteration-close §3.4 |
95
+ | `iteration_id` | Yes | Phase 1 |
96
+ | `start_date` | Yes | Phase 1 |
97
+ | `end_date` | No | Phase 3 §3.4 only |
98
+ | `status` | Yes | Phase 1 → `active` / `locked`(§1.6 PM lock);Phase 3 §3.4 → **`completed`**(YAML frontmatter,非 prose completion status) |
99
+ | `iteration_base_branch` | Yes | Phase 1; integration branch must be created from this ref |
100
+ | `target_branch` | Yes | Phase 1; final PR target after Phase 3 |
101
+ | `plans` (frontmatter) | Recommended | Phase 1 (initial), Phase 2 (add new) |
102
+ | `## Plans` table | Yes | Phase 2 (sync status), Phase 3 (final) |
103
+ | `## Milestones` | Recommended | Phase 1, Phase 2 (update) |
104
+ | `## Acceptance Criteria` | Yes | Phase 1 |
105
+ | `## Non-Goals` | Yes | Phase 1 |
106
+ | `## Roadmap Position` | **Yes** | Phase 1(必填节,非散落于 general context prose);Phase 3 §3.3(current iteration → `delivered`) |
107
+ | `## Risk Register` | Optional | Phase 1, Phase 2 (update) |
108
+ | `## Compound Round Summary` | Yes | Phase 3 §3.4 |
109
+ | `## Iteration Retrospective` | Recommended | Phase 3 §3.4 |
96
110
 
97
111
  ## Legacy compass drift
98
112
 
99
113
  若仓库中已有 compass **无** YAML frontmatter、**无** `## Roadmap Position`,或只有 prose completion status:
100
114
 
101
- - **新迭代**:iteration-start 必须按本模板重写,不延续 prose-only 惯例。
102
- - **收口时**:`mstar-iteration` §3.0.5 在 iteration-close 入口规范化,再执行 §3.3–§3.4。
115
+ - **新迭代**:Phase 1 必须按本模板重写,不延续 prose-only 惯例。
116
+ - **收口时**:`mstar-iteration` §3.0.5 在 Phase 3 入口规范化,再执行 §3.3–§3.4。
@@ -104,7 +104,7 @@ description: Morning Star (启明星) Spec-Driven 双阶段门禁 —— Prepare
104
104
 
105
105
  per-plan 门禁通过后,PM 在**迭代层面**管理以下活动(不计入 per-plan gate):
106
106
 
107
- - **迭代启动**(`mstar-iteration` § Phase 1 iteration-start):锁定迭代范围(本迭代包含哪些 plan)、里程碑、验收标准,产出 `{ITERATION_DIR}/<iteration-id>-delivery-compass.md`。
107
+ - **迭代启动**(`mstar-iteration` § Phase 1):锁定迭代范围、**显式 branch policy**(`iteration_base_branch` / `target_branch`)、产出 compass
108
108
  - **迭代驱动**(`mstar-iteration` § Phase 2 Autonomous Execute):per-plan 派发循环(分支→实现→QC→QA→Done→合并),跨 plan 进度追踪,更新 compass 中各 plan 状态。
109
109
  - **迭代收口**(`mstar-iteration` § Phase 3 iteration-close):迭代内所有 plan Done 后,执行一轮知识结晶(`mstar-compound`)沉淀迭代经验,更新 roadmap,标记迭代完成。
110
110
 
@@ -39,7 +39,7 @@
39
39
  - **After `Request Changes` (default — targeted re-review)**:PM maps each **blocking** finding to the QC seat that raised it (`source` on R#, consolidated table, or the originating `qcN.md` / `F-###`). Dispatch **only** those reviewers (`QC re-review: targeted — reviewers: qc-specialist, qc-specialist-2, …`). Each re-reviewing QC **updates the same** `qc1.md` / `qc2.md` / `qc3.md` in place (add `## Revalidation`, refresh verdict / `generated_at`); **do not** add `qc1-rev2.md` siblings on this path. PM **updates the same** `qc-consolidated.md` in place. Git history is the audit trail.
40
40
  - **Full tri re-review (exception)**:Only when Assignment states **`QC re-review: full tri-review`**. Run **three** parallel reviews again; use **new basenames** (`qc1-rev2.md` … `qc3-rev2.md`, `qc-consolidated-rev2.md`) so wave-1 files stay immutable; PM states **active wave** in consolidated decision. See `mstar-review-qc` · `mstar-dispatch-gates`.
41
41
  - **显式例外**:仅当用户与 PM 书面同意**中间门禁**时,在 Assignment 写清 **`QC gate: incremental — <scope>`**(或等价),并仍须保证该次三审的 **`plan_id` + `Review range` / `Diff basis`** 三份一致;**优先**用子范围子目录,避免与终局 `qc1..3.md` 混名。
42
- - **同仓多 worktree 并行 dev**:**推荐**在排各 batch / 各轨 worktree 前确立 **plan 集成分支** 与各轨 topic 线及 **merge 靶**(见 `mstar-branch-worktree` **「推荐默认编排:先建 plan 集成分支,再挂各 worktree」**)。**多 `plan_id` 同属一条 `primary_spec`(Spec 文档)时**:该「集成分支」在计划语义上即 **Spec 集成分支**;各 Plan 的 topic 分支 **merge 回 Spec 集成分支**,**全部 Plans 完成后** 合入 `main`/`master` **须走 PR**,见 `mstar-plan-conventions` SKILL.md **「Spec 文档驱动的分支模型」**。终局(或增量)三审派单前,PM 仍须满足 **单一待审 `Working branch` / `HEAD`** 或已按上条 **拆 scope**;**不得**假设「整 plan 一次三审」可只靠某一个开发 worktree 路径覆盖未合并的其他并行轨。
42
+ - **同仓多 worktree 并行 dev**:**推荐**在排各 batch / 各轨 worktree 前确立 **plan 集成分支** 与各轨 topic 线及 **merge 靶**(见 `mstar-branch-worktree` **「推荐默认编排:先建 plan 集成分支,再挂各 worktree」**)。**多 `plan_id` 同属一条 `primary_spec`(Spec 文档)时**:该「集成分支」在计划语义上即 **Spec 集成分支**;各 Plan 的 topic 分支 **merge 回 Spec 集成分支**,**全部 Plans 完成后** 向显式 `target_branch` **走 PR**,见 `mstar-plan-conventions` SKILL.md **「Spec 驱动的分支模型」**。终局(或增量)三审派单前,PM 仍须满足 **单一待审 `Working branch` / `HEAD`** 或已按上条 **拆 scope**;**不得**假设「整 plan 一次三审」可只靠某一个开发 worktree 路径覆盖未合并的其他并行轨。
43
43
 
44
44
  ### 多 `plan_id` 同时 `InReview`(PM 编排)
45
45
 
@@ -109,8 +109,8 @@ In old JSON, **`"severity": "warning"`** is read and rolled up as **`low`**. **F
109
109
  | Key | Type | Purpose |
110
110
  | --- | --- | --- |
111
111
  | `working_branch` | string | Implementation branch; aligns with Assignment **`Working branch`** (SSOT) |
112
- | `spec_integration_branch` | string | (Multi-plan same **Spec**) integration branch name; plan branches merge here before `main` (`mstar-plan-conventions`) |
113
- | `merge_target` | string | Next merge target; multi-plan + Spec → usually `spec_integration_branch`; `main` via PR |
112
+ | `spec_integration_branch` | string | (Multi-plan same **Spec**) integration branch name; created from root `metadata.iteration_base_branch`; plan branches merge here before final PR (`mstar-plan-conventions`) |
113
+ | `merge_target` | string | Next merge target; multi-plan + Spec → usually `spec_integration_branch`; final PR target is root `metadata.target_branch` |
114
114
  | `branch_policy` | string | One-line policy per `mstar-harness-core` |
115
115
  | `phase` | string | Program/roadmap label |
116
116
  | `priority` | `high` \| `medium` \| `low` | PM scheduling |
@@ -152,10 +152,31 @@ Legacy string `plans[].notes` is OK; new repos should use arrays with time + eve
152
152
  | Key | Type | Purpose |
153
153
  | --- | --- | --- |
154
154
  | `versioning` | object | Cross-plan conventions (team-defined) |
155
+ | `iteration_base_branch` | string | Branch/ref used to create `spec_integration_branch`; required for formal iterations |
156
+ | `target_branch` | string | Final PR target after iteration-close; required for formal iterations |
155
157
  | `notes` | array | **Legacy** — prefer **`{HARNESS_DIR}/notes.json`** |
156
158
  | `residual_findings_history` | object | **Legacy** — prefer **`archived/residuals/<plan-id>.json`** |
157
159
  | `tech_debt_summary` | object | Optional rollup over open R#; maintain via script (below) |
158
160
 
161
+ **Formal iteration example** (root `metadata`; values are project-specific — **do not** copy `main` by default):
162
+
163
+ ```json
164
+ "metadata": {
165
+ "iteration_base_branch": "release/1.76",
166
+ "target_branch": "release/1.77"
167
+ }
168
+ ```
169
+
170
+ Plan row (per active iteration plan):
171
+
172
+ ```json
173
+ "metadata": {
174
+ "spec_integration_branch": "iteration/v1.77-live-teels",
175
+ "merge_target": "iteration/v1.77-live-teels",
176
+ "iteration_refs": ["v1.77"]
177
+ }
178
+ ```
179
+
159
180
  ## General constraints
160
181
 
161
182
  - Each `plans[]` row may include optional **`metadata`** (`{}` or omit).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mstar-plan-conventions
3
- description: Morning Star (启明星) harness 计划目录约定 —— `{HARNESS_DIR}` / `{PLAN_DIR}` / `{ITERATION_DIR}` / `{KNOWLEDGE_DIR}` / `{SPECS_DIR}` 发现与初始化(默认 `.mstar/`,兼容 `.agents/`)、`docs/` 与 harness 子树边界、未启用 plan 时的工作方式、Spec 集成分支与多 Plan 实现分支(merge 靶与 PR 合 main)、Morning Star plan-writing path gate、工期预估(agent-oriented)。**必须**在读写 `.mstar/` / `.agents/`、初始化 harness、编排含 plan 的任务、或对齐 `metadata.primary_spec` 时 Read;`@project-manager` 开 plan 任务前必读。plan 文件 / status / residual / reports / knowledge → **`mstar-plan-artifacts`**;分支与 QC 检出 → **`mstar-branch-worktree`**。
3
+ description: Morning Star (启明星) harness 计划目录约定 —— `{HARNESS_DIR}` / `{PLAN_DIR}` / `{ITERATION_DIR}` / `{KNOWLEDGE_DIR}` / `{SPECS_DIR}` 发现与初始化(默认 `.mstar/`,兼容 `.agents/`)、`docs/` 与 harness 子树边界、未启用 plan 时的工作方式、Spec 集成分支与多 Plan 实现分支(显式 base / merge / PR target)、Morning Star plan-writing path gate、工期预估(agent-oriented)。**必须**在读写 `.mstar/` / `.agents/`、初始化 harness、编排含 plan 的任务、或对齐 `metadata.primary_spec` 时 Read;`@project-manager` 开 plan 任务前必读。plan 文件 / status / residual / reports / knowledge → **`mstar-plan-artifacts`**;分支与 QC 检出 → **`mstar-branch-worktree`**。
4
4
  ---
5
5
 
6
6
  ## Load order(必读顺序)
@@ -58,11 +58,14 @@ PM 在需要持久化追踪时:
58
58
 
59
59
  ## Spec 驱动的分支模型(多 Plan · 同一 Spec)
60
60
 
61
- - **Spec 集成分支**:各 Plan 实现 merge 回此线后再视为 Spec 在代码侧集成。
61
+ - **Iteration base branch**:创建 Spec/iteration 集成分支的祖先分支或 ref;必须显式记录,不能默认 `main` / `master`。
62
+ - **Spec 集成分支**:从 `iteration_base_branch` 创建;各 Plan 实现 merge 回此线后再视为 Spec 在代码侧集成。
62
63
  - **Plan 实现分支**:每 `plan_id` 一条(PM 书面)。
63
- - **合入 `main`**:全部 Plans 完成后 **必须 PR**(窄例外见 Assignment `Branch policy`)。
64
+ - **PR target**:全部 Plans iteration-close 完成后,向显式 `target_branch` 提 PR(窄例外见 Assignment `Branch policy`)。
64
65
  - Git 操作与 QC 单一 `HEAD` → **`mstar-branch-worktree`**。
65
- - `status.json` 登记 `spec_integration_branch` / `merge_target` → **`mstar-plan-artifacts`**。
66
+ - `status.json` 登记 root `metadata.iteration_base_branch` / `metadata.target_branch`,以及 plan `metadata.spec_integration_branch` / `merge_target` → **`mstar-plan-artifacts`**。
67
+
68
+ **解析顺序**(`mstar-iteration` §2.3):`status.json` metadata → compass frontmatter → 向用户确认。**禁止**因仓库默认分支名为 `main`/`master` 就自动采用。
66
69
 
67
70
  ## Plan-Writing Path Gate
68
71
 
@@ -82,10 +82,10 @@ The **`**You are a leaf executor. You MUST NOT:**`** section (previously just pr
82
82
  - Prepare: `specify` [done|n/a], `clarify` [done|n/a], `plan` [done|n/a]
83
83
  - Execute: `plan locked` [done|n/a], `tasks` [done|n/a], `implement` [this assignment|done]
84
84
  - Gate decision: `go` | `blocked` (<reason>)
85
- **Working branch**: <branch policy or create-from policy>
85
+ **Working branch**: <branch policy or create-from policy> — formal iteration: from `metadata.spec_integration_branch`; integration cut from `metadata.iteration_base_branch` (`mstar-iteration` §2.3)
86
86
  **Review cwd / Worktree path**: <absolute path or N/A>
87
87
  **plan_id**: <plan-id or N/A + scope label>
88
- **Review range / Diff basis**: <reproducible basis; identical across QC/QA for same scope>
88
+ **Review range / Diff basis**: <reproducible basis; merge-base = `metadata.target_branch` or PM-specified ref — not assumed `origin/main`>
89
89
  **Worktree path**: <implementer path if used>
90
90
  **QA note**: <PM-scheduled / skipped / self-check>
91
91
  **Why this agent**: <role-fit>
@@ -8,7 +8,7 @@ Use this reference when PM is dispatching QC, consolidating review verdicts, or
8
8
  1. Dispatch three independent QC assignments.
9
9
  2. Collect reports and verify alignment fields:
10
10
  - `plan_id`
11
- - `Review range / Diff basis`
11
+ - `Review range / Diff basis` — use `metadata.target_branch` or PM-specified base ref for merge-base; **do not** assume `origin/main` in formal iterations (`mstar-iteration` §2.3)
12
12
  - `Review cwd / Worktree path`
13
13
  - `Working branch`
14
14
  3. Verify runtime identity/model mapping for three distinct QC roles.
@@ -116,6 +116,9 @@ If any item below matches, fix the dispatch/plan state or mark `Blocked`—do **
116
116
  - **NEVER** label `QA: skipped` for report-only QA—still dispatch `@qa-engineer` with report-only mode; QC skip rules are separate and explicit.
117
117
  - **NEVER** let non-PM/non-QA roles mark plan `Done`.
118
118
  - **NEVER** accept “temporary workaround”, “follow-up later”, “next plan”, or “split into batches” as narrative-only scope management. If work is deferred or staged, write the roadmap/tracking location before implement GO or Done.
119
+ - **NEVER** perform specialist document edits in the PM thread when host invoke is required — that is `dispatch incomplete` (`mstar-dispatch-gates`, `mstar-iteration` §1.6).
120
+ - **NEVER** mark the last plan `Done` and then create a PR or declare the iteration complete without **`## Phase 3: iteration-close`** and `mstar-iteration` §3.1–§3.5 checklists.
121
+ - **NEVER** treat final plan closure prose as iteration-close — compound, roadmap `delivered`, and compass `status: completed` require Phase 3.
119
122
 
120
123
  ---
121
124
 
@@ -134,7 +137,7 @@ If any fail -> do not dispatch implement.
134
137
 
135
138
  ### PM entry sessions (`/pm` or OpenCode PM switch)
136
139
 
137
- When the session entered via **`/pm`**, **`pm` skill**, or OpenCode PM orchestration, follow **`skills/pm/SKILL.md`** — especially **Host entry**, **Autonomous Execute driver** (status.json backlog, `spec_integration_branch`, per-plan feature branches), and **Dispatch-first**. Routing, gates, Task Board, QC, and templates remain in this file and topic `mstar-*` skills.
140
+ When the session entered via **`/pm`**, **`pm` skill**, or OpenCode PM orchestration, follow **`skills/pm/SKILL.md`** — especially **Host entry**, **iteration branch policy**(`iteration_base_branch` / `spec_integration_branch` / `target_branch`), **Autonomous Execute**(status.json backlog, per-plan feature branches), and **Dispatch-first**. Routing, gates, Task Board, QC, and templates remain in this file and topic `mstar-*` skills.
138
141
 
139
142
  ---
140
143
 
@@ -40,25 +40,9 @@ Prepare/Execute gates, routing, Assignment templates, Task Board, QC tri-review,
40
40
 
41
41
  **Exceptions:** user explicitly asks PM thread to implement; hotfix per `mstar-phase-gates`.
42
42
 
43
- ## iteration-start dispatch
43
+ ## Iteration
44
44
 
45
- After grill-me + draft compass/plans(**`mstar-iteration` § Phase 1**):
46
-
47
- - **Do not** commit to `iteration/<iteration-id>` until Review & Edit chain completes(§1.6)。
48
- - Dispatch **@product-manager**, **@architect**, **@writing-specialist** via host Task — **one invoke per role minimum**(parallel when independent)。
49
- - PM final lock is PM-whitelist work(compass `status: locked`, merge conflicts, Prepare gate confirmation)。
50
- - **Not** PM-whitelist: performing all three specialist document edits without subagent Task.
51
-
52
- Before §6 Integration Branch, print **`iteration-start` pre-commit checklist**(command §5); all items must be `[x]`。
53
-
54
- ## iteration-close(drive / 全部 plan Done 后)
55
-
56
- **`mstar-iteration` § Phase 3** 为独立 Phase;final plan closure 只能作为输入。
57
-
58
- - 全部 plan `Done` 后 **STOP** loop,打印 Phase 3 入场,从 §3.0 执行至 §3.5。
59
- - §3.1 close entry checklist 与 §3.5 close exit checklist 必须在对话中打印;全部为 `[x]` 方可 commit / PR。
60
- - 每篇新增 compound doc 必须完成 `mstar-compound` Phase 6(`{KNOWLEDGE_DIR}/README.md`)。
61
- - compass 完成形式:frontmatter `status: completed` + `end_date` + `## Roadmap Position` current iteration `delivered`——prose completion status 不算。
45
+ Formal iteration(Phase 1 Phase 2 → Phase 3)→ **`mstar-iteration`** only. Do not duplicate phase gates, branch policy, or close checklists here.
62
46
 
63
47
  ## Cursor Plan mode
64
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/opencode",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "description": "Morning Star harness OpenCode plugin (skills bootstrap and agent loading).",
5
5
  "license": "MIT",
6
6
  "repository": {