@dsmm/dsmm 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/README.md +37 -67
  2. package/agent-presets/dsmm-builder/agent.cordis.yml +10 -2015
  3. package/agent-presets/dsmm-clarifier/agent.cordis.yml +24 -343
  4. package/agent-presets/dsmm-code-search/agent.cordis.yml +19 -6
  5. package/agent-presets/dsmm-coding/agent.cordis.yml +19 -438
  6. package/agent-presets/dsmm-complex/agent.cordis.yml +23 -1009
  7. package/agent-presets/dsmm-creative/agent.cordis.yml +25 -442
  8. package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +29 -1013
  9. package/agent-presets/dsmm-deep/agent.cordis.yml +24 -1008
  10. package/agent-presets/dsmm-doc-search/agent.cordis.yml +19 -6
  11. package/agent-presets/dsmm-documenting/agent.cordis.yml +26 -439
  12. package/agent-presets/dsmm-frontend/agent.cordis.yml +21 -440
  13. package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +22 -441
  14. package/agent-presets/dsmm-media-reader/agent.cordis.yml +19 -6
  15. package/agent-presets/dsmm-normal-task/agent.cordis.yml +19 -438
  16. package/agent-presets/dsmm-oracle/agent.cordis.yml +25 -340
  17. package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +25 -340
  18. package/agent-presets/dsmm-orchestrator/agent.cordis.yml +29 -2025
  19. package/agent-presets/dsmm-plan-critic/agent.cordis.yml +24 -341
  20. package/agent-presets/dsmm-planner/agent.cordis.yml +14 -344
  21. package/agent-presets/dsmm-quick/agent.cordis.yml +19 -6
  22. package/agent-presets/dsmm-research/agent.cordis.yml +23 -8
  23. package/agent-presets/dsmm-reviewer/agent.cordis.yml +25 -340
  24. package/cordis.patch.yml +14 -0
  25. package/docs/agent-presets.md +36 -52
  26. package/docs/compatibility.md +47 -110
  27. package/docs/deferred-native-approval-risk.md +19 -0
  28. package/docs/design.md +2 -2
  29. package/docs/lsp.md +11 -21
  30. package/docs/migration-from-ocmm.md +2 -2
  31. package/docs/model-routing.md +84 -59
  32. package/docs/native-permissions.md +35 -0
  33. package/docs/profiles.md +40 -87
  34. package/docs/releasing.md +123 -2
  35. package/docs/roadmap.md +71 -17
  36. package/docs/settings-status.md +34 -169
  37. package/docs/skill-sync.md +52 -15
  38. package/lib/agent-registry.d.ts +36 -0
  39. package/lib/agent-registry.js +75 -0
  40. package/lib/child-admission-contract.d.ts +37 -0
  41. package/lib/child-admission-contract.js +2 -0
  42. package/lib/child-admission.d.ts +40 -0
  43. package/lib/child-admission.js +151 -0
  44. package/lib/child-capture.d.ts +85 -0
  45. package/lib/child-capture.js +205 -0
  46. package/lib/child-evidence.d.ts +17 -0
  47. package/lib/child-evidence.js +43 -0
  48. package/lib/client/ChildrenPanel.d.ts +43 -0
  49. package/lib/client/ChildrenPanel.js +82 -0
  50. package/lib/client/DeploymentPage.js +15 -8
  51. package/lib/client/EditableChoice.d.ts +17 -0
  52. package/lib/client/EditableChoice.js +49 -0
  53. package/lib/client/PermissionsPanel.d.ts +14 -0
  54. package/lib/client/PermissionsPanel.js +46 -0
  55. package/lib/client/ProfilesSection.js +30 -15
  56. package/lib/client/RoleAvailability.d.ts +7 -0
  57. package/lib/client/RoleAvailability.js +19 -0
  58. package/lib/client/SessionProfiles.js +27 -9
  59. package/lib/client/StructuredEditor.js +15 -7
  60. package/lib/client/children-controller.d.ts +98 -0
  61. package/lib/client/children-controller.js +296 -0
  62. package/lib/client/children-locales.d.ts +367 -0
  63. package/lib/client/children-locales.js +69 -0
  64. package/lib/client/controller.d.ts +6 -1
  65. package/lib/client/controller.js +14 -8
  66. package/lib/client/deployment-controller.js +1 -1
  67. package/lib/client/deployment-data.d.ts +2 -1
  68. package/lib/client/deployment-data.js +34 -5
  69. package/lib/client/deployment-locales.d.ts +4 -0
  70. package/lib/client/deployment-locales.js +11 -2
  71. package/lib/client/diagnostics.d.ts +14 -0
  72. package/lib/client/diagnostics.js +53 -0
  73. package/lib/client/index.d.ts +4 -0
  74. package/lib/client/index.js +96 -2
  75. package/lib/client/locales.d.ts +54 -0
  76. package/lib/client/locales.js +34 -16
  77. package/lib/client/permission-client.d.ts +16 -0
  78. package/lib/client/permission-client.js +38 -0
  79. package/lib/client/permission-controller.d.ts +62 -0
  80. package/lib/client/permission-controller.js +149 -0
  81. package/lib/client/permission-locales.d.ts +114 -0
  82. package/lib/client/permission-locales.js +75 -0
  83. package/lib/client/session-labels.js +4 -4
  84. package/lib/client/structured.js +19 -5
  85. package/lib/client/styles.d.ts +1 -1
  86. package/lib/client/styles.js +20 -0
  87. package/lib/client.js +5780 -1679
  88. package/lib/core-permission-authority.d.ts +18 -0
  89. package/lib/core-permission-authority.js +255 -0
  90. package/lib/core-permissions.d.ts +8 -0
  91. package/lib/core-permissions.js +33 -0
  92. package/lib/delivery-authority.d.ts +83 -0
  93. package/lib/delivery-authority.js +397 -0
  94. package/lib/deployment-config.d.ts +23 -0
  95. package/lib/deployment-config.js +61 -40
  96. package/lib/deployment-permission-rules.d.ts +55 -0
  97. package/lib/deployment-permission-rules.js +306 -0
  98. package/lib/dsh-types.d.ts +10 -4
  99. package/lib/guards.d.ts +1 -1
  100. package/lib/guards.js +29 -8
  101. package/lib/host-llm-startup.d.ts +41 -0
  102. package/lib/host-llm-startup.js +65 -0
  103. package/lib/host-llm.d.ts +92 -0
  104. package/lib/host-llm.js +325 -0
  105. package/lib/index.d.ts +15 -4
  106. package/lib/index.js +288 -48
  107. package/lib/live-pi-ai-owner.d.ts +18 -0
  108. package/lib/live-pi-ai-owner.js +144 -0
  109. package/lib/llm-runtime.d.ts +11 -0
  110. package/lib/llm-runtime.js +21 -0
  111. package/lib/managed-settings.d.ts +5 -0
  112. package/lib/managed-settings.js +14 -0
  113. package/lib/model-parameter-policy.d.ts +11 -0
  114. package/lib/model-parameter-policy.js +27 -0
  115. package/lib/model-routing.js +28 -17
  116. package/lib/modules.d.ts +13 -5
  117. package/lib/modules.js +17 -1
  118. package/lib/native-child-evidence.d.ts +40 -0
  119. package/lib/native-child-evidence.js +104 -0
  120. package/lib/native-pi-ai-wire.d.ts +37 -0
  121. package/lib/native-pi-ai-wire.js +261 -0
  122. package/lib/native-scope.js +1 -1
  123. package/lib/permission-bash.d.ts +6 -0
  124. package/lib/permission-bash.js +7 -0
  125. package/lib/permission-control.d.ts +73 -0
  126. package/lib/permission-control.js +205 -0
  127. package/lib/permission-controller.d.ts +68 -0
  128. package/lib/permission-controller.js +317 -0
  129. package/lib/permission-errors.d.ts +7 -0
  130. package/lib/permission-errors.js +21 -0
  131. package/lib/permission-fs-search.d.ts +5 -0
  132. package/lib/permission-fs-search.js +7 -0
  133. package/lib/permission-fs.d.ts +5 -0
  134. package/lib/permission-fs.js +7 -0
  135. package/lib/permission-native-access.d.ts +11 -0
  136. package/lib/permission-native-access.js +6 -0
  137. package/lib/permission-native-command.d.ts +10 -0
  138. package/lib/permission-native-command.js +93 -0
  139. package/lib/permission-native-rules.d.ts +75 -0
  140. package/lib/permission-native-rules.js +278 -0
  141. package/lib/permission-pwsh.d.ts +6 -0
  142. package/lib/permission-pwsh.js +7 -0
  143. package/lib/permission-remote.d.ts +26 -0
  144. package/lib/permission-remote.js +53 -0
  145. package/lib/permission-rpc.d.ts +29 -0
  146. package/lib/permission-rpc.js +152 -0
  147. package/lib/permission-rules.d.ts +115 -0
  148. package/lib/permission-rules.js +256 -0
  149. package/lib/permission-settings.d.ts +45 -0
  150. package/lib/permission-settings.js +48 -0
  151. package/lib/permission-shell.d.ts +38 -0
  152. package/lib/permission-shell.js +150 -0
  153. package/lib/permission-web.d.ts +5 -0
  154. package/lib/permission-web.js +7 -0
  155. package/lib/preset-registry.js +36 -25
  156. package/lib/profile-diagnostics.d.ts +45 -0
  157. package/lib/profile-diagnostics.js +148 -0
  158. package/lib/profile-locale.d.ts +3 -0
  159. package/lib/profile-locale.js +2 -0
  160. package/lib/profile-remote.d.ts +8 -0
  161. package/lib/profile-remote.js +163 -39
  162. package/lib/profile-rpc.d.ts +4 -3
  163. package/lib/profile-rpc.js +20 -16
  164. package/lib/profile-runtime.d.ts +40 -1
  165. package/lib/profile-runtime.js +368 -93
  166. package/lib/profile-store.d.ts +11 -0
  167. package/lib/profile-store.js +143 -11
  168. package/lib/profile-types.d.ts +70 -1
  169. package/lib/profile-types.js +1 -0
  170. package/lib/profiles.d.ts +16 -2
  171. package/lib/profiles.js +156 -79
  172. package/lib/prompt-content.js +1 -1
  173. package/lib/prompts.d.ts +37 -2
  174. package/lib/prompts.js +111 -9
  175. package/lib/recovery-policy.js +20 -7
  176. package/lib/role-control-remote.d.ts +38 -0
  177. package/lib/role-control-remote.js +211 -0
  178. package/lib/role-control-rpc.d.ts +51 -0
  179. package/lib/role-control-rpc.js +381 -0
  180. package/lib/role-control-types.d.ts +92 -0
  181. package/lib/role-control-types.js +8 -0
  182. package/lib/role-invocation.d.ts +47 -0
  183. package/lib/role-invocation.js +135 -0
  184. package/lib/role-llm-runtime.d.ts +17 -0
  185. package/lib/role-llm-runtime.js +62 -0
  186. package/lib/role-llm.d.ts +31 -0
  187. package/lib/role-llm.js +66 -0
  188. package/lib/role-policy.d.ts +46 -8
  189. package/lib/role-policy.js +421 -61
  190. package/lib/role-providers.d.ts +2 -2
  191. package/lib/role-providers.js +27 -72
  192. package/lib/role-routing.d.ts +11 -2
  193. package/lib/role-routing.js +42 -25
  194. package/lib/role-runs.d.ts +138 -0
  195. package/lib/role-runs.js +335 -0
  196. package/lib/role-subagents.d.ts +58 -3
  197. package/lib/role-subagents.js +179 -56
  198. package/lib/roles.d.ts +5 -6
  199. package/lib/roles.js +10 -39
  200. package/lib/route-json.d.ts +19 -0
  201. package/lib/route-json.js +129 -0
  202. package/lib/routing-policy.d.ts +2 -0
  203. package/lib/routing-policy.js +12 -2
  204. package/lib/runtime-integration.d.ts +81 -0
  205. package/lib/runtime-integration.js +702 -0
  206. package/lib/runtime-recovery.js +18 -8
  207. package/lib/session-persistence.d.ts +2 -1
  208. package/lib/session-persistence.js +1 -1
  209. package/lib/session-scope.js +4 -1
  210. package/lib/settings.d.ts +47 -13
  211. package/lib/settings.js +217 -82
  212. package/lib/skills.js +2 -2
  213. package/lib/status.d.ts +10 -1
  214. package/lib/status.js +11 -8
  215. package/lib/subagent-runtime.d.ts +57 -0
  216. package/lib/subagent-runtime.js +257 -0
  217. package/package.json +149 -89
  218. package/patches/subagent-runtime.yml +15 -0
  219. package/prompts/deepseek-flash.md +1 -1
  220. package/prompts/deepseek-v4-pro.md +2 -2
  221. package/prompts/deepwork.md +27 -18
  222. package/prompts/source/agents/clarifier.md +5 -3
  223. package/prompts/source/agents/orchestrator.md +18 -9
  224. package/prompts/source/agents/plan-critic.md +5 -1
  225. package/prompts/source/agents/planner.md +4 -2
  226. package/prompts/source/agents/reviewer.md +6 -0
  227. package/prompts/source/category/complex.md +4 -4
  228. package/prompts/source/category/creative.md +6 -4
  229. package/prompts/source/category/cross-cutting.md +10 -8
  230. package/prompts/source/category/deep.md +5 -3
  231. package/prompts/source/category/documenting.md +7 -1
  232. package/prompts/source/category/frontend.md +2 -2
  233. package/prompts/source/category/hard-reasoning.md +3 -3
  234. package/prompts/source/category/research.md +4 -2
  235. package/prompts/source/deepwork/claude-opus-5.md +2 -2
  236. package/prompts/source/deepwork/codex.md +1 -1
  237. package/prompts/source/deepwork/default.md +22 -15
  238. package/prompts/source/deepwork/gemini.md +23 -16
  239. package/prompts/source/deepwork/glm.md +21 -14
  240. package/prompts/source/deepwork/gpt.md +12 -6
  241. package/prompts/source/deepwork/planner.md +8 -5
  242. package/prompts/source/manifest.json +178 -63
  243. package/prompts/source/shared/dsh-host-contract.md +5 -3
  244. package/prompts/source/shared/locale.md +2 -2
  245. package/prompts/source/terminal/orchestrator.md +1 -1
  246. package/skills/ast-grep/SKILL.md +7 -4
  247. package/skills/brainstorming/SKILL.md +43 -22
  248. package/skills/coding-agent-sessions/SKILL.md +7 -4
  249. package/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -46
  250. package/skills/coding-agent-sessions/scripts/tests/test_pi_family_scanners.py +130 -130
  251. package/skills/debugging/SKILL.md +14 -9
  252. package/skills/debugging/references/methodology/00-setup.md +14 -62
  253. package/skills/debugging/references/methodology/02-investigate.md +4 -4
  254. package/skills/debugging/references/methodology/03-flaky-triage.md +3 -3
  255. package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +2 -14
  256. package/skills/debugging/references/methodology/06-fix.md +6 -6
  257. package/skills/debugging/references/methodology/08-qa.md +5 -5
  258. package/skills/debugging/references/methodology/09-cleanup.md +15 -153
  259. package/skills/debugging/references/methodology/partial-runtime-evidence.md +3 -16
  260. package/skills/debugging/references/runtimes/bundled-js-binary.md +1 -16
  261. package/skills/debugging/references/runtimes/native-binary.md +9 -54
  262. package/skills/debugging/references/runtimes/node.md +4 -15
  263. package/skills/debugging/references/runtimes/python.md +3 -15
  264. package/skills/debugging/references/runtimes/rust.md +2 -18
  265. package/skills/debugging/references/tools/dap.md +1 -1
  266. package/skills/debugging/references/tools/ghidra.md +4 -15
  267. package/skills/debugging/references/tools/playwright-cli.md +3 -15
  268. package/skills/debugging/references/tools/pwntools.md +4 -16
  269. package/skills/dispatching-parallel-agents/SKILL.md +18 -16
  270. package/skills/frontend/SKILL.md +7 -4
  271. package/skills/frontend/references/design/react-dev-tooling-skill.md +1 -1
  272. package/skills/git-master/SKILL.md +7 -4
  273. package/skills/init-deep/SKILL.md +7 -4
  274. package/skills/receiving-code-review/SKILL.md +17 -12
  275. package/skills/remove-ai-slops/SKILL.md +39 -38
  276. package/skills/requesting-code-review/SKILL.md +19 -17
  277. package/skills/requesting-code-review/code-reviewer.md +13 -1
  278. package/skills/subagent-driven-development/SKILL.md +29 -26
  279. package/skills/subagent-driven-development/implementer-prompt.md +29 -11
  280. package/skills/subagent-driven-development/spec-reviewer-prompt.md +6 -1
  281. package/skills/using-git-worktrees/SKILL.md +7 -4
  282. package/skills/writing-plans/SKILL.md +29 -24
  283. package/skills/writing-plans/plan-document-reviewer-prompt.md +10 -1
  284. package/scripts/repair-session-log.mjs +0 -476
  285. package/scripts/session-repair-native-verifier.mjs +0 -367
@@ -1,206 +1,71 @@
1
1
  # Deepwork settings and status
2
2
 
3
- ## Commands and inspection
3
+ These are built source contracts, not a claim that the published `@dsmm/dsmm@0.2.0` artifact contains every source feature. Named policy is covered in [profiles](profiles.md), routing in [model routing](model-routing.md), and child authority in [Agent presets](agent-presets.md).
4
4
 
5
- `/deepwork [off|message]` changes the receiving session's mode. `/dsmm-status` reports bounded normalized state; `/dsmm-status json` returns a defensive JSON snapshot with version 1. Other input returns `Usage: /dsmm-status [json]`.
5
+ ## Deployment layers and native editors
6
6
 
7
- Human-facing status/mode copy uses Deepwork. Technical commands, JSON fields and configurable `modeName` remain unchanged. In the stage A working source, the **Deepwork** toggle controls common workflow and DSMM skill visibility with one activation decision: ordinary presets are opt-in/effective-default, official minimal defaults off, and DW roles default on only until a saved explicit `deepwork/mode` choice. Even a same-default choice persists; this intent survives profile changes and reopen. DW roles are no longer locked; explicit off does not remove persona/read-only/Git/host permissions. Busy commands are rejected instead of mutating an open turn or silently queueing a pre-step change. The header's existing idle/CAS path remains authoritative. This source change does not claim publication, installation or Config UI acceptance.
7
+ Effective settings resolve from **defaults → sparse global base → explicit native entry/profile override → admitted immutable named overlay**. The global base is `<resolvedDshHome>/plugins/dsmm/config.json`; a missing file is an empty layer. This is DSMM's storage convention, not a mandated Host layout. Trusted home resolution uses explicit `profileContext.home`, then `DSH_HOME`, then the official home default.
8
8
 
9
- Commands belong to the native command adapter. Headless task text is not a slash-command invocation.
9
+ <a id="native-plugins-configuration-d"></a>
10
10
 
11
- ## C0 layered deployment configuration
11
+ **Plugins → DSMM** edits the global base through fixed `remote.dsmmConfig`. The DSMM bundle and actual row Config pages also offer the current native-profile override through the public `ConfigPageForm`. Runtime entry ID, package ID, row ID and form namespace aren't interchangeable. A profile write requires the actual namespace, descriptor revision and matching raw base/user provenance. If that identity isn't available, the profile editor is unavailable or read-only; it never falls back to Global. The standalone Plugins item has no supplied profile form.
12
12
 
13
- The working source remains version **0.1.9**. C0 supplies centralized storage/sparse inheritance/immutable capture; C consumes those boundaries for native role policy, continuation/background and startup MCP. D0 adds the global Deepwork module ceiling. D adds the actual native Plugins pages below, with isolated rc.2 Web browser evidence. Publication, private migration, final artifact gates and actual Electron acceptance remain separate.
13
+ Global and native-profile controls have independent Save, Refresh and Discard actions and revisions. There's no Save all or cross-layer transaction. Missing keys inherit, explicit same-default values pin, and Unset removes only the edited layer's key, not a higher Host pin. Plain objects merge recursively and arrays replace. Full merged validation follows sparse-layer validation; unknown/prototype keys, non-JSON values and raw volatile refs refuse.
14
14
 
15
- Effective composition is **built-in defaults → sparse global deployment base → explicit native DSH entry/profile overrides → applied immutable named-profile/session overlay**. The global base is `<resolvedDshHome>/plugins/dsmm/config.json`, a UTF-8 JSON object containing only explicit DSMM fields. A missing file means an empty layer. The native entry remains a separate sparse layer in the active profile's Cordis configuration, not a copy of merged defaults. Named Profiles are runtime overlays, not another deployment layer editor.
15
+ Native structural controls and bounded schema-aware Advanced JSON cover applicable deployment settings. Advanced input is strict JSON, not named-document JSONC. Invalid text and conflicts stay visible. Refresh preserves dirty input and its original revision; explicit discard/reload rebases it. Connection replacement, disconnection, entry replacement and disposal fence old writes. Saving doesn't restart, cancel, apply a named profile or respawn LSP.
16
16
 
17
- `src/dsh-home.ts` resolves the public `resolveDshHome` export through `createRequire` anchored at the declared `dsh-skill-filesystem` peer. Priority is explicit trusted `profileContext.home`, then `DSH_HOME`, then the official `~/.dsh` default. Resolution failure is explicit, not a fallback to a developer's global SDK. **`home/plugins/dsmm` is DSMM's convention, not an official mandated plugin layout.** `profileContext.dir` identifies the native profile; it isn't used to guess home.
18
-
19
- `DSMM_CONFIG_SCHEMA` remains the plain sparse public ABI. Native Loader `Config` uses the separate `DSMM_NATIVE_CONFIG_SCHEMA`, with flat optional volatile transport fields. Full business defaults and validation apply after layer resolution, not as transport defaults. Legacy raw flat callers keep every explicit value, including a value equal to the built-in default. The removed `settings.register()` namespace and old `$DSH_HOME/settings.yaml` aren't DSMM storage interfaces.
20
-
21
- Direct public `Config(input)` calls return plain flat data and require complete explicit model-route pairs, preserving `resolveConfig(Config(input))`. Native Cordis consumes the same Config object's Standard Schema protocol to obtain sparse volatile refs. Sparse deployment-layer validation can inherit primary members across global/native layers; their full merge is revalidated. No schema-expanded defaults or resolved refs are used to infer raw presence.
22
-
23
- The snapshot's `profile` is the assembled explicit native entry layer, which can include bundle/home/CLI pins; it isn't a claim that every field came from the editable profile file. When available, `nativeForm.base`/`user` retain the public redacted descriptor provenance and `nativeFormRevision` is its actual CAS. Higher host pins cannot be cleared by profile unset; native ConfigEditor rejects a write whose result is overridden by another host layer. DSMM doesn't inspect private layers or evaluate `!!js` to guess presence.
24
-
25
- The following is an explicit native profile override, not the global file format. Keep existing values when editing a Cordis patch; its `config` replaces the row's config object:
26
-
27
- ```yaml
28
- - id: dsmm
29
- config:
30
- defaultActive: true
31
- modeName: deepwork
32
- workflow:
33
- policy: risk-based
34
- deepseekFlashCalibration: auto
35
- deepseekFlashDefaultReasoningEffort: high
36
- deepseekFlashMaxReasoningPresets:
37
- - dsmm-plan-critic
38
- - dsmm-reviewer
39
- runtimeRecovery:
40
- enabled: false
41
- lsp:
42
- enabled: false
43
- ```
44
-
45
- Plain objects merge recursively and arrays replace whole arrays. Missing keys inherit; an empty object doesn't erase inherited children. Valid explicit `false`, `0`, `""` and `[]` aren't omission. Unset removes a key only from the edited layer: profile unset restores global inheritance, global unset restores defaults. `null` is accepted only where the field schema permits it. Unknown/prototype keys, non-JSON values, cycles and raw volatile refs are rejected; the complete merged desired settings are validated before startup or admission.
46
-
47
- Native Settings **Deepwork Profiles** / **Deepwork 配置档** remains separate from plugin Config. New named drafts and revisions share `<resolvedDshHome>/plugins/dsmm/profiles/`; selection/session state is scoped by canonical native profile identity and actual DSMM entry ID. An existing current-profile legacy library is strictly read-only, with its original immutable pins retained and its origin shown in the named editor. See [runtime profiles](profiles.md) for formats and origin rules. Neither Web evidence nor these backend contracts proves Electron activation.
48
-
49
- Save changes only the draft. Global Apply pins an immutable revision for **new unscoped Agents only**; existing even-blank Agents retain their admissions. The separate current-session selector uses the native view's actual session ID and idle maintenance/CAS/epoch fences. It changes only that ordinary root and future children; old children retain their old epoch. Cold resume honors an explicit sidecar or, when absent, the current global default. Global reset and session baseline pinning are distinct and leave drafts intact.
50
-
51
- Here, “global Apply/default” means the runtime's scoped named-profile selection, not the shared global deployment file.
52
-
53
- ### Global module ceiling (D0)
54
-
55
- The only recognized module is `deepwork`, controlled by `modules.deepwork.enabled` **only in the global `config.json` layer**:
56
-
57
- ```json
58
- {"modules":{"deepwork":{"enabled":false}}}
59
- ```
60
-
61
- Missing/unset means `true`, preserving existing availability; ordinary-session `defaultActive` still defaults to `false`. This is an allowed upper bound, not a session-mode override and not a pin for every other global field. Native profile/volatile Config, direct legacy flat Config, named profiles and session overlays reject `modules`; unknown module IDs/fields and nonboolean enabled values refuse. Internally resolved/captured settings include the field without becoming an external profile input.
62
-
63
- Core remains installed and usable when Deepwork is off: fixed global configuration read/save, profile storage and immutable captures/CAS, status and mandatory identity/read-only/filter/native-permission fences. A cold-off startup does not register DW persona/common/calibration/workflow skills, role providers/aliases/controls, materialize presets, or mount DW routing/recovery/LSP. It does not delete bundled assets, presets or user data, or withdraw host/project skills, tools, LSP or subagents. A static DW preset may remain visible in the native filesystem picker; choosing it refuses before prompt-body/model execution. Unknown DSMM standing roots also refuse.
64
-
65
- With `guards.scope:"always"`, configured shell safety and Git deny/approval gates remain Core safety, including on a cold-off ordinary root. `guards.scope:"off"` retains its existing optional-guard semantics; mandatory identity/native permissions still apply. DW plan/todo/question/output helpers remain unavailable while the module is off. Genuine native foreign children receive Core identity admission from their exact live parent and captured epoch, without installing DW role tools or granting a generic-spawn bypass to a DW-authorized parent.
66
-
67
- Startup captures the actual DW substrate once. Each new ordinary root admits **latest valid global desired ∩ startup-mounted substrate ∩ existing policy**. Saving off on a mounted Host leaves old busy/idle parents and their future children on their exact captures, while new roots are off. Their generic/directed skills, standing presets, role aliases, continuable resume and mode-on requests cannot bypass the ceiling. Mode-on reports unavailable; saved historical mode intent is retained but never reported effective while the admitted module is off. Idle profile/mode changes only update that root's overlay/intent and do not absorb newer module state. Saving on after cold-off changes desired/pending only: no mount, reconciliation, disposal, cancellation, process launch or restart queue. New roots remain off/restart-required until an independently authorized Host restart. Restoring on does not rebind old off roots.
68
-
69
- For later Config consumers, `DSMM_MODULE_DESCRIPTORS` and `DsmmModuleState` (exported from the package root) are plain static first-party data, not dynamic third-party JS/provider/installer APIs. The additive, no-argument `dsmmConfig.describeModules` uses the same local writable operator authority as `describe`/`save` and reads the latest valid global state; it is not opened to unauthorized read-only carriers. It returns descriptor `{id,label,key}`, global/default desired source, `startupMounted`, `admitted` (`null` without an Agent), next-root admission/reason and pending/reason. `hostBundleEnabled` is explicitly `"unknown"`: installed files, loaded DSMM core, desired DW availability, mounted substrate, admitted module and active mode are different facts.
70
-
71
- `getSettings.moduleStates(agent)`, the optional session-profile response `modules`, and status `modules` project the receiving Agent's capture. `desired.capture` distinguishes `current-global`, `admission` and `startup`: a synchronous admission/status snapshot does not claim to have reread current disk state. D's UI combines the authorized current-global projection with the actual session projection instead of treating captured state as current desired. Native profile form revision/CAS remains separate; there is neither a Root-path RPC nor a cross-layer atomic save.
72
-
73
- ### Native Plugins configuration (D)
74
-
75
- Open native **Plugins → DSMM**, or the installed **DSMM** bundle's page and its
76
- actual **Configure DSMM** row. The item registers `plugins.item`; bundle and row
77
- contributions use `plugins.bundle.config` (`@dsmm/dsmm`) and
78
- `plugins.row.config` (`@dsmm/dsmm#<actual-row-id>`). The public page props are
79
- `view: summary | page` plus optional `form`, not an invented standalone editor.
80
- Bundle pages do not automatically supply a form: DSMM obtains only the server-
81
- verified actual entry namespace's public ConfigForms seat. Row pages match their
82
- supplied native form's namespace, revision and exact base/user metadata. If that
83
- identity cannot be proved, profile controls are unavailable/readonly; they never
84
- fall back to writing Global. Other instances are not cross-written.
85
-
86
- The two editors have independent save/refresh/discard actions:
87
-
88
- - **Global DSMM** uses fixed `dsmmConfig.save(expectedRevision, edits)` and the
89
- actual-byte global revision. A save touches only `config.json`, retaining
90
- untouched sparse fields. It is independently discoverable with no conversation,
91
- named-profile client service or mounted DW substrate.
92
- - **Current DSH profile override** uses the actual native form `mutate` with its
93
- descriptor revision, never its schema-expanded `value` as raw presence. Only
94
- changed fields and explicit unsets are sent. Existing startup-only
95
- `sessionPersistence` is retained unchanged, not made editable or relocated.
96
- - Roles/skills, calibration, workflow/review, guards, routing/retry/recovery,
97
- subagent depth/background, preset materialization and LSP have native structural
98
- controls or bounded Advanced JSON for complete applicable field coverage.
99
- Advanced accepts strict JSON up to 32768 characters, closed known schema,
100
- duplicate/prototype-key rejection and immediate error feedback. Sparse primary
101
- members can inherit lower-layer members; the full merged value is validated.
102
- New providers/accounts/models are not installed or configured here. The existing
103
- native catalog/picker and independent named JSONC editor retain model authority.
104
- - Missing keys **inherit**; explicit same-default values are **default pins**.
105
- Unset removes only this layer, not higher Host pins. Modules' master is only in
106
- Global; profile/named/session controls cannot bypass the ceiling. Only the
107
- static known `deepwork` descriptor exists, not a registry/marketplace API.
108
-
109
- Module summary and the field-source disclosure separate **merged desired**,
110
- **startup-mounted/captured**, **next-root preview** (using the same admission
111
- preparation) and **current session admission**. Without an actual session, current
112
- admission is unknown; host bundle enablement stays unknown when not observable.
113
- Named/global/profile/default source and capture are distinct from raw CAS values.
114
- Cold-off desired-on shows pending independent restart, not success at hot mounting.
115
- Mounted-on desired-off affects new roots, not old parents/future children.
116
-
117
- Read-only `describeSession.configuration`, successful current-session selection,
118
- and `describeSettings` desired/startup/next-root layers use a Host-side defensive
119
- projection, not raw runtime settings or browser-only masking. LSP command,
120
- arguments and working directory, preset root and recovery continuation prompt
121
- use fixed `<configured>` markers; environment names are anonymous `variable-N`
122
- keys and values are `<redacted>`. Environment source/capture metadata is aggregated
123
- under `lsp.env` (mixed origins remain `mixed`), so even key names are not disclosed.
124
- The strict result codecs reject raw private values in those read-only layers.
125
- Actual `getSettings(agent)`, captured admissions and stored configuration are
126
- unchanged. Raw sparse Global/profile/native-form editor input remains available
127
- only through its existing C0 authorized editor boundary; it is not a status DTO.
128
-
129
- The inspector sorts the union of safe desired/startup/next-root/admitted values
130
- and source/capture paths, including fields present only in a named overlay. A
131
- missing field is **Absent**, not an invented built-in value; unavailable layers
132
- are **Unknown**. Startup sources come from the captured deployment when available.
133
- An actual session shows its ID, epoch and scope; a known session without its
134
- configuration projection is distinct from having no session. Apply and Baseline
135
- return the already-committed in-memory admission immediately, without a post-commit
136
- disk read or another validation that could reverse the successful transaction.
137
- Global refresh does not silently rebind or refresh a session admission. Dirty
138
- drafts/conflicts visibly remain separate from these captured revisions.
139
-
140
- Refresh preserves dirty edits and their original revision. A stale revision is a
141
- visible conflict; explicit **Discard draft and reload** alone rebases. Invalid
142
- numeric/JSON input stays visible and disables save. Entry changes, disconnection,
143
- connection-generation replacement and disposal fence old writes; no retry/rebase
144
- loop or common Save-all is used. Errors are localized sanitized allowlisted
145
- messages, never raw paths/arguments/environment/provider tokens; saving/success
146
- uses accessible busy/polite live feedback and native keyboard/focus behavior.
17
+ LSP isn't an applicable UI setting in this version. Its implementation, interfaces and original configuration remain, but DSMM settings hide LSP controls and automatic MCP mounting stays off even with stored `lsp.enabled:true`. Neither a save nor a restart enables it. DSH's own LSP and independently configured MCP are unaffected; the retained historical manual patch isn't a supported DSMM activation entry. See [LSP boundary](lsp.md).
147
18
 
148
19
  ### Save authority and concurrency
149
20
 
150
- The fixed `dsmmConfig` Remote backend exposes `describe`, `describeModules`, `describeSettings` and `save` for exact set/unset edits with an expected global revision. It accepts no file, root or entry arguments and isn't a model-visible tool. All operations require a local writable control operator: the native invocation peer must equal `connection.operator`, the public current `webServer.host` must be exactly `127.0.0.1`, and `settings.writable` must be `true`. Unknown or remote/nonloopback carriers are unavailable; client `isLoopback` isn't authority. Reverse proxies and tunnels aren't automatically proven safe. Save rechecks lifetime/connection authority before commit, so disconnect or disposal cannot authorize a late write. Core owns the existing Typert descriptor contribution once; global configuration service lifetime does not depend on the DW/profile UI service mounting.
151
-
152
- Reads create no directory, lock or config file. Saves use bounded safe file access, the actual bytes' SHA256 revision (or a distinct absent revision), a cooperative writer lock, final revision recheck and same-directory temporary-file rename. Stale or invalid input fails closed instead of overwriting it. Non-cooperating external editors can still race between the final recheck and rename; this isn't a universal external-editor transaction.
153
-
154
- Global save changes only `config.json`: no profile patch, Loader reload/patch/dispose, cancellation or automatic profile apply. Native profile saves use only the volatile transport, with native authorization and entry CAS. The two layers have separate revisions and no cross-layer transaction. A save response acknowledges that layer, not that every running consumer has adopted it.
155
-
156
- **Native signal distinction:** the rc.2 ConfigEditor/Include forced empty-pending reconciliation path emits the compatibility `loader/partial-dispose` signal even when it doesn't update or dispose a fiber. The real regression observes that signal while proving retained refs/fiber/services, zero actual scope/Agent disposals or updates, and completion of the original busy request. The signal alone isn't a lifecycle acknowledgment; no SDK patch, signal filtering or automatic restart hides it. Consumers must use actual lifetime/admission boundaries rather than treating this signal as disposal proof.
21
+ `dsmmConfig.describe`, `describeModules`, `describeSettings` and `save` use the existing local writable operator boundary. The native invocation peer must equal `connection.operator`, public `webServer.host` must be exactly `127.0.0.1`, and `settings.writable` must be true. A client loopback assertion, tunnel or reverse proxy isn't authority. These aren't model-visible tools and accept no arbitrary file, root or entry arguments.
157
22
 
158
- ## Workflow compatibility
23
+ Global saves use expected actual-byte revision, cooperative locking, a final revision recheck and same-directory atomic replacement. Authority and lifetime are rechecked before commit. Native-profile saves use public form mutation and descriptor CAS, not a hash guessed to be native CAS. External non-cooperating editors can still race at the final rename boundary. A save acknowledges its layer, not adoption by every live consumer.
159
24
 
160
- `workflow.policy` selects `risk-based` or `legacy`. An explicit policy wins; old explicitly supplied `strictGates`, `reviewCap`, or `finalReviewPolicy` selects legacy behavior when policy is omitted. With neither new nor legacy controls, risk-based behavior is the default. Schema parsing preserves this distinction.
25
+ Native ConfigEditor can emit `loader/partial-dispose` during empty-pending reconciliation without actual fiber or Agent disposal. The signal alone isn't proof of a lifecycle change; consumers must observe actual lifetime and admission boundaries.
161
26
 
162
- Risk-based behavior scales discovery, planning, and review to uncertainty and integration risk. Legacy fields remain readable in the normalized snapshot, but are not a universal fixed-review loop under risk-based policy.
27
+ <a id="global-module-ceiling-d0"></a>
163
28
 
164
- ## Other settings
29
+ ## Availability and capture
165
30
 
166
- `roleRouting` defaults to an empty map. Each canonical role accepts optional `primary`, ordered `fallbackRoutes`, `strategy` and bounded `rateLimit` fields. Profile-level `runtimePolicy` supplies inherited strategy/retry defaults. Child Agents use their configured startup lock or explicit per-role rate-limit rollover. Ordinary top-level Agents instead preserve the native model tab's exact model/effort and only retry on that same route. Native catalog/form controls edit JSONC paths without changing native global model defaults. The compact header menu has one profile list and one `@use-model` **Use profile model** action; a normal profile switch never selects a model. The action reads the current admitted immutable profile model without reapplying a later saved revision, uses native-default persistence like the Models tab, and preserves newer manual intent through existing race fencing. Successes are accessible live announcements only; visible errors are short sanitized codes/fields, not verbose normal menu descriptions. The deployment-only `roles` enable map remains separate. Unknown keys/malformed routes fail; omitted and explicit empty chains differ. See [model routing](model-routing.md) and [runtime recovery](runtime-recovery.md).
31
+ `modules.deepwork.enabled` is a global-only ceiling and defaults true; ordinary `defaultActive` defaults false. Native profile overrides and named/session overlays can't enable the module. Cold-off leaves Core storage, captures/CAS, configuration/status and mandatory native permissions available, without mounting DW role/routing/recovery substrate. DSMM-managed LSP stays off independently of this module ceiling. Static preset files aren't proof of callable roles.
167
32
 
168
- `DEFAULT_DSMM_SETTINGS` supplies the complete business defaults; the public sparse schema doesn't expand them into overrides. The current inventory has 22 roles/categories and 14 configurable skills, with cross-cutting opt-in/default false. Active Agent scopes expose enabled DSMM skills as native metadata/lazy bodies; explicit off wins even on a DW preset. Roles/skills remain outside named runtime profiles. Managed preset-directory materialization remains off by default and is an export facility rather than native discovery. Content/catalog presence doesn't prove the remaining C execution mechanisms.
33
+ On a mounted Host, desired-off affects new roots, not existing parents or their future children. Desired-on after cold-off remains restart-required until an independent Host restart. No hot-mount or restart queue is implied. An idle profile change doesn't absorb newer global deployment. Mode-on can't bypass an admitted off module; mode-off can replace saved on intent without pretending the module was active.
169
34
 
170
- Runtime overlays allow only `defaultActive`, `roleRouting`, `runtimePolicy`, `workflow`, `guards`, `runtimeRecovery`, and both `deepseekV4Pro*`/`deepseekFlash*` Calibration, DefaultReasoningEffort and MaxReasoningPresets fields. `modules`, `roles`, `skills`, `modeName`, `promptOrder`, `section`, `presets`, `subagents`, `lsp`, `sessionPersistence`, native provider/account/install controls, embedded profiles and unknown fields are rejected. A missing named-profile selection leaves the captured deployment baseline unchanged. Auth and native session logs stay in their existing locations; centralized storage doesn't move them or expand `sessionPersistence` authority.
35
+ The inspector separates merged desired, startup-mounted/captured, next-root preview, and current-session admission. Without an actual session, current admission is unknown. Host bundle enablement also remains unknown when the public interface can't observe it. Sources, capture origins, global bytes revision, native descriptor revision and named pin aren't one acknowledgment.
171
36
 
172
- `subagents.enableRunInBackground:false` and `backgroundMode:"one-shot"` default to foreground one-shot. Explicit opt-in can use native jobs or continuable children. Omitted `maxDepth` uses the host default (rc.2 1); explicit nonnegative integer limits remain native-enforced. These sparse deployment fields capture at new-root admission and remain frozen for old parents/future children. Missing startup jobs/control/persistence/provider substrate yields `restartRequired: ["subagents"]` and effective background disabled, not fabricated readiness. No new queue/controller is created.
37
+ `presets.plannerRootEnabled` defaults false and controls only the standing DW Planner root preset, not the default-enabled workflow Planner role or Harness's native plan mode. Like the rest of `presets`, Global/native-entry settings may configure it, named overlays cannot, and desired changes require an independent restart; current Agents are not hot-migrated. See [Planner root admission](agent-presets.md#roles-and-composition) for discovery, forced creation/resume and read-only boundaries.
173
38
 
174
- ## Capture and restart boundaries
39
+ `permissionControl.enabled` defaults true independently of Deepwork. Permission settings are deployment-only: Global and native-profile settings may save them, while named/session overlays cannot. Only `enabled` is startup-pinned: live saves do not remount or change its admitted value, including for newly created roots; a difference is reported as `permissionControl.enabled` restart-required. A separate cold start captures the new toggle. Dynamic outside-read, web and persistent rules require runtime revision synchronization rather than restart. OFF does not disable Core guards, readonly, native sandbox/approval or tool filters. Configuration and startup admission do not establish that a permission executor is mounted or synchronized. Actual native standing `danger-full-access` is full access: DSMM adds no ask, downgrade, path permit or refusal for unknown operations or missing classification facts. Only a deterministically matched existing explicit deny blacklist may produce a native pre-approval denial. A requested mode or configured command target alone isn't effective native authority. See [native permissions](native-permissions.md).
175
40
 
176
- Startup awaits global/profile read, merge and validation before any consumer mounts. The startup snapshot is frozen. Persistent registration, standing presets, `modeName`, `promptOrder`, preset materialization and LSP retain startup settings; late dependency install/injection doesn't reread desired settings.
41
+ The rules RPC writes the global DSMM layer. A native override of outside-read, web or rule policy refuses that RPC save; edit or unset the native override instead. An enabled-only native override does not shadow dynamic policy. Ordinary configuration Save still writes its chosen layer, and the runtime uses the resolved global/native policy rather than assuming every global edit wins.
177
42
 
178
- When a native preset registry already exists, its frozen startup definitions finish registering before retained ordinary Agents are audited/admitted. Optional absent registries retain the existing late-install lifetime path, using that same startup getter. Direct trusted Cordis callers without a Loader entry use the stable `trusted-direct` namespace; fiber allocation never becomes a persisted entry identity.
43
+ The Host installs `installDeploymentPermissionRules` in its owned Core fiber with `agents` injected, the actual `DsmmDeploymentConfig`, a pure writable-Root check and an awaited notification callback. Its `initial` snapshot, `runtime` sync owner and backend are the collaborators for the permission controller and the single permissions RPC. DSH owns approval: an actual manual approval is final for that call and approved scope, without a DSMM post-approval veto from older rules, epochs or internal gates. DSMM has no independent approval queue, UI, TTL or session permit memory. The ordinary `managed-settings` module retains native SettingsForms and supplies only a scoped `configEditor.edit` façade; the root ConfigEditor and its locks, form CAS and reconciliation remain native-owned. Missing or retired ownership refuses managed saves, not an actually approved call. These source interfaces require the corresponding cold Host composition; configuration alone is not mounting evidence.
179
44
 
180
- A new ordinary root awaits the latest valid global/profile desired deployment and combines it with the applied immutable named overlay, never a later draft. Existing roots retain their entire captured snapshot, including blank/idle roots. Future children of an old parent inherit that parent's complete snapshot and epoch rather than today's desired settings. An explicit idle session-profile switch replaces only the allowed runtime overlay on that root's old deployment baseline.
45
+ Permission revisions are opaque tokens over the persistent global CAS and native configuration read set, not form counters or per-rule version maxima. Controlled saves reread actual storage after CAS and publish only after notification acknowledges the committed policy. No-op saves may retain the token. Notification failure exposes saved/runtime revisions as unsynchronized; recovery rereads authoritative storage. CAS, ownership and synchronization checks protect configuration writes and policy adoption, not a second call-approval gate: permission-source changes neither cancel pending native approval nor let DSMM override an actual same-call approval. New calls consume current policy. Conflicts and recovery preserve dirty editor drafts. Native and ordinary JSON rule imports receive `user-import` provenance, while rules RPC provenance comes from the live operator authority. Persistent provenance isn't native approval or a reusable grant. A native once grant doesn't widen session permissions or authorize another call, and a narrower grant isn't full access. Native rejection, caller/native cancellation and original OS failures remain possible; approval doesn't guarantee command success. Only `enabled` remains pinned to the mounted runtime; a desired OFF cannot turn off running controls before restart.
181
46
 
182
- New-root capture validates schema/file safety and standing startup capabilities, not every dormant role's model catalog entry. Native root requests retain the model tab's authority; child/alias preflight owns exact candidate selection, fallback and hard effort refusal before requests. Named selection/current-session Apply and retained-Agent startup admission keep their full semantic catalog audits and readiness guards. Capture isn't an automatic model-selection action or a promise that every declared role route is callable.
47
+ Read-only configuration projections redact LSP command/arguments/cwd, preset root and recovery prompt; environment values and names aren't disclosed. Authorized sparse editor input is a separate boundary, not a status DTO. A missing projected field is absent; an unavailable layer is unknown, not an invented default.
183
48
 
184
- Role enable policy is constrained by the startup substrate and original permissions. A capability absent at startup is restart-required, not made available by saving desired settings. No restart/idle queue exists. Desired off isn't a claim that old admitted work was cancelled.
49
+ ## Runtime controls
185
50
 
186
- `getSettings(agent)` is the authority for an existing Agent. No-argument `getSettings()` remains the validated runtime named default, not raw desired settings. Invalid external edits refuse new admissions and writes without invalidating old frozen admissions. Cold resume creates a new admission from current valid desired deployment and the correct origin's pinned sidecar/default; it doesn't promise persistence of an exited process's old memory snapshot.
51
+ `/deepwork [off|message]` changes the receiving session's mode. Explicit intent, including a same-default choice, survives profile changes and reopen. Official minimal conversations default off; DW presets default on unless explicit intent says otherwise. Off hides common workflow/DSMM skills, not persona, read-only restrictions or host/Git permissions. Busy mutations refuse instead of queuing. Slash commands belong to the native command adapter, not headless task text.
187
52
 
188
- Existing `deepseekV4ProCalibration`, `deepseekV4ProDefaultReasoningEffort`, and `deepseekV4ProMaxReasoningPresets` remain compatible for child Agents. Flash has independent corresponding `deepseekFlash*` settings; calibration modes are off/auto/strict. Auto preserves explicit effort, strict chooses supported policy effort, and unsupported capabilities never justify guessed parameters. Ordinary root effort is always native-owned, including when a calibration setting says strict.
53
+ `/dsmm-status` reports normalized bounded state; `/dsmm-status json` returns a defensive version-1 snapshot. Status separates admitted profile/revision/epoch, actual route state, effective settings and captured module/runtime binding. Ordinary roots report native-owned effort and keep the native model tab's route, not an applied child-role primary. `profileModel` is advisory for explicit **Use profile model**, never proof that selection already happened.
189
54
 
190
- Guard scope defaults to `deepwork-or-dsmm-agent`; shell safety and helpers remain enabled and Git writes require host approval. LSP and runtime recovery default off. Recovery caps are finite; an empty fallback list does not enable automatic model discovery or substitution.
55
+ `workflow.policy` accepts `risk-based` or `legacy`. Explicit policy wins. Without it, explicitly supplied `strictGates`, `reviewCap` or `finalReviewPolicy` selects legacy; otherwise risk-based is the default. Named role restrictions retain required Orchestrator/Planner/Plan Critic, plus legacy-conditional Reviewer/Oracle. They can't enable a role outside startup/deployment ceilings.
191
56
 
192
- ## Snapshot boundaries
57
+ `roleRouting[id].levels` accepts only explicit `low`, `high` and `max` overrides; invocation omission means `normal`. These are call resources, not workflow tiers or generated roles. `subagents.toolTopology` defaults `per-role` and may be narrowed/configured in a named overlay. Background, depth and route-override permission remain deployment-only. `subagents.allowRouteOverride` defaults false. See [routing](model-routing.md) for the exact tool and target grammar.
193
58
 
194
- The snapshot reports `mode`, `route`, `calibration`, `runtimeRecovery`, and `effectiveSettings`. Route flags distinguish exact V4 Pro and V41 Flash matches. Desired policy effort is not a claim that an adapter advertised or applied it.
59
+ `locale` is an optional visible-output preference using the supported locale IDs in [profiles](profiles.md#inheritance-and-ceilings). Omission inherits; the current user's explicit language request wins. It doesn't change UI locale or protocol vocabulary. Both retired `*MaxReasoningPresets` fields reject with `deprecated-field`; there is no automatic migration. The only nonblocking document warning is `blank-label`, with schema-safe diagnostics and source location where available.
195
60
 
196
- Status does not perform capability/network queries, expose credentials or provider errors, or report process-local pending retries. Model calibration is enforced in the actual request waterfall, not by status or prompt text.
61
+ ## Child runtime composition
197
62
 
198
- Status masks configured preset/LSP working-directory paths, all LSP command/argument contents and LSP environment values with fixed markers; runtime LSP settings aren't changed. The trusted backend's `describeDeployment()` retains separate plain startup, desired and admitted snapshots, with the raw native input hash and optional native form CAS revision explicitly distinguished. `deployment.sources` describes desired input; admission `sources` describes effective values after startup pins/role constraints and named overlays. `sourceCaptures.fields` identifies startup versus captured deployment versus named-session origins, and its startup revision pair prevents attributing pinned values to the newer desired revision.
63
+ Default deployment uses foreground one-shot work: `enableRunInBackground:false`, `backgroundMode:"one-shot"`, and omitted `maxDepth` delegates to the native Host limit. Captured settings and actual startup capabilities determine availability. A configured flag isn't proof that jobs, persistence, continuation or delivery fencing is ready.
199
64
 
200
- A named overlay's complete primary route replaces its lower primary, including removal of omitted effort. Effective provenance removes that entire replaced primary subtree before marking the overlay; nonexistent lower-only members aren't left in `sources` or capture fields.
65
+ The 0.3.0 build exports `@dsmm/dsmm/agent-registry` (`./agent-registry`) and `@dsmm/dsmm/subagent-runtime` (`./subagent-runtime`) for explicit cold-start composition. The bundled [patch](../cordis.patch.yml) disables the exact stock Agent and Subagent rows and installs one DSMM owner for each service before Main. Verify settled Loader identities and actual service constructors, preserve spawn/fork/model/Gateway services and explicit capacity/depth configuration, then restart. Missing or duplicate ownership refuses; there is no hot replacement or automatic runtime selection.
201
66
 
202
- Configured role policy/chain and the actual persisted current route are distinct facts. The normalized settings snapshot defensively copies nested role routes and lists; configuration presence is not a claim of successful provider authentication or a completed fallback.
67
+ The public runtime projection reports `binding: stock | dsmm | unavailable`, `deliveryFenceReady`, `restartRequired`, and a bounded reason when applicable. Loading Core, saving settings or seeing a role catalog doesn't prove fenced delivery. Managed continuation requires the explicit ready composition. Native lifecycle, inbox, jobs and storage remain native-owned; DSMM doesn't install a second scheduler or retry controller.
203
68
 
204
- For ordinary roots, effective status reports `startup-lock`, no applied profile primary/fallback chain, and reasoning action `native-owned`. The original child-role configuration remains available under `effectiveSettings`; it is not falsely presented as an automatic main-model override. `profileModel` in a session-profile response is only the declared model for an explicit user action, never proof that the native model has already changed.
69
+ 0.3.0 accepts only current version-3 child captures. Old or incomplete capture evidence refuses without falling back to current parent settings, role labels, or fabricated approval/durability guarantees. The legacy-read adapter is not exported or composed. See [compatibility](compatibility.md#retired-compatibility-surfaces).
205
70
 
206
- Status describes the receiving Agent's admitted profile/revision/epoch, resolved strategy/retry policy and actual route state separately from desired deployment and future named defaults. Global bytes revision, native entry revision, startup capability and store origin are distinct facts, not one atomic cross-layer acknowledgment. `--dump-config` shows native Loader composition, not the complete global-aware DSMM effective snapshot or proof of runtime-profile application/authenticated UI behavior. D's field-level native presentation has isolated rc.2 Web evidence; final artifact/publication and actual Electron acceptance remain separate.
71
+ *Author's note: For a DSH deployment operator; distinguish a successful configuration save from captured runtime availability before applying policy.*
@@ -1,16 +1,20 @@
1
1
  # DSMM source-content synchronization
2
2
 
3
- The source baseline is OCMM `89ca14b`, with DSH fixed to **0.2.0-rc.2**. This is full-content adaptation, not short personas. The maintenance inventory lives in `scripts/source-inventory.mjs`; generated `prompts/source/manifest.json` records actual source → artifact → consumer, source anchors, adaptation rules, canonical role/skill inventories, attribution and exclusions. Runtime uses package-relative assets only; it never requires an OCMM checkout, global SDK path or maintenance compiler.
3
+ DSH is fixed to **0.2.0-rc.2**. Source synchronization reads the committed **DSMM-owned `source-inputs/` snapshot**, never a live or historical OCMM Root fallback. Explicit maintenance refresh captures raw bytes from the Root worktree. `source-inputs/manifest.json` records the actual full Root baseline commit and the paths whose raw Git blobs differ from that baseline, including uncommitted/untracked worktree content or checkout byte differences. The captured baseline is `3b680211feeb93508b3817546f37bee2291c402b`; raw-byte `overlayPaths` do not by themselves claim uncommitted semantic changes or a new Root commit. Generated `prompts/source/manifest.json` derives `sourceRef` from that captured baseline and retains the overlay provenance. This is full-content adaptation, not short personas. The maintenance inventory lives in `scripts/source-inventory.mjs`; the generated manifest carries the actual source → artifact → consumer, source anchors, adaptation rules, canonical role/skill inventories, attribution and exclusions. Runtime uses package-relative prepared assets only; it never requires the raw snapshot, an OCMM checkout, global SDK path or maintenance compiler. Root AGENTS, Codex bundles and user/provider/model configuration are not synchronization inputs.
4
+
5
+ The raw closure is limited to the two catalog TS files, `src/hooks/config.ts`, prompt-loader/model-family assembly anchors, shared shell safety, the explicitly selected v1 role/category/workflow Markdown, and the fourteen selected recursive skill resource trees. `source-inputs/root/` preserves their actual bytes; no whole-Root copy, runtime import of Root code, extra ledger or whole-repository hash is used. The one input manifest binds paths, byte lengths and SHA-256 digests for source/resource integrity. Snapshot `.gitattributes` disables Git text conversion for `root/**`; DSMM's local `.gitattributes` also preserves prepared source prompts, skill resources and `src/skills.ts` bytes through Git checkout. Excluded frontend attribution/license inputs are supplied by DSMM's existing fixed-pin recipe, not copied and falsely claimed as consumed Root inputs.
4
6
 
5
7
  ## Inventories and assembly
6
8
 
7
- Primary/all personas also retain the actual source default `buildLocaleGuidance` prefix: infer the user's language, preserve identifiers/quotes, and respect any explicit host locale. This introduces no DSMM locale setting or private host-config lookup.
9
+ Every role/category persona adapts the source default `buildLocaleGuidance` prefix for visible output. `buildDsmmLocaleGuidance` and `buildDsmmAgentGuidance` add the exact Agent's immutable captured `settings.locale`: `en`, `zh-Hans`, `zh-Hant`, `ja`, `ko`, `de`, `fr`, `es`, `pt-BR`, or `ru`. Omission inherits applicable host/user language guidance, otherwise the request/context; it is not an English default. The current user's explicit output-language request wins. Preserve code, identifiers, paths, commands, protocol fields and exact quotations; child assignments retain explicit language instructions. A later parent Apply does not rewrite an old child's captured preference. No Root session preference, private host-config lookup, internal reasoning-language guarantee or host/project locale change is supplied.
8
10
 
9
11
  The 11 base roles come from `src/data/agents.ts`; the 11 categories come from `src/data/categories.ts`. Oracle slots reuse the full reviewer source. Builder/code-search/doc-search/media-reader have no standalone source role Markdown: their actual catalog responsibilities, source workflow and terminal TS policy are consumed, not invented personas. Existing `dsmm-creative` remains the one creative category. All 22 have stable metadata and templates; cross-cutting alone defaults off. File existence is never callable evidence.
10
12
 
11
- `src/prompt-content.ts` is a content-only package loader; it avoids a roles → prompt/model-routing initialization cycle. Role/category bodies and source `terminalPromptSuffixFor` policies are assembled into persona once. Category `<model-calibration>` blocks are removed from persistent persona and selected separately. The active common section preserves the full default workflow; model guidance is additive and subordinate to persona, permissions and output contract. Planner adds its source doctrine; Opus 5/5.5 calibration is orchestrator-only; GPT/Codex gets the shared GPT layer once; Gemini/GLM, exact Kimi Code aliases and SWE-2 retain their applicable full source guidance. The v1 Codex variant is adapted tool compatibility, not a separate Codex host or adapter behavior stack.
13
+ `src/prompt-content.ts` is a content-only package loader with no settings/model-routing runtime dependency. Role/category bodies, shared language priority and source `terminalPromptSuffixFor` policies assemble into persona once. Category `<model-calibration>` blocks are removed from persistent persona and selected separately. `src/prompts.ts` also keeps calibration assembly independent of the provider/routing graph. The active common section preserves the full default workflow; model guidance is additive and subordinate to persona, permissions and output contract. Planner adds its source doctrine; Opus 5/5.5 calibration is orchestrator-only; GPT/Codex gets the shared GPT layer once; Gemini/GLM, exact Kimi Code aliases and SWE-2 retain their applicable full source guidance. The v1 Codex variant is adapted tool compatibility, not a separate Codex host or adapter behavior stack.
14
+
15
+ The current Root sources preserve final-state artifacts and functional/interface regression evidence, orchestrator-owned complex product planning, direct routine non-product work, bounded useful delegation, and material-relevance evidence reuse. DSMM retains those requirements in full while adapting native read-only planner persistence, lazy skill loading, tool topology, per-invocation resource selection and lifecycle authority. Common mode off withdraws workflow/DSMM skills only; persona, read-only, Git authorization and scoped language guidance remain independent.
12
16
 
13
- The fourteen skills are brainstorming, writing-plans, requesting-code-review, receiving-code-review, subagent-driven-development, dispatching-parallel-agents, remove-ai-slops, debugging, frontend, git-master, ast-grep, coding-agent-sessions, init-deep, and using-git-worktrees. **Actual canonical remove-ai-slops is `skills/remove-ai-slops`**, not a nonexistent v1 copy or generated Codex/DSMM summary. Its ten cleanup categories and green regression protection remain; arbitrary batches, LOC splitting, redundant tests, forced status tokens and unauthorized Git restore are adapted to bounded evidence-led cleanup.
17
+ The fourteen skills are brainstorming, writing-plans, requesting-code-review, receiving-code-review, subagent-driven-development, dispatching-parallel-agents, remove-ai-slops, debugging, frontend, git-master, ast-grep, coding-agent-sessions, init-deep, and using-git-worktrees. **Actual canonical remove-ai-slops is `skills/remove-ai-slops`**, not a nonexistent v1 copy or generated Codex/DSMM summary. Its ten categories protect final valid requirements and committed contracts with passing functional/interface evidence, not uncommitted transition behavior or descriptive-text locks. Routine maintenance resolves directly; coordination stays in session. Arbitrary batches, LOC splitting, redundant tests, forced status tokens and unauthorized Git restore are adapted to bounded evidence-led cleanup and corrections of task-owned edits.
14
18
 
15
19
  ## Lazy native resources
16
20
 
@@ -20,22 +24,55 @@ The Stage A ancestor snapshot/precedence, incomplete-observation refusal, invoca
20
24
 
21
25
  The published 0.1.9 `./preset-skills` export retains its minimal Config/name/inject/apply compatibility shape; apply itself registers nothing. Its module is not dead: the main entry still calls the actual `registerAgentSkills` there, with unchanged registration/lifecycle. Likewise, `renderAgentCordis` and the shared renderer retain their ignored optional skills argument in its original second position so existing enabledRoles/roleRouting callers do not shift. Native Agent configuration controls visibility. This is a bounded public compatibility ruling, not a future provider/wrapper or remaining removal blocker; no module/function has been moved to another helper.
22
26
 
23
- ## Reproduce and check (maintainer checkout only)
27
+ ## Refresh, reproduce and check
24
28
 
25
- Use existing Node/TypeScript/pnpm. A new checkout first needs explicit fixed-pin frontend materialization; this fetches only approved documentation/CSV/Python/license bytes and executes no third-party code or installer:
29
+ Use existing Node/TypeScript/pnpm. To deliberately adopt reviewed Root worktree changes, run from `dsmm/` with the existing complete fixed-pin frontend library:
26
30
 
27
31
  ```powershell
28
- pnpm run sync:source
29
- pnpm run sync:frontend # explicit network operation; no HEAD/alternate pin fallback
30
- pnpm run sync:source # records validated frontend provenance in the manifest
31
- pnpm run build
32
- pnpm run generate:roles
33
- pnpm run check:source
32
+ node --experimental-strip-types scripts/source-inputs.mjs --refresh
33
+ pnpm run sync:source # adapts the sealed snapshot; never refreshes it implicitly
34
34
  ```
35
35
 
36
- During development use direct targeted Node tests and typecheck. `sync:source -- --check` compares source-adapted results without writing; `generate:roles -- --check` checks renderer output without writing. Sync writes changed artifacts only; a second run must report no differences. An anchor mismatch fails before artifacts are written; do not silently accept changed source assembly. Update the baseline, mapping/rules and useful regressions together after reviewing a source change. Do not hand-edit generated prompt/source assets, skills or presets.
36
+ Refresh reads only the declared closure twice and compares raw bytes, path inventory and baseline provenance. A changed capture gets at most one consistency retake; continued drift fails before snapshot writes. The destination's existing parent and all ancestors must be regular directories. An existing snapshot must validate completely, including both metadata files and every raw input; dangling/live links, malformed directories, unknown entries and integrity drift are refused before mutation. Refresh writes exclusively into a new task-owned sibling candidate, loads that candidate and runs the adapter's catalog, permission/assembly anchors and adapted resource-closure checks there. It rechecks the existing snapshot before same-parent rename publication and restores the untouched original on publication failure. Unknown existing content is never deleted as a refresh repair. A failed rollback preserves the original backup and reports its location rather than cleaning it away; post-commit staging cleanup limitations are reported explicitly. Review and commit the entire refreshed snapshot, adapter changes when needed, and prepared targets together through the authorized commit owner. Missing, additional, changed, linked or non-regular snapshot inputs fail closed; source check never repairs them from Root. A stale prepared resource not in the current output inventory is a failure and must be reviewed/removed explicitly, not silently retained or deleted by sync.
37
+
38
+ CI and a cold released checkout use the tag's own adapter/generator and committed snapshot by default:
39
+
40
+ ```powershell
41
+ pnpm run sync:source # optional rebuild of prepared source targets from sealed inputs
42
+ pnpm run build # coordinated build owner; offline frontend integrity gate first
43
+ pnpm run generate:roles # coordinated renderer owner, after build
44
+ pnpm run check:source # read-only regenerated byte comparison plus resource gates
45
+ ```
46
+
47
+ `node --experimental-strip-types scripts/sync-source-assets.mjs --check` regenerates all source-adapted bytes in memory and compares them to prepared targets without writing. It checks inputs before targets, rather than hashing targets alone or skipping source drift. `node scripts/generate-role-assets.mjs --check` separately checks renderer output. `check:source` requires both comparisons and the actual resource/fixed-pin gates; a passing source-only comparison is not full build/renderer/release completion. Prepared targets must retain their generated bytes in the released checkout, without text-conversion filters; `src/skills.ts` retains its existing surrounding source while regenerating the metadata section.
48
+
49
+ Direct regression checks do not emit shared `lib/` or presets:
50
+
51
+ ```powershell
52
+ node --import ./test/prompt-source-loader.mjs --test --experimental-strip-types --test-concurrency=1 test/source-inputs.test.ts test/source-sync.test.ts
53
+ ```
54
+
55
+ These checks commit the DSMM source snapshot and prepared targets in a disposable fixture repository, then clone and execute that checkout's generator with no Root catalog/policy/prompt/skill checkout, using only the already-installed compiler. The cold Git-only clone first refuses absent ignored frontend resources. Once the already-verified fixed-pin library is delivered, check and fresh regeneration must reproduce every adapted byte, including a text-converting checkout. Cold regeneration removes every prepared target, including the frontend index, while retaining the authored `src/skills.ts` shell and genuine fixed-pin vendor library. The replay's generated index drives recipe selection, offline vendor validation and resource closure; stale prepared index bytes cannot supply the recipe or mask missing input dependencies. Missing/drifted vendor resources remain fatal before output writes. Checks also exercise raw-input tamper/missing/extra/link refusal, resealed permission-anchor and resource-closure errors, actual metadata regeneration, prepared extra-resource refusal, bounded capture drift, metadata/ancestor link refusal without outside writes, unknown-content preservation and candidate-publication rollback. For current source/native SDK prompt/tool behavior, run `test/prompt-guidance.test.ts test/skills.test.ts` through the same in-memory loader. The resource sync and role renderer remain separate entry points; coordinate shared compiled output/preset generation with its owner. Sync writes changed artifacts only; a second run must report no differences. Do not hand-edit generated prompt/source assets, skills or presets.
56
+
57
+ Cold rebuild needs the existing approved toolchain/dependencies and the **prepared complete frontend fixed-pin library** as well as the committed raw snapshot. Committing the raw snapshot does not deliver ignored third-party bodies. An authorized release/build owner must preserve their delivery to the cold checkout/staging surface; missing bodies or inventory fail offline with no download or older-Root fallback. Separately authorized `pnpm run sync:frontend` can materialize missing fixed-pin resources, but is never an implicit CI/build/check action. No software installation is authorized by these commands.
58
+
59
+ Source Markdown is kept in full, with precise anchored changes and an explicit DSH resource/authority boundary. Native read/glob/grep, web_search/web_fetch, write/edit, bash/pwsh and skill invocation are the tools mapped here; native read uses `file_path`. Exposed `todo_write` replaces the owning Agent's whole content/status list under its actual parallel policy; exposed `ask_user_question` provides questions, otherwise conversation does. LSP, image/browser, documentation services and native controls remain actual-catalog/route capabilities. Host compaction is not OCMM `compress`. No Task, todowrite, compress or Context7 MCP interface is invented. Template fields describe an assignment, not callable parameters. Native delegation groups preserve root/stage-owner Builder versus bounded child Builder, strict-leaf research, read-only utility restrictions and local-coordinator specialists; runtime policy enforces these boundaries.
60
+
61
+ Role IDs remain `dsmm-<name>`. `subagents.toolTopology=per-role` exposes individual `kind=role` underscore tools plus `dsmm_category`; `parameterized` exposes `dsmm_role` and `dsmm_category` with their respective admitted target enums. Empty groups have no tool. Actual arguments are `description`, `prompt`, optional `level`, deployment-authorized/exposed `route`, and capability-exposed `run_in_background`; no template grants them. Omitted/normal preserves the default route; `roleRouting.<id>.levels` contains only configured low/high/max complete routes or effort-only choices requiring exact native preflight. A complete per-call route requires paired provider/model, drops stale effort on model changes and does not silently fall back; an effort-only override must be supported by the selected native model. Route override additionally requires captured deployment `allowRouteOverride=true`. Source tier advice never generates suffix roles or fixed max effort. Target/caller/read-only/depth authority is unchanged by topology or level. Missing required planning/review capability is reported, not bypassed. Read-only planners return complete Markdown for authorized coordinator persistence. Reviewer/Oracle independence requires different observed routes, not names.
62
+
63
+ One-shot defaults foreground; permitted one-shot background is native-job-owned. An admitted managed continuable configuration defaults background and returns a durable child ID; explicit `run_in_background:false` starts a non-reusable one-shot. A wired user foreground handoff transfers the same existing run to native jobs without another start, after operator/session/epoch/ownership/background gates; failed preflight leaves foreground ownership/cancellation intact. Existing continuable children use exposed `send_message` for nearest-step running, idle next-turn or same-ID cold delivery and the actual native user queue/steer surface. Receipts mean inbox acceptance, not execution/review completion. A settled one-shot cannot revive. Reuse does not reselect role/level/route or replace original captured locale/authority with the parent's latest profile. Background enablement, native capacity/depth, ownership, cancellation, provider support and permissions always gate execution. No OpenCode `task_id`/resume/retry, automatic retry or guessed idempotency is supplied.
64
+
65
+ Managed message delivery requires explicit startup composition: disable the stock `subagents` registration row, bind the unique PUBLIC DSMM `SubagentRuntime` subclass, then restart. Stock cannot be unloaded/drained for hot replacement or shadowed by a parallel runtime. The assembler takes the observed `SubagentRuntimeAdmissionView`; stock/unavailable/unready states give the explicit composition/restart limitation, not a readiness promise. Native controls remain genuine SDK capabilities, but tool exposure and operator-gated user surfaces must be separately observed. Unconnected C3 tool/RPC surfaces are not announced. Legacy-conservative evidence permits useful proven capabilities under the same durable ID intersected with current normal parent authority and native boundaries; missing evidence denies that capability with a reason, neither denying all legacy children nor inheriting the parent's latest policy. Captured child epochs need not equal the parent's current epoch.
66
+
67
+ ### Runtime assembler consumer interface
68
+
69
+ `buildDsmmAgentGuidance(capturedSettings, observation: DsmmPromptObservation)` is pure and installs no tools, policy, provider, RPC or locale. The integration owner registers it once in the exact admitted Agent scope, independently of the mode-gated `buildDeepworkPrompt`; do not also inject a second dynamic locale block. Use that root/child's immutable settings, never desired deployment/editor drafts or the ancestor's new admission. Persistent `buildRolePersona` contains only shared language priority, not a configured locale.
70
+
71
+ Pass B's `callableRoleInventory` entries (`name`, `kind`, `targets`, optional `targetParameter`) **after actual admission/provider/tool filtering**, plus current policy-filtered native `ToolSchema[]`. The assembler intersects those schemas and target enums with optional observed role availability, and lists configured levels only when the schema exposes them. A role-availability row is not proof of a tool. Pass observed `DsmmInvocationView` under `invocation: {view, routeKind:'initial'|'actual'}`: initial is a preflighted start route, actual comes from native request/status after fallback; never infer either from raw args or a role name. Runtime admission, invocation (including route), and child evidence are explicitly projected to allowed output fields; structurally compatible objects' extra properties are not serialized. Evidence field/code/effect lists are closed and limitation output is bounded.
72
+
73
+ `capabilities.continuable` observes **new child creation**. `capabilities.managedChildDelivery` independently observes **managed parent-to-existing-continuable-child delivery under this exact Agent's authority**; omitted/false does not establish reuse, even with a ready binding and native `send_message`. Model reuse guidance requires that flag, a ready unique DSMM delivery fence and the actual exposed control. Native user queue/steer additionally requires an actually wired `nativeBrowserPrompt.surface`; its name/readiness alone does not prove delivery. Existing-child delivery does not require creation/background to be enabled. Exposed native child-to-parent reporting remains separate and retains exact-sender/adjacency semantics. Supply native jobs capability and a wired `foregroundHandoff.surface` only when supported. Optional `ChildAdmissionEvidenceView` supplies original/proven fields and precise capability limitations, never extra private state. These observations describe availability; actual target, operator/connection/session/epoch/lifetime and native permission gates remain the execution authority.
37
74
 
38
- Source Markdown is kept in full, with precise anchored changes and an explicit DSH resource/authority boundary. Native read/glob/grep, web_search/web_fetch, write/edit, bash/pwsh and skill invocation are the tools mapped here. Question, LSP, image, browser, tracking, background and continuation behavior is conditional on the actual catalog/provider. No Task, todowrite, compress or Context7 MCP interface is invented. Template fields describe an assignment, not callable parameters. Native delegation groups preserve root/stage-owner Builder versus bounded child Builder, strict-leaf research, read-only utility restrictions and local-coordinator specialists; Stage C must enforce those policies on real execution paths.
75
+ DeepSeek V4 Pro/Flash guidance applies only to the exact verified provider/model pairs, uses adapter-advertised efforts and treats configured default effort as policy, not an observed request result. Ordinary root native model/effort and explicit preflighted invocation effort remain authoritative. Preset-derived max reasoning policy is not part of this calibration.
39
76
 
40
77
  Authored frontend router/tooling text overrides install-by-default/implicit latest behavior: inspect existing capabilities, require separate setup authorization, and report unverified evidence without hiding incomplete declared resources. Verbatim UI/UX README paths/cwd examples are superseded by the authored DSH entry: resolve the absolute native resourceBase script, require the already-active target project context, and supply an explicitly approved project-owned output-dir for persistence. The installed skill tree is never an output target; no tool cwd field or shell cd is invented. Public renderer inputs retain the old object shape with optional source metadata; only the canonical catalog requires those trusted source fields.
41
78
 
@@ -55,4 +92,4 @@ Body/data/Python resources and `.frontend-materialized.json` are gitignored. Act
55
92
 
56
93
  `node scripts/materialize-frontend.mjs` defaults to read-only/offline check. `pnpm run build`, `check:source` and `check:release` refuse incomplete/drifted materialization without downloading. Explicit `sync:frontend` reuses complete validated content with zero requests/writes; no arbitrary destination CLI is accepted. Runtime distribution needs only package-relative resources, never an upstream checkout or network materialization.
57
94
 
58
- **E/CI handoff:** after installing the already-authorized build toolchain, run `sync:source`, explicit `sync:frontend`, `sync:source`, then build/generate/check/pack. A Git checkout alone does not contain the ignored bodies. Materialize before a source Docker build context is created; frozen tarballs must already carry the entire library. Do not insert network fetching into default build or use a compiled/ignored local tree as proof that CI packed it. Full packed inventory and missing-resource refusal remain separate evidence from native C/D capability/permission/lifecycle completion.
95
+ **Distribution handoff:** with the authorized build toolchain and complete fixed-pin resources, run snapshot-backed `sync:source`, then coordinated build/generate/check/pack. Only deliberate Root adoption uses `source-inputs.mjs --refresh`; only separately authorized materialization uses `sync:frontend`. The raw snapshot is committed maintenance input and is not required in the npm runtime package. Prepared prompts/skills and every fixed-pin runtime resource must still be delivered; ignored status does not supply them to a cold checkout. Frozen tarballs must already carry the complete library. Default build/check does not fetch resources. Local compiled/materialized content is not proof of packed delivery. Full packed inventory and missing-resource refusal remain separate evidence from native runtime/UI capability, permission and lifecycle completion.
@@ -0,0 +1,36 @@
1
+ import type { Context } from "@deepseek-ai/cordis";
2
+ import { AgentRegistry } from "@deepseek-ai/dsh-agent";
3
+ import type { Agent, AgentHandle, CreateAgentOptions, ResumeAgentOptions } from "@deepseek-ai/dsh-agent";
4
+ import type { SessionId } from "@deepseek-ai/dsh-session";
5
+ import { SubagentError } from "@deepseek-ai/dsh-subagent";
6
+ export interface ManagedCreation {
7
+ readonly registry: AgentRegistry;
8
+ readonly parent: Agent;
9
+ readonly childId: SessionId;
10
+ readonly kind: "fresh" | "cold";
11
+ readonly delegationMode?: "one-shot" | "continuable";
12
+ readonly owner: object;
13
+ readonly ownerSignal?: AbortSignal;
14
+ entered(agent: Agent): void;
15
+ claimed: boolean;
16
+ child?: Agent;
17
+ retired: boolean;
18
+ }
19
+ export declare function managedCancellation(reason: unknown): SubagentError;
20
+ export declare function isManagedCancellation(error: unknown): boolean;
21
+ export declare const exactRegistry: (registry: AgentRegistry) => AgentRegistry;
22
+ export declare function duringManagedCreation<T>(operation: ManagedCreation, run: () => T): T;
23
+ export declare function currentManagedCreation(): ManagedCreation | undefined;
24
+ export declare function duringActivationOwnership<T>(signal: AbortSignal, run: () => T): T;
25
+ export declare function activationOwnerSignal(): AbortSignal | undefined;
26
+ /** Startup-only agents provider. Factory, traced caller, ownership and handles stay native. */
27
+ export declare class DsmmAgentRegistry extends AgentRegistry {
28
+ readonly managedLifetime: AbortController;
29
+ constructor(ctx: Context);
30
+ create(options: CreateAgentOptions): Promise<AgentHandle>;
31
+ resume(options: ResumeAgentOptions): Promise<AgentHandle>;
32
+ enter(agent: Agent, owner: Agent | undefined): () => void;
33
+ private creation;
34
+ }
35
+ export default DsmmAgentRegistry;
36
+ //# sourceMappingURL=agent-registry.d.ts.map
@@ -0,0 +1,75 @@
1
+ import { AsyncLocalStorage } from "node:async_hooks";
2
+ import { symbols } from "@deepseek-ai/cordis";
3
+ import { AgentRegistry } from "@deepseek-ai/dsh-agent";
4
+ import { SubagentError } from "@deepseek-ai/dsh-subagent";
5
+ import { scopeLifetime } from "./delivery-authority.js";
6
+ const creations = new AsyncLocalStorage();
7
+ const holders = new AsyncLocalStorage();
8
+ const cancellations = new WeakSet();
9
+ export function managedCancellation(reason) {
10
+ const error = new SubagentError("Managed activation owner cancelled", "ABORTED", { cause: reason });
11
+ cancellations.add(error);
12
+ return error;
13
+ }
14
+ export function isManagedCancellation(error) { return typeof error === "object" && error !== null && cancellations.has(error); }
15
+ export const exactRegistry = (registry) => Reflect.get(registry, symbols.original) ?? registry;
16
+ export function duringManagedCreation(operation, run) { return creations.run(operation, run); }
17
+ export function currentManagedCreation() { return creations.getStore(); }
18
+ export function duringActivationOwnership(signal, run) { return holders.run(signal, run); }
19
+ export function activationOwnerSignal() { return holders.getStore(); }
20
+ /** Startup-only agents provider. Factory, traced caller, ownership and handles stay native. */
21
+ export class DsmmAgentRegistry extends AgentRegistry {
22
+ managedLifetime = new AbortController();
23
+ constructor(ctx) {
24
+ if (ctx.get("agents") !== undefined)
25
+ throw new SubagentError("DSMM agents requires one startup provider; restart to change it.", "DUPLICATE_PROVIDER");
26
+ super(ctx);
27
+ scopeLifetime(ctx, "dsmm.agents: retire managed residency", () => this.managedLifetime.abort());
28
+ }
29
+ create(options) {
30
+ return this.creation("fresh", options.sessionId, options.parentAgent, options.signal, signal => super.create(signal === options.signal ? options : { ...options, signal }));
31
+ }
32
+ resume(options) {
33
+ return this.creation("cold", options.resumeSessionId, options.parentAgent, options.signal, signal => super.resume(signal === options.signal ? options : { ...options, signal }));
34
+ }
35
+ enter(agent, owner) {
36
+ const detach = super.enter(agent, owner);
37
+ const operation = creations.getStore();
38
+ if (operation?.claimed && operation.registry === exactRegistry(this) && operation.parent === owner && operation.childId === agent.id) {
39
+ try {
40
+ operation.entered(agent);
41
+ }
42
+ catch (error) {
43
+ detach();
44
+ throw error;
45
+ }
46
+ }
47
+ return detach;
48
+ }
49
+ async creation(kind, id, parent, source, run) {
50
+ const operation = creations.getStore();
51
+ if (operation !== undefined && operation.registry === exactRegistry(this) && operation.parent === parent
52
+ && operation.childId === id && operation.kind === kind) {
53
+ if (operation.claimed || operation.retired || this.managedLifetime.signal.aborted || source === undefined) {
54
+ throw new SubagentError("Managed creation requires its exact unused operation", "UNAUTHORIZED");
55
+ }
56
+ operation.claimed = true;
57
+ }
58
+ if (source === undefined)
59
+ return run(source);
60
+ // Creation-only cancellation must not end an accepted root or native child residency.
61
+ const relay = new AbortController();
62
+ const abort = () => relay.abort(source.reason);
63
+ source.addEventListener("abort", abort, { once: true });
64
+ if (source.aborted)
65
+ abort();
66
+ try {
67
+ return await run(relay.signal);
68
+ }
69
+ finally {
70
+ source.removeEventListener("abort", abort);
71
+ }
72
+ }
73
+ }
74
+ export default DsmmAgentRegistry;
75
+ //# sourceMappingURL=agent-registry.js.map