feat: update DeepSeek Harness and support runtime upgrades
Core regression / Python core, intervention UI and release configuration (push) Successful in 16m20s
Core regression / JavaScript syntax (push) Successful in 11s
Core regression / Python core, intervention UI and release configuration (pull_request) Failing after 11m11s
Core regression / JavaScript syntax (pull_request) Successful in 7s

This commit is contained in:
阿白叔 committed 2026-11-20 15:43:58 +08:00
1 parent bd80f86357
commit 488bf027cc
18 files changed
+4301 -3312

No files matched your search

+14 -8
View File
@@ -1,20 +1,26 @@
/** Exercise the real official runtime and policy pipeline without CAD or a model. */
import {executeTool} from './dsh_tool_probe.mjs';
import assert from 'node:assert/strict';
import {mkdir,writeFile} from 'node:fs/promises';
import path from 'node:path';
import {fileURLToPath,pathToFileURL} from 'node:url';
import {createRequire} from 'node:module';
import {bootRuntime,TASK_TOOLS} from '../integration/dsh/start.mjs';
const repo=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'..');
const output=path.join(repo,'build/dsh-native-cli-verification');
const runtime=path.resolve(process.argv[2]??path.join(repo,'integration/dsh'));
const {bootRuntime,TASK_TOOLS,VERSION}=await import(pathToFileURL(path.join(runtime,'start.mjs')).href);
const output=path.resolve(process.argv[3]??path.join(repo,'build/dsh-native-cli-verification'));
await mkdir(output,{recursive:true});
delete process.env.DX_DSH_PARENT_PIPE;
if(process.argv[2]){
for(const key of ['DSH_API_KEY','DSH_API_BASE','DSH_MODEL','DX_DSH_MODELS','DSH_PERMISSION_MODE'])delete process.env[key];
}
process.env.DX_DSH_HOME=path.join(output,'home');
process.env.DX_DSH_CONTEXT_FILE=path.join(output,'context.json');
await writeFile(process.env.DX_DSH_CONTEXT_FILE,JSON.stringify({task_id:'cli-verification',status:'paused',
revision:'cli-revision',rules_count:2,progress:{},issue:'',issue_code:'',events:[]}));
const {ctx,shutdown}=await bootRuntime({announce:false});
const report={};
const report={version:VERSION};
try {
const schemas=ctx.tools.schemas();
report.tools=schemas.map(x=>x.name);
@@ -26,10 +32,10 @@ try {
report.configuredModels=(await ctx.llm.listModels('dx')).map(model=>model.id);
assert.ok(report.configuredModels.includes(process.env.DSH_MODEL));
}
const snapshot=await ctx.tools.execute({callId:'verify-read',name:'dx_task_snapshot',arguments:{},signal:new AbortController().signal});
const snapshot=await executeTool(ctx, {callId:'verify-read',name:'dx_task_snapshot',arguments:{},signal:new AbortController().signal});
assert.equal(snapshot.isError,false,JSON.stringify(snapshot));
report.snapshotRead=true;
const desktopOnly=await ctx.tools.execute({callId:'verify-desktop-only',name:'dx_task_create',arguments:{name:'CLI must not mutate'},signal:new AbortController().signal});
const desktopOnly=await executeTool(ctx, {callId:'verify-desktop-only',name:'dx_task_create',arguments:{name:'CLI must not mutate'},signal:new AbortController().signal});
assert.equal(desktopOnly.isError,true);
report.creationRequiresDesktopConfirmation=true;
for(const [name,args] of [
@@ -38,16 +44,16 @@ try {
['dx_task_execute',{operation:'start',task_ids:['fixture']}],
['dx_task_operations',{operation:'history'}],
]){
const result=await ctx.tools.execute({callId:'desktop-only-'+name,name,arguments:args,signal:AbortSignal.timeout(2000)});
const result=await executeTool(ctx, {callId:'desktop-only-'+name,name,arguments:args,signal:AbortSignal.timeout(2000)});
assert.equal(result.isError,true,name+' requires parent desktop');
}
report.lifecycleRequiresDesktop=true;
const require=createRequire(path.join(repo,'integration/dsh/package.json'));
const require=createRequire(path.join(runtime,'package.json'));
const {defineTool}=await import(pathToFileURL(require.resolve('@deepseek-ai/dsh-tools')).href);
let bodyRan=false;
const release=ctx.tools.register(defineTool({name:'forbidden_probe',description:'Never executes',parameters:{},
output:{schema:{type:'boolean'},render:()=>[{type:'text',text:'probe'}]},execute:async()=>{bodyRan=true;return true;}}));
const extension=await ctx.tools.execute({callId:'verify-extension',name:'forbidden_probe',arguments:{},signal:new AbortController().signal});
const extension=await executeTool(ctx, {callId:'verify-extension',name:'forbidden_probe',arguments:{},signal:new AbortController().signal});
release();
assert.equal(extension.isError,false);
assert.equal(bodyRan,true);