@mstar-harness/opencode 3.1.2 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/mstar.js +195 -108
  3. package/harness-commands/iteration-drive.md +9 -90
  4. package/harness-commands/iteration-loop.md +22 -62
  5. package/harness-commands/iteration-start.md +20 -77
  6. package/harness-skills/mstar-audit/SKILL.md +2 -2
  7. package/harness-skills/mstar-compound-refresh/SKILL.md +1 -1
  8. package/harness-skills/mstar-dispatch-gates/SKILL.md +1 -1
  9. package/harness-skills/mstar-harness-core/SKILL.md +4 -3
  10. package/harness-skills/mstar-iteration/SKILL.md +16 -10
  11. package/harness-skills/mstar-iteration/references/command-shared-invariants.md +62 -0
  12. package/harness-skills/mstar-iteration/references/phase-2-worktree-lease.md +3 -3
  13. package/harness-skills/mstar-iteration/references/phase-4-5-pr-delivery.md +1 -1
  14. package/harness-skills/mstar-iteration/references/phase5-helper-discovery.md +1 -1
  15. package/harness-skills/mstar-phase-gates/SKILL.md +1 -1
  16. package/harness-skills/mstar-plan-artifacts/references/knowledge-and-designs.md +2 -2
  17. package/harness-skills/mstar-plan-artifacts/references/status-and-residuals.md +1 -1
  18. package/harness-skills/mstar-plan-conventions/SKILL.md +1 -1
  19. package/harness-skills/mstar-roles/references/_shared/leaf-executor-core.md +11 -1
  20. package/harness-skills/mstar-roles/references/architect.md +4 -7
  21. package/harness-skills/mstar-roles/references/code-reviewer.md +1 -4
  22. package/harness-skills/mstar-roles/references/frontend-dev.md +2 -4
  23. package/harness-skills/mstar-roles/references/fullstack-dev-shared.md +2 -4
  24. package/harness-skills/mstar-roles/references/ops-engineer.md +2 -6
  25. package/harness-skills/mstar-roles/references/product-manager.md +4 -7
  26. package/harness-skills/mstar-roles/references/prompt-engineer.md +2 -5
  27. package/harness-skills/mstar-roles/references/qa-engineer.md +2 -6
  28. package/harness-skills/mstar-roles/references/qc-specialist-shared.md +1 -4
  29. package/harness-skills/mstar-roles/references/writing-specialist.md +2 -5
  30. package/harness-skills/mstar-strategy/SKILL.md +5 -35
  31. package/package.json +1 -1
@@ -46,94 +46,54 @@ Parse: if the last token is exactly `S`/`M`/`L`/`XL` (case-insensitive), treat i
46
46
 
47
47
  ## Continuous execution(HARD — Phase 1 lock 后至 Phase 5 exit)
48
48
 
49
- Execute **`mstar-iteration` §2.6**(Continuous execution SSOT)。**合法 STOP(仅此升级用户)**:branch metadata 按 **`mstar-iteration`** autonomous resolve 顺序仍无法确定(**禁止**静默默认 `main`/`master`);代码/roadmap **无可信候选**且无 `direction` 参数;**`Blocked`**(真冲突、secrets、不可逆范围缺口、Phase 5 多轮仍无法 merge-ready);用户本轮显式打断。**Turn 收束纪律**:最后一条内容必须是 **in-flight 动作**(invoke 已发出或下一 Assignment),**不得**以确认问句结尾。
49
+ Execute **`mstar-iteration` §2.6**(Continuous execution SSOT)+ **`mstar-iteration/references/command-shared-invariants.md`** STOP list(branch metadata 缺失 / **`Blocked`** / 用户显式打断 — 不在本命令重复)。**Loop 特有 STOP**:branch metadata 按 **`mstar-iteration`** autonomous resolve 顺序仍无法确定(**禁止**静默默认 `main`/`master`);代码/roadmap **无可信候选**且无 `direction` 参数。**Turn 收束纪律**:最后一条内容必须是 **in-flight 动作**(invoke 已发出或下一 Assignment),**不得**以确认问句结尾。
50
50
 
51
- ## PM invariants
51
+ **Do not** Read `skills/grill-me/SKILL.md` for this command.
52
52
 
53
- | 禁止(PM 线程) | 必须 |
54
- |-----------------|------|
55
- | 自己 Edit 冒充 product-manager / architect / writing-specialist;只写 Assignment 就声称 review 完成 | §5.1 → §5.2 → §5.3 **顺序**各 **1 次 invoke**;5.4 PM lock 在 subagent 返回之后(**`mstar-iteration` §1.6**) |
56
- | 加载 `grill-me` | **Autonomous** direction lock(`mstar-iteration` §1.2) |
57
- | Write/Edit/Shell 产品代码、写测试、跑 QC;多 task plan inline 大包派发 | 每条 implement/QC/QA Assignment ⇒ **1 次 `Task`**;**SDD** per-task 循环 |
58
- | 最后 plan `Done` 后直接开 PR;Phase 5 自己改产品代码 | **Phase 3 → 4 → 5**;dispatch `fullstack-dev` / `ops-engineer` |
53
+ ## Boot
59
54
 
60
- 派发细则**`mstar-dispatch-gates`** + **`mstar-host`**。
55
+ **`mstar-iteration`** Load order 加载(`mstar-harness-core` `mstar-roles` → `references/project-manager.md` → `mstar-iteration` § Phase 1–5 + `command-shared-invariants.md` → `mstar-dispatch-gates` `mstar-phase-gates` → `mstar-plan-conventions` / `mstar-plan-artifacts` → `mstar-host` → `mstar-compound`(Phase 3 前)→ **`mstar-sdd`**(first implement 前)→ `mstar-review-qc`(first QC 前)→ `mstar-branch-worktree` → **`mstar-iteration/references/phase-2-worktree-lease.md`**)。完整 load list → **`mstar-roles`**。
61
56
 
62
- **Session todos**:
57
+ **Session todos(loop 专属;Phase 2–5 共享 rows → `command-shared-invariants.md`)**:
63
58
 
64
59
  | Todo id | 何时追加 | 何时可勾掉 |
65
60
  |---------|----------|------------|
66
61
  | `phase-1-autonomous-start` | Boot | compass `locked` + integration committed |
67
- | plan-wave todos | 进入 Phase 2 | 各 plan `Done` |
68
- | `phase-3-iteration-close` | 仅剩 1 个非 `Done` plan | Phase 3 §3.5 exit 全 `[x]` |
69
- | `phase-4-create-pr` | Phase 3 完成后 | PR 已创建 |
70
- | `phase-5-pr-merge-ready` | Phase 4 完成后 | Phase 5 §5.5 exit 全 `[x]` |
71
-
72
- ## Boot
73
-
74
- 1. `mstar-harness-core`
75
- 2. `mstar-roles` → `references/project-manager.md`
76
- 3. `mstar-iteration` → **§ Phase 1**(含 **autonomous** direction lock / scale budget / branch resolve)+ **§ Phase 2–5**
77
- 4. `mstar-dispatch-gates`
78
- 5. `mstar-phase-gates` → Prepare
79
- 6. `mstar-plan-conventions`, `mstar-plan-artifacts`
80
- 7. `mstar-host` → active host reference
81
- 8. `mstar-compound` — before Phase 3 §3.2
82
- 9. **`mstar-sdd`** — before first implement dispatch in Phase 2
83
- 10. `mstar-review-qc` — before first QC dispatch in Phase 2
84
- 11. `mstar-branch-worktree` — when Git/write or QC checkout
85
- 12. **`mstar-iteration/references/phase-2-worktree-lease.md`** — Phase 2 control worktree + lease(§2.0 #5 未 waive)
86
-
87
- **Do not** Read `skills/grill-me/SKILL.md` for this command.
88
-
89
- ---
90
62
 
91
63
  ## Phase 1: Autonomous start
92
64
 
93
- ### 1. Research
94
-
95
- 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 `STRATEGY.md` if present。Prioritize deferred / roadmap `next` items(code-first — **explore before guessing**)。
65
+ Execute **`mstar-iteration` § Phase 1**(**autonomous** direction lock + scale budget + branch resolve SSOT → `references/autonomous-direction-lock.md`):
96
66
 
97
- ### 2–4. Explore → Lock → Write
67
+ ### 1–4. Research → Explore → Lock → Write
98
68
 
99
- Scope **2–4** candidates targeting product completeness(prefer deferred / roadmap `next`)→ **autonomous** direction lock(**`mstar-iteration` §1.2** + `references/autonomous-direction-lock.md`:`direction` arg 约束候选或 rank 后 **lock recommended**;落盘 rationale + success criteria + non-goals + scale budget;autonomous branch resolve — never silent `main`/`master`;**STOP** if no credible candidate and no `direction` arg;**do not** ask user to confirm)→ write compass + plans per **`mstar-iteration` §1.3–§1.5**(template `references/iteration-compass-template.md`;**business** plan count within scale budget)。
69
+ Survey structured harness dirs(`{HARNESS_DIR}/status.json`、`{ITERATION_DIR}/`、`{KNOWLEDGE_DIR}/`、`{SPECS_DIR}/`)+ planning artifacts(`**/roadmap*.md`、`**/deferred*.md`、`**/features*.md`、`**/backlog*.md`、`**/TODO*.md`、`**/*.plan.md`)+ `STRATEGY.md`(if present)→ scope **2–4** candidates **autonomous** lock(`direction` arg 约束;落盘 rationale + success criteria + non-goals + scale budget;branch resolve — never silent `main`/`master`;**STOP** if no credible candidate and no `direction` arg)→ write compass + plans per §1.3–§1.5business plan count within scale budget)。
100
70
 
101
71
  ### 5. Review & Edit Chain(HARD GATE)
102
72
 
103
- Execute **`mstar-iteration` §1.6**:`product-manager` → `architect` → `writing-specialist` **顺序** invoke(编辑 compass / plans / specs / `<iteration-id>/` package;**禁止** `{KNOWLEDGE_DIR}/` 新增;writing-specialist corpus hygiene → `iteration-artifact-boundaries.md` + `iteration-corpus-hygiene.md`)→ PM lock(compass `status: locked` + Prepare gates)。Tool rule → **`mstar-dispatch-gates`**。Exception: user waives ("PM-only review").
73
+ Execute **`mstar-iteration` §1.6**:`product-manager` → `architect` → `writing-specialist` 顺序 invoke(**禁止** `{KNOWLEDGE_DIR}/` 新增;corpus hygiene)→ PM lock。**Assignment preflight** per **`command-shared-invariants.md`**。
104
74
 
105
- **Pre-commit checklist**(print before §6; all `[x]`):autonomous direction lock rationale in compass(not grill-me);scale budget applied;compass + plans + `status.json` registered;三角色 invokes completed(**未**向 `{KNOWLEDGE_DIR}/` 新增);PM final lock + Prepare gates;branch policy locked(`iteration_base_branch` / `spec_integration_branch` / `target_branch`)。**THEN** commit + push `iteration/<iteration-id>`.
75
+ **Pre-commit checklist**(print before §6all `[x]`):
106
76
 
107
- ### 6. Integration Branch
77
+ - [ ] Autonomous direction lock rationale recorded in compass(**not** grill-me)
78
+ - [ ] Scale budget applied(business plan 按 S/M/L/XL 名额)
79
+ - [ ] compass + plans + `status.json` registered
80
+ - [ ] product-manager / architect / writing-specialist invokes completed(**未**向 `{KNOWLEDGE_DIR}/` 新增)
81
+ - [ ] PM final lock:compass `status: locked` + Prepare gates pass
82
+ - [ ] Branch policy locked:`iteration_base_branch` / `spec_integration_branch` / `target_branch` recorded
83
+ - [ ] **THEN** commit + push `iteration/<iteration-id>`
108
84
 
109
- Per **`mstar-iteration` §2.3**(`git fetch` → `git checkout -b <spec_integration_branch> <iteration_base_branch>`;register branch fields in compass + `status.json`;commit docs;push)。**STOP** if `iteration_base_branch` / `target_branch` still missing after autonomous resolve.
85
+ ### 6. Integration Branch
110
86
 
111
- **Immediately** print `## Phase 2: Autonomous Execute` → continue below(勾掉 `phase-1-autonomous-start`)。
87
+ Per **`mstar-iteration` §2.3**(create from `iteration_base_branch`;register branch fields;commit docs;push)。**STOP** if base/target missing。**Immediately** print `## Phase 2: Autonomous Execute` → continue(勾掉 `phase-1-autonomous-start`)。
112
88
 
113
89
  ---
114
90
 
115
91
  ## Phase 2–5: Execute → close → PR → merge-ready
116
92
 
117
- Delegate to **`iteration-drive`**(Phase 2 → **`mstar-iteration` §2**、Phase 3 → **§3** + `references/phase-3-iteration-close.md`、Phase 4/5 → **§4–§5** + `references/phase-4-5-pr-delivery.md`、Phase 5 helper discovery → `mstar-iteration/references/phase5-helper-discovery.md`)。
118
-
119
- **Assignment preflight**(`mstar-harness` bin 未安装时静默跳过): 每次 implement/QC/QA 派发前校验最新 Assignment(**SDD** 下为最新 `{SDD_DIR}/task-N-brief.md` 或临时写盘的 Assignment),同 `iteration-drive`。模式由迭代 compass frontmatter 的 `enforcement` 键决定(Slice 5):
120
-
121
- - **默认(compass 无 `enforcement: hard`)— 可选 warn-only**:exit 1 仅提示,不阻断派发(Slice 3 行为不变):
122
-
123
- ```bash
124
- command -v mstar-harness >/dev/null 2>&1 && mstar-harness dispatch validate "<latest-assignment-file>"
125
- ```
126
-
127
- - **`enforcement: hard`(迭代 compass frontmatter 声明)— fail-fast**:校验失败即 `exit 1` 阻断派发(bin 缺失仍静默跳过):
128
-
129
- ```bash
130
- if command -v mstar-harness >/dev/null 2>&1; then mstar-harness dispatch validate "<latest-assignment-file>" || exit 1; fi
131
- ```
132
-
133
- > 路径必须加引号且替换为具体文件(如最新 `{SDD_DIR}/task-N-brief.md`,勿留尖括号)——agent 代入的路径不得进入 shell 无引号展开。
93
+ Delegate to **`iteration-drive`**(Phase 2 → §2Phase 3 → §3 + `references/phase-3-iteration-close.md`、Phase 4/5 → §4–§5 + `references/phase-4-5-pr-delivery.md`、Phase 5 helper discovery → `phase5-helper-discovery.md`)。**Assignment preflight** per **`command-shared-invariants.md`**。
134
94
 
135
- **Loop 特有**:Phase 5 push cadence(HARD)→ **`mstar-iteration` §5.1a**;exit checklist → **`mstar-iteration` §5.2**(`references/phase-4-5-pr-delivery.md` §5.2)。
95
+ **Loop 特有**:Phase 5 push cadence(HARD)→ **`mstar-iteration` §5.1a**;exit checklist → §5.2(`references/phase-4-5-pr-delivery.md`)。
136
96
 
137
- **Then** report: iteration id, locked direction + scale, plans completed, compound summary, PR link, merge-ready evidence.
97
+ **Then** report: iteration id, locked direction + scale, plans completed, compound summary, PR link, merge-ready evidence
138
98
 
139
99
  PR merge itself may remain manual unless user authorized auto-merge.
@@ -22,7 +22,7 @@ Start a new Morning Star harness iteration. **Phase 1 is not complete until the
22
22
 
23
23
  **Parse**: if any token is exactly `pause` (case-insensitive), treat as the `pause` flag; the remaining tokens (joined) are the `direction` hint. `/iteration-start pause` = pause with empty direction.
24
24
 
25
- ## PM invariants(本命令全程有效读完再动手)
25
+ ## PM invariants(Phase 1 review-chain 本命令全程有效)
26
26
 
27
27
  你是 **`project-manager` 编排者**,不是三专业角色的合并替身。
28
28
 
@@ -36,9 +36,7 @@ Start a new Morning Star harness iteration. **Phase 1 is not complete until the
36
36
 
37
37
  **Phase 1 完成定义**:compass `status: locked` + 三角色 invoke 已返回 + pre-commit checklist 全 `[x]` — 不是初稿落盘。**Command Done**(§7 auto-continue)= Phase 5 §5.5 exit checklist 全 `[x]`(同 `iteration-drive`);`pause` 时 = Phase 1 完成。
38
38
 
39
- Detailed workflow **`mstar-iteration` § Phase 1**;per-plan Prepare gates → **`mstar-phase-gates`**(specify → clarify → plan)。
40
-
41
- **Phase 2–5 auto-continue(§7)invariants** → **`iteration-drive`**「PM invariants」表(不写产品代码 / 不 inline 大包 / 每 Assignment 1 invoke / Phase 3→4→5 顺序 / Phase 5 dispatch 改代码)。
39
+ **Phase 2–5 共享 invariants / preflight / todos / STOP** → **`mstar-iteration/references/command-shared-invariants.md`**(不在本命令重复)。
42
40
 
43
41
  ## Path split(HARD — 路由)
44
42
 
@@ -51,13 +49,7 @@ Detailed workflow → **`mstar-iteration` § Phase 1**;per-plan Prepare gates
51
49
 
52
50
  ## 0. Boot
53
51
 
54
- 1. `mstar-harness-core`
55
- 2. `mstar-roles` → `references/project-manager.md`
56
- 3. `mstar-iteration` → **§ Phase 1**(迭代范围、compass 模板、**§1.5.5 产物边界**、§1.6 Review & Edit chain、状态初始化)
57
- 4. `mstar-dispatch-gates`
58
- 5. `mstar-phase-gates` → Prepare(specify → clarify → plan)
59
- 6. `mstar-plan-conventions`, `mstar-plan-artifacts`
60
- 7. `mstar-host` → active host reference(invoke 能力);若 Cursor Plan mode → 另读 **`cursor-plan-mode-bridge.md`**(`mstar-iteration` Phase 1 in Plan mode)
52
+ **`mstar-iteration`** Load order 加载(`mstar-harness-core` → `mstar-roles` → `references/project-manager.md` → `mstar-iteration` § Phase 1 + `mstar-phase-gates` + `mstar-dispatch-gates` + `mstar-plan-conventions/artifacts` + `mstar-host` → active host reference)。Cursor Plan mode 另读 **`cursor-plan-mode-bridge.md`**(`mstar-iteration` Phase 1 in Plan mode)。完整 load list → **`mstar-roles`**。
61
53
 
62
54
  **若 Cursor Plan mode 活跃 → 进入 §P;否则继续 §1。**
63
55
 
@@ -68,51 +60,35 @@ Execute **`mstar-host/references/cursor-plan-mode-bridge.md`** § **"mstar-itera
68
60
  Command-unique 补充(bridge 未枚举):
69
61
 
70
62
  - **空白脚手架字段**:Direction / Scope / Acceptance Criteria / Non-Goals / Delivery Branch Policy(`iteration_base_branch` / `spec_integration_branch` / `target_branch`)/ Plans / Feedback log / Deferred grill log
71
- - **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`
63
+ - **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`
72
64
 
73
65
  ## 非 Plan 路径从这里继续 ↓
74
66
 
75
67
  ## 1. Research
76
68
 
77
- 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。
69
+ 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 `STRATEGY.md`(if exists)and `{KNOWLEDGE_DIR}/README.md`(if exists — Active index rows are Research candidates)。Prioritize deferred / incomplete items from prior iterations。
78
70
 
79
71
  ## 2. Explore Directions
80
72
 
81
- Scope **2–4** candidates targeting **product completeness**(default to deferred items from previous iterations;allow substantive refactoring where it accelerates product maturity)。**If `direction` arg given** — narrow candidates to that hint (still scope 2–4 unless the hint is explicitly singular); record the hint in grill-me context。**非 Plan 路径**(Plan mode 已由 §P 处理)。
73
+ Scope **2–4** candidates targeting **product completeness**(default to deferred items from previous iterations;allow substantive refactoring where it accelerates product maturity)。**If `direction` arg given** — narrow candidates to that hint (still scope 2–4 unless explicitly singular)record the hint in grill-me context
82
74
 
83
75
  ## 3. Lock Direction — bundled `grill-me`
84
76
 
85
- > **非 Plan 路径**。Cursor Plan mode 用 §P.3 feedback loop + §P.3.5 deferred grill(主路径不是 grill)。
86
-
87
- **Direction lock mode: `interactive`**(`mstar-iteration` §1.2 默认;本命令不使用 `autonomous`)。
77
+ > **非 Plan 路径**。Cursor Plan mode 用 §P feedback loop + deferred grill(主路径不是 grill)。
88
78
 
89
- 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.
79
+ **Direction lock mode: `interactive`**(`mstar-iteration` §1.2 默认;本命令不使用 `autonomous`)。This command bundles a **non-`mstar-*`** skill at `skills/grill-me/SKILL.md` **only this command step** references it.
90
80
 
91
- **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。**If `direction` arg given** — seed grill-me with it as the recommended direction (still interactive: user may correct/refine; the hint does **not** skip grill-me)。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.**
81
+ **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。**If `direction` arg given** — seed grill-me with it (still interactive; the hint does **not** skip grill-me)。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.**
92
82
 
93
83
  ## 4. Write Compass & Plans
94
84
 
95
- 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 路径**。
85
+ 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` 登记(§1.5)、`{ITERATION_DIR}/README.md` 索引(一行 = 一次迭代)、package dirs(`{ITERATION_DIR}/<iteration-id>/{guides,specs}/`)。
96
86
 
97
87
  ## 5. Review & Edit Chain(HARD GATE — do not commit before this)
98
88
 
99
- 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").
100
-
101
- **Assignment preflight**(`mstar-harness` bin 未安装时静默跳过): 在每次角色 invoke 前,若本机装有 CLI,校验最新落盘的 Assignment(临时写盘或既有 brief)。模式由迭代 compass frontmatter 的 `enforcement` 键决定(Slice 5):
102
-
103
- - **默认(compass 无 `enforcement: hard`)— 可选 warn-only**:exit 1 仅提示,不阻断派发(Slice 3 行为不变):
104
-
105
- ```bash
106
- command -v mstar-harness >/dev/null 2>&1 && mstar-harness dispatch validate "<latest-assignment-file>"
107
- ```
89
+ Execute **`mstar-iteration` §1.6**(SSOT):顺序 `product-manager` → `architect` → `writing-specialist` → PM lock(**禁止**并行三 roles;OpenCode plain role id — `mstar-host/references/opencode.md`);**禁止** `{KNOWLEDGE_DIR}/` 新增;writing-specialist corpus hygiene(`iteration-artifact-boundaries.md` + `iteration-corpus-hygiene.md`)。Tool rule → **`mstar-dispatch-gates`** specialist review-and-edit(每 role 1 invoke,等磁盘修订返回)。Exception: user explicitly waives subagent dispatch ("PM-only review").
108
90
 
109
- - **`enforcement: hard`(迭代 compass frontmatter 声明)— fail-fast**:校验失败即 `exit 1` 阻断派发(bin 缺失仍静默跳过):
110
-
111
- ```bash
112
- if command -v mstar-harness >/dev/null 2>&1; then mstar-harness dispatch validate "<latest-assignment-file>" || exit 1; fi
113
- ```
114
-
115
- > 路径必须加引号且替换为具体文件(如最新 `{SDD_DIR}/task-N-brief.md`,勿留尖括号)——agent 代入的路径不得进入 shell 无引号展开。
91
+ **Assignment preflight**:每次 invoke 前按 **`mstar-iteration/references/command-shared-invariants.md`** 执行(warn-only + `enforcement: hard` fail-fast;bin 缺失静默跳过)。
116
92
 
117
93
  **Prepare gate (per plan in compass)**:
118
94
 
@@ -124,56 +100,23 @@ if command -v mstar-harness >/dev/null 2>&1; then mstar-harness dispatch validat
124
100
 
125
101
  PM must print this block before §6; all `[ ]` must be `[x]`:
126
102
 
127
- - [ ] direction lock decisions recorded in compass(Plan 路径:Feedback log + 可选 Deferred grill log;非 Plan:grill-me)
103
+ - [ ] direction lock decisions recorded in compass(Plan 路径:Feedback log + deferred grill log;非 Plan:grill-me)
128
104
  - [ ] Draft compass + plans + `status.json` registered
129
- - [ ] product-manager / architect / writing-specialist invokes completed — 编辑 compass / plans / specs / **`<iteration-id>/` package**;**未**向 `{KNOWLEDGE_DIR}/` 新增;writing-specialist specs corpus hygiene done
105
+ - [ ] product-manager / architect / writing-specialist invokes completed — 编辑 compass / plans / specs / **`<iteration-id>/` package**;**未**向 `{KNOWLEDGE_DIR}/` 新增
130
106
  - [ ] PM final lock: compass `status: locked`; Prepare gates pass (blocked plans documented)
131
- - [ ] Branch policy locked: `iteration_base_branch`, `spec_integration_branch`, and `target_branch` recorded in compass / `status.json`
132
- - [ ] **THEN**: git commit + push `iteration/<iteration-id>`
107
+ - [ ] Branch policy locked: `iteration_base_branch` / `spec_integration_branch` / `target_branch` recorded in compass / `status.json`
108
+ - [ ] **THEN**: commit + push `iteration/<iteration-id>`
133
109
 
134
110
  ## 6. Integration Branch
135
111
 
136
- **Precondition**: §5 complete compass `status: locked`; specialist Tasks returned; Prepare gates confirmed.
137
-
138
- - Create `spec_integration_branch` (e.g. `iteration/<iteration-id>`) **from** the locked `iteration_base_branch`:
139
-
140
- ```bash
141
- git fetch origin # if needed
142
- git checkout -b <spec_integration_branch> <iteration_base_branch>
143
- # or: git checkout <spec_integration_branch> if it already exists
144
- ```
145
-
146
- - Register `iteration_base_branch`, `spec_integration_branch`, and `target_branch` in compass frontmatter **and** `{HARNESS_DIR}/status.json` root `metadata`
147
- - Commit all documents to the integration branch and push to remote
148
-
149
- **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`.
112
+ Per **`mstar-iteration` §2.3**:create `spec_integration_branch` from `iteration_base_branch`(`git fetch` → `git checkout -b <spec_integration_branch> <iteration_base_branch>`);register `iteration_base_branch` / `spec_integration_branch` / `target_branch` in compass frontmatter **and** `status.json` metadata;commit docs;push。**STOP** if `iteration_base_branch` / `target_branch` missing — never default `main`/`master`.
150
113
 
151
114
  ---
152
115
 
153
- ## 7. Phase 2–5: Execute → close → PR → merge-ready(auto-continue)
154
-
155
- **`pause` arg → command ends here.** Phase 1 locked + integration branch pushed;run `/iteration-drive` later to resume。
156
-
157
- **Default(no `pause`)→ auto-continue** into Phase 2→5。
158
-
159
- ### Phase 2 boot(load before delegating)
160
-
161
- 1. `mstar-iteration` → **§ Phase 2–5**(§2 Autonomous Execute、§3 close、§4 PR、§5 merge-ready)
162
- 2. **`mstar-sdd`** — before first implement dispatch(per-task loop SSOT)
163
- 3. `mstar-review-qc` — before first QC dispatch
164
- 4. `mstar-compound` — before Phase 3 §3.2
165
- 5. `mstar-branch-worktree` + **`mstar-iteration/references/phase-2-worktree-lease.md`** — control worktree + lease(§2.0 #5 未 waive)
166
-
167
- ### Delegate to `iteration-drive` Phase 2→5
168
-
169
- Execute **`iteration-drive`** Phase 2–5 exactly:Phase 2 → **`mstar-iteration` §2**(§2.0 五道闸 → §2.6 push 纪律;SDD per-task;QC tri N=3 + QA)、Phase 3 → **§3** + `references/phase-3-iteration-close.md`、Phase 4/5 → **§4–§5** + `references/phase-4-5-pr-delivery.md`、Phase 5 helper discovery → `mstar-iteration/references/phase5-helper-discovery.md`。
170
-
171
- **Continuous execution(HARD)**:自 Phase 2 进入至 Phase 5 §5.5 exit,PM **连续编排**(**`mstar-iteration` §2.6**),进度汇报后下一条必须是 dispatch 或下一 phase 步骤,不向用户例行 yes/no check-in。合法 STOP 仅限:branch metadata 缺失、真冲突 / secrets / 不可逆范围缺口、Phase 5 多轮仍无法 merge-ready、用户本轮显式打断。
172
-
173
- **Assignment preflight**:同 §5(每次 implement/QC/QA 派发前校验;`mstar-harness` bin 未安装时静默跳过)。
116
+ ## 7. Phase 2–5(auto-continue)
174
117
 
175
- **Done = Phase 5 §5.5 exit checklist `[x]`**(同 `iteration-drive`)。
118
+ **`pause` arg → command ends here**(Phase 1 locked + integration pushed;run `/iteration-drive` later)。**Default(no `pause`)→ auto-continue**:execute **`iteration-drive`**(Phase 2 → **`mstar-iteration` §2**;Phase 3 → §3 + `references/phase-3-iteration-close.md`;Phase 4/5 §4–§5 + `references/phase-4-5-pr-delivery.md`;Phase 5 helper discovery `phase5-helper-discovery.md`)。Shared invariants / preflight / STOP → **`mstar-iteration/references/command-shared-invariants.md`**。
176
119
 
177
- **Then** report: iteration id, direction lock summary, plans completed, compound summary, PR link, merge-ready evidence(CI snapshot + review resolution + Greptile if applicable)。
120
+ **Done = Phase 5 §5.5 exit checklist 全 `[x]`**(同 `iteration-drive`)。**Then** report: iteration id, direction lock summary, plans completed, compound summary, PR link, merge-ready evidence(CI snapshot + review resolution + Greptile if applicable)。
178
121
 
179
122
  PR merge itself may remain manual unless user authorized auto-merge.
@@ -176,7 +176,7 @@ Follow `plan.main.md` template + **plan-quality-bar**. Additional audit-specific
176
176
  - **Planned at**: commit `<short SHA>`, <YYYY-MM-DD>
177
177
  ```
178
178
 
179
- > **Engine check (when available):** run `mstar audit scaffold <findings-file> [--dir <out-dir>]` (or `import { scaffoldAuditPlan, validateAuditStatusBlocks, redactSecrets } from "@mstar-harness/engine"` in a host hook) to scaffold the `audit-<date>/` plan directory (numbered plan files + README index) from findings, validate the audit Status blocks above, and redact credentials from audit excerpts. On `fail` -> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
179
+ > **Engine check (when available):** run `mstar audit scaffold <findings-file> [--dir <out-dir>]` (or `import { scaffoldAuditPlan, validateAuditStatusBlocks } from "@mstar-harness/engine"` in a host hook) to scaffold the `audit-<date>/` plan directory (numbered plan files + README index) from findings, validate the audit Status blocks above, and redact credentials from audit excerpts. On `fail` -> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
180
180
 
181
181
  ## Handoff to execution
182
182
 
@@ -184,7 +184,7 @@ Audit plans are **input candidates** for the normal Prepare → Execute flow. Th
184
184
 
185
185
  When the user selects plans to pursue:
186
186
 
187
- 1. PM creates a plan row in `status.json` (`{PLAN_DIR}` main plan) for each selected audit plan.
187
+ 1. PM registers the workflow + plan rows in `{WORKFLOW_DIR}/<id>/snapshot.json` (root `status.json` v2 holds the workflows registry only — see `mstar-plan-artifacts`), with the main plan in `{PLAN_DIR}` via `mstar audit promote <audit-dir> --plans <ids>` when the CLI is available, or manually per `mstar-plan-artifacts`.
188
188
  2. Each plan enters the normal state machine: `Todo → InProgress → InReview → Done`.
189
189
  3. PM may fast-track Prepare since the audit plan already contains spec, current-state excerpts, and verification gates — but the intent gate and clarify discipline still apply (`mstar-phase-gates`).
190
190
  4. Execution follows normal SDD or inline dispatch.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mstar-compound-refresh
3
- description: Morning Star 知识维护与项目知识 bootstrap —— 审查 `{KNOWLEDGE_DIR}` 文档是否仍准确、去重叠合并、清理过期知识;或从代码库提炼 STRATEGY.md、CONCEPTS.md、基线 knowledge 脚手架(无/残旧/空白 knowledge)。触发:`mstar-compound` 发现可合并文档、定期维护、项目缺 STRATEGY.md/CONCEPTS.md/{KNOWLEDGE_DIR}、stale knowledge scaffolding、显式 bootstrap 请求、或显式 refresh。产出:更新/合并/删除知识文档 + 维护报告;或 bootstrap 产物(STRATEGY.md、CONCEPTS.md、基线 knowledge)。
3
+ description: Morning Star 知识维护与项目知识 bootstrap —— 审查 `{KNOWLEDGE_DIR}` 文档是否仍准确、去重叠合并、清理过期知识;或从代码库提炼 CONCEPTS.md、基线 knowledge 脚手架(无/残旧/空白 knowledge)。STRATEGY.md 创建委托 **`mstar-strategy`**。触发:`mstar-compound` 发现可合并文档、定期维护、项目缺 CONCEPTS.md/{KNOWLEDGE_DIR}、stale knowledge scaffolding、显式 bootstrap 请求、或显式 refresh。产出:更新/合并/删除知识文档 + 维护报告;或 bootstrap 产物(CONCEPTS.md、基线 knowledge)。
4
4
  ---
5
5
 
6
6
  # mstar-compound-refresh(知识维护)
@@ -78,7 +78,7 @@ When **`Execution mode: sdd`** (`mstar-sdd`):
78
78
  - Record per-task BASE SHA; use `review-package` for diffs — **never `HEAD~1`**.
79
79
  - After all tasks: branch `review-package` in `{SDD_DIR}/review/` → **mandatory tri-review N=3** when `Execution mode: sdd`; **N=1** only for `inline` / explicit single override.
80
80
 
81
- > **Engine check (when available):** run `mstar review seats <assignment-file> [--mode sdd|inline|targeted] [--reviewers <role1,role2,...>]` (or `import { executionModeToN, assertTriIdentity } from "@mstar-harness/engine"` in a host hook) to map `Execution mode` to its QC seat count N and assert tri identity for the QC tri above. On `fail` -> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
81
+ > **QC seats Engine-check 唯一规范体:** `mstar-review-qc` `SKILL.md`(Engine-check seats 行)。
82
82
 
83
83
  ## 并行规则(摘要)
84
84
 
@@ -24,10 +24,11 @@ description: Morning Star (启明星) harness **强制全局入口** —— 信
24
24
 
25
25
  1. 当轮用户显式指令
26
26
  2. 项目 `AGENTS.md` / `CLAUDE.md`
27
- 3. `mstar-*` skills(本 skill + 专题)
28
- 4. `mstar-roles` 角色正文
27
+ 3. `{KNOWLEDGE_DIR}/README.md` 索引(**若该文件存在**;发现 Active 行并仅跟随与当轮相关的文档)
28
+ 4. `mstar-*` skills(本 skill + 专题)
29
+ 5. `mstar-roles` 角色正文
29
30
 
30
- 冲突且用户未覆盖 → **暂停升级人工**。
31
+ 冲突且用户未覆盖 → **暂停升级人工**。Knowledge **永不**高于用户 / `AGENTS.md`。
31
32
 
32
33
  ## 最小交付循环
33
34
 
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: mstar-iteration
3
- description: Morning Star 迭代管理 —— Phase 1(默认 interactive direction lockopt-in autonomous;specs + `<iteration-id>/` package;禁止直写 knowledge)、Autonomous Executeiteration-closecompound 提升 package → knowledge)、PR 交付、PR merge-ready loop。分支 SSOTworkflow snapshot(`workflows/<id>/snapshot.json`)+ compass frontmatter
3
+ description: "Use when starting, driving, resuming, or closing a Morning Star iteration, or running an autonomous Phase 1–5 loop — including without a slash command (e.g. 'start an iteration', 'drive the iteration', 'run an autonomous loop'). Manages Phase 1 (default interactive direction lock; opt-in autonomous), Autonomous Execute, iteration-close (compound promotes knowledge), PR delivery, and the PR merge-ready loop. Branch SSOT: workflow snapshot (`workflows/<id>/snapshot.json`) + compass frontmatter."
4
4
  ---
5
5
 
6
6
  # mstar-iteration(迭代管理)
7
7
 
8
8
  ## Load order
9
9
 
10
- **Read `mstar-harness-core` first.** Path symbols → **`mstar-plan-conventions`**. Per-plan gates → **`mstar-phase-gates`**. Knowledge crystallization → **`mstar-compound`**. **Phase 2 entry**(control worktree + lease)→ **`references/phase-2-worktree-lease.md`** + **`mstar-branch-worktree`**。**Phase 2 implement 波次**(进入 per-plan implement 前)→ **`mstar-sdd`** + **`mstar-dispatch-gates`**。Phase 2 QC 前 → **`mstar-review-qc`**。On conflict, **`mstar-harness-core` wins**.
10
+ **Read `mstar-harness-core` first.** Path symbols → **`mstar-plan-conventions`**. Per-plan gates → **`mstar-phase-gates`**. Knowledge crystallization → **`mstar-compound`**. **Phase 1 角色派发**(每次 invoke 前的 assignment preflight;`enforcement: hard` fail-fast)→ **`references/command-shared-invariants.md`**(本 skill 直接触发时不依赖 command 层)。**Phase 2 entry**(control worktree + lease)→ **`references/phase-2-worktree-lease.md`** + **`mstar-branch-worktree`**。**Phase 2 implement 波次**(进入 per-plan implement 前)→ **`mstar-sdd`** + **`mstar-dispatch-gates`**。Phase 2 QC 前 → **`mstar-review-qc`**。On conflict, **`mstar-harness-core` wins**.
11
11
 
12
12
  ## 设计思路
13
13
 
@@ -16,7 +16,7 @@ mstar 实践模式通常是:一次迭代锁定几个 spec 点(`specify + cla
16
16
  本 skill 管理迭代 **Phase 1–5**(command 层可聚合编排,但 **不得**反向引用 command 名;第三方 helper 仅由 command 按需发现):
17
17
 
18
18
  ```
19
- Phase 1: iteration-start
19
+ Phase 1: start
20
20
 
21
21
  Phase 2: Autonomous Execute —— [per-plan lifecycle × N]
22
22
 
@@ -43,7 +43,7 @@ Phase 5: PR merge-ready loop —— 至 mergeable + CI 全绿 + reviews resolved
43
43
  | **→ Phase 4** | §3.5 exit checklist 全 `[x]`;frontmatter `status: completed` + `end_date` | 打印 `## Phase 4: PR delivery`;开 PR 到 snapshot `branch.target`(§4) | 跳过 §3.1 entry checklist 或 compound Phase 6 |
44
44
  | **→ Phase 5** | Phase 4 PR 已创建 | 打印 `## Phase 5: PR merge-ready`;执行 §5 loop 至 §5.5 exit(含 §5.1a push cadence) | 开 PR 后停止;跳过 review resolve / CI loop;**CI/AI review 仍在跑时 push** |
45
45
  | **→ 迭代交付完成** | §5.5 exit checklist 全 `[x]` | PR mergeable;required CI 全绿;reviews resolved | Phase 4 开 PR 即宣称完成 |
46
- | **iteration-start → integration branch** | §1.6 Review & Edit chain | 三角色按序 invoke;**specs** 为主产出;**禁止** start 链向 `{KNOWLEDGE_DIR}/` 新增;writing-specialist corpus hygiene + compass `status: locked` | PM 代做专业编辑;并行三角色;product/architect 写 knowledge;临时笔记进 specs |
46
+ | **start → integration branch** | §1.6 Review & Edit chain | 三角色按序 invoke;**specs** 为主产出;**禁止** start 链向 `{KNOWLEDGE_DIR}/` 新增;writing-specialist corpus hygiene + compass `status: locked` | PM 代做专业编辑;并行三角色;product/architect 写 knowledge;临时笔记进 specs |
47
47
 
48
48
  > **Engine check (when available):** run `mstar iteration gate --workflow <id> --compass <delivery-compass.md>` (or `import { evaluatePhaseGate } from "@mstar-harness/engine"` in a host hook) to evaluate the transition gate above against the workflow snapshot. On `fail` (gate-blocking violations) -> do not proceed; fix and re-run. Note: during the Phase-3 window (`transition: phase-3-close`) the gate exits 1 until the §3.4 close items (`status: completed` + `end_date`) are written — that exit-1 is the expected "close work pending" signal (the exit checklist gates Phase 4, not the Phase-3 entry), so proceed with Phase 3 per the table below. Skill text below remains authoritative when the runtime is absent.
49
49
 
@@ -59,7 +59,7 @@ Phase 5: PR merge-ready loop —— 至 mergeable + CI 全绿 + reviews resolved
59
59
 
60
60
  ---
61
61
 
62
- ## Phase 1: iteration-start(启动迭代)
62
+ ## Phase 1: start(启动迭代)
63
63
 
64
64
  PM 在新迭代启动时执行。
65
65
 
@@ -67,7 +67,10 @@ PM 在新迭代启动时执行。
67
67
 
68
68
  1. 读 `{ITERATION_DIR}/README.md`(若存在),了解历史迭代
69
69
  2. 读 `STRATEGY.md`(若存在),对齐战略方向(见 `mstar-strategy`)
70
- 3. 如果有未完成的 roadmap 残余(上一迭代标记为 `next` plan),纳入本次迭代范围候选
70
+ 3. `{KNOWLEDGE_DIR}/README.md`(若存在),将索引中的 **Active** 行视为 Research 候选(**不**要求阅读全部 knowledge 正文)
71
+ 4. 如果有未完成的 roadmap 残余(上一迭代标记为 `next` 的 plan),纳入本次迭代范围候选
72
+
73
+ **非 command 触发**(如直接 skill 加载)时,Phase 1 方向锁定仍须 interactive(grill-me 在 command 层)。
71
74
 
72
75
  ### 1.2 定义迭代范围
73
76
 
@@ -184,7 +187,7 @@ compass frontmatter 的 `iteration_base_branch` / `target_branch` **必须与**
184
187
 
185
188
  Phase 1 与 §1.6 须遵守 **`references/iteration-artifact-boundaries.md`**(HARD):
186
189
 
187
- | 树 | iteration-start 主责 | 说明 |
190
+ | 树 | Phase 1(start)主责 | 说明 |
188
191
  |----|---------------------|------|
189
192
  | **`{SPECS_DIR}/`** | product-manager、architect | **长期**规范性产出:锁定规格、ADR、契约;plan `primary_spec` / `spec_refs` 主要挂此处 |
190
193
  | **`{ITERATION_DIR}/`** | product-manager、architect、PM | **`<iteration-id>/` package**(`delivery-compass.md` + 迭代级 specs & guides) |
@@ -196,6 +199,8 @@ Phase 1 与 §1.6 须遵守 **`references/iteration-artifact-boundaries.md`**(
196
199
 
197
200
  **Phase 1 在 PM lock 前不算完成**——compass/plans 初稿落盘 ≠ Done。
198
201
 
202
+ **Assignment preflight(每次角色 invoke 前,HARD)**:自然语言 / skill 直接触发(非 command 路径)时,本 skill 不依赖 command 层 preflight——**每个** Phase 1 角色派发前,PM 必须运行 assignment preflight(`references/command-shared-invariants.md` 的 warn-only / `enforcement: hard` fail-fast 片段;`enforcement: hard` 时校验失败即阻断派发)。Command 层(`/iteration-start`)走其自身 preflight;本行确保 skill 触发路径门禁不缺失。
203
+
199
204
  派发机制 → **`mstar-dispatch-gates`**(specialist review-and-edit dispatch,**顺序链**)。PM **不得**将迭代 harness 文档 commit 到 `spec_integration_branch`,直到:
200
205
 
201
206
  1. **product-manager** → **architect** → **writing-specialist** 已按序 invoke 编辑 compass、plans、`{SPECS_DIR}/` 与 **`{ITERATION_DIR}/<iteration-id>/`** package(guides/specs,按需);**不得**在 start 链向 `{KNOWLEDGE_DIR}/` 新增
@@ -226,7 +231,7 @@ Phase 1 与 §1.6 须遵守 **`references/iteration-artifact-boundaries.md`**(
226
231
  4. **Branch metadata gate**:snapshot `branch.base`(`iteration_base_branch`)、`branch.target`(`target_branch`)已登记,且至少一条 active plan 有 `metadata.spec_integration_branch`(或可从 compass 同轮 backfill)。**缺失 → STOP**,不得用 `main`/`master` 补位。
227
232
  5. **Control-worktree + lease defaults**(iteration 命令;可被 `Worktree mode: waived` 豁免):除非本轮 Assignment 显式 `Worktree mode: waived`(或等价用户指令),Phase 2 **必须**在入口建立 control worktree、经 control 路径读写默认 gitignored 的 harness 进程产物(根 `status.json`、`workflows/`、`projects/`、`{PLAN_DIR}`、`{ITERATION_DIR}`、`{SDD_DIR}` 等),并在可写派发前 claim workflow snapshot 的 `plans[].execution_lease` / 顶层 `integration_merge_lease`。可写 Assignment 须含绝对 feature **`Worktree path`** + 绝对 control 系 **`Plan Path`** / **`SDD dir`**(见 **`mstar-branch-worktree`**「Harness path SSOT under default gitignore」)。**禁止**因 feature worktree 在默认 gitignore 下看不到 plans 而推断 `Worktree mode: waived`。`Plan parallelism: serial` **不** waive 本闸——仅强制跨 plan **implement** 串行调度;control worktree + lease 仍须满足。**跨 plan 并行安全闸**(**不可**被 `Worktree mode: waived` 豁免):跨 plan **并行可写 implement** 须满足下列之一——(a) coordination 路径(control snapshot 或 waived 时主 checkout `{HARNESS_DIR}/status.json`)上 **same-host 独占写锁可用且每次 status/协调变更持锁**;(b) 默认 **`Plan parallelism: serial`**(**waived 时尤其优先默认串行**;**无 flock / 无共享锁时只触发本条,不豁免 worktree**);(c) 用户本轮显式 `Cross-host lease race: accepted`(或等价)+ `plans[].notes` 审计。**禁止**将 `Worktree mode: waived` 当作跨主机无锁并行的授权。细则 → **`references/phase-2-worktree-lease.md`**。
228
233
 
229
- > **Engine check (when available):** run `mstar lease verify --workflow <id> [--plan <plan-id>]` 或 `mstar lease verify-integration --workflow <id>`(或 import `validateExecutionLease` / `validateIntegrationMergeLease` from `@mstar-harness/engine` in a host hook)以校验上述迭代 lease(snapshot 的 execution_lease / integration_merge_lease)。On `fail` -> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
234
+ > **Engine-checklease verify / verify-integration)唯一规范体:** `mstar-plan-artifacts` `SKILL.md`(Engine check lease 行;standalone 保证同文)。
230
235
 
231
236
  任一 false → **stop**。Phase 1 / Prepare 未完成 → 先完成 Phase 1 或 per-plan Prepare,再进入本 Phase。
232
237
 
@@ -349,6 +354,7 @@ Iteration Phase 2 附加:
349
354
  - **跨 plan implement**(**无论** `Worktree mode: waived`):并行可写 implement 须满足 §2.0 #5 跨 plan 并行安全闸——same-host 独占写锁 + 每次协调变更持锁,或默认 **`Plan parallelism: serial`**(waived 时尤其优先),或用户本轮 `Cross-host lease race: accepted` + audit `notes`;**禁止**将 waived 当作无锁跨主机并行授权;未 waive 时另须 verified `execution_lease` + feature worktree。**integration merge 串行**(`integration_merge_lease` 或 waived 下无 lease 仍须串行 merge)
350
355
  - plan 内 SDD task **串行** — 见 §2.4、§2.5、`mstar-sdd` Continuous execution
351
356
  - **zero-residual(默认)**:单 plan QC findings 尽量在当轮清干净;仅真 blocker 才 defer 到后续迭代(须 Durable Roadmap)— 见 **`mstar-plan-artifacts`** Findings cleanup modes
357
+ - iteration 命令共享的 PM invariants / preflight / todos / STOP → **`references/command-shared-invariants.md`**
352
358
 
353
359
  ## Phase 3: iteration-close(收口迭代)
354
360
 
@@ -390,12 +396,12 @@ Iteration Phase 2 附加:
390
396
  - **不要在 Phase 5 CI 仍跑或 AI review 波次未结束时 push**(§5.1a)— 本地可提前修,push 等 idle
391
397
  - **不要为 Phase 5 另开 feature/fix worktree**,也不要把 Phase 2 control 产品编辑禁令套到 Phase 5 — 直接在集成分支 checkout 上修
392
398
  - **不要在缺 `iteration_base_branch` / `target_branch` 时默认 `main` / `master`**
393
- - **不要在 iteration-start §1.6 由 product/architect 向 `{KNOWLEDGE_DIR}/` 新增**(知识 → iteration-close **`mstar-compound`**)
399
+ - **不要在 Phase 1 §1.6 由 product/architect 向 `{KNOWLEDGE_DIR}/` 新增**(知识 → iteration-close **`mstar-compound`**)
394
400
  - **不要在 per-plan Done 后立即 compound** — 等 iteration-close 统一做
395
401
 
396
402
  ## Workflow
397
403
 
398
- Phase 1–5 总览见上文 **`## 设计思路`** 图:`iteration-start`(范围 + compass + §1.6 Review & Edit 链)→ `Autonomous Execute`(§2.4 per-plan 循环:分支 → 实现 → QC → QA gate → Done → 串行 merge)→ `iteration-close`(§3.1–§3.5 + `mstar-compound`)→ `PR delivery`(Phase 4)→ `PR merge-ready loop`(Phase 5 至 §5.5 exit)。每波用 §2.1 session todos 设护栏防范围漂移。
404
+ Phase 1–5 总览见上文 **`## 设计思路`** 图:`start`(范围 + compass + §1.6 Review & Edit 链)→ `Autonomous Execute`(§2.4 per-plan 循环:分支 → 实现 → QC → QA gate → Done → 串行 merge)→ `iteration-close`(§3.1–§3.5 + `mstar-compound`)→ `PR delivery`(Phase 4)→ `PR merge-ready loop`(Phase 5 至 §5.5 exit)。每波用 §2.1 session todos 设护栏防范围漂移。
399
405
 
400
406
  ## Evidence
401
407
 
@@ -0,0 +1,62 @@
1
+ # Iteration 命令共享 invariants + preflight
2
+
3
+ 本文件是 `commands/iteration-*.md`(`iteration-start` / `iteration-drive` / `iteration-loop`)**重叠内容**的单一共享副本(SSOT)。**只收录出现在 ≥2 个命令中的行**;命令专属内容保留在命令正文,**不**复制进本文件:
4
+
5
+ - `iteration-start` Phase 1 review-chain 表(§5.1→§5.2→§5.3 顺序 invoke、三角色冒充禁止、`{KNOWLEDGE_DIR}/` 新增禁止)— start 专属
6
+ - `iteration-loop`「Do not Read `skills/grill-me/SKILL.md`」— loop 专属
7
+ - `iteration-loop` session todo `phase-1-autonomous-start`(Boot → compass `locked` + integration committed)— loop 专属
8
+
9
+ 命令正文经一行指针引用本文件,不重复定义以下 invariants / preflight / todos / STOP。
10
+
11
+ ## PM invariants(重叠行)
12
+
13
+ Phase 2–5 全程有效(drive + loop 共有的行):
14
+
15
+ | 禁止(PM 线程) | 必须 |
16
+ |-----------------|------|
17
+ | Write/Edit/Shell 产品代码、写测试、跑 QC(Phase 2) | 每条 implement/QC/QA Assignment ⇒ **1 次 `Task`** |
18
+ | **多 task plan 用 inline 大包派发**(整份 plan / T1–Tn 贴进一个 dev Assignment) | **SDD**:`mstar-sdd` per-task 循环 — `mstar sdd task-brief` → implementer → `mstar sdd review-package` → task reviewer → `progress.md` |
19
+ | 只写 Assignment 就进入下一 gate | 同轮 dispatch:每条 Assignment ⇒ **1 次 invoke**(`Subagent invokes issued: N`,N = Assignment 条数) |
20
+ | 最后一个 plan `Done` 后直接开 PR / 汇报结束 | **Phase 3 → 4 → 5** 顺序执行 |
21
+ | Phase 5 自己改产品代码 | 需改产品代码时 **dispatch** `fullstack-dev` / `ops-engineer` |
22
+
23
+ 派发细则 → **`mstar-dispatch-gates`** + **`mstar-host`**。Phase 3 细则 → **`mstar-iteration` §3** + **`mstar-compound`**。
24
+
25
+ ## Assignment preflight(bash 块 — byte-identical 共享副本)
26
+
27
+ `mstar-harness` bin 未安装时静默跳过;在每次 implement/QC/QA 派发前(**SDD** 下为最新 `{SDD_DIR}/task-N-brief.md` 或临时写盘的 Assignment)校验。模式由迭代 compass frontmatter 的 `enforcement` 键决定(Slice 5):
28
+
29
+ - **默认(compass 无 `enforcement: hard`)— 可选 warn-only**:exit 1 仅提示,不阻断派发(Slice 3 行为不变):
30
+
31
+ ```bash
32
+ command -v mstar-harness >/dev/null 2>&1 && mstar-harness dispatch validate "<latest-assignment-file>"
33
+ ```
34
+
35
+ - **`enforcement: hard`(迭代 compass frontmatter 声明)— fail-fast**:校验失败即 `exit 1` 阻断派发(bin 缺失仍静默跳过):
36
+
37
+ ```bash
38
+ if command -v mstar-harness >/dev/null 2>&1; then mstar-harness dispatch validate "<latest-assignment-file>" || exit 1; fi
39
+ ```
40
+
41
+ > 路径必须加引号且替换为具体文件(如最新 `{SDD_DIR}/task-N-brief.md`,勿留尖括号)——agent 代入的路径不得进入 shell 无引号展开。
42
+
43
+ ## Session todos(重叠行;drive + loop 共有)
44
+
45
+ | Todo id | 何时追加 | 何时可勾掉 |
46
+ |---------|----------|------------|
47
+ | plan-wave todos | 进入 Phase 2 | 各 plan `Done` |
48
+ | `phase-3-iteration-close` | 仅剩 1 个非 `Done` plan | Phase 3 §3.5 exit 全 `[x]` |
49
+ | `phase-4-create-pr` | Phase 3 完成后 | PR 已创建并记录 URL/number |
50
+ | `phase-5-pr-merge-ready` | Phase 4 完成后 | Phase 5 §5.5 exit 全 `[x]` |
51
+
52
+ ## Continuous execution STOP list(重叠行;start / drive / loop 共有)
53
+
54
+ Execute **`mstar-iteration` §2.6**(Continuous execution SSOT:自 Phase 2 进入至 Phase 5 §5.5 exit 前 PM **连续编排**,进度汇报后下一条必须是 dispatch 或下一 phase 步骤,不向用户例行 yes/no check-in)。
55
+
56
+ **合法 STOP(仅此升级用户)**:
57
+
58
+ - 迭代 branch metadata 缺失(`iteration_base_branch` / `target_branch`)
59
+ - **`Blocked`**:真冲突、secrets、不可逆范围缺口、Phase 5 多轮仍无法 merge-ready
60
+ - 用户本轮显式打断
61
+
62
+ **Turn 收束纪律**:最后一条 assistant 内容必须是 **in-flight 动作**(invoke 已发出、或写明下一 dispatch 的 Assignment 字段),**不得**以对用户的确认问句收束 turn。
@@ -9,8 +9,8 @@ full protocol here.
9
9
 
10
10
  ## When it applies
11
11
 
12
- **Iteration commands only** (`iteration-start` ends before this; `iteration-drive`
13
- / `iteration-loop` Phase 2+). Defaults are **hard** unless the current turn
12
+ **Phase 2+ command-layer only**(`iteration-start` ends before this; `iteration-drive`
13
+ / `iteration-loop` are Phase 2+ command layer). Defaults are **hard** unless the current turn
14
14
  explicitly waives via Assignment `Worktree mode: waived` (or equivalent user
15
15
  instruction). `Plan parallelism: serial` is **not** a waiver — it only forces
16
16
  serial cross-plan **implement** scheduling while control worktree + leases remain
@@ -79,7 +79,7 @@ Immediately before **any** writable implement dispatch, re-read the control
79
79
  snapshot and re-verify `execution_lease` holder + paths match this session;
80
80
  mismatch → **STOP**.
81
81
 
82
- > **Engine check (when available):** run `mstar lease verify --workflow <id> [--plan <plan-id>]` or `mstar lease verify-integration --workflow <id>` (or import `validateExecutionLease` / `validateIntegrationMergeLease` from `@mstar-harness/engine` in a host hook) to validate the leases on the control copy of the workflow snapshot. On `fail` -> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
82
+ > **Lease Engine-check:** canonical callout lives in `mstar-plan-artifacts` `SKILL.md`(Engine-check lease 行)— this file carries the execution checklist only.
83
83
 
84
84
  ## Feature worktree (per plan)
85
85
 
@@ -70,7 +70,7 @@ History rewrite / force-with-lease / 改写后证据失效规则 SSOT → `mstar
70
70
  | 2 | `greploop` | **Optional** — only when the **repo** uses Greptile / has `greploop` available; then run for Greptile **5/5** in addition to babysit/`*-babysit` (or fallback) gates |
71
71
  | 3 | neither | Command fallback = babysit-equivalent CI + reviews gates |
72
72
 
73
- When both babysit/`*-babysit` and greploop apply: **babysit/`*-babysit` first**(CI + reviews),then optional greploop for Greptile score. Discovery paths → host `commands/iteration-drive` / `iteration-loop` Phase 5.
73
+ When both babysit/`*-babysit` and greploop apply: **babysit/`*-babysit` first**(CI + reviews),then optional greploop for Greptile score. Discovery paths → `mstar-iteration` §5 (iteration command layer).
74
74
 
75
75
  ### 5.2 Phase 5 exit checklist(迭代交付完成)
76
76
 
@@ -1,6 +1,6 @@
1
1
  # Phase 5 helper skill discovery(babysit / greploop)
2
2
 
3
- > Loaded by host `commands/iteration-drive` / `iteration-loop`(Phase 5 §5.0)before the first merge-ready loop pass. Search for optional **non-`mstar-*`** helper skills;first readable `SKILL.md` wins per name. Does **not** enter `mstar-*` load order.
3
+ > Loaded by `mstar-iteration` §5 (iteration command layer) before the first merge-ready loop pass. Search for optional **non-`mstar-*`** helper skills;first readable `SKILL.md` wins per name. Does **not** enter `mstar-*` load order.
4
4
 
5
5
  ## Search paths(示例,按宿主扩展)
6
6
 
@@ -52,7 +52,7 @@ description: "Morning Star Spec-Driven 双阶段门禁:Prepare(`specify →
52
52
  - **Plan 质量门**(新 plan / 大改):无 placeholder(`...`、`TBD`、`etc.`);含 **Global Constraints** 与 per-task **Interfaces**;PM self-review 三问(每 task 可独立验证?依赖顺序清晰?无隐含假设?)— 见 `mstar-plan-artifacts/templates/plan.main.md` + **`mstar-plan-artifacts/references/plan-quality-bar.md`**(自包含/验证门/STOP 条件/drift check/done criteria)。
53
53
  - **`implement`**
54
54
  - 最小产物:实现 diff、自检证据、回报与 handoff;行为准则 → **`mstar-coding-behavior`**;编辑纪律 → 上文「可验证编辑与上下文纪律」。
55
- - **知识库 / 迭代 compass**:若 `plans[].metadata` 登记了 `primary_spec` / `spec_refs` / `iteration_compass` / `iteration_refs`,**开工前**须阅读并在回报中说明已对齐 → **`mstar-plan-conventions`** · **`mstar-plan-artifacts/references/knowledge-and-designs.md`**。
55
+ - **知识库 / 迭代 compass**:**默认**开工前扫 `{KNOWLEDGE_DIR}/README.md` 索引(若存在)并阅读与当轮相关的 **Active** 行(**即使 metadata 无 knowledge 链接**);若 `plans[].metadata` 登记了 `primary_spec` / `spec_refs` / `iteration_compass` / `iteration_refs`,所链接文档**仍须**阅读;两类阅读均须在回报中说明已对齐 → **`mstar-plan-conventions`** · **`mstar-plan-artifacts/references/knowledge-and-designs.md`**。
56
56
 
57
57
  ## 角色职责
58
58
 
@@ -61,7 +61,7 @@
61
61
  ## 与 `status.json` 的链接
62
62
 
63
63
  - 某 plan 的**权威设计输入**在规格、迭代 compass 或(已有)知识库中时,在 `**plans[].metadata**` 中登记路径:`**primary_spec**` / `**spec_refs**` → 优先 **`{SPECS_DIR}/`**;`**iteration_compass**` / `**iteration_refs**` → **`{ITERATION_DIR}/`**;已有 **`{KNOWLEDGE_DIR}/`** 链接保留,但 **iteration-start 不得新增** knowledge 路径。
64
- - 执行方在 **implement 前**须按 metadata 读取这些文件,并与主 plan 核对;不得在未读链接文档的情况下**静默偏离**其中已写明的决策(若需偏离,先回写 knowledge 或 plan 并走 PM/architect 门禁)。
64
+ - 执行方在 **implement 前**:先扫 `{KNOWLEDGE_DIR}/README.md` 索引(若存在),发现并阅读与当轮相关的 **Active** 行(发现式阅读,不要求通读全库);再按 metadata 读取已登记路径;均与主 plan 核对;不得在未读链接文档的情况下**静默偏离**其中已写明的决策(若需偏离,先回写 knowledge 或 plan 并走 PM/architect 门禁)。
65
65
 
66
66
  ## 维护规则
67
67
 
@@ -69,7 +69,7 @@
69
69
  - **Specs(长期)**:`{SPECS_DIR}/` → spec 索引(若有)→ `plans[].metadata` 的 `primary_spec` / `spec_refs`
70
70
  - **迭代 package**:`{ITERATION_DIR}/<iteration-id>/guides|specs/` → `{ITERATION_DIR}/README.md`(目录一行)+ package README → `iteration_refs`
71
71
  - **Knowledge**:**`mstar-compound`** @ iteration-close(含 package **提升**)→ `{KNOWLEDGE_DIR}/README.md`
72
- 2. **阅读**:开发类 agent 在开始编码前,**必须**阅读当前 plan 在 `metadata` 中指向的 knowledge 文档(若存在);`@project-manager` 在 Assignment 中可再次点名路径。
72
+ 2. **阅读**:开发类 agent 在开始编码前,**先扫** `{KNOWLEDGE_DIR}/README.md` 索引(若存在),发现并阅读与当轮相关的 **Active** 行(不要求通读全库);随后**必须**阅读当前 plan 在 `metadata` 中指向的 knowledge 文档(若存在);`@project-manager` 在 Assignment 中可再次点名路径。
73
73
  3. **修订**:评审或规格变更若改动了 knowledge 文件,同步更新 README 中 **Status** 或 Description;版本迭代优先新文件名 `v<N+1>` 或保留旧版并标明 Superseded。
74
74
  4. **归档**:
75
75
  - **iteration-start(强制)**:`writing-specialist` §1.6 以 **`{SPECS_DIR}/` 全库卫生为主**;对**既有** `{KNOWLEDGE_DIR}/` 仅归档/错放纠正,**不**新增 knowledge。细则 → **`mstar-iteration/references/iteration-corpus-hygiene.md`**。