@mstar-harness/opencode 2.1.1 → 2.3.0
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 +23 -0
- package/dist/mstar.js +29 -1
- package/harness-commands/codebase-audit.md +2 -1
- package/harness-commands/iteration-drive.md +2 -1
- package/harness-commands/iteration-loop.md +2 -1
- package/harness-commands/iteration-start.md +2 -1
- package/harness-skills/mstar-audit/SKILL.md +20 -0
- package/harness-skills/mstar-audit/references/audit-playbook.md +27 -0
- package/harness-skills/mstar-branch-worktree/SKILL.md +8 -1
- package/harness-skills/mstar-coding-behavior/SKILL.md +5 -0
- package/harness-skills/mstar-compound/references/compound-workflow.md +16 -0
- package/harness-skills/mstar-compound-refresh/SKILL.md +5 -0
- package/harness-skills/mstar-host/SKILL.md +5 -3
- package/harness-skills/mstar-host/references/dsh.md +502 -0
- package/harness-skills/mstar-iteration/SKILL.md +1 -1
- package/harness-skills/mstar-iteration/references/phase-2-worktree-lease.md +4 -5
- package/harness-skills/mstar-iteration/references/phase-4-5-pr-delivery.md +1 -0
- package/harness-skills/mstar-plan-artifacts/SKILL.md +1 -0
- package/harness-skills/mstar-plan-artifacts/references/status-and-residuals.md +8 -0
- package/harness-skills/mstar-plan-conventions/SKILL.md +1 -1
- package/harness-skills/mstar-review-qc/SKILL.md +6 -0
- package/harness-skills/mstar-roles/references/project-manager/qc-and-residuals.md +2 -1
- package/harness-skills/mstar-roles/references/qc-specialist/deep-review-lenses.md +16 -7
- package/harness-skills/mstar-roles/references/qc-specialist/report-template.md +17 -1
- package/harness-skills/mstar-roles/references/qc-specialist-shared.md +3 -1
- package/harness-skills/mstar-roles/references/writing-specialist.md +33 -0
- package/harness-skills/mstar-sdd/SKILL.md +5 -1
- package/harness-skills/mstar-sdd/references/file-handoffs.md +2 -0
- package/harness-skills/mstar-skill-authoring/SKILL.md +4 -2
- package/harness-skills/mstar-skill-authoring/references/regression-fixation.md +46 -0
- package/harness-skills/mstar-skill-authoring/references/skillsbench-authoring.md +37 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,29 @@ The monorepo root [CHANGELOG.md](../../CHANGELOG.md) summarizes cross-surface re
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [2.3.0] - 2026-08-16
|
|
10
|
+
|
|
11
|
+
### Harness
|
|
12
|
+
|
|
13
|
+
- Internal `@mstar-harness/engine` devDependencies in cli/opencode/dsh now use the `workspace:*` protocol; the release-prep engine-spec sync step was removed.
|
|
14
|
+
|
|
15
|
+
- Version alignment with harness **2.3.0** (no OpenCode package API change).
|
|
16
|
+
|
|
17
|
+
See root [CHANGELOG.md](../../CHANGELOG.md) **2.3.0**.
|
|
18
|
+
|
|
19
|
+
## [2.2.0] - 2026-08-13
|
|
20
|
+
|
|
21
|
+
### Bundled harness skills (`harness-skills/` at publish)
|
|
22
|
+
|
|
23
|
+
- Added the **dsh host reference** to `mstar-host`: a detect-table row for dsh's `subagent` delegation tool and `references/dsh.md` (tool map, in-process gates/enforcement, bundled commands, PM dispatch, gotchas).
|
|
24
|
+
- **Sync upstream v2.1.1**: merged the upstream `mstar-harness` v2.1.1 line into the dev-dsh branch — adds the `code-reviewer` role (read-only L2 SDD task reviewer / audit executor; replaces `generalPurpose` as the SDD per-task review seat, with generic fallback only when the role agent is absent on the host), ships the canonical default-ignore harness `.gitignore` format (`.mstar/**` + tracked re-includes `AGENTS.md` / `knowledge/` / `specs/`) across the engine, CLI `init` fence and bundled skills, and aligns all 11 version surfaces to 2.1.1.
|
|
25
|
+
- **engine**: `emitGitignoreSnippet` / `validateGitignore` / `HARNESS_PROCESS_GITIGNORE` now emit the default-ignore + re-include format instead of the flat per-directory ignore list; `ROLE_MAPPING` grows to 14 ids with `code-reviewer`.
|
|
26
|
+
- **bundle-assets**: re-synced `packages/dsh/harness-skills` / `harness-commands` from the merged `skills/` tree — the 6+ upstream-touched bundled skills and all `mstar-host/references/*.md` host adapters (cursor/kimi/omp/opencode/zcode) now carry the v2.1.1 wording (SDD task reviewer → `code-reviewer`).
|
|
27
|
+
|
|
28
|
+
- Version alignment with harness **2.2.0** (no OpenCode package API change).
|
|
29
|
+
|
|
30
|
+
See root [CHANGELOG.md](../../CHANGELOG.md) **2.2.0**.
|
|
31
|
+
|
|
9
32
|
## [2.1.1] - 2026-08-12
|
|
10
33
|
|
|
11
34
|
### Harness
|
package/dist/mstar.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// ../engine/dist/engine.js
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { mkdirSync as mkdirSync2, readdirSync, readFileSync as readFileSync2, statSync } from "node:fs";
|
|
4
|
+
import { execFileSync } from "node:child_process";
|
|
4
5
|
import { basename as basename2, dirname as dirname2, isAbsolute, join as join2, relative, resolve as resolve2 } from "node:path";
|
|
5
6
|
import { existsSync as existsSync2, readFileSync as readFileSync3, readdirSync as readdirSync2 } from "node:fs";
|
|
6
7
|
import { join as join4, resolve as resolve4 } from "node:path";
|
|
@@ -26,18 +27,45 @@ function resolveHarnessDir(startDir = process.cwd(), opts = {}) {
|
|
|
26
27
|
const explicit = opts.harnessDir ?? process.env.MSTAR_HARNESS_DIR;
|
|
27
28
|
if (explicit)
|
|
28
29
|
return resolve2(start, explicit);
|
|
30
|
+
const boundary = resolve2(start, opts.workspaceRoot ?? defaultWorkspaceRoot(start));
|
|
29
31
|
let dir = start;
|
|
30
32
|
for (;; ) {
|
|
33
|
+
if (!isAtOrBelow(dir, boundary))
|
|
34
|
+
return null;
|
|
31
35
|
for (const candidate of [join2(dir, ".mstar"), join2(dir, ".agents"), join2(dir, ".plans"), join2(dir, "plans")]) {
|
|
32
36
|
if (isDirectory(candidate))
|
|
33
37
|
return candidate;
|
|
34
38
|
}
|
|
39
|
+
if (dir === boundary)
|
|
40
|
+
return null;
|
|
35
41
|
const parent = dirname2(dir);
|
|
36
42
|
if (parent === dir)
|
|
37
43
|
return null;
|
|
38
44
|
dir = parent;
|
|
39
45
|
}
|
|
40
46
|
}
|
|
47
|
+
function defaultWorkspaceRoot(startDir) {
|
|
48
|
+
try {
|
|
49
|
+
const cdup = execFileSync("git", ["rev-parse", "--show-cdup"], {
|
|
50
|
+
cwd: startDir,
|
|
51
|
+
encoding: "utf8",
|
|
52
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
53
|
+
}).trim();
|
|
54
|
+
if (!cdup)
|
|
55
|
+
return startDir;
|
|
56
|
+
let boundary = startDir;
|
|
57
|
+
for (const segment of cdup.split(/[\\/]/)) {
|
|
58
|
+
if (segment && segment !== ".")
|
|
59
|
+
boundary = dirname2(boundary);
|
|
60
|
+
}
|
|
61
|
+
return resolve2(boundary);
|
|
62
|
+
} catch {}
|
|
63
|
+
return startDir;
|
|
64
|
+
}
|
|
65
|
+
function isAtOrBelow(dir, root) {
|
|
66
|
+
const rel = relative(root, dir);
|
|
67
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute(rel);
|
|
68
|
+
}
|
|
41
69
|
function resolveIterationDir(harnessDir) {
|
|
42
70
|
return join2(resolve2(harnessDir), "iterations");
|
|
43
71
|
}
|
|
@@ -167,7 +195,7 @@ function parseAssignmentBranchForms(assignmentText) {
|
|
|
167
195
|
if (fields.branchPolicy !== undefined && fields.branchPolicy !== "") {
|
|
168
196
|
const direct = fields.branchPolicy.match(/^direct\s+on\s+(\S+)/i);
|
|
169
197
|
if (direct) {
|
|
170
|
-
const strict = fields.branchPolicy.match(/^direct\s+on\s+(\S+)(?:\s*(?:[
|
|
198
|
+
const strict = fields.branchPolicy.match(/^direct\s+on\s+(\S+)(?:\s*(?:[\u2014\u2013]|--|-)\s*(.+))?$/);
|
|
171
199
|
forms.directOn = { branch: direct[1].trim(), reason: strict ? (strict[2] ?? "").trim() : "" };
|
|
172
200
|
}
|
|
173
201
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: codebase-audit
|
|
3
3
|
description: Survey a codebase as a senior advisor and produce prioritized, self-contained improvement plans. Read-only on source code. Use standalone before iteration-start to discover what's worth doing, or independently to build a prioritized backlog.
|
|
4
4
|
agent: project-manager
|
|
5
|
+
input: "[simplify]"
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Audit Codebase
|
|
@@ -32,7 +33,7 @@ The audit is **advisory** — it does not enter the per-plan state machine (`Tod
|
|
|
32
33
|
|
|
33
34
|
## Execute
|
|
34
35
|
|
|
35
|
-
Execute **`mstar-audit`** end to end(SKILL.md:Recon → Audit → Vet & prioritize → Write plans;effort `quick` / `standard` / `deep`;scope variants `security` / `perf` / `tests` / `branch` / `next` / `roadmap`)。Plans → `{PLAN_DIR}/audit-<YYYY-MM-DD>/NNN-<slug>.md` + `README.md` index,per **`mstar-plan-artifacts/references/plan-quality-bar.md`**。
|
|
36
|
+
Execute **`mstar-audit`** end to end(SKILL.md:Recon → Audit → Vet & prioritize → Write plans;effort `quick` / `standard` / `deep`;scope variants `security` / `perf` / `tests` / `branch` / `next` / `roadmap` / `simplify`)。Plans → `{PLAN_DIR}/audit-<YYYY-MM-DD>/NNN-<slug>.md` + `README.md` index,per **`mstar-plan-artifacts/references/plan-quality-bar.md`**。
|
|
36
37
|
|
|
37
38
|
Executor: PM dispatches `@code-reviewer`;大型仓库 scout 扇出经 Assignment `Delegation: allowed (scout/explore only, read-only)`(Routing 表)。
|
|
38
39
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: iteration-drive
|
|
3
3
|
description: Drive the active iteration to completion — Phase 2 Autonomous Execute, Phase 3 iteration-close, Phase 4 Create PR, Phase 5 PR merge-ready loop (prefer babysit/*-babysit; optional greploop when repo has it; else CI fallback) until mergeable. Not Done until Phase 5 exit checklist passes.
|
|
4
4
|
agent: project-manager
|
|
5
|
+
input: "[no args]"
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Drive Iteration
|
|
@@ -78,7 +79,7 @@ command -v mstar-harness >/dev/null 2>&1 && mstar-harness dispatch validate "<la
|
|
|
78
79
|
if command -v mstar-harness >/dev/null 2>&1; then mstar-harness dispatch validate "<latest-assignment-file>" || exit 1; fi
|
|
79
80
|
```
|
|
80
81
|
|
|
81
|
-
> 路径必须加引号且替换为具体文件(如最新 `{SDD_DIR}/task-N-brief.md`,勿留尖括号)——agent 代入的路径不得进入 shell
|
|
82
|
+
> 路径必须加引号且替换为具体文件(如最新 `{SDD_DIR}/task-N-brief.md`,勿留尖括号)——agent 代入的路径不得进入 shell 无引号展开。
|
|
82
83
|
|
|
83
84
|
## Phase 3: iteration-close
|
|
84
85
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: iteration-loop
|
|
3
3
|
description: "Autonomous full iteration loop for cloud agents — Phase 1 (code-first auto direction lock + compass/plans + Review & Edit chain) through Phase 2–5 (execute → close → PR → merge-ready). Optional args: direction, scale (S|M|L|XL, default M). Not Done until Phase 5 exit checklist passes. Minimal human intervention; no grill-me."
|
|
4
4
|
agent: project-manager
|
|
5
|
+
input: "[direction] [scale]"
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Iteration Loop
|
|
@@ -129,7 +130,7 @@ command -v mstar-harness >/dev/null 2>&1 && mstar-harness dispatch validate "<la
|
|
|
129
130
|
if command -v mstar-harness >/dev/null 2>&1; then mstar-harness dispatch validate "<latest-assignment-file>" || exit 1; fi
|
|
130
131
|
```
|
|
131
132
|
|
|
132
|
-
> 路径必须加引号且替换为具体文件(如最新 `{SDD_DIR}/task-N-brief.md`,勿留尖括号)——agent 代入的路径不得进入 shell
|
|
133
|
+
> 路径必须加引号且替换为具体文件(如最新 `{SDD_DIR}/task-N-brief.md`,勿留尖括号)——agent 代入的路径不得进入 shell 无引号展开。
|
|
133
134
|
|
|
134
135
|
**Loop 特有**:Phase 5 push cadence(HARD)→ **`mstar-iteration` §5.1a**;exit checklist → **`mstar-iteration` §5.2**(`references/phase-4-5-pr-delivery.md` §5.2)。
|
|
135
136
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: iteration-start
|
|
3
3
|
description: "Start a new harness iteration — optional direction hint, research, grill-me, compass/plans, Review & Edit chain (long-lived {SPECS_DIR}/ + {ITERATION_DIR}/<id>/ package; compound promotes package at close only), PM lock, integration branch; then auto-continue Phase 2→5 (execute → close → PR → merge-ready) unless `pause` arg given."
|
|
4
4
|
agent: project-manager
|
|
5
|
+
input: "[direction] [pause]"
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Start Iteration
|
|
@@ -111,7 +112,7 @@ command -v mstar-harness >/dev/null 2>&1 && mstar-harness dispatch validate "<la
|
|
|
111
112
|
if command -v mstar-harness >/dev/null 2>&1; then mstar-harness dispatch validate "<latest-assignment-file>" || exit 1; fi
|
|
112
113
|
```
|
|
113
114
|
|
|
114
|
-
> 路径必须加引号且替换为具体文件(如最新 `{SDD_DIR}/task-N-brief.md`,勿留尖括号)——agent 代入的路径不得进入 shell
|
|
115
|
+
> 路径必须加引号且替换为具体文件(如最新 `{SDD_DIR}/task-N-brief.md`,勿留尖括号)——agent 代入的路径不得进入 shell 无引号展开。
|
|
115
116
|
|
|
116
117
|
**Prepare gate (per plan in compass)**:
|
|
117
118
|
|
|
@@ -70,6 +70,21 @@ Every finding follows **`references/finding-format.md`** — read it before the
|
|
|
70
70
|
|
|
71
71
|
### Phase 3 — Vet, prioritize, confirm
|
|
72
72
|
|
|
73
|
+
**Attack before vet — claims must survive an adversarial pass first.** Take the top candidate findings (by leverage; scale the count to finding volume — attack the whole table when small, the head when large) and run a three-way attack on each:
|
|
74
|
+
|
|
75
|
+
1. **Counter-example** — find a boundary case that makes the claim not hold.
|
|
76
|
+
2. **Simpler explanation** — does a simpler explanation cover the same evidence?
|
|
77
|
+
3. **Evidence verifiability** — open the cited `file:line` and check it actually supports the claim.
|
|
78
|
+
|
|
79
|
+
Dispose per the five-state rule (single-pass version — the four dispositions below implement the survey's five-state semantics: uncovered-keep == 未提及保留; never-drop == 全空/null 回流):
|
|
80
|
+
|
|
81
|
+
- **Survived** — passes to vet unchanged.
|
|
82
|
+
- **Refuted** — drop, and record in the index's "considered and rejected" section: `- <finding>: not worth doing because <one line>`.
|
|
83
|
+
- **Hallucinated** — the attack surfaced a claim never in the original finding set: discard it and log a red-team record line in the index (never into the findings table; it does not occupy a "considered and rejected" slot — it was never a finding). Disambiguation: hallucinated = a claim the attack itself produced; fabricated/unsupported evidence inside the original finding goes to **Refuted** via the evidence-verifiability axis, not to Hallucinated.
|
|
84
|
+
- **Uncovered** — the attack did not reach a finding: treat as unreviewed and keep for vet. Never drop a finding just because the attack missed it.
|
|
85
|
+
|
|
86
|
+
Where the attack step decides whether a claim stands on its face, vet below confirms the code itself — opening cited files and disposing by-design / mis-attribution / duplicate cases; survived findings hand to vet below.
|
|
87
|
+
|
|
73
88
|
**Vet before presenting — subagents over-report.** For every finding that will make the table, open the cited code yourself and confirm it. Three failure classes to expect:
|
|
74
89
|
|
|
75
90
|
1. **By-design behavior** reported as a bug or vulnerability (e.g. honoring `https_proxy` flagged as SSRF — standard proxy convention; or a tradeoff explicitly recorded in an ADR).
|
|
@@ -112,6 +127,7 @@ If an audit directory from a previous run exists, **reconcile, don't duplicate**
|
|
|
112
127
|
| Category focus (`security`, `perf`, `tests`, ...) | Recon, then that category only, then plan | Useful for targeted sweeps |
|
|
113
128
|
| `branch` | Current branch changes only | Files changed since merge-base with default branch + their direct importers. Tag every finding `introduced` or `pre-existing` |
|
|
114
129
|
| `next` / `roadmap` | Direction category only, in depth | 4–6 grounded suggestions; selected ones become design/spike plans |
|
|
130
|
+
| `simplify` | DEBT-focused deep pass: dead / duplicated / speculative / over-built / added-then-removed / hand-rolled-where-a-dependency-exists surfaces | Prove-or-reject per playbook §5; findings use Category DEBT; tiny-real items → "considered and rejected" rows, never inline TODOs (Hard Rule 1) |
|
|
115
131
|
|
|
116
132
|
## Output format
|
|
117
133
|
|
|
@@ -138,6 +154,10 @@ If an audit directory from a previous run exists, **reconcile, don't duplicate**
|
|
|
138
154
|
## Findings considered and rejected
|
|
139
155
|
|
|
140
156
|
- <finding>: not worth doing because <one line>.
|
|
157
|
+
|
|
158
|
+
## Red-team dispositions
|
|
159
|
+
|
|
160
|
+
- <finding>: <survived / refuted / hallucination-dropped / uncovered-kept>, <one-line reason>
|
|
141
161
|
```
|
|
142
162
|
|
|
143
163
|
Status values: `TODO` | `IN PROGRESS` | `DONE` | `BLOCKED` | `REJECTED`
|
|
@@ -18,6 +18,8 @@ The highest-trust category — real bugs found by reading, not speculation.
|
|
|
18
18
|
- Concurrency: check-then-act on shared resources, missing transactions around multi-write operations, idempotency of retried operations (webhooks, queues).
|
|
19
19
|
- Type escape hatches: `any` / `as` casts / `@ts-ignore` clusters — each one is a place the compiler was overruled.
|
|
20
20
|
- Resource leaks: unclosed handles, connections, subscriptions; missing `finally`.
|
|
21
|
+
- Derived-state drift: every cache, replay, projection, denormalized copy, or UI echo must trace to an authoritative source and an invalidation point; flag retained state with neither.
|
|
22
|
+
- Bounds covering the final operation: who owns the complete emitted/retained result (wrappers and metadata included)? Probe tiny/exact limits, oversized single chunks, and multibyte text against byte limits.
|
|
21
23
|
|
|
22
24
|
## 2. Security
|
|
23
25
|
|
|
@@ -34,6 +36,7 @@ Review only what is directly supported by code evidence. Keep findings framed as
|
|
|
34
36
|
- Dependency posture: run the ecosystem's audit command (`npm audit`, `pip-audit`, `cargo audit`) in read-only mode. Report only critical/high advisories that affect reachable runtime code.
|
|
35
37
|
- Production configuration: overly broad CORS where credentials are allowed, missing response-hardening headers (e.g. CSP), cookies missing appropriate `HttpOnly`/`Secure`/`SameSite` attributes, debug/verbose behavior enabled in production.
|
|
36
38
|
- Data minimization: PII or sensitive operational data in logs, stack traces returned to clients, internal error details exposed through API responses.
|
|
39
|
+
- Enforcement bypass: for every validation/rejection point, look for alternate callers that route around it — direct calls, wrappers, facades, schema-less paths, listener ordering.
|
|
37
40
|
|
|
38
41
|
## 3. Performance
|
|
39
42
|
|
|
@@ -56,6 +59,9 @@ The goal is not a percentage — it's *which untested code is dangerous*.
|
|
|
56
59
|
- Existing test quality: tests that assert nothing meaningful, heavy mocking that tests the mocks, snapshot tests nobody reads, flaky patterns (real timers, real network, order dependence).
|
|
57
60
|
- Missing test layers: unit-only suites with zero integration coverage on API boundaries, or the inverse.
|
|
58
61
|
- Verification infrastructure: is there a one-command way to know the codebase works? If not, that's finding #1 and a prerequisite plan for any risky change.
|
|
62
|
+
- Real entry path: do tests exercise the shipped entry (CLI, loader, plugin boot) rather than a hand-mounted equivalent?
|
|
63
|
+
- Externally observable state: assertions verify logs, events, files, exit codes — never implementation restatement or agent-reported success.
|
|
64
|
+
- User-visible output is behavior (conditional): in repos shipping UI copy, CLI output, API error shapes, or prompt text, wording is behavior — snapshot or e2e coverage should pin it.
|
|
59
65
|
|
|
60
66
|
## 5. Tech Debt & Architecture
|
|
61
67
|
|
|
@@ -65,6 +71,27 @@ The goal is not a percentage — it's *which untested code is dangerous*.
|
|
|
65
71
|
- God objects/modules: files an order of magnitude larger than the repo median that everything touches; functions with double-digit parameters or deep conditional nesting.
|
|
66
72
|
- Inconsistent patterns: three ways of doing data fetching / error handling / styling — pick the winner (the one the team converged on most recently) and plan the consolidation.
|
|
67
73
|
- Abstraction mismatches: premature abstractions with a single implementation, or missing abstractions where the same change always requires touching N files in lockstep.
|
|
74
|
+
- Public-but-one-caller: a public method on a generic service with a single internal caller is a private-capability closure candidate.
|
|
75
|
+
- Unjustified defaults/public options: flag defaults or public operations/formats with no current-consumer evidence or prior art.
|
|
76
|
+
|
|
77
|
+
### Prove-or-reject before reporting DEBT (`simplify` scope)
|
|
78
|
+
|
|
79
|
+
**Prove before reporting dead code.** Classify consumers first — production corpus / tests-docs-only / ambiguous (examples, scripts: inspect, don't assume). Grep the exact symbol, plus event/field/config names, both quoted and bare. Read the call sites — a grep hit is a lead, not a verdict. "Tests are the only consumer" is a finding-enabler when the pinned behavior is non-load-bearing; "an invariant/test existing only to protect an unused API" is itself the signal.
|
|
80
|
+
|
|
81
|
+
**Hand-rolled vs dependency swap bar.** Name the exact surface the package covers — residual semantics count against the swap. Health-check the dependency honestly. A recorded decision (ADR/knowledge doc) beats the swap claim — re-litigating a settled tradeoff needs new evidence. Weigh net deletion: implementation + dedicated tests + docs − remaining glue. A wrapper that relocates the same complexity is not a win.
|
|
82
|
+
|
|
83
|
+
**Mirrored-fact test.** When several mechanisms track the same liveness/settlement fact, propose one controller — but preserve machinery protecting publication, rollback, callback containment, and first-terminal arbitration.
|
|
84
|
+
|
|
85
|
+
**Strong-candidate families** (one line per family):
|
|
86
|
+
- Symbols with no production consumer.
|
|
87
|
+
- Tests/docs-only consumers pinning non-load-bearing behavior.
|
|
88
|
+
- Two representations mirroring the same fact.
|
|
89
|
+
- Seam methods fully implemented for support but with zero consumption.
|
|
90
|
+
- Speculative product generality.
|
|
91
|
+
- Invariants/rollbacks/expected-outputs existing only to protect an unused API.
|
|
92
|
+
- Hand-rolled where a dependency exists.
|
|
93
|
+
|
|
94
|
+
**Guards.** A production caller exists → feature decision, not cleanup (reject). A recorded seam/ADR rationale → new evidence must beat it. Tiny-but-real items → "considered and rejected" rows in the index, never inline TODOs (Hard Rule 1).
|
|
68
95
|
|
|
69
96
|
## 6. Dependencies & Migrations
|
|
70
97
|
|
|
@@ -150,7 +150,7 @@ Default process artifacts (`plans/`, `iterations/`, `status.json`, `sdd/`, `note
|
|
|
150
150
|
**Naming conventions (PM / ops; examples only — paths MUST be canonical absolute)**
|
|
151
151
|
|
|
152
152
|
1. **Control worktree** — usually the primary checkout or a PM-designated path on `spec_integration_branch`; record once in `metadata.control_worktree_path`.
|
|
153
|
-
2. **Feature worktree (per plan)** — one distinct
|
|
153
|
+
2. **Feature worktree (per plan)** — one distinct subdirectory under the workspace root **`.worktrees/`** per active `plan_id` (e.g. `.worktrees/<plan-id>-<slug>`; AGENTS.md「Local scratch layout」), gitignored by the repo convention; Assignment **`Worktree path`** must match lease `worktree_path`.
|
|
154
154
|
3. **L2 track worktrees (within-plan)** — additional distinct directories per parallel implement track under the **same** plan (see **`references/parallel-writable-pre-dispatch.md`**), each with its own PM-approved **`Working branch`**.
|
|
155
155
|
|
|
156
156
|
> **Engine check (when available):** run `mstar worktree check <plan-id>` (L1) / `mstar worktree check --l2 --tracks <json>` (L2) (or `import { l1PreDispatchCheck, l2PreDispatchCheck, assertControlVsFeaturePath, assertBranchAlignment } from "@mstar-harness/engine"` in a host hook) to verify the L1/L2 isolation rules above (lease worktree ≠ control path; checked-out branch matches `Working branch`). On `fail` -> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
|
|
@@ -217,3 +217,10 @@ Default process artifacts (`plans/`, `iterations/`, `status.json`, `sdd/`, `note
|
|
|
217
217
|
- 若 **QA 与同仓其他可写角色并发**提交测试代码,仍须遵守上文「同仓并发写入」**worktree** 规则(可为 QA 单开一条写入 worktree,**同一 `Working branch`**,由 PM 在 Assignment 写明)。
|
|
218
218
|
|
|
219
219
|
派发前清单与常见反模式 → **`references/parallel-writable-pre-dispatch.md`**。
|
|
220
|
+
|
|
221
|
+
## History rewrite 与推送安全
|
|
222
|
+
|
|
223
|
+
- 已推送分支的任何 history rewrite:先 `git fetch` 记录远端**精确 OID**,发布用 `--force-with-lease=<branch>:<observed-oid>`;**禁止**裸 `--force`。
|
|
224
|
+
- Rewrite 推送后:重新 fetch heads;rewrite 前的 review threads / approvals / check 结果**不再是当前证据** — merge 结论前须重审(commit hash 与 inline-comment anchor 已失效)。
|
|
225
|
+
- 证据最窄原则(audit / QA Assignment 场景):选择会在目标回归上失败的**最窄**检查;不因「push 在即」重跑已通过的检查。
|
|
226
|
+
- 本节只管 rewrite / lease / 证据失效面;CI / review 波次 push 门禁(时序)SSOT → `mstar-iteration` §5.1a。
|
|
@@ -92,6 +92,11 @@ When something does not work, investigate; do not guess.
|
|
|
92
92
|
- **Run existing tests before and after changes.** If they passed before and fail after, you broke something. If they were already failing, say so.
|
|
93
93
|
- **If stuck, say so.** "I tried X and Y; neither worked. I'm seeing Z. I think it might be W but am not sure" is infinitely more useful than silently trying random things for 20 iterations.
|
|
94
94
|
|
|
95
|
+
**Dataflow-directed diagnosis — how to locate, verify, and falsify** (for where to fix, see Surgical Changes · bug=root-cause; for the pre-fix repro test, see the bullets above):
|
|
96
|
+
- **Map the data flow before judging.** Trace input → processing → storage → output, noting who writes and who reads at each step. A bug is a state deviation from expectation at some point in that flow (expected state vs observed state) — locate it from the data, not by static code reading.
|
|
97
|
+
- **Four verifiable cross-checks.** Every hypothesis must be cross-checkable: re-run the repro / log comparison / input-output comparison / dual-path comparison. A hypothesis that cannot be verified on the spot is not a conclusion.
|
|
98
|
+
- **Falsify the fix.** After the fix, re-run the original repro and compare output with expectation. If the problem did not disappear, the root cause was wrong — report "verification failed" explicitly; never pretend success.
|
|
99
|
+
|
|
95
100
|
## 5) Goal-Driven Execution
|
|
96
101
|
|
|
97
102
|
Convert vague requests into verifiable outcomes and iterate until verified. Define concrete success criteria before major edits; use brief `Step -> verify` checkpoints for multi-step tasks; for split delivery, maintain a durable roadmap (current slice, later slices, dependencies, owner/trigger, completion condition); prefer evidence-backed completion (tests, command output, reproducible checks). If verification fails, loop on diagnosis and fix before declaring completion. Do not finish with "next plan / later / follow-up" only in prose — remaining work must be written to the plan/status artifact or the task reports `Partial` / `Blocked`.
|
|
@@ -113,6 +113,22 @@ After writing, validate the YAML frontmatter:
|
|
|
113
113
|
- `date` is YYYY-MM-DD format
|
|
114
114
|
- Array fields use `[item1, item2]` syntax
|
|
115
115
|
|
|
116
|
+
### 3.5 知识文档质量门:HEAD-resolvability & prose hygiene
|
|
117
|
+
|
|
118
|
+
写作完成、进入 Phase 4 前,对文档运行本质量门(writing-specialist 编辑 durable harness artifacts 时适用同一 rubric — 见 `mstar-roles/references/writing-specialist.md` Output Guidance 指针):
|
|
119
|
+
|
|
120
|
+
- **The one test**:读者在 HEAD(无 chat transcript / dispatch prompt / 未合并草稿访问权)能否解析每个引用并验证每个声明?
|
|
121
|
+
- **mstar 泄漏分类**(vantage 来自 authoring session 而非仓库现状;修剪或重述):
|
|
122
|
+
- dead session citations:chat-only decision 序号 → 引 plan/knowledge/roadmap 属主路径,或独立重述事实
|
|
123
|
+
- durable docs 中的 change narration:knowledge/roadmap/README 陈述现状;已修回归 → counterfactual-present(「without X, Y happens」)
|
|
124
|
+
- review choreography:谁在哪轮确认 → 平实事实;finding id 留在 review bundle(其 sanctioned genre)
|
|
125
|
+
- reviewer-addressed justification(向评审自辩的措辞)
|
|
126
|
+
- control-flow narration(过程/控制流叙述)
|
|
127
|
+
- hedges without markers → 既有 `simplify:` / `temporary` 标记约定(`mstar-coding-behavior`;引用不重复)
|
|
128
|
+
- authoring-language slips:双语对之外的 zh/en 混杂
|
|
129
|
+
- **Keep 规则(mstar-sanctioned)**:review bundle / QC report 内的 R# 与 finding id(durable 文档引用 QC 证据的 sanctioned pattern 是经 review bundle 路径引用:finding id 留在 bundle 内,durable 文档只引用 bundle 路径本身);issue 引用;带 provenance 词的 measured bounds;runtime old/new 生命周期态;Alternatives-considered genre 节;HEAD 持久工件中的 iteration/plan id
|
|
130
|
+
- **过度修正陷阱**:义务↛背书翻转;hypothetical 保持标记;共享一句时删子句不删句。「修剪前枚举命题」→ complete-proposition rule(`mstar-roles/references/writing-specialist.md` Output Guidance — SSOT,不在本节重述)
|
|
131
|
+
|
|
116
132
|
## Phase 4: Discoverability check
|
|
117
133
|
|
|
118
134
|
Check whether the project's `AGENTS.md` or `CLAUDE.md` would lead a future agent to discover `{KNOWLEDGE_DIR}`.
|
|
@@ -50,6 +50,9 @@ For each candidate document, classify into one of five outcomes:
|
|
|
50
50
|
| **Replace** | Old doc is misleading; known better replacement exists | Create trustworthy successor, then delete old |
|
|
51
51
|
| **Delete** | No longer useful, applicable, or distinct | Delete — git history preserves it |
|
|
52
52
|
|
|
53
|
+
> **Guardrail — rejected approaches:** a captured rejected approach stays only while the losing idea remains a tempting, meaningful mistake; delete it once obsolete or no longer plausible.
|
|
54
|
+
> **Calibration:** first real run of this axis — 9 size-divergent knowledge docs (36–78 lines) under `{KNOWLEDGE_DIR}/architecture-patterns/` classified at fold time, all kept by future value (evidence: `.mstar/plans/20260815-mstar-knowledge-prose-folds.md` `## Review Gate Summary` → Task evidence); length proved not to be a criterion.
|
|
55
|
+
|
|
53
56
|
## Core rules
|
|
54
57
|
|
|
55
58
|
1. **Evidence over opinion.** Signals are inputs, not a scorecard. Use engineering judgment.
|
|
@@ -58,6 +61,7 @@ For each candidate document, classify into one of five outcomes:
|
|
|
58
61
|
4. **Be decisive.** When evidence is clear (file renamed, class moved), apply. Only ask PM when genuinely ambiguous.
|
|
59
62
|
5. **Avoid low-value churn.** Don't edit for typos, polish, or cosmetic changes that don't improve accuracy.
|
|
60
63
|
6. **Delete, don't archive** — **except** formal **iteration-start** §1.6 corpus hygiene (`mstar-iteration/references/iteration-corpus-hygiene.md`), which **moves** superseded/redundant knowledge/specs to `{HARNESS_DIR}/archived/knowledge|specs/`. Outside that gate, git history is the archive; `git log --diff-filter=D -- <path>` finds deleted docs.
|
|
64
|
+
> **Not adopted:** frozen-archive seal machinery, `Archived:` triplets, or a verifier — they contradict rule 6 (delete, don't archive; git history is the archive); do not reintroduce.
|
|
61
65
|
7. **Evaluate document-set design.** Check whether two+ docs overlap and should be consolidated. Redundant docs silently drift apart.
|
|
62
66
|
|
|
63
67
|
## Scope selection
|
|
@@ -92,6 +96,7 @@ For each doc, check:
|
|
|
92
96
|
2. **Referenced conventions still match?** — check against current `AGENTS.md`, `CONCEPTS.md`, lint configs.
|
|
93
97
|
3. **Solution still the recommended approach?** — has a newer pattern superseded it?
|
|
94
98
|
4. **Overlap with other docs?** — search for same module/tags to find duplicates.
|
|
99
|
+
5. **Future decision value?** — rationale / alternatives considered / negative guarantees / reintroduction conditions that would still guide a future change → **Keep, regardless of length**. A completed decision whose body has no future leverage left (one-off fix detail, superseded mechanics) enters the Delete candidate pool. Word count and age remain discovery aids, never criteria.
|
|
95
100
|
|
|
96
101
|
### Phase 3: Classify and act
|
|
97
102
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mstar-host
|
|
3
|
-
description: Morning Star host adapter (OpenCode, Cursor, Codex, Kimi, ZCode, omp). Use after mstar-harness-core whenever host entry, clarify, dispatch, or plan UX differs by platform - OpenCode question/task-tool subagent invoke, Cursor /pm and CreatePlan/SwitchMode dual-write and Task parallel QC, Codex plugin skills plus Plan/Goal Mode, Kimi Agent/AgentSwarm with built-in subagent types only (coder/explore/plan) and role-in-prompt binding, ZCode Agent/AskUserQuestion/EnterPlanMode with built-in subagent types and role-in-prompt binding, omp task/ask/hub preferring live-schema role agents (agents/*.md) with C5b skill-load binding (generic task/scout only as fallback), sandboxed tools, and tool discovery. Auto-detect host from session tools; then Read references/<host>.md. Always load after mstar-harness-core.
|
|
3
|
+
description: Morning Star host adapter (OpenCode, Cursor, Codex, Kimi, ZCode, omp, dsh). Use after mstar-harness-core whenever host entry, clarify, dispatch, or plan UX differs by platform - OpenCode question/task-tool subagent invoke, Cursor /pm and CreatePlan/SwitchMode dual-write and Task parallel QC, Codex plugin skills plus Plan/Goal Mode, Kimi Agent/AgentSwarm with built-in subagent types only (coder/explore/plan) and role-in-prompt binding, ZCode Agent/AskUserQuestion/EnterPlanMode with built-in subagent types and role-in-prompt binding, omp task/ask/hub preferring live-schema role agents (agents/*.md) with C5b skill-load binding (generic task/scout only as fallback), dsh (DeepSeek Harness) subagent tool with in-process engine gates and bundled mstar commands, sandboxed tools, and tool discovery. Auto-detect host from session tools; then Read references/<host>.md. Always load after mstar-harness-core.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Morning Star Host Adapter
|
|
@@ -30,12 +30,13 @@ Detect from **session tool shapes and available commands** — not from plugin m
|
|
|
30
30
|
| **`subagent_type`** param on the Task tool (plus **CreatePlan**/**SwitchMode** when Plan mode is active) | `cursor` | `references/cursor.md`; Plan mode also `references/cursor-plan-mode-bridge.md` |
|
|
31
31
|
| **`question`** tool, or **`task`** tool with **`subagent`** (singular) — no `tasks[]` batch | `opencode` | `references/opencode.md` |
|
|
32
32
|
| **`task`** tool with **`agent`** / **`tasks[]`** batch, **`ask`**, **`hub`** (omp also exposes `/goal`; goal rule is host-agnostic per below) | `omp` | `references/omp.md`; Plan mode also `references/omp-plan-mode-bridge.md` |
|
|
33
|
+
| **`subagent`** tool (dsh's model-facing delegation tool — `@deepseek-ai/dsh-tool-subagent` default `toolName`) | `dsh` | `references/dsh.md` |
|
|
33
34
|
| **`Agent`** / **`AskUserQuestion`** / **`EnterPlanMode`** + **`AgentSwarm`** (Kimi-only) | `kimi` | `references/kimi.md`; Plan mode also `references/kimi-plan-mode-bridge.md` |
|
|
34
35
|
| **`Agent`** / **`AskUserQuestion`** / **`EnterPlanMode`** / **`TodoWrite`**, **no `AgentSwarm`** | `zcode` | `references/zcode.md`; Plan mode also `references/zcode-plan-mode-bridge.md` |
|
|
35
36
|
| `/plan`, `/goal` slash commands; **Goal tools**; `functions.*` / `codex_app.*` tool namespaces; `tool_search`; Browser plugin tools | `codex` | `references/codex.md`; Plan mode also `references/_shared/plan-mode-bridge-core.md` |
|
|
36
|
-
| Still ambiguous | - | Read sections in **`cursor.md`**, **`opencode.md`**, **`codex.md`**, **`kimi.md`**, **`zcode.md`**, and **`
|
|
37
|
+
| Still ambiguous | - | Read sections in **`cursor.md`**, **`opencode.md`**, **`codex.md`**, **`kimi.md`**, **`zcode.md`**, **`omp.md`**, and **`dsh.md`** that match tools you have; **`mstar-harness-core` wins** on conflict |
|
|
37
38
|
|
|
38
|
-
Order matters: check `cursor` → `opencode` → `omp` → `kimi` → `zcode` → `codex`. `subagent_type` (Cursor) vs `subagent` (OpenCode) vs `agent`/`tasks[]` (omp) is the sharpest split among the Task-based hosts.
|
|
39
|
+
Order matters: check `cursor` → `opencode` → `omp` → `dsh` → `kimi` → `zcode` → `codex`. `subagent_type` (Cursor) vs `subagent` (OpenCode) vs `agent`/`tasks[]` (omp) is the sharpest split among the Task-based hosts; dsh's `subagent` tool collides with no other row, so it sits with the agent-tool hosts.
|
|
39
40
|
|
|
40
41
|
> **Engine check (when available):** run `mstar host detect --signals <comma-list>` (or `import { detectHost } from "@mstar-harness/engine"` in a host hook) to resolve the detection table above from session tool shapes (prints the host id, or `ambiguous` to fall back on the table + judgment). On `fail` -> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
|
|
41
42
|
|
|
@@ -62,6 +63,7 @@ Docs name assets as skill **`<name>`** → `scripts/…` / `references/…`. **R
|
|
|
62
63
|
| **Cursor** | Skill **name** via plugin skills | Global `~/.cursor/plugins/local/morning-star-harness/skills/<name>/`; project `.cursor/plugins/morning-star-harness/skills/<name>/` |
|
|
63
64
|
| **Codex** | Skill **name** via plugin | Plugin-mounted `skills/<name>/`; project command skills under `.agents/skills/<name>/` |
|
|
64
65
|
| **OpenCode** | Skill **name** via `@mstar-harness/opencode` | Package-internal `harness-skills/<name>/` — never `process.cwd()/skills/` |
|
|
66
|
+
| **dsh** | Skill **name** via the mstar skill-local provider (`providerName: mstar`) | `$DSH_BUNDLED_SKILL_DIR/<name>[/<rel>]` — the packaged `harness-skills/` mirror mounted package-relative by `@mstar-harness/dsh`; never app cwd |
|
|
65
67
|
| **Kimi / ZCode** | Skill **name** / `/skill:<name>` | Plugin mount `./skills/<name>/` from the installed plugin root |
|
|
66
68
|
|
|
67
69
|
Authoring convention: **`mstar-skill-authoring`** § Skill-relative script and asset paths. Per-host URI / mount detail: `references/<host>.md`.
|