@mstar-harness/opencode 0.7.7 → 0.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,46 +1,57 @@
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 the recorded target branch
3
+ description: Drive the active iteration to completion — Phase 2 Autonomous Execute, Phase 3 iteration-close, Phase 4 Create PR, Phase 5 PR merge-ready loop (greploop / babysit / CI fallback) until mergeable. Not Done until Phase 5 exit checklist passes.
4
4
  agent: project-manager
5
5
  ---
6
6
 
7
7
  # Drive Iteration
8
8
 
9
- Drive the active Morning Star iteration forward. **Boot loads skills; this command sequences Phase 2 → Phase 3 → PR.** Domain SSOT → **`mstar-iteration`**.
9
+ Drive the active Morning Star iteration forward. **Boot loads skills; this command sequences Phase 2 → 3 → 4 → 5.** Phase gate SSOT → **`mstar-iteration`** §2–§5;本 command 仅补充 **可选第三方 helper skill 发现**(Phase 5),不反向写入 `mstar-*`。
10
10
 
11
11
  ## Phase state machine(禁止跳步)
12
12
 
13
13
  ```
14
- Phase 2: Autonomous Execute → Phase 3: iteration-close → Completion: PR
15
- (per-plan dispatch loop) (独立 gate,非 final plan) (close 之后)
14
+ Phase 2: Autonomous Execute → Phase 3: iteration-close → Phase 4: Create PR → Phase 5: PR merge-ready
15
+ (per-plan dispatch loop) (独立 gate) (开 PR) (loop 至 mergeable)
16
16
  ```
17
17
 
18
18
  | 当前状态 | 允许 | 禁止 |
19
19
  |----------|------|------|
20
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 |
21
+ | **全部** plan `Done` | **立刻** `## Phase 3: iteration-close`(§3.0→§3.5) | 宣称 iteration-drive 完成、开 PR、结束会话 |
22
+ | Phase 3 exit checklist 全 `[x]` + compass `status: completed` | 进入 **Phase 4: Create PR** | 跳过 compound / roadmap / frontmatter |
23
+ | PR 已创建 | **Phase 5** merge-ready loop(§5) | 汇报「迭代结束」、停止 host todos |
24
+ | Phase 5 exit checklist 全 `[x]` | **iteration-drive Done**;报告 PR link + merge-ready 证据 | — |
23
25
 
24
- **常见误判**:final plan closure notes、compound 草稿、roadmap 口头更新 **≠** iteration-close。必须打印 §3.1 entry + §3.5 exit checklist。
26
+ **Done 定义**:**仅** Phase 5 §5.5 exit checklist `[x]`。**Phase 3 close Done;Phase 4 开 PR ≠ Done。**
25
27
 
26
- ## PM invariants(Phase 2 全程有效)
28
+ ## PM invariants(Phase 2–5 全程有效)
27
29
 
28
30
  | 禁止(PM 线程) | 必须 |
29
31
  |-----------------|------|
30
- | Write/Edit/Shell 产品代码、写测试、跑 QC 审查 | 每条 implement/QC/QA Assignment ⇒ **1 次 `Task`** |
32
+ | Write/Edit/Shell 产品代码、写测试、跑 QC 审查(Phase 2) | 每条 implement/QC/QA Assignment ⇒ **1 次 `Task`** |
31
33
  | 只写 Assignment 就进入下一 gate | 同轮 dispatch:`Subagent invokes issued: N`(N = Assignment 条数) |
32
- | 最后一个 plan `Done` 后直接 PR / 汇报结束 | **先** Phase 3(`mstar-iteration` §3),**再** PR(见 Completion) |
34
+ | 最后一个 plan `Done` 后直接开 PR / 汇报结束 | **Phase 3 4 5** 顺序执行 |
35
+ | Phase 4 开 PR 后停止 | Phase 5 loop 至 merge-ready;**禁止**未过 §5.5 就结束会话 |
36
+ | Phase 5 自己改产品代码 | 需改产品代码时 **dispatch** `@fullstack-dev` / `@ops-engineer` |
33
37
 
34
38
  派发细则 → **`mstar-dispatch-gates`** + **`mstar-host`**。Phase 3 细则 → **`mstar-iteration` §3** + **`mstar-compound`**。
35
39
 
36
- **Session todos**:进入 Phase 2 时设 plan-wave todos;当仅剩 1 个非 `Done` plan 时 **追加** `phase-3-iteration-close`(`mstar-iteration` §2.1);§3.5 完成前不得勾掉。
40
+ **Session todos**:
41
+
42
+ | Todo id | 何时追加 | 何时可勾掉 |
43
+ |---------|----------|------------|
44
+ | plan-wave todos | 进入 Phase 2 | 各 plan `Done` |
45
+ | `phase-3-iteration-close` | 仅剩 1 个非 `Done` plan | Phase 3 §3.5 exit 全 `[x]` |
46
+ | `phase-4-create-pr` | Phase 3 完成后 | PR 已创建并记录 URL/number |
47
+ | `phase-5-pr-merge-ready` | Phase 4 完成后 | Phase 5 §5.5 exit 全 `[x]` |
37
48
 
38
49
  ## Boot
39
50
 
40
51
  1. `mstar-harness-core`
41
52
  2. `mstar-roles` → `references/project-manager.md`
42
53
  3. `skills/pm/SKILL.md` → **§ Host entry** + **§ Boot**(PM role identity + dispatch-first rules)
43
- 4. `mstar-iteration` → **§ Phase 2** + **§ Phase 3**(close 为独立 gate,§3.0–§3.5
54
+ 4. `mstar-iteration` → **§ Phase 2–5**(§3 close gate;§4 PR delivery;§5 merge-ready loop
44
55
  5. `mstar-compound` — Phase 3 §3.2 前加载(含 Phase 6 索引登记)
45
56
  6. `mstar-dispatch-gates` + host reference
46
57
  7. `mstar-plan-artifacts`, `mstar-plan-conventions`, `mstar-branch-worktree`
@@ -69,7 +80,7 @@ Execute **`mstar-iteration` § Phase 2** exactly. Summary:
69
80
  - Merge plan branch → integration branch
70
81
  - Cross-plan progress sync → compass
71
82
  - Next plan
72
- 6. Repeat until **all** plans `Done` → **STOP**(见 Phase state machine)→ 打印 `## Phase 3: iteration-close` → 执行 **`mstar-iteration` §3**;**不得**开 PR
83
+ 6. Repeat until **all** plans `Done` → **STOP**(见 Phase state machine)→ 打印 `## Phase 3: iteration-close` → 执行 **`mstar-iteration` §3**;**不得**进入 Phase 4
73
84
 
74
85
  派发回合纪律 → **`mstar-dispatch-gates`** + **`mstar-iteration` §2.5**。
75
86
 
@@ -77,10 +88,10 @@ Execute **`mstar-iteration` § Phase 2** exactly. Summary:
77
88
 
78
89
  当 **every** plan 为 `Done` 时:
79
90
 
80
- 1. **STOP** per-plan loop — 不得合并 plan 分支、写 PR、或输出「迭代完成」摘要。
91
+ 1. **STOP** per-plan loop — 不得开 PR、不得进入 Phase 4/5、不得输出「迭代完成」摘要。
81
92
  2. 打印标题 **`## Phase 3: iteration-close`**(用户可见的 phase 边界)。
82
93
  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**。
94
+ 4. §3.5 exit checklist 全 `[x]` 且 compass frontmatter `status: completed` → 打印 **`## Phase 4: Create PR`** → 执行下方 Phase 4。
84
95
 
85
96
  | Step | Section | 要点 |
86
97
  |------|---------|------|
@@ -97,17 +108,106 @@ git commit -m "chore(iteration): close <iteration-id> — compound round, roadma
97
108
  git push origin <spec_integration_branch>
98
109
  ```
99
110
 
100
- **Not Done until**: §3.5 checklist `[x]` + compass frontmatter `completed`.
111
+ **Phase 3 exit(非 iteration-drive Done)**: §3.5 checklist `[x]` + compass frontmatter `completed`。
112
+
113
+ ## Phase 4: Create PR
114
+
115
+ Execute **`mstar-iteration` § Phase 4**(PR delivery gate)。本 command 步骤摘要:
116
+
117
+ 1. 打印 **`## Phase 4: Create PR`**
118
+ 2. Resolve PR target: `status.json` → `metadata.target_branch`(fallback:compass frontmatter `target_branch`)
119
+ 3. If missing → **stop and ask**; never default `main` / `master`
120
+ 4. Create PR: `spec_integration_branch` → `target_branch`
121
+ 5. Record PR URL + number(Phase 5 SSOT for this session)
122
+ 6. 勾掉 host todo `phase-4-create-pr`
123
+ 7. **Immediately** 打印 **`## Phase 5: PR merge-ready`** → 执行下方 Phase 5(**禁止**在此停止或汇报 Done)
124
+
125
+ **Phase 4 exit(非 iteration-drive Done)**: PR 已创建且 head = `spec_integration_branch`。
126
+
127
+ ## Phase 5: PR merge-ready(babysit loop)
128
+
129
+ Execute **`mstar-iteration` § Phase 5**(merge-ready loop SSOT)。**§5.5 exit 全 `[x]` = iteration-drive Done.**
130
+
131
+ 本 command **叠加**可选 helper skill 发现(**non-`mstar-*`**;不写入 `mstar-*` load order):
132
+
133
+ ### 5.0 Discover optional helper skills
134
+
135
+ Before the first loop pass, search for bundled/host skills(first readable `SKILL.md` wins per name):
136
+
137
+ | Skill | Search paths(示例,按宿主扩展) |
138
+ |-------|----------------------------------|
139
+ | `greploop` | `skills/greploop/SKILL.md`;`~/.cursor/skills-cursor/greploop/SKILL.md`;`~/.agents/skills/greploop/SKILL.md`;Codex plugin `skills/greploop/` |
140
+ | `babysit` | `skills/babysit/SKILL.md`;`~/.cursor/skills-cursor/babysit/SKILL.md`;`~/.agents/skills/babysit/SKILL.md` |
141
+
142
+ **Mode selection**:
143
+
144
+ | Priority | Condition | Read before loop | Primary done signal |
145
+ |----------|-----------|------------------|---------------------|
146
+ | 1 | `greploop` found | `greploop` SKILL.md | Greptile score **5/5** on this PR |
147
+ | 2 | else `babysit` found | `babysit` SKILL.md | Required CI **all green** + **all** review threads **resolved** |
148
+ | 3 | else neither | —(本 command §5.2–§5.4) | Required CI **all green** + **all** review threads **resolved** |
149
+
150
+ **Both greploop and babysit present**: run greploop until **5/5**, then babysit until CI green + reviews resolved(串行;§5.5 仍须满足全部 exit 项).
151
+
152
+ **All modes** share §5.5 exit checklist(CI + reviews + mergeable;Greptile 5/5 按 mode / repo 条件).
153
+
154
+ ### 5.1 PM invariants(Phase 5)
155
+
156
+ | 禁止 | 必须 |
157
+ |------|------|
158
+ | 改 CI workflow 只为「让检查变绿」 | 仅修 **本 PR 范围内** 引起的失败;workflow 变更需用户明确授权 |
159
+ | 未 comment + resolve 就宣称 review 已处理 | 每次 push 针对 review 的修复 → §5.3 |
160
+ | §5.5 未全 `[x]` 就结束会话 | 循环直至 merge-ready |
161
+
162
+ Fixes **push 到 `spec_integration_branch`**(PR head);禁止另开分支替代。
163
+
164
+ ### 5.2 Loop(all modes)
165
+
166
+ Repeat until §5.5 exit checklist passes:
167
+
168
+ 1. **Status** — `gh pr view <number> --json mergeable,mergeStateStatus,statusCheckRollup,reviewDecision`(或宿主等价 API)
169
+ 2. **Merge conflicts** — if blocking: resolve on integration branch(意图冲突 → **Blocked**,问用户)→ push
170
+ 3. **Active reviews** — fetch **unresolved** review threads only;triage valid change requests
171
+ 4. **CI** — list failing required checks;dispatch or fix in-scope → push
172
+ 5. **Mode-specific pass**:
173
+ - **greploop**: follow greploop SKILL until Greptile **5/5**
174
+ - **babysit**: follow babysit SKILL(comments + CI loop)
175
+ - **fallback**: triage unresolved review threads(§5.3)+ poll CI until all required checks green(no skill Read;**与 babysit 同级的 CI + reviews 门禁**)
176
+ 6. After each push → §5.3 → return to step 1
177
+
178
+ **Stop looping only when** §5.5 全 `[x]`。若多轮仍 blocked → 升级用户(列出 failing checks / unresolved threads / Greptile score)。
179
+
180
+ ### 5.3 Review fix hygiene(HARD — all modes)
181
+
182
+ Whenever a push addresses PR review feedback(human or bot, including Bugbot / Greptile):
183
+
184
+ 1. **Comment** on the **same review thread** — 简述改动与验证(链接 commit / 文件)
185
+ 2. **Resolve** the thread when the fix is complete and you stand behind the response
186
+ 3. Re-fetch thread list — unresolved count must trend to **zero** before §5.5
187
+
188
+ Do not bulk-resolve without a per-thread reply. Disagree or uncertain → reply explaining why; leave unresolved and escalate.
189
+
190
+ ### 5.4 Fallback mode detail(no greploop / babysit)
191
+
192
+ When neither skill is found, **本 command 承担 babysit 同级职责**(无外部 SKILL,但 exit 标准相同):
193
+
194
+ 1. Fetch **unresolved** review threads;triage valid change requests → dispatch fix → push → §5.3 comment + resolve
195
+ 2. Poll PR required checks until **all green**(reasonable backoff between polls)
196
+ 3. On CI failure: diagnose → dispatch implement/ops if code fix needed → push → poll again
197
+ 4. Do **not** exit until **both** CI green **and** all review threads resolved(或用户书面 waive)
198
+ 5. Do **not** exit on first green if new commits or reviews reopened checks
101
199
 
102
- ## Completion: Create PR
200
+ ### 5.5 Phase 5 exit checklist(iteration-drive Done)
103
201
 
104
- **Precondition(HARD)**: Phase 3 complete — §3.5 exit checklist `[x]`;compass YAML `status: completed` + `end_date`;compound Phase 6 索引已登记(或已记录无可结晶原因)。**不满足 → 禁止开 PR。**
202
+ **`mstar-iteration` §5.2** 对齐;打印 checklist 并全 `[x]` 后结束本 command:
105
203
 
106
- All iteration-close changes committed to integration branch:
204
+ - [ ] PR mergeable(无 blocking merge conflicts)
205
+ - [ ] All **required** CI checks green on latest head
206
+ - [ ] All review threads **resolved**(或用户书面 waive 特定 thread)
207
+ - [ ] Greptile **5/5**(若运行了 greploop mode,或 repo 启用 Greptile 且 PR 上可见分数)
208
+ - [ ] §5.3 comment + resolve 已完成于本轮所有 addressed reviews
209
+ - [ ] Host todo `phase-5-pr-merge-ready` 可勾选
107
210
 
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`
111
- - Report summary: plans completed, compound round(结晶文档数), target branch, PR link
211
+ **Then** report: iteration id, plans completed, compound summary, PR link, merge-ready evidence(CI snapshot + review resolution + Greptile if applicable).
112
212
 
113
- PR 合并后(babysit loop 或手动),本次迭代完整结束。
213
+ PR merge itself may still be manual or a separate host action unless user authorized auto-merge.
@@ -32,14 +32,14 @@ description: Morning Star (启明星) harness **强制全局入口** —— 信
32
32
 
33
33
  **per-plan**:`specify → clarify → plan` → `plan(locked) → tasks → implement` → QC 三审 + QA → Done。阶段细则 → **`mstar-phase-gates`**。
34
34
 
35
- **迭代级**:`iteration-start → [per-plan cycle × N] → iteration-close(含知识结晶 `mstar-compound`)`。细则 → **`mstar-iteration`**。
35
+ **迭代级**:`iteration-start → [per-plan cycle × N] → iteration-close → PR delivery → PR merge-ready loop`。细则 → **`mstar-iteration`**。
36
36
 
37
37
  ## 加载约定(强制)
38
38
 
39
39
  | 角色 | 始终 | 按任务追加(典型) |
40
40
  |------|------|-------------------|
41
41
  | **全部** | 本 skill | — |
42
- | **`@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` |
42
+ | **`@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–5);战略性工作 `mstar-strategy`。**不**读 `mstar-coding-behavior` |
43
43
  | **实现/审查/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 触发) |
44
44
  | **leaf 承接方** | 上栏 + **`mstar-dispatch-gates`**(反递归节) | — |
45
45
 
@@ -87,7 +87,7 @@ PM 在 Assignment 写 **`Task category`**(主类 + 可选 `secondary`):
87
87
  |-------|------|
88
88
  | `mstar-harness-core` | 本文件:入口、状态机、Task category、explore、索引、护栏 |
89
89
  | `mstar-phase-gates` | per-plan 双阶段门禁:Prepare/Execute、意图门禁、hotfix、可验证编辑 |
90
- | `mstar-iteration` | 迭代管理:iteration-start(锁定范围/Roadmap)、Phase 2 Autonomous Execute(per-plan 派发循环:分支→实现→QC→QA→Done→合并)、iteration-close(收口 compound、更新 roadmap) |
90
+ | `mstar-iteration` | 迭代管理:Phase 1–5(start / Autonomous Execute / iteration-close / PR delivery / PR merge-ready loop) |
91
91
  | `mstar-dispatch-gates` | 派发、Delegation、反递归、并行 invoke、QC 同消息三审 |
92
92
  | `mstar-branch-worktree` | 功能分支、worktree、QC/QA 检出对齐 |
93
93
  | `mstar-plan-conventions` | `{HARNESS_DIR}` 发现、初始化、Spec 分支模型摘要、产物路径 SSOT |
@@ -148,6 +148,7 @@ Read **`mstar-host`** after this skill; detect host per its table, then Read the
148
148
  | Phase 1 review chain 未完成即 commit | `mstar-iteration` §1.6;PM 代做专业角色编辑;或三角色并行派发 |
149
149
  | Phase 2 paste-only / PM 自实现 | `mstar-dispatch-gates` |
150
150
  | Phase 3 折叠进 final plan closure / 跳过 §3.1 gate | `mstar-iteration` §3.0–§3.5 |
151
+ | Phase 4 开 PR 后跳过 merge-ready loop | `mstar-iteration` §5 |
151
152
  | iteration-close 无 frontmatter completed / 漏 compound Phase 6 | `mstar-iteration` §3.0.5、§3.4、§3.2 #5 |
152
153
  | iteration 默认 `main` 作 base 或 PR 目标 | `mstar-iteration` §1.2、§2.3;`mstar-plan-conventions` Spec 分支模型 |
153
154
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mstar-iteration
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。
3
+ description: Morning Star 迭代管理 —— iteration-startAutonomous Execute、iteration-close、PR 交付(Phase 4)、PR merge-ready loop(Phase 5)。显式分支策略;compass `{ITERATION_DIR}/`;分支 SSOT:`status.json` metadata + compass frontmatter。
4
4
  ---
5
5
 
6
6
  # mstar-iteration(迭代管理)
@@ -13,26 +13,36 @@ description: Morning Star 迭代管理 —— iteration-start(显式 `iteratio
13
13
 
14
14
  mstar 实践模式通常是:一次迭代锁定几个 spec 点(`specify + clarify`),产生多个 `plan`,每个 plan 含多个 tasks。**per-plan 生命周期有完整的闭环**(Prepare → Execute → QC → Done)。Compound 不是 per-plan 活动——它是**迭代级收口**,在迭代内所有 plan Done 后,沉淀一轮知识。
15
15
 
16
- 本 skill 管理三个迭代节点:
16
+ 本 skill 管理迭代 **Phase 1–5**(command 层可聚合编排,但 **不得**反向引用 command 名;第三方 helper 仅由 command 按需发现):
17
17
 
18
18
  ```
19
- iteration-start [per-plan lifecycle × N] → iteration-close → PR → merge
20
- │ │
21
- 锁定范围、创建 compass │ compound、更新 roadmap
22
- │ Review & Edit chain → PM lock │ 标记迭代完成
23
- 创建 integration 分支 │ commit 到 integration 分支
24
- │ │
25
- └──────── Phase 2(Autonomous Execute)────────┘
19
+ Phase 1: iteration-start
20
+
21
+ Phase 2: Autonomous Execute —— [per-plan lifecycle × N]
22
+
23
+ Phase 3: iteration-close
24
+
25
+ Phase 4: PR delivery(开 PR)
26
+
27
+ Phase 5: PR merge-ready loop —— 至 mergeable + CI 全绿 + reviews resolved
28
+
29
+ 迭代交付完成
26
30
  ```
27
31
 
28
- **关键定位**:Phase 3 iteration-close 是 **Autonomous Execute 之后的独立 Phase**,在 integration 分支上执行,**完成后再创建 PR**。所有 compound 产物(knowledge docs、compass 更新、CONCEPTS.md)作为迭代交付的一部分随 PR 合入已记录的 `target_branch`。一次迭代 = 一个 PR。
32
+ **关键定位**:
33
+
34
+ - **Phase 3** 在 integration 分支收口 compound / roadmap;**开 PR(Phase 4)≠ 迭代交付完成**。
35
+ - **Phase 5** 是 **merge-ready loop**:修复 → push → 再验证,直至 §5.5 exit。**Loop 理念 SSOT 在本 skill**;宿主 command 可叠加额外 helper,但不写入 `mstar-*` load order。
36
+ - 一次迭代 = 一个 PR;compound 产物随 PR 合入 `metadata.target_branch`。
29
37
 
30
38
  ## Phase transition gates(HARD — 防跳步)
31
39
 
32
40
  | 边界 | 触发 | 必须 | 禁止 |
33
41
  |------|------|------|------|
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 |
42
+ | **→ 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;宣称迭代交付完成;仅依赖 final plan closure |
43
+ | **→ Phase 4** | §3.5 exit checklist 全 `[x]`;frontmatter `status: completed` + `end_date` | 打印 `## Phase 4: PR delivery`;开 PR 到 `metadata.target_branch`(§4) | 跳过 §3.1 entry checklist 或 compound Phase 6 |
44
+ | **→ Phase 5** | Phase 4 PR 已创建 | 打印 `## Phase 5: PR merge-ready`;执行 §5 loop 至 §5.5 exit | 开 PR 后停止;跳过 review resolve / CI loop |
45
+ | **→ 迭代交付完成** | §5.5 exit checklist 全 `[x]` | PR mergeable;required CI 全绿;reviews resolved | Phase 4 开 PR 即宣称完成 |
36
46
  | **iteration-start → integration branch** | §1.6 Review & Edit chain | 三角色 **按序** invoke 完成 + compass `status: locked` | PM 线程代做三角色编辑;并行三角色;review 前 commit |
37
47
 
38
48
  **误判信号**:对话里出现 compound 摘要、roadmap 更新、或「所有 plan 已完成」但 **未** 打印 §3.1 / §3.5 checklist → 视为 **Phase 3 未执行**,回到 §3.0。
@@ -181,7 +191,7 @@ compass frontmatter 的 `iteration_base_branch` / `target_branch` **必须与**
181
191
 
182
192
  | Host | 工具 | 最小集合 |
183
193
  |------|------|---------|
184
- | **Cursor** | `TodoWrite` / CreatePlan todos | 当前 `plan_id`;下一批 gates(implement/QC/QA);分支 checkpoint;**仅剩 1 个非 Done plan 时追加 `phase-3-iteration-close`**(Done 后保持 open 直至 §3.5) |
194
+ | **Cursor** | `TodoWrite` / CreatePlan todos | 当前 `plan_id`;下一批 gates(implement/QC/QA);分支 checkpoint;**仅剩 1 个非 Done plan 时追加 `phase-3-iteration-close`**(open 直至 §3.5);Phase 4 后 **`phase-5-pr-merge-ready`**(open 直至 §5.5) |
185
195
  | **Codex** | `update_plan` / Goal UI | 同上 |
186
196
  | **OpenCode** | host todo/plan UI(如有) | 同上 |
187
197
 
@@ -334,7 +344,7 @@ PM 触发 `mstar-compound`(可批量):
334
344
 
335
345
  **Precondition**: §3.1 checklist `[x]`;§3.4 frontmatter `completed` + `end_date` 已写。
336
346
 
337
- PM 打印 **iteration-close exit checklist**;全部为 `[x]` 后方可 `git commit` / 开 PR:
347
+ PM 打印 **iteration-close exit checklist**;全部为 `[x]` 后方可 `git commit`;然后进入 **Phase 4**(§4):
338
348
 
339
349
  - [ ] §3.1 前置 gate 已打印并满足
340
350
  - [ ] §3.2 compound 完成;新增 knowledge doc 均已登记 `{KNOWLEDGE_DIR}/README.md`(或已记录无可结晶原因)
@@ -359,6 +369,55 @@ PR 目标使用 root `metadata.target_branch`;缺失时停止并补齐,不
359
369
 
360
370
  ---
361
371
 
372
+ ## Phase 4: PR delivery(开 PR)
373
+
374
+ **Precondition**: Phase 3 §3.5 exit 全 `[x]`;close commit 已 push 到 `spec_integration_branch`。
375
+
376
+ 1. 打印 **`## Phase 4: PR delivery`**
377
+ 2. Resolve target:`metadata.target_branch`(compass frontmatter 镜像);缺失 → **STOP**,问用户
378
+ 3. 创建 PR:`spec_integration_branch` → `target_branch`
379
+ 4. 记录 PR URL / number(Phase 5 会话 SSOT)
380
+ 5. **Immediately** 进入 **Phase 5** — **Phase 4 exit ≠ 迭代交付完成**
381
+
382
+ ---
383
+
384
+ ## Phase 5: PR merge-ready loop
385
+
386
+ **Precondition**: Phase 4 PR 已创建且 head = `spec_integration_branch`。
387
+
388
+ **Loop 理念**(mstar SSOT):PR 开完后进入 **验证—修复—再验证** 循环,直至 PR 可合并。与 Phase 2 per-plan loop 类似,但对象是 **PR 级** merge 门禁(CI、review、冲突),不是 plan 实现。
389
+
390
+ ### 5.0 Phase boundary
391
+
392
+ - Phase 5 在 PR head(`spec_integration_branch`)上 push 修复;**禁止**另开替代分支
393
+ - 产品代码修复 → PM **dispatch** dev/ops(`mstar-dispatch-gates`);PM 线程不代写实现
394
+ - 禁止为「让 CI 变绿」而改 workflow,除非用户明确授权
395
+
396
+ ### 5.1 Loop(repeat until §5.5 exit)
397
+
398
+ 1. **Status** — PR mergeable?required CI?unresolved review threads?
399
+ 2. **Merge conflicts** — blocking 则在 integration 分支解决 → push(意图冲突 → **Blocked**)
400
+ 3. **Reviews** — fetch unresolved threads;triage;dispatch 修复 → push
401
+ 4. **CI** — 失败项在 PR 范围内修复 → push
402
+ 5. **Review fix hygiene**(每次因 review 而 push 后):
403
+ - 在同 thread **comment**(改动 + 验证)
404
+ - **Resolve** when addressed
405
+ 6. Return to step 1
406
+
407
+ ### 5.2 Phase 5 exit checklist(迭代交付完成)
408
+
409
+ 打印 **`## Phase 5 exit checklist`**;全 `[x]` 后方可宣称 **迭代交付完成**:
410
+
411
+ - [ ] PR mergeable(无 blocking merge conflicts)
412
+ - [ ] All **required** CI checks green on latest head
413
+ - [ ] All review threads **resolved**(或用户书面 waive 特定 thread)
414
+ - [ ] §5.1 review comment + resolve 已覆盖本轮所有 addressed feedback
415
+ - [ ] Host todo `phase-5-pr-merge-ready` 可勾选
416
+
417
+ PR **merge** 本身可仍由用户手动执行,除非 Assignment 明确授权 auto-merge。
418
+
419
+ ---
420
+
362
421
  ## 迭代 compass 模板
363
422
 
364
423
  完整模板见 `references/iteration-compass-template.md`。
@@ -388,3 +447,5 @@ PR 目标使用 root `metadata.target_branch`;缺失时停止并补齐,不
388
447
  - 不要用 prose completion status 替代 compass frontmatter `status: completed` + `end_date`
389
448
  - 不要跳过 compound Phase 6(`{KNOWLEDGE_DIR}/README.md` 索引)——即使只结晶一篇文档
390
449
  - 不要跳过 compound——如果本迭代确实没有可结晶的知识,在 compass `## Compound Round Summary` 写 `无可结晶知识(原因:<简述>)`
450
+ - 不要将 **Phase 4 开 PR** 等同于 **迭代交付完成** — 必须完成 **Phase 5** §5.5 merge-ready loop
451
+ - 不要在 Phase 5 跳过 review comment + resolve 纪律(§5.1 step 5)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/opencode",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
4
4
  "description": "Morning Star harness OpenCode plugin (skills bootstrap and agent loading).",
5
5
  "license": "MIT",
6
6
  "repository": {