From 616cad75ceded4228b6e35d2d49dcd14e0528d70 Mon Sep 17 00:00:00 2001 From: NotExpectedYet Date: Fri, 6 Nov 2026 07:20:32 +0000 Subject: [PATCH] fix: rebuild both shipped presets from the harness standard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On dsh 0.2.2-rc.1 the harness folded `list_agents` into `@deepseek-ai/dsh-tool-subagent-control` and stopped exporting its `./list-agents` subpath. Both files under `presets/` are frozen copies of the shipped `standard` composition, and the copy still named that row. A preset declaration mounts every row it lists, so the row that could never start broke the whole declaration: `facet` appeared on the roster with a `broken` diagnostic and no session could compose it, which is why facet sessions stopped resuming. Both files are re-copied from the current `standard` patch and the three documented changes are re-applied — the guard, the compaction budget, and the persona's model-only prefix. The drift that came with the stale copy is fixed with them: `time-context`, `tool-schedule` and `tool-plugin-market` are back, `tool-subagent` uses the keys the harness reads (`modelSelection`, `modelDiscovery`) instead of the retired `modelSelectionSettings`/`backgroundMode`, `tool-fs` keeps `applyPatch: false`, and the plugin-manager row uses the shipped `profileContext` condition. The README now names this failure mode and why one dead row is fatal. --- README.md | 31 ++++++++--- presets/facet.patch.yml | 74 +++++++++++---------------- presets/standard-compaction.patch.yml | 64 ++++++++--------------- 3 files changed, 75 insertions(+), 94 deletions(-) diff --git a/README.md b/README.md index b3f7a73..aa58903 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,21 @@ replaces the whole plugin list rather than merging into it, so the file is a frozen copy of `standard` that will not follow the harness when `standard` changes. +### Preset drift, and why one dead row breaks the preset + +A preset declaration mounts every row it lists, so a single row the harness no +longer provides fails the whole declaration rather than just that tool: the +roster shows the preset with a `broken` diagnostic and no session can compose it. +That is how this bundle broke on dsh `0.2.2-rc.1`. The harness folded +`list_agents` into `@deepseek-ai/dsh-tool-subagent-control` and stopped exporting +its `./list-agents` subpath; the frozen copy still named it, the row could never +start, and every session on the `facet` preset failed to resume. + +`test/presets.test.js` now compares both files under `presets/` against the +`standard` preset of the installed harness — after removing the documented +deltas — and resolves every plugin name they list, so the next time the harness +moves a row the copy fails the tests instead of failing sessions. + ### Prompt variables, and why the preset's persona has no suffix Both preset files used to copy the deployment's persona line, *Your working @@ -285,7 +300,7 @@ Honest boundaries, because each one is a decision rather than an oversight: Verified: -- 95 tests (`npm test`) over the scope algebra, the policy state, the guard, and +- 98 tests (`npm test`) over the scope algebra, the policy state, the guard, and the browser half — including that containment is decided on canonical targets (a symlink inside the facet pointing outside it is refused), that a prefix is not a parent (`/a/room` does not contain `/a/roommate`), that a malformed tool @@ -298,7 +313,9 @@ Verified: out of a self-narrowing, that both listings normalise into one picker level and that a file listing the Host confines still leaves a browsable one, that no preset or contributed prompt text references a prompt variable the harness - does not register, and that every `facet` result satisfies the tool's own + does not register, that each shipped preset is the installed harness's + `standard` composition plus only its documented changes and names only plugins + the harness provides, and that every `facet` result satisfies the tool's own declared output schema. - The bundle's patch layers parse, merge and land correctly against the real profile: `dsh --profile web --patch ./cordis.patch.yml --patch @@ -357,15 +374,17 @@ would publish. ## Development ```sh -node scripts/dev-links.mjs # link the harness's cordis/schemastery/dsh-tools +node scripts/dev-links.mjs # link the harness's cordis/schemastery/dsh-tools/js-yaml npm test ``` -`dev-links.mjs` links rather than installs those three packages, and for +`dev-links.mjs` links rather than installs those four packages, and for `@deepseek-ai/cordis` that is a correctness requirement rather than tidiness: a second copy of Cordis means a second `Context` class, two service registries in one process, and a plugin whose services are invisible to the harness that loaded -it. +it. `js-yaml` is there so the preset-drift tests can read the harness's own +`standard` patch; the scope search both share lives in +`scripts/harness-scope.mjs`. ## Layout @@ -377,7 +396,7 @@ lib/scope.js the pure half — argument extraction, text, reason lib/guard.js preset row: rule, binding, tool, pre-execute guard presets/facet.patch.yml the `facet` agent preset presets/standard-compaction.patch.yml optional: the same budget for `standard` -test/ 95 tests +test/ 98 tests ``` `client/client.js` is a browser half rather than a module the host imports, and diff --git a/presets/facet.patch.yml b/presets/facet.patch.yml index ddadfd2..d74ff49 100644 --- a/presets/facet.patch.yml +++ b/presets/facet.patch.yml @@ -1,8 +1,8 @@ # Agent preset facet: one `@deepseek-ai/dsh-agent-preset` declaration inserted # after the web patch. # -# The composition is `standard` with three changes, and this file is the only -# place any of them is decided: +# The composition is the shipped `standard` patch with three changes, and this +# file is the only place any of them is decided: # # * compaction is configured (see the `compaction` row below) so the pressure # trigger is a budget rather than a formality. The shipped ratio is 0.80 of a @@ -11,17 +11,23 @@ # # * `facet-guard` is mounted, which confines the session to its own folder; # -# * the persona row carries no suffix. The shipped one states the working -# directory through a prompt variable the harness no longer registers, and -# an unregistered variable fails the whole turn — see the note on that row. +# * the persona row carries no suffix. The shipped one used to state the +# working directory through a prompt variable the harness no longer +# registers, and an unregistered variable fails the whole turn — see the +# note on that row. # # Everything else is copied verbatim from the shipped `standard` patch, and that # is deliberate: a preset declaration replaces the whole plugin list rather than # merging into it, so a clone that drifts from the original silently loses -# whatever it drifted past. When the harness next changes `standard`, re-copy -# this file and re-apply the three changes — do not hand-patch around it. The -# persona row must be re-checked by hand: re-copying it from `standard` restores -# the suffix, and the harness's variable set is what decides whether it composes. +# whatever it drifted past — and a clone that keeps a row the harness has since +# removed fails to mount at all. That is how this preset broke on dsh +# 0.2.2-rc.1: the harness folded `list_agents` into +# `@deepseek-ai/dsh-tool-subagent-control` and stopped exporting its +# `./list-agents` subpath, so the copied row could never start and the whole +# preset reported as broken. When the harness next changes `standard`, re-copy +# this file and re-apply the three changes — do not hand-patch around it. +# `test/presets.test.js` compares this file against the installed `standard` +# and fails on any drift, so the reminder is enforced rather than remembered. - insert: - id: preset-facet name: '@deepseek-ai/dsh-agent-preset' @@ -31,13 +37,6 @@ description: One module of the system, not all of it — the session's own folder, plus the files you grant. order: 5 plugins: - # No suffix. It used to state the working directory through the `cwd` - # prompt variable, which the harness does not register — and an unknown - # variable is not rendered as text: assembly throws and the whole turn - # fails with it. Only `provider` and `model` are registered now, so the - # prefix keeps its model reference and the folder is stated per session - # by `facet-guard`'s runtime binding instead, which follows the user - # when they narrow it. - id: persona name: '@deepseek-ai/dsh-persona' config: @@ -46,6 +45,8 @@ name: '@deepseek-ai/dsh-agent-instructions' config: maxBytes: 65536 + - id: time-context + name: '@deepseek-ai/dsh-time-context' # The facet itself: a rule in the system prompt, the binding in the # runtime context, the `facet` tool, and the pre-execute guard that # asks before a file call leaves the session's folder. Configured by @@ -61,12 +62,17 @@ disabled: !!js process.platform !== 'win32' - id: tool-fs name: '@deepseek-ai/dsh-tool-fs' + config: + # Set false to drop the apply_patch tool beside edit. + applyPatch: false - id: tool-fs-search name: '@deepseek-ai/dsh-tool-fs-search' config: sampleOverCapGlobResults: false - id: tool-jobs name: '@deepseek-ai/dsh-tool-jobs' + - id: tool-schedule + name: '@deepseek-ai/dsh-tool-schedule' - id: skill-filesystem name: '@deepseek-ai/dsh-skill-filesystem' - id: tool-skill @@ -85,7 +91,7 @@ name: '@deepseek-ai/dsh-plan-mode' config: section: | - You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode. + You are in plan mode. Stay in plan mode until the user approves your plan through exit_plan_mode or switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode. Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery. @@ -106,7 +112,7 @@ - id: compaction-basic name: '@deepseek-ai/dsh-compaction-basic' config: - # 0.80 of a 1M window is a 800k trigger, and the deepest session + # 0.80 of a 1M window is an 800k trigger, and the deepest session # ever recorded here peaked at 787,668 pressure tokens: the # trigger was never reached, so every token below it was re-read # on every subsequent step. 0.35 puts the ceiling at 350k. @@ -134,49 +140,24 @@ config: - id: tool-subagent-control name: '@deepseek-ai/dsh-tool-subagent-control' - - id: tool-subagent-list-agents - name: '@deepseek-ai/dsh-tool-subagent-control/list-agents' - id: tool-subagent name: '@deepseek-ai/dsh-tool-subagent' config: provider: spawn toolName: subagent - modelSelectionSettings: true - backgroundMode: continuable + modelSelection: true + modelDiscovery: true - id: tool-subagent-fork name: '@deepseek-ai/dsh-tool-subagent' config: provider: fork toolName: subagent_fork - backgroundMode: continuable - - id: tool-subagent-codex - name: '@deepseek-ai/dsh-tool-subagent' - disabled: true - config: - provider: codex - toolName: subagent_codex - backgroundMode: one-shot - maxDepth: provider-managed - - id: tool-subagent-claude-code - name: '@deepseek-ai/dsh-tool-subagent' - disabled: true - config: - provider: claude-code - toolName: subagent_claude_code - backgroundMode: one-shot - maxDepth: provider-managed - id: workflow-ptc name: '@deepseek-ai/dsh-workflow-ptc' config: provider: spawn - id: tool-workflow name: '@deepseek-ai/dsh-tool-workflow' - - id: tool-ralph - name: '@deepseek-ai/dsh-tool-ralph' - disabled: true - config: - subagentProvider: spawn - maxRounds: 64 - id: tool-ask-user name: '@deepseek-ai/dsh-tool-ask-user' - id: tool-todo @@ -192,4 +173,7 @@ name: '@deepseek-ai/dsh-tool-present' - id: tool-plugin-manager name: '@deepseek-ai/dsh-plugin-manager/tools' + disabled: !!js "!ctx.get('profileContext')" + - id: tool-plugin-market + name: '@deepseek-ai/dsh-plugin-market/tools' disabled: true diff --git a/presets/standard-compaction.patch.yml b/presets/standard-compaction.patch.yml index b862199..2b07268 100644 --- a/presets/standard-compaction.patch.yml +++ b/presets/standard-compaction.patch.yml @@ -11,17 +11,16 @@ # It is deliberately not applied for you, and the reason is a real hazard rather # than caution: a preset declaration replaces the whole plugin list, never merges # into it, so this file is a frozen copy of the shipped `standard` composition -# plus two changes. When the harness next updates `standard` — a new tool, a +# plus one change. When the harness next updates `standard` — a new tool, a # renamed row — this copy will not follow it, and the sessions on this preset -# will silently lose whatever was added. Use it if you are prepared to re-copy -# and re-apply when that happens; otherwise take the compaction settings into -# whichever preset you actually run. +# will silently lose whatever was added, or fail to mount if the copy keeps a +# row the harness removed. Use it if you are prepared to re-copy and re-apply +# when that happens; otherwise take the compaction settings into whichever +# preset you actually run. # -# The two changes from the shipped file are the `compaction-basic` row's config, -# and the persona row's missing suffix: the shipped one names the working -# directory with a prompt variable the harness no longer registers, and an -# unregistered variable fails the whole turn instead of rendering. Re-copying -# this file from a newer `standard` reintroduces that suffix — re-apply both. +# The one change from the shipped file is the `compaction-basic` row's config. +# `test/presets.test.js` compares this file against the installed `standard` +# and fails on any other difference. - insert: - id: preset-standard name: '@deepseek-ai/dsh-agent-preset' @@ -29,12 +28,6 @@ id: standard order: 1 plugins: - # No suffix, for the reason in `facet.patch.yml`: the harness registers - # only `provider` and `model` as prompt variables, and an unregistered - # one now throws instead of rendering. Nothing in this preset states the - # session's working directory any more — a static prompt template cannot - # name a folder that changes per session, so a deployment that needs it - # belongs in the runtime context rather than here. - id: persona name: '@deepseek-ai/dsh-persona' config: @@ -43,6 +36,8 @@ name: '@deepseek-ai/dsh-agent-instructions' config: maxBytes: 65536 + - id: time-context + name: '@deepseek-ai/dsh-time-context' - id: tool-bash name: '@deepseek-ai/dsh-tool-bash' disabled: !!js process.platform === 'win32' @@ -51,12 +46,17 @@ disabled: !!js process.platform !== 'win32' - id: tool-fs name: '@deepseek-ai/dsh-tool-fs' + config: + # Set false to drop the apply_patch tool beside edit. + applyPatch: false - id: tool-fs-search name: '@deepseek-ai/dsh-tool-fs-search' config: sampleOverCapGlobResults: false - id: tool-jobs name: '@deepseek-ai/dsh-tool-jobs' + - id: tool-schedule + name: '@deepseek-ai/dsh-tool-schedule' - id: skill-filesystem name: '@deepseek-ai/dsh-skill-filesystem' - id: tool-skill @@ -75,7 +75,7 @@ name: '@deepseek-ai/dsh-plan-mode' config: section: | - You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode. + You are in plan mode. Stay in plan mode until the user approves your plan through exit_plan_mode or switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode. Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery. @@ -116,49 +116,24 @@ config: - id: tool-subagent-control name: '@deepseek-ai/dsh-tool-subagent-control' - - id: tool-subagent-list-agents - name: '@deepseek-ai/dsh-tool-subagent-control/list-agents' - id: tool-subagent name: '@deepseek-ai/dsh-tool-subagent' config: provider: spawn toolName: subagent - modelSelectionSettings: true - backgroundMode: continuable + modelSelection: true + modelDiscovery: true - id: tool-subagent-fork name: '@deepseek-ai/dsh-tool-subagent' config: provider: fork toolName: subagent_fork - backgroundMode: continuable - - id: tool-subagent-codex - name: '@deepseek-ai/dsh-tool-subagent' - disabled: true - config: - provider: codex - toolName: subagent_codex - backgroundMode: one-shot - maxDepth: provider-managed - - id: tool-subagent-claude-code - name: '@deepseek-ai/dsh-tool-subagent' - disabled: true - config: - provider: claude-code - toolName: subagent_claude_code - backgroundMode: one-shot - maxDepth: provider-managed - id: workflow-ptc name: '@deepseek-ai/dsh-workflow-ptc' config: provider: spawn - id: tool-workflow name: '@deepseek-ai/dsh-tool-workflow' - - id: tool-ralph - name: '@deepseek-ai/dsh-tool-ralph' - disabled: true - config: - subagentProvider: spawn - maxRounds: 64 - id: tool-ask-user name: '@deepseek-ai/dsh-tool-ask-user' - id: tool-todo @@ -174,4 +149,7 @@ name: '@deepseek-ai/dsh-tool-present' - id: tool-plugin-manager name: '@deepseek-ai/dsh-plugin-manager/tools' + disabled: !!js "!ctx.get('profileContext')" + - id: tool-plugin-market + name: '@deepseek-ai/dsh-plugin-market/tools' disabled: true