@mstar-harness/opencode 1.8.0 → 1.8.1
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.
- package/CHANGELOG.md +16 -0
- package/harness-commands/codebase-audit.md +5 -68
- package/harness-commands/iteration-drive.md +17 -159
- package/harness-commands/iteration-loop.md +16 -194
- package/harness-commands/iteration-start.md +17 -185
- package/harness-skills/mstar-branch-worktree/SKILL.md +38 -27
- package/harness-skills/mstar-coding-behavior/SKILL.md +40 -114
- package/harness-skills/mstar-compound/SKILL.md +25 -197
- package/harness-skills/mstar-compound/references/compound-workflow.md +155 -0
- package/harness-skills/mstar-dispatch-gates/SKILL.md +3 -8
- package/harness-skills/mstar-host/references/_shared/host-role-binding-core.md +44 -0
- package/harness-skills/mstar-host/references/_shared/plan-mode-bridge-core.md +91 -0
- package/harness-skills/mstar-host/references/codex-plan-goal-mode-bridge.md +6 -11
- package/harness-skills/mstar-host/references/codex.md +1 -1
- package/harness-skills/mstar-host/references/cursor-plan-mode-bridge.md +9 -78
- package/harness-skills/mstar-host/references/cursor.md +3 -3
- package/harness-skills/mstar-host/references/kimi-plan-mode-bridge.md +5 -24
- package/harness-skills/mstar-host/references/kimi.md +5 -32
- package/harness-skills/mstar-host/references/omp-plan-mode-bridge.md +3 -13
- package/harness-skills/mstar-host/references/omp.md +5 -32
- package/harness-skills/mstar-host/references/opencode.md +1 -3
- package/harness-skills/mstar-host/references/zcode-plan-mode-bridge.md +5 -24
- package/harness-skills/mstar-host/references/zcode.md +5 -32
- package/harness-skills/mstar-iteration/SKILL.md +21 -211
- package/harness-skills/mstar-iteration/references/phase-3-iteration-close.md +95 -0
- package/harness-skills/mstar-iteration/references/phase-4-5-pr-delivery.md +81 -0
- package/harness-skills/mstar-iteration/references/phase5-helper-discovery.md +24 -0
- package/harness-skills/mstar-phase-gates/SKILL.md +1 -1
- package/harness-skills/mstar-roles/references/_shared/leaf-executor-core.md +46 -0
- package/harness-skills/mstar-roles/references/architect.md +3 -23
- package/harness-skills/mstar-roles/references/frontend-dev.md +4 -24
- package/harness-skills/mstar-roles/references/fullstack-dev-shared.md +4 -24
- package/harness-skills/mstar-roles/references/ops-engineer.md +3 -23
- package/harness-skills/mstar-roles/references/product-manager.md +3 -23
- package/harness-skills/mstar-roles/references/project-manager/dispatch-and-assignment.md +5 -5
- package/harness-skills/mstar-roles/references/project-manager.md +4 -13
- package/harness-skills/mstar-roles/references/prompt-engineer.md +4 -23
- package/harness-skills/mstar-roles/references/qa-engineer.md +3 -22
- package/harness-skills/mstar-roles/references/qc-specialist/deep-review-lenses.md +16 -75
- package/harness-skills/mstar-roles/references/qc-specialist/reviewer-workflow.md +1 -1
- package/harness-skills/mstar-roles/references/qc-specialist-shared.md +4 -17
- package/harness-skills/mstar-roles/references/writing-specialist.md +4 -24
- package/package.json +1 -1
|
@@ -22,13 +22,13 @@ Start a new Morning Star harness iteration. **Not Done until the Review & Edit c
|
|
|
22
22
|
|
|
23
23
|
**完成定义**:compass `status: locked` + 三角色 invoke 已返回 + pre-commit checklist 全 `[x]` — 不是初稿落盘。
|
|
24
24
|
|
|
25
|
-
Detailed workflow → **`mstar-iteration` § Phase 1
|
|
25
|
+
Detailed workflow → **`mstar-iteration` § Phase 1**;per-plan Prepare gates → **`mstar-phase-gates`**(specify → clarify → plan)。
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
## Path split(HARD — 路由)
|
|
28
28
|
|
|
29
29
|
| 宿主上下文 | 走哪条 |
|
|
30
30
|
|------------|--------|
|
|
31
|
-
| **Cursor Plan mode**(CreatePlan / Plan 会话活跃) | §0 Boot →
|
|
31
|
+
| **Cursor Plan mode**(CreatePlan / Plan 会话活跃) | §0 Boot → **§P** — **先**空白 CreatePlan,再 **feedback-driven** 自主改同一份 plan;grill-me **仅**在用户明确结束反馈后、仍有阻塞疑问时;**Build 前不执行** Review 链 / commit / integration 分支 |
|
|
32
32
|
| **其它**(Agent、OpenCode、非 Plan) | §0 Boot → §1–§6(Research → Explore → grill-me → Write → Review → branch) |
|
|
33
33
|
|
|
34
34
|
## 0. Boot
|
|
@@ -45,148 +45,24 @@ Detailed workflow → **`mstar-iteration` § Phase 1**(含 §1.6 Review & Edit
|
|
|
45
45
|
|
|
46
46
|
## P. Cursor Plan mode(Phase 1 scaffold → feedback loop → deferred grill → Build)
|
|
47
47
|
|
|
48
|
-
**
|
|
48
|
+
Execute **`mstar-host/references/cursor-plan-mode-bridge.md`** § **"mstar-iteration Phase 1 in Plan mode"**(Detect / 语义 / Single CreatePlan URI(HARD)/ Research → Early CreatePlan → Feedback loop → Feedback-close deferred grill → Pre-Build / Build 全流程 SSOT)。
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
Command-unique 补充(bridge 未枚举):
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
- **空白脚手架字段**:Direction / Scope / Acceptance Criteria / Non-Goals / Delivery Branch Policy(`iteration_base_branch` / `spec_integration_branch` / `target_branch`)/ Plans / Feedback log / Deferred grill log
|
|
53
|
+
- **Build 才勾的 todos**(顺序):`harness-init` → `finalize-compass-plans`(**同一份** CreatePlan 落成 compass + plans + `status.json` 登记 + 索引)→ review-edit-product-manager → review-edit-architect → review-edit-writing-specialist → `pm-lock` → `integration-branch`
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
|------|------|
|
|
56
|
-
| **CreatePlan 只调用一次** | §P.2 空白脚手架是本会话 **唯一** 一次 CreatePlan |
|
|
57
|
-
| **记录路径** | 记下工具返回的 plan 文件路径(常在 `~/.cursor/plans/*.plan.md`);后续所有修订都写 **这一份** |
|
|
58
|
-
| **更新方式** | Feedback / deferred grill 后用 **Read + Write/StrReplace 原地改** 该文件;**禁止**再调 CreatePlan 开第二份 |
|
|
59
|
-
| **发现重复** | 若已误开第二份:把有效内容 **合并进第一份**,删除重复文件,并确保用户 View Plan 指向第一份 |
|
|
60
|
-
|
|
61
|
-
### P.1 Research(只读)
|
|
62
|
-
|
|
63
|
-
执行与 §1 相同的调研(structured + unstructured + `STRATEGY.md`)。**不要**在本步写 compass/plans 终稿。
|
|
64
|
-
|
|
65
|
-
### P.2 Early CreatePlan(空白脚手架 — 本会话唯一一次)
|
|
66
|
-
|
|
67
|
-
Research 后 **立刻** CreatePlan **一次**(**禁止**等方向锁定完成再 CreatePlan;**禁止**之后再 CreatePlan)。
|
|
68
|
-
|
|
69
|
-
**CreatePlan 最小结构**(session mirror;dual-write 草稿见 P.3):
|
|
70
|
-
|
|
71
|
-
```markdown
|
|
72
|
-
# Phase 1: <iteration-id-or-TBD>
|
|
73
|
-
|
|
74
|
-
## Direction
|
|
75
|
-
TBD
|
|
76
|
-
|
|
77
|
-
## Scope
|
|
78
|
-
TBD
|
|
79
|
-
|
|
80
|
-
## Acceptance Criteria
|
|
81
|
-
TBD
|
|
82
|
-
|
|
83
|
-
## Non-Goals
|
|
84
|
-
TBD
|
|
85
|
-
|
|
86
|
-
## Delivery Branch Policy
|
|
87
|
-
| Field | Value |
|
|
88
|
-
|-------|-------|
|
|
89
|
-
| iteration_base_branch | TBD |
|
|
90
|
-
| spec_integration_branch | TBD |
|
|
91
|
-
| target_branch | TBD |
|
|
92
|
-
|
|
93
|
-
## Plans
|
|
94
|
-
| plan_id | Name | Status | Notes |
|
|
95
|
-
|---------|------|--------|-------|
|
|
96
|
-
| TBD | | Todo | |
|
|
97
|
-
|
|
98
|
-
## Feedback log
|
|
99
|
-
(吸收用户反馈 / agent 推荐决议后追加)
|
|
100
|
-
|
|
101
|
-
## Deferred grill log
|
|
102
|
-
(仅 P.3.5 若发起 grill 时追加;可空)
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
**Build 才勾的 todos**(顺序;**不要**把 feedback / grill 写成 Build todo):
|
|
106
|
-
|
|
107
|
-
1. `harness-init` — 若 `{HARNESS_DIR}` / `status.json` 缺失则初始化
|
|
108
|
-
2. `finalize-compass-plans` — 将 **同一份** CreatePlan 正文落成 compass + `{PLAN_DIR}/` plans + `status.json` 登记 + `{ITERATION_DIR}` 索引
|
|
109
|
-
3. `review-edit-product-manager` — §5.1 invoke
|
|
110
|
-
4. `review-edit-architect` — §5.2 invoke
|
|
111
|
-
5. `review-edit-writing-specialist` — §5.3 invoke
|
|
112
|
-
6. `pm-lock` — §5.4 compass `status: locked` + Prepare gates
|
|
113
|
-
7. `integration-branch` — §6
|
|
114
|
-
|
|
115
|
-
### P.3 Feedback loop(主路径 — 直到用户明确结束反馈)
|
|
116
|
-
|
|
117
|
-
**用户模式**:提方向、提意见、纠正推荐 — **纯反馈**。**不要**把用户当成问卷答题人;**禁止**例行一问一答卡更新。
|
|
118
|
-
|
|
119
|
-
**Agent 每轮**(可多轮,直到用户喊停):
|
|
120
|
-
|
|
121
|
-
1. 探索代码 / harness / roadmap(能靠读回答的先读)
|
|
122
|
-
2. 形成推荐(Direction / Scope / Acceptance / Non-Goals / Branch policy / Plans)
|
|
123
|
-
3. **立刻**原地更新 **§P.2 那一份** CreatePlan(含 `## Feedback log`)+ 推荐 dual-write SSOT 草稿
|
|
124
|
-
4. 吸收用户新反馈 → 再探索/再改 **同一份** plan
|
|
125
|
-
|
|
126
|
-
**Branch policy**:在 plan 中写入 **推荐值 + 简短 rationale**(不得静默默认 `main`/`master`);用户可用反馈改掉。**不要**在本阶段为 branch 开 grill。
|
|
127
|
-
|
|
128
|
-
**禁止**:
|
|
129
|
-
|
|
130
|
-
- 再调 CreatePlan / 写到另一份 plan 文件
|
|
131
|
-
- 把「等用户回答问题」当作更新 plan 的门禁
|
|
132
|
-
- 在用户结束反馈前加载 / 运行 `grill-me`
|
|
133
|
-
- 固定死反馈轮数;Plan 模式内派发 §5 / commit / §6
|
|
134
|
-
|
|
135
|
-
### P.3.5 Feedback-close → deferred grill(可选)
|
|
136
|
-
|
|
137
|
-
**触发**:用户明确表示反馈结束(例如:反馈结束、总结、分析反馈、可以了、准备 Build)。
|
|
138
|
-
|
|
139
|
-
然后 Agent 自检 CreatePlan:Direction / Scope / Acceptance / Non-Goals / Branch policy / Plans 是否仍有 **阻塞缺口**。
|
|
140
|
-
|
|
141
|
-
| 结果 | 动作 |
|
|
142
|
-
|------|------|
|
|
143
|
-
| **无阻塞缺口** | **不**开 grill-me;宣布可 Build;确认同一份 CreatePlan + 草稿 SSOT 已反映锁定内容 |
|
|
144
|
-
| **仍有阻塞缺口** | Read `skills/grill-me/SKILL.md`(**仅本命令**);对 **剩余缺口** 做最小 grill(一段一问);每段收敛后仍 **原地改同一份** CreatePlan,并追加 `## Deferred grill log` |
|
|
145
|
-
|
|
146
|
-
**Direction lock mode** 仍为 interactive 语义,但 Plan 会话的 **主路径是 feedback-driven**;grill 是 close 后门禁,不是主循环。
|
|
147
|
-
|
|
148
|
-
### P.4 Build(执行 Phase 1 可执行门禁)
|
|
149
|
-
|
|
150
|
-
用户点击 **Build**(或 Plan → Agent)后:
|
|
151
|
-
|
|
152
|
-
1. 按 Build todos 顺序执行:`harness-init` → `finalize-compass-plans`(以 **View Plan 打开的那一份** CreatePlan 为准)→ §5 Review 链(5.1→5.2→5.3)→ `pm-lock` → §6
|
|
153
|
-
2. **禁止**把 Build 当成重新跑 feedback / grill
|
|
154
|
-
3. pre-commit checklist(见 §5)全 `[x]` 后再 commit / push integration 分支
|
|
155
|
-
|
|
156
|
-
**非 Plan 路径从这里继续 ↓**
|
|
55
|
+
## 非 Plan 路径从这里继续 ↓
|
|
157
56
|
|
|
158
57
|
## 1. Research
|
|
159
58
|
|
|
160
|
-
|
|
59
|
+
Survey structured harness dirs(`{HARNESS_DIR}/status.json`、`{ITERATION_DIR}/`、`{KNOWLEDGE_DIR}/`、`{SPECS_DIR}/`)+ glob for planning artifacts(`**/roadmap*.md`、`**/deferred*.md`、`**/features*.md`、`**/backlog*.md`、`**/TODO*.md`、`**/*.plan.md`);read matches with iteration-level / deferred-scope information;read `STRATEGY.md`(if exists)。Prioritize deferred / incomplete items from prior iterations。
|
|
161
60
|
|
|
162
|
-
**
|
|
163
|
-
- `{HARNESS_DIR}/status.json` → active plans, deferred features, residuals
|
|
164
|
-
- `{ITERATION_DIR}/` → previous iteration compasses, roadmap batches
|
|
165
|
-
- `{KNOWLEDGE_DIR}/` → design knowledge, architecture notes
|
|
166
|
-
- `{SPECS_DIR}/` → existing specs, gaps
|
|
167
|
-
|
|
168
|
-
**Unstructured discovery — search the repo for planning artifacts by name:**
|
|
169
|
-
- Glob for `**/roadmap*.md`, `**/ROADMAP*.md`, `**/*-roadmap.md`
|
|
170
|
-
- Glob for `**/deferred*.md`, `**/DEFERRED*.md`
|
|
171
|
-
- Glob for `**/features*.md`, `**/FEATURES*.md`
|
|
172
|
-
- Also search for `**/backlog*.md`, `**/TODO*.md`, `**/todo*.md`, `**/*.plan.md`
|
|
173
|
-
- Open and read any matches that carry iteration-level or deferred-scope information
|
|
174
|
-
|
|
175
|
-
Identify deferred or incomplete items from prior iterations as priority candidates for this iteration.
|
|
176
|
-
|
|
177
|
-
Also read `STRATEGY.md`(if exists)for strategic alignment.
|
|
178
|
-
|
|
179
|
-
**Optional — codebase audit**: if a prior `/codebase-audit` run exists under `{PLAN_DIR}/audit-<date>/`, read its findings index. Audit plans are evidence-grounded direction candidates — high-leverage fixes, security issues, tech debt, or feature directions the codebase itself signals. Use them as input to §2 Explore Directions alongside deferred items and roadmap context. Do **not** treat the audit as mandatory; it is one source among many.
|
|
61
|
+
**Optional — codebase audit**: if a prior `/codebase-audit` run exists under `{PLAN_DIR}/audit-<date>/`, read its findings index as evidence-grounded direction candidates for §2(not mandatory;one source among many)。
|
|
180
62
|
|
|
181
63
|
## 2. Explore Directions
|
|
182
64
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
Explore candidate directions targeting **product completeness**:
|
|
186
|
-
|
|
187
|
-
- Default to completing deferred items from previous iterations
|
|
188
|
-
- Allow substantive refactoring where it accelerates product maturity
|
|
189
|
-
- Scope 2–4 candidates, each with clear product-completeness goals and trade-offs
|
|
65
|
+
Scope **2–4** candidates targeting **product completeness**(default to deferred items from previous iterations;allow substantive refactoring where it accelerates product maturity)。**非 Plan 路径**(Plan mode 已由 §P 处理)。
|
|
190
66
|
|
|
191
67
|
## 3. Lock Direction — bundled `grill-me`
|
|
192
68
|
|
|
@@ -196,73 +72,29 @@ Explore candidate directions targeting **product completeness**:
|
|
|
196
72
|
|
|
197
73
|
This command bundles a **non-`mstar-*`** skill at `skills/grill-me/SKILL.md`. **Only this command step**(及 §P.3.5 deferred grill)references it — **do not** load it from `mstar-harness-core` or other `mstar-*` skills.
|
|
198
74
|
|
|
199
|
-
**Before this step:** Read `skills/grill-me/SKILL.md`.
|
|
200
|
-
|
|
201
|
-
Run **grill-me** to stress-test candidate directions with the user:
|
|
202
|
-
|
|
203
|
-
- Walk through trade-offs for each candidate
|
|
204
|
-
- Converge on a **single iteration direction** with shared understanding
|
|
205
|
-
- Document: locked direction, success criteria, non-goals
|
|
206
|
-
- Confirm delivery branch policy:
|
|
207
|
-
- `iteration_base_branch`: branch/ref used to create `spec_integration_branch`
|
|
208
|
-
- `target_branch`: PR target after iteration-close
|
|
209
|
-
- If either is not explicit, inspect the current branch and ask. **Do not default to `main` / `master` just because those names exist.**
|
|
75
|
+
**Before this step:** Read `skills/grill-me/SKILL.md`. Run **grill-me** to stress-test candidate directions with the user: walk through trade-offs, converge on a **single iteration direction** with shared understanding, document locked direction + success criteria + non-goals。Confirm delivery branch policy(`iteration_base_branch`、`target_branch`)per **`mstar-iteration` §1.2** — **Do not default to `main` / `master` just because those names exist.**
|
|
210
76
|
|
|
211
77
|
## 4. Write Compass & Plans
|
|
212
78
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
Produce harness artifacts per **`mstar-iteration` § 1.3**(template: `mstar-iteration/references/iteration-compass-template.md`):
|
|
216
|
-
|
|
217
|
-
- `{ITERATION_DIR}/<iteration-id>/delivery-compass.md` — YAML frontmatter **must** include `iteration_base_branch`, `target_branch`, `status: active`
|
|
218
|
-
- `{PLAN_DIR}/<plan-id>-<name>.md` for each plan in this iteration
|
|
219
|
-
- Register all plans in `{HARNESS_DIR}/status.json`(per `mstar-plan-artifacts` §1.5:root `metadata` + plan `spec_integration_branch`)
|
|
220
|
-
- Update `{ITERATION_DIR}/README.md` index(**一行 = 一次迭代**;per `mstar-iteration` § 1.4)
|
|
221
|
-
- Create package dirs as needed: `{ITERATION_DIR}/<iteration-id>/{guides,specs}/` + optional package `README.md`
|
|
79
|
+
Produce harness artifacts per **`mstar-iteration` §1.3–§1.5**(template: `mstar-iteration/references/iteration-compass-template.md`):compass(frontmatter **must** include `iteration_base_branch`、`target_branch`、`status: active`)、plans、`status.json` 登记(`mstar-iteration` §1.5)、`{ITERATION_DIR}/README.md` 索引(一行 = 一次迭代)、package dirs(`{ITERATION_DIR}/<iteration-id>/{guides,specs}/`)。**非 Plan 路径**。
|
|
222
80
|
|
|
223
81
|
## 5. Review & Edit Chain(HARD GATE — do not commit before this)
|
|
224
82
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
**顺序(HARD)**:`product-manager` → `architect` → `writing-specialist` → PM lock。后一角色基于前一角色已落盘的修订继续编辑;**禁止**三角色并行 invoke。OpenCode:正文用 plain role id — **`mstar-host/references/opencode.md`** § Role-mention hygiene。
|
|
228
|
-
|
|
229
|
-
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.
|
|
230
|
-
|
|
231
|
-
| # | Role | Required action | Gate |
|
|
232
|
-
|---|------|-----------------|------|
|
|
233
|
-
| 5.1 | **product-manager** | invoke: **edit** compass, plans, **`{SPECS_DIR}/`**, **`{ITERATION_DIR}/<iteration-id>/`**(`guides/`、`specs/` 按需)— **禁止** `{KNOWLEDGE_DIR}/` 新增 | 完成后方可 5.2 |
|
|
234
|
-
| 5.2 | **architect** | invoke: **edit** compass, plans, **`{SPECS_DIR}/`**, package `specs/`(含 5.1 后版本)— **禁止** `{KNOWLEDGE_DIR}/` 新增 | 5.1 返回后;完成后方可 5.3 |
|
|
235
|
-
| 5.3 | **writing-specialist** | invoke: **edit** compass / plans / specs / iteration 文档; **specs corpus hygiene**(全库 `{SPECS_DIR}/` + 既有 `{KNOWLEDGE_DIR}/` 卫生与错放纠正,**不**新增 knowledge)— `mstar-iteration/references/iteration-artifact-boundaries.md` + `iteration-corpus-hygiene.md` | 5.2 返回后 |
|
|
236
|
-
| 5.4 | **project-manager** | Merge subagent edits; resolve conflicts; **lock** compass (`status: locked`); confirm Prepare gates | 5.3 返回后 |
|
|
237
|
-
|
|
238
|
-
**Evidence of done** = edited compass / plans / **specs** / iteration docs on disk + specs corpus hygiene(及既有 knowledge 归档/错放纠正,如有)+ compass `status: locked`. **No** new `{KNOWLEDGE_DIR}/` from this chain — knowledge → **`mstar-compound`** @ iteration-close. **No** separate iteration review reports under `reports/`.
|
|
239
|
-
|
|
240
|
-
**Tool rule (hosts with invoke)** — per **`mstar-dispatch-gates`** · specialist review-and-edit dispatch(**顺序链**,非 parallel batch):
|
|
241
|
-
|
|
242
|
-
1. 为当前角色写好 Assignment(含须直接编辑的文件路径;5.2/5.3 注明基于上一角色已落盘修订)。
|
|
243
|
-
2. **派发 1 次 invoke** → 等待 Completion Report / 磁盘修订完成。
|
|
244
|
-
3. 按序重复下一角色:**5.1 → 5.2 → 5.3**(每步一条派发消息、一次 invoke)。
|
|
245
|
-
4. 本条链 **禁止** PM 线程代做专业编辑;**禁止** 同条消息并行三角色;**禁止** 未等 5.1 返回就发 5.2/5.3。
|
|
246
|
-
5. 5.3 返回后,PM 线程再做 5.4 merge + lock。
|
|
247
|
-
|
|
248
|
-
- Exception: user explicitly waives subagent dispatch ("PM-only review").
|
|
83
|
+
Execute **`mstar-iteration` §1.6**(SSOT):顺序 `product-manager` → `architect` → `writing-specialist` → PM lock(**禁止**并行三角色;OpenCode plain role id — `mstar-host/references/opencode.md` § Role-mention hygiene);**禁止** `{KNOWLEDGE_DIR}/` 新增;writing-specialist specs corpus hygiene(`iteration-artifact-boundaries.md` + `iteration-corpus-hygiene.md`)。Tool rule → **`mstar-dispatch-gates`** specialist review-and-edit(每角色 1 invoke,等磁盘修订返回)。Exception: user explicitly waives subagent dispatch ("PM-only review").
|
|
249
84
|
|
|
250
85
|
**Prepare gate (per plan in compass)**:
|
|
86
|
+
|
|
251
87
|
- [ ] specify / clarify / plan = done on each plan file
|
|
252
88
|
- [ ] `primary_spec` path exists (if declared)
|
|
253
89
|
- [ ] `blocked_by` / sequential deps documented
|
|
254
90
|
|
|
255
|
-
Only after 5.4 → proceed to §6.
|
|
256
|
-
|
|
257
91
|
### iteration-start pre-commit checklist
|
|
258
92
|
|
|
259
93
|
PM must print this block before §6; all `[ ]` must be `[x]`:
|
|
260
94
|
|
|
261
95
|
- [ ] direction lock decisions recorded in compass(Plan 路径:Feedback log + 可选 Deferred grill log;非 Plan:grill-me)
|
|
262
96
|
- [ ] Draft compass + plans + `status.json` registered
|
|
263
|
-
- [ ] product-manager
|
|
264
|
-
- [ ] architect invoke completed — compass / **specs** edited;**未**向 `{KNOWLEDGE_DIR}/` 新增
|
|
265
|
-
- [ ] writing-specialist invoke completed — specs + iteration docs edited;**specs corpus hygiene** done(全库 `{SPECS_DIR}/`;既有 knowledge 仅卫生/归档;错放已迁回 `iterations/` 或 archive)
|
|
97
|
+
- [ ] product-manager / architect / writing-specialist invokes completed — 编辑 compass / plans / specs / **`<iteration-id>/` package**;**未**向 `{KNOWLEDGE_DIR}/` 新增;writing-specialist specs corpus hygiene done
|
|
266
98
|
- [ ] PM final lock: compass `status: locked`; Prepare gates pass (blocked plans documented)
|
|
267
99
|
- [ ] Branch policy locked: `iteration_base_branch`, `spec_integration_branch`, and `target_branch` recorded in compass / `status.json`
|
|
268
100
|
- [ ] **THEN**: git commit + push `iteration/<iteration-id>`
|
|
@@ -282,6 +114,6 @@ git checkout -b <spec_integration_branch> <iteration_base_branch>
|
|
|
282
114
|
- Register `iteration_base_branch`, `spec_integration_branch`, and `target_branch` in compass frontmatter **and** `{HARNESS_DIR}/status.json` root `metadata`
|
|
283
115
|
- Commit all documents to the integration branch and push to remote
|
|
284
116
|
|
|
285
|
-
**Phase 2 note**:
|
|
117
|
+
**Phase 2 note**:control worktree + `execution_lease` 门控在 Phase 2 入口(`iteration-drive` / `iteration-loop`)——见 **`mstar-iteration/references/phase-2-worktree-lease.md`**。
|
|
286
118
|
|
|
287
119
|
**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`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mstar-branch-worktree
|
|
3
|
-
description: "Morning Star
|
|
3
|
+
description: "Morning Star 业务仓 Git 功能分支、worktree 隔离(L1 跨 plan:control worktree + 每 plan feature worktree + `execution_lease`,默认 gitignore 下经 control 绝对路径读写进程产物;L2 同 plan:`references/parallel-writable-pre-dispatch.md`,N 次 invoke ≠ 隔离)、Spec 集成分支、QC/QA 检出对齐(`Review cwd` / `Working branch` / `plan_id` / `Review range` / `Diff basis` 三审 + QA 逐字相同)。Read when PM writes `Working branch` / `Branch policy`, iteration/parallel writable dispatch, or QC/QA checkout alignment is needed."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Load order(必读顺序)
|
|
@@ -174,31 +174,42 @@ Default process artifacts (`plans/`, `iterations/`, `status.json`, `sdd/`, `note
|
|
|
174
174
|
|
|
175
175
|
**QC / QA 与 feature**:开发常在 **feature 分支的 worktree** 中完成;进入 **QC 三审**与随后的 **QA 验证**时,PM 须在 Assignment 中写明 **`Review cwd` / `Worktree path`**、**`Working branch`**、**`plan_id`**(无 plan 流程时 `N/A` + 不可歧义 **Feature / scope label**)与 **`Review range` / `Diff basis`**;**三份 QC Assignment 与 QA Assignment 中 `plan_id` 与 `Review range` / `Diff basis` 须逐字相同**,保证三票审 **同一 plan/feature 与同一 diff 范围**。
|
|
176
176
|
|
|
177
|
-
##
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
177
|
+
## QC / QA 检出对齐与多 worktree 门禁衔接(强制;避免误派)
|
|
178
|
+
|
|
179
|
+
### 对齐字段契约(canonical)
|
|
180
|
+
|
|
181
|
+
分派 **QC 三审** 与对齐的 **QA 验证** 时,PM **必须**在 Assignment 写明与待审实现一致的 **`Review cwd` / `Worktree path`**、**`Working branch`**、**`plan_id`**、**`Review range` / `Diff basis`**。开发在 **feature 分支**(往往在独立 worktree 中)完成后,QC/QA 针对的都是这份 feature,不是 `main` 或任意未对齐默认 cwd。
|
|
182
|
+
|
|
183
|
+
- **`Review cwd` / `Worktree path`**:**优先**沿用开发 Completion Report 回报的业务仓实现检出路径(该 feature 的 worktree)**当且仅当**该路径检出分支 `HEAD` 已含本轮待审全部提交(含曾发生在其他并行 worktree、现已归并到该分支的变更)。否则**必须**改用集成完成后的 `Working branch` 与对应检出路径(或在该分支上**另开**只读审查 worktree)。开发未用 worktree → 写明单一业务仓根路径。
|
|
184
|
+
- **`Working branch`**:含全部待审提交的那条分支(常见 plan 集成分支)。
|
|
185
|
+
- **`plan_id`**:与 `{SDD_DIR}` `<plan-id>` 段、主 Plan Path、`status.json.plans[].id` 一致;无 `{PLAN_DIR}` 流程时写 **`plan_id: N/A`** + 一行 **`Feature / scope label`**(不可歧义,足以与并行其它 feature 区分)。
|
|
186
|
+
- **`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`,以团队可复现为准)。
|
|
187
|
+
- **逐字对齐(强制)**:三份 QC Assignment 与 QA Assignment 间 **`plan_id`** 与 **`Review range` / `Diff basis`**(连同 `Review cwd` / `Working branch`)**必须完全相同**;**`qa-engineer`** 验证同一 feature 时**复用同一组字段**。**热修 / QC 单审**路径也须含**同一组字段**,仅承接方份数为 1。
|
|
188
|
+
- 三审并行时三名 reviewer **共用同一组**字段(对业务仓**只读 diff 审查**);一般不必为每位 reviewer 各开 worktree,除非宿主/环境要求进程级隔离。
|
|
189
|
+
|
|
190
|
+
### 多 worktree 并行 → 单一待审快照(派 QC 前置)
|
|
191
|
+
|
|
192
|
+
**语义区分(必须理解)**:开发阶段可存在 **多个** `Worktree path`(每条流一条检出目录);**一轮**正式 QC 三审 + 对齐 QA 只对应 **一套**对齐字段(上文)。**不要**把「多个开发 worktree」误解成「QC 应轮流进多个目录各审一半」。
|
|
193
|
+
|
|
194
|
+
**单一待审 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 错误**)。
|
|
195
|
+
|
|
196
|
+
**推荐默认编排(plan 集成分支先行)**——同仓、同一 plan、**≥2 条可写并行轨**时降低 QC/QA 误用单一开发目录风险。**不是唯一合法 Git 拓扑**;其它拓扑仍须满足上文对齐字段 + 本节**强制**条款(派发前 worktree 隔离 + 派 QC 前**单一**待审 `HEAD` + 一套对齐字段):
|
|
197
|
+
|
|
198
|
+
1. **先起集成分支(再挂 worktree)**:派发各轨**实现** Assignment 前,PM 与用户确认 **`Branch policy`**,建立 **plan 集成分支**(Assignment 用 **`Working branch: create <plan-integration-branch> from <base>`** 或等价明确写法;`<base>` 必须 PM 明确记录,例如 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 驱动的分支模型」)。
|
|
199
|
+
2. **再挂各轨 worktree**:每条并行轨分配**独立** `git worktree` + **`Worktree path`**;各轨 `Working branch` 一般为**从集成分支出**的 topic 分支(`create <topic-i> from <plan-integration-branch>`)或 PM 书面约定等价结构(例如从同一 `<base>` 出 topic、但**书面指定**合并时**以集成分支为靶**)。**禁止**承接方擅自把未授权功能提交直接堆在 `main`/`master`。
|
|
200
|
+
3. **进 QC 之前**:将全部**须同一轮三审覆盖**的提交**归并**(merge / rebase / cherry-pick,以 PM 指定团队方式)到同一条将作 QC **`Working branch`** 的分支 **`HEAD`**(**通常即 plan 集成分支**;PM 已重命名/快进为最终 `feature/*` 则以 Assignment 为准)。**在此**解决冲突;**勿**在 QC Assignment 仍指向「只含部分轨」旧 `HEAD` 时派三审。
|
|
201
|
+
4. **QC/QA 的 `Working branch` 与合并主线**:`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 式例外)。
|
|
202
|
+
5. **本推荐不适用时**:单轨、多仓库、或 plan 已**拆 scope / 多轮增量三审**(见 `mstar-plan-conventions`)— 仍须**逐轮**满足**强制**条款:每轮 QC 对应**一条**快照、**一套**逐字相同的 `plan_id` + `Review range` / `Diff basis`。
|
|
203
|
+
|
|
204
|
+
**不应合并为一次审时**:若两轨**有意**保持独立可合并单元(例如两条独立 PR),**不得**共用**同一套** `plan_id` + `Review range` / `Diff basis` 假装「一轮三审覆盖全部」。应**拆分 scope**:分轮次审查、不同 **`Feature / scope label`**、不同 `plan_id`、或按 `mstar-plan-conventions` 写明的**显式增量三审**例外,使每轮 QC 各对应**一条**分支快照与**一套**对齐字段。
|
|
205
|
+
|
|
206
|
+
**同分支多目录例外**:若所有并行轨**始终**在同一条已授权 **`Working branch`** 上协作(每流仅目录不同、提交已互相 `pull`/推送收敛),则任一该分支检出目录在**更新到含全部提交 `HEAD`** 后均可作 `Review cwd`;**不得**使用仍停留在旧提交的 worktree 路径。
|
|
207
|
+
|
|
208
|
+
### QC / QA 执行约束
|
|
209
|
+
|
|
210
|
+
- **并行 QC 禁止**在共享检出跑 **test / build / install / lint / typecheck** 等争用缓存或锁的命令(否则 peer QC 易 `Blocked`)。L3 默认手段:`git diff` / `git log` / `git show` / Read / Grep。运行时验证留给 **L1 证据**与 **`qa-engineer`(L4)** — 见 `mstar-review-qc/references/review-responsibility-boundaries.md`。
|
|
211
|
+
- QC **报告落盘**默认仅限 Assignment 指定的 `{SDD_DIR}/review/`;上述约定保证 `git diff`、`git log` 与所读文件与**待合并 feature** 一致。PM 另行提交主 plan gate summary / `status.json` residual changes as durable artifacts。
|
|
212
|
+
- **`qa-engineer`**(仅 **`QA gate: mandatory`**)Assignment 用 QC 逐字相同的对齐字段(QC 已写清则 QA 照抄);执行业务仓命令前须核对检出与分支;Report-only 且无路径依赖时回报须说明验证环境,否则 `Blocked`。
|
|
213
|
+
- 若 **QA 与同仓其他可写角色并发**提交测试代码,仍须遵守上文「同仓并发写入」**worktree** 规则(可为 QA 单开一条写入 worktree,**同一 `Working branch`**,由 PM 在 Assignment 写明)。
|
|
203
214
|
|
|
204
215
|
派发前清单与常见反模式 → **`references/parallel-writable-pre-dispatch.md`**。
|