Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

ci(dsh): install acceptance runtime with pnpm

tt-a1i78d4037c5e33
diff --git a/integrations/deepseek-harness/scripts/distribution-acceptance.mjs b/integrations/deepseek-harness/scripts/distribution-acceptance.mjs
index e40916fd..7691954e 100644
--- a/integrations/deepseek-harness/scripts/distribution-acceptance.mjs
+++ b/integrations/deepseek-harness/scripts/distribution-acceptance.mjs
@@ -233,24 +233,27 @@ const dshEnv = {
npm_config_update_notifier: 'false',
};
-// Install the pinned host separately from plugin mutation so a slow npm
-// download remains distinguishable from `dsh plugin add`. Retry only a bounded
-// set of transient network failures, rebuilding the install root each time.
+// Install the pinned host separately from plugin mutation so package-manager
+// failures remain distinguishable from `dsh plugin add`. pnpm handles DSH's
+// large dependency graph without npm's long silent resolution, while the
+// explicit build allowlist keeps lifecycle execution fail-closed.
const runtimeInstallOutcome = runWithTransientNetworkRetry((attempt) => {
fs.rmSync(dshRuntime, { recursive: true, force: true });
fs.mkdirSync(dshRuntime);
if (attempt > 1) {
process.stderr.write(`Retrying transient DSH runtime install (attempt ${attempt}/2)\n`);
}
- return run('npm', [
- 'install',
- '--prefix', dshRuntime,
- '--no-save',
- '--package-lock=false',
- '--no-audit',
- '--no-fund',
- '--foreground-scripts',
- '--loglevel=warn',
+ return run('pnpm', [
+ '--dir', dshRuntime,
+ 'add',
+ '--save-exact',
+ '--reporter=append-only',
+ '--use-stderr',
+ '--allow-build=@deepseek-ai/dsh-subprocess-local',
+ '--allow-build=@google/genai',
+ '--allow-build=koffi',
+ '--allow-build=node-pty',
+ '--allow-build=protobufjs',
DSH_SPEC,
], {
cwd: scratch,
@@ -263,7 +266,7 @@ const runtimeInstallOutcome = runWithTransientNetworkRetry((attempt) => {
});
const runtimeInstall = runtimeInstallOutcome.result;
requireStatus('dsh-runtime-install', runtimeInstall, {
- command: `npm install ${DSH_SPEC}`,
+ command: `pnpm add ${DSH_SPEC}`,
attempts: runtimeInstallOutcome.attempts,
});
const dshPackageRoot = path.join(dshRuntime, 'node_modules', '@deepseek-ai', 'dsh');
diff --git a/integrations/deepseek-harness/test/package-contract.test.mjs b/integrations/deepseek-harness/test/package-contract.test.mjs
index 7abfa0a9..938d5943 100644
--- a/integrations/deepseek-harness/test/package-contract.test.mjs
+++ b/integrations/deepseek-harness/test/package-contract.test.mjs
@@ -76,6 +76,9 @@ test('distribution acceptance reserves stdout for its machine-readable JSON rece
'utf8',
);
assert.match(source, /runWithTransientNetworkRetry/);
+ assert.match(source, /run\('pnpm'/);
+ assert.match(source, /--allow-build=@deepseek-ai\/dsh-subprocess-local/);
+ assert.doesNotMatch(source, /--allow-build=\*/);
assert.match(source, /stdio:\s*\['ignore',\s*2,\s*2\]/);
assert.doesNotMatch(source, /stdio:\s*['"]inherit['"]/);
assert.equal([...source.matchAll(/process\.stdout\.write/g)].length, 2);