/** Model-free behavioral regression through the installed official ACL runner. */ import {spawnSync} from 'node:child_process'; import {mkdir,writeFile} from 'node:fs/promises'; import path from 'node:path'; const [root,python]=process.argv.slice(2); const workspace=path.join(root,'workspace'),temp=path.join(root,'temp'); await mkdir(workspace,{recursive:true});await mkdir(temp,{recursive:true}); const script=path.join(workspace,'probe.py'); await writeFile(script,'import json\nprint(json.dumps({"probe":42}))\n'); const q=value=>"'"+value.replaceAll("'","''")+"'"; const commands={inline:`& ${q(python)} -c 'print(314159)'; exit $LASTEXITCODE`, script:`& ${q(python)} ${q(script)}; exit $LASTEXITCODE`, listing:`$ErrorActionPreference='Stop'; Get-ChildItem -LiteralPath ${q(workspace)} | ForEach-Object {$_.Name}`}; const results={root,workspace,commands}; for(const [name,command] of Object.entries(commands)){ const result=spawnSync(process.execPath,['integration/dsh/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/runner.js', '--workspace',workspace,'--temp',temp,'--mode','workspace-write','--', path.join(process.env.SystemRoot,'System32/WindowsPowerShell/v1.0/powershell.exe'), '-NoLogo','-NoProfile','-NonInteractive','-Command',command],{encoding:'utf8',timeout:30000}); results[name]={exit_code:result.status,stdout:result.stdout,stderr:result.stderr,error:result.error?.message}; } results.acl=spawnSync('icacls',[root],{encoding:'utf8'}).stdout; results.user_sid=spawnSync('whoami',['/user'],{encoding:'utf8'}).stdout; console.log(JSON.stringify(results));