@mstar-harness/opencode 2.4.1 → 3.0.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 +30 -0
- package/README.md +1 -1
- package/dist/mstar.js +4532 -227
- package/harness-agents/code-reviewer.md +0 -8
- package/harness-skills/mstar-branch-worktree/SKILL.md +14 -14
- package/harness-skills/mstar-branch-worktree/references/parallel-writable-pre-dispatch.md +2 -2
- package/harness-skills/mstar-compound/SKILL.md +2 -2
- package/harness-skills/mstar-compound/references/compound-workflow.md +3 -3
- package/harness-skills/mstar-compound-refresh/SKILL.md +4 -4
- package/harness-skills/mstar-compound-refresh/references/project-knowledge-bootstrap.md +1 -1
- package/harness-skills/mstar-dispatch-gates/SKILL.md +2 -2
- package/harness-skills/mstar-engine-legacy/SKILL.md +53 -0
- package/harness-skills/mstar-engine-legacy/references/anti-recursion-checklists.md +58 -0
- package/harness-skills/mstar-engine-legacy/references/engine-check-boilerplate.md +26 -0
- package/harness-skills/mstar-engine-legacy/references/lease-protocol.md +92 -0
- package/harness-skills/mstar-engine-legacy/references/qc-seat-n-restatements.md +57 -0
- package/harness-skills/mstar-engine-legacy/references/status-field-history.md +186 -0
- package/harness-skills/mstar-harness-core/SKILL.md +6 -3
- package/harness-skills/mstar-host/references/_shared/plan-mode-bridge-core.md +8 -8
- package/harness-skills/mstar-host/references/codex.md +1 -1
- package/harness-skills/mstar-host/references/cursor-plan-mode-bridge.md +19 -8
- package/harness-skills/mstar-host/references/cursor.md +5 -5
- package/harness-skills/mstar-host/references/dsh.md +10 -7
- package/harness-skills/mstar-host/references/kimi-plan-mode-bridge.md +3 -3
- package/harness-skills/mstar-host/references/kimi.md +1 -1
- package/harness-skills/mstar-host/references/omp-plan-mode-bridge.md +2 -2
- package/harness-skills/mstar-host/references/omp.md +2 -2
- package/harness-skills/mstar-host/references/zcode-plan-mode-bridge.md +3 -3
- package/harness-skills/mstar-host/references/zcode.md +1 -1
- package/harness-skills/mstar-iteration/SKILL.md +38 -37
- package/harness-skills/mstar-iteration/references/autonomous-direction-lock.md +2 -2
- package/harness-skills/mstar-iteration/references/iteration-compass-template.md +3 -3
- package/harness-skills/mstar-iteration/references/phase-2-worktree-lease.md +50 -38
- package/harness-skills/mstar-iteration/references/phase-3-iteration-close.md +7 -7
- package/harness-skills/mstar-iteration/references/phase-4-5-pr-delivery.md +2 -2
- package/harness-skills/mstar-phase-gates/SKILL.md +3 -3
- package/harness-skills/mstar-plan-artifacts/SKILL.md +21 -23
- package/harness-skills/mstar-plan-artifacts/references/knowledge-and-designs.md +6 -6
- package/harness-skills/mstar-plan-artifacts/references/plan-files-and-reports.md +10 -10
- package/harness-skills/mstar-plan-artifacts/references/status-and-residuals.md +190 -309
- package/harness-skills/mstar-plan-artifacts/templates/README.md +1 -3
- package/harness-skills/mstar-plan-artifacts/templates/status.empty.json +2 -4
- package/harness-skills/mstar-plan-conventions/SKILL.md +53 -13
- package/harness-skills/mstar-plan-conventions/references/artifact-storage-paths.md +6 -3
- package/harness-skills/mstar-plan-conventions/references/harness-bootstrap-and-agents-layering.md +9 -10
- package/harness-skills/mstar-project-governance/SKILL.md +118 -0
- package/harness-skills/mstar-review-qc/SKILL.md +3 -3
- package/harness-skills/mstar-roles/references/project-manager/dispatch-and-assignment.md +1 -1
- package/harness-skills/mstar-roles/references/project-manager/plan-management.md +6 -8
- package/harness-skills/mstar-roles/references/project-manager/qc-and-residuals.md +6 -6
- package/harness-skills/mstar-roles/references/project-manager.md +7 -7
- package/harness-skills/mstar-roles/references/qc-specialist/deep-review-lenses.md +1 -1
- package/harness-skills/mstar-roles/references/qc-specialist/report-template.md +1 -1
- package/harness-skills/mstar-roles/references/qc-specialist/reviewer-workflow.md +1 -1
- package/harness-skills/mstar-roles/references/qc-specialist-shared.md +2 -2
- package/harness-skills/mstar-sdd/SKILL.md +2 -2
- package/harness-skills/mstar-sdd/references/file-handoffs.md +1 -1
- package/package.json +1 -1
- package/harness-skills/mstar-plan-artifacts/references/done-compaction.md +0 -88
- package/harness-skills/mstar-plan-artifacts/templates/notes.empty.json +0 -5
- package/harness-skills/mstar-plan-artifacts/templates/plans-done.empty.json +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mstar-iteration
|
|
3
|
-
description: Morning Star 迭代管理 —— Phase 1(默认 interactive direction lock;opt-in autonomous;specs + `<iteration-id>/` package;禁止直写 knowledge)、Autonomous Execute、iteration-close(compound 提升 package → knowledge)、PR 交付、PR merge-ready loop。分支 SSOT
|
|
3
|
+
description: Morning Star 迭代管理 —— Phase 1(默认 interactive direction lock;opt-in autonomous;specs + `<iteration-id>/` package;禁止直写 knowledge)、Autonomous Execute、iteration-close(compound 提升 package → knowledge)、PR 交付、PR merge-ready loop。分支 SSOT:workflow snapshot(`workflows/<id>/snapshot.json`)+ compass frontmatter。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# mstar-iteration(迭代管理)
|
|
@@ -33,25 +33,25 @@ Phase 5: PR merge-ready loop —— 至 mergeable + CI 全绿 + reviews resolved
|
|
|
33
33
|
|
|
34
34
|
- **Phase 3** 在 integration 分支收口 compound / roadmap;**开 PR(Phase 4)≠ 迭代交付完成**。
|
|
35
35
|
- **Phase 5** 是 **merge-ready loop**:修复 →(等 CI/review 波次结束再)push → 再验证,直至 §5.5 exit。**Loop 理念与 push cadence SSOT 在本 skill**(§5.1a);宿主 command 可叠加额外 **non-`mstar-*`** helper(**优先** `babysit` / `*-babysit`;**`greploop` 可选** — 仅当仓库具备 Greptile/`greploop` 时采用),但不写入 `mstar-*` load order。
|
|
36
|
-
- 一次迭代 = 一个 PR;compound 产物随 PR 合入 `
|
|
36
|
+
- 一次迭代 = 一个 PR;compound 产物随 PR 合入 snapshot `branch.target`。
|
|
37
37
|
|
|
38
38
|
## Phase transition gates(HARD — 防跳步)
|
|
39
39
|
|
|
40
40
|
| 边界 | 触发 | 必须 | 禁止 |
|
|
41
41
|
|------|------|------|------|
|
|
42
|
-
| **→ Phase 3** |
|
|
43
|
-
| **→ Phase 4** | §3.5 exit checklist 全 `[x]`;frontmatter `status: completed` + `end_date` | 打印 `## Phase 4: PR delivery`;开 PR 到 `
|
|
42
|
+
| **→ Phase 3** | workflow snapshot(`workflows/<id>/snapshot.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 到 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
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 |
|
|
47
47
|
|
|
48
|
-
> **Engine check (when available):** run `mstar iteration gate --
|
|
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
|
|
|
50
50
|
**误判信号**:对话里出现 compound 摘要、roadmap 更新、或「所有 plan 已完成」但 **未** 打印 §3.1 / §3.5 checklist → 视为 **Phase 3 未执行**,回到 §3.0。
|
|
51
51
|
|
|
52
|
-
**per-plan 状态 SSOT**:`{
|
|
52
|
+
**per-plan 状态 SSOT**:`{WORKFLOW_DIR}/<id>/snapshot.json` 的 `plans[]` 行(per-plan Todo/InProgress/InReview/Done);根 `{HARNESS_DIR}/status.json` `workflows[]` 登记活跃 lifecycle。
|
|
53
53
|
**迭代状态 SSOT**:`{ITERATION_DIR}/<id>/delivery-compass.md` frontmatter `status` + `{ITERATION_DIR}/README.md` 索引(一行 = 一次迭代)。
|
|
54
|
-
**迭代分支 SSOT**:
|
|
54
|
+
**迭代分支 SSOT**:snapshot `branch.base`(= `iteration_base_branch`)+ `branch.target`(= `target_branch`)与 `branch.integration`(= `spec_integration_branch`)(`workflows/<id>/snapshot.json`);compass frontmatter 镜像同名字段。解析顺序见 §2.3。**禁止**因仓库存在 `main`/`master` 就假定 base 或 PR 目标。
|
|
55
55
|
|
|
56
56
|
## 产物存储位置
|
|
57
57
|
|
|
@@ -170,15 +170,15 @@ plans: []
|
|
|
170
170
|
|
|
171
171
|
> **Engine check (when available):** import `assertIndexRowObligations` from `@mstar-harness/engine` in a host hook to assert the index-row obligations above (no CLI form yet). On `fail` -> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
|
|
172
172
|
|
|
173
|
-
### 1.5 登记到
|
|
173
|
+
### 1.5 登记到 v2 状态面(formal iteration 必填)
|
|
174
174
|
|
|
175
|
-
iteration
|
|
175
|
+
iteration 正式全流程**必须**登记 `{HARNESS_DIR}/status.json`(v2 根)+ `{WORKFLOW_DIR}/<id>/snapshot.json`:
|
|
176
176
|
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
- 各 plan `metadata.iteration_refs`、`spec_integration_branch`、`merge_target`(`merge_target` 通常为 `spec_integration_branch
|
|
177
|
+
- 根 `status.json` `workflows[]` 增一条 active entry:`{ "id": "<iteration-id>", "type": "iteration", "started_at", "dir": "workflows/<iteration-id>" }`(engine `registerWorkflow`)。
|
|
178
|
+
- snapshot 顶层 `branch` anchors:`base`(= `iteration_base_branch`,创建 `spec_integration_branch` 的祖先 ref——**不是**隐式 `main`)、`integration`(= `spec_integration_branch`)、`target`(= iteration-close 后 PR 的目标分支)。
|
|
179
|
+
- 各 plan 行 `metadata.iteration_refs`、`spec_integration_branch`、`merge_target`(`merge_target` 通常为 `spec_integration_branch`)。
|
|
180
180
|
|
|
181
|
-
compass frontmatter 的 `iteration_base_branch` / `target_branch` **必须与** `
|
|
181
|
+
compass frontmatter 的 `iteration_base_branch` / `target_branch` **必须与** snapshot `branch` 一致;若仅写在 compass 而 snapshot 缺失,§2.3 同轮 backfill。
|
|
182
182
|
|
|
183
183
|
### 1.5.5 产物边界(specs · iterations · knowledge)
|
|
184
184
|
|
|
@@ -220,13 +220,13 @@ Phase 1 与 §1.6 须遵守 **`references/iteration-artifact-boundaries.md`**(
|
|
|
220
220
|
|
|
221
221
|
进入 Autonomous Execute 前必须满足:
|
|
222
222
|
|
|
223
|
-
1.
|
|
223
|
+
1. workflow snapshot(`{WORKFLOW_DIR}/<id>/snapshot.json`)中至少一条 plan `status` ≠ `Done`;根 `status.json` `workflows[]` 含该 iteration entry
|
|
224
224
|
2. **Pre-implement gate = GO**:plan 已 locked、tasks ready(见 `mstar-phase-gates`)
|
|
225
225
|
3. 用户意图为 **continue Autonomous Execute**(推进迭代 Execute、继续 per-plan 循环等)
|
|
226
|
-
4. **Branch metadata gate**:
|
|
227
|
-
5. **Control-worktree + lease defaults**(iteration 命令;可被 `Worktree mode: waived` 豁免):除非本轮 Assignment 显式 `Worktree mode: waived`(或等价用户指令),Phase 2 **必须**在入口建立 control worktree、经 control 路径读写默认 gitignored 的 harness
|
|
226
|
+
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
|
+
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
228
|
|
|
229
|
-
> **Engine check (when available):** run `mstar lease verify <plan-id
|
|
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.
|
|
230
230
|
|
|
231
231
|
任一 false → **stop**。Phase 1 / Prepare 未完成 → 先完成 Phase 1 或 per-plan Prepare,再进入本 Phase。
|
|
232
232
|
|
|
@@ -240,21 +240,21 @@ Phase 1 与 §1.6 须遵守 **`references/iteration-artifact-boundaries.md`**(
|
|
|
240
240
|
| **Codex** | `update_plan` / Goal UI | 同上 |
|
|
241
241
|
| **OpenCode** | host todo/plan UI(如有) | 同上 |
|
|
242
242
|
|
|
243
|
-
SSOT = `{
|
|
243
|
+
SSOT = `{WORKFLOW_DIR}/<id>/snapshot.json` + `{PLAN_DIR}/`。todos 只追踪本轮下一步。
|
|
244
244
|
|
|
245
245
|
### 2.2 Read backlog
|
|
246
246
|
|
|
247
|
-
1. 读 `mstar-plan-artifacts` +
|
|
248
|
-
2. 列出 `status` ∈ `{Todo, InProgress, InReview, Blocked}` 的 plan(优先级:`InProgress` → `InReview` → `Todo` → unblock `Blocked`)
|
|
249
|
-
3. 读
|
|
247
|
+
1. 读 `mstar-plan-artifacts` + workflow snapshot(`{WORKFLOW_DIR}/<id>/snapshot.json`)与根 `status.json`
|
|
248
|
+
2. 列出 snapshot 中 `status` ∈ `{Todo, InProgress, InReview, Blocked}` 的 plan(优先级:`InProgress` → `InReview` → `Todo` → unblock `Blocked`)
|
|
249
|
+
3. 读 snapshot `branch.base` / `branch.target`,以及 plan `metadata.spec_integration_branch` / `merge_target` / `primary_spec` 链接
|
|
250
250
|
|
|
251
251
|
### 2.3 Integration branch + control worktree(Phase 2 入口)
|
|
252
252
|
|
|
253
|
-
**
|
|
253
|
+
**Branch anchors 解析顺序**(任一环节缺失则 STOP,**禁止**默认 `main`/`master`):
|
|
254
254
|
|
|
255
|
-
1.
|
|
255
|
+
1. workflow snapshot → `branch.base`(`iteration_base_branch`)、`branch.target`(`target_branch`)、`branch.integration`(`spec_integration_branch`);plan 行 → `metadata.spec_integration_branch`
|
|
256
256
|
2. 若 (1) 缺字段 → 读当前迭代 compass frontmatter 同名键:优先 `{ITERATION_DIR}/<iteration-id>/delivery-compass.md`;若无则 legacy `{ITERATION_DIR}/<iteration-id>-delivery-compass.md`
|
|
257
|
-
3. 若 compass 有值而
|
|
257
|
+
3. 若 compass 有值而 snapshot 无 → **同轮 backfill** snapshot `branch`
|
|
258
258
|
4. 仍缺 → 向用户确认 base / PR target;**不得**因 `git symbolic-ref refs/remotes/origin/HEAD` 指向 `main` 就自动采用
|
|
259
259
|
5. 所有参与本轮迭代的 active plan **必须**解析到**同一** `spec_integration_branch`;不一致 → **STOP**
|
|
260
260
|
|
|
@@ -262,13 +262,14 @@ SSOT = `{HARNESS_DIR}/status.json` + `{PLAN_DIR}/`。todos 只追踪本轮下一
|
|
|
262
262
|
|
|
263
263
|
1. 解析或创建 **control worktree**(通常 primary checkout 或 PM 指定路径),检出到上一步的 `spec_integration_branch`
|
|
264
264
|
2. `git fetch`(按需);`git branch --show-current` 确认在 `spec_integration_branch`
|
|
265
|
-
3. 将规范绝对仓库根路径写入 control 副本 `
|
|
265
|
+
3. 将规范绝对仓库根路径写入 control 副本 snapshot 顶层 `control_worktree_path`(仓库根,非 `{HARNESS_DIR}` 子路径)
|
|
266
266
|
4. 此后 **harness 进程产物 SSOT**(默认 gitignored)均经 control 绝对路径解析:
|
|
267
|
-
- `<control_worktree_path>/{HARNESS_DIR}/status.json
|
|
267
|
+
- `<control_worktree_path>/{HARNESS_DIR}/status.json`(v2 根 register)
|
|
268
|
+
- `<control_worktree_path>/{WORKFLOW_DIR}/<id>/snapshot.json`(per-lifecycle 运行态 + leases)
|
|
269
|
+
- `<control_worktree_path>/{PROJECT_DIR}/<id>/`(roadmap.md + residuals.json)
|
|
268
270
|
- `<control_worktree_path>/{PLAN_DIR}/`(主 plan)
|
|
269
271
|
- `<control_worktree_path>/{ITERATION_DIR}/`(compass / iteration package)
|
|
270
272
|
- `<control_worktree_path>/{HARNESS_DIR}/sdd/<plan-id>/`
|
|
271
|
-
- 同树:`notes.json`、`archived/`(若使用)
|
|
272
273
|
Feature worktree 只承载产品/源码编辑;其同名 `{HARNESS_DIR}` **不是** SSOT。Assignment **`Plan Path`** / **`SDD dir`** 须写 control 绝对路径。
|
|
273
274
|
5. 若 integration 分支尚不存在:在 control worktree 内 `git checkout -b <spec_integration_branch> <iteration_base_branch>`(**必须**从记录的 base 创建)
|
|
274
275
|
|
|
@@ -278,22 +279,22 @@ SSOT = `{HARNESS_DIR}/status.json` + `{PLAN_DIR}/`。todos 只追踪本轮下一
|
|
|
278
279
|
2. **checkout 或创建** `spec_integration_branch`(同上)
|
|
279
280
|
3. `git branch --show-current` 确认在 `spec_integration_branch`
|
|
280
281
|
|
|
281
|
-
`spec_integration_branch` 是本迭代内所有 plan feature branch 的 merge target。QC **`Review range` / `Diff basis`** 的 merge-base 参照优先用 `
|
|
282
|
+
`spec_integration_branch` 是本迭代内所有 plan feature branch 的 merge target。QC **`Review range` / `Diff basis`** 的 merge-base 参照优先用 snapshot `branch.target`(或 PM 书面指定的 base ref),**禁止**无 Assignment 依据写死 `origin/main`。
|
|
282
283
|
|
|
283
284
|
### 2.4 Per-plan loop(直到全部 Done)
|
|
284
285
|
|
|
285
|
-
**跨 plan 默认**(**无论** `Worktree mode: waived`):**不同 `plan_id` 可并行 implement** 须满足 §2.0 #5 跨 plan 并行安全闸——(a) coordination 路径 same-host 独占写锁可用且每次 status/协调变更持锁,或 (b) **`Plan parallelism: serial`**(waived 时默认),或 (c) 用户本轮 `Cross-host lease race: accepted` + audit `notes`;否则 Assignment 仍写并行 → **Blocked**。**merge 入 `spec_integration_branch`
|
|
286
|
+
**跨 plan 默认**(**无论** `Worktree mode: waived`):**不同 `plan_id` 可并行 implement** 须满足 §2.0 #5 跨 plan 并行安全闸——(a) coordination 路径 same-host 独占写锁可用且每次 status/协调变更持锁,或 (b) **`Plan parallelism: serial`**(waived 时默认),或 (c) 用户本轮 `Cross-host lease race: accepted` + audit `notes`;否则 Assignment 仍写并行 → **Blocked**。**merge 入 `spec_integration_branch` 仍串行**(snapshot 顶层 `integration_merge_lease`;waived 时无 merge lease 仍须串行 merge)。未 waive 时 **禁止**无 verified `execution_lease` 的跨 plan 可写派发。
|
|
286
287
|
|
|
287
288
|
对每个本轮要推进的 active `plan_id`(可交错/并行,非强制 plan A 全 Done 再 plan B):
|
|
288
289
|
|
|
289
290
|
1. **Claim / resume — execution lease**(§2.0 #5 未 waive):
|
|
290
|
-
- 自 control 路径 **重读**
|
|
291
|
+
- 自 control 路径 **重读** workflow snapshot(`{WORKFLOW_DIR}/<id>/snapshot.json`)定位 plan 行
|
|
291
292
|
- 若已有 `execution_lease` 且 `holder` **等于本 session** → **resume**:校验 `worktree_path` / `working_branch` 与 Assignment 一致后继续(**不是** steal / Blocked)
|
|
292
293
|
- 若 `execution_lease` 存在且 `holder` **不同** → **Blocked**
|
|
293
294
|
- 若 `status: InProgress` 但 **无** `execution_lease` → **STOP** 升级(孤儿状态恢复 → **`mstar-plan-artifacts`**;本 skill 不自行补 lease)
|
|
294
295
|
- 否则按 **`references/phase-2-worktree-lease.md`** claim:`Todo`/`Blocked` → `InProgress` + 写入完整 `execution_lease`;verify 通过前 **禁止**可写派发
|
|
295
296
|
2. **Plan start — feature worktree + branch**:创建/校验 dedicated feature worktree;Assignment 须含绝对 `Worktree path` + `Working branch`(与 lease 一致)。plan 内多可写并行轨 → **`mstar-branch-worktree`** **`references/parallel-writable-pre-dispatch.md`**
|
|
296
|
-
3. **Implement → InReview**(`§ 2.5`;产品编辑在 feature worktree;plans /
|
|
297
|
+
3. **Implement → InReview**(`§ 2.5`;产品编辑在 feature worktree;plans / snapshot / iterations / SDD 经 control 绝对路径):
|
|
297
298
|
- **默认 `Execution mode: sdd`**(多 task plan;hotfix 可 `inline`)。
|
|
298
299
|
- PM 载入 **`mstar-sdd`** 后,按 plan task 顺序 **串行** per-task 循环(**不是**一次派发 dev 做全部 tasks):
|
|
299
300
|
1. `mstar sdd workspace <plan-id>` → `{SDD_DIR}`
|
|
@@ -301,11 +302,11 @@ SSOT = `{HARNESS_DIR}/status.json` + `{PLAN_DIR}/`。todos 只追踪本轮下一
|
|
|
301
302
|
3. Dispatch **one** implementer subagent(`references/implementer-prompt.md`:brief 路径 + report 路径 + `Model tier`;**禁止**贴整份 plan)
|
|
302
303
|
4. Implementer `DONE` → `mstar sdd review-package BASE HEAD` → task diff 文件
|
|
303
304
|
5. Dispatch **one** task reviewer subagent(brief + report + diff + Global Constraints)
|
|
304
|
-
6. Fix loop 直至 review clean;append `{SDD_DIR}/progress.md`;更新
|
|
305
|
+
6. Fix loop 直至 review clean;append `{SDD_DIR}/progress.md`;更新 snapshot plan 行 / plan checkbox
|
|
305
306
|
7. Next task
|
|
306
|
-
- 每次 Completion Report 后更新
|
|
307
|
-
4. **QC → QA gate**(plan 保持 **`InReview`**;**保留** `execution_lease`):per-plan 审查链 → **`mstar-sdd`**(L1–L2)+ **`mstar-review-qc/references/review-responsibility-boundaries.md`**(L3 tri / inline 单席;raw reports in `{SDD_DIR}/review/`,durable summary in main plan/
|
|
308
|
-
5. **Plan complete — serial merge back**(§2.0 #5 未 waive):自 **control worktree** claim/resume `
|
|
307
|
+
- 每次 Completion Report 后更新 snapshot(`workflows/<id>/snapshot.json`)+ 主 plan
|
|
308
|
+
4. **QC → QA gate**(plan 保持 **`InReview`**;**保留** `execution_lease`):per-plan 审查链 → **`mstar-sdd`**(L1–L2)+ **`mstar-review-qc/references/review-responsibility-boundaries.md`**(L3 tri / inline 单席;raw reports in `{SDD_DIR}/review/`,durable summary in main plan/snapshot)+ **`QA gate`**(`mandatory` → `qa-engineer`;`pm-acceptance` → PM checklist)。**禁止**在 integration merge 成功前设 `Done` 或删除 `execution_lease`。
|
|
309
|
+
5. **Plan complete — serial merge back**(§2.0 #5 未 waive):自 **control worktree** claim/resume snapshot 顶层 `integration_merge_lease` → 将 plan feature branch 合并入 `spec_integration_branch`(仅 merge-lease holder;细则 → **`references/phase-2-worktree-lease.md`**)→ 记录 merge commit 证据 → 释放 merge lease;**同轮**设 `Done` 并删除 `execution_lease`。merge 失败:保持 `InReview` + 保留 lease,不得标 `Done`。
|
|
309
310
|
6. **Cross-plan 进度同步**:更新 `{ITERATION_DIR}/<iteration-id>/delivery-compass.md` 的 `## Plans` 表状态列
|
|
310
311
|
7. **Next plan / parallel wave** 从步骤 1 继续(可并行推进其他已 claim 的 plan;merge 仍排队串行)
|
|
311
312
|
|
|
@@ -344,14 +345,14 @@ Iteration Phase 2 附加:
|
|
|
344
345
|
- 不因 harness 流程问题常问「是否继续」「要不要现在启动」—— **决策、记录、dispatch**
|
|
345
346
|
- 进度汇报 / subagent Completion Report 后,下一条必须是 **dispatch 或下一 gate 动作**,不得以确认问句收束 turn
|
|
346
347
|
- 未知 → 读 `mstar-*`;仅 **`Blocked`**、secrets、不可逆范围缺口、branch metadata 缺失、或 Phase 5 多轮仍 blocked 时升级用户
|
|
347
|
-
- 实际 Git ≠ `working_branch` → **同轮**更新 plan +
|
|
348
|
+
- 实际 Git ≠ `working_branch` → **同轮**更新 plan + snapshot + `execution_lease.working_branch`(如适用)
|
|
348
349
|
- **跨 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)
|
|
349
350
|
- plan 内 SDD task **串行** — 见 §2.4、§2.5、`mstar-sdd` Continuous execution
|
|
350
351
|
- **zero-residual(默认)**:单 plan QC findings 尽量在当轮清干净;仅真 blocker 才 defer 到后续迭代(须 Durable Roadmap)— 见 **`mstar-plan-artifacts`** Findings cleanup modes
|
|
351
352
|
|
|
352
353
|
## Phase 3: iteration-close(收口迭代)
|
|
353
354
|
|
|
354
|
-
**入口**:Phase 2 全部 plan `Done` 后按 **Phase transition gates** 进入。本 Phase 在 **integration 分支**上运行;产出物 commit 到该分支,随迭代 PR 合入 `
|
|
355
|
+
**入口**:Phase 2 全部 plan `Done` 后按 **Phase transition gates** 进入。本 Phase 在 **integration 分支**上运行;产出物 commit 到该分支,随迭代 PR 合入 snapshot `branch.target`。
|
|
355
356
|
|
|
356
357
|
完整流程(§3.0 phase boundary、§3.0.5 compass 规范化、§3.1 entry checklist **HARD GATE**、§3.2 compound、§3.3 roadmap、§3.4 标记完成、§3.5 exit checklist + commit、§3.6 可选 compound-refresh)→ **`references/phase-3-iteration-close.md`**。
|
|
357
358
|
|
|
@@ -42,7 +42,7 @@ Write into compass (and plan Scope as needed):
|
|
|
42
42
|
|
|
43
43
|
### What counts toward the budget(HARD)
|
|
44
44
|
|
|
45
|
-
Count only **business delivery plans** registered in compass / `
|
|
45
|
+
Count only **business delivery plans** registered in compass / workflow snapshot (`workflows/<id>/snapshot.json`) whose primary outcome is product, feature, bugfix, user-facing docs, API/contract, or architecture work for the locked direction.
|
|
46
46
|
|
|
47
47
|
**Do not count** harness / process work as plans (and do not invent plans whose sole job is process):
|
|
48
48
|
|
|
@@ -71,7 +71,7 @@ When a free-text direction / feedback constraint is supplied by the caller:
|
|
|
71
71
|
|
|
72
72
|
Resolve `iteration_base_branch` and `target_branch` in order(first hit wins per field):
|
|
73
73
|
|
|
74
|
-
1. `{
|
|
74
|
+
1. Workflow snapshot `branch` anchors(`{WORKFLOW_DIR}/<id>/snapshot.json` → `branch.base` / `branch.target`;缺失则根 `status.json` `workflows[]` 无该 entry 时先登记)
|
|
75
75
|
2. Existing / prior iteration compass frontmatter
|
|
76
76
|
3. Current git branch **only if** it is already a documented delivery, integration, or project-policy branch(not merely “whatever HEAD is”)
|
|
77
77
|
4. Still missing → **STOP** — escalate; **never** substitute `main` / `master` because those names exist
|
|
@@ -57,7 +57,7 @@ Status values: `Todo` | `InProgress` | `InReview` | `Done` | `Blocked`
|
|
|
57
57
|
|
|
58
58
|
## Delivery Branch Policy
|
|
59
59
|
|
|
60
|
-
> Mirror of frontmatter; keep in sync with `{
|
|
60
|
+
> Mirror of frontmatter; keep in sync with workflow snapshot `{WORKFLOW_DIR}/<id>/snapshot.json` `branch` anchors.
|
|
61
61
|
|
|
62
62
|
| Field | Value |
|
|
63
63
|
|-------|-------|
|
|
@@ -83,7 +83,7 @@ Status values: `Todo` | `InProgress` | `InReview` | `Done` | `Blocked`
|
|
|
83
83
|
|
|
84
84
|
## Quality Gate Summary
|
|
85
85
|
|
|
86
|
-
> Filled at iteration-close. Human summary only; per-plan gate details stay in each main plan, and open residual SSOT stays in `{
|
|
86
|
+
> Filled at iteration-close. Human summary only; per-plan gate details stay in each main plan, and open residual SSOT stays in `{PROJECT_DIR}/<id>/residuals.json`.
|
|
87
87
|
|
|
88
88
|
| plan_id | QC decision | QA gate | Residuals | Durable summary |
|
|
89
89
|
|---------|-------------|---------|-----------|-----------------|
|
|
@@ -92,7 +92,7 @@ Status values: `Todo` | `InProgress` | `InReview` | `Done` | `Blocked`
|
|
|
92
92
|
Notes:
|
|
93
93
|
|
|
94
94
|
- Raw review bundle: `{SDD_DIR}/review/` (ephemeral; do not rely on it after Done).
|
|
95
|
-
- Open residual SSOT: `{
|
|
95
|
+
- Open residual SSOT: `{PROJECT_DIR}/<id>/residuals.json` `entries[<plan-id>]` (default `{HARNESS_DIR}/projects/<id>/`).
|
|
96
96
|
|
|
97
97
|
## Compound Round Summary
|
|
98
98
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# Phase 2 control worktree + execution lease
|
|
2
2
|
|
|
3
|
-
Normative field names
|
|
4
|
-
`mstar-plan-artifacts/references/status-and-residuals.md
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Normative field names → field SSOT
|
|
4
|
+
`mstar-plan-artifacts/references/status-and-residuals.md`; the **full lease
|
|
5
|
+
protocol prose** (single canonical copy) → `mstar-engine-legacy/references/lease-protocol.md`
|
|
6
|
+
(engine-absent fallback). This reference is the **iteration-command execution
|
|
7
|
+
checklist** — do not invent alternate lease field names; do not re-state the
|
|
8
|
+
full protocol here.
|
|
7
9
|
|
|
8
10
|
## When it applies
|
|
9
11
|
|
|
@@ -27,16 +29,17 @@ starts at **Phase 2 entry**.
|
|
|
27
29
|
PM-designated path) checked out to that `spec_integration_branch`.
|
|
28
30
|
3. Verify `git branch --show-current` equals `spec_integration_branch`; working
|
|
29
31
|
tree clean before merge operations.
|
|
30
|
-
4. Record canonical absolute repository-root path in
|
|
31
|
-
`
|
|
32
|
+
4. Record canonical absolute repository-root path in the workflow
|
|
33
|
+
snapshot top-level `control_worktree_path` (not `{HARNESS_DIR}`; canonicalize symlinks).
|
|
32
34
|
5. Resolve coordination paths from that root (default-gitignored process artifacts live on the **control filesystem**, not as Git blobs):
|
|
33
|
-
- status
|
|
35
|
+
- status register: `<control_worktree_path>/{HARNESS_DIR}/status.json` (v2 root — active workflow entries)
|
|
36
|
+
- snapshot SSOT: `<control_worktree_path>/{WORKFLOW_DIR}/<id>/snapshot.json` (plan rows + leases + branch anchors)
|
|
37
|
+
- project register: `<control_worktree_path>/{PROJECT_DIR}/<id>/residuals.json`
|
|
34
38
|
- plans SSOT: `<control_worktree_path>/{PLAN_DIR}/` (or `<control>/{HARNESS_DIR}/plans/`)
|
|
35
39
|
- iterations SSOT: `<control_worktree_path>/{ITERATION_DIR}/`
|
|
36
40
|
- SDD tree: `<control_worktree_path>/{HARNESS_DIR}/sdd/<plan-id>/`
|
|
37
|
-
- also under control harness root when used: `notes.json`, `archived/`
|
|
38
41
|
|
|
39
|
-
All sessions MUST reread the **control copy** of
|
|
42
|
+
All sessions MUST reread the **control copy** of the workflow snapshot immediately before
|
|
40
43
|
claim, release, transfer, plan-status transition, or merge-lease mutation.
|
|
41
44
|
|
|
42
45
|
**Do not** set `Worktree mode: waived` because a feature worktree lacks
|
|
@@ -48,37 +51,45 @@ control **`Plan Path`** / **`SDD dir`** in Assignments
|
|
|
48
51
|
|
|
49
52
|
All control-path lease mutations (claim, release, transfer, merge-lease
|
|
50
53
|
claim/release) **MUST** run inside a same-host exclusive write lock for the full
|
|
51
|
-
read-check-replace-verify sequence.
|
|
52
|
-
`
|
|
53
|
-
|
|
54
|
+
read-check-replace-verify sequence. Engine writers acquire the lock
|
|
55
|
+
automatically (`writeWorkflowSnapshot` / `registerWorkflow` use
|
|
56
|
+
`<status-file dir>/.status-write.lockdir/` — for snapshots the lockdir lands
|
|
57
|
+
inside `workflows/<id>/`); for manual edits prefer the engine-check commands
|
|
58
|
+
(`mstar lease verify --workflow <id>`, `mstar worktree check`) over hand-rolled
|
|
59
|
+
`flock`. The atomic-mkdir alternative (`.status-write.lockdir/` in the same
|
|
60
|
+
directory as the file) remains the documented fallback. Do **not** invent a
|
|
61
|
+
distributed CAS CLI.
|
|
54
62
|
|
|
55
63
|
**Cross-plan parallel hard gate:** Applies **whether or not** `Worktree mode: waived`.
|
|
56
64
|
Lease-gated **cross-plan parallel** writable implement is allowed **only when**
|
|
57
|
-
this same-host lock is **available on the coordination
|
|
58
|
-
used for every
|
|
59
|
-
|
|
60
|
-
waived). Agents on **different hosts** or with **no shared flock/lockdir** →
|
|
65
|
+
this same-host lock is **available on the coordination snapshot path and
|
|
66
|
+
used for every coordination mutation** in that Phase 2 session (control path
|
|
67
|
+
when lease gate active; primary checkout `{HARNESS_DIR}/status.json` + snapshot
|
|
68
|
+
when waived). Agents on **different hosts** or with **no shared flock/lockdir** →
|
|
61
69
|
default **`Plan parallelism: serial`** (preferred when waived). **No flock
|
|
62
70
|
does not waive** control worktree / feature worktree / leases — serial
|
|
63
71
|
scheduling only. Assignment still
|
|
64
72
|
claiming cross-plan parallel without lock availability → **Blocked** until PM
|
|
65
73
|
sets serial scheduling or the user gives current-turn override
|
|
66
|
-
`Cross-host lease race: accepted` (or equivalent) + audit on
|
|
74
|
+
`Cross-host lease race: accepted` (or equivalent) + audit on snapshot plan
|
|
75
|
+
`notes` / `notes.jsonl`.
|
|
67
76
|
**`Worktree mode: waived` alone is not** this override.
|
|
68
77
|
|
|
69
|
-
Immediately before **any** writable implement dispatch, re-read control
|
|
70
|
-
|
|
78
|
+
Immediately before **any** writable implement dispatch, re-read the control
|
|
79
|
+
snapshot and re-verify `execution_lease` holder + paths match this session;
|
|
71
80
|
mismatch → **STOP**.
|
|
72
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.
|
|
83
|
+
|
|
73
84
|
## Feature worktree (per plan)
|
|
74
85
|
|
|
75
86
|
- Each concurrently active plan uses a **distinct** absolute feature-worktree
|
|
76
87
|
path and dedicated feature branch from `spec_integration_branch`.
|
|
77
88
|
- `execution_lease.worktree_path` MUST differ from
|
|
78
|
-
`
|
|
89
|
+
`control_worktree_path` (never reuse the control checkout for product
|
|
79
90
|
edits).
|
|
80
|
-
- `Worktree path` MUST appear in the writable Assignment and in
|
|
81
|
-
`
|
|
91
|
+
- `Worktree path` MUST appear in the writable Assignment and in the snapshot
|
|
92
|
+
plan row's `execution_lease.worktree_path` before first writable implement dispatch.
|
|
82
93
|
- Product/source edits run from the feature worktree; plans, iterations,
|
|
83
94
|
status, and SDD coordination reads/writes run through **absolute control
|
|
84
95
|
paths** (never relative `.mstar/...` from the feature cwd when L1 is active).
|
|
@@ -87,20 +98,21 @@ mismatch → **STOP**.
|
|
|
87
98
|
- Default **L1**: one writable track per plan. Within-plan multi-writable tracks
|
|
88
99
|
still follow L2 `parallel-writable-pre-dispatch` (`mstar-branch-worktree`).
|
|
89
100
|
|
|
90
|
-
## Execution lease (`plans[].execution_lease`)
|
|
101
|
+
## Execution lease (`plans[].execution_lease` in the workflow snapshot)
|
|
91
102
|
|
|
92
103
|
Required shape (v1): `holder`, `claimed_at` (RFC 3339 UTC with `Z`),
|
|
93
104
|
`worktree_path`, `working_branch`; optional `session_label` (display only).
|
|
105
|
+
Lives on the snapshot plan row — `{WORKFLOW_DIR}/<id>/snapshot.json` → `plans[]`.
|
|
94
106
|
|
|
95
107
|
### Claim (before `InProgress` or writable dispatch)
|
|
96
108
|
|
|
97
|
-
1. Read control
|
|
109
|
+
1. Read the control snapshot; locate exactly one plan row (`id` read compatibility).
|
|
98
110
|
2. If `execution_lease` exists:
|
|
99
111
|
- **Same `holder` as this session** → **resume**: verify `worktree_path` and
|
|
100
112
|
`working_branch` match the Assignment; continue (not steal/block).
|
|
101
113
|
- **Different `holder`** → **Blocked** (no timestamp makes it stealable).
|
|
102
114
|
3. Create or verify dedicated feature worktree + branch.
|
|
103
|
-
4. Re-read
|
|
115
|
+
4. Re-read the snapshot under write lock; if row/status/lease changed, restart claim.
|
|
104
116
|
5. One complete-file update (still under lock): `status: "InProgress"` + full `execution_lease`.
|
|
105
117
|
Use temp file + atomic replace; never expose partial JSON.
|
|
106
118
|
6. Re-read and verify `holder`, `worktree_path`, `working_branch` match before
|
|
@@ -110,18 +122,18 @@ Required shape (v1): `holder`, `claimed_at` (RFC 3339 UTC with `Z`),
|
|
|
110
122
|
|
|
111
123
|
- Lease stays active across `InProgress` and `InReview` (including post-QC/QA
|
|
112
124
|
ready-to-merge) unless released or transferred.
|
|
113
|
-
- Normal release: re-read control
|
|
125
|
+
- Normal release: re-read the control snapshot under write lock; confirm stored `holder` matches
|
|
114
126
|
this session — mismatch → **Blocked**; then **delete** `execution_lease`
|
|
115
127
|
(never `null` or tombstone).
|
|
116
128
|
- `Done` authority deletes `execution_lease` in the same update as `status: "Done"`
|
|
117
129
|
— **only after** successful integration merge (when lease gate not waived).
|
|
118
130
|
- Override of another holder requires **explicit user instruction this turn** +
|
|
119
|
-
audit note on plan `notes` (prior holder, new holder/release, user authorized).
|
|
131
|
+
audit note on snapshot plan `notes` / `notes.jsonl` (prior holder, new holder/release, user authorized).
|
|
120
132
|
- V1: **manual release only** — no `expires_at`, TTL, or heartbeat authority.
|
|
121
133
|
|
|
122
134
|
### Orphan `InProgress` without lease
|
|
123
135
|
|
|
124
|
-
If a plan row is `InProgress` but has **no** `execution_lease
|
|
136
|
+
If a plan row is `InProgress` but has **no** `execution_lease` in the snapshot, STOP and
|
|
125
137
|
escalate — do not invent a lease or writable-dispatch. Unattended "Recover with
|
|
126
138
|
claim" is permitted **only** for the **same** stable `holder`; different holder
|
|
127
139
|
requires verified quiescence + handoff or current-turn user override + audit.
|
|
@@ -135,26 +147,27 @@ waived` is in effect — waiver does **not** authorize lockless cross-host paral
|
|
|
135
147
|
- **Feature implementation** MAY proceed in parallel across **different plan IDs**
|
|
136
148
|
only when **one** of:
|
|
137
149
|
1. Same-host exclusive write lock is available on the coordination
|
|
138
|
-
|
|
139
|
-
`{HARNESS_DIR}/status.json` when waived) and used for every
|
|
150
|
+
snapshot path (control path when lease gate active; primary checkout
|
|
151
|
+
`{HARNESS_DIR}/status.json` + snapshot when waived) and used for every coordination
|
|
140
152
|
mutation in that session; **and** when lease gate is not waived, each plan
|
|
141
153
|
holds a verified, distinct `execution_lease` and feature worktree.
|
|
142
154
|
2. **`Plan parallelism: serial`** (default when waived; preferred default under
|
|
143
155
|
waiver).
|
|
144
156
|
3. Current-turn `Cross-host lease race: accepted` (or equivalent) + audit
|
|
145
|
-
`
|
|
157
|
+
snapshot plan `notes` / `notes.jsonl`.
|
|
146
158
|
Cross-host / no shared lock without (2) or (3) → **Blocked** if Assignment still
|
|
147
159
|
claims cross-plan parallel writable implement.
|
|
148
160
|
- **Integration merge** into `spec_integration_branch` is **serial** (one at a time),
|
|
149
161
|
with or without lease gate.
|
|
150
162
|
|
|
151
|
-
## Integration merge lease (`
|
|
163
|
+
## Integration merge lease (snapshot top-level `integration_merge_lease`)
|
|
152
164
|
|
|
153
165
|
Required shape (v1): `holder`, `claimed_at`, `plan_id`, `source_branch`,
|
|
154
166
|
`target_branch` (= resolved `spec_integration_branch`); optional `session_label`.
|
|
167
|
+
Lives top-level on the snapshot — `{WORKFLOW_DIR}/<id>/snapshot.json`.
|
|
155
168
|
|
|
156
169
|
1. From control worktree: clean tree; branch = `spec_integration_branch`.
|
|
157
|
-
2. Under write lock,
|
|
170
|
+
2. Under write lock, re-read the snapshot. If `integration_merge_lease` exists:
|
|
158
171
|
- **Same `holder` as this session** → **resume**: verify `plan_id`,
|
|
159
172
|
`source_branch`, `target_branch` match intended merge; confirm control
|
|
160
173
|
worktree state; continue (not steal/block).
|
|
@@ -176,16 +189,15 @@ waives **only**:
|
|
|
176
189
|
|
|
177
190
|
- Control worktree establishment and control-path SSOT routing
|
|
178
191
|
- Per-plan feature worktree defaults
|
|
179
|
-
- `plans[].execution_lease` and `
|
|
180
|
-
defaults
|
|
192
|
+
- Snapshot lease claim/hold/release defaults (`plans[].execution_lease` and top-level `integration_merge_lease`)
|
|
181
193
|
|
|
182
194
|
It does **not** waive the **cross-plan parallel safety gate**. Under waiver,
|
|
183
195
|
cross-plan **parallel writable** implement still requires same-host exclusive
|
|
184
|
-
write lock on the coordination
|
|
196
|
+
write lock on the coordination snapshot path, default **`Plan parallelism:
|
|
185
197
|
serial`**, or current-turn `Cross-host lease race: accepted` + audit
|
|
186
|
-
`
|
|
198
|
+
snapshot plan `notes` / `notes.jsonl`. **Prefer serial scheduling when waived**; parallel under waiver
|
|
187
199
|
only with the race-accepted override (or same-host lock when mutating shared
|
|
188
|
-
|
|
200
|
+
state).
|
|
189
201
|
|
|
190
202
|
`Plan parallelism: serial` does **not** waive control worktree or leases.
|
|
191
203
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Loaded by `mstar-iteration` SKILL.md when entering Phase 3. **Read `mstar-harness-core` first.** Phase 2 全部 plan `Done` 后按 **Phase transition gates** 进入本 Phase。
|
|
4
4
|
|
|
5
|
-
PM 在迭代内全部 plan Done 后执行。**本 Phase 在 integration 分支上运行**,产出物 commit 到 integration 分支,随迭代 PR 合入
|
|
5
|
+
PM 在迭代内全部 plan Done 后执行。**本 Phase 在 integration 分支上运行**,产出物 commit 到 integration 分支,随迭代 PR 合入 snapshot `branch.target`(`target_branch`)。入口:Phase 2 全部 plan `Done` 后按 **Phase transition gates** 进入。
|
|
6
6
|
|
|
7
7
|
**Close Done 定义**:§3.1→§3.5 全部完成;compass frontmatter 写入 `status: completed` + `end_date`;每篇新增 knowledge doc 已登记 `{KNOWLEDGE_DIR}/README.md`。只在 final plan 中写了 compound / roadmap / PR 说明,不算 iteration-close 完成。
|
|
8
8
|
|
|
@@ -30,9 +30,9 @@ PM 在迭代内全部 plan Done 后执行。**本 Phase 在 integration 分支
|
|
|
30
30
|
|
|
31
31
|
**STOP**: 打印下方 checklist,且全部为 `[x]` 后,才可进入 §3.2 Compound。
|
|
32
32
|
|
|
33
|
-
- [ ] 所有 compass 中登记的 plan 在
|
|
34
|
-
- [ ] 所有 plan 的 residual findings 已收口:优先 empty
|
|
35
|
-
- [ ] compass `## Plans` 表状态列已与
|
|
33
|
+
- [ ] 所有 compass 中登记的 plan 在 workflow snapshot(`{WORKFLOW_DIR}/<id>/snapshot.json`)均为 `Done`
|
|
34
|
+
- [ ] 所有 plan 的 residual findings 已收口:优先 empty register 条目(`projects/<id>/residuals.json` → `entries[<plan-id>]`);若仍有 open R#,须均为 Phase 2 `zero-residual` 允许的 blocker-defer + roadmap,或已 closed(`lifecycle` / `closed_at` / `closure_note`,见 `mstar-plan-artifacts` Findings cleanup modes)
|
|
35
|
+
- [ ] compass `## Plans` 表状态列已与 snapshot 同步
|
|
36
36
|
- [ ] 迭代 `## Acceptance Criteria` 已达成或显式豁免(compass 或对话记录原因)
|
|
37
37
|
- [ ] compass shape 已满足(frontmatter + `## Roadmap Position` + close 占位节)
|
|
38
38
|
|
|
@@ -57,7 +57,7 @@ PM 批量触发后须:
|
|
|
57
57
|
1. 更新 compass **`## Roadmap Position`**(§3.0.5 已确保本节存在):
|
|
58
58
|
- current iteration 行标记为 **`delivered`**(或等价明确措辞)
|
|
59
59
|
- next iteration 更新为即将开始的内容、触发条件、owner
|
|
60
|
-
2.
|
|
60
|
+
2. 若项目层 roadmap(`{PROJECT_DIR}/<id>/roadmap.md`)存在,同步更新(frontmatter `status` / goal-item checkboxes);若 snapshot plan 行含 `metadata.roadmap` 字段,同步更新
|
|
61
61
|
3. 若存在 deferred-features / roadmap tracker 类文档,按项目惯例刷新
|
|
62
62
|
4. 若 `STRATEGY.md` 存在,可更新 `## Decision Log`(重大架构决策时)
|
|
63
63
|
|
|
@@ -78,7 +78,7 @@ PM 打印 **iteration-close exit checklist**;全部为 `[x]` 后方可 `git co
|
|
|
78
78
|
- [ ] §3.3 `## Roadmap Position` current iteration 已标 `delivered`;tracker / STRATEGY 已按需更新
|
|
79
79
|
- [ ] §3.4 frontmatter `status: completed` + `end_date`;Quality Gate Summary + Compound Summary + Retrospective 已填
|
|
80
80
|
- [ ] 当前分支是 `spec_integration_branch`
|
|
81
|
-
- [ ] PR base = `
|
|
81
|
+
- [ ] PR base = snapshot `branch.target`(`target_branch`,与 compass frontmatter 一致);**不是**未记录的 `main`
|
|
82
82
|
|
|
83
83
|
**Commit 到 integration 分支**:
|
|
84
84
|
|
|
@@ -88,7 +88,7 @@ git commit -m "chore(iteration): close <iteration-id> — compound round, roadma
|
|
|
88
88
|
git push origin <spec_integration_branch>
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
PR 目标使用
|
|
91
|
+
PR 目标使用 snapshot `branch.target`;缺失时停止并补齐,不得默认 `main`。
|
|
92
92
|
|
|
93
93
|
## 3.6 可选:触发 compound-refresh
|
|
94
94
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
**Precondition**: Phase 3 §3.5 exit 全 `[x]`;close commit 已 push 到 `spec_integration_branch`。
|
|
8
8
|
|
|
9
9
|
1. 打印 **`## Phase 4: PR delivery`**
|
|
10
|
-
2. Resolve target
|
|
10
|
+
2. Resolve target:snapshot `branch.target`(`target_branch`;compass frontmatter 镜像);缺失 → **STOP**,问用户
|
|
11
11
|
3. 创建 PR:`spec_integration_branch` → `target_branch`
|
|
12
12
|
4. 记录 PR URL / number(Phase 5 会话 SSOT)
|
|
13
13
|
5. **Immediately** 进入 **Phase 5** — **Phase 4 exit ≠ 迭代交付完成**
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
- Phase 5 在 PR head(`spec_integration_branch`)上 push 修复;**禁止**另开替代分支
|
|
26
26
|
- **Checkout / worktree(HARD)**:Phase 5 是 PR 级 **hotfix** loop,**不是** Phase 2 plan 实现。修复直接在 **control worktree**(已检出 `spec_integration_branch` 的 checkout)上编辑、commit、再按 §5.1a push。**禁止**为 Phase 5 另开 feature / fix worktree;**禁止**把 Phase 2「control 禁止产品编辑 / 须 feature worktree」套用到 Phase 5。另开 worktree 浪费时间、磁盘与计算,与 Phase 5 快速收敛 CI/review 的目标相悖。
|
|
27
|
-
- 产品代码修复 → PM **dispatch** dev/ops(`mstar-dispatch-gates`);Assignment **`Worktree path`** / cwd = control
|
|
27
|
+
- 产品代码修复 → PM **dispatch** dev/ops(`mstar-dispatch-gates`);Assignment **`Worktree path`** / cwd = control(snapshot `control_worktree_path` 或当前已在集成分支上的 checkout);PM 线程不代写实现
|
|
28
28
|
- 禁止为「让 CI 变绿」而改 workflow,除非用户明确授权
|
|
29
29
|
- **Push cadence** → **§5.1a**(本地可提前修;**禁止**在 CI / AI review 波次未结束时 push)
|
|
30
30
|
|
|
@@ -74,12 +74,12 @@ per-plan 门禁通过后,PM 在**迭代层面**管理以下活动(不计入
|
|
|
74
74
|
|
|
75
75
|
per-plan Done 是 per-plan 的闭环终点;compound 是迭代级收口活动,不影响 per-plan 状态判定。
|
|
76
76
|
|
|
77
|
-
> **Engine check (when available):** run `mstar iteration gate --
|
|
77
|
+
> **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 iteration phase-transition gate (Phase 2 → 3 → 4) against the workflow snapshot when iteration-level activities above are reached — per-plan Prepare/Execute gate judgment stays prompt. On `fail` (gate-blocking violations) -> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
|
|
78
78
|
|
|
79
79
|
## Plan 目录与审查证据(启用 `{PLAN_DIR}` 时)
|
|
80
80
|
|
|
81
|
-
- 进入 `InReview` 后,QC/QA 原始过程报告默认落入 `{SDD_DIR}/review/`(**SDD 默认 tri** `qc1`…`qc-consolidated`;**inline** 单席 `qc.md`)。**fix 后默认 targeted re-review**。SDD per-task review 在 implement 波次内完成(`mstar-sdd` task reviewer)。PM 将 durable gate summary 回写主 plan /
|
|
82
|
-
- 非阻断项与后续技术债:PM 汇总后写入 `{
|
|
81
|
+
- 进入 `InReview` 后,QC/QA 原始过程报告默认落入 `{SDD_DIR}/review/`(**SDD 默认 tri** `qc1`…`qc-consolidated`;**inline** 单席 `qc.md`)。**fix 后默认 targeted re-review**。SDD per-task review 在 implement 波次内完成(`mstar-sdd` task reviewer)。PM 将 durable gate summary 回写主 plan / workflow snapshot,而不是把 raw reports 作为默认 git 产物。
|
|
82
|
+
- 非阻断项与后续技术债:PM 汇总后写入 project register `{PROJECT_DIR}/<id>/residuals.json` → `entries[<plan-id>]`(**open**,默认 `{HARNESS_DIR}/projects/<id>/`;canonical 见 **`mstar-plan-artifacts` SKILL.md**);关闭时在 register 内 **in place** 置 `lifecycle` / `closed_at` / `closure_note`,与 `mstar-review-qc` 一致。每条 **`severity`** 遵守 **`mstar-plan-artifacts/references/status-and-residuals.md`**「Residual findings:severity(SSOT,机器字段)」。
|
|
83
83
|
|
|
84
84
|
## 快速判定(PM)
|
|
85
85
|
|