dsh-submodel 0.3.0 → 0.4.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/README.en.md CHANGED
@@ -1,24 +1,23 @@
1
1
  # dsh-submodel
2
2
 
3
- **The default policy pack for the official subagent.** Install once and "who does what, when to delegate, and to whom" is configured for you.
3
+ **Two-way cross-model delegation policy for the official subagent.** A strong main model hands routine execution down to a cheaper model; a cheap main model escalates architecture-level problems to a strong one — routine token spend stays cheap, hard problems still get a strong model.
4
+
5
+ > **What it solves**
6
+ > - **Routine execution and retrieval** stay on a cheap model (e.g. DeepSeek Flash), so expensive models stay out of routine work.
7
+ > - **Architecture and complex code or logic** escalate to a strong expert model (e.g. Claude).
8
+ > - **Both directions**: whichever model is the main one, work goes to the right tier; delegated subagents cannot delegate further.
9
+ > - You configure the provider/model behind each route; the policy text ships with no provider or model names.
4
10
 
5
11
  ![dsh-submodel: the main model routes work to an executor route or expert routes](https://raw.githubusercontent.com/angel291592/dsh-submodel/main/assets/hero.svg)
6
12
 
7
13
  [![npm version](https://img.shields.io/npm/v/dsh-submodel.svg)](https://www.npmjs.com/package/dsh-submodel)
8
14
  [![npm downloads](https://img.shields.io/npm/dm/dsh-submodel.svg)](https://www.npmjs.com/package/dsh-submodel)
9
15
  [![license](https://img.shields.io/npm/l/dsh-submodel.svg)](https://github.com/angel291592/dsh-submodel/blob/main/LICENSE)
10
- [![DSH](https://img.shields.io/badge/DeepSeek%20Harness-%E2%89%A50.2.2-4d6bfe.svg)](https://github.com/angel291592/dsh-submodel)
11
- [![dshbase](https://img.shields.io/badge/dshbase-install--tested-2ea44f.svg)](https://github.com/ylwl1997/dshbase/issues/221)
16
+ [![DSH >=0.2.2-rc.5](https://img.shields.io/badge/DSH-0.2.2--rc.5%20or%20later-4d6bfe.svg)](https://github.com/angel291592/dsh-submodel)
12
17
 
13
18
  [中文](README.md) | **English**
14
19
 
15
- It does **not** ship its own provider system — it reads the channels and models already configured in your
16
- profile, writes a delegation policy into the system prompt, and adds one unified entry point
17
- (`delegate_task`) on top of the official `subagent`. Since 0.2.0 the mode is decided by **route** (no model
18
- naming convention required), and there is a first-run setup wizard plus `economyRoutes`. Since 0.3.0 you can
19
- optionally enable the **team formation self-check**: with Agent Teams enabled, the top-level main model declares
20
- whether to parallelise, how many teammates to start, and which model each one uses before the first real task
21
- (off by default). Requires DSH `0.2.2-rc.1` (`0.2.1` and older are not compatible).
20
+ Open **Plugins → Subagent model settings** to order the cost-effective and expert model groups and add a note about what each model is good for. The main model can choose where to start. With automatic switching enabled, eligible failures move forward from that choice. DSH manages providers, credentials, and model permissions. Version `0.4.0` requires DSH `>=0.2.2-rc.5 <0.3.0`.
22
21
 
23
22
  ## Install
24
23
 
@@ -30,20 +29,19 @@ dsh --profile <your-profile> # 2. start (restart the p
30
29
 
31
30
  ## Configuration (two steps)
32
31
 
33
- Configuration has **two layers**, and delegation only works when both are done:
32
+ Delegating to a different model requires choosing preferences and allowing that model in DSH:
34
33
 
35
34
  | Layer | What it controls | If missing |
36
35
  |---|---|---|
37
- | ① Host authorization | DSH's own "subagent model selection" setting: which routes a subagent may switch to | Delegating to a non-inherited route fails with `child LLM route "…/…" is not allowed for this Session` |
38
- | ② Plugin config | This package's `executor` (execution route) and `experts` (expert routes) | In boss mode there is no default delegation target: an `error` is logged and nothing is delegated |
36
+ | ① Host authorization | Which models new conversations may delegate to | The current conversation cannot delegate to a different, unauthorized model |
37
+ | ② Plugin preferences | The default execution model and the expert models to choose from | A strong main agent without an execution model cannot select a default for routine delegation |
39
38
 
40
39
  ### ① Host authorization (required)
41
40
 
42
41
  By default the native `subagent` only lets a child inherit the parent session's route. To let a child switch
43
42
  to an execution/expert route, authorize it in the host first:
44
43
 
45
- - **GUI**: open **subagent model selection** in Settings (config id `subagent-model-selection-settings`),
46
- turn it on, and add the execution route and expert routes to the allow-list one by one.
44
+ - **UI:** open **Subagent** settings under Plugins, turn on model selection, and allow each execution, expert, and fallback model you intend to use.
47
45
  - **Or write the profile patch YAML** (`~/.dsh/profiles/<your-profile>/cordis.patch.yml`; the file is an empty
48
46
  array `[]` by default — append the entry to that array):
49
47
 
@@ -56,42 +54,30 @@ to an execution/expert route, authorize it in the host first:
56
54
  model: your-model
57
55
  - provider: your-provider
58
56
  model: your-strong-model
57
+ - provider: your-other-provider
58
+ model: your-backup-model
59
59
  ```
60
60
 
61
61
  Note: `allowedModels` must not be empty when `enabled: true`; host authorization only applies to **new
62
62
  sessions**, so open a new session (or restart the profile) after writing it.
63
63
 
64
- ### ② Plugin configuration (pick one)
65
-
66
- **Option A (recommended): call `configure_submodel` on the first session — it writes both places**
67
-
68
- No YAML by hand. As long as you are the top-level agent, `autoConfigure` keeps its default `true`, and
69
- `executor` is not configured yet, the `configure_submodel` tool appears on the first session:
70
-
71
- 1. Call it. It asks three questions — **execution route** (where verifiable execution blocks go; single
72
- choice), **expert routes** (models you may name when escalating; multi-choice), and **whether to write the
73
- host authorization row too** (recommended: yes);
74
- 2. On confirmation it uses the official `configEditor` to write **host authorization first, then plugin
75
- config** (the plugin config's `executor`, `experts` and `economyRoutes` all reflect your choices), so both
76
- take effect together;
77
- 3. It takes effect on the next session. Writing the plugin config reloads this plugin and the tool
78
- disappears afterwards — that is expected, not an error.
64
+ ### ② Plugin configuration
79
65
 
80
- On clients without a GUI (headless / plain CLI) or when a required service is missing, no question card is
81
- shown: the tool returns copyable manual YAML instead and **writes nothing**.
66
+ **Settings page:** open **Plugins → Subagent model settings**. Add models to either group, change the order, and enter short notes such as “Prefer for code”. The first model in each group is the usual starting point; the main model can use the notes to pick another one. Allow each model separately in Subagent settings. If another page saves first, your draft is kept. Load the saved settings and review the draft before saving it. Reload the page if the connection changes.
82
67
 
83
- **Option B: five-line YAML by hand**
68
+ **First-run wizard:** call `configure_submodel` from a top-level agent with `autoConfigure` on and no execution model configured. It asks for execution and expert models first, then asks separately whether to add host authorization. The two writes are separate; the wizard reports which succeeded. Saving an execution model hides the wizard.
84
69
 
85
- In your profile patch layer (`~/.dsh/profiles/<your-profile>/cordis.patch.yml`), override this package by id.
86
- The file is an empty array `[]` by default: **replace `[]` with the entry below**; if it already has entries,
87
- append this one to the array.
70
+ **Without the settings page:** add or update the `submodel` entry in your profile patch. Keep any other fields in that entry. If the host cannot show question cards, the wizard explains how to configure preferences and authorization manually.
88
71
 
89
72
  ```yaml
90
73
  - id: submodel
91
74
  config:
92
- executor:
93
- provider: your-provider
94
- model: your-model
75
+ modelGroups:
76
+ executors:
77
+ - { provider: your-provider, model: your-model, note: Prefer for code }
78
+ - { provider: your-other-provider, model: your-backup-model }
79
+ experts:
80
+ - { provider: your-provider, model: your-strong-model, note: Architecture decisions }
95
81
  ```
96
82
 
97
83
  Note: a profile patch **replaces the whole `config` block** of an entry — fields you leave out fall back to
@@ -105,21 +91,34 @@ Full field reference:
105
91
  | `autoConfigure` | `true` | Whether to register the `configure_submodel` wizard for first-run setup (visible only for a top-level agent whose `executor` is not configured); turn it off to configure everything manually |
106
92
  | `preset` | `standard` | Only applies to that composition |
107
93
  | `teamFit.enabled` | `false` | Team formation self-check section (0.3.0+): needs the master `enabled` switch to be `true` as well, plus the official Agent Teams plugin; visible only to the top-level main model of the target preset — see below. Off by default, which is the rollback state |
108
- | `executor.provider` / `executor.model` | empty | Execution route: the default delegation target in boss mode; **leaving it empty logs an `error`** (see Troubleshooting). Switching the main model to this route also means Flash mode |
109
- | `executor.reasoningEffort` | `max` | Default effort only when the caller did not specify one |
110
- | `economyRoutes` | `[]` | Extra "cheap routes", each `{provider?, model}`: the current request matching any of them counts as Flash (`economize`) mode. Omit `provider` to match on `model` alone; **when non-empty, the legacy flash-suffix rule no longer applies** |
111
- | `experts` | `[]` | Expert routes you may name explicitly when escalating, each `{label, provider, model, reasoningEffort?}`; `reasoningEffort` is reserved for now and does not affect delegation |
94
+ | `modelGroups` | `legacy` (use previous settings) | Ordered `executors` and `experts` lists. Each entry is `{provider, model, note?, reasoningEffort?}`. Pairs may not repeat within a group. Every model can have a default reasoning effort: it applies when a delegation names no effort and when switching lands on that model; empty leaves it to the model, and an effort named in the call wins |
95
+ | `executor`, `experts` | Unset | Used only before saving the group lists. Omitting the old executor's `reasoningEffort` keeps `max`; `""` leaves it to the model |
96
+ | `economyRoutes` | `[]` | Extra cost-effective routes, each `{provider?, model}`. Omit `provider` to match on `model` alone. When non-empty, the legacy `flash` suffix rule no longer applies |
112
97
  | `texts.economize` / `texts.boss` / `texts.child` | empty | When non-empty, replaces the built-in prompt section verbatim (no interpolation afterwards) |
113
98
  | `toolName` | `list_subagent_models` | Tool name used as the capability gate for the policy section |
114
99
  | `order` | `2850` | Order of the policy section in the system prompt |
115
- | `guardNativeSubagent` | `true` | Whether to reject a non-economy-route (non-Flash mode) top-level agent that calls the native `subagent` without a complete provider/model pair |
100
+ | `guardNativeSubagent` | `true` | Requires a complete provider and model pair when a strong main agent calls the native `subagent` directly |
101
+ | `fallbacks` | `[]` | Legacy only. Entries are `{primary: {provider, model}, alternatives: [...]}`. Saving the new groups switches to their order |
102
+ | `watchdog.mode` | `off` | `off` disables monitoring, `notify` reminds the child to finish, `stop` prompts for a manual stop after the grace period, and `retry` retries eligible failures |
103
+ | `watchdog.tiers` | `[expert]` | Monitor `expert` and/or `executor` |
104
+ | `watchdog.warnTokens` | `100000` | Threshold for cumulative reported token usage (a positive integer) |
105
+ | `watchdog.graceMs` | `60000` | `1000`–`600000` milliseconds after the finish-up reminder is delivered |
106
+ | `watchdog.maxRetries` | `1` | Maximum number of automatic retries per task, `0`–`2` |
107
+
108
+ ## Usage reminders and automatic switching
109
+
110
+ **Usage reminders** are off by default. They apply to selected groups of local subagents started through `delegate_task`. Usage comes from the reported totals; a single request can go over the reminder amount. Missing and explicitly zero usage are indistinguishable in the current host, so both count as unknown. The page shows the wait in seconds. At the end of that wait, it prompts you to stop the task yourself.
111
+
112
+ **Try the next model after failure** uses the next entry in the same group only when the current model has exhausted the host's bounded retries (five after the first failure by default, and no switch if it ran fewer than five). The task needs known usage below the reminder amount, with no partial output, tool calls, manual stop, or outside follow-up. The order starts at the chosen model and moves forward without wrapping or skipping unavailable entries. The switched-to model uses its own configured default effort (unset leaves it to the model); the failed model's effort is not carried over. The next model must be allowed by both the current settings and the original conversation. It can be on a different provider, which receives the same task and may charge for it. Turning monitoring off cancels pending actions without stopping tasks the host has already accepted.
113
+
114
+ Each request needs a verifiable usage sample for automatic switching. A later report cannot fill in an earlier missing or zero sample. Existing settings keep their behavior until you save the groups. To carry forward old backup models, add them to the relevant group. If a provider/model pair is in both groups, naming it explicitly uses the expert group.
116
115
 
117
116
  ## How it decides who does what (route-based since 0.2.0)
118
117
 
119
118
  There are two modes, and the decision looks only at the **route of the current request** (`provider` +
120
119
  `model`) — no model-name suffix is required:
121
120
 
122
- 1. Current request route **== the configured `executor` route** → **Flash (`economize`) mode**;
121
+ 1. The current request matches the cost-effective group (or the old `executor` if no groups are saved) → **Flash (`economize`) mode**;
123
122
  2. The request matches any route in **`economyRoutes`** → **Flash (`economize`) mode** (for multiple cheap routes);
124
123
  3. When `economyRoutes` is empty, the legacy rule still applies: a model name ending in `flash` → **Flash
125
124
  (`economize`) mode**;
@@ -128,19 +127,17 @@ There are two modes, and the decision looks only at the **route of the current r
128
127
  Built-in behaviour:
129
128
 
130
129
  - **Flash mode**: do the work yourself by default; ordinary subtasks go through `delegate_task` (no
131
- provider/model — the child inherits the current route); escalate only when "the problem itself is complex"
132
- or "it exceeds your execution limits", naming a route from `experts`.
133
- - **Boss mode**: understanding, judgement and writing stay with the main model; verifiable execution blocks
134
- default to the configured `executor` route.
130
+ provider/model means the child inherits the current route). Escalate only for complex problems or tasks beyond your execution limits, choosing an expert by order and note.
131
+ - **Boss mode**: understanding, judgment, and writing stay with the main model. Verifiable tasks use the first cost-effective model by default. The main model can name another model based on its note.
135
132
  - **Children**: hard boundary — `delegate_task` / `subagent` / `subagent_fork` / `workflow` / `spawn_teammate`
136
133
  are unavailable to a child, preventing recursive delegation.
137
134
  - **`delegate_task`**: same parameters as the native `subagent` (`description`, `prompt`, and optional
138
135
  `provider` / `model` / `reasoning_effort`; `provider` and `model` must be supplied **together** — one alone
139
- fails immediately). It goes through `ctx.tools.execute` and raises a real native call, so the host's
140
- allowlist / preflight / permissions still apply. Since 0.2.0 the semantics are "starts an independently
141
- managed subagent and **immediately returns its id**; the runtime notifies you when it finishes": do not poll
142
- repeatedly — use `list_agents` to look at live subagents, `send_message` to append, and `interrupt_agent` to
143
- stop. Call `list_subagent_models` first if you are unsure which routes are authorized.
136
+ fails immediately). When a call names no reasoning effort, the model's configured default from the two
137
+ groups applies; unset leaves it to the model. It goes through `ctx.tools.execute` and raises a real native call, so the host's
138
+ allowlist, preflight, and permissions still apply. On success it returns the native receipt `{kind: 'activation', name}`.
139
+ Use the name to look up or message the subagent. The runtime delivers a separate completion notice.
140
+ Call `list_subagent_models` first if you are unsure which routes are authorized.
144
141
 
145
142
  Two typical calls:
146
143
 
@@ -204,45 +201,35 @@ does not affect other prompt sections.
204
201
 
205
202
  | Capability | Provided by |
206
203
  |---|---|
207
- | Status view `list_agents`, append `send_message`, stop `interrupt_agent` | Official `@deepseek-ai/dsh-tool-subagent-control` (this package does **not** register them) |
208
- | Policy text, `delegate_task`, child guard, `configure_submodel` wizard | This package |
209
- | Model selection itself (`provider` / `model` parameters of `subagent`) | Official subagent (this package only consumes it) |
204
+ | Discovery, messaging, waiting, and stopping | The host provides `list_agents`, `send_message`, `wait_agent`, and optional `interrupt_agent` |
205
+ | Routing policy, `delegate_task`, settings page, wizard, and usage monitoring | This package |
206
+ | Model authorization and task board | The host manages both. Agent Teams controls task board availability |
207
+
208
+ `list_agents` shows the subagent tree. `send_message` confirms delivery. `wait_agent` waits for inbox input or a completion notice, and a timeout lets you return to other work. The Standard preset disables `interrupt_agent` by default. Enable it using the host's configuration guide, or stop tasks in the Subagent panel. Check the task's terminal record to confirm it stopped.
210
209
 
211
210
  ## Compatibility
212
211
 
213
- | DSH version | Status |
212
+ | DSH version | Verification |
214
213
  |---|---|
215
- | `0.2.2-rc.1` | ✅ Target version: fixture + isolated-profile **real-host load verified**; GUI end-to-end is for the user to accept (**not verified**) |
216
- | `0.2.1-rc.5` and older | ❌ Incompatible: no batch `ctx.tools.execute`, and no 0.2.2 child-route semantics |
217
- | Other `0.2.x` versions | Not tested per version; `engines.dsh` declares `>=0.2.2-rc.1 <0.3.0`, so out-of-range versions are rejected by the installer |
214
+ | `0.2.2-rc.5` | An isolated Web instance started with the installed CLI verified settings, delegation, and control tools. Desktop trial and the npm-distributed CLI remain to be verified |
215
+ | `0.2.2-rc.1`–`rc.4` | Install `dsh-submodel@0.3.0` for these host versions, or upgrade DSH |
216
+ | Other versions within `>=0.2.2-rc.5 <0.3.0` | Within the declared range, pending per-version verification |
218
217
 
219
218
  ## Troubleshooting
220
219
 
221
- Fail-fast: startup warnings are logged only and never thrown; errors only surface when you call a tool.
222
-
223
- | Symptom | Level | Meaning and fix |
224
- |---|---|---|
225
- | `config.executor.provider/model 未配置,自动委派不可用…` | `error` | No default delegation target: call `configure_submodel` or add `executor` manually as in "Configuration (two steps)" |
226
- | `child LLM route "…/…" is not allowed for this Session` | error on delegation | **Host authorization missing** (or this route is not in the allow-list): open "subagent model selection", add the route (takes effect on new sessions), or re-run `configure_submodel` and accept the host-authorization write |
227
- | `configure_submodel` is not visible | — | ① `executor` is already configured (the wizard intentionally appears only once); ② `autoConfigure` is `false`; ③ the native `subagent` in this session exposes no model-selection parameters (check that model selection is enabled in the profile/preset); ④ you are not the top-level agent |
228
- | `configure_submodel` returns no question card | — | The client has no GUI (headless / plain CLI), so there is nobody to ask; the tool returns manual YAML and writes nothing — use Option B above |
229
- | `当前 profile 无 agentPresets 服务,策略不生效` | `warn` | This profile has no agentPresets service; use a profile that supports compositions |
230
- | `原生 subagent 未暴露 provider/model,delegate_task 不安装` | `warn` | The native `subagent` in this session exposes no model-selection parameters: the whole install (policy section / guard / tools) is skipped and retried automatically once the capability appears |
231
- | `本会话未启用官方 subagent 模型选择,策略段不渲染` | `info` | Enable `subagent-model-selection-settings` in Settings (host authorization applies to new sessions only); tools are still installed subject to their own gate |
220
+ | Symptom | What to do |
221
+ |---|---|
222
+ | No default execution model | Pick one in plugin details or use the first-run wizard |
223
+ | The current conversation cannot use the chosen model | Allow it in Subagent settings and start a new conversation |
224
+ | The model list fails to load | Select **Reload model list**. You can keep or remove any saved choice that is currently unavailable |
225
+ | The wizard is missing | It appears for a top-level agent in the target preset when no execution model is configured and native model selection is available |
226
+ | No settings page or question card is available | Use the profile patch under Configuration (two steps) |
232
227
 
233
228
  ## Known limitations
234
229
 
235
- - The policy text is Chinese by default; override it with `texts.*` (tool descriptions and some guard
236
- rejections stay in English).
237
- - Applies only to the composition named by `preset` (default `standard`).
238
- - No budget guard / nudging / failure re-routing (watchdog).
239
- - `configure_submodel` writes exactly two places — this package's config row and the host authorization row
240
- (`subagent-model-selection-settings`); it does not create channels or credentials and does not touch other
241
- plugins.
242
- - Model metadata has no price field, so which routes count as "cheap" is up to your configuration (the wizard
243
- only pre-fills candidates; it does not decide for you).
244
- - Non-GUI clients have no question card, so use Option B (manual YAML).
245
- - The team formation self-check is a **prompt-level constraint**: whether to parallelise and how many teammates to start is still the main model's decision, not enforced; it does not enable Agent Teams for you.
230
+ - `preset` selects where the policy applies. Live agents keep their preferences from activation. New activations read the saved preferences. The host records model authorization when a conversation is created.
231
+ - `texts.*` preserves custom guidance. Check it for calls to retired control tools when upgrading.
232
+ - Team formation guidance is a prompt. The main model decides whether and how to act on it.
246
233
 
247
234
  ## Rollback
248
235
 
@@ -250,8 +237,7 @@ Fail-fast: startup warnings are logged only and never thrown; errors only surfac
250
237
  dsh plugin --profile <your-profile> remove dsh-submodel
251
238
  ```
252
239
 
253
- Removing the plugin leaves the host authorization row in the profile patch; to revert that too, delete the
254
- `subagent-model-selection-settings` entry manually.
240
+ Disabling or removing the plugin does not revoke host authorization. Restore the previous list in Subagent settings if needed. When switching back to a previous plugin, disable the new one first, restore the backed-up entry and profile settings, then restart and open a new conversation to confirm only one delegation policy is active.
255
241
 
256
242
  To turn off only the team formation self-check while keeping everything else, set `teamFit.enabled` to `false`
257
243
  and restart the profile (no plugin removal needed).
@@ -271,15 +257,11 @@ Current verification counts (CI runs the same commands on every push / PR, see `
271
257
 
272
258
  | Check | Result |
273
259
  |---|---|
274
- | fixture | **126** assertions, `failed: 0` |
260
+ | fixture | **141** assertions, `failed: 0` |
275
261
  | Python driver | **7** test cases, `OK` |
276
262
  | Public-profile smoke | **8** assertions, `failed: 0` |
277
263
 
278
- GUI end-to-end (the `configure_submodel` card and both writes, `delegate_task` delegation, and switching the
279
- main model to the execution route to enter economize mode) must be accepted by the user in a restarted real
280
- GUI session and is **not verified yet**. For the team formation self-check, the deterministic parts (the three
281
- leading lines, identity/preset/team-state gating, off-by-default rollback) are covered by the fixture; the
282
- actual first-turn reply and teammate count in a real GUI conversation still need acceptance in a new session.
264
+ Isolated Web verification used local synthetic models. It covered save and reopen, conflicting drafts, model-list recovery, reconnects, light and dark themes, keyboard interaction, native control tools, and usage monitoring. It did not exercise a personal Desktop profile or paid models. The team-formation prompt cannot guarantee verbatim compliance by a model.
283
265
 
284
266
  ## Contributing
285
267
 
@@ -290,14 +272,29 @@ actual first-turn reply and teammate count in a real GUI conversation still need
290
272
 
291
273
  ## Releasing (maintainers)
292
274
 
275
+ ### One development and release source
276
+
277
+ Maintain features, fixes, and packaged documentation in this repository. Try candidate packages in
278
+ an isolated DSH profile. For every validated plugin update, maintainers must publish the corresponding
279
+ open-source version with a changelog entry, a Git tag, and an npm release. Use that same validated
280
+ release for day-to-day local use.
281
+
282
+ Keep provider and model choices, budget settings, and credentials in the user's own DSH profile or
283
+ credential store. Use placeholders in public examples. Before pushing, review the commits, the
284
+ `npm pack --dry-run` file list, and the contents that will ship. Keep real provider and model mappings,
285
+ local paths, profile backups, credentials, and run records out of Git and the published package.
286
+ Local material in `reference/` and private plans under `docs/plans/` stay on the maintainer's machine.
287
+ Changes to a personal profile do not require a package release.
288
+
289
+ ### Release steps
290
+
293
291
  Releases go through GitHub Actions + npm **Trusted Publishing (OIDC)**; no npm token is stored on this
294
292
  machine or in the repository:
295
293
 
296
- 1. Add a `## <version> (YYYY-MM-DD)` section at the top of `CHANGELOG.md`;
297
- 2. On `main`, run `pwsh scripts/release.ps1 <version>`: it runs the gates, bumps the `package.json`
298
- version, commits, tags and pushes, then polls npm until the new version appears;
299
- 3. The repository's `release` workflow (`.github/workflows/release.yml`) re-runs the tests after the tag
300
- push and publishes with `npm publish`; the script tries to create the GitHub Release once npm confirms.
294
+ 1. Review the version in `package.json` and its [changelog](CHANGELOG.md) entry. Run `pwsh scripts/release.ps1 <version> -FromIndex` to prepare a **local-only** candidate from staged files. The script does not bump the version, commit, or tag.
295
+ 2. Review the archive's contents, its `tarball-sha256` (the whole archive), and its `pack-content-sha256` (the files inside). Try that candidate in an isolated profile and in a Desktop trial with rollback prepared.
296
+ 3. For an approved release, use a clean `main` with the reviewed commit. Run `pwsh scripts/release.ps1 <version> -ExpectedContentSha256 <content digest> -Publish` to check the content and push only that commit and an annotated tag carrying the digest.
297
+ 4. The [release workflow](.github/workflows/release.yml) repacks the pinned commit, verifies the same content digest, and publishes the checked archive. It then downloads the exact version to verify it and updates the GitHub Release.
301
298
 
302
299
  One-time setup: configure a Trusted Publisher in the npm package settings (repository
303
300
  `angel291592/dsh-submodel`, workflow `release.yml`, allow Direct publish). After that, releasing needs no