Kaynağa Gözat

refactor(preset): trim the shell-row comments

Drop the filler and factually loose comments added with the tool-pwsh rows:
the platform expressions self-explain, the web-app overlay comment repeats
the file header, and the spec comments now state only the platform-scoped
evaluation fact.
Huanqi Cao 1 ay önce
ebeveyn
işleme
05a8846c6e

+ 2 - 6
apps/cli/config/agent-presets/code/agent.cordis.yml

@@ -46,18 +46,14 @@
 # the criterion for host-plane ownership — injection resolves before any session
 # exists, so there is no agent to key by. Behind a preset realm those variables
 # never reached the model's shell at all. Both shell tools consume the host
-# registry from here; the executors behind them (`bash-sandbox`/`pwsh-sandbox`)
-# are host-plane too, where the sandbox policy owns them. The web-app overlay
-# disables the host shell-tool rows, so exactly one of these rows mounts per
-# host — `tool-bash` on POSIX, `tool-pwsh` on win32.
+# registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
+# host-plane too.
 - id: tool-bash
   name: '@deepseek-ai/dsh-tool-bash'
-  # POSIX-only: the base composition swaps the bash stack for the pwsh stack on win32.
   disabled: !!js process.platform === 'win32'
 
 - id: tool-pwsh
   name: '@deepseek-ai/dsh-tool-pwsh'
-  # win32-only twin of tool-bash: bash has no Windows runner.
   disabled: !!js process.platform !== 'win32'
 
 # ── filesystem ──────────────────────────────────────────────────────────────

+ 2 - 6
apps/cli/config/agent-presets/cordis/agent.cordis.yml

@@ -40,18 +40,14 @@
 # the criterion for host-plane ownership — injection resolves before any session
 # exists, so there is no agent to key by. Behind a preset realm those variables
 # never reached the model's shell at all. Both shell tools consume the host
-# registry from here; the executors behind them (`bash-sandbox`/`pwsh-sandbox`)
-# are host-plane too, where the sandbox policy owns them. The web-app overlay
-# disables the host shell-tool rows, so exactly one of these rows mounts per
-# host — `tool-bash` on POSIX, `tool-pwsh` on win32.
+# registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
+# host-plane too.
 - id: tool-bash
   name: '@deepseek-ai/dsh-tool-bash'
-  # POSIX-only: the base composition swaps the bash stack for the pwsh stack on win32.
   disabled: !!js process.platform === 'win32'
 
 - id: tool-pwsh
   name: '@deepseek-ai/dsh-tool-pwsh'
-  # win32-only twin of tool-bash: bash has no Windows runner.
   disabled: !!js process.platform !== 'win32'
 
 # ── filesystem ──────────────────────────────────────────────────────────────

+ 2 - 6
apps/cli/config/agent-presets/standard/agent.cordis.yml

@@ -39,18 +39,14 @@
 # the criterion for host-plane ownership — injection resolves before any session
 # exists, so there is no agent to key by. Behind a preset realm those variables
 # never reached the model's shell at all. Both shell tools consume the host
-# registry from here; the executors behind them (`bash-sandbox`/`pwsh-sandbox`)
-# are host-plane too, where the sandbox policy owns them. The web-app overlay
-# disables the host shell-tool rows, so exactly one of these rows mounts per
-# host — `tool-bash` on POSIX, `tool-pwsh` on win32.
+# registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
+# host-plane too.
 - id: tool-bash
   name: '@deepseek-ai/dsh-tool-bash'
-  # POSIX-only: the base composition swaps the bash stack for the pwsh stack on win32.
   disabled: !!js process.platform === 'win32'
 
 - id: tool-pwsh
   name: '@deepseek-ai/dsh-tool-pwsh'
-  # win32-only twin of tool-bash: bash has no Windows runner.
   disabled: !!js process.platform !== 'win32'
 
 # ── filesystem ──────────────────────────────────────────────────────────────

+ 5 - 11
apps/cli/tests/windows-shell.spec.ts

@@ -21,10 +21,8 @@ import { evaluate } from '@deepseek-ai/cordis-plugin-loader'
 import { composeEntries, initProfile, loadProfile, PROFILES_DIR } from '@deepseek-ai/dsh-app-boot'
 
 /**
- * The effective disabled state of one composed row on one platform: a `!!js`
- * expression evaluates with a platform-scoped context (the `with` scope
- * shadows the global `process`) so both outcomes pin on every host; a plain
- * boolean is the value itself.
+ * The effective disabled state of one row on one platform: a `!!js` expression
+ * evaluates with a platform-scoped `process` so both outcomes pin on any host.
  */
 function disabledOn(row: { disabled?: unknown }, platform: 'win32' | 'linux'): boolean {
   const value = row.disabled
@@ -60,9 +58,8 @@ describe('the shipped shell composition (real bundle layers)', () => {
     expect(disabledOn(byId.get('bash-sandbox')!, 'linux'), 'bash-sandbox on linux').toBe(false)
     expect(disabledOn(byId.get('pwsh-sandbox')!, 'win32'), 'pwsh-sandbox on win32').toBe(false)
     expect(disabledOn(byId.get('pwsh-sandbox')!, 'linux'), 'pwsh-sandbox on linux').toBe(true)
-    // The Web surface owns both host shell TOOL rows on every platform: the
-    // executors stay host-plane with their platform gates, while sessions
-    // mount the shell tools from their preset rows instead.
+    // Host shell-tool rows are disabled on every platform; sessions mount
+    // their own rows instead.
     expect(byId.get('tool-bash')?.disabled).toBe(true)
     expect(byId.get('tool-pwsh')?.disabled).toBe(true)
     // The permission surface never moves: the sandbox/policy rows, the
@@ -118,10 +115,7 @@ describe('shipped agent presets gate both shell tools by platform', () => {
       ))
       if (row === undefined) throw new TypeError(`preset ${preset} must mount ${id}`)
       expect(row.disabled).toMatchObject({ __jsExpr: expect.any(String) as string })
-      // The base patch gates the host shell-tool rows by platform; the preset
-      // rows must not re-enable them on the wrong host. Evaluate the shipped
-      // expression with a platform-scoped context (the `with` scope shadows
-      // the global `process`) so both outcomes pin on every host.
+      // A platform-scoped context pins both outcomes on every host.
       const expression = (row.disabled as { __jsExpr: string }).__jsExpr
       expect(Boolean(evaluate({ process: { platform: 'win32' } }, expression)), `${id} on win32`).toBe(win32)
       expect(Boolean(evaluate({ process: { platform: 'linux' } }, expression)), `${id} on linux`).toBe(!win32)

+ 0 - 5
packages/bundle/web-app/cordis.patch.yml

@@ -258,11 +258,6 @@
 # the criterion for host-plane ownership — injection resolves before any session
 # exists, so there is no agent to key by. Behind a preset realm those variables
 # would never reach the model's shell at all.
-#
-# Both shell TOOL rows move behind presets on every platform: the executors
-# (`bash-sandbox`/`pwsh-sandbox`) stay host-plane with their platform gates in
-# the base patch, while each session's preset declares the shell tool its agent
-# sees and gates it by platform — so the host tool rows are disabled here.
 
 - id: tool-bash
   disabled: true