@dsmm/dsmm 0.3.0 → 0.3.1

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 (166) hide show
  1. package/README.md +26 -40
  2. package/cordis.patch.yml +0 -13
  3. package/docs/agent-presets.md +26 -14
  4. package/docs/compatibility.md +19 -73
  5. package/docs/deferred-native-approval-risk.md +8 -12
  6. package/docs/design.md +25 -254
  7. package/docs/lsp.md +2 -2
  8. package/docs/migration-from-ocmm.md +38 -51
  9. package/docs/model-routing.md +21 -21
  10. package/docs/native-permissions.md +17 -7
  11. package/docs/profiles.md +13 -9
  12. package/docs/releasing.md +34 -280
  13. package/docs/roadmap.md +23 -254
  14. package/docs/runtime-recovery.md +29 -91
  15. package/docs/safety-guards.md +19 -16
  16. package/docs/settings-status.md +23 -11
  17. package/docs/skill-sync.md +17 -17
  18. package/docs/web-fetch-fakeip.md +82 -0
  19. package/lib/child-capture.d.ts +12 -2
  20. package/lib/child-capture.js +22 -5
  21. package/lib/client/ChildrenPanel.d.ts +1 -4
  22. package/lib/client/ChildrenPanel.js +4 -16
  23. package/lib/client/DeploymentFields.d.ts +28 -0
  24. package/lib/client/DeploymentFields.js +68 -0
  25. package/lib/client/DeploymentPage.d.ts +17 -5
  26. package/lib/client/DeploymentPage.js +79 -112
  27. package/lib/client/NativeCommandEntries.d.ts +17 -0
  28. package/lib/client/NativeCommandEntries.js +68 -0
  29. package/lib/client/PermissionsPanel.d.ts +1 -1
  30. package/lib/client/PermissionsPanel.js +8 -8
  31. package/lib/client/ProfilesSection.js +7 -5
  32. package/lib/client/RoleToolView-data.d.ts +35 -0
  33. package/lib/client/RoleToolView-data.js +52 -0
  34. package/lib/client/RoleToolView-locales.d.ts +36 -0
  35. package/lib/client/RoleToolView-locales.js +20 -0
  36. package/lib/client/RoleToolView.d.ts +10 -0
  37. package/lib/client/RoleToolView.js +47 -0
  38. package/lib/client/SessionProfiles.js +39 -15
  39. package/lib/client/children-controller.d.ts +2 -8
  40. package/lib/client/children-controller.js +1 -26
  41. package/lib/client/children-locales.d.ts +27 -52
  42. package/lib/client/children-locales.js +8 -12
  43. package/lib/client/configuration-display.d.ts +5 -0
  44. package/lib/client/configuration-display.js +11 -0
  45. package/lib/client/controller.d.ts +1 -0
  46. package/lib/client/controller.js +20 -13
  47. package/lib/client/deployment-controller.d.ts +13 -1
  48. package/lib/client/deployment-controller.js +84 -24
  49. package/lib/client/deployment-data.d.ts +1 -0
  50. package/lib/client/deployment-data.js +4 -1
  51. package/lib/client/deployment-locales.d.ts +43 -0
  52. package/lib/client/deployment-locales.js +35 -9
  53. package/lib/client/deployment-modules.d.ts +9 -0
  54. package/lib/client/deployment-modules.js +24 -0
  55. package/lib/client/deployment-workspace.d.ts +48 -0
  56. package/lib/client/deployment-workspace.js +123 -0
  57. package/lib/client/index.js +11 -74
  58. package/lib/client/locales.d.ts +7 -0
  59. package/lib/client/locales.js +12 -6
  60. package/lib/client/permission-controller.d.ts +1 -0
  61. package/lib/client/permission-controller.js +3 -2
  62. package/lib/client/permission-locales.d.ts +25 -0
  63. package/lib/client/permission-locales.js +24 -4
  64. package/lib/client/session-labels.js +4 -3
  65. package/lib/client/styles.d.ts +1 -1
  66. package/lib/client/styles.js +9 -8
  67. package/lib/client.js +2713 -2361
  68. package/lib/commands.js +2 -0
  69. package/lib/config-file-store.d.ts +3 -0
  70. package/lib/config-file-store.js +4 -2
  71. package/lib/config-revision.d.ts +5 -0
  72. package/lib/config-revision.js +11 -0
  73. package/lib/core-permission-authority.js +11 -41
  74. package/lib/deployment-config.d.ts +9 -2
  75. package/lib/deployment-config.js +35 -8
  76. package/lib/deployment-permission-rules.js +19 -7
  77. package/lib/dsh-types.d.ts +1 -1
  78. package/lib/host-llm-startup.js +3 -3
  79. package/lib/host-llm.d.ts +9 -3
  80. package/lib/host-llm.js +48 -8
  81. package/lib/index.d.ts +16 -20
  82. package/lib/index.js +130 -416
  83. package/lib/lifetime.d.ts +4 -0
  84. package/lib/lifetime.js +22 -0
  85. package/lib/live-pi-ai-owner.d.ts +1 -0
  86. package/lib/live-pi-ai-owner.js +8 -4
  87. package/lib/mode.d.ts +3 -2
  88. package/lib/mode.js +28 -41
  89. package/lib/model-routing.d.ts +2 -8
  90. package/lib/model-routing.js +59 -175
  91. package/lib/native-admission.d.ts +56 -0
  92. package/lib/native-admission.js +313 -0
  93. package/lib/native-pi-ai-wire.d.ts +3 -1
  94. package/lib/native-pi-ai-wire.js +47 -13
  95. package/lib/permission-control.d.ts +0 -3
  96. package/lib/preset-registry.js +3 -2
  97. package/lib/preset-skills.d.ts +3 -12
  98. package/lib/preset-skills.js +28 -58
  99. package/lib/profile-diagnostics.d.ts +1 -1
  100. package/lib/profile-diagnostics.js +2 -2
  101. package/lib/profile-remote.js +61 -22
  102. package/lib/profile-rpc.d.ts +4 -3
  103. package/lib/profile-rpc.js +33 -37
  104. package/lib/profile-runtime.d.ts +31 -74
  105. package/lib/profile-runtime.js +224 -639
  106. package/lib/profile-store.d.ts +18 -6
  107. package/lib/profile-store.js +104 -62
  108. package/lib/profile-types.d.ts +18 -4
  109. package/lib/profiles.d.ts +3 -1
  110. package/lib/profiles.js +9 -7
  111. package/lib/prompt-content.d.ts +1 -0
  112. package/lib/prompt-content.js +4 -1
  113. package/lib/prompts.d.ts +2 -12
  114. package/lib/prompts.js +11 -66
  115. package/lib/role-control-remote.d.ts +1 -4
  116. package/lib/role-control-remote.js +8 -36
  117. package/lib/role-control-rpc.d.ts +10 -36
  118. package/lib/role-control-rpc.js +112 -269
  119. package/lib/role-control-types.d.ts +3 -26
  120. package/lib/role-control-types.js +3 -4
  121. package/lib/role-identity.d.ts +5 -0
  122. package/lib/role-identity.js +10 -0
  123. package/lib/role-invocation.d.ts +2 -2
  124. package/lib/role-llm-runtime.js +5 -11
  125. package/lib/role-policy.d.ts +19 -50
  126. package/lib/role-policy.js +136 -508
  127. package/lib/role-providers.d.ts +5 -8
  128. package/lib/role-providers.js +20 -86
  129. package/lib/role-routing.d.ts +1 -3
  130. package/lib/role-routing.js +24 -34
  131. package/lib/role-subagents.d.ts +5 -14
  132. package/lib/role-subagents.js +148 -106
  133. package/lib/runtime-integration.d.ts +5 -78
  134. package/lib/runtime-integration.js +11 -697
  135. package/lib/session-metadata.d.ts +13 -12
  136. package/lib/session-metadata.js +6 -31
  137. package/lib/session-scope.js +2 -1
  138. package/lib/settings.d.ts +5 -18
  139. package/lib/settings.js +19 -43
  140. package/lib/state.d.ts +3 -2
  141. package/lib/state.js +26 -10
  142. package/lib/status.d.ts +1 -9
  143. package/lib/status.js +3 -55
  144. package/lib/web-fetch-address-policy.d.ts +24 -0
  145. package/lib/web-fetch-address-policy.js +189 -0
  146. package/lib/web-fetch-fakeip.d.ts +25 -0
  147. package/lib/web-fetch-fakeip.js +107 -0
  148. package/package.json +113 -103
  149. package/docs/research/deepseek-v4-pro.md +0 -74
  150. package/docs/research/oh-dsh.md +0 -96
  151. package/lib/agent-registry.d.ts +0 -36
  152. package/lib/agent-registry.js +0 -75
  153. package/lib/child-admission.d.ts +0 -40
  154. package/lib/child-admission.js +0 -151
  155. package/lib/delivery-authority.d.ts +0 -83
  156. package/lib/delivery-authority.js +0 -397
  157. package/lib/native-child-evidence.d.ts +0 -40
  158. package/lib/native-child-evidence.js +0 -104
  159. package/lib/role-runs.d.ts +0 -138
  160. package/lib/role-runs.js +0 -335
  161. package/lib/session-persistence.d.ts +0 -36
  162. package/lib/session-persistence.js +0 -304
  163. package/lib/subagent-runtime.d.ts +0 -57
  164. package/lib/subagent-runtime.js +0 -257
  165. package/prompts/deepseek-flash.md +0 -11
  166. package/prompts/deepseek-v4-pro.md +0 -14
package/docs/design.md CHANGED
@@ -1,278 +1,49 @@
1
- # dsmm dsh Migration Design
1
+ # DSMM native architecture
2
2
 
3
- Date: 2026-08-21
3
+ DSMM 0.3.1 targets exactly DSH `0.2.1-rc.2`. It supplies Core configuration and native permission integration plus optional Deepwork roles, routing and skills.
4
4
 
5
- ## Current native configuration design (stage D, 2026-10-08)
5
+ ## Composition and authority
6
6
 
7
- The historical MVP proposal below is retained as design history, not today's
8
- scope. The authority is the native parity plan §3.3/stage D and [DESIGN.md](../DESIGN.md).
9
- The product is the existing official Plugins page, not a new SPA or skin.
7
+ Official AgentRegistry, SubagentRuntime, AgentLoop and JSONL namespace plugins own creation, execution, activation results, queues, parent-child ownership, storage and disposal. DSMM doesn't replace those owners or require a manual-runtime selector, companion or cold-migration entry.
10
8
 
11
- - `plugins.item` owns DSMM's summary/page contribution; `plugins.bundle.config`
12
- keys `@dsmm/dsmm`; `plugins.row.config` keys `@dsmm/dsmm#<actual-row-id>`.
13
- Runtime entry ID, native form namespace, row ID and package ID are not
14
- interchangeable. Identity is verified by server projection and the exact
15
- native form descriptor/revision/base/user metadata before a profile write.
16
- - Global edits use only the fixed Core `dsmmConfig` service. Profile edits use
17
- only the actual entry's public ConfigForms/ConfigPageForm transport. Separate
18
- buttons/revisions preserve untouched sparse fields; no merged-default copy,
19
- new store, root-path RPC, or cross-layer Save-all exists. Bundle views obtain
20
- the verified actual namespace's public form; a standalone page without a
21
- form honestly marks the profile region unavailable while Core remains usable.
22
- - All applicable feature families are exposed by structural controls and
23
- bounded, closed-schema Advanced JSON. Unknown/duplicate/prototype keys and
24
- invalid numbers remain visible and refuse save. Arrays replace, objects
25
- inherit recursively; empty/default values remain explicit pins. Higher Host
26
- pins are displayed, never promised removable by a lower-layer unset.
27
- - Desired, startup-mounted/captured, next-root preview and actual admitted
28
- session are separate projections. Preview reuses the runtime's admission
29
- preparation without creating a session. The host bundle state is unknown
30
- when unobservable; module availability is not bundle enablement or mode.
31
- Missing sessions stay unknown. Save never restarts, remounts, cancels or
32
- reconciles running work; cold-off desired-on requires an independent restart.
33
- - Drafts retain their original CAS on refresh/conflict. Explicit discard alone
34
- rebases. Entry/connection-generation changes and component disposal fence
35
- stale writes; native readonly/nonloopback/operator refusal is not bypassed by
36
- the global route. Named JSONC/model selection/session actions stay independent.
37
- - UI uses Host colors, font, controls, borders/radius and focus tokens; 14px/22px
38
- reading rhythm, maximum 760px, native disclosures and wrapping actions. No new
39
- brand, shadows or decorative motion. EN/ZH, sanitized alerts and polite live
40
- feedback accompany real 375/768/1280 light/dark native Web evidence.
9
+ The data flow is configuration source → complete immutable candidate → Agent admission → native request/tool execution → activation/catalog → client projection. Configuration and display metadata can't flow backward to grant execution permission.
41
10
 
42
- The SDK stays rc.2. The official Desktop shared source contract is pinned at
43
- `5badb15009ae1756c3afe0ae0cef1faafc290ccc` (0.2.1-alpha.1); actual Electron is
44
- uninstalled/unverified here. Web screenshots are not Desktop acceptance.
11
+ Each role invocation captures its exact parent, ToolExecution, definition/provider identities, frozen settings and route before calling native `startActivation`. A short-lived pending record correlates the unique child with awaited `agent/created`. That listener installs scoped policy, skills and routing before queued input is released, then publishes the live admission. It runs after Registry publication; initialization failure is rolled back by the native factory, not treated as an unpublished creation. Pending state isn't a second execution queue.
45
12
 
46
- ## Goal
13
+ Preset discovery, root eligibility and model availability are independent. Auxiliary presets aren't valid roots even if a native picker displays them. Empty-root preset changes require a valid execution-before-input binding; mismatched composition refuses at step/request/tool boundaries. Generic spawn/fork can't bypass a controlled parent's role admission. Ordinary non-DSMM off-mode paths don't gain DSMM authority.
47
14
 
48
- Build `dsmm` as a dsh-native subtree project that brings ocmm's deepwork workflow, role prompts, skills, model calibration, and safety conventions to DeepSeek Harness without globally enabling them for every session.
15
+ Agent-scoped guards retain lifetime checks after plugin retirement. Native activation disposal handles owned work; hot unload/reinstall isn't a promise of uninterrupted live-session replacement. Existing unbound Agents aren't enrolled by listing them.
49
16
 
50
- The first deliverable is an MVP dsh bundle that installs into a profile, registers a `deepwork` mode through dsmm's own Host plugin, and makes the mode's behavior configurable. Later versions add full role/category coverage, guard hooks, model routing, and runtime recovery. DSMM-managed external LSP isn't enabled in this version: the implementation, interfaces and original configuration remain, automatic MCP mounting stays off even with `lsp.enabled:true`, and DSMM's settings UI hides LSP controls. This doesn't affect DSH's own LSP or independently configured MCP. The retained manual patch isn't a supported DSMM activation entry; no LSP delivery is scheduled here.
17
+ ## Configuration and admission
51
18
 
52
- ## Non-goals
19
+ Settings resolve as defaults → sparse Global → explicit native entry/profile → admitted named overlay. Objects merge, arrays replace, and explicit false, empty and same-default values remain pins. Unset affects only its own layer.
53
20
 
54
- - Do not load the existing ocmm OpenCode plugin inside dsh.
55
- - Do not emulate OpenCode's `config`, `chat.params`, `system.transform`, or `tool.execute.*` hook ABI.
56
- - Do not globally replace the user's dsh persona or every session's system prompt.
57
- - Do not make DeepSeek V4 Pro-specific prompt tuning mandatory for non-DeepSeek models.
58
- - Do not include UI skins, desktop shell features, or plugin-marketplace functionality in the MVP.
21
+ Core remains available without a session or active Deepwork. Desired source values, mounted startup ceilings and actual Agent admission are distinct. New roots capture valid desired configuration within mounted ceilings. Existing Agents and their children don't absorb later saves. Without a session, admission is unknown.
59
22
 
60
- ## Source references
23
+ Global, native form, named document and selection pointer have independent CAS boundaries. Global/store writes retain prepare, atomic commit and observation stages; native writes retain the public ConfigEditor/form transaction. Operator, connection, entry and lifetime are checked after awaits and before irreversible writes. A committed write with failed notification/observation stays committed with refresh-required or unsynchronized status. An unconfirmed native mutation requires reread before retry.
61
24
 
62
- The design is based on:
25
+ Named-profile Save and future-default selection don't apply to existing Agents or select a model. **Live overlay Apply is unavailable**. **Use profile model**, **Deepwork mode** and **Apply overlay** project separate capabilities and reasons; Apply's restriction doesn't disable ordinary model/mode actions. Use profile model invokes native selection against the admitted immutable revision and observed manual-intent watermark. Same-value manual reselection is still new intent. See [Profiles](profiles.md).
63
26
 
64
- - dsh's Cordis architecture: plugin rows, reversible effects, profile bundles, and services such as `ctx.systemPrompt`, `ctx.tools`, `ctx.agents`, `ctx.llm`, and `ctx.sessions`.
65
- - dsh's current plan-mode package: logged per-agent mode state, prompt-section activation, `/plan`, and `exit_plan_mode`. Current public docs expose `@deepseek-ai/dsh-plan-mode`, not a generic arbitrary named `dsh-mode` package.
66
- - `hust-open-atom-club/oh-dsh`: profile/bundle composition, Host/Client separation, surface contracts, settings seam, and archived mode notes.
67
- - ocmm's existing feature surface: deepwork prompts, v1 workflow skills, role/category metadata, model-family routing, MCP/LSP integration, runtime fallback, and safety guards.
68
- - DeepSeek API and DeepSeek V4 Pro public documentation: thinking mode, `reasoning_effort`, tool-call reasoning-content retention, and max-reasoning prompt implications.
27
+ ## Native client surfaces
69
28
 
70
- ## Architectural choice
29
+ **Plugins → DSMM bundle config** is the deployment editor. Global and current native profile have separate Save/Refresh/Discard, module drawers and bounded Advanced JSON. Exact form namespace, entry/profile identity, revision and raw base/user provenance are required; a redacted snapshot isn't a replacement document. Missing form authority doesn't authorize a Global fallback. Named **Deepwork Profiles** retains its Settings section and compact Conversation menu. [DESIGN.md](../DESIGN.md) defines native components and interaction behavior.
71
30
 
72
- `dsmm` should be a dsh-native bundle package, not a compatibility shim.
31
+ Dirty and invalid drafts survive navigation and conflicts. Saving doesn't create sessions, select models, restart services or mount LSP. Children UI projects official catalog/control capabilities, not a duplicate state machine. Direct-child control and read-only descendant inspection have different authority.
73
32
 
74
- The package should eventually declare:
33
+ Collapsed invocation rows show `调用 Coding` / `Call Coding`; native child labels use `Coding: task description`. Requested identity isn't actual identity. Validated result metadata, partial/failure/interruption handling and current-format replay/PTC preserve that distinction. Native safety refusal presentation takes precedence.
75
34
 
76
- ```json
77
- {
78
- "name": "@dsmm/dsmm",
79
- "type": "module",
80
- "dsh": { "bundle": { "patch": "./cordis.patch.yml" } }
81
- }
82
- ```
35
+ ## Execution, routing and resources
83
36
 
84
- The bundle patch should layer dsmm above normal dsh base/web/headless profiles. It should insert dsmm plugin rows and mode configuration, while leaving users free to override rows in their profile-level `cordis.patch.yml`.
37
+ Waiting calls use native `delivery: 'caller'` and consume the activation result; only `completed` is normal completion. Publication-time cancellation uses the receipt's `dispose()` and waits for cleanup. Background must be chosen before start with `delivery: 'parent'`; accepted child/message IDs aren't completion. Running waiting calls can't be handed off to background.
85
38
 
86
- ## Subtree layout
39
+ Live direct-child Queue/Steer/interrupt require exact ownership, admission, operator and actual native capabilities. Unknown delivery outcomes aren't automatically resent. Cold DSMM resume without trusted live binding refuses execution while preserving history. DSMM read-only history queries don't call resume; native factory load/repair may precede the created guard, so refusal isn't a no-log-open guarantee.
87
40
 
88
- The planned project boundary is:
41
+ Ordinary roots retain native model selection. Role normal and explicit low/high/max routes use generic capabilities and immutable parameter policy. Standard supported calls use native prepared calls. Raw/custom parameters and Pi-AI stop-only calls use the minimal public completions payload seam for self-contained literal or explicit model-mapping configurations. Catalog-backed raw combinations that can't be reliably reproduced are rejected for both native and DSMM parameter sources. Standard Coding and native effort encoding remain unchanged. [Model routing](model-routing.md) and [runtime recovery](runtime-recovery.md) define the boundaries.
89
42
 
90
- ```text
91
- dsmm/
92
- README.md
93
- package.json
94
- cordis.patch.yml
95
- src/
96
- index.ts
97
- config/
98
- mode/
99
- prompt/
100
- skills/
101
- agents/
102
- routing/
103
- guards/
104
- mcp/
105
- docs/
106
- design.md
107
- roadmap.md
108
- research/
109
- tests/
110
- ```
43
+ Fourteen skills use Agent-scoped metadata discovery and lazy bodies, preserving non-DSMM ancestor winners and cancellation/invalidation semantics. `preset-skills` is an internal admission-owned handle, not a public plugin or global lifecycle owner. Deepwork off removes workflow/DSMM skills, not mandatory persona/read-only/tool policy.
111
44
 
112
- The initial commit intentionally contains only documentation. Package files and source code come after the MVP implementation plan is reviewed.
45
+ ## Limits
113
46
 
114
- ## dsh integration model
47
+ Native approval remains final for its exact call/scope, not a reusable permission. Relevant policy changes coordinate revocation; unrelated display/model saves aren't second approval gates. See [native permissions](native-permissions.md).
115
48
 
116
- ### Composition plane
117
-
118
- The composition plane is `cordis.patch.yml` and profile bundle ordering. It decides which plugins exist and how dsh services are wired.
119
-
120
- MVP composition rows should cover:
121
-
122
- - a dsmm Host plugin row;
123
- - dsmm's own `deepwork` mode registration, modelled on dsh plan-mode semantics but not limited to planning;
124
- - optional prompt/skill provider rows if dsh expects separate providers;
125
- - default disabled rows for features that are not active in MVP.
126
-
127
- This follows oh-dsh's pattern: shipped bundles own default composition, while profile patch layers own user overrides.
128
-
129
- ### Settings plane
130
-
131
- The settings plane is for user-editable behavior. dsmm should expose one namespace, tentatively `dsmm`, with settings such as:
132
-
133
- ```yaml
134
- dsmm:
135
- mode:
136
- name: deepwork
137
- enabled: true
138
- autoEnter: false
139
- workflow:
140
- approvalGate: conditional
141
- usePlanCritic: true
142
- finalReview: simple-oracle-complex-reviewer
143
- prompts:
144
- locale: zh-Hans
145
- deepseekV4ProCalibration: auto
146
- verbosity: concise
147
- skills:
148
- brainstorming: true
149
- writingPlans: true
150
- requestingCodeReview: true
151
- receivingCodeReview: true
152
- models:
153
- defaultReasoningEffort: high
154
- maxReasoningForArchitecturalWork: true
155
- guards:
156
- shellSafety: true
157
- gitWriteGuard: true
158
- toolOutputTruncation: true
159
- ```
160
-
161
- Composition config should define availability. Settings should define preferences and toggles that a user could reasonably edit in a settings page.
162
-
163
- ## Deepwork as a custom mode
164
-
165
- The central requirement is that deepwork must be opt-in.
166
-
167
- MVP uses dsh mode semantics instead of global system-prompt injection. Current public dsh docs expose a concrete `@deepseek-ai/dsh-plan-mode` package rather than a generic arbitrary-mode package. Therefore dsmm should implement a small Host plugin, `dsmm-deepwork-mode`, that follows the same dsh-native principles: mode state is session-scoped, prompt contribution is active only while the mode is active, and command/tool affordances are stable enough not to surprise the model.
168
-
169
- The default custom mode name is `deepwork`. Entering the mode should add a model-visible section that explains the deepwork routing, brainstorming gate, planning workflow, review gates, and scope discipline. Leaving the mode should restore ordinary dsh behavior.
170
-
171
- Conceptual dsh patch:
172
-
173
- ```yaml
174
- - id: dsmm-deepwork-mode
175
- name: 'dsmm'
176
- config:
177
- modeName: deepwork
178
- section: |
179
- You are in dsmm deepwork mode. Use the dsmm workflow only for this session mode.
180
- Classify the user's intent, use dsh tools deliberately, keep implementation scope exact,
181
- and follow the configured design, plan, implementation, and review gates.
182
- ```
183
-
184
- The real implementation should keep the default full prompt in source files and allow `section` or overlay settings to replace it. If dsh later exposes a generic mode package, dsmm can replace this plugin with configuration rows while preserving the public settings shape.
185
-
186
- ## Prompt architecture
187
-
188
- Prompt content should be split by responsibility:
189
-
190
- - `mode/deepwork`: mode activation text and workflow contract.
191
- - `prompt/orchestrator`: intent routing and dsh tool-use policy.
192
- - `prompt/model/deepseek-v4-pro`: DeepSeek V4 Pro calibration overlay.
193
- - `prompt/safety`: shell, git, Docker, and scope safety.
194
- - `prompt/review`: final review and evidence requirements.
195
-
196
- The MVP should register only the mode prompt and the minimal orchestrator/safety sections needed for useful behavior. Later versions can add scoped role prompts for planner, reviewer, and specialized agents.
197
-
198
- ## DeepSeek V4 Pro calibration policy
199
-
200
- The user's field observation is that DeepSeek V4 Pro can under-activate unless prompted carefully. Public sources do not establish a formal vendor statement that the model is "overfit" in that sense. Official/public documentation does establish several relevant facts:
201
-
202
- - `deepseek-v4-pro` supports thinking mode through `reasoning_effort` and `extra_body: { thinking: { type: "enabled" } }`.
203
- - Thinking mode with tools requires reasoning content to be preserved across subsequent tool-calling turns, otherwise API-compatible integrations can fail or lose continuity.
204
- - Thinking mode ignores sampling controls such as `temperature` and `top_p` in the official API path.
205
- - DeepSeek V4 Pro has explicit non-think, think-high, and think-max operating modes; max reasoning uses an additional prompt prefix in the model encoding.
206
-
207
- dsmm should therefore treat "DeepSeek V4 Pro calibration" as a model-family overlay, not as a universal prompt. The overlay should:
208
-
209
- 1. ask for deliberate decomposition before tool use on architectural, debugging, migration, and multi-file tasks;
210
- 2. state that tools are part of the reasoning loop and must be used for repository-specific claims;
211
- 3. avoid vague encouragement such as "be smart" and instead encode concrete trigger/action rules;
212
- 4. preserve concise final answers while allowing deeper private reasoning through the provider's thinking controls;
213
- 5. recommend `reasoning_effort: high` for normal deepwork tasks and `max` only for architecture, review, migration, runtime-safety, or hard-reasoning work;
214
- 6. avoid the unsupported `developer` role for general DeepSeek API usage.
215
-
216
- ## MVP scope
217
-
218
- MVP v0.1 builds a minimal, installable dsh bundle with:
219
-
220
- - `deepwork` custom mode implemented by dsmm, disabled outside explicit mode activation;
221
- - dsmm settings namespace with documented defaults;
222
- - core deepwork prompt section;
223
- - four workflow skills: brainstorming, writing-plans, requesting-code-review, receiving-code-review;
224
- - minimal role definitions for orchestrator, planner, reviewer, code-search, and doc-search if dsh agent presets are available in the target profile;
225
- - DeepSeek V4 Pro calibration overlay gated by model/settings.
226
-
227
- MVP excludes:
228
-
229
- - complete ocmm category matrix;
230
- - OpenCode runtime fallback and idle continuation;
231
- - MCP/LSP server packaging;
232
- - tool guard parity;
233
- - web/client UI panels;
234
- - Docker-based dsh integration tests beyond a smoke harness.
235
-
236
- ## Configuration strategy
237
-
238
- Every dsmm feature should have a clear control surface:
239
-
240
- | Feature | Default | Control surface |
241
- |---|---:|---|
242
- | `deepwork` mode registration | on | composition config |
243
- | auto-enter deepwork | off | settings |
244
- | DeepSeek V4 Pro calibration | auto | settings + model detection |
245
- | workflow skills | on for MVP set | settings |
246
- | role presets | on when dsh agent presets available | composition config |
247
- | safety guards | staged, mostly off until implemented | settings |
248
- | DSMM-managed external LSP | always off in this version | original configuration retained; settings UI hidden; no activation entry |
249
-
250
- ## Docker debugging strategy
251
-
252
- Docker is allowed for dsh debugging, but dsmm should keep it as a verification surface rather than a runtime assumption.
253
-
254
- Planned checks:
255
-
256
- 1. build dsmm package;
257
- 2. start a disposable dsh profile inside Docker;
258
- 3. install dsmm into that profile using a local path or packed tarball;
259
- 4. verify the profile includes the dsmm bundle;
260
- 5. run a headless prompt that enters `deepwork` mode and confirms dsmm prompt sections are active;
261
- 6. remove the container and disposable profile artifacts.
262
-
263
- Docker checks must not require publishing dsmm or writing to user-level dsh config.
264
-
265
- ## Risks
266
-
267
- - dsh mode APIs may differ from the archived oh-dsh notes; implementation must verify against the current dsh package version.
268
- - DeepSeek V4 Pro calibration is partly based on user observation and community experience; official claims are limited to thinking/tool-call behavior and model modes.
269
- - Some ocmm features are OpenCode-specific and must be redesigned instead of ported line by line.
270
- - Full reviewer/oracle semantics may require dsh-native agent routing work before parity is possible.
271
-
272
- ## Acceptance criteria for this design phase
273
-
274
- - `dsmm/` contains all current dsmm project materials.
275
- - The MVP explicitly uses dsh custom mode rather than global prompt injection.
276
- - The roadmap separates MVP from parity features.
277
- - DeepSeek V4 Pro tuning is documented as a configurable overlay, not a universal assumption.
278
- - The first commit contains only dsmm project documentation and no runtime code.
49
+ Network behavior and limits are specified in [Fake-IP fetch](web-fetch-fakeip.md); shell rejection remains unlocated. LSP automatic mounting stays disabled; DSH's native LSP and independent MCP remain unchanged. See [LSP boundary](lsp.md).
package/docs/lsp.md CHANGED
@@ -35,6 +35,6 @@ An independently mounted native MCP client using `serverName: dsmm_lsp` uses the
35
35
 
36
36
  DSMM's read-only role restrictions don't grant rename or format permission. The retained `lspRuntime` status interface reports bounded state, diagnostic codes and tool names, not executable paths, arguments or environment values. Tool discovery alone doesn't prove language-server availability or a successful symbol query.
37
37
 
38
- DSMM's automatic external LSP integration isn't a delivered feature in this version. The existing release validator still requires a completed `receipt.lsp` with `directNativeDiagnosticsAndFormat` and `nativeDshMcpClient`; Docker smoke independently exercises the retained interface. These release checks remain required and don't establish a supported DSMM activation path or certify an independently configured server.
38
+ DSMM 0.3.1 targets exactly DSH `0.2.1-rc.2`. Automatic external LSP mounting isn't delivered; the retained interface inventory isn't an activation path.
39
39
 
40
- The workspace executable entry has an unresolved `EPERM` failure creating a child log in the inspected Windows environment. Repairing that path isn't a prerequisite for implementing this version's DSMM features, but it doesn't waive required release checks. Independently managed MCP users must check their actual server entry; this version doesn't certify or repair that environment.
40
+ DSH's native definition/references/implementation/hover surface isn't a promise of diagnostics, rename or format. The retained external interface above doesn't expand that native scope. Independently managed MCP users must verify actual executable and language-server availability; DSMM doesn't certify or repair that environment.
@@ -1,70 +1,57 @@
1
- # Migrating from ocmm to DSMM 0.1.1
1
+ # Migrating from ocmm to DSMM
2
2
 
3
- ## Current source-content checkpoint (2026-10-07)
3
+ DSMM 0.3.1 targets exactly DSH `0.2.1-rc.2`. It's a DSH-native Cordis bundle, not an OpenCode compatibility layer. Don't copy `.opencode/ocmm.jsonc` into DSH.
4
4
 
5
- The historical 0.1.1 mapping below is preserved, not current full-parity evidence. Working Stage B content now has the complete 11 base roles + 11 categories (22 canonical IDs) and fourteen configurable lazy skills. Cross-cutting is opt-in/default false, creative retains its existing identity, and root eligibility remains Orchestrator/Builder/Planner only. No source OCMM provider preferences, .opencode config, credentials or private profiles are copied. The native model picker and actual catalog remain authoritative.
6
-
7
- Use [role catalog](agent-presets.md) and [deterministic source sync](skill-sync.md) for current content and source → artifact → consumer mapping. Full default workflow, all nine source model/compatibility variants, source category calibrations, actual TS catalog responsibilities and terminal delegation policy are preserved with DSH-specific tools/authority. Source-generated files do not prove callable native roles, plan-only writes, continuation, background or execution guards. C/D own those remaining runtime/settings mechanisms.
8
-
9
- All fourteen skills load through native metadata/get/resourceBase, not seven-core fulltext injection plus an unconfigurable debugging exception. Explicit off preserves persona/access but withdraws common and DSMM skills. The full frontend taste/brand/ui-ux-db library uses an explicit, fixed-pin materialization recipe; package/runtime checks refuse missing or changed resources offline. A new source checkout must follow the documented explicit sync step, while a complete distributed package includes the full ignored library and real license notices. This is source/resource parity, not completed C/D runtime or publication/host-install proof. Installation/login/Git/destructive migration operations below require separate exact authorization; they are guidance, not automatic actions.
10
-
11
- DSMM is a DSH-native Cordis bundle, not an OpenCode compatibility layer; .opencode/ocmm.jsonc cannot be copied into DSH. This guide describes the 0.1.1 routing surface targeting DSH 0.2.0-rc.2, not a full host-feature parity claim.
12
-
13
- ## Hard boundary
14
-
15
- Model selection, authentication, permissions, session ownership, and package loading remain DSH-native. Existing ocmm/OpenCode configuration and sessions can coexist, but do not become DSMM configuration or fallback sessions.
5
+ Model selection, authentication, permissions, session ownership and package loading remain DSH-native. Existing OpenCode configuration and sessions may coexist, but they don't become DSMM configuration or fallback sessions. Migration doesn't copy credentials, account records or private provider preferences.
16
6
 
17
7
  ## Feature mapping
18
8
 
19
- | ocmm area | DSMM migration | State |
20
- | --- | --- | --- |
21
- | Deepwork gates | Risk-scaled discovery; authorized bounded implementation proceeds; complex behavior uses planner → critic → implementation; completion requires relevant evidence. | equivalent core intent |
22
- | Seven workflow skills | Current workflow intent adapted to native DSH tools, scopes, authorization, and review ownership. | equivalent core intent |
23
- | Twelve role presets | Native definitions plus role-specific delegation composition, including builder, creative, reviewer, oracle, and oracle-2nd. | redesigned for DSH |
24
- | Per-role model/effort and DeepSeek calibration | Explicit `roleRouting`, fixed native child options, direct-role request policy, exact configured efforts, and compatible legacy calibration. | redesigned for DSH |
25
- | Safety guards | Native pre/post tool policies; host approval/cancellation remain authoritative. | redesigned for DSH |
26
- | LSP/MCP | Implementation, interfaces and original config retained, but DSMM automatic MCP mounting stays off even with `lsp.enabled:true`; LSP settings UI is hidden. DSH's own LSP and independently configured MCP are unaffected. | not enabled in this version |
27
- | Runtime fallback | Host-first, opt-in role/global ordered chains with exact efforts, cancellation, duplicate, and step fences. | redesigned for DSH |
28
- | Idle continuation | Separately enabled, bounded steering from durable unfinished work. | redesigned for DSH |
29
- | Subagent interruption recovery | Native durable child/session control and explicit continuation; no guessed task IDs, synthesized parent messages, or independent automatic retry dispatcher. | redesigned for DSH |
30
- | Settings/status | Restart-scoped Loader plugin config and normalized read-only status; old settings namespaces need explicit migration. | redesigned for DSH |
31
- | Prompt/cache hooks | No OpenCode history mutation or cache-hook compatibility layer. | unavailable |
32
- | OpenCode commands/hooks | Native equivalents only; OpenCode registrations cannot be copied. | unavailable |
33
- | Model categories and Oracle tiers | User-controlled native agent/model composition; normal roles have no suffix and tier routes require explicit configuration. | optional/manual |
34
- | Codex marketplace | DSH plugin/profile loading, not Codex marketplace installation. | unavailable |
35
- | Release surfaces | Local packed-readiness checks; no root ocmm release authority. | redesigned for DSH |
9
+ | ocmm area | DSMM contract |
10
+ | --- | --- |
11
+ | Deepwork workflow | Risk-based discovery and planning adapted to native tools. Complex product behavior retains orchestrator-owned planning/criticism; bounded routine work doesn't require a ceremonial approval loop. |
12
+ | Roles and categories | 11 base roles and 11 categories with canonical `dsmm-*` IDs. Cross-cutting defaults off. Only enabled Orchestrator, Builder and opted-in Planner are standing-root eligible. |
13
+ | Skills | Fourteen configurable lazy native skills, discovered through metadata and loaded through `get`/`resourceBase`, not full bodies injected every turn. |
14
+ | Model routing | Generic native capabilities, `modelParameters`, role primary/fallback routes and explicit invocation levels. Ordinary root model/effort stays native-owned. |
15
+ | Settings | Sparse Global/native deployment layers plus independent named Profiles. Save, future default, mode and native model selection have independent capabilities; live overlay Apply is unavailable. |
16
+ | Safety | Native tool policies and scoped helpers; mandatory role/read-only/delegation fences remain independent of optional workflow mode. DSH owns approval and cancellation. |
17
+ | Child lifecycle | Official activation/results/disposal, immutable admission and live direct-parent controls. Background is selected before start; no running handoff, guessed task IDs or cold DSMM recovery. |
18
+ | Recovery | Startup locks and explicitly configured bounded rate-limit fallback, requiring positive no-output evidence. Idle continuation is separately opt-in. |
19
+ | LSP/MCP | DSMM automatic integration remains off, even with `lsp.enabled:true`; original interfaces/config remain. Native DSH LSP and independently configured MCP are unaffected. |
20
+ | OpenCode hooks and Codex marketplace | No hook ABI, history/cache mutation or marketplace compatibility. Use native DSH installation and actual exposed capabilities. |
21
+ | Release | Dedicated DSMM workflow and checker, not the root ocmm completion authority. |
22
+
23
+ See [Agent presets](agent-presets.md) for the canonical inventory and permission matrix. An exported template isn't a callable role. Reviewer is primary-lane self-review; Oracle is an external-model check only when the observed route actually differs. A role name alone doesn't prove model heterogeneity.
36
24
 
37
- The seven core skills are `brainstorming`, `writing-plans`, `subagent-driven-development`, `requesting-code-review`, `receiving-code-review`, `dispatching-parallel-agents`, and `remove-ai-slops`. Debugging is available on demand, without injecting its full references into every prompt.
25
+ [Source synchronization](skill-sync.md) defines prompt/resource provenance and fixed-pin distribution. The full frontend library and licenses must be present in the packed artifact; offline build/check refuses missing or unsafe resources without imposing content locks on local files.
38
26
 
39
- The role set includes `dsmm-orchestrator`, `dsmm-planner`, `dsmm-plan-critic`, `dsmm-reviewer`, `dsmm-code-search`, `dsmm-doc-search`, `dsmm-clarifier`, `dsmm-media-reader`, `dsmm-builder`, `dsmm-oracle`, `dsmm-oracle-2nd`, and `dsmm-creative`. File existence is not callable evidence. Check the active native preset and tool inventories. Reviewer is primary-lane self-review; Oracle is an external-model cross-check only when the actual user-selected route differs. Running all roles with Flash does not prove model heterogeneity.
27
+ ## Configuration sequence
40
28
 
41
- ## Migration sequence
29
+ These steps are operator guidance, not authorization to install or change user profiles:
42
30
 
43
- 1. Use an isolated `DSH_HOME` and a dedicated profile built from the pinned DSH 0.2.0-rc.2 headless template.
44
- 2. Install a locally packed reviewed DSMM artifact; registry publication remains separately authorized.
45
- 3. Configure the actual native provider/model and credentials; V41 Flash is `deepseek-flash`, not a guessed `deepseek-v4.1-flash` alias.
46
- 4. Move DSMM settings into the `id: dsmm` profile patch's `config` object and restart; do not copy old settings.yaml into the new home.
47
- 5. Use `workflow.policy: risk-based` for the current workflow. Explicit legacy controls remain supported; inspect normalized status instead of assuming omitted and explicit defaults are equivalent.
48
- 6. Inspect native roles and role-specific tools; do not configure removed `roots/includeUserRoot` or count exported template directories as discovery.
49
- 7. Don't use `lsp.enabled:true` or the retained historical manual patch as a DSMM activation entry in this version. Existing release checks still independently validate the retained LSP interface; see [LSP boundary](lsp.md). Recovery stays disabled unless explicitly configured.
50
- 8. Validate the packed profile and the real specified model's read/write/tool-result round-trip before changing your default workflow.
31
+ 1. Evaluate a reviewed packed candidate in an isolated `DSH_HOME` and dedicated native profile. The [README](../README.md#use-a-local-artifact) gives the minimal CLI example. Keep the original OpenCode configuration until the intended DSH carrier has passed its own checks.
32
+ 2. Configure actual providers, model IDs, exact efforts and credential references through native DSH. Discover the real catalog and adapter capabilities; don't infer aliases, vision support or protocol behavior from another provider's SDK name.
33
+ 3. Translate intended behavior into DSMM's sparse Global or exact native entry `config`, preserving unrelated settings and Loader rows. Use **Plugins → DSMM bundle config** for module drawers; named **Deepwork Profiles** remains separate. Don't copy the removed `settings.yaml` namespace or merged defaults into a sparse layer.
34
+ 4. Use `workflow.policy: risk-based` unless deliberately retaining supported legacy controls. Inspect normalized status because omitted values and explicit same-default pins have different inheritance effects.
35
+ 5. Configure canonical `roleRouting` IDs and explicit low/high/max levels where needed. Source tier guidance doesn't create suffix roles. Preserve disabled roles; a source `explore` alias maps to `dsmm-code-search`, not another role/tool.
36
+ 6. Retain official AgentRegistry, SubagentRuntime and JSONL namespace ownership. Don't add a DSMM custom owner, manual-runtime selector or persistence companion. Check actual admission/capabilities independently of saved desired settings.
37
+ 7. Verify actual native delegation, useful read/write/tool-result behavior, read-only denial and the child's own request route. Config/catalog inspection isn't execution evidence. Don't enable DSMM LSP through the retained historical manual patch; see [LSP boundary](lsp.md).
51
38
 
52
- Model IDs belong to their native provider routes: `deepseek-account/deepseek-flash` and a custom `hoo/deepseek-v4.1-flash` are distinct routes. Configure custom routes through DSH's pi-ai adapter, using credential references rather than literal keys. Provider SDK identity alone is not wire-protocol proof. For the inspected Anthropic gateway, terminal `/v1` must be removed from its source SDK baseURL to retain the same native request path; adaptive thinking compatibility and exact high/max declarations preserve effort. This rule is not a global URL rewrite for other protocols.
39
+ Headless task execution uses an effective `defaultActive:true` and a native provider; it doesn't select Agent presets. Command-capable Hosts execute `/deepwork` and `/dsmm-status` through the command adapter, not as model task text. `--dump-config` shows Loader composition, not complete Global-aware DSMM admission.
53
40
 
54
- Translate source agents into canonical `roleRouting` entries with primary and ordered fallback efforts. Keep explicit disabled roles disabled. A source `explore` alias to code-search maps to `dsmm-code-search`, not a new role/tool. Missing source model capabilities require discovery and actual validation; do not copy another version's vision capabilities or silently replace the media model. The checkout migration helper defaults to a sanitized dry run; applying credentials/profile changes is explicit and requires concurrency/backup safeguards.
41
+ ## Retired fields and retained history
55
42
 
56
- The inspected pi-ai adapter exposes stable transient codes but no stable HTTP status. The migration candidate explicitly opts in to `RATE_LIMIT`, `SERVER`, `TIMEOUT`, and `TRANSPORT` through `runtimeRecovery.retryOnCodes`, after native host retries decline. Authentication, quota, and invalid-request failures are not included. Package recovery defaults remain unchanged.
43
+ Brand-calibration/default-effort and MaxReasoningPresets fields reject with `deprecated-field`; [model routing](model-routing.md#generic-model-parameters) lists their exact names. Edit the invalid configuration deliberately using generic routes, parameters and levels. There is no automatic migration or silent field rewrite.
57
44
 
58
- ## Coexistence and cutover
45
+ Unsupported legacy profile libraries and history remain untouched; same-name central documents aren't substitutes. Source versions and immutable references distinguish observed/saved state, not permission to adopt the latest draft or restore execution. Native CAS, admission epochs and release/resource integrity keep separate contracts.
59
46
 
60
- 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.
47
+ Cold DSMM resume without trusted live admission is unsupported. Preserve history and obtain direction rather than substituting a persona or reconstructing permissions from the current parent. Display metadata and old captures don't grant authority; no automatic import, rewrite or migration is supplied.
61
48
 
62
- 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.
49
+ Live overlay Apply is unavailable; select a saved future default for new sessions. **Use profile model** and ordinary Deepwork mode changes have independent capabilities, not Apply's disabled gate. The model action requests the admitted immutable configuration's model, not a later draft, and newer observed native model/effort intent wins, including same-value reselection. See [Profiles](profiles.md).
63
50
 
64
- ## Successor 0.1.5 migration note
51
+ ## Carrier and permission limits
65
52
 
66
- 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.
53
+ Real Desktop and CLI/TUI installations require separate exact authorization. Use the installation-owned carrier on exact rc.2, preserve provider/account state and unrelated rows, and follow cold-start requirements. Desktop plugin installation follows publication and doesn't authorize upgrading the Host. Don't copy credentials or browser storage into tests.
67
54
 
68
- 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.
55
+ DSH owns depth, sandbox and approval. DSMM doesn't raise those ceilings or infer approval from configuration. [Running-overlay and approval boundaries](deferred-native-approval-risk.md) prohibit rebinding a pending call to another configuration. Repeated approval for read-only Git remains unclassified until the exact call and approval reason are supplied.
69
56
 
70
- 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.
57
+ Any profile/log repair or rollback needs its own data-preserving scope, concurrency checks and recoverable backup. Migration never authorizes rewriting immutable releases, deleting history or restoring credentials. [Release controls](releasing.md) separate npm publication completion from GitHub Release delivery and installed-carrier acceptance.