@dsmm/dsmm 0.2.0 → 0.2.2

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 (291) hide show
  1. package/README.md +38 -66
  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/docs/agent-presets.md +36 -52
  25. package/docs/compatibility.md +50 -108
  26. package/docs/deferred-native-approval-risk.md +19 -0
  27. package/docs/design.md +2 -2
  28. package/docs/lsp.md +11 -21
  29. package/docs/migration-from-ocmm.md +2 -2
  30. package/docs/model-routing.md +84 -59
  31. package/docs/native-permissions.md +35 -0
  32. package/docs/profiles.md +40 -87
  33. package/docs/releasing.md +83 -2
  34. package/docs/roadmap.md +71 -17
  35. package/docs/settings-status.md +34 -169
  36. package/docs/skill-sync.md +52 -15
  37. package/lib/child-admission-contract.d.ts +37 -0
  38. package/lib/child-admission-contract.js +2 -0
  39. package/lib/child-admission.d.ts +42 -0
  40. package/lib/child-admission.js +162 -0
  41. package/lib/child-capture.d.ts +81 -0
  42. package/lib/child-capture.js +203 -0
  43. package/lib/child-evidence.d.ts +17 -0
  44. package/lib/child-evidence.js +43 -0
  45. package/lib/client/ChildrenPanel.d.ts +43 -0
  46. package/lib/client/ChildrenPanel.js +82 -0
  47. package/lib/client/DeploymentPage.js +15 -8
  48. package/lib/client/EditableChoice.d.ts +17 -0
  49. package/lib/client/EditableChoice.js +49 -0
  50. package/lib/client/PermissionsPanel.d.ts +14 -0
  51. package/lib/client/PermissionsPanel.js +46 -0
  52. package/lib/client/ProfilesSection.js +30 -15
  53. package/lib/client/RoleAvailability.d.ts +7 -0
  54. package/lib/client/RoleAvailability.js +19 -0
  55. package/lib/client/SessionProfiles.js +27 -9
  56. package/lib/client/StructuredEditor.js +15 -7
  57. package/lib/client/children-controller.d.ts +98 -0
  58. package/lib/client/children-controller.js +296 -0
  59. package/lib/client/children-locales.d.ts +367 -0
  60. package/lib/client/children-locales.js +69 -0
  61. package/lib/client/controller.d.ts +6 -1
  62. package/lib/client/controller.js +14 -8
  63. package/lib/client/deployment-data.d.ts +2 -1
  64. package/lib/client/deployment-data.js +34 -5
  65. package/lib/client/deployment-locales.d.ts +4 -0
  66. package/lib/client/deployment-locales.js +11 -2
  67. package/lib/client/diagnostics.d.ts +14 -0
  68. package/lib/client/diagnostics.js +53 -0
  69. package/lib/client/index.d.ts +4 -0
  70. package/lib/client/index.js +96 -2
  71. package/lib/client/locales.d.ts +54 -0
  72. package/lib/client/locales.js +34 -16
  73. package/lib/client/permission-client.d.ts +16 -0
  74. package/lib/client/permission-client.js +38 -0
  75. package/lib/client/permission-controller.d.ts +62 -0
  76. package/lib/client/permission-controller.js +149 -0
  77. package/lib/client/permission-locales.d.ts +114 -0
  78. package/lib/client/permission-locales.js +75 -0
  79. package/lib/client/session-labels.js +4 -4
  80. package/lib/client/structured.js +19 -5
  81. package/lib/client/styles.d.ts +1 -1
  82. package/lib/client/styles.js +20 -0
  83. package/lib/client.js +5780 -1679
  84. package/lib/core-permission-authority.d.ts +18 -0
  85. package/lib/core-permission-authority.js +255 -0
  86. package/lib/core-permissions.d.ts +8 -0
  87. package/lib/core-permissions.js +33 -0
  88. package/lib/delivery-authority.d.ts +68 -0
  89. package/lib/delivery-authority.js +260 -0
  90. package/lib/deployment-config.d.ts +23 -0
  91. package/lib/deployment-config.js +61 -40
  92. package/lib/deployment-permission-rules.d.ts +55 -0
  93. package/lib/deployment-permission-rules.js +306 -0
  94. package/lib/dsh-types.d.ts +10 -4
  95. package/lib/guards.d.ts +1 -1
  96. package/lib/guards.js +29 -8
  97. package/lib/host-llm-startup.d.ts +41 -0
  98. package/lib/host-llm-startup.js +65 -0
  99. package/lib/host-llm.d.ts +92 -0
  100. package/lib/host-llm.js +325 -0
  101. package/lib/index.d.ts +15 -4
  102. package/lib/index.js +300 -47
  103. package/lib/legacy-child-policy.d.ts +51 -0
  104. package/lib/legacy-child-policy.js +123 -0
  105. package/lib/legacy-read-composition.d.ts +20 -0
  106. package/lib/legacy-read-composition.js +144 -0
  107. package/lib/legacy-read-contracts.d.ts +157 -0
  108. package/lib/legacy-read-contracts.js +39 -0
  109. package/lib/legacy-read-host.d.ts +19 -0
  110. package/lib/legacy-read-host.js +67 -0
  111. package/lib/legacy-read-integration.d.ts +121 -0
  112. package/lib/legacy-read-integration.js +522 -0
  113. package/lib/legacy-read-proxy.d.ts +26 -0
  114. package/lib/legacy-read-proxy.js +237 -0
  115. package/lib/live-pi-ai-owner.d.ts +18 -0
  116. package/lib/live-pi-ai-owner.js +144 -0
  117. package/lib/llm-runtime.d.ts +11 -0
  118. package/lib/llm-runtime.js +21 -0
  119. package/lib/managed-settings.d.ts +5 -0
  120. package/lib/managed-settings.js +14 -0
  121. package/lib/model-parameter-policy.d.ts +11 -0
  122. package/lib/model-parameter-policy.js +27 -0
  123. package/lib/model-routing.js +28 -17
  124. package/lib/modules.d.ts +13 -5
  125. package/lib/modules.js +17 -1
  126. package/lib/native-child-evidence.d.ts +42 -0
  127. package/lib/native-child-evidence.js +133 -0
  128. package/lib/native-pi-ai-wire.d.ts +37 -0
  129. package/lib/native-pi-ai-wire.js +261 -0
  130. package/lib/native-scope.js +1 -1
  131. package/lib/permission-bash.d.ts +6 -0
  132. package/lib/permission-bash.js +7 -0
  133. package/lib/permission-control.d.ts +73 -0
  134. package/lib/permission-control.js +205 -0
  135. package/lib/permission-controller.d.ts +68 -0
  136. package/lib/permission-controller.js +317 -0
  137. package/lib/permission-errors.d.ts +7 -0
  138. package/lib/permission-errors.js +21 -0
  139. package/lib/permission-fs-search.d.ts +5 -0
  140. package/lib/permission-fs-search.js +7 -0
  141. package/lib/permission-fs.d.ts +5 -0
  142. package/lib/permission-fs.js +7 -0
  143. package/lib/permission-native-access.d.ts +11 -0
  144. package/lib/permission-native-access.js +6 -0
  145. package/lib/permission-native-command.d.ts +10 -0
  146. package/lib/permission-native-command.js +93 -0
  147. package/lib/permission-native-rules.d.ts +75 -0
  148. package/lib/permission-native-rules.js +278 -0
  149. package/lib/permission-pwsh.d.ts +6 -0
  150. package/lib/permission-pwsh.js +7 -0
  151. package/lib/permission-remote.d.ts +26 -0
  152. package/lib/permission-remote.js +53 -0
  153. package/lib/permission-rpc.d.ts +29 -0
  154. package/lib/permission-rpc.js +152 -0
  155. package/lib/permission-rules.d.ts +115 -0
  156. package/lib/permission-rules.js +256 -0
  157. package/lib/permission-settings.d.ts +45 -0
  158. package/lib/permission-settings.js +48 -0
  159. package/lib/permission-shell.d.ts +38 -0
  160. package/lib/permission-shell.js +150 -0
  161. package/lib/permission-web.d.ts +5 -0
  162. package/lib/permission-web.js +7 -0
  163. package/lib/preset-registry.js +36 -25
  164. package/lib/profile-diagnostics.d.ts +45 -0
  165. package/lib/profile-diagnostics.js +148 -0
  166. package/lib/profile-locale.d.ts +3 -0
  167. package/lib/profile-locale.js +2 -0
  168. package/lib/profile-remote.d.ts +8 -0
  169. package/lib/profile-remote.js +163 -39
  170. package/lib/profile-rpc.d.ts +4 -3
  171. package/lib/profile-rpc.js +14 -12
  172. package/lib/profile-runtime.d.ts +40 -1
  173. package/lib/profile-runtime.js +368 -93
  174. package/lib/profile-store.d.ts +11 -0
  175. package/lib/profile-store.js +143 -11
  176. package/lib/profile-types.d.ts +70 -1
  177. package/lib/profile-types.js +1 -0
  178. package/lib/profiles.d.ts +16 -2
  179. package/lib/profiles.js +156 -79
  180. package/lib/prompt-content.js +1 -1
  181. package/lib/prompts.d.ts +37 -2
  182. package/lib/prompts.js +111 -9
  183. package/lib/recovery-policy.js +20 -7
  184. package/lib/role-control-remote.d.ts +38 -0
  185. package/lib/role-control-remote.js +211 -0
  186. package/lib/role-control-rpc.d.ts +51 -0
  187. package/lib/role-control-rpc.js +377 -0
  188. package/lib/role-control-types.d.ts +92 -0
  189. package/lib/role-control-types.js +8 -0
  190. package/lib/role-invocation.d.ts +47 -0
  191. package/lib/role-invocation.js +135 -0
  192. package/lib/role-llm-runtime.d.ts +17 -0
  193. package/lib/role-llm-runtime.js +62 -0
  194. package/lib/role-llm.d.ts +31 -0
  195. package/lib/role-llm.js +66 -0
  196. package/lib/role-policy.d.ts +49 -8
  197. package/lib/role-policy.js +437 -60
  198. package/lib/role-providers.d.ts +1 -1
  199. package/lib/role-providers.js +30 -35
  200. package/lib/role-routing.d.ts +11 -2
  201. package/lib/role-routing.js +42 -25
  202. package/lib/role-runs.d.ts +135 -0
  203. package/lib/role-runs.js +304 -0
  204. package/lib/role-subagents.d.ts +58 -3
  205. package/lib/role-subagents.js +169 -56
  206. package/lib/roles.d.ts +5 -6
  207. package/lib/roles.js +10 -39
  208. package/lib/route-json.d.ts +19 -0
  209. package/lib/route-json.js +129 -0
  210. package/lib/routing-policy.d.ts +2 -0
  211. package/lib/routing-policy.js +12 -2
  212. package/lib/runtime-integration.d.ts +112 -0
  213. package/lib/runtime-integration.js +784 -0
  214. package/lib/runtime-recovery.js +18 -8
  215. package/lib/settings.d.ts +47 -13
  216. package/lib/settings.js +217 -82
  217. package/lib/skills.js +2 -2
  218. package/lib/status.d.ts +10 -1
  219. package/lib/status.js +11 -8
  220. package/lib/subagent-runtime.d.ts +45 -0
  221. package/lib/subagent-runtime.js +131 -0
  222. package/package.json +106 -56
  223. package/patches/subagent-runtime.yml +15 -0
  224. package/prompts/deepseek-flash.md +1 -1
  225. package/prompts/deepseek-v4-pro.md +2 -2
  226. package/prompts/deepwork.md +27 -18
  227. package/prompts/source/agents/clarifier.md +5 -3
  228. package/prompts/source/agents/orchestrator.md +18 -9
  229. package/prompts/source/agents/plan-critic.md +5 -1
  230. package/prompts/source/agents/planner.md +4 -2
  231. package/prompts/source/agents/reviewer.md +6 -0
  232. package/prompts/source/category/complex.md +4 -4
  233. package/prompts/source/category/creative.md +6 -4
  234. package/prompts/source/category/cross-cutting.md +10 -8
  235. package/prompts/source/category/deep.md +5 -3
  236. package/prompts/source/category/documenting.md +7 -1
  237. package/prompts/source/category/frontend.md +2 -2
  238. package/prompts/source/category/hard-reasoning.md +3 -3
  239. package/prompts/source/category/research.md +4 -2
  240. package/prompts/source/deepwork/claude-opus-5.md +2 -2
  241. package/prompts/source/deepwork/codex.md +1 -1
  242. package/prompts/source/deepwork/default.md +22 -15
  243. package/prompts/source/deepwork/gemini.md +23 -16
  244. package/prompts/source/deepwork/glm.md +21 -14
  245. package/prompts/source/deepwork/gpt.md +12 -6
  246. package/prompts/source/deepwork/planner.md +8 -5
  247. package/prompts/source/manifest.json +178 -63
  248. package/prompts/source/shared/dsh-host-contract.md +5 -3
  249. package/prompts/source/shared/locale.md +2 -2
  250. package/prompts/source/terminal/orchestrator.md +1 -1
  251. package/scripts/cold-profile-composition.mjs +329 -0
  252. package/scripts/cold-profile-sources.mjs +238 -0
  253. package/scripts/migrate-cold-profile.mjs +315 -0
  254. package/skills/ast-grep/SKILL.md +7 -4
  255. package/skills/brainstorming/SKILL.md +43 -22
  256. package/skills/coding-agent-sessions/SKILL.md +7 -4
  257. package/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -46
  258. package/skills/coding-agent-sessions/scripts/tests/test_pi_family_scanners.py +130 -130
  259. package/skills/debugging/SKILL.md +14 -9
  260. package/skills/debugging/references/methodology/00-setup.md +14 -62
  261. package/skills/debugging/references/methodology/02-investigate.md +4 -4
  262. package/skills/debugging/references/methodology/03-flaky-triage.md +3 -3
  263. package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +2 -14
  264. package/skills/debugging/references/methodology/06-fix.md +6 -6
  265. package/skills/debugging/references/methodology/08-qa.md +5 -5
  266. package/skills/debugging/references/methodology/09-cleanup.md +15 -153
  267. package/skills/debugging/references/methodology/partial-runtime-evidence.md +3 -16
  268. package/skills/debugging/references/runtimes/bundled-js-binary.md +1 -16
  269. package/skills/debugging/references/runtimes/native-binary.md +9 -54
  270. package/skills/debugging/references/runtimes/node.md +4 -15
  271. package/skills/debugging/references/runtimes/python.md +3 -15
  272. package/skills/debugging/references/runtimes/rust.md +2 -18
  273. package/skills/debugging/references/tools/dap.md +1 -1
  274. package/skills/debugging/references/tools/ghidra.md +4 -15
  275. package/skills/debugging/references/tools/playwright-cli.md +3 -15
  276. package/skills/debugging/references/tools/pwntools.md +4 -16
  277. package/skills/dispatching-parallel-agents/SKILL.md +18 -16
  278. package/skills/frontend/SKILL.md +7 -4
  279. package/skills/frontend/references/design/react-dev-tooling-skill.md +1 -1
  280. package/skills/git-master/SKILL.md +7 -4
  281. package/skills/init-deep/SKILL.md +7 -4
  282. package/skills/receiving-code-review/SKILL.md +17 -12
  283. package/skills/remove-ai-slops/SKILL.md +39 -38
  284. package/skills/requesting-code-review/SKILL.md +19 -17
  285. package/skills/requesting-code-review/code-reviewer.md +13 -1
  286. package/skills/subagent-driven-development/SKILL.md +29 -26
  287. package/skills/subagent-driven-development/implementer-prompt.md +29 -11
  288. package/skills/subagent-driven-development/spec-reviewer-prompt.md +6 -1
  289. package/skills/using-git-worktrees/SKILL.md +7 -4
  290. package/skills/writing-plans/SKILL.md +29 -24
  291. package/skills/writing-plans/plan-document-reviewer-prompt.md +10 -1
@@ -1,81 +1,106 @@
1
1
  # Model routing
2
2
 
3
- ## Explicit role policies
4
-
5
- `roleRouting` is a map keyed by canonical DSMM role ID. It defaults to `{}`; role names alone do not select a model. It can be supplied by deployment configuration or a selected [runtime profile](profiles.md). The 0.1.5 contract adds independent per-role strategy and finite retry policy without embedding native account configuration. Provider authentication and the provider/model catalog remain native DSH deployment configuration, never profile-file contents. The following is a deployment baseline example:
6
-
7
- ```yaml
8
- - id: dsmm
9
- config:
10
- defaultActive: true
11
- roles:
12
- dsmm-builder: false
13
- roleRouting:
14
- dsmm-orchestrator:
15
- strategy: startup-lock
16
- primary:
17
- provider: my-provider
18
- model: primary-model
19
- reasoningEffort: high
20
- fallbackRoutes:
21
- - provider: my-provider
22
- model: backup-model
23
- reasoningEffort: high
24
- dsmm-reviewer:
25
- strategy: rate-limit-fallback
26
- rateLimit:
27
- maxRetries: 3
28
- switchAfterRateLimits: 3
29
- maxSwitches: 2
30
- primary:
31
- provider: my-provider
32
- model: review-model
33
- reasoningEffort: max
34
- fallbackRoutes: []
35
- runtimeRecovery:
36
- enabled: true
37
- fallbackRoutes: []
38
- idleContinuation:
39
- enabled: false
3
+ Providers, accounts and credentials remain native DSH configuration, never named-profile contents.
4
+
5
+ ## Native roots and child defaults
6
+
7
+ Every ordinary top-level Agent keeps the native model tab's assembled provider/model/effort, including an implicit default before the first selection event. Deepwork activation, preset selection, draft Save, future-default selection and normal current-session Apply don't select a model or calibrate root effort. Only explicit **Use profile model** asks native selection to change it; later manual choices remain authoritative.
8
+
9
+ `roleRouting` is keyed by canonical IDs such as `dsmm-reviewer`, not tool names or labels. Each entry accepts `primary`, ordered `fallbackRoutes`, `strategy`, bounded `rateLimit`, and `levels`. Omitted primary inherits the native parent route for a child. Configured primary supplies child defaults, not a root override or new selection permission. Native child AgentOptions remain explicit host authority; changing provider/model without effort clears stale configured effort.
10
+
11
+ ```jsonc
12
+ {
13
+ "roleRouting": {
14
+ "dsmm-reviewer": {
15
+ "primary": { "provider": "my-provider", "model": "review-model" },
16
+ "levels": {
17
+ "low": { "reasoningEffort": "low" },
18
+ "high": { "reasoningEffort": "high" },
19
+ "max": { "provider": "my-provider", "model": "large-review-model", "reasoningEffort": "max" }
20
+ },
21
+ "fallbackRoutes": [],
22
+ "strategy": "startup-lock"
23
+ }
24
+ }
25
+ }
40
26
  ```
41
27
 
42
- An ordinary top-level Agent always uses the native DSH model tab's assembled provider/model/effort, including its implicit default before the first request. Enabling Deepwork, selecting a role preset, loading a profile or switching a profile normally does not replace that selection. Root requests do not replay historical model choices, calibrate the effort or automatically switch channels/models. Bounded, positively no-output-safe rate-limit retries stay on the same native route. This applies to every top-level role, not only Orchestrator.
28
+ These identifiers are placeholders for resolvable routes. The native model picker and non-DSMM requests retain the owning adapter's effort validation. DSMM routes owned by the explicit raw Host composition below accept any valid effort string without changing advertised model metadata or claiming account/network health.
43
29
 
44
- `primary` supplies child-role defaults and is also an advisory model for an explicit **switch profile and use its model** action. That opt-in action submits through native `session/selectModel`; native projection and the actual picker reflect the accepted result. A later model-tab choice remains authoritative. Native model selection has its ordinary background-default persistence behavior; editing profile fields, saving drafts and normal profile switches never call that endpoint. DSMM captures native intent only to fence old retry work; a concurrent later choice belongs to the next assembly, not the already assembled frame.
30
+ ## Host-owned raw routes
45
31
 
46
- For a trusted native one-shot role alias, `primary` is also a default rather than an unconditional overwrite of explicit native child options. That live-child exception requires genuine native parent ownership and zero inherited event prefix. Root, cold/unowned child and parent-seeded fork requests cannot claim that exception. A parent's manual native choice does not replace a configured child's own role primary; genuine child-local authority remains distinct. Unconfigured/disabled roles, unrecognized children, and out-of-scope sessions do not acquire another role's policy. Disabled-role configuration may be retained but does not create a callable role. Auxiliary role policies apply through delegation, not additional root presets.
32
+ `modelParameters.passthrough` is an ordinary Core setting, defaulting to `true`, resolved through global, explicit native profile and named/session overlays. It is independent of Deepwork enablement and does not prove that a raw executor is installed. Save and both Apply actions preserve the original JSON; each admitted Agent keeps its immutable policy.
47
33
 
48
- Settings resolve from built-in defaults, then deployment configuration, then the admitted immutable runtime revision. Global profile apply affects newly created unscoped Agents only; explicit idle current-session apply creates a new epoch for that root and later children. Existing children retain their previous snapshot. Cold resume uses a committed session sidecar when present, otherwise the current global default. Changing a draft alone changes none of these policies; see [profiles](profiles.md). Explicit empty fallback lists remain empty instead of inheriting an omitted global chain.
34
+ With passthrough **ON**, applicable DSMM routes retain valid effort strings and opaque JSON through the declared raw owner. With **OFF**, opaque/custom parameters remain stored but are not sent, and neither configured `reasoningEffort` nor `reasoning_effort` overrides native defaults. SDK-standard `temperature`, `maxTokens` and `stop` retain native handling, including explicit native refusal of an unsupported option. Independent native model/effort selections remain native-owned under either policy. OFF does not force a replacement effort or erase configuration.
49
35
 
50
- For child Agents, native preparation chooses the primary or first resolvable configured candidate in order. This does not make a sacrificial request or claim account/network health. Missing catalog rows do not make a custom route unavailable; malformed/unsupported exact efforts remain hard errors. Apply may retain dormant unavailable alternatives when another candidate is admissible. No admissible child candidate means a visible no-request refusal, never a silent native baseline. An unrelated configured primary cannot block an ordinary root's native chosen model.
36
+ `createDsmmLlmColdStartup` is an explicit Host startup composition exported by `@dsmm/dsmm`. Install its `prepare` callback through public `dsh-app-boot.boot` before Loader entries mount. Include its patches in `profileContext.overlays` **before** `readProfilePatches`, exclude its provider names from the stock `llm-pi-ai` row, and preserve the original AgentLoop configuration, including configured Agents. The factory installs the DSMM-aware runtime before constructing the single official AgentLoop. `assertReady()` refuses incomplete composition; a model name or profile flag cannot enable raw request authority.
51
37
 
52
- For child Agents, `startup-lock` is the default, including old documents with an omitted strategy. Once admitted, it keeps the exact provider/model/effort across turns and bounded `RATE_LIMIT` retries. `rate-limit-fallback` starts identically, but distinct positively no-output-safe rate-limit failures reaching the configured threshold advance the ordered chain within finite switch/delay caps. Per-role overrides inherit only omitted fields from `runtimePolicy`; different roles and sessions never share route locks or counters. Success resets consecutive rate-limit counts. Duplicate errors do not count twice and exhausted chains never wrap to primary. Ordinary roots retain the native model even when a child-role policy specifies fallback switching.
38
+ The provider owner requires explicit finite model declarations, an `openai-completions` endpoint, its own settings namespace and a Host-owned request-time credential resolver. Other provider owners, native catalog metadata, model discovery and native picker validation remain separate. Responses and other APIs are not supported by this raw owner. Credentials are not profile parameters; the resolver receives the named reference and cancellation signal and must not introduce an ambient fallback.
53
39
 
54
- Only an exact native `NO_ADAPTER` or adapter-proven `UNKNOWN_MODEL` failure on the first actual request, before any accepted output/tool fragment, may advance a remaining startup candidate. Later generic, transport, authorization, quota, payment, context and cancelled failures do not authorize inferred hopping. Exact rate limit is never startup unavailability. Every automatic retry or switch requires a positively correlated native attempt and its matching live/durable no-output settlement; partial text, reasoning, tool fragments or completed blocks forbid even same-route retries. See [runtime recovery](runtime-recovery.md).
40
+ Cold Core composition can consume `configuredModelParameterPolicy(settings)` without waiting for Deepwork. Requests with an immutable Agent admission use `resolvedModelParameterPolicy(admission)`; a child must never substitute the current parent or Host setting. Both helpers return policy data, not authorization. Provider generations recheck their live Host service identity across preparation and credential waits and immediately before payload submission.
55
41
 
56
- Each configured route requires a nonempty provider and model together. An optional named `reasoningEffort` is a native adapter ID, not an OpenCode variant translation. The exact configured effort must be supported; unsupported `max` fails rather than being substituted with `high`. A changed route without effort clears incompatible inherited effort and lets the native adapter resolve its default. For a native child override that changes provider/model without supplying effort, the alias likewise clears the profile-primary effort rather than carrying it onto the new route. Existing DeepSeek calibration cannot override the admitted explicit role/child effort.
42
+ Future-default Apply and idle current-session Apply preserve valid route JSON without querying model metadata, requiring a live LLM owner, or sending a completion. Provider/model existence and supported execution are checked at actual role invocation or request preparation. Root-role, preset, ownership and CAS checks remain Apply requirements. Real requests additionally require exact Agent/role admission, the child's original capture and current direct-parent delivery authority. Cold continuation preserves that original full route rather than copying a later parent profile.
57
43
 
58
- Native child options keep `modelSelectionSettings:false`: this correction introduces no new model-visible selection permission or tool. DSMM's aliased native provider merges profile-primary defaults from the admitted parent snapshot with explicit native child options, then invokes the parent's native `llm.resolveCallConfig` preflight before native spawn. The trusted live-child path preserves that accepted route/effort through the final request headers instead of reapplying the profile primary. Standing preset/tool rows do not capture per-profile routes. The path preserves native persona/tool filters, depth, permissions, cancellation, and one-shot lifecycle. Child identity comes from its own durable native subagent descriptor, not a parent preset, persona text, or a model-visible role label. Descriptor identity can be reconstructed after reload; it does not prove live ownership or make terminal one-shot children resumable.
44
+ ```jsonc
45
+ {
46
+ "roleRouting": {
47
+ "dsmm-doc-search": {
48
+ "primary": {
49
+ "provider": "apai", "model": "gpt-6.1-sol", "reasoningEffort": "medium",
50
+ "temperature": 0, "full": false, "count": 0, "optional_value": null,
51
+ "customParameters": { "rows": [false, 0, null, [], {}] }
52
+ },
53
+ "fallbackRoutes": [
54
+ { "provider": "apai", "model": "gpt-5.6-terra", "reasoningEffort": "high", "fallback_kind": "terra" },
55
+ { "provider": "apai", "model": "gpt-5.6-luna", "reasoningEffort": "high", "fallback_kind": "luna" }
56
+ ]
57
+ }
58
+ }
59
+ }
60
+ ```
61
+
62
+ Additional route properties are bounded plain JSON. Their original names, values and presence are preserved, including an ordinary user property named `customParameters`. Standard `reasoningEffort` maps to `reasoning_effort` for this API. Its raw alias is also accepted, but both cannot appear together. The same exclusivity applies to `maxTokens`, `max_tokens`, `max_completion_tokens` and `max_output_tokens`. A raw token field must match the declared API/model token field and satisfy the native context budget; conflicts refuse before HTTP rather than silently rewriting the value or selecting a fallback. Host messages, tools, authentication, endpoint, headers, signals, callbacks and authority fields cannot be supplied as route parameters. Host attribution headers remain authoritative.
63
+
64
+ Every fallback owns its full parameter set; primary-only properties never flow into a fallback. Full JSON value identity distinguishes parameter-only changes even at the same provider/model, while object key order does not. Native request headers persist the complete call configuration and must actually flush before dispatch. A persistence or admission failure cannot fall through to stock dispatch.
65
+
66
+ The native Root model-selection API remains its separate three-field contract. Profile Apply and the optional native model-selection action are independent operations; failure of the latter does not undo a successful profile admission.
67
+
68
+ ## Invocation selection
69
+
70
+ Calls default to `level:"normal"`, meaning primary or inherited routing. There is no `levels.normal` setting. `low`, `high` and `max` must be configured for that exact target; an unconfigured requested level refuses before a model request. Orchestrator isn't a child delegation target and doesn't accept level configuration. Levels don't synthesize suffixed personas or change workflow ownership.
71
+
72
+ A level override is either `{reasoningEffort}` or a complete route with `provider`, `model` and optional effort/JSON parameters. Effort-only selection keeps the resolved model and applies the exact effort to candidate preparation. A complete route replaces the route parameters together; omitted effort isn't borrowed from the old route. Native host options are then honored, and an admitted invocation `route` has final override precedence.
73
+
74
+ Model-facing `route` is absent by default. Explicit deployment `subagents.allowRouteOverride:true` makes it available with the same effort-only/complete-route grammar; a named overlay can't grant this permission. A complete invocation route fixes initial preparation to that route and removes fallback routes. Effort-only overrides retain configured candidates with the requested effort. All paths still require native preflight and role/depth/filter admission. `modelSelectionSettings:false` remains in native child options.
75
+
76
+ Invocation metadata reports role, label, effective level, route source (`inherited`, `primary`, `level`, or `invocation-route`), mode and actual IDs when available. Raw call arguments aren't evidence that a route executed.
77
+
78
+ ## Tool topology and target filters
79
+
80
+ `subagents.toolTopology:"per-role"` exposes individual base-role tools such as `dsmm_builder`, `dsmm_plan_critic` and `dsmm_oracle_2nd`, plus `dsmm_category` for category targets. `"parameterized"` exposes `dsmm_role` with a required `role` parameter and `dsmm_category` with a required `category` parameter. Both parameters use canonical `dsmm-*` IDs, and empty groups have no entry. Native provider aliases remain `dsmm-role-<source-name>`.
81
+
82
+ Entries contain only currently admitted targets of the correct kind. Exact caller definition, provider identity, role matrix, enablement and native depth capability are checked again at execution. The merged entry name doesn't broaden authority: inherited allow/deny filters still constrain individual targets by canonical per-role tool names. Disabled or cross-kind targets refuse. See [Agent authority](agent-presets.md#delegation-authority).
83
+
84
+ ## Locks, fallback and capture
85
+
86
+ Child preparation selects the primary or first resolvable configured candidate in order without a sacrificial request. No admissible candidate produces a visible no-request refusal, not silent baseline routing. Explicit `fallbackRoutes:[]` disables inheritance of a fallback chain. Omitted role strategy/retry fields inherit `runtimePolicy`; `startup-lock` is the default.
59
87
 
60
- Default primary preparation does not reset an admitted fallback or an accepted native user choice. Public `session/selectModel` intentionally persists the native default in the host's background; profile-editor fields use only the advisory catalog and never call that endpoint. Final native request headers are authoritative, not an intermediate middleware snapshot. See [runtime recovery](runtime-recovery.md) for role/global chain precedence and retry fences.
88
+ `startup-lock` keeps the admitted route across turns and bounded positively no-output-safe `RATE_LIMIT` retries. `rate-limit-fallback` may advance the ordered chain after the configured threshold, within finite switch/delay limits. Counters and locks aren't shared between roles or sessions; duplicate errors don't count twice, success resets consecutive counts, and exhausted chains don't wrap.
61
89
 
62
- DSMM records a model-hidden `dsmm/role-policy` identity for explicit routing. It hashes the admitted profile epoch, strategy/retry policy and routes while keeping the audited v1 event's exact three-key grammar. Unchanged admitted policies retain accepted routes across turns; a scoped apply changes the root's epoch and invalidates old pending reservations. Child epochs come only from child-owned history/native live ownership. Cold admissions do not resurrect an old process-local lock merely from history. This metadata does not add model-visible prompt text, create a resumable child lifecycle, or substitute for session sidecars.
90
+ Only provider absence established through the public registration directory, or adapter-proven `UNKNOWN_MODEL`, can advance a remaining startup candidate before accepted output/tool fragments. A generic `NO_ADAPTER` from preparation, middleware or an unready registered adapter is not absence proof. Transport, authorization, quota, payment, context and cancelled failures don't authorize model hopping. Partial text, reasoning or tool output forbids automatic retry, including same-route retry. Ordinary roots remain on their native route. See [runtime recovery](runtime-recovery.md).
63
91
 
64
- On DSH 0.2.0-rc.2, durable custom metadata requires explicit deployment-only `sessionPersistence: {root, compression}` on the main DSMM Loader entry. DSMM mounts its native JSONL companion and awaits readiness before installing runtime hooks. The public `@dsmm/dsmm/session-persistence` export is a library building block, not a second package Loader source. An incompatible durable provider is rejected before DSMM appends its custom event; ephemeral Hosts without persistence remain allowed. Native `Session.append` cannot set the stock-reader `ignorable` marker itself. See [persistence compatibility](compatibility.md#session-persistence-compatibility) for preserving the effective storage settings, disabling the exact stock provider at startup, and old-log repair limits. Final frozen-artifact/production acceptance remains pending; source contracts are not release proof.
92
+ Existing Agents use immutable admitted policy, not a later draft or desired deployment. Idle session Apply creates a new root epoch for future children; old children keep original captures. Cold continuation doesn't reconstruct original settings from the current parent or a role label. Profile storage, native persistence and ownership are separate authorities; see [profiles](profiles.md#storage-and-lifetime) and [compatibility](compatibility.md).
65
93
 
66
- ## Legacy exact-route calibration
94
+ New child captures write payload version **2**, including the original requested route, effective initial route, effort provenance and resolved parameter policy. The outer envelope/checksum and `.children/v1` storage namespace are unchanged. V1 and v2 readers validate separate strict shapes; malformed, unknown-version or identity-mismatched captures cannot fall back to legacy recovery. Existing v1 files are read without migration or rewrite. They retain captured effort/calibration/default inputs under internal `legacy-native-v1` semantics, independent of the current ON/OFF setting, and use historical native validation rather than raw passthrough. This internal discriminator is not a third user setting. Old binaries cannot read v2; downgrade recovery of new captures is not guaranteed.
67
95
 
68
- DSMM calibrates only child Agents on exact verified routes while deepwork mode or a selected DSMM preset is in scope. Ordinary roots preserve native effort without calibration:
96
+ ## Observed route versus declared route
69
97
 
70
- | Route | Calibration settings | Default |
71
- | --- | --- | --- |
72
- | `deepseek-official/deepseek-v4-pro` | `deepseekV4ProCalibration`, `deepseekV4ProDefaultReasoningEffort`, `deepseekV4ProMaxReasoningPresets` | `auto`, `high`, plan-critic/reviewer |
73
- | `deepseek-official/deepseek-flash` or `deepseek-account/deepseek-flash` | `deepseekFlashCalibration`, `deepseekFlashDefaultReasoningEffort`, `deepseekFlashMaxReasoningPresets` | `auto`, `high`, plan-critic/reviewer |
98
+ The child report compares initial route from real `invocation-capture` with live route from that child's `own-native-request-header`. Neither substitutes for the other. Missing capture is `missing-invocation-capture`; live unknown reasons include `no-own-request-header`, `invalid-own-request-header` and `not-observed`. A root header, inherited history prefix or configured primary isn't proof of the child's own executed route. Compatibility invocation projections are labeled as such, not presented as this comparison.
74
99
 
75
- The Flash model ID is `deepseek-flash` (catalog name `DeepSeek-V41-Flash`), not `deepseek-v4-pro` or a guessed V4.1 alias. Other provider IDs, even with an identical model string, are not calibrated. DSMM does not change the user's default provider/model.
100
+ ## Exact DeepSeek calibration
76
101
 
77
- `off` leaves the request unchanged. `auto` fills an omitted reasoning effort while preserving an explicit upstream effort. `strict` may replace an upstream effort only when configured and when the final route's `llm.resolveModelInfo` advertises a permitted value. The chosen effort is `max → high → valid default → unchanged` for a max-designated role; otherwise it is `desired → valid default → unchanged`. No effort is invented when the model has no reasoning metadata. The provider and host retain temperature and tool/reasoning-content serialization ownership.
102
+ Child-only calibration recognizes `deepseek-official/deepseek-v4-pro` and `deepseek-official/deepseek-flash` or `deepseek-account/deepseek-flash`. The Flash model ID is `deepseek-flash`, not a guessed alias. Other providers aren't calibrated by matching model text alone.
78
103
 
79
- The selected preset comes from the latest valid selection event or session header. Without an explicit role policy, native children retain normal model inheritance; a role label alone cannot prove heterogeneity. The max-to-high negotiation above applies only to legacy calibration, never to an explicit role effort. Runtime recovery chooses any final route before calibration evaluates it.
104
+ Each route family retains independent Calibration (`off`, `auto`, `strict`) and DefaultReasoningEffort (`off`, `low`, `high`) settings. Auto preserves explicit effort; strict uses supported policy effort, but neither overwrites an admitted explicit role/child effort. No effort is invented without native reasoning metadata. Ordinary root effort stays native-owned. Parameter passthrough OFF does not run DSMM effort calibration; historical v1 recovery retains its original calibration behavior. The retired `deepseekV4ProMaxReasoningPresets` and `deepseekFlashMaxReasoningPresets` fields reject with `deprecated-field`; explicitly configure levels instead, without automatic migration.
80
105
 
81
- The capability-failure warning is sanitized to route and desired effort; it includes no prompt, credentials, response body or request headers. The actual persisted request header, not an outer middleware probe's earlier snapshot, is authoritative for the resolved effort.
106
+ *Author's note: For an operator assigning child models; configure exact resources and verify the child's own request route rather than treating role names as model proof.*
@@ -0,0 +1,35 @@
1
+ # Native permissions
2
+
3
+ DSH owns approval. DSMM composes permission policy into the native tool pipeline; it doesn't add a separate approval queue, approval UI, TTL or session permit memory. This guide states the source contract, not verification of a published package, build or release.
4
+
5
+ ## Full access and approval
6
+
7
+ Full access means actual native effective standing `danger-full-access`, not a model argument, a requested escalation or a configured `permissionControl.nativeCommands` target. With that standing authority, DSMM doesn't add an ask, downgrade the sandbox, demand a path permit or refuse an unknown operation because classification facts are missing. The only DSMM restriction is a deterministically matched existing explicit deny blacklist, expressed as a native pre-approval decision. There's no additional inferred high-risk list.
8
+
9
+ A captured read-only child or a live, composed DSMM read-only preset has an explicit blacklist covering `write`, `edit`, `bash` and `pwsh`. Standing Full access must not bypass that ceiling; useful native reads remain available. Missing ordinary DSMM policy or classification facts do not by themselves establish a read-only role.
10
+
11
+ The permission contract requires an actual DSH manual approval to be final for the same call and approved scope. Older DSMM rules, a changed permission revision or epoch, and DSMM internal gates must not veto it afterward. A pending native approval isn't canceled merely because a permission source changes. The one-shot delegation exception below remains an unresolved defect.
12
+
13
+ A native once grant applies only to its actual call and scope. It doesn't change standing session permissions, authorize later calls or turn a narrower approval into full access. DSMM can't infer approval from model-supplied arguments or saved policy. DSH rejection and caller/native cancellation remain effective, and the original tool or OS can still fail. Permission to execute isn't a command-success guarantee.
14
+
15
+ ## Settings and synchronization
16
+
17
+ `permissionControl.enabled` defaults true independently of Deepwork and is captured at cold startup. Saving a different value reports restart-required; it neither hot-mounts an executor nor changes the admitted toggle, even for new roots. Turning it off doesn't disable native permissions or other independent tool restrictions.
18
+
19
+ Global and native-profile layers may configure permission settings; named/session overlays can't. Dynamic `permissionControl.outsideReads`, `permissionControl.webSearch`, `permissionControl.webFetch`, `permissionControl.rules` and `permissionControl.nativeCommands` require runtime policy synchronization, not a restart. A configured value isn't proof of mounting or synchronization. Outside-read and web controls cover their native tool surfaces, not every filesystem or network operation inside a shell command.
20
+
21
+ The rules RPC writes Global. A native override of outside-read, web or rule policy must be edited or unset at that layer rather than bypassed by a Global RPC save. An enabled-only override doesn't shadow dynamic policy. See [settings and status](settings-status.md) for layer ownership and save authority.
22
+
23
+ Storage CAS and runtime adoption are separate from native call approval. Saves recheck authoritative storage and await notification before publishing synchronized policy. Notification failure leaves saved/runtime revisions visibly unsynchronized; recovery rereads storage, and conflicts preserve dirty drafts. These checks don't cancel pending native approval or override an actual approved call. New calls consume current policy, with no cross-call reuse of a once grant.
24
+
25
+ ## Capability limits
26
+
27
+ ### Deferred P1: admission changes during one-shot approval
28
+
29
+ If a profile selection publishes a new parent admission epoch while a DSMM one-shot delegation awaits native approval, an ensuing Allow can still be rejected with `UNAUTHORIZED` before child dispatch, even when the physical Agent, owner and tool registration are unchanged. This is a known availability defect, not a successful approval or a permission grant to later calls. Avoid changing the parent profile while approval is pending; if the call is refused, issue a fresh invocation under the current profile.
30
+
31
+ This case is excluded from temporary integration acceptance, not considered fixed. Its complete regression remains in `test/native-core-review-regressions.test.mjs` and is skipped with an explicit reason by default. Set `DSMM_TEST_DEFERRED_APPROVAL=1` to run it. Final unrestricted acceptance still requires this regression to pass without weakening cancellation, ownership or input isolation. The installed SDK and existing request-revocation protections remain unchanged.
32
+
33
+ See the [accepted risk and reevaluation conditions](deferred-native-approval-risk.md) for the bounded deferral and future DSH compatibility requirements.
34
+
35
+ Permission coverage isn't proof of final inode identity or socket isolation. Colocation of `rg` with the intended execution environment isn't proven, and direct formal coverage remains partial. Native outside-read and web coverage, policy synchronization, and successful storage writes are distinct claims. None establishes complete shell filesystem/network isolation or published-artifact delivery.
package/docs/profiles.md CHANGED
@@ -1,37 +1,27 @@
1
- # Deepwork runtime profiles (0.1.9 source contract)
1
+ # Deepwork runtime profiles
2
2
 
3
- This guide describes the working 0.1.9 source contract, including C0 storage/capture, C native role/continuation policy, and D's native Plugins configuration UI and global module ceiling. DSMM is the package/Core display name; Deepwork remains the module and named-profile editor name. Package, storage and configuration IDs retain `dsmm` for compatibility. Real keyless rc.2 Web acceptance proves the Plugins item/bundle/row editors; it isn't evidence of a published 0.1.9 package, completed frozen-artifact gate, or Electron/Desktop execution. See [compatibility](compatibility.md) and [releasing](releasing.md). Historical release identities and completed 0.1.4/0.1.6 continuation evidence stay immutable. The published and historically Desktop-installed 0.1.7 has failed terminal verification, not a completed GitHub Release. The 0.1.8 npm publication is genuine but its original terminal receipt failed with GitHub skipped; the historical Desktop 0.1.7 and CLI/TUI 0.1.6 rollout identities stay unchanged until a separately completed successor. Earlier release-only 0.1.9 scope isn't a description of today's changed working source. The release Action controls retain the exact shared 20-minute 404 visibility budget and 45-minute verify job. E and actual Electron acceptance remain separate.
3
+ This guide describes the built source configuration. A published `@dsmm/dsmm@0.2.0` package doesn't automatically contain uncommitted source features; check the actual artifact before using these interfaces. Package availability and Host compatibility are separate from configuration validity. See [compatibility](compatibility.md) and [releasing](releasing.md).
4
4
 
5
- A Deepwork runtime profile is a named file containing runtime policy, not a native deployment profile or an Agent role preset. Native Settings → **Deepwork Profiles** / **Deepwork 配置档** provides create/read/edit/save, explicit apply, and reset to the deployment baseline. The native Agent preset selector remains a separate role selector, displaying `DW …` names under unchanged `dsmm-*` IDs.
5
+ A named Deepwork profile is a runtime-policy document, not a native deployment profile or Agent preset. Open **Settings → Deepwork Profiles** to browse and edit it. Native **Plugins → DSMM** edits deployment layers instead, as described in [settings and status](settings-status.md).
6
6
 
7
- ## Three independent configuration identities
7
+ ## Four independent states
8
8
 
9
- Native **Plugins → DSMM** edits the sparse global deployment base with the fixed `remote.dsmmConfig` service, independently of sessions or Deepwork mounting. The actual DSMM **bundle/row Config** pages additionally edit the selected native entry's profile override through its public Host `ConfigPageForm`. Runtime entry ID, native form namespace, package name and row ID are different identities: writes require the real namespace, raw base/user metadata and descriptor revision to match. The standalone Plugins item has no supplied form and explicitly marks this second layer unavailable rather than guessing it.
10
-
11
- Global and current native-profile override have separate Save/Refresh/Discard controls and revisions, never a shared Save all. Missing members inherit; explicit same-default members pin; Inherit unsets only this layer, not a higher Host pin. The full deployment grammar is editable through native booleans, enums, bounded scalars and collapsed schema-bound advanced objects/arrays. Raw invalid text and dirty conflicts remain visible. Connection/entry replacement and disposal fence writes; stale baselines require explicit refresh/discard. Global save changes only central `config.json`; profile save changes only the native patch with fixed Host revision. Neither writes a named JSONC document.
12
-
13
- The existing **Deepwork Profiles** editor remains separate, preserving custom/native model controls and **Use profile model**. It displays central/explicit/legacy origin and the immutable selected pin. Legacy origin is inspectable and refreshable, but New/Save/Apply/Reset and raw/structured edits are disabled; backend authority remains mandatory. Named/session apply is not global deployment save and doesn't gain broader model or session permissions.
14
-
15
- The DSMM Plugins inspector distinguishes merged desired/source, startup substrate, next-root capture, and an actual current session's admitted settings/named pin. Without a native session, current admission is unknown, not inferred from desired. Cold-off Core stays discoverable: saving global desired-on shows restart-required until a separate explicit Host restart. Host package enabled/loaded state is unknown when the public contract cannot observe it. See [native configuration](settings-status.md#native-plugins-configuration-d) for controls and concurrency.
16
-
17
- ## Files and document format
18
-
19
- The trusted `ProfileStore.fromCentral(home, profiledir, entryId)` factory separates shared documents from scoped state. Home comes from the public resolver through the declared filesystem peer: explicit `profileContext.home` wins over `DSH_HOME`, then the official `~/.dsh` default. `<resolvedDshHome>/plugins/dsmm` is a **DSMM-owned convention**, not an official mandated plugin layout. No client or model may supply an arbitrary root, profile identity or entry ID.
9
+ | State | What it means |
10
+ | --- | --- |
11
+ | Draft | Unsaved JSONC in the editor, including invalid input and comments |
12
+ | Saved revision | Validated bytes in the named document; Save changes only these bytes |
13
+ | Future-default pin | An immutable saved revision selected for new unscoped Agents |
14
+ | Current admission | The actual session's captured settings, profile revision and admission epoch |
20
15
 
21
- In the table, `<root>` means `<resolvedDshHome>/plugins/dsmm` and `<scope>` means SHA256 of the validated canonical native profile identity plus the actual DSMM entry ID. It isn't a display name or a hash of the session alone.
16
+ Browsing doesn't activate anything. **Save profile** doesn't select or apply it, even when its ID is already selected. **Set as future default** pins the saved revision, not the dirty draft, and leaves existing Agents unchanged. **Use baseline for future sessions** clears that default without deleting documents.
22
17
 
23
- | File | Purpose |
24
- | --- | --- |
25
- | `<root>/profiles/<id>.jsonc` | Shared editable named draft |
26
- | `<root>/profiles/.revisions/<sha256>.jsonc` | Shared immutable exact bytes pinned by an explicit apply |
27
- | `<root>/profiles/.state/<scope>/.selection.json` | Scoped default pointer: `{version: 1, id, revision}` |
28
- | `<root>/profiles/.state/<scope>/.sessions/<sha256(native-session-id)>.json` | Scoped explicit session choice: exact session ID, pinned profile/baseline, CAS revision and admission epoch; no history or credentials |
18
+ **Apply profile to current session** and **Pin baseline for current session** are separate actions. They target the native view's exact session ID, reserve a truly idle ordinary root, and require both selection CAS and the current admission epoch. Busy, maintenance-owned, disposed, replaced, child or unauthorized targets refuse; nothing is queued. A successful change updates only that root and future children. Existing children keep their original captures.
29
19
 
30
- The central scopes share the documents lock, so state namespaces don't bypass serialization of draft/revision writes. Sharing a draft doesn't share a selected revision: applying in native profile A doesn't change profile B's default or sidecars. “Global default” in the Profiles API means this runtime's scoped named default, not the separate `<root>/config.json` global deployment base. Reads don't create directories, locks or files.
20
+ The compact Conversation header menu switches the current-session profile while preserving the native model. Its separate **Use profile model** action asks native model selection to use the current admitted immutable profile's declared main model. It doesn't apply a later saved draft. Native model-default persistence follows the Models tab; newer manual model or effort intent wins. Sessionless controls never create a session.
31
21
 
32
- The old public constructor for an explicit `.../dsmm-profiles` root retains its existing contract. Runtime origin selection is separate: if the current native profile's exact `<profileContext.dir>/dsmm-profiles` path exists, that runtime binds to **strict read-only legacy compatibility**. It retains full immutable pins, selection and session records at that origin, without taking a lock or writing. It checks only the current known path, not all native profiles. Corrupt, missing, linked, digest-mismatched or unstable references refuse; a same-name central draft is never a fallback. Legacy save/apply/reset and sidecar mutations refuse rather than writing either library. See [copy/import boundaries](#copyimport-authority-and-rollback).
22
+ ## Document format
33
23
 
34
- IDs are filename-safe identifiers, not paths; reserved names, case collisions and link traversal are rejected. A document has exactly `version: 1`, `id`, optional `label`, and `settings`. For example, a draft named `careful.jsonc` may contain:
24
+ A document contains exactly `version: 1`, a filename-matching `id`, optional `label`, and `settings`. IDs contain 1 to 64 lowercase ASCII letters, digits, hyphens or underscores, start with a letter or digit, and can't be Windows reserved names. Labels are bounded text without control characters.
35
25
 
36
26
  ```jsonc
37
27
  {
@@ -39,89 +29,52 @@ IDs are filename-safe identifiers, not paths; reserved names, case collisions an
39
29
  "id": "careful",
40
30
  "label": "Careful review",
41
31
  "settings": {
42
- // Saving preserves this comment; apply pins these exact bytes.
43
- "defaultActive": true,
44
- "workflow": { "policy": "risk-based" },
32
+ // Omitted fields inherit the captured deployment baseline.
33
+ "locale": "en",
34
+ "roles": { "dsmm-quick": false },
35
+ "subagents": { "toolTopology": "parameterized" },
45
36
  "roleRouting": {
46
37
  "dsmm-reviewer": {
47
- "primary": {
48
- "provider": "my-existing-provider",
49
- "model": "my-existing-model",
50
- "reasoningEffort": "high"
51
- },
38
+ "primary": { "provider": "my-provider", "model": "review-model" },
39
+ "levels": { "high": { "reasoningEffort": "high" } },
52
40
  "fallbackRoutes": [],
53
- "strategy": "startup-lock",
54
- "rateLimit": { "maxRetries": 3, "maxTotalDelayMs": 30000 }
41
+ "strategy": "startup-lock"
55
42
  }
56
- },
57
- "runtimeRecovery": { "enabled": false }
43
+ }
58
44
  }
59
45
  }
60
46
  ```
61
47
 
62
- The example provider/model must be native-resolvable and advertise the specified effort. Catalog listing is advisory: a manually configured route can be resolvable while absent from the list. It introduces no provider, account or credential. Explicit `fallbackRoutes: []` disables that role's fallback chain; it is not equivalent to omitting the key and inheriting a global chain.
63
-
64
- ## Supported settings and precedence
65
-
66
- The exact top-level `settings` allowlist is:
67
-
68
- - `defaultActive`
69
- - `roleRouting`
70
- - `runtimePolicy` (optional inherited strategy and finite `rateLimit` defaults)
71
- - `workflow`
72
- - `guards`
73
- - `runtimeRecovery`
74
- - `deepseekV4ProCalibration`, `deepseekV4ProDefaultReasoningEffort`, `deepseekV4ProMaxReasoningPresets`
75
- - `deepseekFlashCalibration`, `deepseekFlashDefaultReasoningEffort`, `deepseekFlashMaxReasoningPresets`
76
-
77
- Existing nested validation and finite bounds still apply. Profiles reject deployment-only `roles`, `skills`, `modeName`, `promptOrder`, `section`, `presets`, `lsp`, `sessionPersistence`, and `subagents`, as well as global-only `modules`, embedded profiles, native provider/account/auth/header/env/install fields, arbitrary Cordis rows, and unknown fields. `subagents` describes native depth, capacity, background and continuation policy, not a named-profile runtime overlay. `modules.deepwork.enabled` is solely the global availability ceiling; native entry/profile and named overlays cannot enable it. Structural changes belong in deployment configuration and require restart. A guard setting cannot enable tools forbidden by a canonical read-only role composition.
78
-
79
- Effective settings resolve in this order: **built-in defaults → sparse global `config.json` → explicit native entry/profile override → selected immutable runtime revision**. Plain objects merge recursively; arrays replace. Missing keys inherit, and unset deletes only the edited layer's key. Explicit same-default values still override lower layers. Unknown/prototype keys, non-JSON values and raw refs are rejected before full merged validation. Structural settings aren't admitted through a named overlay. No named selection means the captured deployment baseline, not a synthetic default profile. Omitted fallback policy and explicit empty policy remain distinct. See [model routing](model-routing.md) and [settings/status](settings-status.md).
80
-
81
- ## Save versus apply
82
-
83
- Create or open a draft in native Settings and use the role-specific primary provider/model/exact-effort controls, ordered fallback rows, strategy and bounded retry fields. Each role can choose `startup-lock` or `rate-limit-fallback` independently; blank policy fields inherit, zero is explicit, and an empty fallback chain is not inheritance. Provider/model changes clear stale explicit effort. Catalog refresh preserves configured/manual values and does not select the native/global model default. Advanced JSONC remains available for custom routes and other supported settings.
84
-
85
- Saving validates the draft and preserves edited raw JSONC/comments, but doesn't activate it, even if the same ID is currently selected. Structured changes edit only their JSONC paths; invalid raw text remains visible and can't be silently normalized by returning to the form. Unsaved edits must be saved or explicitly discarded before switching away. Legacy-origin runtimes are read-only; these mutations require a writable central origin.
86
-
87
- **Apply saved profile** is a separate global-default operation. It checks the expected draft revision, validates runtime fields and native route/effort semantics, pins the draft's exact bytes in `.revisions`, and atomically commits `.selection.json`. Only after the pointer commit succeeds may the current in-memory selection change. The UI distinguishes the editable draft, selected immutable revision for future Agents, and an existing Agent's admitted snapshot. **Reset to baseline** clears the global runtime selection for future unscoped Agents; it does not delete drafts or mutate an existing Agent.
88
-
89
- **Current-session profile / Apply profile to current session** uses the actual native view's session ID, not the profile being edited or a guessed latest session. It commits only that session's sidecar under a genuine native idle-maintenance reservation. Both the expected sidecar revision and admission epoch must still match. **Pin baseline for current session** writes an explicit baseline choice without changing the global default. Sessionless Settings cannot apply to a session; busy, maintenance-owned, disposed, replaced, child or unauthorized targets refuse visibly. Cold targets are resumed only through native session authority after backend authorization and strict decoding.
90
-
91
- The Conversation header has one icon-only button opening the native Profile menu. Profile names, current selection, status, disabled reasons and refresh are shown only inside that menu, not as standalone header text. It is present on blank sessions and the sessionless welcome screen; without an actual session it is read-only and never creates a session or changes the global default. The single leading slot yields to any higher-priority native/plugin navigation owner.
92
-
93
- The menu has one profile list. Normal options switch only the session profile and preserve the current native model, with zero native model-selection calls. One separate `@use-model` action, **Use profile model**, reads the current admitted immutable profile's configured main model through DSH's native selection endpoint, so the picker and subsequent request agree. It does not reapply the profile or activate a later saved draft revision. An absent configured model, unavailable selection source or native refusal produces a short sanitized error; the admitted profile remains unchanged. Existing manual-model-intent race fencing preserves a newer native choice, including effort-only and same-value choices. Successes use accessible live announcements only, not visible success prose. Full editing and revisions remain in Settings. A refused profile change keeps the prior admission; refresh before retrying, with only allowlisted codes/fields and refresh/retry guidance. Refresh never applies a profile or selects a model on its own.
94
-
95
- The same compact menu offers a **Deepwork** toggle. Official minimal conversations default off unless saved explicit `deepwork/mode` intent exists. Explicit same-default choices persist durable intent; profile switching doesn't erase it or adopt a profile's `defaultActive`. Mode intent survives profile changes and reopen. DW presets default on but aren't locked: explicit off hides common workflow/DSMM skills while retaining persona, read-only and Git/host permissions. Sessionless, busy or unavailable mutations are disabled/refused, without creating a session. Normal menu rows omit verbose explanatory descriptions and the old duplicate profile-model list.
48
+ The provider/model must resolve through native DSH, and an exact effort must be supported. Catalog listings are advisory, not authentication or network-health checks. Manual/unlisted routes remain editable. See [model routing](model-routing.md) for level selection and route precedence.
96
49
 
97
- Save/apply requests use expected byte revisions. Cooperative writers share a lock; changes observed at the final revision recheck produce a conflict, so reread and reconcile. A non-cooperating external editor can still race between that recheck and rename; this isn't a universal editor transaction. Validation, missing file, revision conflict, lock/IO, authorization or activation failures must be visible, not reported as success. Invalid/missing/linked files and digest mismatches never silently select another profile or model. Pointer failure retains the prior disk selection and current settings; an unused immutable revision may remain.
50
+ Allowed runtime fields are `defaultActive`, `locale`, `roles`, `roleRouting`, `runtimePolicy`, `workflow`, `guards`, `runtimeRecovery`, `subagents.toolTopology`, and the `deepseekV4Pro`/`deepseekFlash` Calibration and DefaultReasoningEffort fields. Skills, prompt content, preset installation, LSP, session persistence, provider/account credentials, background/depth settings and `subagents.allowRouteOverride` remain deployment-only. `modules` is global-only. Unknown fields are rejected.
98
51
 
99
- Writable storage uses bounded validated content, containment/link checks under a cross-process writer lock, and same-directory atomic replacement. Lock timeouts are errors; stale-looking locks aren't stolen. Central and strict legacy reads don't create locks or files; the old explicit constructor retains its original cooperative-lock contract. Immutable revision files are never overwritten or hand-edited. Operations accept stable IDs, not arbitrary filesystem paths. Profile summaries don't expose credentials or deployment configuration. Deployment global saves and native profile-override saves are separate from named-profile RPC; neither is a cross-layer transaction.
52
+ `deepseekV4ProMaxReasoningPresets` and `deepseekFlashMaxReasoningPresets` are rejected with `deprecated-field`. They aren't silently ignored or migrated. Configure explicit `roleRouting[id].levels.low/high/max` instead; `normal` is the invocation default, not a configurable level entry. Orchestrator levels aren't supported.
100
53
 
101
- ## Agent lifetime and restart
54
+ ## Inheritance and ceilings
102
55
 
103
- Global applying or resetting affects **new unscoped Agents only**. Every existing live Agent, including a blank one, retains its admitted immutable runtime snapshot. An explicit current-session apply is different: a truly idle ordinary root receives a new immutable admission epoch after the durable sidecar commit. Even reapplying the same revision creates a new epoch. Existing children retain their captured old epoch; later genuinely owned native children inherit the new one. Other roots, the global default, completed tools and native persona/tool/skill composition remain unchanged.
56
+ Effective policy resolves from **built-in defaults → sparse global deployment → explicit native entry/profile override → immutable named overlay**. Missing members inherit, arrays replace, and explicit empty fallback chains remain empty. A named primary or level route replaces that route value, including removal of omitted effort, rather than retaining an old route's effort.
104
57
 
105
- Repeated role-policy admission, including DSMM reinstallation while the exact native child remains live, retains that child's captured role, read-only flag, frozen tool filter and epoch. It verifies the child's original capture and exact live native owner, not the parent's later mode or profile epoch. Owner/capture mismatches refuse rather than downgrading the child to ordinary authority. A new child or cold residency still follows native ownership and descriptor admission; retained tool-definition realms aren't reset by reinstallation.
58
+ Named `roles` can narrow availability, not lift the captured deployment or startup ceiling. Orchestrator, Planner and Plan Critic can't be disabled by a named profile. Under legacy workflow policy, Reviewer is also required when final review isn't off, and Oracle is required for `simple-oracle-complex-reviewer`. Required status doesn't create missing startup capabilities. The editor shows required reason, startup availability, deployment enablement, admitted state, and source/capture separately; routing remains editable for disabled roles.
106
59
 
107
- Startup first awaits global/profile merge and full validation, then freezes the snapshot before any consumer mounts. Late install/injection doesn't reread desired values. Each new ordinary root awaits current valid desired deployment plus the applied immutable named overlay. Existing parents and their future children retain the entire captured deployment/settings snapshot and epoch, not just the named revision. An idle profile switch changes only the allowed overlay on that root's old deployment baseline; it doesn't absorb later global/profile saves. `getSettings(agent)` is authoritative; no-argument `getSettings()` remains the validated runtime named default, not desired deployment.
60
+ `locale` supports `en`, `zh-Hans`, `zh-Hant`, `ja`, `ko`, `de`, `fr`, `es`, `pt-BR`, and `ru`. Omission inherits deployment preference, then applicable native/user language guidance or conversation context. A current user's explicit output-language request wins and should be preserved in child assignments. Locale affects visible replies, plans and role output only, not internal reasoning, UI/project locale, identifiers, commands or exact quotations. A parent's later profile change doesn't rewrite a child's captured preference.
108
61
 
109
- `modeName`, `promptOrder`, standing presets, materialization and LSP stay startup-scoped. Role and subagent policy is intersected with the startup substrate and original permissions. A missing startup capability requires explicit restart; there is no idle/restart queue. Saving desired off doesn't cancel an old admitted consumer: C's native role, continuation, capture and permission consumers retain their admitted policy.
62
+ ## JSONC, diagnostics and concurrency
110
63
 
111
- The D0 global-only `modules.deepwork.enabled` defaults to `true` independently of ordinary `defaultActive:false`; D exposes it only in Global DSMM, with no profile bypass checkbox. New ordinary roots admit current global desired only if DW mounted at startup. Existing roots/future children retain their captured module value; idle profile selection cannot re-enable an off root or pull newer global state. Mode-on refuses when the admitted module is off, without deleting saved mode intent. An explicit mode-off replaces persisted on intent and advances its revision even when effective activity is already off; repeated explicit off is a no-op. Independent module-on startup/resume still honors that saved off intent. Cold-off keeps core storage, admission, profile/CAS/global configuration and mandatory permissions usable, but desired-on remains restart-required until an independent restart. Optional session snapshots expose safe `modules` and admitted `configuration` projections; inspect `desired.capture` before interpreting module values as current-global state. See [the module ceiling and control-plane API](settings-status.md#global-module-ceiling-d0). The new native Plugins pages don't restart, reconcile, cancel or respawn LSP on save.
64
+ Structured controls and Advanced JSONC edit the same draft. Path edits preserve unrelated bytes and comments. Invalid raw input stays visible and isn't normalized by switching back to the form. Save or explicitly discard dirty changes before changing the editor's document or selecting its saved revision.
112
65
 
113
- Native model selection is separate user intent, not a profile sidecar setting. Every ordinary top-level request respects the native assembled provider/model/effort, including an implicit default with no prior selection event. Profile primary/defaults and calibration never overwrite it. An effort-only or same-value native selection still fences stale retry work. Parent model choice does not overwrite a configured child's own role route. Structured editing, save, global apply and normal session apply never select the native/global model default. Only **Use profile model** invokes native model selection, with the same background-default persistence behavior as the Models tab; later manual model changes remain authoritative. Mode intent is a separate saved `deepwork/mode` event, retained across admission/profile changes and cold resume.
66
+ The only nonblocking warning is `blank-label`: the profile ID is used for display, and the original document can still be saved and selected. Saved, draft, future-pin and current-admission warnings are distinct. Validation errors carry a stable reason, schema-safe field and, when available, JSONC offset/length and line/column. Unknown key names aren't echoed as trusted diagnostic fields. Duplicate keys, unsafe keys, malformed routes, unsupported values and retired fields block validation.
114
67
 
115
- After restart, a session with a committed sidecar uses that origin's exact immutable revision or explicit baseline, even if its draft/named default changed. Cold resume creates a new live admission using current valid desired deployment; it doesn't restore the exited process's old in-memory deployment snapshot. A session without a sidecar preserves the historical scoped-global-current behavior; it doesn't infer a previous profile from lineage/history. Corrupt, missing, linked or digest-mismatched sidecars/revisions fail visibly instead of falling back to baseline or a central same-name draft. Sidecars add no new session event vocabulary, so stock native history readers remain authoritative. Native clear/compact changes the session identity and doesn't automatically transfer an old choice.
68
+ Saves and selections require expected revisions. Cooperative writers share a lock, recheck the revision before commit, and use same-directory atomic replacement. A conflict retains the draft and prior selection: refresh and reconcile explicitly. A non-cooperating editor can still race between the final recheck and rename; this isn't a universal external-editor transaction. Failed pointer commits retain the prior selection, though an unused immutable revision may remain.
116
69
 
117
- Older sessions whose selected root ID is now auxiliary-only may fail native cold resume with an unknown preset ID. Read [compatibility](compatibility.md) before upgrading; never silently switch their persona or erase history.
70
+ ## Storage and lifetime
118
71
 
119
- ## Copy/import, authority and rollback
72
+ The central store is `<resolvedDshHome>/plugins/dsmm/profiles/`, a DSMM convention. Trusted home resolution uses explicit `profileContext.home`, then `DSH_HOME`, then the official `~/.dsh` default. Shared named drafts and immutable revisions are separate from selection/session state scoped to canonical native profile identity and the actual DSMM entry ID. Reads don't create files or locks. Clients and models can't choose arbitrary roots or entry identities.
120
73
 
121
- C0 provides fixture-verified, explicit non-destructive copy/import boundaries, not a production migration framework or completed private migration. A later real import needs separate authorization for the exact source. Preserve draft bytes, immutable revisions and source-scoped selection/session records; reject target name/revision conflicts rather than overwrite. Validate the full reference graph before explicitly switching that scope's origin. Don't delete, rename or modify the source, scan other profiles, infer cross-store references, or move native auth/sessionPersistence logs into the central library.
74
+ An existing exact `<profileContext.dir>/dsmm-profiles` library binds that runtime to strict read-only legacy storage. Its original pins and session records remain authoritative; a same-name central document isn't a fallback. Invalid, missing, linked, unstable or digest-mismatched references refuse. There is no automatic copy, migration or source deletion. Explicit import needs separate source authority and must preserve the reference graph without overwriting conflicts.
122
75
 
123
- For older 0.1.1 settings, explicitly save supported runtime values as a named draft, preserve deployment roles/skills/provider/account/UI rows, inspect, then apply separately. Named-profile operations don't rewrite `cordis.patch.yml` or migrate credentials. Backend native RPC authorization remains mandatory. There are no model-visible profile-management tools, child write capabilities, anonymous endpoints or authentication bypasses. The fixed deployment `dsmmConfig` describe/save service has its own local writable operator and precommit connection/lifetime requirements, described in [settings/status](settings-status.md#save-authority-and-concurrency); it isn't an import API.
76
+ Startup freezes deployment and mounted capabilities before consumers install. New ordinary roots capture current valid desired deployment plus the selected immutable overlay. Existing roots, including blank ones, keep their full captures; idle profile Apply replaces only the allowed overlay on that root's old deployment baseline. `getSettings(agent)` is authoritative for an existing Agent. Cold resume creates a new live admission from current valid deployment and its committed sidecar, or the scoped future default when no sidecar exists; it doesn't restore an exited process's memory snapshot.
124
77
 
125
- For policy rollback, explicitly choose global baseline, session baseline, or a reviewed prior profile in the intended scope using current CAS/epoch values. Never overwrite an immutable revision or restore draft bytes over a later user edit. Global rollback leaves existing live Agents unchanged; scoped rollback changes only the admitted idle root and future children. Package rollback is separate and uses an exact known immutable package through the official carrier; see [releasing](releasing.md).
78
+ Profile Apply never changes the native root model, remounts startup services or upgrades role permissions. Deepwork mode intent is separately saved and survives profile changes. Children retain their original route/locale/authority evidence, intersected with current exact-parent authority for delivery; see [Agent presets and child control](agent-presets.md).
126
79
 
127
- 0.1.4 documents remain loadable without rewriting user files. Omitted strategy now means the safer `startup-lock`; a legacy generic fallback chain no longer silently hops after later generic failures. `runtimeRecovery.enabled` is not the strategy selector. Read [runtime recovery](runtime-recovery.md) before upgrading a configuration that depended on generic automatic fallback.
80
+ *Author's note: For a DSH operator editing named policy; save first, then choose the intended future or current-session scope explicitly.*