@mstar-harness/dsh 3.10.3 → 3.11.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.
Files changed (30) hide show
  1. package/harness-commands/iteration-start.md +1 -1
  2. package/harness-skills/mstar-artifacts/references/plan-quality-bar.md +13 -0
  3. package/harness-skills/mstar-artifacts/references/status-and-residuals.md +1 -1
  4. package/harness-skills/mstar-audit/SKILL.md +2 -2
  5. package/harness-skills/mstar-audit/references/codebase-audit.md +53 -4
  6. package/harness-skills/mstar-audit/references/finding-format.md +44 -0
  7. package/harness-skills/mstar-audit/references/security-review.md +194 -32
  8. package/harness-skills/mstar-branch-worktree/SKILL.md +3 -2
  9. package/harness-skills/mstar-dispatch-gates/SKILL.md +7 -0
  10. package/harness-skills/mstar-host/references/cursor.md +1 -13
  11. package/harness-skills/mstar-host/references/omp.md +36 -5
  12. package/harness-skills/mstar-iteration/references/iteration-artifact-boundaries.md +7 -5
  13. package/harness-skills/mstar-iteration/references/iteration-compass-template.md +21 -3
  14. package/harness-skills/mstar-iteration/references/phase-1-prepare.md +37 -3
  15. package/harness-skills/mstar-iteration/references/phase-2-worktree-lease.md +3 -3
  16. package/harness-skills/mstar-iteration/references/phase-3-iteration-close.md +1 -0
  17. package/harness-skills/mstar-iteration/references/phase-6-post-merge-close.md +1 -1
  18. package/harness-skills/mstar-iteration/references/plan-scoped-pm.md +2 -0
  19. package/harness-skills/mstar-phase-gates/SKILL.md +1 -1
  20. package/harness-skills/mstar-roles/references/project-manager/dispatch-and-assignment.md +1 -2
  21. package/harness-skills/mstar-sdd/SKILL.md +1 -13
  22. package/harness-skills/mstar-sdd/references/file-handoffs.md +0 -1
  23. package/harness-skills/mstar-sdd/references/implementer-continuation-prompt.md +0 -1
  24. package/harness-skills/mstar-sdd/references/implementer-prompt.md +0 -1
  25. package/harness-skills/mstar-sdd/references/sticky-implementer-session.md +0 -1
  26. package/harness-skills/mstar-sdd/references/task-reviewer-prompt.md +0 -1
  27. package/harness-skills/mstar-use-cli/SKILL.md +1 -0
  28. package/harness-skills/mstar-use-cli/references/checks-and-lints.md +1 -1
  29. package/harness-skills/mstar-use-cli/references/plan-and-workflow.md +4 -0
  30. package/package.json +1 -1
@@ -78,11 +78,13 @@ iteration-close (§3.2)
78
78
 
79
79
  ## §1.6 各角色编辑范围
80
80
 
81
- | 角色 | 必须编辑 | 禁止 |
82
- |------|----------|------|
83
- | **product-manager** | compass、plans、`{SPECS_DIR}/`、`{ITERATION_DIR}/<iteration-id>/`(guides/specs) | `{KNOWLEDGE_DIR}/` **新增**;迭代草案写入 `{SPECS_DIR}/` |
84
- | **architect** | 同上 + package `specs/` 技术向 | 同上;在 `{SPECS_DIR}/` 堆实施踩坑 |
85
- | **writing-specialist** | 当轮文档 + `{SPECS_DIR}/` corpus hygiene + 既有 knowledge 卫生 | 代替 compound **提升**;跳过 specs 全库审查 |
81
+ | 角色 | 必须编辑 | 禁止 | Draft markers it must clear |
82
+ |------|----------|------|------------------------------|
83
+ | **product-manager** | compass、plans、`{SPECS_DIR}/`、`{ITERATION_DIR}/<iteration-id>/`(guides/specs) | `{KNOWLEDGE_DIR}/` **新增**;迭代草案写入 `{SPECS_DIR}/` | 产品范围 / 优先级 / 验收类 marker |
84
+ | **architect** | 同上 + package `specs/` 技术向 | 同上;在 `{SPECS_DIR}/` 堆实施踩坑 | 架构 / 契约 / 技术设计类 marker |
85
+ | **writing-specialist** | 当轮文档 + `{SPECS_DIR}/` corpus hygiene + 既有 knowledge 卫生 | 代替 compound **提升**;跳过 specs 全库审查 | 行文与 corpus hygiene 类 marker,外加收口「无 marker 残留」核对 |
86
+
87
+ > 新增列是**清除义务**(marker 语法与 owner 词汇 → **`phase-1-prepare.md`** §1.3;义务正文 → §1.6),**不**改变上方「必须编辑」的写入范围。
86
88
 
87
89
  Phase 2 执行期:各角色可继续向 **`<iteration-id>/`** 追加 guides/specs;**仍不**直写 `{KNOWLEDGE_DIR}/`。
88
90
 
@@ -21,6 +21,22 @@ plans: []
21
21
  - <spec point 1>
22
22
  - <spec point 2>
23
23
 
24
+ ## Decisions
25
+
26
+ > Settled direction-lock items — the record a dispatched role reads instead of re-deriving context from a conversation it never saw.
27
+
28
+ | # | Decision | Rationale | Source |
29
+ |---|----------|-----------|--------|
30
+ | D1 | <settled decision> | <why it was settled this way> | user instruction / grill-me / autonomous ranking |
31
+
32
+ ## Open Questions
33
+
34
+ > Unresolved items, each owned by a Phase 1 chain role. Row disposition before the §1.6 lock → `phase-1-prepare.md` §1.3. Write `None` in place of the table when there are no open questions.
35
+
36
+ | # | Question | Owner | Blocking? |
37
+ |---|----------|-------|-----------|
38
+ | Q1 | <open question> | product-manager / architect / writing-specialist / PM | Yes / No |
39
+
24
40
  ## Plans
25
41
 
26
42
  | plan_id | Name | Status | Notes |
@@ -46,8 +62,8 @@ Status values: `Todo` | `InProgress` | `InReview` | `Done` | `Blocked`
46
62
 
47
63
  ## Non-Goals
48
64
 
49
- - <明确排除项 1>
50
- - <明确排除项 2>
65
+ - <明确排除项 1> — <排除理由>
66
+ - <明确排除项 2> — <排除理由>
51
67
 
52
68
  ## Roadmap Position
53
69
 
@@ -125,7 +141,9 @@ Notes:
125
141
  | `## Plans` table | Yes | Phase 2 (sync status), Phase 3 (final) |
126
142
  | `## Milestones` | Recommended | Phase 1, Phase 2 (update) |
127
143
  | `## Acceptance Criteria` | Yes | Phase 1 |
128
- | `## Non-Goals` | Yes | Phase 1 |
144
+ | `## Non-Goals` | Yes | Phase 1; each entry carries its rationale |
145
+ | `## Decisions` | Yes | Phase 1 draft (appended in Phase 2); settled items with rationale and source |
146
+ | `## Open Questions` | Yes(`None` allowed) | Phase 1 draft; each item carries an owner from the Phase 1 chain — row disposition before the lock → `phase-1-prepare.md` §1.3 |
129
147
  | `## Roadmap Position` | **Yes** | Phase 1(必填节,非散落于 general context prose);Phase 3 §3.3(current iteration → `delivered`) |
130
148
  | `## Risk Register` | Optional | Phase 1, Phase 2 (update) |
131
149
  | Iteration package (`guides/` / `specs/`) | Optional | Phase 1 §1.5.5; root index one row → `{ITERATION_DIR}/README.md` |
@@ -31,7 +31,7 @@ PM 在新迭代启动时执行。
31
31
 
32
32
  ### Direction lock modes
33
33
 
34
- compass/plans 初稿落盘前,必须锁定**单一**迭代方向、成功标准、非目标,并确认 delivery branch policy;决策写入 compass `## Scope` / `## Acceptance Criteria` / `## Non-Goals` 与 Delivery Branch Policy。
34
+ compass/plans 初稿落盘前,必须锁定**单一**迭代方向、成功标准、非目标,并确认 delivery branch policy;决策写入 compass `## Scope` / `## Acceptance Criteria` / `## Non-Goals` 与 Delivery Branch Policy。**已决事项**另须落入 compass **`## Decisions`**(每条 = `decision` + `rationale` + `source`:user instruction / grill-me / autonomous ranking),**未决事项**落入 **`## Open Questions`**(每条带 owner —— `product-manager` / `architect` / `writing-specialist` / `PM` —— 与 blocking 标记;无未决项写 `None`)。两节形态 → **`references/iteration-compass-template.md`**;初稿深度与清除义务 → §1.3 **Draft contract**。
35
35
 
36
36
  | Mode | 何时选用 | 行为 |
37
37
  |------|----------|------|
@@ -72,6 +72,18 @@ plans: []
72
72
  ## Scope
73
73
  <本迭代要锁定的 spec 点>
74
74
 
75
+ ## Decisions
76
+
77
+ | # | Decision | Rationale | Source |
78
+ |---|----------|-----------|--------|
79
+ | D1 | <已决事项> | <依据> | user instruction / grill-me / autonomous ranking |
80
+
81
+ ## Open Questions
82
+
83
+ | # | Question | Owner | Blocking? |
84
+ |---|----------|-------|-----------|
85
+ | Q1 | <未决事项> | product-manager / architect / writing-specialist / PM | Yes / No |
86
+
75
87
  ## Plans
76
88
 
77
89
  | plan_id | Name | Status | Notes |
@@ -104,6 +116,26 @@ plans: []
104
116
 
105
117
  > **Engine check (when available):** import `validateCompassFrontmatter` from `@mstar-harness/engine` in a host hook to validate the compass frontmatter above (no CLI form yet). On `fail` -> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
106
118
 
119
+ ### Draft contract(PM 初稿的深度契约)
120
+
121
+ PM 的初稿是**上下文载体**:被派发角色看不到 PM 的会话,只从磁盘读(`delivery-compass.md` + plans + `<iteration-id>/` package)。所以初稿按 **「骨架 + 完整上下文」** 交付,深度边界如下。
122
+
123
+ **(i) 初稿必须携带**:锁定方向;已决事项(→ compass `## Decisions`);带 owner 的未决事项(→ `## Open Questions`);**非目标及其理由**;约束来源(用户指令 / 既有 spec / knowledge / roadmap);acceptance seed(可长成 `## Acceptance Criteria` 的条目);branch policy。
124
+
125
+ **(ii) 初稿可以合法留粗**:候选方案分析、模块/接口细节、per-task 分解、plan 级技术设计。这些**标记**为待补,**不**编造。留粗是允许的;**不加标记**则不允许 —— 未标记的空洞无人认领,等于把上下文缺口丢给一个看不到会话的承接方。
126
+
127
+ **(iii) 标记形态(语法只在本节定义;其它文件按 path + 节号引用本处)**:
128
+
129
+ ```text
130
+ <!-- TODO(owner: <role-id>): <what is missing and what must be decided> -->
131
+ ```
132
+
133
+ owner 取值仅限 Phase 1 链:`product-manager` / `architect` / `writing-specialist` / `PM`(需回到用户决策时)。**无 owner 的 `TBD` / `...` / `etc.` 在任何阶段都仍然禁止** —— 没有 owner,就没有清除它的地方。
134
+
135
+ **(iv) 清除期限**:compass `status: locked` 是终线。lock 前,owner 属于链条三角色的 marker **必须**全部清除;无法清除的,在 lock 前**显式重新归属给 `PM`** 并上报用户(`PM` 归属项是 lock 之后唯一允许存在的 marker 形态)。**禁止**静默删除,也**禁止**让无 owner 的 placeholder 越过终线。各角色的清除义务与报数 → §1.6。
136
+
137
+ **(v) `## Open Questions` 行的处置**:§1.2 落盘的每一行在终线前必须落到三者之一:收敛为已决事项(撤出该行并计入 `## Decisions`);或转入 (iii) 的 marker 形态(行的 owner 即 marker 的 owner,随 (iv) 一同清除或重新归属给 `PM`);或**显式重新归属给 `PM`** 并上报用户。**禁止**静默删除行 —— 与 (iv) 共用同一终线。`Blocking?` 决定该行**能否**越过终线:标记 `Yes` 的行**必须**在 lock 前收敛为已决事项,**不论**它本会重新归属给谁;不能收敛即 Prepare 未通过(`Gate decision: blocked`),compass **不得**置 `status: locked`。lock 之后 `## Open Questions` 中唯一允许存在的行,即**非阻塞**且 owner 为 `PM` 的行。行转入 marker 形态后,其清除义务与报数按 §1.6 计。
138
+
107
139
  ## 1.4 更新索引
108
140
 
109
141
  在 `{ITERATION_DIR}/README.md` 中添加**一行**(首次创建时建立表头;**一行 = 一次迭代**,不拆 compass/workspace 双行):
@@ -118,9 +150,9 @@ plans: []
118
150
 
119
151
  iteration 正式全流程**必须**登记 `{HARNESS_DIR}/status.json`(v2 根)+ `{WORKFLOW_DIR}/<id>/snapshot.json`:
120
152
 
121
- - 根 `status.json` `workflows[]` 增一条 active entry:`{ "id": "<iteration-id>", "type": "iteration", "started_at", "dir": "workflows/<iteration-id>" }`(engine `registerWorkflow`)。
153
+ - 用 **`mstar iteration register`** 一次写入两份文档:create-only 的 `type: "iteration"` snapshot(`{WORKFLOW_DIR}/<id>/snapshot.json`)+ 根 `status.json` `workflows[]` active entry(`{ "id": "<iteration-id>", "type": "iteration", "started_at", "dir": "workflows/<iteration-id>" }`),二者在同一把根锁内完成。snapshot 已存在而 root entry 缺失(两次写入之间崩溃)时,重跑即恢复:保留既有 snapshot 字节,只补写缺失的 root entry。必填输入:workflow id、compass ref、三个 branch anchors、Todo plan 行(registration 从不授权实现)。store-pinning / 写入顺序 / rollback 语义 → **`mstar-artifacts`** `references/plan-workflow-lifecycle-contract.md` §4a。flag 集合与措辞以命令 help 为准(`mstar iteration register --help`),本文件不复述。
122
154
  - snapshot 顶层 `branch` anchors:`base`(= `iteration_base_branch`,创建 `spec_integration_branch` 的祖先 ref——**不是**隐式 `main`)、`integration`(= `spec_integration_branch`)、`target`(= iteration-close 后 PR 的目标分支)。
123
- - 各 plan 行 `metadata.iteration_refs`、`spec_integration_branch`、`merge_target`(`merge_target` 通常为 `spec_integration_branch`)。
155
+ - 各 plan 行 `metadata.iteration_refs`、`spec_integration_branch`、`merge_target`(`merge_target` 通常为 `spec_integration_branch`)由 producer 从 compass / integration 输入**派生**——PM 无需也不应手工构造这些字段。
124
156
 
125
157
  compass frontmatter 的 `iteration_base_branch` / `target_branch` **必须与** snapshot `branch` 一致;若仅写在 compass 而 snapshot 缺失,Phase 2 §2.3 同轮 backfill。
126
158
 
@@ -155,6 +187,8 @@ Phase 1 与 §1.6 须遵守 **`references/iteration-artifact-boundaries.md`**(
155
187
  2. **writing-specialist** 完成 **corpus hygiene**:仅本轮修改的 `{SPECS_DIR}/` / iteration package 与直接相关 knowledge 引用;错放迁回 **`<iteration-id>/`** package;细则 → **`iteration-corpus-hygiene.md`**、**`iteration-artifact-boundaries.md`**
156
188
  3. PM 将 compass `status` 设为 `locked`,并确认各 plan 的 Prepare gate(specify / clarify / plan)
157
189
 
190
+ **Marker 清除义务(§1.3,每个被派发角色)**:角色在自己这一轮编辑中**必须**清除 owner 指向自己的 marker,无法清除的在完成前**重新归属给 `PM`** 并写明理由;两种情况都在 Completion Report 中报出**清除计数**(已清 N / 已重新归属 M)。**writing-specialist** 额外承担**收口核对**:除显式重新归属给 `PM` 的 marker 外,**无** marker 残留(语法的唯一 home 是 §1.3;本行不重述其形态)—— 该核对是 PM 置 `status: locked` 的前置。
191
+
158
192
  **顺序理由**:产品范围与优先级 → 架构与长期契约(specs)→ 行文、规格库卫生与错放纠正(在 PM/architect 定稿后核对受影响文档)。本共享产物链存在真实依赖;独立文档可按 ownership 隔离并行。早期全局探索的既有结果复用,不因每次编辑重新扫全库。角色名写法(role id 提及 hygiene)→ active host reference(**`mstar-host`** → `references/<host>.md`)。
159
193
 
160
194
  **完成证据** = 磁盘上的 compass / plans / specs / iteration 文档修订 + specs(与既有 knowledge)卫生/归档(如有)+ 索引与 metadata 更新 + compass `status: locked`。**不**要求单独的迭代审查报告——迭代审查的 SSOT 是被编辑的文档本身,无 per-plan QC 式审计链。
@@ -252,7 +252,7 @@ Phase 2 缺的不是新调度器,而是一个**具名的重新评估时刻**
252
252
  - PM 载入 **`mstar-sdd`** 后,按依赖与 ownership 派发 **独立 ready tasks 并行** 的 per-task 循环(**不是**一次派发 dev 做全部 tasks):
253
253
  1. `mstar sdd workspace <plan-id>` → `{SDD_DIR}`
254
254
  2. `mstar sdd task-brief <plan-file> N` → `{SDD_DIR}/task-N-brief.md`;记录 `BASE_SHA`
255
- 3. Dispatch **one** implementer subagent(`references/implementer-prompt.md`:brief 路径 + report 路径 + `Model tier`;**禁止**贴整份 plan)
255
+ 3. Dispatch **one** implementer subagent(`references/implementer-prompt.md`:brief 路径 + report 路径;**禁止**贴整份 plan)
256
256
  4. Implementer `DONE` → `mstar sdd review-package BASE HEAD` → task diff 文件
257
257
  5. Dispatch **one** task reviewer subagent(brief + report + diff + Global Constraints)
258
258
  6. Fix loop 直至 review clean;append `{SDD_DIR}/progress.md`;更新 snapshot plan 行 / plan checkbox
@@ -283,7 +283,7 @@ Phase 2 缺的不是新调度器,而是一个**具名的重新评估时刻**
283
283
  integration merge 成功且 plan 行 `Done`、`execution_lease` 已删除的**同一轮**,即可回收该 plan/track 的 feature worktree + 已合并分支 —— **父迭代仍在运行不影响资格**:不存在「父须终结」的一刀切,这是 cleanup 的明确设计而非遗漏。命令与守卫契约本体(ownership、合并证据、refusals、apply 顺序)→ **`mstar-branch-worktree`**「Worktree / branch cleanup」(唯一 home;本节只放 call site):
284
284
 
285
285
  ```text
286
- mstar worktree cleanup --workflow <id> [--harness <path>] [--apply] [--worktree <path>]
286
+ mstar worktree cleanup --workflow <id> [--harness <path>] [--apply] [--remote] [--worktree <path>] [--all-workflows] [--verbose] [--ignore-unreadable-snapshots]
287
287
  ```
288
288
 
289
289
  - 先 dry-run 看 `verdict | kind | ref | reason`(merge 刚完成 → 该 Done 行 eligible);`--apply` 才变更。lane 1 只清**本地面**(无 `--remote`;远端残留留给 Phase 6)。
@@ -302,7 +302,7 @@ mstar worktree cleanup --workflow <id> [--harness <path>] [--apply] [--worktree
302
302
  | 并行 | 独立 ready tasks 各自 fresh implementer + 隔离 worktree;单一 canonical per-plan SDD root 内分离 task artifact 路径,context/progress 仅 PM 串行写;leaf 直接消费不可变绝对路径,不调用共享 context helper;每 task 后一位 fresh reviewer;真实依赖与 merge 串行(`mstar-sdd`) |
303
303
  | Sticky(可选) | Assignment **`SDD implementer session: sticky`** + `implementer-session.json`;implementer **resume**,reviewer **fresh** — `mstar-sdd/references/sticky-implementer-session.md` |
304
304
  | 文件交接 | brief / report / diff / `progress.md` 在 `{SDD_DIR}`;dispatch prompt **只给路径**,不贴 plan 全文或 task 历史 |
305
- | Assignment 字段 | 每个 implement dispatch 须含 `Execution mode: sdd`、`SDD dir`、`Model tier`;§2.0 #5 未 waive 时还须含绝对 `Worktree path` + verified `execution_lease`;**禁止**省略 `Model tier` |
305
+ | Assignment 字段 | 每个 implement dispatch 须含 `Execution mode: sdd`、`SDD dir`;§2.0 #5 未 waive 时还须含绝对 `Worktree path` + verified `execution_lease`;**禁止**省略 `Execution mode` / `SDD dir` |
306
306
  | 大包 inline | **禁止**把 T1–Tn 或整份 plan 写进 **一个** `fullstack-dev` leaf Assignment 冒充 SDD |
307
307
  | 分支 diff | 全部 task 完成后 `mstar sdd review-package MERGE_BASE HEAD` → `{SDD_DIR}/review/` branch diff → plan QC tri(N=3) |
308
308
 
@@ -19,6 +19,7 @@ PM 在迭代内全部 plan Done 后执行。**本 Phase 在 integration worktree
19
19
  | 检查 | 缺则补齐 |
20
20
  |------|----------|
21
21
  | YAML frontmatter:`iteration_id`, `start_date`, `status` | 从文件名 / 正文提取;收口前 `status` 保持 `active` 或 `locked` |
22
+ | `## Decisions` / `## Open Questions`(模板中紧跟 `## Scope`) | 从 general context / 正文迁移为本节,无内容则按模板补节;行处置 → `phase-1-prepare.md` §1.3 |
22
23
  | `## Roadmap Position` | 从 general context / roadmap prose 迁移为本节 |
23
24
  | `## Quality Gate Summary` | 按模板补占位,§3.4 填写 |
24
25
  | `## Compound Round Summary` | 按模板补占位,§3.4 填写 |
@@ -49,7 +49,7 @@ mstar status workflow-close --workflow <id> [--harness <path>] [--ended-at <date
49
49
  物理清理(integration worktree / 本地分支 / 远端分支删除)是 §6.1–§6.3 之后的**显式独立步骤**——即 **timing lane 2**:valid terminal close + PR verified merged 之后才清理 integration 面。Phase 6 只固定顺序与守卫,不在本 phase 内实现删除:
50
50
 
51
51
  - cleanup **永不自动**、永不绕过 ownership / merge-evidence 守卫 —— 契约本体(ownership、合并证据、refusals、apply 顺序)唯一 home → **`mstar-branch-worktree`**「Worktree / branch cleanup」;本节只放 call site,不复制规则
52
- - `mstar worktree cleanup --workflow <id> [--harness <path>] [--apply] [--remote] [--worktree <path>]` —— dry-run 默认,逐候选打印 `verdict | kind | ref | reason`;先 dry-run 核对受保护行全部 `keep`/`refuse`,再 `--apply`
52
+ - `mstar worktree cleanup --workflow <id> [--harness <path>] [--apply] [--remote] [--worktree <path>] [--all-workflows] [--verbose] [--ignore-unreadable-snapshots]` —— dry-run 默认,逐候选打印 `verdict | kind | ref | reason`(标志语义、默认候选范围与守卫本体见上方 owning-contract 指针);先 dry-run 核对受保护行全部 `keep`/`refuse`,再 `--apply`
53
53
  - **lease 释放是手工 owner 动作、cleanup 范围外**:§6.1 close 已拒绝 dangling lease,但 cleanup 仍**从不**替 owner 释放——残留 lease 的候选只会得到 `cleanup.refuse.active-lease`;先手工释放,再重跑 dry-run/apply
54
54
  - squash-merged 分支(tip 非 base 祖先)→ STOP → residual;禁止 `git branch -D`
55
55
 
@@ -179,3 +179,5 @@ The scoped route **requires** `mstar plan …`. Without it(engine/CLI absent o
179
179
  Herdr / tmux (or any multiplexer) is only a way to open a terminal. It is **not** a prerequisite, dependency, ownership signal or session identity. Nothing in this route reads pane state, TTL or terminal labels to decide ownership.
180
180
 
181
181
  Where the active host reference declares an optional skill-driven extra-primary launch protocol (its native opt-in, its bind/checkpoint/reserve/record calls, non-focus pane creation at the prepared worktree, the absolute `--assignment` submission and terminal uncertainty handling), **`mstar-host`** → that reference's Phase-2 section is the only home for those calls; this file defines none of them. The protocol stays optional there too and adds no load-order dependency here.
182
+
183
+ Such a conditional extra-primary launch is available only for a plan row the coordinator has already registered **and** prepared, and whose feature worktree exists; a row that does not yet exist cannot be launched, because row admission closes with Phase 1. Registration and preparation are distinct row states — the launch precondition is a prepared row, never registration alone.
@@ -50,7 +50,7 @@ description: "Morning Star Spec-Driven 双阶段门禁:Prepare(`specify →
50
50
 
51
51
  - **`plan locked`**
52
52
  - 最小动作:在 plan 或 notes 记录当前锁定版本(日期或 hash)。
53
- - **Plan 质量门**(新 plan / 大改):无 placeholder(`...`、`TBD`、`etc.`);含 **Global Constraints** 与 per-task **Interfaces**;PM self-review 四问(每 task 可独立验证?依赖顺序清晰?无隐含假设?每 task 可单轮闭合其 Files 与验证门 — Task shape / session fit?→ **`mstar-artifacts/references/plan-quality-bar.md`** item 7)— 见 `mstar-artifacts/templates/plan.main.md` + **`mstar-artifacts/references/plan-quality-bar.md`**(自包含/验证门/STOP 条件/drift check/done criteria)。
53
+ - **Plan 质量门**(新 plan / 大改):无 placeholder(`...`、`TBD`、`etc.`)—— 该判定在 **`plan(locked)`** 时点执行。Prepare 期间**唯一**被认可的未完成形态是带 owner 的 `TODO(owner: …)` marker(语法、owner 词汇与清除口径 → **`mstar-iteration/references/phase-1-prepare.md`** §1.3;清除期限按路线取:迭代初稿 = compass `status: locked`(**不是**该 plan 的 `plan(locked)` 时点);独立 plan(无 compass)= 本节 `plan(locked)` 时点);无 owner 的 placeholder 在任何阶段都不被接受。含 **Global Constraints** 与 per-task **Interfaces**;PM self-review 四问(每 task 可独立验证?依赖顺序清晰?无隐含假设?每 task 可单轮闭合其 Files 与验证门 — Task shape / session fit?→ **`mstar-artifacts/references/plan-quality-bar.md`** item 7)— 见 `mstar-artifacts/templates/plan.main.md` + **`mstar-artifacts/references/plan-quality-bar.md`**(自包含/验证门/STOP 条件/drift check/done criteria)。
54
54
  - **`implement`**
55
55
  - 最小产物:实现 diff、自检证据、回报与 handoff;行为准则 → **`mstar-coding-behavior`**;编辑纪律 → 上文「可验证编辑与上下文纪律」。
56
56
  - **知识库 / 迭代 compass**:**默认**开工前扫 `{KNOWLEDGE_DIR}/README.md` 索引(若存在)并阅读与当轮相关的 **Active** 行(**即使 metadata 无 knowledge 链接**);若 `plans[].metadata` 登记了 `primary_spec` / `spec_refs` / `iteration_compass` / `iteration_refs`,所链接文档**仍须**阅读;两类阅读均须在回报中说明已对齐 → **`mstar-conventions`** · **`mstar-artifacts/references/knowledge-and-designs.md`**。该 implement 时阅读是输入变化时的 re-alignment,不替代 Prepare 的锁前 recall receipt(见上文 Prepare `plan` 节)。
@@ -87,7 +87,6 @@ The **`**You are a leaf executor. You MUST NOT:**`** section (previously just pr
87
87
  **SDD implementer session**: fresh | sticky | N/A — **default `fresh`**; `sticky` reuses same implementer subagent across tasks (reviewers stay fresh). See `mstar-sdd/references/sticky-implementer-session.md`
88
88
  **SDD dir**: absolute `<main-repo-root>/{HARNESS_DIR}/sdd/<plan-id>/` (control harness root) when L1 lease gate active | `{HARNESS_DIR}/sdd/<plan-id>/` when waived / single checkout | N/A
89
89
  **SDD context file**: absolute `<SDD dir>/context.json` when `Execution mode: sdd` | N/A — destination contract consumed by `mstar sdd exec --context` / `--context` producers (`mstar-sdd/references/file-handoffs.md`)
90
- **Model tier**: fast | standard | capable | N/A
91
90
  **Skill presets**: `standard` | <explicit skill list> | none — activates the `Execute as` role's preset from its `Skill Preset (PM-Activated)` section; default `standard` for implementation / QC / QA rounds unless the route is trivial
92
91
  **QC mode**: full tri-review | single | N/A — **default `full tri-review` when `Execution mode: sdd`**; `single` only for `inline` / override
93
92
  **Review package path**: <branch-review diff file> | N/A
@@ -228,5 +227,5 @@ The **scoped primary route** never appears as a subagent invoke on any host: `/i
228
227
  **NEVER(SDD)**:
229
228
 
230
229
  - 把整份 plan 或 T1–Tn 全文贴进 **一个** `fullstack-dev` leaf Assignment。
231
- - 省略 `Execution mode` / `SDD dir` / `Model tier` 却期望 SDD 产物(`progress.md`、per-task review)。
230
+ - 省略 `Execution mode` / `SDD dir` 却期望 SDD 产物(`progress.md`、per-task review)。
232
231
  - 期望 leaf `fullstack-dev` 载入 `mstar-sdd` 并自编排 per-task 循环 — **编排仅 PM**(`mstar-iteration` §2.4–2.5)。
@@ -76,24 +76,12 @@ Detail: **`references/file-handoffs.md`**.
76
76
  | DONE | review-package → task reviewer |
77
77
  | DONE_WITH_CONCERNS | read concerns; fix scope issues before review |
78
78
  | NEEDS_CONTEXT | provide context; re-dispatch. Budget overrun (the declared round cannot close its Files and gates) → split the task per `mstar-artifacts/references/plan-quality-bar.md` item 7 and re-dispatch with a fresh budget |
79
- | BLOCKED | more context, higher tier, split task, or escalate human — **never** same-model blind retry. Budget overrun → split the task per `mstar-artifacts/references/plan-quality-bar.md` item 7 and re-dispatch with a fresh budget |
79
+ | BLOCKED | more context, split task, or escalate human — **never** same-model blind retry. Budget overrun → split the task per `mstar-artifacts/references/plan-quality-bar.md` item 7 and re-dispatch with a fresh budget |
80
80
 
81
81
  ## Reviewer ⚠️ items
82
82
 
83
83
  `⚠️ Cannot verify from diff` does not block other findings. PM must resolve each before task complete.
84
84
 
85
- ## Model tier
86
-
87
- | Tier | Use |
88
- |------|-----|
89
- | fast | Transcription (complete code in plan); 1–2 file mechanical |
90
- | standard | Prose implementer; task reviewer (floor) |
91
- | capable | Integration judgment; plan QC on large branch diff |
92
-
93
- **Turn count beats token price:** use `standard` floor for reviewers and prose implementers. **Always name model on dispatch** — omitted model inherits session default (often most expensive).
94
-
95
- Host mapping → **`mstar-host`** references (`model` / Task field).
96
-
97
85
  ## After all tasks
98
86
 
99
87
  1. `mstar sdd review-package MERGE_BASE HEAD` → branch diff in `{SDD_DIR}/review/`
@@ -36,7 +36,6 @@ PM runs context-dependent `mstar sdd workspace`, `task-brief`, and `review-packa
36
36
  - Absolute report path: `$SDD_DIR/task-N-report.md` — the implementer's own output slot and L2's **input**; the reviewer's separate output is `$SDD_DIR/task-N-review.md`
37
37
  - Absolute control root, feature cwd, branch and plan paths, plus task-specific brief/report/diff paths fixed for this dispatch; the context path is PM coordination metadata, not a leaf checkout selector
38
38
  - **Inherited plan scope, no credentials**: the handoff restates the inherited plan id + absolute paths and nothing more — a leaf neither selects a plan nor writes the workflow snapshot / root register / leases. Session JSON, `mstar plan --session` write credentials and `--expect <revision>` are PM/coordinator-only and **never** appear in a leaf prompt (`mstar-iteration/references/plan-scoped-pm.md` §8)
39
- - `Model tier` → host-specific model (required)
40
39
  - **`SDD implementer session`**: `fresh` (new subagent) or `sticky` (resume — see **`sticky-implementer-session.md`**)
41
40
 
42
41
  ## Implementer report file
@@ -6,7 +6,6 @@ Use when PM continues **`SDD implementer session: sticky`** for Task N>1. Host:
6
6
  Dispatch:
7
7
  Resume: [HOST_AGENT_ID from implementer-session.json]
8
8
  Name: <CamelCaseId> # omp/Cursor name
9
- Model: [same tier as session start unless PM upgrades]
10
9
  Assignment header: canonical fields (`mstar-roles/references/project-manager/dispatch-and-assignment.md`) — MUST include **`Task budget (implement / ops rounds)`**: <budget copied from THIS plan task> in the header region, before the first Task heading / horizontal rule / `#` heading of the body; a `Task budget` string only inside the body section cannot satisfy the engine header gate, and a previous task's budget is not inherited as authorization for this task
11
10
  Prompt body:
12
11
  <SUBAGENT-STOP> Skip PM orchestration skills. You are a leaf implementer continuing a sticky SDD session.</SUBAGENT-STOP>
@@ -8,7 +8,6 @@ For **sticky** continuation (task 2+), use **`implementer-continuation-prompt.md
8
8
  Dispatch:
9
9
  Role: <Execute as role-id> # omp agent / Cursor subagent_type / OpenCode subagent → mstar-host C5
10
10
  Name: <CamelCaseId> # omp/Cursor name
11
- Model: [REQUIRED — per Model tier in Assignment and mstar-sdd SKILL]
12
11
  Assignment header: canonical fields (`mstar-roles/references/project-manager/dispatch-and-assignment.md`) — MUST include **`Task budget (implement / ops rounds)`**: <budget copied from the plan task> in the header region, before the first Task heading / horizontal rule / `#` heading of the body; a `Task budget` string only inside the body section cannot satisfy the engine header gate
13
12
  Prompt body:
14
13
  <SUBAGENT-STOP> Skip PM orchestration skills. You are a leaf implementer.</SUBAGENT-STOP>
@@ -21,7 +21,6 @@ SSOT for mode selection and host resume → this file. Per-task artifacts → **
21
21
  **Execution mode**: sdd
22
22
  **SDD implementer session**: sticky | fresh
23
23
  **SDD dir**: `{HARNESS_DIR}/sdd/<plan-id>/`
24
- **Model tier**: standard
25
24
  **Execute as**: fullstack-dev
26
25
  **Working branch**: <branch>
27
26
  **Covers task**: N | N–M # single task id for this dispatch turn
@@ -7,7 +7,6 @@ Dispatch:
7
7
  Role: code-reviewer # L2 SDD task reviewer; NOT qc-specialist*
8
8
  # omp: agent = "code-reviewer" (when listed) or "reviewer"/"task" + C5b; Cursor: subagent_type = "generalPurpose" fallback → mstar-host C5
9
9
  Name: <CamelCaseId> # omp/Cursor name
10
- Model: [REQUIRED — standard tier default; capable if diff is large/subtle]
11
10
  Prompt body:
12
11
  <SUBAGENT-STOP> Skip PM orchestration. Read-only review.</SUBAGENT-STOP>
13
12
 
@@ -53,6 +53,7 @@ Find the task, run the family, then read its owning skill for the rules around i
53
53
  | Run the pinned integration and record Done; recover a crashed attempt | `mstar plan integration-start`, `mstar plan integration-accept`, `mstar plan complete`, `mstar plan reconcile` | `mstar-branch-worktree`, `mstar-iteration` |
54
54
  | Amend an approved Prepare scope | `mstar workflow show-prepare`, `mstar workflow amend-prepare` | `mstar-artifacts` |
55
55
  | Register a standalone plan workflow; record delivery evidence | `mstar workflow register`, `mstar workflow evidence` | `mstar-artifacts` |
56
+ | Register an iteration workflow | `mstar iteration register` | `mstar-artifacts` (lifecycle semantics) |
56
57
  | Close one finished lifecycle (terminal snapshot + root unregister) | `mstar status workflow-close` | `mstar-iteration` (Phase 6) |
57
58
  | Validate a coordination document before trusting or replacing it | `mstar status validate` | `mstar-artifacts` |
58
59
  | Read the residual rollup; enforce a plan's findings-cleanup mode; register or close deferred backlog | `mstar status tech-debt`, `mstar status findings-cleanup`, `mstar status backlog-register`, `mstar status backlog-close` | `mstar-project-governance`, `mstar-artifacts` |
@@ -31,7 +31,7 @@ Diagnostics go to stderr in every case; a check that prints a rollup (the tech-d
31
31
  | `mstar review seats` | maps an execution mode to its QC seat count; with the reviewer list, asserts tri identity | `mstar-review-qc` | `0` ok · `1` violations · `2` usage |
32
32
  | `mstar worktree check` | pre-dispatch topology at L1: main-worktree residency, the dedicated integration checkout, and the plan's execution-lease feature worktree (existence, branch alignment); the L2 form checks parallel writable tracks | `mstar-branch-worktree`, `mstar-dispatch-gates` | `0` ok · `1` violations · `2` usage |
33
33
  | `mstar worktree qc-alignment` | that the QC/QA alignment fields (plan id, review range, diff basis) are byte-identical across the given seat files, accepting the separate and the combined label forms | `mstar-branch-worktree` | `0` ok · `1` mismatch or missing field · `2` no files given |
34
- | `mstar worktree cleanup` | guarded worktree and branch cleanup for a workflow: merged-evidence-only branch deletion with active-lease, checked-out, foreign, dirty and non-terminal refusals; a dry run by default that prints one verdict row per candidate | `mstar-iteration` (post-merge close) | `0` valid dry run or successful removals · `1` probe or mutation failure · `2` usage |
34
+ | `mstar worktree cleanup` | `worktree cleanup --workflow <id> [--harness <path>] [--apply] [--remote] [--worktree <path>] [--all-workflows] [--verbose] [--ignore-unreadable-snapshots]`: guarded worktree and branch cleanup, default candidates from the selected workflow's recorded claims (`--all-workflows` full sweep; `--worktree` also narrows branch candidates by exact owner; `--verbose` per-pair ancestry diagnostics); dry-run by default printing one verdict row per candidate; ownership / merge-evidence / refusal / apply-order semantics → `mstar-branch-worktree`「Worktree / branch cleanup」 | `mstar-branch-worktree` (call sites: `mstar-iteration` phase-2 same-round + phase-6 post-merge close) | `0` valid dry run or successful removals · `1` probe or mutation failure · `2` usage |
35
35
  | `mstar lease verify` | a plan's execution lease on its snapshot row | `mstar-artifacts` | `0` valid (prints the holder) · `1` missing or invalid |
36
36
  | `mstar lease verify-integration` | the workflow's integration merge lease when present; an absent lease is a valid unclaimed state | `mstar-artifacts`, `mstar-iteration` | `0` unclaimed or valid · `1` invalid lease · `2` usage |
37
37
  | `mstar qc validate-report` | a saved QC seat report against its machine-readable contract: frontmatter fields, verdict vocabulary, body/verdict agreement, summary-to-findings count parity, truncation and verdict coherence | `mstar-review-qc` | `0` ok · `1` violations |
@@ -152,6 +152,10 @@ A read that reports `allowed: false` is an answer, not a failure: fix the blocke
152
152
  - A registered `branch.source` cannot be amended by ordinary evidence: the evidence verb merges only the delivery block, and the one-time kind declaration refuses a value that conflicts with an already-registered anchor. The single exception is the legacy repair verb, which replaces **only** `branch.source` on a pre-fix snapshot whose registered source wrongly equals its target, derived from the sealed accepted handoff — it records no Done, no delivery success and no remote merge, and it is not a general anchor editor.
153
153
  - The close consults this evidence *before* writing the terminal state, so a gate and the close can never disagree. Close order, refusal conditions and the root unregister: `references/status-and-registers.md`.
154
154
 
155
+ ## Iteration workflow registration
156
+
157
+ An iteration does not go through `mstar workflow register`. It registers through `mstar iteration register` — the same create-only, one-lock contract and the same crash recovery (existing snapshot bytes kept, only the missing root entry written on re-run) — with a compass ref, the three branch anchors and Todo plan rows in place of a delivery kind; no delivery kind or evidence declaration applies to it, and plan-row metadata is derived by the producer rather than supplied. Lifecycle semantics: `mstar-artifacts`; flag set: the command help.
158
+
155
159
  ## Exit codes
156
160
 
157
161
  | Code | When |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/dsh",
3
- "version": "3.10.3",
3
+ "version": "3.11.1",
4
4
  "description": "Morning Star harness dsh (DeepSeek Harness) cordis function plugin — in-process engine gates (status/dispatch/lease) with hard refusal channels.",
5
5
  "keywords": [
6
6
  "dsh",