@dsmm/dsmm 0.1.1 → 0.1.5

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.
Files changed (108) hide show
  1. package/README.md +26 -15
  2. package/agent-presets/dsmm-builder/agent.cordis.yml +14 -12
  3. package/agent-presets/dsmm-builder/preset.yml +1 -1
  4. package/agent-presets/dsmm-clarifier/agent.cordis.yml +4 -2
  5. package/agent-presets/dsmm-clarifier/preset.yml +1 -1
  6. package/agent-presets/dsmm-code-search/agent.cordis.yml +4 -2
  7. package/agent-presets/dsmm-code-search/preset.yml +1 -1
  8. package/agent-presets/dsmm-creative/agent.cordis.yml +3 -1
  9. package/agent-presets/dsmm-creative/preset.yml +1 -1
  10. package/agent-presets/dsmm-doc-search/agent.cordis.yml +4 -2
  11. package/agent-presets/dsmm-doc-search/preset.yml +1 -1
  12. package/agent-presets/dsmm-media-reader/agent.cordis.yml +4 -2
  13. package/agent-presets/dsmm-media-reader/preset.yml +1 -1
  14. package/agent-presets/dsmm-oracle/agent.cordis.yml +3 -1
  15. package/agent-presets/dsmm-oracle/preset.yml +1 -1
  16. package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +3 -1
  17. package/agent-presets/dsmm-oracle-2nd/preset.yml +1 -1
  18. package/agent-presets/dsmm-orchestrator/agent.cordis.yml +15 -13
  19. package/agent-presets/dsmm-orchestrator/preset.yml +2 -2
  20. package/agent-presets/dsmm-plan-critic/agent.cordis.yml +4 -2
  21. package/agent-presets/dsmm-plan-critic/preset.yml +1 -1
  22. package/agent-presets/dsmm-planner/agent.cordis.yml +4 -2
  23. package/agent-presets/dsmm-planner/preset.yml +1 -1
  24. package/agent-presets/dsmm-reviewer/agent.cordis.yml +4 -2
  25. package/agent-presets/dsmm-reviewer/preset.yml +1 -1
  26. package/docs/agent-presets.md +15 -5
  27. package/docs/compatibility.md +66 -11
  28. package/docs/migration-from-ocmm.md +8 -0
  29. package/docs/model-routing.md +25 -7
  30. package/docs/profiles.md +95 -0
  31. package/docs/releasing.md +66 -19
  32. package/docs/runtime-recovery.md +39 -14
  33. package/docs/settings-status.md +13 -5
  34. package/lib/client/ProfilesSection.d.ts +11 -0
  35. package/lib/client/ProfilesSection.js +66 -0
  36. package/lib/client/SessionProfiles.d.ts +19 -0
  37. package/lib/client/SessionProfiles.js +24 -0
  38. package/lib/client/StructuredEditor.d.ts +11 -0
  39. package/lib/client/StructuredEditor.js +74 -0
  40. package/lib/client/controller.d.ts +115 -0
  41. package/lib/client/controller.js +340 -0
  42. package/lib/client/index.d.ts +13 -0
  43. package/lib/client/index.js +54 -0
  44. package/lib/client/locales.d.ts +145 -0
  45. package/lib/client/locales.js +91 -0
  46. package/lib/client/session-labels.d.ts +8 -0
  47. package/lib/client/session-labels.js +13 -0
  48. package/lib/client/structured.d.ts +18 -0
  49. package/lib/client/structured.js +98 -0
  50. package/lib/client/styles.d.ts +3 -0
  51. package/lib/client/styles.js +36 -0
  52. package/lib/client.js +2825 -0
  53. package/lib/commands.d.ts +3 -3
  54. package/lib/commands.js +5 -4
  55. package/lib/dsh-types.d.ts +20 -0
  56. package/lib/guards.d.ts +2 -2
  57. package/lib/guards.js +3 -2
  58. package/lib/index.d.ts +12 -4
  59. package/lib/index.js +98 -20
  60. package/lib/mode.d.ts +2 -2
  61. package/lib/mode.js +1 -1
  62. package/lib/model-routing.d.ts +2 -2
  63. package/lib/model-routing.js +100 -15
  64. package/lib/preset-registry.js +5 -3
  65. package/lib/profile-remote.d.ts +37 -0
  66. package/lib/profile-remote.js +219 -0
  67. package/lib/profile-rpc.d.ts +35 -0
  68. package/lib/profile-rpc.js +187 -0
  69. package/lib/profile-runtime.d.ts +63 -0
  70. package/lib/profile-runtime.js +310 -0
  71. package/lib/profile-store.d.ts +60 -0
  72. package/lib/profile-store.js +588 -0
  73. package/lib/profile-types.d.ts +80 -0
  74. package/lib/profile-types.js +2 -0
  75. package/lib/profiles.d.ts +26 -0
  76. package/lib/profiles.js +269 -0
  77. package/lib/prompts.d.ts +2 -2
  78. package/lib/prompts.js +4 -4
  79. package/lib/role-providers.d.ts +2 -2
  80. package/lib/role-providers.js +49 -6
  81. package/lib/role-routing.d.ts +37 -3
  82. package/lib/role-routing.js +110 -35
  83. package/lib/role-subagents.d.ts +2 -2
  84. package/lib/role-subagents.js +6 -4
  85. package/lib/roles.d.ts +4 -0
  86. package/lib/roles.js +43 -27
  87. package/lib/routing-policy.d.ts +32 -0
  88. package/lib/routing-policy.js +92 -0
  89. package/lib/runtime-recovery.d.ts +2 -2
  90. package/lib/runtime-recovery.js +215 -54
  91. package/lib/session-metadata.d.ts +13 -0
  92. package/lib/session-metadata.js +34 -0
  93. package/lib/session-persistence.d.ts +35 -0
  94. package/lib/session-persistence.js +304 -0
  95. package/lib/settings.d.ts +34 -1
  96. package/lib/settings.js +33 -7
  97. package/lib/state.d.ts +1 -0
  98. package/lib/state.js +4 -0
  99. package/lib/status.d.ts +9 -1
  100. package/lib/status.js +34 -12
  101. package/locale/en.json +6 -0
  102. package/locale/zh.json +6 -0
  103. package/package.json +66 -15
  104. package/patches/agent-presets-root.example.cordis.patch.yml +6 -10
  105. package/prompts/deepseek-v4-pro.md +1 -1
  106. package/prompts/deepwork.md +3 -3
  107. package/scripts/repair-session-log.mjs +476 -0
  108. package/scripts/session-repair-native-verifier.mjs +367 -0
@@ -1,19 +1,29 @@
1
- # DSMM roles on DSH 0.2
1
+ # Deepwork roles on DSH 0.2
2
2
 
3
3
  DSMM defines twelve unsuffixed normal roles: orchestrator, planner, plan-critic, builder, reviewer, oracle, oracle-2nd, creative, code-search, doc-search, clarifier and media-reader (each prefixed `dsmm-`). A role name is a persona and tool policy, not a model-selection claim. Reviewer is primary-model self-review; an Oracle is an external-model cross-check only when the caller explicitly selects a distinct model offered by the current DSH catalog. The second slot is priority order, not greater capability.
4
4
 
5
+ The DW display names introduced in the 0.1.3 source contract are `DW Orchestrator`, `DW Planner`, `DW Plan Critic`, `DW Builder`, `DW Reviewer`, `DW Oracle`, `DW Oracle 2nd`, `DW Creative`, `DW Code Search`, `DW Doc Search`, `DW Clarifier`, and `DW Media Reader`. Their native preset IDs, callable tool/provider identities and permissions are unchanged. Persona introductions use the DW role label while retaining the exact `dsmm-*` technical role ID; no display label is a callable-ID rename.
6
+
5
7
  ## Runtime surfaces
6
8
 
7
- DSH 0.2's `agentPresets.register({ id, plugins })` is the native preset registry. When the host composes `agentPresets` (such as the Web profile), DSMM registers enabled roles as complete plugin compositions: persona, instructions, filesystem/search/web tools, seven bundled workflow skills, on-demand debugging, and role-specific subagent tools where appropriate. Directly selected read-only roles receive an Agent-scoped native `tools.restrict({ deny: ['write', 'edit'] })`; shell tools are not composed into those presets. The orchestrator and builder include native `@deepseek-ai/dsh-tool-subagent` instances whose `persona` and `toolFilter` actually shape each child. Read-only child filters allow repository reads/search, with web tools for doc/media roles; media image reading is available only when that tool exists in the host catalog. The provider must support persona, tool filtering and the host's depth/permission limits.
9
+ The 0.1.4 source contract distinguishes root eligibility from delegation enablement. Only enabled roles whose mode is `primary` or `all` are registered as native root presets: `dsmm-orchestrator`, `dsmm-builder`, and `dsmm-planner`, displayed as DW Orchestrator, DW Builder and DW Planner. If Builder is disabled in deployment configuration, only Orchestrator and Planner enter the root selector, and Builder has no child tool. Planner remains read-only; read-only access does not imply auxiliary-only status.
10
+
11
+ The nine auxiliary-only roles are `dsmm-plan-critic`, `dsmm-reviewer`, `dsmm-oracle`, `dsmm-oracle-2nd`, `dsmm-creative`, `dsmm-code-search`, `dsmm-doc-search`, `dsmm-clarifier`, and `dsmm-media-reader`. Enabled auxiliary roles remain native delegation tools; they are not broken or missing roots. Runtime profile selection never changes either inventory.
12
+
13
+ DSH 0.2's `agentPresets.register({ id, plugins })` is the native preset registry. When the host composes `agentPresets` (such as Web/Desktop), DSMM registers eligible roots as complete plugin compositions: persona, instructions, filesystem/search/web tools, seven bundled workflow skills, on-demand debugging, and role-specific subagent tools where appropriate. The native loading correction uses `persona.prefix` and `agent-instructions.maxBytes: 65536`; a directory or manifest alone cannot prove that the host successfully mounts the composition. Read-only compositions receive Agent-scoped native `tools.restrict({ deny: ['write', 'edit'] })`; shell tools are not composed into them. Orchestrator and Builder include native `@deepseek-ai/dsh-tool-subagent` instances whose `persona` and `toolFilter` actually shape each child. Read-only child filters allow repository reads/search, with web tools for doc/media roles; media image reading is available only when that tool exists in the host catalog. The provider must support persona, tool filtering and the host's depth/permission limits.
8
14
 
9
15
  The DSH headless one-shot runner does **not** mount or select agent presets. When its startup bundle includes `@deepseek-ai/dsh-headless`, DSMM instead mounts the same role-specific subagent instances on each root Agent's tool plane. The tools remain schema-stable for DeepSeek Flash's addition-only tool catalog, but DSMM's monotonic guard rejects owned role-tool calls unless deepwork is active or a DSMM role preset is selected. Without configured role routing, native model inheritance and the DSMM opt-in boundary are unchanged.
10
16
 
11
- Since 0.1.1, `roleRouting` can supply fixed child `agentOptions` and direct-role request policy without dynamic model selection. Native spawn aliases retain trusted role identity in the child's durable descriptor, so two children inheriting the same parent preset can still have different routes and fallback chains. A missing or unknown child identity is not guessed from persona text. DSH's standing `modelSelectionSettings` would re-register subagent tools in each child's own scope, bypassing its inherited-tool filter; DSMM therefore keeps it false. Changing a model never enables extra tools. DSH controls approval, sandbox, cancellation and child depth; DSMM never bypasses those controls.
17
+ `roleRouting` supplies role policies without adding dynamic model-selection permission. The aliased native provider derives defaults from its parent's admitted runtime snapshot, merges supported explicit native child options, and preflights the result through the parent's native `llm.resolveCallConfig` before native spawn; profile routes are not baked into standing preset/tool rows. For a trusted live, owned, zero-prefix one-shot child, the accepted explicit provider/model/effort survives through final request headers. Root, cold/unowned child and parent-seeded fork requests retain profile-primary resolution. Native spawn aliases retain trusted role identity in the child's durable descriptor, so two children inheriting the same parent preset can still have different routes and fallback chains. A missing or unknown child identity is not guessed from persona text, and a durable descriptor alone does not prove live ownership. DSH's standing `modelSelectionSettings` would re-register subagent tools in each child's own scope, bypassing its inherited-tool filter; DSMM therefore keeps it false. Changing a model never enables extra tools. DSH controls approval, sandbox, cancellation and child depth; DSMM never bypasses those controls. See [model routing](model-routing.md).
12
18
 
13
- Only enabled role IDs are registered, materialized and exposed as child tools. The canonical role has no suffix. DSH-specific high/low/max model tiers require an explicit profile composition or subagent model choice: no suffix presets are generated by default, and any separately declared tier must preserve the canonical role persona, readonly filter and other constraints. A profile declaration is not proof of a callable tool: inspect the running tool schema or preset registry diagnostic.
19
+ Only enabled root-eligible IDs are registered in the root selector. All enabled role IDs remain eligible for DSMM-owned materialized exports and role-specific child tools where the parent permits delegation. The canonical role has no suffix; no high/low/max suffix presets are generated by default. A separately authored native composition must preserve its canonical persona and restrictions, and is not a DSMM runtime file profile. Inspect the running tool schema or preset registry diagnostic rather than treating a file as callable proof.
14
20
 
15
21
  ## Optional static mirror
16
22
 
17
- `agent-presets/` is a renderer-checked static snapshot for inspection or profile authors, **not** a directory scanned by the DSH 0.2 registry. `presets.materialize` defaults to false. If enabled, `presets.root` writes only DSMM-owned enabled role directories; adding that path to an obsolete `agent-presets.roots` config does not enable native discovery. In the source repository, regenerate snapshots with `node dsmm/scripts/generate-role-assets.mjs` after the TypeScript build; the development generator is not included in the published package.
23
+ `agent-presets/` keeps twelve renderer-checked static role directories for inspection or native composition authors, **not** a directory scanned by the DSH 0.2 registry. Auxiliary templates do not become roots. The example deployment patch enables DSMM defaults only; it is not a scan-root declaration. `presets.materialize` defaults to false. If enabled, `presets.root` writes only DSMM-owned enabled role directories; adding that path to an obsolete `agent-presets.roots` config does not enable native discovery. In the source repository, regenerate snapshots with `node dsmm/scripts/generate-role-assets.mjs` after the TypeScript build; the development generator is not included in the published package.
18
24
 
19
25
  Materialization keeps the role-bound `.dsmm-managed-preset` marker. Foreign, mismatched, malformed or linked directories/files are never claimed. A current marker with unexpected entries fails closed; only an exact legacy `managed by dsmm` directory with the three expected regular files is updated. Disabling an enabled role removes only its owned directory. No role becomes the host default by installing DSMM.
26
+
27
+ ## Upgrade and evidence boundary
28
+
29
+ Older sessions selected directly into a now-auxiliary preset retain their history, but native cold resume may reject the removed root preset ID as unknown. This limitation must be disclosed before global rollout; DSMM must not silently substitute another persona or erase session history. See [compatibility](compatibility.md) for the upgrade procedure. Healthy Docker root audits, actual blank-session role selection with DW display names and read-only child denials are required for 0.1.4 acceptance; actual Desktop selector verification is a separate post-publication check.
@@ -1,4 +1,10 @@
1
- # DSMM 0.1.1 Compatibility
1
+ # Deepwork 0.1.5 Compatibility and Upgrade
2
+
3
+ This document describes the 0.1.5 source contract and required acceptance evidence. It does not claim that the final 0.1.5 artifact has passed Docker, been published, or been activated in Desktop. Historical 0.1.1 checks and the stopped 0.1.2 frozen draft are not substitute evidence for this update; the old 0.1.2 tag/artifact/draft stay untouched and unpublished.
4
+
5
+ The immutable 0.1.3 tag at `2bdea4b` is also preserved. Its run `37235817488` failed before pack/publish on pnpm 11's ignored esbuild/koffi build scripts. 0.1.4's published-origin bytes and failed original verify/404 history are preserved by their separate fixed continuation controls, not rewritten by 0.1.5. The 0.1.5 gate requires fresh clean Linux installation/build evidence; existing compiled output is not a substitute.
6
+
7
+ Deepwork is the native plugin title in both exported metadata locales, with localized descriptions. Profiles are displayed as **Deepwork Profiles** / **Deepwork 配置档**, and twelve roles as `DW …`. Package `@dsmm/dsmm`, Loader `dsmm`, role/tool/provider IDs, commands, schemas and persistence vocabulary remain compatible. Native metadata-reader and actual UI evidence must prove the display names; a manifest `displayName` is not a supported substitute.
2
8
 
3
9
  ## Compatibility authority
4
10
 
@@ -12,38 +18,87 @@ The installation contracts include `@deepseek-ai/cordis@~4.0.4`, `@deepseek-ai/s
12
18
 
13
19
  | Surface | Fixed version or boundary | Evidence level |
14
20
  | --- | --- | --- |
15
- | Node.js | `>=22` | verified |
16
- | DSH | `0.2.0-rc.2` | verified |
21
+ | Node.js | `>=22` | required; final artifact check pending |
22
+ | DSH | `0.2.0-rc.2` | pinned authority; final native acceptance required |
17
23
  | Cordis | `~4.0.4` | supported by contract |
18
24
  | DSH component peers | `0.2.0-rc.2` | supported by contract |
19
- | Linux container | `Node 22 Bookworm` | verified |
20
- | Windows | `Node >=22` | verified |
25
+ | Linux container | `Node 22 Bookworm` | independent frozen-artifact gate required |
26
+ | Windows Desktop | installed official `0.2.0-rc.2` carrier/host | post-publication native check required |
21
27
  | macOS | `Node >=22` | supported by contract |
22
- | Web | `host command/status` | supported by contract |
23
- | Headless | `profile config and --dump-config` | verified |
28
+ | Native Settings | additive Deepwork Profiles client and authenticated RPC | compiled UI/RPC/storage and actual Desktop are separate proofs |
29
+ | Headless | deployment config and native role tools | no Agent preset selection in the one-shot runner |
24
30
  | TUI | `DSH 0.2.0-rc.2` | unavailable |
25
31
  | LSP/MCP | `external ocmm-lsp mcp` | optional |
26
32
  | Runtime recovery | `process-local` | optional |
27
33
  | Per-role model/effort/fallback policy | native request, subagent and descriptor seams | opt-in; exact configured capability required |
34
+ | Runtime profiles | independent drafts, immutable revisions, global pointer and scoped CAS sidecars | global new-Agent defaults; explicit idle session epochs; cold sidecar retention |
35
+ | Durable DSMM metadata | deployment-only `sessionPersistence` on main DSMM entry | explicit startup integration; frozen-artifact/production acceptance pending |
28
36
  | DeepSeek V4 Pro calibration | `deepseek-official/deepseek-v4-pro` | optional |
29
37
  | DeepSeek V41 Flash calibration | `native DeepSeek providers/deepseek-flash` | optional |
30
38
 
31
39
  ## Command and runtime boundaries
32
40
 
33
- `/deepwork` and `/dsmm-status` are host-adapter commands, not headless task-text commands. Web exposes host command/status but has no custom panel.
41
+ `/deepwork` and `/dsmm-status` are host-adapter commands, not headless task-text commands. The current native client provides Settings → Deepwork Profiles without replacing native navigation, provider/account UI, or the Agent preset selector. There are no model-visible profile-management tools or anonymous file endpoints.
34
42
 
35
43
  Headless uses profile `cordis.patch.yml` plus `--dump-config`; real task execution requires a separately configured provider and uses `dsmm.defaultActive: true`. Old `$DSH_HOME/settings.yaml` namespaces must be migrated explicitly; DSMM does not mutate that file.
36
44
 
37
- The old directory discovery `roots/includeUserRoot` no longer configures the native preset registry. DSMM uses native preset definitions in preset-capable hosts and role-specific subagent tool composition; ordinary native subagents otherwise inherit the parent preset. DSH's headless one-shot runner does not select or compose agent presets: headless role delegation must use native role tools, not a registry default. The original managed preset directory materializer remains an opt-in export facility, not discovery evidence.
45
+ The old directory discovery `roots/includeUserRoot` no longer configures the native preset registry. DSMM registers only enabled `primary`/`all` roots: Orchestrator, Builder and Planner. Disabled Builder is absent from both selector and child tools. The other nine roles remain auxiliary delegation roles; all twelve static `agent-presets/` directories are inspection templates, not scan roots. The loading correction is native `persona.prefix` plus instructions `maxBytes: 65536`.
46
+
47
+ DSH's headless one-shot runner does not select or compose Agent presets: headless role delegation must use native role tools, not a registry default. Native preset selection must be tested through a preset-capable host with a blank session. The managed preset-directory materializer remains an opt-in export facility, not discovery evidence.
48
+
49
+ Trusted live, owned, zero-prefix native one-shot children preserve supported explicit provider/model/effort overrides through final request headers. The role primary supplies alias defaults; it is not an unconditional child override. Roots, cold/unowned children and parent-seeded forks retain profile-primary resolution. `modelSelectionSettings:false` and native tool/permission/depth/cancellation limits are unchanged; this adds no model-visible model-selection authority. See [model routing](model-routing.md).
50
+
51
+ ## Session persistence compatibility
52
+
53
+ DSH 0.2.0-rc.2's native `Session.append` cannot attach the `ignorable` envelope marker required for stock readers to skip unknown custom event types. DSMM's source update provides a public persistence Service companion that delegates to the native JSONL provider in a separate Context instead of patching the vendor reader or redefining its known event vocabulary. The `@dsmm/dsmm/session-persistence` export is a **library building block**, not a separate Loader package entry alongside the main client-bearing package. Multiple active Loader sources from this package can conflict in native client registration.
54
+
55
+ The companion validates and clones only `deepwork/mode` and `dsmm/role-policy` records with their exact supported envelope/payload shapes, adding `ignorable: true` for persistence. Other event types are unchanged; malformed DSMM metadata is rejected rather than broadly declared safe. DSMM-aware readers retain the metadata while stock readers can skip these two marked records. The main metadata guard refuses a DSMM custom append when an installed durable persistence provider is incompatible; an ephemeral Host with no persistence is allowed.
56
+
57
+ The approved source integration uses only the main `@dsmm/dsmm` Loader entry with deployment-only `config.sessionPersistence`. Its `root` must be the unchanged **effective absolute root** of the existing native JSONL provider; its `compression` preserves the effective `zstd` or `none` choice. DSMM mounts the class internally and waits for readiness before runtime hooks. Installation/default bundles remain unchanged until an operator explicitly opts in; no custom root is guessed or silently migrated. Disable the exact existing provider at startup first. If a persistence service is already active, DSMM refuses hot replacement.
58
+
59
+ For the proven stock base Web/headless/Desktop bundle row, the exact target is ID `session-persistence-jsonl` with name `@deepseek-ai/dsh-session-persistence-jsonl`. This is a **conceptual partial patch**, not a ready-to-copy replacement: substitute the actual effective root/compression and include every existing DSMM config value under `config` before use.
60
+
61
+ ```yaml
62
+ - id: session-persistence-jsonl
63
+ name: '@deepseek-ai/dsh-session-persistence-jsonl'
64
+ disabled: true
65
+ - id: dsmm
66
+ name: '@dsmm/dsmm'
67
+ config:
68
+ # Retain ALL existing DSMM config values here.
69
+ sessionPersistence:
70
+ root: '<unchanged-effective-absolute-root>'
71
+ compression: '<unchanged-effective-zstd-or-none>'
72
+ ```
73
+
74
+ Native `name` is a target identity assertion, **not a rename**. Native patch `config` replaces the whole config object; adding only the field above would erase prior DSMM settings. Keep one active main DSMM entry, preserve unrelated Loader rows and do not add a second `./session-persistence` entry. Minimal SDK compositions may use another persistence row ID such as `sessions`, or no provider; those variants are not automatically covered by the stock patch and require exact native composition verification.
75
+
76
+ This startup contract is not a completed final Docker or global-release result. The frozen-artifact gate must still prove the binding, marked durable writes and native/stock read behavior before authorized rollout. Do not weaken the known-vocabulary guard or treat an export resolving as proof that the service owns durable persistence.
77
+
78
+ This prevents future unsafe DSMM writes but does not repair existing unmarked logs. Any repair needs explicit authorization, a targeted recoverable backup, validation and metadata-only changes. There is no automatic log rewriting, history deletion or general unknown-event bypass. Preserve existing logs and report a failed stock-reader restore instead of silently resetting the session.
79
+
80
+ ## Upgrade limits before global rollout
81
+
82
+ DSMM runtime profiles are independent JSONC drafts beneath the native `profileContext.dir`, not additional DSH deployment profiles. Deployment roles/skills/preset composition/LSP/provider/account/install and `sessionPersistence` settings remain restart-scoped and cannot be changed by a runtime profile. Supported runtime values can be saved into a draft explicitly; save alone never activates it or rewrites deployment configuration. Apply pins immutable bytes and updates only the minimal selection pointer. See [profiles](profiles.md).
83
+
84
+ Every existing live Agent, **including a blank Agent**, retains its admitted settings when the global default is applied/reset. Explicit current-session selection is separate: native idle maintenance and CAS/epoch checks commit only that ordinary root's sidecar before publishing its immutable admission. Existing children keep their old epoch; later genuinely owned children inherit the new one. Sidecar cold resume retains the exact pinned revision/baseline even after draft/global changes. Sessions without a sidecar keep the old global-current behavior. Corrupt/unavailable sidecars never silently fall back; native clear/compact does not transfer choices by inferred lineage.
85
+
86
+ Old profile documents remain loadable, but omitted strategy now means safer `startup-lock`: a legacy generic chain no longer causes later generic automatic hopping. `runtimeRecovery.enabled` remains parse-compatible and controls legacy continuation concerns, not the two role strategies. Explicitly opt in per role to bounded `rate-limit-fallback` where desired. Every DSMM retry, including same-route retry, requires correlated native no-output evidence; partial text, reasoning or tool fragments refuse terminally without invoking a competing always-retry owner. See [runtime recovery](runtime-recovery.md).
87
+
88
+ Older sessions directly selected into now-auxiliary roles can fail native cold resume because their root preset ID is no longer registered. This is a known native compatibility limitation, not permission to silently replace the persona, reset a session, or erase its history. Disclose it before rollout and preserve historical data; if restoring such sessions is required, stop and obtain direction rather than substituting a root. Package rollback does not authorize history or credential changes.
89
+
90
+ Global/system Desktop migration is the **third phase**: independent frozen-artifact Docker acceptance first, verified immutable npm/GitHub publication second, and only then authorized Desktop package/configuration changes. Preserve unrelated deployment rows, account/provider catalog, role policies (including disabled Builder), active mode, and UI preferences. Use the installation-owned carrier with the app fully quit; neither standalone CLI nor a renamed/copied Desktop profile is a supported substitute.
38
91
 
39
92
  ## Evidence limits
40
93
 
41
94
  The Linux packed-lifecycle smoke pins pnpm `12.8.1` and retains DSH's native `nodeLinker: hoisted` profile layout. On Linux Node 22, pnpm `11.9.0` with that layout and DSMM's auto-installed peer graph can print `Done` after removal without exiting; the same failure was reproduced directly without DSH, while `12.8.1` returned normally. A printed `Done` is not uninstall completion. This does not claim the same failure on Windows or modify a user's existing package manager or profile. The smoke enforces a bounded fail-closed timeout and checks actual remove/reinstall exits and profile state.
42
95
 
43
- The matrix separates observed CLI/configuration and source-contract evidence from packed runtime and credentialed model evidence. See the dated migration/test report for actual completed checks; a version string or a successful unit test alone does not establish an end-to-end model result. Windows, Linux, Web, and macOS evidence are not interchangeable.
96
+ The matrix separates required 0.1.5 evidence from historical CLI/configuration, source-contract and credentialed model evidence. A version string or unit test alone establishes neither native preset health nor UI/runtime behavior. Windows, Linux, Web, and macOS evidence are not interchangeable.
97
+
98
+ The independent Docker gate installs the exact frozen tarball into a fresh pinned native runtime/home and verifies root selection, actual read-only child denials, aliased-parent route preflight, runtime snapshot behavior, and the **same compiled DSMM UI** using native client/slots/RPC and real profile storage. A supported composition-owned in-process operator/Gateway carrier and test-owned browser bridge provide no-credential native component/RPC/storage proof. No user login, copied cookie, launcher token, browser state, Desktop data, account records or authentication bypass is permitted. This proof is not authenticated Desktop/Web-launch proof; actual Desktop mounting and authorized operations remain the later check.
44
99
 
45
100
  LSP/MCP and runtime recovery are disabled by default. V4 Pro calibration remains limited to the exact `deepseek-official/deepseek-v4-pro` route. V41 Flash calibration recognizes only `deepseek-official/deepseek-flash` and `deepseek-account/deepseek-flash`, whose native DSH catalog label is `DeepSeek-V41-Flash`; similarly named third-party models do not match.
46
101
 
47
- A credentialed smoke must prove the actual selected request route, DSMM prompt, successful tools, and subsequent model response without substituting another model. Account and API-key authentication are distinct; an AAPI key is not assumed valid for the official endpoint. No publication, browser/UI, untested OS, or future-release claim follows from these checks.
102
+ A separately authorized credentialed smoke must prove the actual selected request route, DSMM prompt, successful tools, and subsequent model response without substituting another model. Account and API-key authentication are distinct; an AAPI key is not assumed valid for the official endpoint. Paid chat cannot replace the no-credential Docker/UI gate, and no publication, browser/UI, untested OS, or future-release claim follows from it.
48
103
 
49
104
  Desktop package management uses the installation-owned `dsh.cmd` only while the app is fully quit. Even that carrier cannot boot or dump the reserved Desktop profile. Installation/manifest checks and isolated native model tests do not prove actual Electron-host activation: use an authorized native inventory or the desktop UI, never an anonymous RPC workaround.
@@ -52,3 +52,11 @@ The inspected pi-ai adapter exposes stable transient codes but no stable HTTP st
52
52
  Keep the existing OpenCode configuration until the DSH profile has independently passed its required evidence. Headless configuration uses profile files and `--dump-config`; command-capable hosts execute `/deepwork` and `/dsmm-status` through the command adapter, not by sending those strings as model tasks.
53
53
 
54
54
  DSH owns subagent depth and permission ceilings. DSMM does not raise the native default depth or use workflow instructions to bypass plan mode, user approval, read-only roles, or provider authentication.
55
+
56
+ ## Successor 0.1.5 migration note
57
+
58
+ The mapping above is the historical 0.1.1 contract. For 0.1.5, use [runtime profiles](profiles.md), [model routing](model-routing.md) and [runtime recovery](runtime-recovery.md) as the current source contract, not as evidence of completed publication or Desktop activation. Global apply changes future unscoped Agents; an explicit idle current-session apply commits only that root's sidecar and admission epoch. Existing children keep their snapshots, later owned children inherit the new epoch, and cold resume uses an explicit immutable sidecar or, when absent, the current global default.
59
+
60
+ An omitted strategy now means `startup-lock`: primary or first native-resolvable candidate is admitted once and retained across turns. Opt into `rate-limit-fallback` per role/profile to enable threshold-ordered rate-limit switching within finite retry/delay/switch bounds. Legacy `runtimeRecovery.enabled` does not select or disable these strategies. Every automatic retry requires positively correlated no-output evidence; partial text, reasoning or tool fragments forbid retry. Older generic fallback behavior is not silently carried forward. Preserve deployment/provider/account/authentication and native history; migration does not rewrite old logs or immutable release identities.
61
+
62
+ The native user's explicit provider/model/exact effort remains authoritative over a profile's default, including effort-only changes, later turns and cold resume. Applying a profile does not silently erase that choice; configured children retain their own role-route authority. A native selection made after assembly starts applies to a later assembly, while a fresh same-value choice invalidates stale retry reservations. Profile form controls do not call native `session/selectModel` or change the native global model default.
@@ -1,8 +1,8 @@
1
1
  # Model routing
2
2
 
3
- ## Explicit role policies (0.1.1)
3
+ ## Explicit role policies
4
4
 
5
- `roleRouting` is a restart-scoped map keyed by canonical DSMM role ID. It defaults to `{}`; role names alone do not select a model. Provider authentication and route declarations remain native DSH configuration.
5
+ `roleRouting` is a map keyed by canonical DSMM role ID. It defaults to `{}`; role names alone do not select a model. It can be supplied by deployment configuration or a selected [runtime profile](profiles.md). The 0.1.5 contract adds independent per-role strategy and finite retry policy without embedding native account configuration. Provider authentication and the provider/model catalog remain native DSH deployment configuration, never profile-file contents. The following is a deployment baseline example:
6
6
 
7
7
  ```yaml
8
8
  - id: dsmm
@@ -12,6 +12,7 @@
12
12
  dsmm-builder: false
13
13
  roleRouting:
14
14
  dsmm-orchestrator:
15
+ strategy: startup-lock
15
16
  primary:
16
17
  provider: my-provider
17
18
  model: primary-model
@@ -21,6 +22,11 @@
21
22
  model: backup-model
22
23
  reasoningEffort: high
23
24
  dsmm-reviewer:
25
+ strategy: rate-limit-fallback
26
+ rateLimit:
27
+ maxRetries: 3
28
+ switchAfterRateLimits: 3
29
+ maxSwitches: 2
24
30
  primary:
25
31
  provider: my-provider
26
32
  model: review-model
@@ -33,15 +39,27 @@
33
39
  enabled: false
34
40
  ```
35
41
 
36
- A `primary` is an explicit fixed role policy, not merely a model-menu default. It applies to a directly selected role, a trusted role-tool child, and an active top-level deepwork session as orchestrator when no DSMM preset is selected. Remove or change the policy to use a different native session route. Unconfigured/disabled roles, unrecognized children, and out-of-scope sessions do not acquire another role's policy. Disabled-role configuration may be retained but does not create a callable role.
42
+ A `primary` supplies the default role route for directly selected roots and active top-level deepwork sessions as orchestrator when no DSMM preset is selected. An explicit public native model selection is higher priority: the user's exact provider/model/effort wins, including an effort-only change, subsequent turns and cold resume. Ordinary profile apply changes defaults, strategy and admission epoch without silently erasing that native choice. DSMM captures the typed native intent at prompt-assembly start; a concurrent later choice belongs to the next assembly, not the already assembled frame. A fresh same-value selection still fences an older retry reservation.
37
43
 
38
- Each route requires a nonempty provider and model together. An optional named `reasoningEffort` is a native adapter ID, not an OpenCode variant translation. The exact configured effort must be supported; unsupported `max` fails rather than being substituted with `high`. A changed route without effort clears incompatible inherited effort and lets the native adapter resolve its default. Existing DeepSeek calibration cannot override an explicit role effort.
44
+ For a trusted native one-shot role alias, `primary` is also a default rather than an unconditional overwrite of explicit native child options. That live-child exception requires genuine native parent ownership and zero inherited event prefix. Root, cold/unowned child and parent-seeded fork requests cannot claim that exception. A parent's manual native choice does not replace a configured child's own role primary; genuine child-local authority remains distinct. Unconfigured/disabled roles, unrecognized children, and out-of-scope sessions do not acquire another role's policy. Disabled-role configuration may be retained but does not create a callable role. Auxiliary role policies apply through delegation, not additional root presets.
39
45
 
40
- Fixed native child options keep `modelSelectionSettings:false`. DSMM-owned aliases of the native spawn provider preserve native persona/tool filters, depth, permissions, cancellation, and one-shot lifecycle. Child identity comes from its own durable native subagent descriptor, not a parent preset, persona text, or a model-visible role label. Descriptor identity can be reconstructed after reload; it does not make terminal one-shot children resumable.
46
+ Settings resolve from built-in defaults, then deployment configuration, then the admitted immutable runtime revision. Global profile apply affects newly created unscoped Agents only; explicit idle current-session apply creates a new epoch for that root and later children. Existing children retain their previous snapshot. Cold resume uses a committed session sidecar when present, otherwise the current global default. Changing a draft alone changes none of these policies; see [profiles](profiles.md). Explicit empty fallback lists remain empty instead of inheriting an omitted global chain.
41
47
 
42
- Primary selection does not reset an admitted fallback or a host-owned durable route change. Final native request headers are authoritative, not an intermediate middleware snapshot. See [runtime recovery](runtime-recovery.md) for role/global chain precedence and retry fences.
48
+ At Agent entry, native preparation chooses the primary or first resolvable configured candidate in order. This does not make a sacrificial request or claim account/network health. Missing catalog rows do not make a custom route unavailable; malformed/unsupported exact efforts remain hard errors. Apply may retain dormant unavailable alternatives when another candidate is admissible. No admissible candidate means a visible no-request refusal, never a silent native baseline.
43
49
 
44
- DSMM records a model-hidden `dsmm/role-policy` metadata epoch for explicit routing. Unchanged policies retain accepted routes across turns and reloads; changing the primary effort or fallback policy invalidates the old selection and applies the new primary. Child epochs are read only from child-owned history, never an inherited ancestor. This metadata does not add model-visible prompt text or create a resumable child lifecycle.
50
+ `startup-lock` is the default, including old documents with an omitted strategy. Once admitted, it keeps the exact provider/model/effort across turns and bounded `RATE_LIMIT` retries. `rate-limit-fallback` starts identically, but distinct positively no-output-safe rate-limit failures reaching the configured threshold advance the ordered chain within finite switch/delay caps. Per-role overrides inherit only omitted fields from `runtimePolicy`; different roles and sessions never share route locks or counters. Success resets consecutive rate-limit counts. Duplicate errors do not count twice and exhausted chains never wrap to primary.
51
+
52
+ Only an exact native `NO_ADAPTER` or adapter-proven `UNKNOWN_MODEL` failure on the first actual request, before any accepted output/tool fragment, may advance a remaining startup candidate. Later generic, transport, authorization, quota, payment, context and cancelled failures do not authorize inferred hopping. Exact rate limit is never startup unavailability. Every automatic retry or switch requires a positively correlated native attempt and its matching live/durable no-output settlement; partial text, reasoning, tool fragments or completed blocks forbid even same-route retries. See [runtime recovery](runtime-recovery.md).
53
+
54
+ Each configured route requires a nonempty provider and model together. An optional named `reasoningEffort` is a native adapter ID, not an OpenCode variant translation. The exact configured effort must be supported; unsupported `max` fails rather than being substituted with `high`. A changed route without effort clears incompatible inherited effort and lets the native adapter resolve its default. For a native child override that changes provider/model without supplying effort, the alias likewise clears the profile-primary effort rather than carrying it onto the new route. Existing DeepSeek calibration cannot override the admitted explicit role/child effort.
55
+
56
+ Native child options keep `modelSelectionSettings:false`: this correction introduces no new model-visible selection permission or tool. DSMM's aliased native provider merges profile-primary defaults from the admitted parent snapshot with explicit native child options, then invokes the parent's native `llm.resolveCallConfig` preflight before native spawn. The trusted live-child path preserves that accepted route/effort through the final request headers instead of reapplying the profile primary. Standing preset/tool rows do not capture per-profile routes. The path preserves native persona/tool filters, depth, permissions, cancellation, and one-shot lifecycle. Child identity comes from its own durable native subagent descriptor, not a parent preset, persona text, or a model-visible role label. Descriptor identity can be reconstructed after reload; it does not prove live ownership or make terminal one-shot children resumable.
57
+
58
+ Default primary preparation does not reset an admitted fallback or an accepted native user choice. Public `session/selectModel` intentionally persists the native default in the host's background; profile-editor fields use only the advisory catalog and never call that endpoint. Final native request headers are authoritative, not an intermediate middleware snapshot. See [runtime recovery](runtime-recovery.md) for role/global chain precedence and retry fences.
59
+
60
+ DSMM records a model-hidden `dsmm/role-policy` identity for explicit routing. It hashes the admitted profile epoch, strategy/retry policy and routes while keeping the audited v1 event's exact three-key grammar. Unchanged admitted policies retain accepted routes across turns; a scoped apply changes the root's epoch and invalidates old pending reservations. Child epochs come only from child-owned history/native live ownership. Cold admissions do not resurrect an old process-local lock merely from history. This metadata does not add model-visible prompt text, create a resumable child lifecycle, or substitute for session sidecars.
61
+
62
+ On DSH 0.2.0-rc.2, durable custom metadata requires explicit deployment-only `sessionPersistence: {root, compression}` on the main DSMM Loader entry. DSMM mounts its native JSONL companion and awaits readiness before installing runtime hooks. The public `@dsmm/dsmm/session-persistence` export is a library building block, not a second package Loader source. An incompatible durable provider is rejected before DSMM appends its custom event; ephemeral Hosts without persistence remain allowed. Native `Session.append` cannot set the stock-reader `ignorable` marker itself. See [persistence compatibility](compatibility.md#session-persistence-compatibility) for preserving the effective storage settings, disabling the exact stock provider at startup, and old-log repair limits. Final frozen-artifact/production acceptance remains pending; source contracts are not release proof.
45
63
 
46
64
  ## Legacy exact-route calibration
47
65
 
@@ -0,0 +1,95 @@
1
+ # Deepwork runtime profiles (0.1.5 source contract)
2
+
3
+ This guide describes the 0.1.5 source contract. It is not evidence of a published package or completed Docker/Desktop acceptance; see [releasing](releasing.md). Deepwork is the display name; package, storage and configuration IDs retain `dsmm` for compatibility. Historical 0.1.4 release identities and continuation evidence stay immutable.
4
+
5
+ A Deepwork runtime profile is a named file containing runtime policy, not a native deployment profile or an Agent role preset. Native Settings → **Deepwork Profiles** / **Deepwork 配置档** provides create/read/edit/save, explicit apply, and reset to the deployment baseline. The native Agent preset selector remains a separate role selector, displaying `DW …` names under unchanged `dsmm-*` IDs.
6
+
7
+ ## Files and document format
8
+
9
+ The native `profileContext.dir` is the only storage authority. No guessed user-home fallback or inline `profiles` object in plugin config is used.
10
+
11
+ | File | Purpose |
12
+ | --- | --- |
13
+ | `<profileContext.dir>/dsmm-profiles/<id>.jsonc` | Editable named draft |
14
+ | `<profileContext.dir>/dsmm-profiles/.revisions/<sha256>.jsonc` | Immutable exact bytes pinned by an explicit apply |
15
+ | `<profileContext.dir>/dsmm-profiles/.selection.json` | Minimal selection pointer: `{version: 1, id, revision}` |
16
+ | `<profileContext.dir>/dsmm-profiles/.sessions/<sha256(native-session-id)>.json` | Explicit session choice: exact session ID, pinned profile/baseline, CAS revision and admission epoch; no history or credentials |
17
+
18
+ IDs are filename-safe identifiers, not paths; reserved names, case collisions and link traversal are rejected. A document has exactly `version: 1`, `id`, optional `label`, and `settings`. For example, a draft named `careful.jsonc` may contain:
19
+
20
+ ```jsonc
21
+ {
22
+ "version": 1,
23
+ "id": "careful",
24
+ "label": "Careful review",
25
+ "settings": {
26
+ // Saving preserves this comment; apply pins these exact bytes.
27
+ "defaultActive": true,
28
+ "workflow": { "policy": "risk-based" },
29
+ "roleRouting": {
30
+ "dsmm-reviewer": {
31
+ "primary": {
32
+ "provider": "my-existing-provider",
33
+ "model": "my-existing-model",
34
+ "reasoningEffort": "high"
35
+ },
36
+ "fallbackRoutes": [],
37
+ "strategy": "startup-lock",
38
+ "rateLimit": { "maxRetries": 3, "maxTotalDelayMs": 30000 }
39
+ }
40
+ },
41
+ "runtimeRecovery": { "enabled": false }
42
+ }
43
+ }
44
+ ```
45
+
46
+ The example provider/model must be native-resolvable and advertise the specified effort. Catalog listing is advisory: a manually configured route can be resolvable while absent from the list. It introduces no provider, account or credential. Explicit `fallbackRoutes: []` disables that role's fallback chain; it is not equivalent to omitting the key and inheriting a global chain.
47
+
48
+ ## Supported settings and precedence
49
+
50
+ The exact top-level `settings` allowlist is:
51
+
52
+ - `defaultActive`
53
+ - `roleRouting`
54
+ - `runtimePolicy` (optional inherited strategy and finite `rateLimit` defaults)
55
+ - `workflow`
56
+ - `guards`
57
+ - `runtimeRecovery`
58
+ - `deepseekV4ProCalibration`, `deepseekV4ProDefaultReasoningEffort`, `deepseekV4ProMaxReasoningPresets`
59
+ - `deepseekFlashCalibration`, `deepseekFlashDefaultReasoningEffort`, `deepseekFlashMaxReasoningPresets`
60
+
61
+ Existing nested validation and finite bounds still apply. Profiles reject deployment-only `roles`, `skills`, `modeName`, `promptOrder`, `section`, `presets`, `lsp`, and `sessionPersistence`, as well as embedded profiles, native provider/account/auth/header/env/install fields, arbitrary Cordis rows, and unknown fields. Structural changes belong in deployment configuration and require restart. A guard setting cannot enable tools forbidden by a canonical read-only role composition.
62
+
63
+ Effective settings resolve in this order: **built-in DSMM defaults → deployment DSMM configuration → selected immutable runtime revision**. Structural settings always come from deployment configuration. No selection means the unchanged deployment baseline, not a synthetic default profile. Omitted fallback policy and explicit empty policy remain distinct through resolution. See [model routing](model-routing.md) and [settings/status](settings-status.md).
64
+
65
+ ## Save versus apply
66
+
67
+ Create or open a draft in native Settings and use the role-specific primary provider/model/exact-effort controls, ordered fallback rows, strategy and bounded retry fields. Each role can choose `startup-lock` or `rate-limit-fallback` independently; blank policy fields inherit, zero is explicit, and an empty fallback chain is not inheritance. Provider/model changes clear stale explicit effort. Catalog refresh preserves configured/manual values and does not select the native/global model default. Advanced JSONC remains available for custom routes and other supported settings.
68
+
69
+ Saving validates the draft and preserves edited raw JSONC/comments, but does not activate it—even if the same ID is currently selected. Structured changes edit only their JSONC paths; invalid raw text remains visible and cannot be silently normalized by returning to the form. Unsaved edits must be saved or explicitly discarded before switching away.
70
+
71
+ **Apply saved profile** is a separate global-default operation. It checks the expected draft revision, validates runtime fields and native route/effort semantics, pins the draft's exact bytes in `.revisions`, and atomically commits `.selection.json`. Only after the pointer commit succeeds may the current in-memory selection change. The UI distinguishes the editable draft, selected immutable revision for future Agents, and an existing Agent's admitted snapshot. **Reset to baseline** clears the global runtime selection for future unscoped Agents; it does not delete drafts or mutate an existing Agent.
72
+
73
+ **Current-session profile / Apply profile to current session** uses the actual native view's session ID, not the profile being edited or a guessed latest session. It commits only that session's sidecar under a genuine native idle-maintenance reservation. Both the expected sidecar revision and admission epoch must still match. **Pin baseline for current session** writes an explicit baseline choice without changing the global default. Sessionless Settings cannot apply to a session; busy, maintenance-owned, disposed, replaced, child or unauthorized targets refuse visibly. Cold targets are resumed only through native session authority after backend authorization and strict decoding.
74
+
75
+ Save/apply requests use expected revisions. A concurrent UI save or external file edit produces a conflict instead of overwriting later bytes; reread and reconcile. Validation, missing file, revision conflict, lock/IO, authorization, or activation failures must be visible, not reported as success. Invalid/missing/linked files and digest mismatches never silently select another profile or model. Pointer failure retains the prior disk selection and current settings; an unused immutable revision may remain.
76
+
77
+ Storage uses bounded validated content, containment/link checks under a cross-process writer lock, and same-directory atomic replacement. Lock timeouts are errors; stale-looking locks are not stolen. Immutable revision files are never overwritten or hand-edited. Operations accept stable IDs, not arbitrary filesystem paths. Profile summaries do not expose credentials or deployment configuration.
78
+
79
+ ## Agent lifetime and restart
80
+
81
+ Global applying or resetting affects **new unscoped Agents only**. Every existing live Agent, including a blank one, retains its admitted immutable runtime snapshot. An explicit current-session apply is different: a truly idle ordinary root receives a new immutable admission epoch after the durable sidecar commit. Even reapplying the same revision creates a new epoch. Existing children retain their captured old epoch; later genuinely owned native children inherit the new one. Other roots, the global default, completed tools and native persona/tool/skill composition remain unchanged.
82
+
83
+ Native model selection is separate user intent, not a profile sidecar setting. The exact public native provider/model/effort choice takes priority over the profile's role default, remains on subsequent turns/cold resume, and is not silently cleared by ordinary profile apply. An effort-only or same-value native selection is still fresh intent and fences stale retry work. Parent manual choice does not overwrite a configured child's own role route. Structured profile editing never selects the native/global model default; only the user's native selection endpoint has the host's normal background-default persistence behavior.
84
+
85
+ After restart, a session with a committed sidecar admits that exact immutable revision or explicit baseline, even if its draft/global default changed. A session without a sidecar preserves the historical global-current cold-resume behavior; it does not infer a previous profile from lineage/history. Corrupt, missing, linked or digest-mismatched sidecars/revisions fail visibly instead of falling back to baseline. Sidecars add no new session event vocabulary, so stock native history readers remain authoritative. Native clear/compact changes the session identity and does not automatically transfer an old choice.
86
+
87
+ Older sessions whose selected root ID is now auxiliary-only may fail native cold resume with an unknown preset ID. Read [compatibility](compatibility.md) before upgrading; never silently switch their persona or erase history.
88
+
89
+ ## Migration, authority and rollback
90
+
91
+ Migration from 0.1.1 is explicit: save supported runtime values as a named draft, preserve deployment roles/skills/provider/account/UI rows, inspect the draft, then apply separately. No operation rewrites `cordis.patch.yml` or migrates credentials. Native RPC authorization applies on the backend as well as the UI. There are no model-visible profile-management tools, child write capabilities, anonymous endpoints or authentication bypasses.
92
+
93
+ For policy rollback, explicitly choose global baseline, session baseline, or a reviewed prior profile in the intended scope using current CAS/epoch values. Never overwrite an immutable revision or restore draft bytes over a later user edit. Global rollback leaves existing live Agents unchanged; scoped rollback changes only the admitted idle root and future children. Package rollback is separate and uses an exact known immutable package through the official carrier; see [releasing](releasing.md).
94
+
95
+ 0.1.4 documents remain loadable without rewriting user files. Omitted strategy now means the safer `startup-lock`; a legacy generic fallback chain no longer silently hops after later generic failures. `runtimeRecovery.enabled` is not the strategy selector. Read [runtime recovery](runtime-recovery.md) before upgrading a configuration that depended on generic automatic fallback.
package/docs/releasing.md CHANGED
@@ -1,15 +1,24 @@
1
- # DSMM 0.1.1 Release and Rollback
1
+ # Deepwork 0.1.5 Release and Rollback
2
+
3
+ This is a future procedure for 0.1.5, not a completed-release receipt. The new identities are `@dsmm/dsmm@0.1.5`, tag `dsmm-scoped-v0.1.5`, and `dsmm-dsmm-0.1.5.tgz`. Deepwork/DW display names do not rename package or protocol IDs. Existing 0.1.1 and older releases remain immutable. The stopped 0.1.2 tag, frozen artifact and draft Release remain untouched and unpublished: do not dispatch its bootstrap publisher, finalize its draft, overwrite its bytes or move/delete/recreate its tag.
4
+
5
+ The `dsmm-scoped-v0.1.3` tag at `2bdea4b` is immutable too. Run `37235817488` failed **before pack/publish** because pnpm 11 ignored esbuild/koffi build scripts. Preserve that tag and its historical plan; do not reroute it to the successor. 0.1.5 must obtain its own fresh source, clean Linux build, packed bytes and receipt.
6
+
7
+ The completed 0.1.4 publication and its separately authorized continuation remain historical evidence: original run `37240470628/1` and continuation `37243216939/1` are not 0.1.5 proof. Their exact fourteen UI checks and nine installed compiled-file checks remain unchanged.
8
+
9
+ The mandatory sequence is **fresh CI pack → independent frozen-byte Docker acceptance → verified OIDC npm/GitHub publication and terminal completion → authorized official-carrier Desktop rollout**. No global/system DSH, Desktop configuration, account/provider, credential, or real-session writes may occur before terminal verified publication. Local readiness alone does not authorize publication or migration.
2
10
 
3
11
  ## Preflight
4
12
 
5
- Run these local checks from the exact checkout/status selected for review; they are readiness evidence, not publication steps. Perform the npm-name ownership recheck before publication: the registry lookup is current evidence and cannot reserve name ownership. Confirm the pinned DSH 0.2.0-rc.2 package/CLI identity, review license parity with the package contents, and complete artifact review of the dry-run pack manifest before any mutation. The user selected 0.1.0 for the initial package release; readiness alone does not authorize publishing or replacing an artifact.
13
+ Run these checks from the exact source selected for review; they are readiness evidence, not publication steps. Confirm pinned DSH 0.2.0-rc.2 package/CLI identity, seven exact public exports, both metadata locale resources, peer/client exports, license parity and the exact packed file set. Recheck scoped npm authority and absence of the new version/tag before authorized publication; a registry lookup cannot reserve ownership. Do not change root ocmm/LSP versions or regenerate the unrelated Codex adapter.
6
14
 
7
15
  ```powershell
8
16
  git rev-parse HEAD
9
17
  git status --short
10
- npm view @dsmm/dsmm name version --registry "https://registry.npmjs.org/"
18
+ pnpm --dir dsmm typecheck:test
19
+ pnpm --dir dsmm test
11
20
  pnpm --dir dsmm build
12
- pnpm --dir ".\dsmm" exec tsc -p ".\tsconfig.test.json" --noEmit
21
+ node dsmm/scripts/generate-role-assets.mjs
13
22
  pnpm --dir dsmm check:release
14
23
  npm pack ".\dsmm" --dry-run --json
15
24
  pnpm --dir dsmm smoke:docker
@@ -18,35 +27,73 @@ pnpm test
18
27
  pnpm run build
19
28
  ```
20
29
 
21
- The DSMM test, build, checker, pack, and Docker checks cover the package surface; run `pnpm --dir dsmm test` when completing the DSMM test check. The root typecheck, test, and build check the surrounding repository. Inspect the `npm pack` JSON for the intended artifacts, files, and license before treating the package as review-ready. Local evidence has one boundary: a successful local checker or Docker smoke is not proof of publication.
30
+ The root typecheck, test and build must pass before committing. Build before generating static role assets, then verify generation is idempotent and the committed assets match. Inspect the preview for client/profile assets and exported `locale/en.json` / `locale/zh.json` with `{meta: {title: "Deepwork", description: <localized nonempty text>}}`; exclude secrets, test homes, tests, plans, sourcemaps and nested tarballs. Prove native `readPluginMeta` consumes the installed resources and all twelve DW display labels preserve IDs, mode, access and tool restrictions.
31
+
32
+ Use pnpm for actual install/build/test/**pack/publish**. The `npm pack --dry-run --json` above is only the existing read-only, size-rich metadata diagnostic, not release packaging. Do not blindly substitute pnpm's differently shaped preview JSON or fabricate missing size fields. Source-checkout Docker runs are development evidence; final acceptance must use the CI-frozen artifact and expected SHA256 without building or repacking. A checker or successful install is not runtime, UI, publication or Desktop proof.
33
+
34
+ For 0.1.5, clean Linux install/build verification must exercise the reviewed pnpm `allowBuilds` policy for exactly `esbuild@0.25.12` and `koffi@3.1.1`, with `strictDepBuilds: true`. A cached native binary or pre-existing `lib` tree cannot establish that the ignored-script failure is repaired. This is distinct from the deliberately script-free metadata dry-run above; do not weaken that diagnostic's lifecycle-script protection or approve all dependency scripts.
35
+
36
+ ## Phase 1: frozen artifact and independent Docker gate
37
+
38
+ Use the dedicated `.github/workflows/dsmm-release.yml` **future tag path** for the authorized `dsmm-scoped-v0.1.5` push, not the old bootstrap dispatch. Tag/version, peeled source commit, control commit and event identity must agree. CI uses pinned Node 24 / pnpm 11.9.0, checks/builds the exact source, verifies generated assets, and packs **one new actual tarball** with pnpm. Inspect `dsmm-dsmm-0.1.5.tgz`, record its actual size/SHA256/SHA1/SHA512 integrity, and freeze it. Never reuse the old 0.1.2 hash/receipt/artifact.
39
+
40
+ Run the full independent Docker runner with that **explicit artifact path and expected SHA256**, required compiled-UI hook and trusted support files. It must fail closed if required inputs are missing/mismatched and must not build, repack, or silently choose another tarball. The new completed receipt's `packedSha256` must match the fresh frozen file and its run/attempt/source identity. Only these accepted unchanged bytes may proceed to publish.
41
+
42
+ Use a fresh image/process/home and exact pinned DSH, installing the packed package rather than importing checkout code. Do not mount or copy Desktop/global configuration, sessions, credentials, account records, browser storage or user authentication. A deterministic test-owned no-auth model fixture may drive actual runtime operations; paid chat and schema inventories alone cannot replace these scenarios:
43
+
44
+ - Native metadata reader yields Deepwork from both packaged locales; all twelve DW display names and unchanged technical IDs are correct; settled healthy root audit includes enabled DW Orchestrator/Builder/Planner only, disabled Builder absent, auxiliary roles excluded; actual blank-session Agent preset selection.
45
+ - Actual enabled auxiliary delegation and native read-only denials, with exact role route/effort and aliased-parent `llm.resolveCallConfig` preflight against the fixture catalog.
46
+ - Same packaged compiled Deepwork Profiles UI through native client/slots and supported in-process operator/Gateway RPC into real profile storage: create/read/edit/save/apply/reset, explicit deployment-only validation errors, revision conflict, pointer failure, and exact draft/immutable-revision/pointer bytes.
47
+ - Save without activation; new-Agent-only apply; existing even-blank Agent retention; inherited child/recovery settings; fresh-process pinned current selection despite a subsequently edited draft; truthful cold-resume/removed auxiliary-root limitations.
48
+ - Existing native web/headless, session-persistence/history compatibility, LSP, sentinel and cleanup scenarios remain required; naming checks do not replace these runtime contracts.
22
49
 
23
- ## Authorized publication
50
+ Successor acceptance additionally requires the compiled structured editor's native catalog round-trip, comment/unrelated-setting preservation, ordered fallback controls, unlisted native-resolvable routes, and invalid raw retention. Exercise real current-session UI apply, two independent roots, sidecar CAS and fresh epochs, busy/maintenance/child refusal, old/new child isolation and same-revision reapply. Cold-resume the exact pinned sidecar after changing the global default, then compare stock native visible history and request headers. Place an owned regular profile lock **before** a second real native Loader starts; prove visible refusal and unchanged pointer/lock ownership, with a truthful observed root-roster disposition.
24
51
 
25
- The first scoped package is `@dsmm/dsmm@0.1.0`, with the distinct tag `dsmm-scoped-v0.1.0`. The prior `dsmm-v0.1.0` GitHub release remains immutable; its unscoped npm publication was rejected by the registry's package-name similarity policy. Do not rename or replace that old release's artifacts. Publication requires explicit authorization; the root release workflow has no DSMM lane. The authorized first-release bootstrap uses the maintainer's authenticated npm account with access to the `dsmm` organization to publish the reviewed tarball. npm Trusted Publishing is a future CI option, not an authentication claim for this bootstrap. Release authorization covers normal commit, push, tag, npm publication and GitHub Release steps for this scoped identity only; it does not authorize rewriting existing publications or adding unrelated release lanes.
52
+ Actual native `followup/whenIdle` requests must prove primary/first-available startup locks, finite same-route rate-limit exhaustion, threshold-ordered rollover, same-profile/different-role and different-profile isolation, first-request unavailable versus partial/later refusal, and both strategies' partial-text/tool-fragment no-retry fences. Bind each real provider call to its native request header, live attempt ID, matching durable stream and settlement; successful outputs and terminal outcomes must agree. A competing native always-retry handler must remain unused and tools must not replay. The added native model-selection scenario must invoke strict public `session/selectModel`, demonstrate a route different from the Orchestrator profile primary, exact effort-only changes and subsequent-request retention, and validate the final native headers rather than an acknowledgement alone.
26
53
 
27
- The authorized follow-up feature version is `@dsmm/dsmm@0.1.1`, tag `dsmm-scoped-v0.1.1`. Keep both 0.1.0 identities intact. Before its publication, additionally verify direct/child role routes, exact efforts, native host-first fallback ordering, read-only routed children, and real configured gateway acceptance; an inherited-Flash smoke alone cannot prove the new role configuration.
54
+ Bind the hook and all three support files explicitly: `profile-ui-harness-server.mjs`, `profile-ui-harness-browser.mjs`, and `profile-ui-harness-native.mjs`. The successor receipt's exact check and installed compiled-file inventories are version-gated; historical receipt grammars are not expanded. CI source/pack/publish/installed verification uses Node 24 / pnpm 11.9.0; the independent borrowed Docker runtime uses its recorded Node 22 / pnpm 12.8.1 environment. These are distinct evidence surfaces, not interchangeable build claims.
28
55
 
29
- Pack once from the tested committed checkout, then freeze `dsmm-dsmm-0.1.1.tgz`. Run real Flash and role-routing verification against this exact file and require each receipt's `packedSha256` to match the frozen artifact SHA256. Rehash before publication; never repack after that test. Publish with `npm publish <reviewed-dsmm-dsmm-0.1.1.tgz> --access public --registry=https://registry.npmjs.org/`, and attach the same tarball plus `SHA256SUMS.txt` to the new GitHub Release. Record the tag's peeled commit, npm integrity and downloaded asset checksums. A DSMM release is complete only when these identities agree and a fresh registry-installed profile loads successfully; the root ocmm completion checker does not cover DSMM.
56
+ The native component/RPC/storage test uses a supported composition-owned in-process carrier, not an anonymous production route or copied login. It is distinct from authenticated Desktop activation. Preserve sanitized scenario evidence and inspect the full intended diff before parent-owned authorized release operations. If any required scenario fails or the frozen bytes change, stop before publication/global migration.
57
+
58
+ ## Phase 2: authorized immutable publication
59
+
60
+ Publication requires explicit authorization for the new identity. Recheck `@dsmm/dsmm@0.1.5` and `dsmm-scoped-v0.1.5` are absent. Confirm the one-time npm Trusted Publisher registration for repository `hugefiver/ocmm`, workflow filename `dsmm-release.yml`, with direct publish allowed. If supported setup/MFA is still missing, request that step; do not add a static token fallback or recurring manual release gate. The main ocmm workflow/checker does not cover DSMM: its dedicated workflow and DSMM terminal checker do.
61
+
62
+ The earlier unscoped `dsmm-v0.1.0` GitHub release, scoped 0.1.0 release and scoped 0.1.1 release stay intact. A new-release authorization covers ordinary commit/push/tag/npm/GitHub actions for 0.1.5 only, not rewriting prior publications, the old 0.1.2 draft, app upgrades, global package-manager changes or authentication workarounds.
63
+
64
+ The future publish job revalidates the accepted run/attempt-bound bytes and publishes **that exact tarball with native pnpm**, public npmjs access, lifecycle scripts ignored, OIDC and genuine provenance enabled. Do not forge GitHub identity variables, use the old bootstrap's `provenance=false`, or repack after acceptance. Preserve non-canceling package-wide publication concurrency and least-permission separated jobs. Registry byte/integrity and fresh installed-package verification precede non-overwriting public GitHub finalization with the same tarball and `SHA256SUMS.txt`.
30
65
 
31
66
  Treat both identities as immutable: never overwrite an npm version and never move, delete, or recreate an immutable tag. Readiness documentation and a local tarball do not authorize a publish.
32
67
 
33
- ## Post-publication verification
68
+ ### Publication identity verification
34
69
 
35
- After an authorized publication, use a fresh isolated `DSH_HOME` and registry install the exact `@dsmm/dsmm@0.1.1` version into a new profile process. Initialize the headless profile first. Check the plugin list and `--dump-config` from that profile, then use available host adapter status where the host exposes it; `/deepwork` and `/dsmm-status` are not headless task text. Confirm scoped root and `@dsmm/dsmm/preset-skills` exports resolve from the installed package while the Loader settings row remains `id: dsmm`.
70
+ Verify the tag's peeled commit, exact npm name/version and `dist.integrity`, genuine provenance, downloaded registry archive bytes, GitHub asset bytes and checksum list against the frozen artifact. Use a fresh isolated `DSH_HOME` for exact registry installation. Check all seven exports, including both metadata JSON resources, resolve and match bytes from the **installed registry package**, never the checkout. Native `readPluginMeta` must yield Deepwork; JSON resources are metadata, not executable code. The Loader row remains `id: dsmm`. Initialize a fresh headless deployment profile first; `/deepwork` and `/dsmm-status` are not headless task text.
36
71
 
37
- Record the package integrity reported by the registry alongside the version, tarball identity, profile name, and verification time. The evidence must show that the installed package resolves from the registry rather than the working tree.
72
+ After the matching workflow terminates, run `scripts/check-dsmm-release-completion.mjs` for its exact run ID, attempt and control SHA. It must bind source/Docker proof, tag/commit, frozen bytes, registry/provenance/install evidence, GitHub assets/checksums and every required job. The future path has `import-bootstrap` **skipped / NOT_APPLICABLE**, `bootstrapImport: null` and no bootstrap import artifact; this is not missing evidence. Only terminal outcome `COMPLETED` authorizes later rollout. Workflow success alone is insufficient. Preserve any partial or ambiguous publication; do not overwrite assets, move/delete/recreate the tag, implicitly retry uploads or repair in place.
38
73
 
39
74
  ```powershell
40
- $env:DSH_HOME = "$env:TEMP\dsmm-0.1.1-verify"
41
- dsh --profile dsmm-0.1.1-verify --from-default-profile headless --dump-config
42
- dsh plugin --profile dsmm-0.1.1-verify add @dsmm/dsmm@0.1.1
43
- dsh plugin --profile dsmm-0.1.1-verify list
44
- dsh --profile dsmm-0.1.1-verify --dump-config
45
- npm view @dsmm/dsmm@0.1.1 dist.integrity --registry "https://registry.npmjs.org/"
75
+ $env:DSH_HOME = "<fresh-task-owned-verification-home>"
76
+ dsh --profile dsmm-0.1.5-verify --from-default-profile headless --dump-config
77
+ dsh plugin --profile dsmm-0.1.5-verify add @dsmm/dsmm@0.1.5
78
+ dsh plugin --profile dsmm-0.1.5-verify list
79
+ dsh --profile dsmm-0.1.5-verify --dump-config
80
+ npm view @dsmm/dsmm@0.1.5 dist.integrity --registry "https://registry.npmjs.org/"
46
81
  ```
47
82
 
83
+ ## Phase 3: official installed-carrier Desktop rollout
84
+
85
+ Only after terminal 0.1.5 completion may authorized global migration begin. First perform the separately bounded isolated real-model/tool check against the exact registry package. Coordinate a fully quit Desktop, recheck concurrent edits, and preserve a recoverable local snapshot of only task-changed package-manager/DSMM-owned files—not the entire credential or session store. Use the exact installed official Desktop carrier to install `@dsmm/dsmm@0.1.5`. It may manage packages while the app is quit; it may **not** boot/dump the reserved Desktop profile. Never substitute standalone npm DSH, a renamed/copied profile, checkout imports, `app.asar` patches, global PATH/pnpm changes, or auth bypasses.
86
+
87
+ Preserve base/web bundles, deployment roles/skills, all configured policies, disabled Builder, active mode, provider/model catalog, account state and UI preferences. Saving supported baseline settings as a runtime draft is explicit and reversible; it does not change structural configuration. Disclose committed-sidecar versus absent-sidecar cold resume and the unknown removed auxiliary-root ID limitation in [compatibility](compatibility.md) before rollout. Do not silently substitute personas or delete history.
88
+
89
+ Any old unmarked-log repair remains a separately authorized exact private target, native-lease-held, same-directory backup-first, metadata-only operation with concurrency checks and actual installed-reader parity. The naming release does not itself authorize session edits, and an old observed digest is not permission to overwrite newer history.
90
+
91
+ After a supported restart, verify actual Desktop package 0.1.5 activation, native Deepwork metadata, healthy selectable DW root names, retained auxiliary delegation/read-only denial, and actual Deepwork Profiles UI create/edit/save/apply/reset with independent file/pointer bytes. Verify live even-blank Agents remain unchanged on apply and current pinned selection persists across restart. Check unrelated deployment/provider/account/UI state remained intact. If authenticated native Desktop behavior cannot be observed, report that pending boundary; disk files, native metadata reads, headless tests and Docker component proof alone are insufficient for complete integration.
92
+
48
93
  ## Rollback
49
94
 
50
- For a profile-level rollback, run `dsh plugin --profile <name> remove @dsmm/dsmm`, add an exact known-good version, and restart the profile process. Replacing an old unscoped installation requires removing its `dsmm` dependency/bundle before activating the scoped one, so two bundles do not both insert `id: dsmm`. Preserve existing settings and credentials. Desktop requires its installation-owned `dsh.cmd` with the app fully quit; Desktop boot/config dump is not a supported CLI operation. If a corrected package is needed, use a separately-authorized new patch version and repeat publication verification.
95
+ Runtime rollback resets to the deployment baseline or explicitly reapplies a reviewed prior configuration with concurrency/revision checks. Never mutate immutable files or restore drafts over later user edits. Existing live Agents retain their snapshots.
96
+
97
+ For package rollback, use the official carrier to remove `@dsmm/dsmm`, add an exact known immutable version and restart through the supported path. Keep runtime drafts/revisions and unrelated settings. An old unscoped bundle must not coexist with the scoped bundle using the same `id: dsmm`. Desktop requires the installed carrier with the app fully quit; boot/dump remains unsupported. Do not restore credential files, sign out, delete sessions, remove old releases or perform broad recursive cleanup. Remove only exact task-owned temporary material when safe and retain release/recovery evidence.
51
98
 
52
99
  Never overwrite an npm version or rewrite a tag to repair a publication. Preserve the immutable evidence and select a new, authorized version instead.