@dsmm/dsmm 0.0.0-stage → 0.1.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 (125) hide show
  1. package/LICENSE +103 -0
  2. package/README.md +67 -2
  3. package/agent-presets/dsmm-builder/agent.cordis.yml +210 -0
  4. package/agent-presets/dsmm-builder/preset.yml +3 -0
  5. package/agent-presets/dsmm-clarifier/agent.cordis.yml +34 -0
  6. package/agent-presets/dsmm-clarifier/preset.yml +3 -0
  7. package/agent-presets/dsmm-code-search/agent.cordis.yml +34 -0
  8. package/agent-presets/dsmm-code-search/preset.yml +3 -0
  9. package/agent-presets/dsmm-creative/agent.cordis.yml +31 -0
  10. package/agent-presets/dsmm-creative/preset.yml +3 -0
  11. package/agent-presets/dsmm-doc-search/agent.cordis.yml +34 -0
  12. package/agent-presets/dsmm-doc-search/preset.yml +3 -0
  13. package/agent-presets/dsmm-media-reader/agent.cordis.yml +34 -0
  14. package/agent-presets/dsmm-media-reader/preset.yml +3 -0
  15. package/agent-presets/dsmm-oracle/agent.cordis.yml +31 -0
  16. package/agent-presets/dsmm-oracle/preset.yml +3 -0
  17. package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +31 -0
  18. package/agent-presets/dsmm-oracle-2nd/preset.yml +3 -0
  19. package/agent-presets/dsmm-orchestrator/agent.cordis.yml +215 -0
  20. package/agent-presets/dsmm-orchestrator/preset.yml +3 -0
  21. package/agent-presets/dsmm-plan-critic/agent.cordis.yml +33 -0
  22. package/agent-presets/dsmm-plan-critic/preset.yml +3 -0
  23. package/agent-presets/dsmm-planner/agent.cordis.yml +33 -0
  24. package/agent-presets/dsmm-planner/preset.yml +3 -0
  25. package/agent-presets/dsmm-reviewer/agent.cordis.yml +33 -0
  26. package/agent-presets/dsmm-reviewer/preset.yml +3 -0
  27. package/cordis.patch.yml +8 -0
  28. package/docs/agent-presets.md +17 -0
  29. package/docs/compatibility.md +46 -0
  30. package/docs/design.md +237 -0
  31. package/docs/lsp.md +40 -0
  32. package/docs/migration-from-ocmm.md +48 -0
  33. package/docs/model-routing.md +16 -0
  34. package/docs/releasing.md +50 -0
  35. package/docs/research/deepseek-v4-pro.md +74 -0
  36. package/docs/research/oh-dsh.md +96 -0
  37. package/docs/roadmap.md +207 -0
  38. package/docs/runtime-recovery.md +67 -0
  39. package/docs/safety-guards.md +55 -0
  40. package/docs/settings-status.md +51 -0
  41. package/docs/skill-sync.md +20 -0
  42. package/lib/commands.d.ts +13 -0
  43. package/lib/commands.js +55 -0
  44. package/lib/dsh-events.d.ts +13 -0
  45. package/lib/dsh-events.js +2 -0
  46. package/lib/dsh-types.d.ts +308 -0
  47. package/lib/dsh-types.js +2 -0
  48. package/lib/guards.d.ts +10 -0
  49. package/lib/guards.js +252 -0
  50. package/lib/index.d.ts +31 -0
  51. package/lib/index.js +54 -0
  52. package/lib/lsp.d.ts +30 -0
  53. package/lib/lsp.js +154 -0
  54. package/lib/mode.d.ts +6 -0
  55. package/lib/mode.js +62 -0
  56. package/lib/model-family.d.ts +6 -0
  57. package/lib/model-family.js +49 -0
  58. package/lib/model-routing.d.ts +11 -0
  59. package/lib/model-routing.js +103 -0
  60. package/lib/plan-validation.d.ts +3 -0
  61. package/lib/plan-validation.js +119 -0
  62. package/lib/preset-materializer.d.ts +36 -0
  63. package/lib/preset-materializer.js +258 -0
  64. package/lib/preset-registry.d.ts +5 -0
  65. package/lib/preset-registry.js +126 -0
  66. package/lib/preset-skills.d.ts +12 -0
  67. package/lib/preset-skills.js +28 -0
  68. package/lib/prompts.d.ts +13 -0
  69. package/lib/prompts.js +82 -0
  70. package/lib/recovery-policy.d.ts +25 -0
  71. package/lib/recovery-policy.js +252 -0
  72. package/lib/role-subagents.d.ts +6 -0
  73. package/lib/role-subagents.js +54 -0
  74. package/lib/roles.d.ts +28 -0
  75. package/lib/roles.js +239 -0
  76. package/lib/runtime-recovery.d.ts +5 -0
  77. package/lib/runtime-recovery.js +149 -0
  78. package/lib/session-scope.d.ts +4 -0
  79. package/lib/session-scope.js +17 -0
  80. package/lib/settings.d.ts +112 -0
  81. package/lib/settings.js +363 -0
  82. package/lib/shell-command.d.ts +18 -0
  83. package/lib/shell-command.js +492 -0
  84. package/lib/skills.d.ts +18 -0
  85. package/lib/skills.js +64 -0
  86. package/lib/state.d.ts +13 -0
  87. package/lib/state.js +64 -0
  88. package/lib/status.d.ts +46 -0
  89. package/lib/status.js +155 -0
  90. package/package.json +124 -4
  91. package/patches/agent-presets-root.example.cordis.patch.yml +14 -0
  92. package/patches/ocmm-lsp-mcp.example.cordis.patch.yml +15 -0
  93. package/prompts/deepseek-flash.md +11 -0
  94. package/prompts/deepseek-v4-pro.md +14 -0
  95. package/prompts/deepwork.md +32 -0
  96. package/skills/brainstorming/SKILL.md +15 -0
  97. package/skills/debugging/SKILL.md +12 -0
  98. package/skills/debugging/references/logging.md +91 -0
  99. package/skills/debugging/references/methodology/00-setup.md +108 -0
  100. package/skills/debugging/references/methodology/02-investigate.md +67 -0
  101. package/skills/debugging/references/methodology/03-flaky-triage.md +69 -0
  102. package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +83 -0
  103. package/skills/debugging/references/methodology/05-escalate.md +69 -0
  104. package/skills/debugging/references/methodology/06-fix.md +123 -0
  105. package/skills/debugging/references/methodology/08-qa.md +94 -0
  106. package/skills/debugging/references/methodology/09-cleanup.md +164 -0
  107. package/skills/debugging/references/methodology/partial-runtime-evidence.md +217 -0
  108. package/skills/debugging/references/runtimes/bundled-js-binary.md +415 -0
  109. package/skills/debugging/references/runtimes/go.md +252 -0
  110. package/skills/debugging/references/runtimes/native-binary.md +484 -0
  111. package/skills/debugging/references/runtimes/node.md +260 -0
  112. package/skills/debugging/references/runtimes/python.md +248 -0
  113. package/skills/debugging/references/runtimes/rust.md +234 -0
  114. package/skills/debugging/references/scripts/dap.mjs +533 -0
  115. package/skills/debugging/references/tools/dap.md +89 -0
  116. package/skills/debugging/references/tools/ghidra.md +212 -0
  117. package/skills/debugging/references/tools/playwright-cli.md +316 -0
  118. package/skills/debugging/references/tools/pwndbg.md +263 -0
  119. package/skills/debugging/references/tools/pwntools.md +265 -0
  120. package/skills/dispatching-parallel-agents/SKILL.md +14 -0
  121. package/skills/receiving-code-review/SKILL.md +13 -0
  122. package/skills/remove-ai-slops/SKILL.md +14 -0
  123. package/skills/requesting-code-review/SKILL.md +10 -0
  124. package/skills/subagent-driven-development/SKILL.md +13 -0
  125. package/skills/writing-plans/SKILL.md +14 -0
@@ -0,0 +1,207 @@
1
+ # dsmm Roadmap
2
+
3
+ Date: 2026-08-21
4
+
5
+ ## Version principles
6
+
7
+ - Each version must produce a working dsh-native increment.
8
+ - Deepwork remains opt-in through a dsmm-provided dsh custom mode unless the user explicitly enables auto-entry in settings.
9
+ - Configuration comes before breadth: every major feature must have an enable/disable or tuning surface.
10
+ - ocmm parity is phased after the MVP proves dsh package, mode, and settings mechanics.
11
+
12
+ ## v0.1 — MVP custom mode bundle
13
+
14
+ ### Goal
15
+
16
+ Create the smallest useful dsmm dsh bundle: installable, mode-scoped, configurable, and calibrated for DeepSeek V4 Pro when enabled.
17
+
18
+ ### Deliverables
19
+
20
+ - `package.json` with `dsh.bundle.patch`.
21
+ - `cordis.patch.yml` that inserts dsmm rows without replacing dsh base behavior.
22
+ - Host plugin entry that registers dsmm settings and prompt/mode contributions.
23
+ - `deepwork` custom mode implementation, modelled on dsh plan-mode semantics because current public dsh docs expose `@deepseek-ai/dsh-plan-mode` rather than a generic arbitrary-mode package.
24
+ - `/deepwork [off|message]` command if the current dsh command service supports it; otherwise documented profile-level activation fallback.
25
+ - Minimal deepwork prompt text adapted from ocmm.
26
+ - Minimal skill set:
27
+ - brainstorming
28
+ - writing-plans
29
+ - requesting-code-review
30
+ - receiving-code-review
31
+ - Documented settings namespace.
32
+ - Docker smoke test instructions for installing into a disposable dsh profile.
33
+
34
+ ### Acceptance
35
+
36
+ - `dsh plugin add ./dsmm` or packed equivalent activates the dsmm bundle in a disposable profile.
37
+ - A dsh session outside `deepwork` mode does not receive dsmm workflow instructions.
38
+ - A dsh session inside `deepwork` mode receives the dsmm workflow section.
39
+ - Switching the mode off restores ordinary dsh prompt behavior.
40
+ - Settings can disable DeepSeek V4 Pro calibration without removing the bundle.
41
+
42
+ ## v0.2 — Role and agent preset parity
43
+
44
+ ### Goal
45
+
46
+ Port ocmm's role model into dsh-native agent presets.
47
+
48
+ ### Deliverables
49
+
50
+ - Orchestrator, planner, plan-critic, reviewer, doc-search, code-search, clarifier, and media-reader role prompts.
51
+ - Initial oracle/oracle-2nd mapping if the current dsh agent model supports external-model review lanes.
52
+ - Role-specific prompt scoping so dsmm mode does not leak into unrelated agents.
53
+ - Settings to enable or disable individual role presets.
54
+
55
+ ### Acceptance
56
+
57
+ - A dsmm orchestrator session can route to planner/reviewer/search roles through dsh-native mechanisms.
58
+ - Disabled role presets are absent from model-facing choices.
59
+
60
+ ## v0.3 — Workflow skill completeness
61
+
62
+ Status: completed in the v0.3 implementation. dsmm now bundles the full seven-skill workflow set and exposes mode-scoped workflow policy settings for strict gates, review caps, and final review routing.
63
+
64
+ ### Goal
65
+
66
+ Bring the deepwork workflow to practical parity for planning and review flows.
67
+
68
+ ### Deliverables
69
+
70
+ - Add remaining workflow skills:
71
+ - subagent-driven-development
72
+ - dispatching-parallel-agents
73
+ - remove-ai-slops
74
+ - Skill provider layout compatible with dsh skill discovery.
75
+ - Skill settings for enabling strict gates, review caps, and final review policy.
76
+ - Prompt sync notes for maintaining ocmm/dsmm workflow text.
77
+
78
+ ### Acceptance
79
+
80
+ - The mode can guide a user from brainstorm to plan to review using dsmm skills.
81
+ - A user can disable any non-core skill through settings.
82
+
83
+ ## v0.4 — Safety and guard layer
84
+
85
+ Status: implemented in the v0.4 implementation. The guard layer is covered by settings defaults/overrides, guard decision tests, prompt asset tests, Docker smoke asset checks, and the Docker smoke script.
86
+
87
+ ### Goal
88
+
89
+ Port the highest-value ocmm safety policies into dsh tool events.
90
+
91
+ ### Deliverables
92
+
93
+ - Shell command safety for PowerShell and POSIX-like shells.
94
+ - Git write guard with explicit permission requirements.
95
+ - Tool-output truncation policy.
96
+ - Basic plan-format validation.
97
+ - Question-label and todo-discipline helpers if dsh exposes compatible surfaces.
98
+
99
+ ### Acceptance
100
+
101
+ - Implemented guard behavior is scoped to dsmm mode or dsmm-managed agents by default, with `always` and `off` settings coverage.
102
+ - Every implemented guard has a settings toggle and documented `[dsmm safety]` failure message in `docs/safety-guards.md`.
103
+
104
+ ## v0.5 — MCP and LSP integration
105
+
106
+ Status: implemented in v0.5 with disabled-by-default LSP settings, an opt-in `@deepseek-ai/dsh-mcp-client` patch for `ocmm-lsp mcp`, user documentation, direct MCP `tools/list`/diagnostics smoke coverage, and Docker dsh MCP bridge diagnostics smoke coverage.
107
+
108
+ ### Goal
109
+
110
+ Expose ocmm's LSP value through dsh MCP mechanisms.
111
+
112
+ ### Deliverables
113
+
114
+ - dsh MCP client configuration for `ocmm-lsp` or a renamed `dsmm-lsp` wrapper.
115
+ - LSP tool documentation for diagnostics, symbols, definitions, references, and rename.
116
+ - Docker smoke test that verifies the MCP server lists tools.
117
+
118
+ ### Acceptance
119
+
120
+ - A disposable dsh profile can call at least one LSP diagnostic tool through MCP.
121
+ - Users can keep MCP/LSP disabled while using only dsmm mode prompts.
122
+
123
+ ## v0.6 — Model routing and DeepSeek V4 Pro calibration
124
+
125
+ Status: implemented in v0.6 with provider-aware family classification, exact-route DeepSeek V4 Pro prompt/request calibration, preset-derived max reasoning, adapter capability negotiation, and pinned DSH `agent/request` waterfall coverage.
126
+
127
+ ### Goal
128
+
129
+ Port ocmm's model-family routing and add dsh-native DeepSeek V4 Pro tuning.
130
+
131
+ ### Deliverables
132
+
133
+ - Model-family classifier adapted from ocmm.
134
+ - Variant-to-reasoning policy for dsh `ctx.llm` or `agent/request` seams.
135
+ - DeepSeek V4 Pro settings:
136
+ - calibration off/auto/strict
137
+ - default reasoning effort
138
+ - max reasoning trigger categories
139
+ - tool-call reasoning retention checks where the dsh adapter exposes them
140
+ - Tests for routing decisions.
141
+
142
+ ### Acceptance
143
+
144
+ - DeepSeek V4 Pro deepwork sessions default to high reasoning for complex work.
145
+ - Max reasoning is reserved for configured high-rigor task classes.
146
+ - Non-DeepSeek models do not receive DeepSeek-specific prompt overlays.
147
+
148
+ ## v0.7 — Runtime recovery
149
+
150
+ Status: implemented in v0.7 with host-first request-error policy, bounded configured route fallback reconstructed from durable request headers, opt-in todo/goal continuation, documented subagent recovery boundaries, and pinned DSH rc.2 packaged-runtime coverage.
151
+
152
+ ### Goal
153
+
154
+ Rebuild ocmm's runtime recovery features using dsh-native sessions and events.
155
+
156
+ ### Deliverables
157
+
158
+ - Session error classification.
159
+ - Retry/fallback policy.
160
+ - Idle continuation policy for dsmm-managed tasks.
161
+ - Interrupted subagent recovery notes or implementation, depending on dsh event support.
162
+
163
+ ### Acceptance
164
+
165
+ - Recovery events are durable or reconstructable from dsh session logs.
166
+ - Users can disable runtime recovery while keeping prompts and skills active.
167
+
168
+ ## v0.8 — UI/settings polish
169
+
170
+ Status: implemented in v0.8 with a fixed `/dsmm-status [json]` host command, deterministic defensive status snapshots, normalized file-based settings documentation for Web/headless/future TUI use, and pinned DSH rc.2 packaged-command coverage.
171
+
172
+ ### Goal
173
+
174
+ Expose dsmm settings ergonomically in dsh web-compatible surfaces while keeping headless support.
175
+
176
+ ### Deliverables
177
+
178
+ - Optional client/settings panel if dsh client plugin APIs are stable.
179
+ - Human-readable mode status and active calibration indicators.
180
+ - Documentation for web/headless/TUI profiles.
181
+
182
+ ### Acceptance
183
+
184
+ - Headless users can configure dsmm through files.
185
+ - Web users can inspect effective dsmm settings without editing YAML manually.
186
+
187
+ ## v1.0 — Stable dsmm release
188
+
189
+ Status: initial package release selected as dsmm 0.1.0; the v1.0 stable milestone remains future work.
190
+
191
+ ### Goal
192
+
193
+ Publish dsmm as a stable dsh plugin with documented compatibility and migration paths.
194
+
195
+ ### Deliverables
196
+
197
+ - npm-ready package.
198
+ - dsh compatibility matrix.
199
+ - Docker integration checks.
200
+ - Migration guide from ocmm.
201
+ - Release checklist and rollback notes.
202
+
203
+ ### Acceptance
204
+
205
+ - Fresh users can install dsmm into a new dsh profile and run deepwork mode from the documented steps.
206
+ - Existing ocmm users can understand which features are equivalent, redesigned, or unavailable.
207
+ - The release process does not require global dsh configuration mutation.
@@ -0,0 +1,67 @@
1
+ # Runtime recovery
2
+
3
+ ## Scope and defaults
4
+
5
+ Runtime recovery is an opt-in, restart-scoped DSMM setting. Its complete default is:
6
+
7
+ ```yaml
8
+ runtimeRecovery:
9
+ enabled: false
10
+ retryOnStatusCodes: [429, 500, 502, 503, 504]
11
+ retryOnCodes: []
12
+ fallbackRoutes: []
13
+ maxFallbackAttempts: 2
14
+ idleContinuation:
15
+ enabled: false
16
+ maxContinuations: 3
17
+ prompt: "Continue the current task from the durable goal or unfinished todo list. Do not repeat completed work."
18
+ ```
19
+
20
+ `maxFallbackAttempts` and `idleContinuation.maxContinuations` are finite integer caps floored and clamped to `0..10`. An empty `fallbackRoutes` list is valid and supplies no provider/model fallback. When runtime recovery is disabled (`enabled` is false), recovery is isolated: it does not disable or alter DSMM prompts, skills, guards, LSP, or model routing.
21
+
22
+ ## Host retry and fallback routes
23
+
24
+ The host `agent/request-error` decision wins by identity. DSMM calls downstream first and acts only after the host declines to retry. It classifies failures using exact integer status membership and lowercased exact code membership only; it performs no message parsing or provider-message classification.
25
+
26
+ For a host-declined, retryable failure, the failed provider must match the latest request header before DSMM can select a route. Attempted routes are reconstructed from durable request headers: the latest valid header before the target `step/start` is inherited, then valid route changes within that same turn and step are appended. DSMM chooses only the first unattempted, non-failed fallback in configured order. It does not discover providers, infer a heuristic chain, or reorder the configured list.
27
+
28
+ `maxFallbackAttempts` counts selected fallback routes after the primary route. A cap of zero selects none; an exhausted cap, invalid route, missing header, provider mismatch, disabled setting, aborted signal, or non-retryable failure leaves the host decision unchanged. The selected route is held in process-local state behind a one-shot `(agent, turn, step)` fence. DSMM makes no timer or provider call itself and does not replace the host retry backoff policy.
29
+
30
+ ## Request ordering
31
+
32
+ The default recovery `agent/request` listener is downstream of the prepend model routing listener. It first receives the downstream request configuration, then applies a matching pending fallback route and removes stale adapter-owned `reasoningEffort`. All other downstream fields are preserved.
33
+
34
+ The outer model routing listener sees the final route. It calibrates reasoning only for a supported exact V4 Pro or native V41 Flash route; a fallback does not broaden the existing matches. A route change removes stale adapter-owned reasoning effort; DSMM does not set temperature or create a second capability registry, and the final adapter remains responsible for supported call parameters.
35
+
36
+ Duplicate failure delivery cannot select a second pending fallback. Closed or superseded turn/step boundaries, aborted signals, and expired pending routes are ignored. HTTP 402 requires explicit membership in `retryOnStatusCodes`; generic retry-code membership cannot silently authorize a paid-route change. No real billing/rate-limit error is manufactured for testing.
37
+
38
+ ## Durable continuation
39
+
40
+ Idle continuation is separately opt-in. It is eligible only for an active deepwork session or selected DSMM preset when the signal is not aborted and the durable state shows either a latest current-turn todo with `pending` or `in_progress` status, or a latest active goal. The cap is per live agent and turn, so each live agent/turn pair gets at most `maxContinuations` steering attempts.
41
+
42
+ The continuation uses this exact user message:
43
+
44
+ > Continue the current task from the durable goal or unfinished todo list. Do not repeat completed work.
45
+
46
+ Steering failure consumes an attempt and produces a sanitized warn/fail-open result: it never rejects turn shutdown. DSMM emits only fixed sanitized warnings: `dsmm runtime recovery could not evaluate fallback; preserving the host request-error decision` and `dsmm runtime recovery continuation steering failed for turn <turn>`.
47
+
48
+ ## Cold restart
49
+
50
+ Durable route/header work can be reconstructed after a cold restart from session events. Process-local pending-route and continuation-count state cannot. There is no continuation until the user or host resumes a turn, which prevents DSMM from fabricating a cross-process retry or continuation loop.
51
+
52
+ ## Subagent recovery
53
+
54
+ Continuable child sessions differ from one-shot children: a continuable child has a known session that can be resumed deliberately, while a one-shot child has no safe automatic follow-up contract. `subagent/end` is live-only diagnostic information, not a durable recovery trigger.
55
+
56
+ To investigate an interrupted child, use the native durable descriptor and child control/session surfaces. Explicitly continue a known continuable child only when the host/user has the required context; one-shot role tools are not continuable sessions. DSMM never synthesizes a parent prompt, parent session, or task ID, and it does not automatically follow up a child or parent. Native delegation depth and permission restrictions remain authoritative; DSMM does not raise the host's default depth.
57
+
58
+ ## Non-goals and logging
59
+
60
+ - No fake or extended `llm/retry` events.
61
+ - No retry timer or backoff replacement, no timers, no session aborts, and no background polling.
62
+ - No cross-process automatic retry.
63
+ - No provider discovery or heuristic fallback chain.
64
+ - No provider-message parsing or classification, and no provider calls outside the host request loop.
65
+ - No automatic child followup. No automatic parent followup.
66
+
67
+ Warnings are fixed and sanitized; they omit request bodies, provider error bodies, credentials, todo text, goal text, and arbitrary exception details.
@@ -0,0 +1,55 @@
1
+ # DSMM Safety Guards
2
+
3
+ DSMM uses DSH 0.2-native safety guards on the tools pipeline. The guards use `tools/pre-execute` for allow, deny, and ask decisions, and `tools/post-execute` for accepted-result truncation. They do not use OpenCode hook names and do not mutate tool arguments. Profile configuration belongs in the `id: dsmm` Loader entry's `config` object, not the removed settings.yaml namespace.
4
+
5
+ ## Scope
6
+
7
+ The default scope is `deepwork-or-dsmm-agent`: guards apply only when the current agent is in DSMM deepwork mode or uses a DSMM-managed preset id. For preset selection, the most recent `agent-preset/selected` session event takes precedence over `session.header.agentPreset`; the header is only the fallback when no selection event supplies a preset. Set `guards.scope: always` to apply them to every tool call in the profile, or `guards.scope: off` to disable all DSMM guard enforcement.
8
+
9
+ ## Settings
10
+
11
+ ```yaml
12
+ dsmm:
13
+ guards:
14
+ scope: deepwork-or-dsmm-agent
15
+ shellCommandSafety: true
16
+ gitWriteGuard: ask
17
+ toolOutputTruncation:
18
+ enabled: true
19
+ maxInlineBytes: 12000
20
+ planFormatValidation: true
21
+ questionLabelHelper:
22
+ enabled: true
23
+ maxLabelChars: 30
24
+ todoDisciplineHelper: true
25
+ ```
26
+
27
+ ## Failure messages
28
+
29
+ All DSMM guard messages begin with `[dsmm safety]`.
30
+
31
+ - `[dsmm safety] PowerShell command appears to use POSIX shell syntax (...)` rejects clear POSIX-only syntax such as `export` in `pwsh`.
32
+ - `[dsmm safety] PowerShell command uses POSIX null redirection (...)` rejects `/dev/null` in `pwsh`.
33
+ - `[dsmm safety] PowerShell command uses POSIX \`source\` (...)` rejects `source` in `pwsh`.
34
+ - `[dsmm safety] bash command appears to use PowerShell syntax (...)` rejects `$env:` in `bash`.
35
+ - `[dsmm safety] git write command requires explicit user approval before running: git ...` requests host approval for mutating git operations such as `git add`, `git rm`, `git mv`, `git commit`, `git push`, `git tag`, `git merge`, `git rebase`, `git cherry-pick`, `git revert`, `git reset`, `git clean`, `git stash`, `git checkout`, `git switch`, `git pull`, `git fetch`, `git remote`, `git submodule`, and `git worktree`, including forms with git global options such as `git -C repo commit`. If host approval is unavailable, dsh fails closed.
36
+ - `[dsmm safety] git write command is disabled by dsmm settings: git ...` denies those same git write operations when `gitWriteGuard: deny`.
37
+ - `[dsmm safety] truncated ... output` marks accepted plain-text tool results that were replaced with a head/tail preview.
38
+ - `[dsmm safety] plan file contains a malformed checklist entry: ...` rejects malformed checkbox lines in writes to `docs/superpowers/plans/*.md` and `.omo/plans/*.md`.
39
+ - `[dsmm safety] question option label exceeds ... characters: ...` rejects `ask_user_question` option labels longer than `maxLabelChars`.
40
+ - `[dsmm safety] todo list must keep at least one in_progress item while unfinished work remains; parallel work follows the host todo policy.` rejects unfinished lists without an active item; DSMM does not reject legitimate parallel active items supported by the host.
41
+ - `[dsmm safety] todo content must use "[WHERE] [HOW] to [WHY] - expect [RESULT]": ...` applies only to explicitly selected legacy workflow policy. Risk-based policy preserves the native todo contract.
42
+
43
+ ## Shell and Git coverage
44
+
45
+ Shell checks inspect the command argument for `bash`, `sh`, `zsh`, `pwsh`, and `powershell`. Command parsing separates `;`, newlines, pipes, and `&&`/`||` continuations; it also honors the dialect's normal line continuation escape. Git write detection recognizes an executable named `git` or `git.exe`, including a path-qualified executable, Git global options such as `git -C repo commit`, and the `env` wrapper with its supported options and POSIX-style assignments. Other aliases, shell functions, and wrappers are deliberately unclassified rather than guessed.
46
+
47
+ Known write operations are `add`, `am`, `apply`, `branch`, `checkout`, `cherry-pick`, `clean`, `clone`, `commit`, `fetch`, `init`, `merge`, `mv`, `pull`, `push`, `rebase`, `remote`, `reset`, `restore`, `revert`, `rm`, `stash`, `submodule`, `switch`, `tag`, and `worktree`. The guard also classifies mutating `config`, `notes`, `replace`, `update-ref`, and `symbolic-ref` forms, plus `reset --hard` and destructive `stash` actions. With `gitWriteGuard: ask`, each known write returns an ask decision for the host to compose with user approval; with `deny`, it is rejected; with `off`, it is not classified by DSMM. An unrecognized alias or wrapper receives no DSMM git decision.
48
+
49
+ DSMM's pre-execute handler runs before downstream handlers. Its own deny wins immediately. For its own ask, DSMM calls downstream and returns the ask only when downstream allowed the call; a downstream ask or deny is preserved. This keeps another safety policy's stricter decision intact rather than replacing it with DSMM's request. Structured-value replacements, errors, and blocked post-tool results are not truncated into apparently successful text.
50
+
51
+ Workflow and role instructions also prefer short shell operations and repository-native tools, prohibit cross-shell destructive path composition, require exact path checks before recursive deletion, and prohibit autonomous Git writes. These instructions complement—not replace—the host sandbox and approval pipeline. Read-only role tools use native child tool filters; they cannot gain write or shell capability from a persona label.
52
+
53
+ ## Plan mutation validation
54
+
55
+ Plan validation applies only to `write` and `edit` calls targeting `docs/superpowers/plans/*.md` or `.omo/plans/*.md` beneath the session cwd. A write validates its supplied `content`. For an edit, DSMM reads the current file, requires a non-empty `old_string`, reconstructs the resulting document using the requested single replacement or `replace_all`, then validates the resulting document's checklist lines. It rejects ambiguous, missing, unreadable, out-of-cwd, or non-string edit inputs instead of validating only the replacement fragment.
@@ -0,0 +1,51 @@
1
+ # Settings and status
2
+
3
+ ## Commands and inspection
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]`.
6
+
7
+ Commands belong to the native command adapter. Headless task text is not a slash-command invocation.
8
+
9
+ ## DSH 0.2 configuration
10
+
11
+ DSMM's configuration remains **restart-scoped** and is resolved from the Loader plugin entry. The removed `settings.register()` service and old `$DSH_HOME/settings.yaml` namespace are not used by DSH 0.2. Copy the desired DSMM values manually into the profile's `cordis.patch.yml`, restart, and inspect `--dump-config` and status:
12
+
13
+ ```yaml
14
+ - id: dsmm
15
+ config:
16
+ defaultActive: true
17
+ modeName: deepwork
18
+ workflow:
19
+ policy: risk-based
20
+ deepseekFlashCalibration: auto
21
+ deepseekFlashDefaultReasoningEffort: high
22
+ deepseekFlashMaxReasoningPresets:
23
+ - dsmm-plan-critic
24
+ - dsmm-reviewer
25
+ runtimeRecovery:
26
+ enabled: false
27
+ lsp:
28
+ enabled: false
29
+ ```
30
+
31
+ DSH's new SettingsForms only projects explicitly volatile fields; DSMM does not silently turn restart-only values into live references merely to display a settings form. There is no custom settings panel.
32
+
33
+ ## Workflow compatibility
34
+
35
+ `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.
36
+
37
+ 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.
38
+
39
+ ## Other settings
40
+
41
+ The public schema and exported `DEFAULT_DSMM_SETTINGS` are the complete defaults. Seven core skill toggles and all twelve role toggles default on; effective application is scoped to active mode or a selected DSMM role, not global task policy. Managed preset-directory materialization remains off by default and is an export facility rather than native discovery.
42
+
43
+ Existing `deepseekV4ProCalibration`, `deepseekV4ProDefaultReasoningEffort`, and `deepseekV4ProMaxReasoningPresets` remain compatible. 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.
44
+
45
+ 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.
46
+
47
+ ## Snapshot boundaries
48
+
49
+ 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.
50
+
51
+ 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.
@@ -0,0 +1,20 @@
1
+ # dsmm Skill Sync Policy
2
+
3
+ dsmm skill text is sourced from current ocmm `skills/v1` behavior, then adapted to DSH-native Agent Skills. Seven core skills remain prompt-injected while deepwork is active. The separate `debugging` skill and its DAP client are bundled for on-demand role-preset use and are never added to every turn's core prompt.
4
+
5
+ ## Source mapping
6
+
7
+ - `brainstorming` mirrors scope-first discovery: an explicit implementation request is authority within that scope, while safety/API/irreversible decisions still escalate.
8
+ - `writing-plans` mirrors risk-scaled planning and blocker-focused plan criticism for complex behavior, not a mandatory plan for every multi-step change.
9
+ - `subagent-driven-development` mirrors the ocmm/deepwork decomposition and delegated implementation discipline, scoped to dsh-available tools.
10
+ - `dispatching-parallel-agents` mirrors the ocmm/deepwork guidance for independent parallel work.
11
+ - `requesting-code-review` mirrors risk- and evidence-driven reviewer selection, without fixed reviewer counts or unconditional final approval.
12
+ - `receiving-code-review` mirrors the ocmm/deepwork review-feedback handling flow.
13
+ - `remove-ai-slops` mirrors the ocmm cleanup workflow: lock behavior first, remove only behavior-preserving slop, then verify.
14
+ - `debugging` is on demand. `scripts/sync-debugging-assets.mjs` copies self-contained DAP and runtime references from `skills/debugging`, adapts OpenCode-only team wording and excludes the fixture/test scripts from production assets. The original source tests remain usable from the repository; shipped `dap.mjs` needs only Node and an already available adapter.
15
+
16
+ ## Synchronization rules
17
+
18
+ When ocmm workflow skills change, review the matching dsmm skill for behavior drift. Port durable intent, safety and acceptance; do not port OpenCode/Codex tool names, hook mechanics or imagined DSH events. Keep the seven auto-injected bodies compact, retain debugging as a separate registered skill, and update tests/docs when core inventory or setting names change.
19
+
20
+ Future sync work should record the source ocmm skill version or date in the related implementation plan or changelog entry, then run the dsmm verification path before publishing the package.
@@ -0,0 +1,13 @@
1
+ import type { DshContext } from "./dsh-types.js";
2
+ import { DSMM_STATUS_COMMAND } from "./settings.js";
3
+ import type { DsmmSettings } from "./settings.js";
4
+ import type { DeepworkModeController } from "./state.js";
5
+ export { DSMM_STATUS_COMMAND };
6
+ export interface DeepworkCommandInput {
7
+ action: "on" | "off";
8
+ message: string;
9
+ }
10
+ export declare function parseDeepworkCommandInput(rawInput: string): DeepworkCommandInput;
11
+ export declare function registerDeepworkCommand(readyCtx: DshContext, controller: DeepworkModeController, getSettings: () => DsmmSettings): void;
12
+ export declare function registerDsmmStatusCommand(readyCtx: DshContext, controller: DeepworkModeController, getSettings: () => DsmmSettings): void;
13
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1,55 @@
1
+ import { createUserMessage } from "@deepseek-ai/dsh-llm";
2
+ import { DSMM_STATUS_COMMAND } from "./settings.js";
3
+ import { createDsmmStatusSnapshot, formatDsmmStatus } from "./status.js";
4
+ export { DSMM_STATUS_COMMAND };
5
+ export function parseDeepworkCommandInput(rawInput) {
6
+ const message = rawInput.trim();
7
+ return message === "off" ? { action: "off", message: "" } : { action: "on", message };
8
+ }
9
+ async function handleDeepworkCommand(controller, getSettings, invocation) {
10
+ const parsed = parseDeepworkCommandInput(invocation.rawInput);
11
+ await controller.select(invocation.agent, parsed.action === "on", getSettings().defaultActive);
12
+ if (parsed.action === "on" && parsed.message !== "") {
13
+ await invocation.agent.steer?.(createUserMessage({
14
+ content: [{ type: "text", text: parsed.message }],
15
+ source: { kind: "user" }
16
+ }));
17
+ }
18
+ return parsed.action === "on"
19
+ ? { kind: "success", text: "Entering deepwork mode." }
20
+ : { kind: "success", text: "Leaving deepwork mode." };
21
+ }
22
+ function handleDsmmStatusCommand(controller, getSettings, invocation) {
23
+ const input = invocation.rawInput.trim();
24
+ if (input !== "" && input !== "json")
25
+ return { kind: "error", text: "Usage: /dsmm-status [json]" };
26
+ const settings = getSettings();
27
+ const snapshot = createDsmmStatusSnapshot({
28
+ agent: invocation.agent,
29
+ settings,
30
+ modeActive: controller.active(invocation.agent, settings.defaultActive)
31
+ });
32
+ return {
33
+ kind: "success",
34
+ text: input === "json" ? JSON.stringify(snapshot, null, 2) : formatDsmmStatus(snapshot)
35
+ };
36
+ }
37
+ export function registerDeepworkCommand(readyCtx, controller, getSettings) {
38
+ const commands = readyCtx.get?.("commands") ?? readyCtx.commands;
39
+ commands?.register({
40
+ name: getSettings().modeName,
41
+ description: "Enter or leave dsmm deepwork mode",
42
+ input: { hint: "[off|message]" },
43
+ handler: (invocation) => handleDeepworkCommand(controller, getSettings, invocation)
44
+ });
45
+ }
46
+ export function registerDsmmStatusCommand(readyCtx, controller, getSettings) {
47
+ const commands = readyCtx.get?.("commands") ?? readyCtx.commands;
48
+ commands?.register({
49
+ name: DSMM_STATUS_COMMAND,
50
+ description: "Show DSMM status",
51
+ input: { hint: "[json]" },
52
+ handler: (invocation) => handleDsmmStatusCommand(controller, getSettings, invocation)
53
+ });
54
+ }
55
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1,13 @@
1
+ declare module "@deepseek-ai/dsh-session/types" {
2
+ interface SessionEventMap {
3
+ "deepwork/mode": {
4
+ active: boolean;
5
+ };
6
+ }
7
+ }
8
+ export interface DeepworkSessionEventMap {
9
+ "deepwork/mode": {
10
+ active: boolean;
11
+ };
12
+ }
13
+ //# sourceMappingURL=dsh-events.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dsh-events.js.map