@mstar-harness/dsh 3.2.1 → 3.2.3

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.
@@ -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`: follow **§ Report template (below)** three sections (Verdict Review Plan to fix). `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
  ```
@@ -156,25 +228,77 @@ Posting the GitHub Review is a **mandatory deliverable** of the `pr` variant —
156
228
  5. Record `html_url` / review id for `comments:`. Only now clean up the worktree (or after the n/a-no-PR skip).
157
229
  6. **Batch:** each reviewer posts on **their own PRs** only. No second PM summary comment unless the Assignment says so.
158
230
 
159
- ### Folding plans into the summary
231
+ ### Report template (GitHub Review `body`)
232
+
233
+ The posted review body is a three-section report. Section order fixed; omit a subsection only when its content is genuinely empty (write `none`, never delete the heading).
234
+
235
+ **Section emoji map** — verdict: `ship it` ✅ · `needs fixes` ⚠️ · `blocked` ⛔. Finding classes: 🔴 must-fix · 🟠 should-fix · 🔵 nit · ❓ unverified.
236
+
237
+ ````markdown
238
+ ## <verdict-emoji> Verdict: `<verdict>` · Confidence <score_pct>%
239
+
240
+ | Findings | Count |
241
+ | --- | --- |
242
+ | 🔴 must-fix | <n> |
243
+ | 🟠 should-fix | <n> |
244
+ | 🔵 nit | <n> |
245
+ | ❓ unverified | <n> |
246
+
247
+ ## 📋 Review
160
248
 
161
- Fold follow-up plans into the review body **only if** this review wrote them. A short index title, priority, effort, 1–3 sentence sketch, plan path inside:
249
+ **What this PR does**: <2–3 sentences summarizing the diff's intent and surface from the PR description plus your own read of the changed files, not copied marketing text.>
162
250
 
251
+ ### Findings
252
+
253
+ <Ranked findings (§ List cut). Each finding keeps its normal format — title, evidence (`file:line`), impact, **Merge class**, **Confidence**, fix sketch — with its class emoji prefixing the title.>
254
+
255
+ ### Linked-issue AC
256
+
257
+ <When § Linked-issue hygiene applied: per-criterion met / unmet / cut with one-line reasoning. Otherwise `none`.>
258
+
259
+ ### ✅ Verified
260
+
261
+ <Concise what-checks-proved summary — the smallest runtime checks actually run and what they showed. Residual unverified leads go here as `- ❓ <lead>` lines, not into the findings table.>
262
+
263
+ ### 🗑️ Considered & rejected
264
+
265
+ <- <finding>: rejected because <one line>. Otherwise `none` — rejections come from the three-way attack / vet pass (§ Attack and vet), so the next reviewer does not re-chase them.>
266
+
267
+ ## 🛠️ Plan to fix
268
+
269
+ <details><summary>展开修复计划 / Expand fix plan</summary>
270
+ <br>
271
+
272
+ ```md
273
+ <Fix plan in markdown when the audit produced one: ordered steps per finding, files touched, verification gates. Omit the block entirely only when no fix is proposed.>
163
274
  ```
164
- <details><summary>Follow-up plans</summary>
165
275
 
166
- - <plan title> — P1 / S — <1–3 sentence sketch> (`{PLAN_DIR}/audit-<date>/NNN-<slug>.md`)
167
276
  </details>
277
+ ````
278
+
279
+ - The Verdict section replaces the old two-line tally header on GitHub: same facts (verdict token + `score_pct` as Confidence + four-class tally), structured. The chat display contract (§ Display contract) is unchanged.
280
+ - When the fix plan itself contains fenced code blocks, open the outer fence with four backticks so the inner fences survive.
281
+
282
+ ### Folding plans into the summary
283
+
284
+ Fold follow-up plans into the review body **only if** this review wrote them. Put a short index — title, priority, effort, 1–3 sentence sketch, plan path — as the first content inside the § Report template **Plan to fix** `<details>` block, before the ```md fix-plan block:
285
+
286
+ ```
287
+ - <plan title> — P1 / S — <1–3 sentence sketch> (`{PLAN_DIR}/audit-<date>/NNN-<slug>.md`)
168
288
  ```
169
289
 
170
290
  Never dump full plan files.
171
291
 
172
292
  ## Output shape
173
293
 
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`.
294
+ - `- findings:` — list of evidence-backed findings (`none` when none). Each accepted finding includes **Merge class** (§ Merge class).
295
+ - `- verdict:` — exactly one of `ship it` / `needs fixes` / `blocked` (§ Verdict synthesis).
296
+ - `- score_pct:` — integer 0–100 from the locked formula (§ Tally and derived score).
297
+ - `- tally:`
298
+ - `- must-fix: <n>`
299
+ - `- should-fix: <n>`
300
+ - `- nit: <n>`
301
+ - `- unverified: <n>`
178
302
  - `- evidence:` — concise what-checks-proved summary.
179
303
  - `- unverified:` — residual unverified claims, or `none`.
180
304
  - `- next:` — one of `implementation` / `verify` / `docs`.
@@ -184,3 +308,20 @@ Verbatim labels, in order:
184
308
  - `review_url: <url>` when `posted: yes`; `n/a` when `n/a-no-pr` or `failed`
185
309
  - `inline: <N> posted / <M> attempted (<K> summary-only fallback)`
186
310
  - `plans_folded: yes` | `no`
311
+
312
+ ### Display contract (chat output)
313
+
314
+ First two lines of the **chat** display — verbatim:
315
+
316
+ ```
317
+ {verdict} · {score_pct}%
318
+ must-fix=<n> should-fix=<n> nit=<n> unverified=<n>
319
+ ```
320
+
321
+ Then ranked findings / leftover AC summary. Do not put `score_pct%` on the `- verdict:` token line.
322
+
323
+ The GitHub Review `body` no longer uses the two-line header — it follows § Report template, whose Verdict section carries the same facts structured (verdict token + Confidence + four-class emoji tally table).
324
+
325
+ ### List cut
326
+
327
+ 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/dsh",
3
- "version": "3.2.1",
3
+ "version": "3.2.3",
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",