@mstar-harness/dsh 3.7.3 → 3.8.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/dist/types.d.ts CHANGED
@@ -1,11 +1,16 @@
1
1
  /**
2
- * `mstar-engine-status` catalog source: a durable `catalog`-form
3
- * MessageSource the plugin appends to
4
- * every composed step at `agent/pre-step`, so the model-visible engine-status
5
- * row is reconstructable from the session log without re-parsing its prose
6
- * (model-visible ⟺ logged — dsh packages/AGENTS.md). Merge-extensible
7
- * `MessageSourceMap` augmentation mirroring the `@deepseek-ai/dsh-tool-skill`
8
- * precedent (declare module '@deepseek-ai/dsh-llm' + catalog-form source).
2
+ * `mstar-engine-status` catalog source + payload: the durable `catalog`-form
3
+ * MessageSource the plugin appends to every composed step at
4
+ * `agent/pre-step`, so the model-visible engine-status row is
5
+ * reconstructable from the session log without re-parsing its prose
6
+ * (model-visible ⟺ logged — dsh packages/AGENTS.md), plus the NON-persisted
7
+ * payload that row is rendered from.
8
+ *
9
+ * The source is the first-party `plugin` arm and nothing else: dsh freezes
10
+ * the source vocabulary per released session-format edge, so a custom `kind`
11
+ * or any extra `source` member makes a released edge refuse the whole session
12
+ * log. The structured facts live in
13
+ * {@link MstarEngineStatusPayload} instead.
9
14
  *
10
15
  * `mstar-iteration-gate` is the sibling catalog row: the boot-cached
11
16
  * `evaluatePhaseGate` verdict (tool result shape) appended after the
@@ -16,15 +21,29 @@
16
21
  */
17
22
  import type { EnforcementFlag } from '@mstar-harness/engine';
18
23
  /**
19
- * Durable provenance for the ONE unified engine-status catalog row. The
20
- * catalog is a `catalog`-form context, so it records the facts it published
21
- * beside the model-facing prose: a consumer presenting the row must not
22
- * re-parse the `<mstar_engine_status>` block, whose framing exists for the
23
- * model.
24
+ * The ONE unified engine-status catalog row's `source`: the first-party
25
+ * `plugin` arm with a CLOSED member set — exactly these three keys, never a
26
+ * fourth.
27
+ *
28
+ * `plugin` carries the plugin's identity literal and `form: 'catalog'` the
29
+ * row's first-party presentation; both are opaque, already-admitted
30
+ * vocabulary at every released session-format edge. Everything the row
31
+ * publishes about the workspace lives in
32
+ * {@link MstarEngineStatusPayload}, which never rides `source`.
24
33
  */
25
34
  export interface MstarEngineStatusSource {
26
- readonly kind: 'mstar-engine-status';
35
+ readonly kind: 'plugin';
36
+ readonly plugin: 'mstar-engine-status';
27
37
  readonly form: 'catalog';
38
+ }
39
+ /**
40
+ * The engine-status payload the model-facing row is rendered from — the
41
+ * facts the catalog publishes BESIDE the prose (a consumer presenting the row
42
+ * must not re-parse the `<mstar_engine_status>` block, whose framing exists
43
+ * for the model). Deliberately NOT persisted on the message `source`: no
44
+ * released historical session-format edge admits extra `source` members.
45
+ */
46
+ export interface MstarEngineStatusPayload {
28
47
  /**
29
48
  * The unified mstar version: the `@mstar-harness/dsh` plugin package
30
49
  * version (own manifest). The single-version invariant pins the bundled
@@ -187,7 +206,7 @@ export type WorkflowSelectionView = {
187
206
  * one-liner. All fields come from the same per-workspace cached build as
188
207
  * the rest of the row (one status.json / compass / knowledge-index read
189
208
  * per cache refresh — the TTL-bounded staleness tradeoff documented on
190
- * `buildCatalogSources`).
209
+ * `buildCatalogPayload`).
191
210
  */
192
211
  export interface MstarHarnessState {
193
212
  /**
@@ -332,8 +351,3 @@ export interface AgentFlowView {
332
351
  readonly events: readonly AgentFlowEventView[];
333
352
  readonly summary: readonly AgentFlowSummaryRow[];
334
353
  }
335
- declare module '@deepseek-ai/dsh-llm' {
336
- interface MessageSourceMap {
337
- 'mstar-engine-status': MstarEngineStatusSource;
338
- }
339
- }
@@ -157,7 +157,7 @@ Body conventions (`## Direction` + goal items as `- [ ]` / `- [x]` markdown task
157
157
 
158
158
  ## Fail-loud handoff contract
159
159
 
160
- Findings must pass engine validation **before** registration into the project register: `validateResidual(entry)` per entry, `validateProjectRegister(doc)` for the whole register, `validateWorkflowSnapshot(doc)` for the snapshot, `validateStatus` for the v2 root (`mstar status validate <path>` / engine import). Malformed entries — **non-object**, missing any of the nine required fields (`id`, `title`, `severity`, `source`, `scope`, `decision`, `owner`, `target`, `tracking` — mirroring engine `RESIDUAL_REQUIRED_FIELDS` in `packages/engine/src/status.ts`), or **severity** outside the enum — are **rejected** (`ok:false` + violation): fix and rewrite — never silent pass-through, downgrade-write, or “write then patch”.
160
+ Findings must pass engine validation **before** registration into the project register: `validateResidual(entry)` per entry, `validateProjectRegister(doc)` for the whole register, `validateWorkflowSnapshot(doc)` for the snapshot, `validateStatus` for the v2 root (`mstar status validate <path>` / engine import). Malformed entries — **non-object**, missing any of the nine required fields (`id`, `title`, `severity`, `source`, `scope`, `decision`, `owner`, `target`, `tracking` — mirroring engine `RESIDUAL_REQUIRED_FIELDS` in `packages/engine/src/status.ts`), or **`severity`** / **`decision`** outside their enums (`status.residual.invalid-severity` / `status.residual.invalid-decision`) — are **rejected** (`ok:false` + violation): fix and rewrite — never silent pass-through, downgrade-write, or “write then patch”. A *lifecycle* value such as `"resolved"` in `decision` leaves the **whole register unwritable** — `validateProjectRegister(doc)` then fails the document, so the engine refuses every subsequent write to that register, not just that entry.
161
161
 
162
162
  dsh-derived findings map their keys per the engine-residual validation verification spec §5; dsh keys never enter the schema.
163
163
 
@@ -36,7 +36,14 @@ or a custom profile).
36
36
  automatically by `ClientModuleHostService` — no separate profile layer or
37
37
  install step. It registers a **`conversation.view`** view-ring tab
38
38
  (`id: 'mstar-workflow'`, `order: 20`) labeled **"MStar 工作流" / "MStar
39
- Workflow"** rendering the latest `mstar-engine-status` catalog row as the
39
+ Workflow"** rendering the latest `mstar-engine-status` catalog **anchor** row
40
+ — the persisted source is the bare first-party `plugin` arm
41
+ (`{ kind: 'plugin', plugin: 'mstar-engine-status', form: 'catalog' }`, no
42
+ payload members), and the payload is fetched from the host's
43
+ `/api/mstar/engineStatus` endpoint (the gateway owns the route; the browser
44
+ half calls `connection.rpc.call('/api', 'mstar/engineStatus', { args: { sessionId, cwd } })`
45
+ and renders the session's stored snapshot, or an explicit unavailable reason) —
46
+ as the
40
47
  **MStar Workflow layout** — a right sidebar (plans ≤5 in time-desc order +
41
48
  `+N more`, open residual findings ≤10 with severity chips + overflow hint,
42
49
  policy with **enforcement first** then push / worktree / control worktree,
@@ -208,9 +215,11 @@ or a custom profile).
208
215
  the zones stack vertically. Pure `projectGraph` projection (never throws,
209
216
  explicit degraded states — muted empty states, never orange warn boxes).
210
217
  The branches block left the sidebar in plan `20260810-panel-sidebar-info`
211
- (its anchor fields stay in the catalog source; the iteration zone renders
212
- them via plan `20260810-panel-canvas-zones`); refresh follows the session
213
- snapshot, no polling — while the main agent is ACTIVELY orchestrating, a
218
+ (its anchor fields ride the row's per-session snapshot payload, NOT the
219
+ persisted source — the source is the bare first-party `plugin` arm; the
220
+ iteration zone renders them via plan `20260810-panel-canvas-zones`); refresh
221
+ follows the session snapshot, no polling — while the main agent is ACTIVELY
222
+ orchestrating, a
214
223
  ledger record (dispatch/settle) invalidates the workspace's TTL-cached
215
224
  catalog row so the next pre-step rebuilds and (digest text change)
216
225
  re-injects it, and the panel refreshes per step (seconds, not the 60 s TTL);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/dsh",
3
- "version": "3.7.3",
3
+ "version": "3.8.0",
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",
@@ -47,7 +47,8 @@
47
47
  "inject": [
48
48
  "@deepseek-ai/dsh-client-store",
49
49
  "@deepseek-ai/dsh-client-ui-conversation",
50
- "@deepseek-ai/dsh-client-locale"
50
+ "@deepseek-ai/dsh-client-locale",
51
+ "@deepseek-ai/dsh-client-connection"
51
52
  ],
52
53
  "platform": "web"
53
54
  }
@@ -56,6 +57,7 @@
56
57
  "pretest": "bun run build-client",
57
58
  "test": "bun test",
58
59
  "typecheck:tests": "bunx tsc --noEmit -p tests/tsconfig.json",
60
+ "typecheck:src": "bunx tsc --noEmit -p tsconfig.json",
59
61
  "bundle-assets": "bun run scripts/bundle-harness-assets.ts",
60
62
  "build": "bun run bundle-assets && rm -rf dist && bun build src/index.ts src/invariant.ts --target node --outdir dist --external @deepseek-ai/cordis --external @deepseek-ai/dsh-skill-filesystem --external @deepseek-ai/dsh-tools --external @deepseek-ai/dsh-llm && bun run build-client && bunx tsc",
61
63
  "build-client": "bun run scripts/build-client-bundle.ts",