@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.
Files changed (61) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -1
  3. package/dist/mstar.js +4532 -227
  4. package/harness-agents/code-reviewer.md +0 -8
  5. package/harness-skills/mstar-branch-worktree/SKILL.md +14 -14
  6. package/harness-skills/mstar-branch-worktree/references/parallel-writable-pre-dispatch.md +2 -2
  7. package/harness-skills/mstar-compound/SKILL.md +2 -2
  8. package/harness-skills/mstar-compound/references/compound-workflow.md +3 -3
  9. package/harness-skills/mstar-compound-refresh/SKILL.md +4 -4
  10. package/harness-skills/mstar-compound-refresh/references/project-knowledge-bootstrap.md +1 -1
  11. package/harness-skills/mstar-dispatch-gates/SKILL.md +2 -2
  12. package/harness-skills/mstar-engine-legacy/SKILL.md +53 -0
  13. package/harness-skills/mstar-engine-legacy/references/anti-recursion-checklists.md +58 -0
  14. package/harness-skills/mstar-engine-legacy/references/engine-check-boilerplate.md +26 -0
  15. package/harness-skills/mstar-engine-legacy/references/lease-protocol.md +92 -0
  16. package/harness-skills/mstar-engine-legacy/references/qc-seat-n-restatements.md +57 -0
  17. package/harness-skills/mstar-engine-legacy/references/status-field-history.md +186 -0
  18. package/harness-skills/mstar-harness-core/SKILL.md +6 -3
  19. package/harness-skills/mstar-host/references/_shared/plan-mode-bridge-core.md +8 -8
  20. package/harness-skills/mstar-host/references/codex.md +1 -1
  21. package/harness-skills/mstar-host/references/cursor-plan-mode-bridge.md +19 -8
  22. package/harness-skills/mstar-host/references/cursor.md +5 -5
  23. package/harness-skills/mstar-host/references/dsh.md +10 -7
  24. package/harness-skills/mstar-host/references/kimi-plan-mode-bridge.md +3 -3
  25. package/harness-skills/mstar-host/references/kimi.md +1 -1
  26. package/harness-skills/mstar-host/references/omp-plan-mode-bridge.md +2 -2
  27. package/harness-skills/mstar-host/references/omp.md +2 -2
  28. package/harness-skills/mstar-host/references/zcode-plan-mode-bridge.md +3 -3
  29. package/harness-skills/mstar-host/references/zcode.md +1 -1
  30. package/harness-skills/mstar-iteration/SKILL.md +38 -37
  31. package/harness-skills/mstar-iteration/references/autonomous-direction-lock.md +2 -2
  32. package/harness-skills/mstar-iteration/references/iteration-compass-template.md +3 -3
  33. package/harness-skills/mstar-iteration/references/phase-2-worktree-lease.md +50 -38
  34. package/harness-skills/mstar-iteration/references/phase-3-iteration-close.md +7 -7
  35. package/harness-skills/mstar-iteration/references/phase-4-5-pr-delivery.md +2 -2
  36. package/harness-skills/mstar-phase-gates/SKILL.md +3 -3
  37. package/harness-skills/mstar-plan-artifacts/SKILL.md +21 -23
  38. package/harness-skills/mstar-plan-artifacts/references/knowledge-and-designs.md +6 -6
  39. package/harness-skills/mstar-plan-artifacts/references/plan-files-and-reports.md +10 -10
  40. package/harness-skills/mstar-plan-artifacts/references/status-and-residuals.md +190 -309
  41. package/harness-skills/mstar-plan-artifacts/templates/README.md +1 -3
  42. package/harness-skills/mstar-plan-artifacts/templates/status.empty.json +2 -4
  43. package/harness-skills/mstar-plan-conventions/SKILL.md +53 -13
  44. package/harness-skills/mstar-plan-conventions/references/artifact-storage-paths.md +6 -3
  45. package/harness-skills/mstar-plan-conventions/references/harness-bootstrap-and-agents-layering.md +9 -10
  46. package/harness-skills/mstar-project-governance/SKILL.md +118 -0
  47. package/harness-skills/mstar-review-qc/SKILL.md +3 -3
  48. package/harness-skills/mstar-roles/references/project-manager/dispatch-and-assignment.md +1 -1
  49. package/harness-skills/mstar-roles/references/project-manager/plan-management.md +6 -8
  50. package/harness-skills/mstar-roles/references/project-manager/qc-and-residuals.md +6 -6
  51. package/harness-skills/mstar-roles/references/project-manager.md +7 -7
  52. package/harness-skills/mstar-roles/references/qc-specialist/deep-review-lenses.md +1 -1
  53. package/harness-skills/mstar-roles/references/qc-specialist/report-template.md +1 -1
  54. package/harness-skills/mstar-roles/references/qc-specialist/reviewer-workflow.md +1 -1
  55. package/harness-skills/mstar-roles/references/qc-specialist-shared.md +2 -2
  56. package/harness-skills/mstar-sdd/SKILL.md +2 -2
  57. package/harness-skills/mstar-sdd/references/file-handoffs.md +1 -1
  58. package/package.json +1 -1
  59. package/harness-skills/mstar-plan-artifacts/references/done-compaction.md +0 -88
  60. package/harness-skills/mstar-plan-artifacts/templates/notes.empty.json +0 -5
  61. package/harness-skills/mstar-plan-artifacts/templates/plans-done.empty.json +0 -3
@@ -0,0 +1,186 @@
1
+ # Status v1→v2 field history (archived contract prose)
2
+
3
+ > Engine-absent fallback: the full field tables displaced from `mstar-plan-artifacts` when engine validators took over the same contract. Engine-present hosts read `mstar-plan-artifacts/references/status-and-residuals.md` (v2) instead; this file is the historical + fallback full text.
4
+
5
+ ## v1 `{HARNESS_DIR}/status.json` — full shape (historical)
6
+
7
+ `status.json` lived at `{HARNESS_DIR}/status.json` and was the **SSOT** for `plans[]` row status and open residual findings. Closed residuals were archived to `{HARNESS_DIR}/archived/residuals/<plan-id>.json`.
8
+
9
+ ```json
10
+ {
11
+ "version": 1,
12
+ "updated_at": "YYYY-MM-DD",
13
+ "plans": [
14
+ {
15
+ "id": "plan-id",
16
+ "title": "Plan title",
17
+ "file": "{PLAN_DIR}/plan-id-feature-name.md",
18
+ "status": "Todo | InProgress | InReview | Blocked | Done",
19
+ "owner": "@project-manager",
20
+ "agents": ["@fullstack-dev"],
21
+ "progress": 0,
22
+ "tags": [],
23
+ "created_at": "YYYY-MM-DD",
24
+ "updated_at": "YYYY-MM-DD",
25
+ "done_at": null,
26
+ "notes": "",
27
+ "metadata": {}
28
+ }
29
+ ],
30
+ "residual_findings": {
31
+ "plan-id": [
32
+ {
33
+ "id": "R1",
34
+ "title": "Finding title",
35
+ "severity": "critical | high | medium | low | nit",
36
+ "source": "QC-#1 qc1.md F-001 @ <review-range>, QA qa.md, review, …",
37
+ "scope": "Affected file or component",
38
+ "decision": "defer | accept | risk-accepted",
39
+ "owner": "@fullstack-dev",
40
+ "target": "Before plan 02 / YYYY-MM-DD / milestone",
41
+ "tracking": "Issue URL or null",
42
+ "detail_doc": "{PLAN_DIR}/residuals/plan-id/R1-short-label.md"
43
+ }
44
+ ]
45
+ },
46
+ "metadata": {}
47
+ }
48
+ ```
49
+
50
+ Closed residual entries added: `lifecycle`, `closed_at`, `closure_note`; optional `closure_evidence`, `superseded_by`.
51
+
52
+ ## v1 `plans[]` row fields
53
+
54
+ | Field | Meaning |
55
+ | --- | --- |
56
+ | `id` | Plan id (legacy alias `plan_id` read-compatible). |
57
+ | `title` / `file` | Display title / main plan path (`{PLAN_DIR}/…`). |
58
+ | `status` | `Todo \| InProgress \| InReview \| Blocked \| Done` (Done only by `@project-manager` / `@qa-engineer`). |
59
+ | `owner` / `agents` / `progress` / `tags` | PM ownership, role agents, progress 0–100, tags. |
60
+ | `created_at` / `updated_at` / `done_at` | `YYYY-MM-DD`; `done_at` set at Done. |
61
+ | `notes` | Per-plan timeline (string array recommended; legacy string OK). |
62
+ | `metadata` | Optional object (see below). |
63
+
64
+ ## v1 `plans[].metadata` standard optional fields
65
+
66
+ | Key | Type | Purpose |
67
+ | --- | --- | --- |
68
+ | `findings_cleanup` | `zero-residual` \| `allow-residual` | Mirror of Assignment `Findings cleanup`. |
69
+ | `working_branch` | string | Implementation branch; aligns with Assignment `Working branch` (SSOT). |
70
+ | `spec_integration_branch` | string | (Multi-plan same Spec) integration branch; created from root `metadata.iteration_base_branch`. |
71
+ | `merge_target` | string | Next merge target; final PR target is root `metadata.target_branch`. |
72
+ | `branch_policy` | string | One-line policy per `mstar-harness-core`. |
73
+ | `phase` / `priority` / `description` / `scope` | string | Program label; `high\|medium\|low`; one-line scope (pick one key per repo). |
74
+ | `gates` | object | Gate summary (`qc`, `qa`, `typecheck`, `tests`, `lint`, …). |
75
+ | `blocked_since` / `blocked_reason` / `blocked_by_plan_id` / `dependency` / `next_action` | string | Block bookkeeping + deps + next step. |
76
+ | `primary_spec` / `iteration_compass` / `iteration_refs` | string / string[] | Spec / compass pointers. |
77
+ | `qc_status` / `tests` / `commits` | string | InReview/Done snapshots — not a substitute for durable gate summaries or root `residual_findings`. |
78
+ | `sdd_dir` / `sdd_progress` / `review_bundle` / `task_commits` | string / array | SDD scratch path, progress ledger pointer, review bundle pointer, `{task_id,base,head}[]`. |
79
+
80
+ ### v1 `plans[].execution_lease` (iteration Phase 2)
81
+
82
+ | Field | Type | Required | Semantics |
83
+ | --- | --- | --- | --- |
84
+ | `holder` | non-empty string | Yes | Opaque cooperative owner identity (recommended `<host>:<stable-session-id>`, e.g. `cursor:bc-1234`); stable for claim lifetime; **no credentials**; used for ownership comparison — not `session_label`. |
85
+ | `claimed_at` | RFC 3339 UTC (`Z`) | Yes | Acquisition time (audit only; **not** an expiry clock). |
86
+ | `worktree_path` | absolute path string | Yes | Dedicated feature-worktree root; **MUST** differ from `metadata.control_worktree_path`. |
87
+ | `working_branch` | non-empty string | Yes | Feature branch at `worktree_path`; MUST agree with Assignment `Working branch`. |
88
+ | `session_label` | string | No | Human display only — **MUST NOT** authorize or compare ownership. |
89
+
90
+ Writers **delete** `execution_lease` on release; `null` and tombstone objects are invalid.
91
+
92
+ ## v1 root `metadata` standard optional fields
93
+
94
+ | Key | Type | Purpose |
95
+ | --- | --- | --- |
96
+ | `versioning` | object | Cross-plan conventions (team-defined). |
97
+ | `iteration_base_branch` | string | Branch/ref used to create `spec_integration_branch`; required for formal iterations. |
98
+ | `target_branch` | string | Final PR target after iteration-close; required for formal iterations. |
99
+ | `notes` | array | **Legacy** — prefer `{HARNESS_DIR}/notes.json`. |
100
+ | `residual_findings_history` | object | **Legacy** — prefer `archived/residuals/<plan-id>.json`. |
101
+ | `tech_debt_summary` | object | Optional rollup over open R# (engine `techDebtRollup`). |
102
+ | `control_worktree_path` | absolute path string | Iteration Phase 2: canonical repository root checked out to active `spec_integration_branch`; coordination + serial merge cwd. |
103
+ | `integration_merge_lease` | object | While one integration merge is owned; **absent** = unclaimed. Writers **delete** the key on release — never `null`/tombstones. |
104
+
105
+ ## v1 residual entry contract (9 required fields + severity/lifecycle)
106
+
107
+ Entry keys mirroring engine `RESIDUAL_REQUIRED_FIELDS`: `id`, `title`, `severity`, `source`, `scope`, `decision`, `owner`, `target`, `tracking` (+ optional `detail_doc`). Malformed entries (non-object, missing any required field, or severity outside enum) were rejected fail-loud by `validateResidual` / `validateStatus` — never silent pass-through.
108
+
109
+ ### Severity (machine enum, lowercase English only)
110
+
111
+ `critical` > `high` > `medium` > `low` > `nit`. `nit` is always lighter than `low`. Forbidden in JSON: `warning`, `Major`, non-English. Legacy `"severity": "warning"` read+rolled up as `low`. QC report **Critical / Warning / Suggestion** are section titles — never copied verbatim into JSON.
112
+
113
+ ### Lifecycle states
114
+
115
+ `open` (default; omit field) · `resolved` · `waived` · `superseded` · `duplicate`. On close set `closed_at` (`YYYY-MM-DD`) + `closure_note`; recommend `closure_evidence` (PR/commit/test/doc anchor). Owners: fix → implementer; verify → QA (when `QA gate: mandatory`) else PM; write SSOT → PM or QA.
116
+
117
+ ## v1 archive shapes (historical)
118
+
119
+ **`archived/residuals/<plan-id>.json`** (append to `entries`):
120
+
121
+ ```json
122
+ {
123
+ "plan_id": "01-data-infrastructure",
124
+ "schema_version": 1,
125
+ "entries": [
126
+ {
127
+ "id": "R1",
128
+ "severity": "medium",
129
+ "lifecycle": "resolved",
130
+ "closed_at": "2026-04-06",
131
+ "closure_note": "…",
132
+ "closure_evidence": "PR #42 / commit …",
133
+ "archived_at": "2026-04-07"
134
+ }
135
+ ]
136
+ }
137
+ ```
138
+
139
+ **`{HARNESS_DIR}/notes.json`** (append-only program timeline):
140
+
141
+ ```json
142
+ { "schema_version": 1, "updated_at": "YYYY-MM-DD",
143
+ "entries": [{ "at": "2026-04-08", "message": "Short milestone", "plan_id": "01-data-infrastructure" }] }
144
+ ```
145
+
146
+ `plans[].notes` = per-plan timeline; `notes.json` = cross-plan milestones.
147
+
148
+ ## v1 jq / flock examples (legacy read paths)
149
+
150
+ ```bash
151
+ # Replace .mstar with your resolved {HARNESS_DIR}; legacy projects may use .agents.
152
+ jq '.plans[] | select(.id == "01-data-infrastructure")' .mstar/status.json
153
+ jq '.residual_findings["01-data-infrastructure"] // .metadata.residual_findings["01-data-infrastructure"]' .mstar/status.json
154
+ jq '.entries[] | select(.id == "R1")' .mstar/archived/residuals/01-data-infrastructure.json
155
+ ```
156
+
157
+ Legacy read paths (root `residual_findings` / `metadata.residual_findings` / `archived/residuals/<plan-id>.json`) were **legacy read-only**; `mstar migrate` moved open entries into the register.
158
+
159
+ ## v2 destinations (where each v1 surface landed)
160
+
161
+ | v1 surface | v2 home |
162
+ | --- | --- |
163
+ | root `plans[]` rows | `{WORKFLOW_DIR}/<id>/snapshot.json` → `plans[]` (legacy PlanRow shape verbatim) |
164
+ | root `plans[].execution_lease` | snapshot plan row `execution_lease` |
165
+ | root `metadata.integration_merge_lease` | snapshot top-level `integration_merge_lease` |
166
+ | root `metadata.control_worktree_path` | snapshot top-level `control_worktree_path` |
167
+ | root `metadata.iteration_base_branch` / `target_branch` / `spec_integration_branch` / `merge_target` | snapshot top-level `branch.{base,integration,target}` |
168
+ | root `metadata.plan_parallelism` / `worktree_mode` / `push_policy` | snapshot `execution_policy` |
169
+ | root `metadata.notes` / legacy row `notes` | `{WORKFLOW_DIR}/<id>/notes.jsonl` (runtime ledger; row `notes` kept verbatim as legacy copy) |
170
+ | root `residual_findings` | `{PROJECT_DIR}/<id>/residuals.json` → `entries[<plan-id>]` (array semantics preserved) |
171
+ | `archived/residuals/<plan-id>.json` | register **close in place** (lifecycle/closed_at/closure_note on the entry) |
172
+ | `metadata.tech_debt_summary` | derived `mstar status tech-debt <project-dir>` rollup (v1 stored drift path dead) |
173
+ | root `version: 1` | root `version: 2` + `workflows[]` (active-only registry; terminal rows removed after snapshot write) |
174
+ | v1 root `plans[]`/`residual_findings` trees | migrated first via `mstar migrate [--dry-run] [--path <root>]` |
175
+
176
+ Root v2 shape:
177
+
178
+ ```json
179
+ { "version": 2, "updated_at": "YYYY-MM-DD",
180
+ "workflows": [{ "id": "<plan-or-iteration-id>", "type": "plan | iteration", "started_at": "YYYY-MM-DD", "dir": "workflows/<id>" }] }
181
+ ```
182
+
183
+ ## Compatibility
184
+
185
+ - Read: accept `id` or `plan_id`; write: one canonical key (prefer `id`).
186
+ - Document the canonical key in `{HARNESS_DIR}/AGENTS.md` if migrating.
@@ -12,6 +12,7 @@ description: Morning Star (启明星) harness **强制全局入口** —— 信
12
12
  - 凡 **`mstar-*`**(`name` ≠ `mstar-harness-core`)假定读者**已 Read 本 skill**。
13
13
  - **仅读专题、未读核心** → 未完成 harness 加载。
14
14
  - 各专题 SKILL.md 含 **Load order**;按 **`mstar-harness-core`** 专题 skill 索引 + 角色 load contract 按需加载,**禁止**为「保险」通读全部专题。
15
+ - **加载条件(`mstar-engine-legacy`)**:`mstar-engine-legacy` 是**条件契约档案**(engine-absent fallback)。**engine 约束激活(或宿主含 engine 能力)时不加载**——engine-present 宿主以运行时 skills 的 engine-check 指针 + engine 校验为权威;仅 engine-absent 宿主(无 `mstar` CLI / engine import)为找回被 engine 校验接管的 contract 全文而读取(触发契约见其 description)。
15
16
 
16
17
  ## Standalone harness(`mstar-*` 自洽)
17
18
 
@@ -52,7 +53,7 @@ Routing eval(Cursor 插件内回归用,**非**运行时必读)→ `.cursor
52
53
  - **`Done`**:仅 `@project-manager` 或 `@qa-engineer`。
53
54
  - 实现类可设 **`InReview`**,不可设 **`Done`**。
54
55
 
55
- `status.json` 字段与 residual → **`mstar-plan-artifacts`**。
56
+ `status.json`(v2 根)/ workflow snapshot / project register 字段与 residual → **`mstar-plan-artifacts`**。
56
57
 
57
58
  ## Task category(路由摘要)
58
59
 
@@ -90,10 +91,12 @@ PM 在 Assignment 写 **`Task category`**(主类 + 可选 `secondary`):
90
91
  | `mstar-phase-gates` | per-plan 双阶段门禁:Prepare/Execute、意图门禁、hotfix、可验证编辑 |
91
92
  | `mstar-iteration` | 迭代管理:Phase 1–5(start / Autonomous Execute / iteration-close / PR delivery / PR merge-ready loop) |
92
93
  | `mstar-dispatch-gates` | 派发、Delegation、反递归、SDD 串行、SDD 路径 plan QC 强制 tri |
94
+ | `mstar-engine-legacy` | 条件契约档案(engine-absent fallback):status v1→v2 字段历史、lease 协议全文、各宿主 N=3/N=1 重述、反递归全清单、Engine-check 样板;engine 激活时不加载 |
93
95
  | `mstar-sdd` | Subagent-driven development:file handoff、per-task review、ledger |
94
96
  | `mstar-branch-worktree` | 功能分支、worktree、QC/QA 检出对齐 |
95
97
  | `mstar-plan-conventions` | `{HARNESS_DIR}` 发现、初始化、Spec 分支模型摘要、产物路径 SSOT |
96
- | `mstar-plan-artifacts` | 主 plan、review bundle / durable summaries、`status.json`、residual、knowledge、Done 归档 |
98
+ | `mstar-plan-artifacts` | 主 plan、review bundle / durable summaries、`status.json`(v2 根)+ workflow snapshots + project register、residual、knowledge |
99
+ | `mstar-project-governance` | 项目治理层:`projects/<id>/roadmap.md` 编写约定 + `residuals.json` register 生命周期(open → verified close in place)、`_default` 回退、provenance;schema 与 engine `project.ts` 逐字一致 |
97
100
  | `mstar-design-md` | DESIGN.md 设计系统规范 —— 创建/审计/维护 design tokens,三级检查清单,light/dark 双主题 |
98
101
  | `mstar-review-qc` | PM:QC tri 编排、residual 留档、四层边界;leaf 执行 → `mstar-roles/references/qc-specialist/` |
99
102
  | `mstar-coding-behavior` | Think / Simplicity / Surgical / Debugging / Review Feedback / Goal-Driven / Communication |
@@ -148,7 +151,7 @@ Read **`mstar-host`** after this skill; detect host per its table, then Read the
148
151
  | 因默认 gitignore 致 feature 缺 plans 而 `Worktree mode: waived`(应保留 feature worktree + control 绝对 Plan Path / SDD dir;无 flock 仅 → `Plan parallelism: serial`) | `mstar-branch-worktree` · `mstar-iteration` §2.0 #5 · `phase-2-worktree-lease` |
149
152
  | 并行 writable implement 无隔离(L2 同 plan 多轨:N invoke ≠ worktree;L1 跨 plan:无 verified `execution_lease` + feature worktree) | `mstar-branch-worktree` L1/L2 · `mstar-iteration` §2.6 · `references/parallel-writable-pre-dispatch.md` |
150
153
  | 跨 plan 可写派发无 verified `execution_lease` / steal 活跃 lease / 并行 merge 入 `spec_integration_branch` | `mstar-iteration` · `mstar-plan-artifacts`(leases)· `mstar-branch-worktree` L1 |
151
- | `InProgress` 无 `execution_lease` 未恢复即可写派发 | `mstar-plan-artifacts` — orphan recovery |
154
+ | `InProgress` 无 `execution_lease`(snapshot 行)未恢复即可写派发 | `mstar-plan-artifacts` — orphan recovery |
152
155
  | 混淆跨 plan lease 门控并行与单 plan 内 SDD 并行 implementer | `mstar-dispatch-gates` · `mstar-sdd` |
153
156
  | residual 只写 plan 不写 SSOT | `mstar-plan-artifacts` |
154
157
  | `zero-residual` 下把可修 findings 登记为 open R# / 草草 `Approve with residuals` | `mstar-plan-artifacts` Findings cleanup modes · `mstar-review-qc` |
@@ -6,13 +6,13 @@ Each per-host bridge (`cursor-plan-mode-bridge.md`, `kimi-plan-mode-bridge.md`,
6
6
 
7
7
  ## Dual-write SSOT rule
8
8
 
9
- The host **Plan mode** (session plan file, todos, UI) is a **session UX mirror**. Morning Star **SSOT** lives on disk under **`{HARNESS_DIR}`** (default `.mstar/`, legacy `.agents/`): the main plan in `{PLAN_DIR}/<plan-id>-<name>.md`, the plan registry in `{HARNESS_DIR}/status.json`, the iteration compass under `{ITERATION_DIR}/…` when in a formal iteration. Mirror every durable plan artifact to the repo; never treat the host plan file/URI/UI alone as the handoff surface.
9
+ The host **Plan mode** (session plan file, todos, UI) is a **session UX mirror**. Morning Star **SSOT** lives on disk under **`{HARNESS_DIR}`** (default `.mstar/`, legacy `.agents/`): the main plan in `{PLAN_DIR}/<plan-id>-<name>.md`, the plan registry in `{HARNESS_DIR}/status.json` (v2 root `workflows[]`) + per-lifecycle `{WORKFLOW_DIR}/<id>/snapshot.json` (`plans[]` rows + leases), the iteration compass under `{ITERATION_DIR}/…` when in a formal iteration. Mirror every durable plan artifact to the repo; never treat the host plan file/URI/UI alone as the handoff surface.
10
10
 
11
11
  ### Priority (hard)
12
12
 
13
13
  1. User explicit instructions (this turn)
14
14
  2. Project `AGENTS.md` / `CLAUDE.md`
15
- 3. **`{HARNESS_DIR}` / `{PLAN_DIR}` / `status.json`** (harness SSOT)
15
+ 3. **`{HARNESS_DIR}` / `{PLAN_DIR}` / `status.json` (v2) + workflow snapshot** (harness SSOT)
16
16
  4. Host session plan / todos / UI (session UX mirror) — the host bridge names its surfaces
17
17
 
18
18
  **NEVER** cite only a host plan path / session todo list / chat summary in Assignment **Plan Path**, **Context Loaded**, or Completion Report when `{PLAN_DIR}/<plan-id>-<name>.md` should exist.
@@ -21,7 +21,7 @@ The host **Plan mode** (session plan file, todos, UI) is a **session UX mirror**
21
21
 
22
22
  1. **Read** (minimum): `mstar-plan-conventions`, `mstar-plan-artifacts` (SKILL.md); Prepare gates from `mstar-phase-gates` if not hotfix.
23
23
  2. **Discover** `{HARNESS_DIR}` / `{PLAN_DIR}` per `mstar-plan-conventions` (prefer `.mstar/` + `.mstar/plans/`; reuse legacy `.agents/` only when already present and `.mstar/` is absent).
24
- 3. **Initialize** if absent: `{HARNESS_DIR}/`, `{PLAN_DIR}/`, `status.json` from `mstar-plan-artifacts/templates/status.empty.json`, `archived/residuals/`, Morning Star process-artifact gitignore set (canonical snippet → `mstar-plan-conventions` SKILL.md「Git 跟踪策略」). Full PM checklist: `mstar-roles/references/project-manager/plan-management.md`.
24
+ 3. **Initialize** if absent: `{HARNESS_DIR}/`, `{PLAN_DIR}/`, `status.json` from `mstar-plan-artifacts/templates/status.empty.json` (v2 shape), Morning Star process-artifact gitignore set (canonical snippet → `mstar-plan-conventions` SKILL.md「Git 跟踪策略」; `workflows/` / `projects/` subdirs are created on demand by engine writers, not pre-created). Full PM checklist: `mstar-roles/references/project-manager/plan-management.md`.
25
25
 
26
26
  ## Build resume contract
27
27
 
@@ -45,8 +45,8 @@ Not allowed in the parent Build session by default: product implementation, test
45
45
 
46
46
  | Todo ID (use in title) | Goal | On-disk outcome |
47
47
  |------------------------|------|-----------------|
48
- | **`harness-init`** | Bootstrap harness tree | `{HARNESS_DIR}/`, `{PLAN_DIR}/`, process-artifact gitignore set, `archived/residuals/`, `status.json` initialized |
49
- | **`spec-register`** | Register plan in SSOT | New `plans[]` row in `status.json` (`id`, `status`, `file`, `metadata`); spec stub in `{SPECS_DIR}` or plan frontmatter |
48
+ | **`harness-init`** | Bootstrap harness tree | `{HARNESS_DIR}/`, `{PLAN_DIR}/`, process-artifact gitignore set, `status.json` (v2) initialized (`workflows/` / `projects/` created on demand by engine writers) |
49
+ | **`spec-register`** | Register plan in SSOT | New root `workflows[]` entry (`{HARNESS_DIR}/status.json` v2) + `plans[]` row in `{WORKFLOW_DIR}/<id>/snapshot.json` (`id`, `status`, `file`, `metadata`); spec stub in `{SPECS_DIR}` or plan frontmatter |
50
50
  | **`mirror-plan`** | SSOT main plan file | `{PLAN_DIR}/<plan-id>-<name>.md` with task checkboxes aligned to the host plan body |
51
51
 
52
52
  After the host plan is created, keep the host plan body and mirror file **in sync** when scope changes (update both in the same coordination round).
@@ -57,7 +57,7 @@ After the host plan is created, keep the host plan body and mirror file **in syn
57
57
 
58
58
  1. **Commit**: `git add` + `git commit` on the authorized **Working branch** for this **task id** (one commit per task unless PM explicitly allowed batched commits in Assignment).
59
59
  2. **Plan checkbox**: Set `- [x]` on the matching line in `{PLAN_DIR}/<plan-id>-<name>.md`.
60
- 3. **status.json** (when PM round requires): bump `plans[].status` (e.g. `InProgress`) or append coordination notes per `mstar-plan-artifacts`.
60
+ 3. **status.json / snapshot** (when PM round requires): bump the snapshot plan row `plans[].status` (e.g. `InProgress`) or append coordination notes to `{WORKFLOW_DIR}/<id>/notes.jsonl` per `mstar-plan-artifacts`.
61
61
  4. **Evidence**: Record real `git log -1 --oneline` in Completion Report **Git** (or the plan-mode status note if executing as PM in Plan mode).
62
62
 
63
63
  **NEVER**
@@ -80,11 +80,11 @@ Dev-role NEVER rules also apply when executing as implementer: `mstar-roles/refe
80
80
 
81
81
  | Anti-pattern | Fix |
82
82
  |--------------|-----|
83
- | Host plan only, no `{HARNESS_DIR}` files | Run bootstrap todos; write mirror plan + status.json |
83
+ | Host plan only, no `{HARNESS_DIR}` files | Run bootstrap todos; write mirror plan + status.json/snapshot |
84
84
  | Todo done, no commit | Commit per task; paste `git log -1` evidence |
85
85
  | Drift between host plan and SSOT plan | Update both in same round |
86
86
  | Host plan URI as Plan Path | Use `{PLAN_DIR}/...` path |
87
- | Skip `spec-register` | Add `plans[]` row before implement |
87
+ | Skip `spec-register` | Add the snapshot `plans[]` row + root `workflows[]` entry before implement |
88
88
  | Build starts coding in the parent session | Resume PM context; dispatch implement work or block on missing Assignment |
89
89
  | Host plan approval treated as Done authority | Check harness plan/status/QC/QA gates first |
90
90
  | Resume starts coding from host chat summary | Reload harness context and SSOT plan/status first |
@@ -30,7 +30,7 @@ Use skill names in prompts and references. Avoid absolute local paths unless the
30
30
  - Codex does not imply an OpenCode-style `question` tool.
31
31
  - If a structured user-input tool is available in the active mode, use it for concise 1-3 choice decisions.
32
32
  - Otherwise ask one concise Markdown question only after codebase exploration cannot answer it.
33
- - `update_plan` / local todo UI is session progress only; it does not replace `{PLAN_DIR}` plans or `{HARNESS_DIR}/status.json`.
33
+ - `update_plan` / local todo UI is session progress only; it does not replace `{PLAN_DIR}` plans or `{HARNESS_DIR}/status.json` (v2 root `workflows[]`) + `{WORKFLOW_DIR}/<id>/snapshot.json` (`plans[]` rows).
34
34
  - Codex Goal Mode objective is completion criteria for the host thread, not Morning Star Done authority; mirror it into the SSOT plan when the work is implementation-sized.
35
35
 
36
36
  ## Dispatch and role execution
@@ -21,13 +21,24 @@ Bootstrap todos `harness-init` / `spec-register` / `mirror-plan` (emit first, in
21
21
 
22
22
  ### `spec-register` minimum fields
23
23
 
24
- Add one object to `status.json` `plans[]`:
24
+ Add a root `workflows[]` entry to `status.json` (v2) + one `plans[]` object to the workflow snapshot:
25
25
 
26
26
  ```json
27
+ // {HARNESS_DIR}/status.json (v2 root) — active lifecycle entry
28
+ {
29
+ "id": "<plan-id>",
30
+ "type": "plan",
31
+ "started_at": "YYYY-MM-DD",
32
+ "dir": "workflows/<plan-id>"
33
+ }
34
+ ```
35
+
36
+ ```json
37
+ // {WORKFLOW_DIR}/<plan-id>/snapshot.json — plan row (schema_version 1)
27
38
  {
28
39
  "id": "<plan-id>",
29
40
  "status": "Todo",
30
- "file": ".mstar/plans/<plan-id>-<short-name>.md",
41
+ "file": ".mstar/plans/<plan-id>-<short-name>.md",
31
42
  "metadata": {
32
43
  "primary_spec": "<spec-id or path if known>",
33
44
  "description": "<one-line summary>"
@@ -35,14 +46,14 @@ Add one object to `status.json` → `plans[]`:
35
46
  }
36
47
  ```
37
48
 
38
- Set `updated_at` on `status.json` to today (`YYYY-MM-DD`). Commit **tracked results** in the business repo when applicable: `{HARNESS_DIR}/AGENTS.md`, `{KNOWLEDGE_DIR}/`, `{SPECS_DIR}/` (default git policy — see `mstar-plan-conventions`). Do **not** default `git add` for `status.json`, `plans/`, or `iterations/`.
49
+ Set `updated_at` on `status.json` / the snapshot to today (`YYYY-MM-DD`). Commit **tracked results** in the business repo when applicable: `{HARNESS_DIR}/AGENTS.md`, `{KNOWLEDGE_DIR}/`, `{SPECS_DIR}/` (default git policy — see `mstar-plan-conventions`). Do **not** default `git add` for `status.json`, `workflows/`, `projects/`, `plans/`, or `iterations/`.
39
50
 
40
51
  ### `mirror-plan` minimum content
41
52
 
42
53
  - YAML or markdown frontmatter with `plan_id`, title, status (`Todo` / `InProgress` — not `Done` unless PM/QA authority).
43
54
  - **Task list** as markdown checkboxes (`- [ ]` / `- [x]`) matching CreatePlan implement todos.
44
55
  - **Roadmap / deferred scope** section when delivery is staged, partial, or uses a temporary workaround.
45
- - Link: “SSOT status: `{HARNESS_DIR}/status.json` → `plans[]` / `residual_findings`.”
56
+ - Link: “SSOT status: `{HARNESS_DIR}/status.json` (v2 `workflows[]`) → `{WORKFLOW_DIR}/<id>/snapshot.json` `plans[]`; open residuals → `{PROJECT_DIR}/<id>/residuals.json`.”
46
57
 
47
58
  After **CreatePlan**, keep CreatePlan body and mirror file **in sync** when scope changes (update both in the same coordination round).
48
59
 
@@ -76,8 +87,8 @@ Use this structure in CreatePlan `plan` markdown; mirror the same sections into
76
87
 
77
88
  ### Bootstrap (fixed prefix — complete before implement)
78
89
 
79
- 1. harness-init — init .mstar/, status.json, process-artifact gitignore set, archived/residuals/
80
- 2. spec-register — register plan_id in status.json; spec stub if applicable
90
+ 1. harness-init — init .mstar/, status.json (v2), process-artifact gitignore set
91
+ 2. spec-register — register the root `workflows[]` entry + snapshot plan row; spec stub if applicable
81
92
  3. mirror-plan — write .mstar/plans/<plan-id>-<short-name>.md
82
93
 
83
94
  ### Implement
@@ -104,7 +115,7 @@ Commit → SSOT checkbox → `status.json` sync → `git log -1 --oneline` evide
104
115
  Before switching from Plan to Agent for implementation (or declaring Plan phase complete):
105
116
 
106
117
  - [ ] `{PLAN_DIR}/<plan-id>-<name>.md` exists on disk
107
- - [ ] `status.json` contains `plans[]` entry with matching `id` and `file`
118
+ - [ ] Root `status.json` `workflows[]` contains the entry and `{WORKFLOW_DIR}/<id>/snapshot.json` contains the `plans[]` row with matching `id` and `file`
108
119
  - [ ] Bootstrap todos `harness-init`, `spec-register`, `mirror-plan` are **done**
109
120
  - [ ] CreatePlan implement todos reference **task ids** traceable to SSOT plan checkboxes
110
121
  - [ ] If staged/partial/temporary, CreatePlan and SSOT plan both contain `Roadmap / deferred scope`
@@ -139,7 +150,7 @@ When starting a **new iteration** under Cursor Plan mode (host command may orche
139
150
 
140
151
  **Single CreatePlan URI (HARD)**: one CreatePlan per Phase 1 Plan session. Updates use file edit tools on that path. If a duplicate plan file was created by mistake: merge into the original, delete the duplicate, keep View Plan on the original.
141
152
 
142
- **Bootstrap relationship**: ordinary per-plan work still uses `harness-init` / `spec-register` / `mirror-plan`. Phase 1 CreatePlan uses Phase 1 todos (`harness-init` → `finalize-compass-plans` → review-edit seats → `pm-lock` → `integration-branch`). Business `plans[]` rows should exist as drafts before Build when direction has converged.
153
+ **Bootstrap relationship**: ordinary per-plan work still uses `harness-init` / `spec-register` / `mirror-plan`. Phase 1 CreatePlan uses Phase 1 todos (`harness-init` → `finalize-compass-plans` → review-edit seats → `pm-lock` → `integration-branch`). Snapshot `plans[]` rows should exist as drafts before Build when direction has converged.
143
154
 
144
155
  **Helpers**: third-party interview helpers are **not** named here; host **command** layer may use them only after feedback-close when gaps remain.
145
156
 
@@ -12,7 +12,7 @@ Parallel PM dispatch: **`parallel-dispatch.md`** (Task tool uses same turn model
12
12
 
13
13
  ## Plan mode × harness dual-write
14
14
 
15
- When **Plan mode** is active, **CreatePlan is session UX**; SSOT is **`{HARNESS_DIR}`** (default `.mstar/`, legacy `.agents/`) — `{PLAN_DIR}/<plan-id>-<name>.md`, `{HARNESS_DIR}/status.json`.
15
+ When **Plan mode** is active, **CreatePlan is session UX**; SSOT is **`{HARNESS_DIR}`** (default `.mstar/`, legacy `.agents/`) — `{PLAN_DIR}/<plan-id>-<name>.md`, `{HARNESS_DIR}/status.json` (v2 root `workflows[]`) + `{WORKFLOW_DIR}/<id>/snapshot.json` (`plans[]` rows).
16
16
 
17
17
  Before first **CreatePlan**: Read `mstar-plan-conventions`, `mstar-plan-artifacts`, Prepare gates from `mstar-phase-gates` when not hotfix. Full procedure: **`cursor-plan-mode-bridge.md`**.
18
18
 
@@ -20,13 +20,13 @@ Before first **CreatePlan**: Read `mstar-plan-conventions`, `mstar-plan-artifact
20
20
 
21
21
  | Todo ID | Purpose |
22
22
  |---------|---------|
23
- | `harness-init` | Init `{HARNESS_DIR}`, `{PLAN_DIR}`, process-artifact gitignore set (`plans/`, `iterations/`, `sdd/`, `status.json`, …), `archived/residuals/`, `status.json` |
24
- | `spec-register` | Register `plan_id` in `status.json.plans[]` + spec stub if applicable |
23
+ | `harness-init` | Init `{HARNESS_DIR}`, `{PLAN_DIR}`, process-artifact gitignore set (`plans/`, `iterations/`, `sdd/`, `status.json`, `workflows/`, `projects/`, …), `status.json` (v2 template) |
24
+ | `spec-register` | Register the root `workflows[]` entry + snapshot plan row (`{WORKFLOW_DIR}/<id>/snapshot.json` → `plans[]`) + spec stub if applicable |
25
25
  | `mirror-plan` | Write SSOT main plan under `{PLAN_DIR}/` |
26
26
 
27
- Each **implement todo**: per–task-ID **git commit** on Working branch → SSOT `- [x]` → optional `status.json` sync → `git log -1 --oneline` evidence.
27
+ Each **implement todo**: per–task-ID **git commit** on Working branch → SSOT `- [x]` → optional snapshot sync → `git log -1 --oneline` evidence.
28
28
 
29
- Before **SwitchMode → Agent**: mirror plan exists; `status.json` lists `plan_id`; bootstrap todos done. **Never** use only the Cursor plan URI as **Plan Path**.
29
+ Before **SwitchMode → Agent**: mirror plan exists; snapshot lists `plan_id` + root `workflows[]` entry; bootstrap todos done. **Never** use only the Cursor plan URI as **Plan Path**.
30
30
 
31
31
  After **Build**: treat the run as plan resume, not `/pm` replay. Reload `mstar-harness-core` + this Cursor reference, resume Morning Star plans as `project-manager` orchestration, and dispatch implementation through Task unless the user explicitly overrides the harness.
32
32
 
@@ -295,11 +295,12 @@ The plugin wires the engine gates on dsh seams (all in-process):
295
295
 
296
296
  **Enforcement semantics**: warn-only by default. `Enforcement: hard` —
297
297
  resolved from the plugin Config (`enforcement: hard`), the Assignment header
298
- flag, or the iteration compass frontmatter escalates dispatch violations to
298
+ flag, the repo `.mstarc` `[config] enforcement`, or the iteration compass
299
+ frontmatter — escalates dispatch violations to
299
300
  a real veto; status/skill-lint writes are never hard-vetoed because the intent
300
301
  waterfall is content-blind (an already-invalid document is allowed as a
301
- repair escape). Config `soft` is the only local rollback. Hard gates are never
302
- a global default.
302
+ repair escape). Config / `.mstarc` `soft` are the local rollbacks. Hard gates
303
+ are never a global default.
303
304
 
304
305
  Every composed agent step carries ONE **`<mstar_engine_status>`** catalog
305
306
  message: the watermark (unified mstar version, harness dir, enforcement),
@@ -458,14 +459,16 @@ The dsh web client resolves slash commands against a client-side lexicon driven
458
459
 
459
460
  ## Harness dir and environment
460
461
 
461
- - `{HARNESS_DIR}` resolves via the engine `resolveHarnessDir` (`.mstar/` →
462
- `.agents/` → `.plans/`/`plans/`), with the plugin Config `harnessDir`
462
+ - `{HARNESS_DIR}` resolves via the engine `resolveHarnessDir` (`.mstarc`
463
+ `[config] harness_dir` → `.mstar/` → `.agents/` → `.plans/`/`plans/`),
464
+ with the plugin Config `harnessDir`
463
465
  override winning. The probe starts from the SESSION workspace root (the
464
466
  session cwd — **never the dsh launch/process cwd**) and **STOPS there** — it
465
467
  never walks above the session workspace, so the watermark and gates follow
466
468
  the workspace the session actually works in. Repos using a
467
- non-standard harness root (e.g. `.harness/`) MUST set Config `harnessDir`
468
- (absolute path) — the gates are inert without a resolvable harness dir.
469
+ non-standard harness root MUST set Config `harnessDir`
470
+ (absolute path) or declare it in a repo `.mstarc` — the gates are inert
471
+ without a resolvable harness dir.
469
472
  - The dispatch gate needs the dispatching agent's own role for the
470
473
  anti-recursion precheck: declare it via Config **`dispatchBinding`** (dsh
471
474
  exposes no per-agent role on the tool-execution context). Under hard
@@ -15,13 +15,13 @@ Kimi **Plan mode** (`EnterPlanMode` / `ExitPlanMode`, `/plan`, or `Shift-Tab`) u
15
15
 
16
16
  | Step | Kimi session | Harness SSOT |
17
17
  |------|--------------|--------------|
18
- | Enter | `EnterPlanMode` or `/plan on` — explore read-only | Ensure `{HARNESS_DIR}` exists; register `plan_id` in `status.json` when known |
18
+ | Enter | `EnterPlanMode` or `/plan on` — explore read-only | Ensure `{HARNESS_DIR}` exists; register the root `workflows[]` entry + snapshot plan row when known |
19
19
  | Design | Edit Kimi plan file with `Write` / `Edit` (when Plan mode allows writes) | Mirror main plan to `{PLAN_DIR}/<plan-id>-<name>.md` with task checkboxes |
20
20
  | Clarify | `AskUserQuestion` for blocking ambiguity only | Record decisions in plan / spec when durable |
21
- | Exit | `ExitPlanMode` — user approves plan to implement | SSOT plan locked; `status.json` row updated |
21
+ | Exit | `ExitPlanMode` — user approves plan to implement | SSOT plan locked; snapshot plan row updated |
22
22
  | Implement | Agent mode resumes | Per-task commits, Working branch, dispatch per `mstar-dispatch-gates` |
23
23
 
24
- `TodoList` and Kimi UI todos are **session progress only** — sync meaningful state to SSOT plan checkboxes and `status.json` when coordination requires it.
24
+ `TodoList` and Kimi UI todos are **session progress only** — sync meaningful state to SSOT plan checkboxes and the workflow snapshot (`{WORKFLOW_DIR}/<id>/snapshot.json` → `plans[]`) when coordination requires it.
25
25
 
26
26
  ## ExitPlanMode gate
27
27
 
@@ -35,7 +35,7 @@ Use skill names in prompts and references. Avoid absolute local paths unless mai
35
35
  | **AgentSwarm** | Parallel batch when **same** role/profile and prompts differ only by task slice; prefer **N× Agent** when roles differ |
36
36
  | **AskUserQuestion** | Structured clarify (1–4 questions, 2–4 options each); prefer over free-form when choices are known |
37
37
  | **EnterPlanMode** / **ExitPlanMode** | Plan mode entry/approval → **`kimi-plan-mode-bridge.md`** |
38
- | **TodoList** | Session UX only; mirror to SSOT plan / `status.json` when durable |
38
+ | **TodoList** | Session UX only; mirror to SSOT plan / workflow snapshot (`{WORKFLOW_DIR}/<id>/snapshot.json`) when durable |
39
39
  | **Bash** | Commands, git, tests — evidence per `mstar-coding-behavior` |
40
40
  | **Read** / **ReadMediaFile** | File reads |
41
41
  | **Glob** / **Grep** | Search (prefer over shell find/grep) |
@@ -9,10 +9,10 @@ omp session plans, composer todos, and plan-mode UI text are **session UX only**
9
9
  | Artifact | SSOT |
10
10
  |----------|------|
11
11
  | Main plan | `{PLAN_DIR}/<plan-id>-<name>.md` |
12
- | Plan registry | `{HARNESS_DIR}/status.json` |
12
+ | Plan registry | `{HARNESS_DIR}/status.json` (v2 root `workflows[]`) + `{WORKFLOW_DIR}/<id>/snapshot.json` (`plans[]` rows) |
13
13
  | Iteration compass | `{ITERATION_DIR}/…` when in formal iteration |
14
14
 
15
- Bootstrap before treating a plan as ready for Execute (read `mstar-plan-conventions` + `mstar-plan-artifacts`; ensure `{HARNESS_DIR}` / `{PLAN_DIR}` exist with process-artifact gitignore entries; mirror the active omp plan into the SSOT main plan path; register `plan_id` in `status.json.plans[]` when required by Prepare gates) → core.
15
+ Bootstrap before treating a plan as ready for Execute (read `mstar-plan-conventions` + `mstar-plan-artifacts`; ensure `{HARNESS_DIR}` / `{PLAN_DIR}` exist with process-artifact gitignore entries; mirror the active omp plan into the SSOT main plan path; register the root `workflows[]` entry + snapshot plan row when required by Prepare gates) → core.
16
16
 
17
17
  **Never** use only the omp session plan / UI todo list as **Plan Path**.
18
18
 
@@ -211,10 +211,10 @@ Cannot emit required **N** → **`Blocked`**.
211
211
  ## In-process engine binding (omp ≥ 17.2.11)
212
212
 
213
213
  - **Surfaces** (repo root = plugin root): `hooks/pre/mstar-gates.ts` — one `tool_call` pre-hook that returns `{ block: true, reason }` (structured refusal the model sees as the tool error) or `undefined` (pass); `tools/mstar_{status_validate,dispatch_validate,lease_verify,path_resolve,iteration_gate,worktree_check}/index.ts` — six model-callable validator tools (engine validators only, Zod params via `pi.zod`).
214
- - **Enforcement semantics**: block ONLY under `Enforcement: hard`. The status gate reads the harness compass frontmatter (`enforcement: hard`, active/locked iterations only); the dispatch gate reads each Assignment's own header flag (`assignmentHeaderRegion` — a body example never hardens). Soft / no flag → silent pass. Rollback = unset the flag. Never global.
214
+ |- **Enforcement semantics**: block ONLY under `Enforcement: hard`. The status gate reads the repo `.mstarc` `[config] enforcement`, else the harness compass frontmatter (`enforcement: hard`, active/locked iterations only); the dispatch gate reads each Assignment's own header flag (`assignmentHeaderRegion` — a body example never hardens). Soft / no flag → silent pass. Rollback = unset the flag (or `.mstarc` `soft`). Never global.
215
215
  - **Engine dependency**: the adapters import the published engine package (root `package.json` `dependencies` entry). omp git/npm plugin installs run `bun install <spec>` in the plugins tree → declared deps installed; a bare `-l` / `omp plugin link` symlink install without `node_modules` cannot resolve the modules.
216
216
  - **Graceful degradation (explicit)**: module load failure → `mstar_*` tools skipped, hook absent (no blocking), `commands/*.md` shell-out fallback intact. Caveat: a partial failure is SILENT — no in-band signal that gates are off; verify with `omp -p '/extensions'`.
217
- - **`MSTAR_HARNESS_DIR` override**: the hook and tools discover `{HARNESS_DIR}` via `resolveHarnessDir`, which probes only `.mstar/` → `.agents/` → `.plans/`/`plans/` roots. Repos using a non-standard harness root (e.g. this plugin repo's own `.harness/`) MUST export `MSTAR_HARNESS_DIR` (absolute path) in the omp session env — without it the status gate does not cover those roots and tools like `mstar_path_resolve` / `mstar_lease_verify` error out (parity with the opencode binding).
217
+ |- **`MSTAR_HARNESS_DIR` override / `.mstarc`**: the hook and tools discover `{HARNESS_DIR}` via `resolveHarnessDir` a repo `.mstarc` `[config] harness_dir` (gitignored local config) first, then the probe `.mstar/` → `.agents/` → `.plans/`/`plans/`. Repos using a non-standard harness root can declare it in `.mstarc` or MUST export `MSTAR_HARNESS_DIR` (absolute path) in the omp session env — without either the status gate does not cover those roots and tools like `mstar_path_resolve` / `mstar_lease_verify` error out (parity with the opencode binding).
218
218
  - **Edit-path limitation**: the status gate validates the on-disk file for `edit` events (pre-edit state) — a corrupting edit is caught by the next write or `mstar_status_validate` (known v1 limitation, parity with opencode).
219
219
  - **Engine version compatibility**: the hook and tools degrade gracefully until the engine release exporting both `composeDispatchGate` and `parseCompassFrontmatter` (published 2.0.2 predates both). Missing exports never fail module load: the hook's dispatch gate needs `composeDispatchGate` — on older engines Gate 2 (task dispatch) is skipped with a one-time warning while Gate 1 (status) stays active — and `mstar_dispatch_validate` / `mstar_iteration_gate` report an explicit upgrade error instead of loading (no silent absence; CLI fallbacks: `mstar dispatch validate`, `mstar iteration gate`).
220
220
  - **Reload**: edits are picked up by a new session (`?mtime` cache-buster); in-session `/reload-plugins` (omp ≥ 17.2.11) applies them without a new session.
@@ -15,13 +15,13 @@ ZCode **Plan mode** (`EnterPlanMode` / `ExitPlanMode`) uses read-only exploratio
15
15
 
16
16
  | Step | ZCode session | Harness SSOT |
17
17
  |------|---------------|--------------|
18
- | Enter | `EnterPlanMode` — explore read-only | Ensure `{HARNESS_DIR}` exists; register `plan_id` in `status.json` when known |
18
+ | Enter | `EnterPlanMode` — explore read-only | Ensure `{HARNESS_DIR}` exists; register the root `workflows[]` entry + snapshot plan row when known |
19
19
  | Design | Draft plan content; surface via `ExitPlanMode` plan text | Mirror main plan to `{PLAN_DIR}/<plan-id>-<name>.md` with task checkboxes |
20
20
  | Clarify | `AskUserQuestion` for blocking ambiguity only | Record decisions in plan / spec when durable |
21
- | Exit | `ExitPlanMode` — user approves plan to implement | SSOT plan locked; `status.json` row updated |
21
+ | Exit | `ExitPlanMode` — user approves plan to implement | SSOT plan locked; snapshot plan row updated |
22
22
  | Implement | Agent mode resumes | Per-task commits, Working branch, dispatch per `mstar-dispatch-gates` |
23
23
 
24
- `TodoWrite` and ZCode UI todos are **session progress only** — sync meaningful state to SSOT plan checkboxes and `status.json` when coordination requires it.
24
+ `TodoWrite` and ZCode UI todos are **session progress only** — sync meaningful state to SSOT plan checkboxes and the workflow snapshot (`{WORKFLOW_DIR}/<id>/snapshot.json` → `plans[]`) when coordination requires it.
25
25
 
26
26
  ## ExitPlanMode gate
27
27
 
@@ -34,7 +34,7 @@ Use skill names in prompts and references. Avoid absolute local paths unless mai
34
34
  | **Agent** | Primary dispatch — delegate one subagent task (`subagent_type`: built-in profiles such as `general-purpose` / `Explore`) |
35
35
  | **AskUserQuestion** | Structured clarify (1–4 questions, 2–4 options each); prefer over free-form when choices are known |
36
36
  | **EnterPlanMode** / **ExitPlanMode** | Plan mode entry/approval → **`zcode-plan-mode-bridge.md`** |
37
- | **TodoWrite** | Session UX only; mirror to SSOT plan / `status.json` when durable |
37
+ | **TodoWrite** | Session UX only; mirror to SSOT plan / workflow snapshot (`{WORKFLOW_DIR}/<id>/snapshot.json`) when durable |
38
38
  | **Bash** | Commands, git, tests — evidence per `mstar-coding-behavior` |
39
39
  | **Read** | File reads (text + images) |
40
40
  | **Edit** / **Write** | Edits |