@mstar-harness/opencode 3.2.1 → 3.2.2

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,16 @@ The monorepo root [CHANGELOG.md](../../CHANGELOG.md) summarizes cross-surface re
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [3.2.2] - 2026-08-24
10
+
11
+ ### Bundled harness skills (`harness-skills/` at publish)
12
+
13
+ - `/pr-deep-review` now emits a merge signal computed from the finding tally: the middle verdict token is renamed `needs review` → `needs fixes`, each accepted PR finding carries a `Merge class` (`must-fix` | `should-fix` | `nit`), and the output shape gains `- score_pct:` (derived, `max(0, 100 - 40*must_fix - 15*should_fix - 3*nit - 10*unverified)`, floor 0) and `- tally:` with four counts. The verdict is derived from the tally (`must-fix ≥ 1` → `blocked`, else `should-fix ≥ 1` → `needs fixes`, else `ship it`); leftover linked-issue `unmet` ACs increment `should_fix` (or `must_fix` when unsafe-to-ship) before that mapping and are not extra findings. `score_pct` is display-only and never overrides it. Chat and the GitHub Review `body` open with `{verdict} · {score_pct}%` plus the tally line; `event` remains `COMMENT`. The list cut now applies to nits only — every `must-fix` / `should-fix` is listed. Formula and rules are SSOT'd in `skills/mstar-audit/references/pr-review.md` § Verdict synthesis / Tally and derived score.
14
+
15
+ - Version alignment with harness **3.2.2** (no OpenCode package API change).
16
+
17
+ See root [CHANGELOG.md](../../CHANGELOG.md) **3.2.2**.
18
+
9
19
  ## [3.2.1] - 2026-08-24
10
20
 
11
21
  ### Bundled harness skills (`harness-skills/` at publish)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pr-deep-review
3
- description: Use when asked to deeply review a pull request, branch, or diff before merge — deciding whether a change is safe to ship with evidence-backed findings, rather than a shallow "looks good" pass. Produces a `ship it` / `needs review` / `blocked` verdict. Also for a batch of sibling PRs. Do not use for self-checking a change you just authored.
3
+ description: Use when asked to deeply review a pull request, branch, or diff before merge — deciding whether a change is safe to ship with evidence-backed findings, rather than a shallow "looks good" pass. Produces a `ship it` / `needs fixes` / `blocked` verdict. Also for a batch of sibling PRs. Do not use for self-checking a change you just authored.
4
4
  agent: project-manager
5
5
  input: "[pr|branch|scope] [full]"
6
6
  ---
@@ -9,6 +9,8 @@ input: "[pr|branch|scope] [full]"
9
9
 
10
10
  Run a read-only, evidence-first deep review of a pull request, branch, or diff and decide whether it is safe to ship. When a PR number exists, posting the GitHub Review is **mandatory** — the review is not complete until comments land on the PR. Output: verdict + findings presented to the user, plus the posted review URL. Never auto-approve, never REQUEST_CHANGES, never merge.
11
11
 
12
+ The verdict is **computed from the finding tally** (`must-fix` / `should-fix` / `nit` + `unverified`); `score_pct` is display-only feedback and never overrides it. Procedure and formula → **`references/pr-review.md`** § Verdict synthesis / Tally and derived score.
13
+
12
14
  **Read-only advisory.** The review does not enter the harness plan state machine (`Todo → InProgress → InReview → Done`). Reviewers never edit the worktree, never merge, and never approve-as-merge.
13
15
 
14
16
  ## Boot
@@ -25,7 +25,7 @@ A read-only advisory skill that discovers what is worth doing in a codebase and
25
25
  Two entry families, one skill:
26
26
 
27
27
  - **Full codebase audit** — user asks: "audit my codebase", "what should I improve", "find bugs/security/perf issues", "what tech debt do we have", "what should I build next"; PM routes a request with `Task category: audit`; before a major refactoring initiative; as input to iteration planning. Process detail → **`references/codebase-audit.md`**.
28
- - **Deep PR review** — user asks to deeply review a pull request / branch / diff before merge (verdict `ship it` / `needs review` / `blocked`). Process detail → **`references/pr-review.md`**.
28
+ - **Deep PR review** — user asks to deeply review a pull request / branch / diff before merge (verdict `ship it` / `needs fixes` / `blocked`). Process detail → **`references/pr-review.md`**.
29
29
 
30
30
  ## Variant dispatch
31
31
 
@@ -91,7 +91,7 @@ Do not write 30 plans nobody asked for. If running non-interactively (no user av
91
91
  The output contract is common; per-variant output shapes live in the variant reference.
92
92
 
93
93
  - **Full codebase audit**: audit index `README.md` template (findings table, direction, execution order & status, considered-and-rejected, red-team dispositions) and the `mstar audit scaffold` Engine-check callout → **`references/codebase-audit.md`** § Output format. Plan writing → **`## Plan output (all variants)`** below.
94
- - **PR review**: `findings` / `verdict` / `evidence` / `unverified` / `next` / `notes` / `comments` labels → **`references/pr-review.md`** § Output shape.
94
+ - **PR review**: `findings` / `verdict` / `score_pct` / `tally` / `evidence` / `unverified` / `next` / `notes` / `comments` → **`references/pr-review.md`** § Output shape.
95
95
  - Every finding follows **`references/finding-format.md`** — read it before the first finding.
96
96
 
97
97
  ## Plan output (all variants)
@@ -1,6 +1,6 @@
1
1
  # Deep PR Review Process
2
2
 
3
- Read-only, evidence-first review of a pull request / branch / diff, producing exactly one verdict: `ship it` / `needs review` / `blocked`. Runs under `mstar-audit` § `pr` variant, reusing the Recon → Audit → Vet discipline (recon = PR scope + repo guidance; vet = three-way attack). The reviewer never edits the worktree, never merges, and never approves-as-merge.
3
+ Read-only, evidence-first review of a pull request / branch / diff, producing exactly one verdict: `ship it` / `needs fixes` / `blocked`. Runs under `mstar-audit` § `pr` variant, reusing the Recon → Audit → Vet discipline (recon = PR scope + repo guidance; vet = three-way attack). The reviewer never edits the worktree, never merges, and never approves-as-merge.
4
4
 
5
5
  ## Worktree isolation
6
6
 
@@ -86,20 +86,92 @@ Then open cited code yourself and dispose by-design / mis-attributed / duplicate
86
86
 
87
87
  ## Verdict synthesis
88
88
 
89
- - Order findings by impact-if-shipped.
90
- - Cut to the top 1–3 unless `full` was requested.
91
- - No padding, no invented requirements, no style grading.
92
- - Choose exactly one verdict:
89
+ - Order findings by impact-if-shipped; no padding, no invented requirements, no style grading.
90
+ - List **every** `must-fix` and `should-fix` finding — the default top 1–3 cut (unless `full`) applies to nits only, and truncated nits are summarized in the display line (§ Output shape / Display contract).
91
+ - The verdict is **derived from the tally, not chosen**: classify every accepted finding (§ Merge class) → apply leftover `unmet` AC increments if any (§ Linked-issue hygiene) → apply **Verdict-from-tally** (§ Tally and derived score) → emit that one token. The reviewer does not pick a verdict by vibe.
92
+ - Exactly one verdict:
93
93
  - `ship it` — evidence-backed, safe to ship.
94
- - `needs review` — issues found; address before merge.
94
+ - `needs fixes` — issues found; address before merge.
95
95
  - `blocked` — a must-fix issue stands in the way of shipping.
96
96
 
97
+ ## Merge class (PR findings only)
98
+
99
+ Classify each **accepted** finding (after three-way vet) as exactly one class. Do not invent a fourth class. Do not derive class from `Confidence`.
100
+
101
+ | Class | Use when | Verdict effect |
102
+ | --- | --- | --- |
103
+ | `must-fix` | Shipping this issue is unsafe: correctness bug, security hole, data loss, auth/authz bypass, or a broken public contract. Same meaning as today's `blocked` gloss ("a must-fix issue stands in the way of shipping"). | Any count ≥ 1 → `blocked` |
104
+ | `should-fix` | A real issue that should be addressed before merge but is not itself a ship-stopper. Same meaning as today's middle gloss ("issues found; address before merge"). | Else if count ≥ 1 → `needs fixes` |
105
+ | `nit` | Optional cleanup, naming, comment, or small suggestion that does **not** change merge-readiness. Lint-covered cosmetics stay ignored (existing lens rule) — they are not findings. | Does not change verdict |
106
+
107
+ Tie-break: unsafe to ship → `must-fix`; should be addressed before merge but ship-safe → `should-fix`; otherwise `nit`. A LOW-confidence smell that fails evidence rules is **not** a finding (existing disqualify rules) — put it on `- unverified:` if it must be mentioned.
108
+
109
+ Field placement: on each finding, `- **Merge class**: must-fix | should-fix | nit`, immediately after `Confidence` (before `Fix sketch`). The shared finding template (`references/finding-format.md`) is unchanged — this field is PR-review-only.
110
+
111
+ ## Tally and derived score
112
+
113
+ Verbatim, applied after the three-way vet to **accepted** findings, then leftover unmet ACs:
114
+
115
+ ```
116
+ must_fix = count of accepted findings with Merge class: must-fix
117
+ should_fix = count of accepted findings with Merge class: should-fix
118
+ nit = count of accepted findings with Merge class: nit
119
+ unverified = count of residual items under `- unverified:` (0 when `none`)
120
+
121
+ # leftover unmet ACs (§ Linked-issue hygiene) — tally increment, not a fourth class, not a second finding:
122
+ for each leftover AC marked unmet (not met, not cut):
123
+ if that leftover is itself unsafe-to-ship / a broken public contract:
124
+ must_fix += 1
125
+ else:
126
+ should_fix += 1
127
+
128
+ if must_fix >= 1:
129
+ verdict = blocked
130
+ else if should_fix >= 1:
131
+ verdict = needs fixes
132
+ else:
133
+ verdict = ship it
134
+ ```
135
+
136
+ `score_pct` — integer arithmetic only. Floor at 0. No decimals. No second formula:
137
+
138
+ ```
139
+ score_pct = max(0, 100 - 40*must_fix - 15*should_fix - 3*nit - 10*unverified)
140
+ ```
141
+
142
+ ### Override invariant
143
+
144
+ ```
145
+ Score never overrides verdict.
146
+ blocked + any score_pct → not shippable
147
+ needs fixes + any score_pct → still address findings before merge
148
+ ship it + score_pct < 100 → allowed (nits and/or unverified deducted)
149
+ High score_pct never means APPROVE. Low score_pct never means REQUEST_CHANGES.
150
+ ```
151
+
152
+ ### Worked examples (check table)
153
+
154
+ | must / should / nit / unverified | score_pct | verdict | Display line |
155
+ | --- | --- | --- | --- |
156
+ | 0 / 0 / 0 / 0 + 1 leftover unmet AC | 85 | `needs fixes` | `needs fixes · 85%` |
157
+ | 0 / 0 / 0 / 0 + 1 leftover unmet AC (unsafe-to-ship) | 60 | `blocked` | `blocked · 60%` |
158
+ | 0 / 0 / 2 / 0 | 94 | `ship it` | `ship it · 94%` |
159
+ | 0 / 0 / 0 / 2 | 80 | `ship it` | `ship it · 80%` |
160
+ | 0 / 1 / 0 / 0 | 85 | `needs fixes` | `needs fixes · 85%` |
161
+ | 0 / 1 / 1 / 0 | 82 | `needs fixes` | `needs fixes · 82%` |
162
+ | 1 / 0 / 0 / 0 | 60 | `blocked` | `blocked · 60%` |
163
+ | 1 / 2 / 1 / 1 | 17 | `blocked` | `blocked · 17%` |
164
+ | 3 / 0 / 0 / 0 | 0 (floor) | `blocked` | `blocked · 0%` |
165
+
166
+ `blocked · 60%` is still not shippable. `needs fixes · 85%` still means address findings.
167
+
97
168
  ## Linked-issue hygiene
98
169
 
99
170
  If the PR closes/fixes a tracked issue, score **every** acceptance criterion against the diff:
100
171
 
101
172
  - Mark each: met / unmet / cut.
102
- - Leftover criteria get a follow-up or a narrowed scope **before** merge, with reasoning on the review comment.
173
+
174
+ Leftover `unmet` criteria count against the verdict: they are **tally increments**, not extra findings (do not also emit a Merge-class finding for the same leftover — that would double-count). Each leftover AC marked `unmet` (not `met`, not `cut`) increments `should_fix` by 1, or `must_fix` by 1 when that leftover is itself a broken public contract / unsafe-to-ship. The increment lives in the tally procedure (§ Tally and derived score); apply Verdict-from-tally **after** it, so leftover `unmet` ACs cannot yield `ship it`. Score uses the existing formula only (`should_fix` deducts 15, `must_fix` deducts 40 — no second formula, no new tally key). Leftovers are already mentioned in the review `body` (§ Comment posting) — no fourth merge class.
103
175
  - Do not invent a follow-up when all criteria landed.
104
176
 
105
177
  ## CI attribution
@@ -145,7 +217,7 @@ Posting the GitHub Review is a **mandatory deliverable** of the `pr` variant —
145
217
  2. Build one review payload:
146
218
  - `event`: `COMMENT` — **never** `APPROVE`, **never** `REQUEST_CHANGES`, never a merge.
147
219
  - `commit_id`: the PR head SHA.
148
- - `body`: verdict + ranked findings (short) + linked-issue leftover reasoning + optional folded plan index (below).
220
+ - `body`: **first two lines are the display contract** — `{verdict} · {score_pct}%` then the tally line (`must-fix=<n> should-fix=<n> nit=<n> unverified=<n>`) — then ranked findings (short) + linked-issue leftover reasoning + optional folded plan index (below). `event` stays `COMMENT` — **never** `APPROVE`, **never** `REQUEST_CHANGES`, never a merge.
149
221
  - `comments[]`: one entry per finding whose `path` + `line` is in the three-dot diff, `side: RIGHT`. Finding body = title + evidence + impact + fix sketch — not the whole plan.
150
222
  3. Post it:
151
223
  ```
@@ -171,10 +243,14 @@ Never dump full plan files.
171
243
 
172
244
  ## Output shape
173
245
 
174
- Verbatim labels, in order:
175
-
176
- - `- findings:` — list of evidence-backed findings (`none` when none).
177
- - `- verdict:` — one of `ship it` / `needs review` / `blocked`.
246
+ - `- findings:` — list of evidence-backed findings (`none` when none). Each accepted finding includes **Merge class** (§ Merge class).
247
+ - `- verdict:` — exactly one of `ship it` / `needs fixes` / `blocked` (§ Verdict synthesis).
248
+ - `- score_pct:` — integer 0–100 from the locked formula (§ Tally and derived score).
249
+ - `- tally:`
250
+ - `- must-fix: <n>`
251
+ - `- should-fix: <n>`
252
+ - `- nit: <n>`
253
+ - `- unverified: <n>`
178
254
  - `- evidence:` — concise what-checks-proved summary.
179
255
  - `- unverified:` — residual unverified claims, or `none`.
180
256
  - `- next:` — one of `implementation` / `verify` / `docs`.
@@ -184,3 +260,18 @@ Verbatim labels, in order:
184
260
  - `review_url: <url>` when `posted: yes`; `n/a` when `n/a-no-pr` or `failed`
185
261
  - `inline: <N> posted / <M> attempted (<K> summary-only fallback)`
186
262
  - `plans_folded: yes` | `no`
263
+
264
+ ### Display contract (chat + GitHub Review `body`)
265
+
266
+ First two lines of the display (chat output and the GitHub Review `body`) — verbatim:
267
+
268
+ ```
269
+ {verdict} · {score_pct}%
270
+ must-fix=<n> should-fix=<n> nit=<n> unverified=<n>
271
+ ```
272
+
273
+ Then existing ranked findings / leftover AC / optional `<details>` plan index. Do not put `score_pct%` on the `- verdict:` token line.
274
+
275
+ ### List cut
276
+
277
+ The default "top 1–3 unless `full`" applies to **nits only**: every `must-fix` and `should-fix` finding is listed. If nits are omitted from the narrative list, add one line `nits: <n> omitted from list (counted in tally)` — `tally.nit` stays complete.
@@ -123,7 +123,7 @@ Read **`mstar-host`** after this skill; detect host per its table, then Read the
123
123
 
124
124
  ## 护栏(不变量)
125
125
 
126
- - 未经用户同意不改 `opencode.json`、凭据、`secrets.env`。
126
+ - 未经用户同意不改宿主配置文件与用户凭据。
127
127
  - 行为变更须有验证证据。
128
128
  - 业务仓默认功能分支(Assignment `Branch policy` 例外)→ **`mstar-branch-worktree`**。
129
129
  - **Dev 三角**:`@fullstack-dev` 后端主导;UI → `@frontend-dev`;第二轨 → `@fullstack-dev-2`(`mstar-roles` PM 节)。
@@ -59,7 +59,7 @@ All leaf executors share these anti-recursion red lines (role-specific sibling l
59
59
  When the assignment is a review/audit dispatch — `Task category: audit`, `Audit mode: on`, or a `pr-deep-review` batch seat — the executor operates as a **read-only audit seat**, not an implementer:
60
60
 
61
61
  - **Permission contract**: no tracked-file writes, no `edit`/`write`/`ast_edit` on the reviewed worktree, no merge, no approve-as-merge. The write permissions the role normally has are **suspended for the assignment**; do not "fix things while reviewing". **Required exception (`pr-deep-review` with a PR number):** the GitHub Review POST (`gh api` Reviews POST, `event: COMMENT`) **must** be posted — it is the deliverable, not a source-code mutation; Git stays read-only with no commits. Procedure → **`skills/mstar-audit/references/pr-review.md`** § Comment posting.
62
- - **Process**: load `mstar-audit` (`pr` variant or audit process) + its references + `mstar-coding-behavior` evidence discipline; run the concern-lens review and the three-way attack; produce `findings` + `verdict` (`ship it` / `needs review` / `blocked` for PR review) + `unverified` in the `pr-deep-review` output shape.
62
+ - **Process**: load `mstar-audit` (`pr` variant or audit process) + its references + `mstar-coding-behavior` evidence discipline; run the concern-lens review and the three-way attack; produce `findings` + `verdict` (`ship it` / `needs fixes` / `blocked` for PR review) + `unverified` in the `pr-deep-review` output shape.
63
63
  - **Mode lock**: one assignment = one mode. Review-assigned work is completed as review only; implementation mode applies to implementation assignments only.
64
64
  - **Completion Report**: `Git:` states `read-only, no commits`. **Artifacts** must include `comments.posted` and match the `pr` variant output shape — do **not** collapse failure into `n/a-no-pr`:
65
65
  - `posted: yes` → Status `Done`; Artifacts include `comments.review_url`
@@ -80,7 +80,7 @@ Follow `mstar-audit` output format — audit index `README.md` (findings table,
80
80
 
81
81
  ### Output (Mode C)
82
82
 
83
- Follow the `pr` variant output shape in **`references/pr-review.md`** § Output shape — `findings` / `verdict` / `evidence` / `unverified` / `next` / `notes` / `comments` — including the posted review URL.
83
+ Follow the `pr` variant output shape in **`references/pr-review.md`** § Output shape — `findings` / `verdict` / `score_pct` / `tally` / `evidence` / `unverified` / `next` / `notes` / `comments` — including the posted review URL.
84
84
 
85
85
  ## Non-Recursive Dispatch Rule (Hard)
86
86
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/opencode",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "Morning Star harness OpenCode plugin — skills bootstrap + engine-backed runtime hooks (status lint, dispatch validation, Enforcement: hard gates).",
5
5
  "license": "MIT",
6
6
  "repository": {