@mstar-harness/opencode 1.8.5 → 1.8.7

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 CHANGED
@@ -6,6 +6,23 @@ The monorepo root [CHANGELOG.md](../../CHANGELOG.md) summarizes cross-surface re
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.8.7] - 2026-08-06
10
+
11
+ ### Bundled harness skills (`harness-skills/` at publish)
12
+
13
+ - Version alignment with harness **1.8.7** (no OpenCode package API change).
14
+
15
+ See root [CHANGELOG.md](../../CHANGELOG.md) **1.8.7**.
16
+
17
+ ## [1.8.6] - 2026-08-06
18
+
19
+ ### Bundled harness skills (`harness-skills/` at publish)
20
+
21
+ - Sync dispatch field-completeness gate: `mstar-dispatch-gates` self-check + anti-pattern, `mstar-host/references/parallel-dispatch.md` hard rule + self-check, `mstar-host/references/omp.md` Review-&-Edit example + N=1 gotcha.
22
+ - Version alignment with harness **1.8.6** (no OpenCode package API change).
23
+
24
+ See root [CHANGELOG.md](../../CHANGELOG.md) **1.8.6**.
25
+
9
26
  ## [1.8.5] - 2026-08-06
10
27
 
11
28
  ### Bundled harness skills (`harness-skills/` at publish)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mstar-dispatch-gates
3
- description: Morning Star 派发与委派门禁 —— 仅 PM 可增派 subagent、`Execute as` 与 `Delegation`、承接方反递归 NEVER 红线、SDD implement 串行派发、**SDD 路径 plan QC 强制 tri-review(N=3)**、inline 单席 QC 例外、Assignment 文案≠派发、未齐不发。`project-manager` 派发时必读;leaf 动手前必读反递归。worktree 见 `mstar-branch-worktree`;SDD 见 `mstar-sdd`;宿主见 `mstar-host`。
3
+ description: Morning Star 派发与委派门禁 —— 仅 PM 可增派 subagent、`Execute as` 与 `Delegation`、承接方反递归 NEVER 红线、SDD implement 串行派发、**SDD 路径 plan QC 强制 tri-review(N=3)**、inline 单席 QC 例外、Assignment 文案≠派发、未齐不发、**invoke 角色字段必填(漏写=静默 generic 回退=派发未完成)**。`project-manager` 派发时必读;leaf 动手前必读反递归。worktree 见 `mstar-branch-worktree`;SDD 见 `mstar-sdd`;宿主见 `mstar-host`。
4
4
  ---
5
5
 
6
6
  ## Load order(必读顺序)
@@ -58,6 +58,7 @@ description: Morning Star 派发与委派门禁 —— 仅 PM 可增派 subagent
58
58
  - **QC 单席(例外)**:`Execution mode: inline`(hotfix 等),或 Assignment 显式 `QC mode: single` / `QC mode: single — override: <reason>` → `qc-specialist` ×1,`N=1`,写 `{SDD_DIR}/review/qc.md`。
59
59
  - **QC targeted re-review**:Assignment 含 **`QC re-review: targeted — reviewers: …`** 时,**N** = 所列席位数(1–3),同条消息发满 **N**。
60
60
  - **先自检再发送**:发送前核对「Assignment 条数 = 本条消息中的实际 **派发** 调用条数」。
61
+ - **先自检字段再发送(与 count 同级门禁)**:核对**每条** invoke 都携带与 **`Execute as`** 匹配的角色绑定字段——omp **`agent`** / Cursor **`subagent_type`** / OpenCode **`subagent`** / Kimi·ZCode **`subagent_type`**。**漏写或取默认通用值**(omp 漏 `agent` ⇒ 自动回退 generic `task`,无报错)= **派发未完成**,与 paste-only(零 invoke)**同等级**:当场补齐重发,不得进入下一 gate。**N=1 顺序链(Review & Edit)不豁免**——count 门在 N=1 恒过,**字段门是唯一保护**。
61
62
  - **前置步骤与派发回合分离(防串行 rollout)**:为派发准备的 **`bash` / `read` / `glob` / `grep`**(如 `merge-base`、`Review range`、`git rev-parse`)**不计入** `N` 次派发;可在上一条仅含准备的消息完成。准备完成后,**下一条派发消息**须**一次性**含 **`N` 次** Task / subagent invoke。**禁止**先发 `1` 次、等返回再补发其余 `N-1` 次。
62
63
  - **未齐不发(emit zero until batch-ready)**:需并发 `N≥2` 而当前只能发 `1` 条时,本条应发 **`0` 条派发 invoke`**(可继续 read/bash 补齐),**禁止**「先发一个顶一下」;`N` 份 payload 就绪后**单次消息发满 `N`**。见 **`mstar-host`** → `references/parallel-dispatch.md`(具备 invoke / Task / subagent 工具的宿主共用)。
63
64
 
@@ -114,6 +115,7 @@ When **`Execution mode: sdd`** (`mstar-sdd`):
114
115
  - Review-and-edit 链未完成即 commit integration 分支;PM 代做专业角色编辑而不 invoke。
115
116
  - Phase 1 review-and-edit 链三角色并行派发,或未等上一角色返回即派发下一角色。
116
117
  - Assignment 已写、invoke 为零(paste-only)却进入下一 gate。
118
+ - Task/subagent item 漏写角色绑定字段(omp 漏 `agent` / Cursor 漏 `subagent_type` / OpenCode 漏 `subagent`)⇒ **静默回退 generic worker**,却因 count=N 通过而误判「派发完成」;属 paste-only 同级的 **dispatch-incomplete**。N=1 顺序 Review-&-Edit 链最易在此漏字段。
117
119
 
118
120
  ## References
119
121
 
@@ -77,6 +77,8 @@ task(
77
77
 
78
78
  Single-task shorthand may exist depending on host version — always match the live schema. Parallel **N** Morning Star assignees ⇒ **one** `task` call with **N** `tasks[]` entries **or** **N** `task` calls in one assistant message when the host requires that shape. Count emitted dispatches = **N**.
79
79
 
80
+ **Envelope-first**: write `agent` + `name` as the first fields of each `tasks[]` entry, before the long `task` body — the body crowds them out and `agent` gets silently dropped (omp defaults to generic `task`, no error). SSOT → `parallel-dispatch.md` § Mandatory order.
81
+
80
82
  ## Role agents (C5 — hard constraint)
81
83
 
82
84
  **Live `task` tool schema is SSOT every session.** Exact `agent` names vary by omp version and which `agents/*.md` were discovered after plugin install/link. Read the tool's Available Agents list before dispatch — do not invent names; do not hard-code stale tables over the live list.
@@ -145,18 +147,16 @@ task(
145
147
  )
146
148
  ```
147
149
 
148
- Review & Edit / Prepare specialist chain (sequential, **N=1** each turn):
150
+ Review & Edit / Prepare specialist chain (sequential, **N=1** each turn — re-set **`agent`** on **every** dispatch; at N=1 the count gate is trivial, so the **field** gate is the only protection):
149
151
 
150
152
  ```text
153
+ # pass 1 — product-manager
151
154
  task(
152
155
  context: "Review & Edit — product scope",
153
- tasks: [{
154
- name: "ReviewEditProduct",
155
- agent: "product-manager",
156
- task: "<Assignment: Execute as product-manager; Act as + skill load>"
157
- }]
156
+ tasks: [{ name: "ReviewEditProduct", agent: "product-manager",
157
+ task: "<Assignment: Execute as product-manager; Act as + skill load>" }]
158
158
  )
159
- # wait for return, then architect, then writing-specialist — each with agent: "<role-id>"
159
+ # repeat for architect, writing-specialist, — each a separate N=1 dispatch with agent re-set
160
160
  ```
161
161
 
162
162
  For explore-only orientation (no Morning Star role deliverable):
@@ -190,7 +190,7 @@ Cannot emit required **N** → **`Blocked`**.
190
190
 
191
191
  ### SDD implement (serial)
192
192
 
193
- - **`Execution mode: sdd`**: one implementer `task` entry per task id with `agent` matching the implementer role when listed; task reviewer = new entry (no sticky resume unless host resume/id is available and recorded). Serial rule → **`parallel-dispatch.md`** § SDD implement.
193
+ - **`Execution mode: sdd`**: one implementer `task` entry per task id with `agent` matching the implementer role when listed; task reviewer = new entry with `agent: "reviewer"` (omp L2 review; not qc-specialist*) or `agent: "task"` as last resort + C5b — no sticky resume unless host resume/id is available and recorded. Serial rule → **`parallel-dispatch.md`** § SDD implement.
194
194
  - **Never** multiple implementer entries in one message for the same plan.
195
195
 
196
196
  ## Clarify
@@ -230,3 +230,4 @@ Cannot emit required **N** → **`Blocked`**.
230
230
  - omp has no `sessionStart.skill`; new sessions do **not** auto-load PM — invoke `/skill:pm` manually.
231
231
  - Do not confuse omp **`task.agent`** with OpenCode **`subagent`** or Cursor **`subagent_type`**.
232
232
  - Do not treat Kimi/ZCode “built-ins only → always `coder`/`task`” habits as omp defaults when Morning Star role agents are listed.
233
+ - **Sequential N=1 Review-&-Edit turns are where `agent` gets dropped**: the “all N in one message” pressure is absent and the count gate passes trivially — re-verify **`agent: "<Execute as>"`** on every single dispatch; `tasks:[{task:"…"}]` with no `agent` is a silent generic fallback, not a valid role invoke.
@@ -15,7 +15,7 @@ Printing `## Assignment` in the main thread **without** matching host invocation
15
15
 
16
16
  ## Mandatory order (dispatch turn)
17
17
 
18
- 1. Finalize all `N` Assignment payloads (after any prerequisite turn).
18
+ 1. Finalize all `N` Assignment payloads (after any prerequisite turn). **Build each invoke entry envelope-first**: set the role-binding field (omp `agent` / Cursor `subagent_type` / OpenCode `subagent` / Kimi·ZCode `subagent_type`) + `name` *before* writing the long Assignment body.
19
19
  2. Count distinct `Execute as` sessions (`N`).
20
20
  3. Issue **`N` host invocations first** — OpenCode: **N `task` tool** calls with **subagent**; Cursor: **N `Task`** with `subagent_type` (JSON field shape → `cursor.md` § Task invoke schema); Kimi: **N `Agent`** calls (each prompt carries **Act as** + skill load; `subagent_type` ∈ {`coder`,`explore`,`plan`} only — see `kimi.md` C5/C5b); omp: **one `task` call with N `tasks[]`** (or N `task` calls) with `agent` = live-schema role id matching `Execute as` when listed (else generic built-in) + **Act as** / skill load (see `omp.md` C5/C5b); each with one Assignment body. For parallel work, **all `N` tool calls in one assistant message** when the host allows.
21
21
  4. Optionally post a short **Status Update** after invocations (audit trail only — does not replace step 3).
@@ -26,6 +26,7 @@ Printing `## Assignment` in the main thread **without** matching host invocation
26
26
  - Do not end the dispatch turn until **`N` invocations emitted**, or mark `Blocked` / `dispatch incomplete`.
27
27
  - Dual-track implement: **`N = 2` ⇒ two invocations in one message** when parallel is required.
28
28
  - Status Update on dispatch turns: **`Subagent invokes issued: N`** (must match Assignment count). If Assignments were written but `N = 0` → **`dispatch failed — paste-only`**; fix next message.
29
+ - **Per-item field completeness (same severity as paste-only)**: every invocation must carry the role-binding field set to **`Execute as`** — omp **`agent`** / Cursor **`subagent_type`** / OpenCode **`subagent`** / Kimi·ZCode **`subagent_type`**. A missing field (e.g. omp omitting `agent` ⇒ silent generic `task` fallback) = **dispatch incomplete** even though count = N passes. Sequential **N=1** Review-&-Edit turns are not exempt — re-set the field on **every** dispatch.
29
30
 
30
31
  ## QC default (initial wave)
31
32
 
@@ -62,5 +63,6 @@ Formal iteration Phase 2 uses the same SDD + tri rule — not a separate carve-o
62
63
  1. Required assignments this turn? (`N`)
63
64
  2. Prerequisite-only message? → **zero** batch dispatches unless `N = 1`.
64
65
  3. Dispatch message contains **exactly `N`** invocation calls?
65
- 4. QC initial: **`Execution mode: sdd`** **N=3**? **`inline`** **N=1**? Targeted re-review **N** = Assignment reviewer count?
66
- 5. SDD implement → **serial** (never batch implementers); sticky = **resume** same implementer, not parallel
66
+ 4. **Each** invocation carries its role-binding field set to **`Execute as`** (omp `agent` / Cursor `subagent_type` / OpenCode `subagent` / Kimi·ZCode `subagent_type`)? A bare `task`/prompt item with no role field = **incomplete**, even at **N=1**.
67
+ 5. QC initial: **`Execution mode: sdd`** → **N=3**? **`inline`** **N=1**? Targeted re-review **N** = Assignment reviewer count?
68
+ 6. SDD implement → **serial** (never batch implementers); sticky = **resume** same implementer, not parallel
@@ -45,7 +45,7 @@ Batch all findings for the human in one message. If clean, proceed silently.
45
45
  - **`SDD implementer session: fresh`** (default) — new subagent; templates: `references/implementer-prompt.md`
46
46
  - **`SDD implementer session: sticky`** — first task: same as fresh + write `{SDD_DIR}/implementer-session.json` with `host_agent_id`; later tasks: host **resume** + `references/implementer-continuation-prompt.md` (see **`references/sticky-implementer-session.md`**)
47
47
  5. On `DONE`: `scripts/review-package BASE HEAD` → diff file
48
- 6. Dispatch **fresh** task reviewer — **`subagent_type: generalPurpose`** (L2; **not** `qc-specialist*`) — brief, report, diff, Global Constraints — `references/task-reviewer-prompt.md` — **never** sticky resume for reviewers
48
+ 6. Dispatch **fresh** task reviewer — role **`generalPurpose`** (L2; **not** `qc-specialist*`; host role field → `mstar-host` C5) — brief, report, diff, Global Constraints — `references/task-reviewer-prompt.md` — **never** sticky resume for reviewers
49
49
  7. Fix loop for Critical/Important; re-review until approved
50
50
  8. Append `progress.md`; update `status.json` `task_commits[]` and `implementer-session.json` `last_task` if sticky
51
51
  9. Next task
@@ -3,11 +3,11 @@
3
3
  Use when PM continues **`SDD implementer session: sticky`** for Task N>1. Host: **resume** same agent when supported (`sticky-implementer-session.md`).
4
4
 
5
5
  ```
6
- Task / subagent:
7
- resume: [HOST_AGENT_ID from implementer-session.json]
8
- description: "SDD continue Task N: <name>"
9
- model: [same tier as session start unless PM upgrades]
10
- prompt: |
6
+ Dispatch:
7
+ Resume: [HOST_AGENT_ID from implementer-session.json]
8
+ Name: <CamelCaseId> # omp/Cursor name
9
+ Model: [same tier as session start unless PM upgrades]
10
+ Prompt body:
11
11
  <SUBAGENT-STOP> Skip PM orchestration skills. You are a leaf implementer continuing a sticky SDD session.</SUBAGENT-STOP>
12
12
 
13
13
  Continue as the same implementer on plan <plan-id>, Working branch: <branch>.
@@ -5,10 +5,11 @@ Use when PM dispatches an SDD implementer (`mstar-sdd`) — **first task** or **
5
5
  For **sticky** continuation (task 2+), use **`implementer-continuation-prompt.md`** instead.
6
6
 
7
7
  ```
8
- Task / subagent:
9
- description: "SDD implement Task N: <name>"
10
- model: [REQUIRED per Model tier in Assignment and mstar-sdd SKILL]
11
- prompt: |
8
+ Dispatch:
9
+ Role: <Execute as role-id> # omp agent / Cursor subagent_type / OpenCode subagent → mstar-host C5
10
+ Name: <CamelCaseId> # omp/Cursor name
11
+ Model: [REQUIRED — per Model tier in Assignment and mstar-sdd SKILL]
12
+ Prompt body:
12
13
  <SUBAGENT-STOP> Skip PM orchestration skills. You are a leaf implementer.</SUBAGENT-STOP>
13
14
 
14
15
  You are implementing Task N: <name>
@@ -3,11 +3,12 @@
3
3
  One reviewer per task: spec compliance + code quality (`mstar-sdd`).
4
4
 
5
5
  ```
6
- Task / subagent:
7
- subagent_type: generalPurpose
8
- description: "SDD review Task N (spec + quality)"
9
- model: [REQUIRED standard tier default; capable if diff is large/subtle]
10
- prompt: |
6
+ Dispatch:
7
+ Role: generalPurpose # L2 SDD task reviewer; NOT qc-specialist*
8
+ # omp: agent = "reviewer" or "task" + C5b; Cursor: subagent_type = "generalPurpose" → mstar-host C5
9
+ Name: <CamelCaseId> # omp/Cursor name
10
+ Model: [REQUIRED — standard tier default; capable if diff is large/subtle]
11
+ Prompt body:
11
12
  <SUBAGENT-STOP> Skip PM orchestration. Read-only review.</SUBAGENT-STOP>
12
13
 
13
14
  Review one task implementation: spec compliance first, then quality.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/opencode",
3
- "version": "1.8.5",
3
+ "version": "1.8.7",
4
4
  "description": "Morning Star harness OpenCode plugin (skills bootstrap and agent loading).",
5
5
  "license": "MIT",
6
6
  "repository": {