refactor(sandbox): defer native protocol exports (round 3)

This commit is contained in:
Hypatia May
2026-08-04 13:37:33 +08:00
parent 319376ef1c
commit f91aedd074
14 changed files with 44 additions and 69 deletions

View File

@@ -1,10 +1,7 @@
import type { ConfinedArgv, SandboxPolicy } from '@deepseek-ai/dsh-sandbox'
import { SandboxProvider } from '@deepseek-ai/dsh-sandbox'
import {
LAUNCHER_FAILURE_EXIT,
LAUNCHER_FATAL_PREFIX,
PARTIAL_ENFORCEMENT_NOTICE,
} from 'node-addon-landlock-run'
const NOTICE = 'landlock-run: partial enforcement (older Landlock ABI)'
/** Snapshot-only provider that reproduces an older-ABI Landlock launch. */
export default class PartialLandlockSandboxProvider extends SandboxProvider {
@@ -13,16 +10,16 @@ export default class PartialLandlockSandboxProvider extends SandboxProvider {
argv: [
'bash',
'-c',
`printf '%s\\n' '${PARTIAL_ENFORCEMENT_NOTICE}' >&2; exec "$@"`,
`printf '%s\\n' '${NOTICE}' >&2; exec "$@"`,
'partial-landlock-run',
...argv,
],
enforcement: 'partial',
denialSignatures: ['permission denied'],
runnerFailureRules: [{
allowedExitCodes: [LAUNCHER_FAILURE_EXIT],
fatalSignatures: [LAUNCHER_FATAL_PREFIX],
informationalLines: [PARTIAL_ENFORCEMENT_NOTICE],
allowedExitCodes: [125],
fatalSignatures: ['landlock-run: '],
informationalLines: [NOTICE],
}],
}
}

View File

@@ -100,7 +100,6 @@
"@deepseek-ai/dsh-web": "workspace:*",
"@deepseek-ai/dsh-web-fetch-local": "workspace:*",
"@deepseek-ai/dsh-workflow-workerthread": "workspace:*",
"@deepseek-ai/dsh-workspace-context": "workspace:*",
"node-addon-landlock-run": "0.0.0-test.0"
"@deepseek-ai/dsh-workspace-context": "workspace:*"
}
}