Spaces:
Running
Running
sync: 189 file da Baida98/AI@f527eaa5 (2026-08-26 09:08 UTC) [deploy-all]
#68
by Baida07 - opened
- benchmark-extended.mjs +110 -48
benchmark-extended.mjs
CHANGED
|
@@ -46,7 +46,8 @@
|
|
| 46 |
|
| 47 |
import { spawn } from "child_process";
|
| 48 |
import { writeFileSync, mkdirSync, rmSync, existsSync } from "fs";
|
| 49 |
-
import { join }
|
|
|
|
| 50 |
|
| 51 |
// ββ CLI args ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 52 |
const _A = process.argv.slice(2);
|
|
@@ -80,8 +81,25 @@ const G="\x1b[32m",R="\x1b[31m",Y="\x1b[33m",B="\x1b[34m",
|
|
| 80 |
const _baseUrlArg = _A.find(a=>a.startsWith("--base-url="));
|
| 81 |
const BASE_URL = (_baseUrlArg ? _baseUrlArg.slice("--base-url=".length) : (process.env.BENCHMARK_BASE_URL ?? process.env.BACKEND_URL ?? "https://baida07-terminal.hf.space")).replace(/\/+$/, "");
|
| 82 |
const TASK_DIR = "/tmp/bench-ext/tasks";
|
| 83 |
-
const
|
| 84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
const HF_GSM8K = 1319; // openai/gsm8k test split size
|
| 86 |
const HF_BBH = 250; // lukaemon/bbh logical_deduction size
|
| 87 |
const HF_SCIQ = 1000; // allenai/sciq test split size
|
|
@@ -874,13 +892,34 @@ async function fetchSciQ(seed){
|
|
| 874 |
|
| 875 |
// ββ callAgent βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 876 |
async function callAgent(goal,timeoutMs=90000,options={}){
|
| 877 |
-
const t0=Date.now();
|
| 878 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 879 |
const internalToken=process.env.INTERNAL_TOKEN||"";
|
| 880 |
if(!internalToken)return{ok:false,output:"",engine,...telemetry(),toolCalls,durationMs:0,failed:true,failureReason:"INTERNAL_TOKEN mancante"};
|
| 881 |
const ctrl=new AbortController();
|
| 882 |
const timer=setTimeout(()=>ctrl.abort(),timeoutMs);
|
| 883 |
const headers={"Content-Type":"application/json","X-Internal-Token":internalToken};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 884 |
try{
|
| 885 |
const created=await fetch(`${BASE_URL}/api/agent/tasks`,{
|
| 886 |
method:"POST",headers,
|
|
@@ -894,13 +933,6 @@ async function callAgent(goal,timeoutMs=90000,options={}){
|
|
| 894 |
taskId=String(createdBody.taskId||"");
|
| 895 |
if(!taskId)return{ok:false,output:"",engine,...telemetry(),toolCalls,durationMs:Date.now()-t0,failed:true,failureReason:"taskId mancante"};
|
| 896 |
|
| 897 |
-
const res=await fetch(`${BASE_URL}/api/agent/tasks/${encodeURIComponent(taskId)}/stream`,{
|
| 898 |
-
method:"GET",headers:{"X-Internal-Token":internalToken},signal:ctrl.signal});
|
| 899 |
-
if(!res.ok)return{ok:false,output:"",engine,...telemetry(),toolCalls,durationMs:Date.now()-t0,failed:true,failureReason:`stream HTTP ${res.status}`};
|
| 900 |
-
if(!res.body)return{ok:false,output:"",engine,...telemetry(),toolCalls,durationMs:Date.now()-t0,failed:true,failureReason:"stream body mancante"};
|
| 901 |
-
const dec=new TextDecoder(); let buf="";
|
| 902 |
-
const rd=res.body.getReader();
|
| 903 |
-
let stopStream=false;
|
| 904 |
let sawText=false;
|
| 905 |
const rawPayloadLog=[];
|
| 906 |
const processSSEData=(raw)=>{
|
|
@@ -923,11 +955,7 @@ async function callAgent(goal,timeoutMs=90000,options={}){
|
|
| 923 |
sawText=true;
|
| 924 |
if(!(trimmed.startsWith("{")&&trimmed.endsWith("}")))out+=chunk;
|
| 925 |
ttfa=ttfa??now;
|
| 926 |
-
|
| 927 |
-
// quando il modello ha giΓ prodotto un blocco completo e sufficientemente lungo.
|
| 928 |
-
if(options.earlyComplete === "typescript" && /```(?:typescript|ts)\s*[\\s\\S]{80,}?```/i.test(out)){
|
| 929 |
-
done=true; return true;
|
| 930 |
-
}
|
| 931 |
}
|
| 932 |
} else if(eventType==="task_error"){
|
| 933 |
failed=true;failureReason=String(ev.error||"task_error");done=true;return true;
|
|
@@ -937,43 +965,68 @@ async function callAgent(goal,timeoutMs=90000,options={}){
|
|
| 937 |
if(ev.success===false||result.startsWith("[LLM_UNAVAILABLE]")||result.includes("tutti i provider configurati sono falliti")){
|
| 938 |
failed=true;failureReason=result||"provider_unavailable";engine=ev.engine??engine;done=true;return true;
|
| 939 |
}
|
| 940 |
-
// Il backend puΓ² inviare un result stale o non coerente al termine dello stream.
|
| 941 |
-
// Se abbiamo ricevuto text_chunk, il buffer SSE Γ¨ la fonte autorevole.
|
| 942 |
if(result&&(!sawText||result.length>(out||"").length)&&!sawText)out=result;
|
| 943 |
-
engine=ev.engine??engine;done=true;return true;
|
| 944 |
}
|
| 945 |
}catch{}
|
| 946 |
return false;
|
| 947 |
};
|
| 948 |
-
|
| 949 |
-
const
|
| 950 |
-
if(
|
| 951 |
-
|
| 952 |
-
|
| 953 |
-
|
| 954 |
-
buf
|
| 955 |
-
|
| 956 |
-
|
| 957 |
-
|
| 958 |
-
|
| 959 |
-
|
| 960 |
-
|
| 961 |
-
|
| 962 |
-
|
| 963 |
-
|
| 964 |
-
|
| 965 |
-
|
| 966 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 967 |
}
|
| 968 |
-
if(done
|
| 969 |
-
|
|
|
|
|
|
|
| 970 |
}
|
|
|
|
|
|
|
|
|
|
| 971 |
}catch(e){
|
| 972 |
-
|
| 973 |
-
|
| 974 |
-
|
| 975 |
-
const partial = normalizeAgentOutput(out || "");
|
| 976 |
-
const salvageFeature = options.earlyComplete === "typescript" && partial.length >= 120 && /(?:interface|type|class|function|const)\b/.test(partial) && /(?:subscribe|getState|async|await|try|catch)/.test(partial);
|
| 977 |
return{ok:salvageFeature,output:partial,engine,...telemetry(),toolCalls,durationMs:Date.now()-t0,failed:!salvageFeature,failureReason:e.name==="AbortError"?(salvageFeature?"PARTIAL_TIMEOUT":"TIMEOUT"):String(e.message||e),partial:salvageFeature};
|
| 978 |
}finally{clearTimeout(timer);}
|
| 979 |
const finalOutput=normalizeAgentOutput(out);
|
|
@@ -2300,6 +2353,13 @@ async function runOneSeed(seed,opts={}){
|
|
| 2300 |
const n=selected.length;
|
| 2301 |
const hfN=selected.filter(t=>t.hfSource&&!t.hfSource.startsWith("local")).length;
|
| 2302 |
const ghN=[_ghEval,_ghSQL,_ghAdvisory].filter(Boolean).length;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2303 |
|
| 2304 |
_log(`\n${B}${BOLD}ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ${NC}`);
|
| 2305 |
_log(`${B}${BOLD}β EXTENDED BENCHMARK v5 β seed: ${String(seed).padEnd(12)} β${NC}`);
|
|
@@ -2354,7 +2414,7 @@ async function runOneSeed(seed,opts={}){
|
|
| 2354 |
score:null,ref:task.ref,buildPassed:null,testsPassed:null,
|
| 2355 |
planScore:null,executionScore:null,recoveryScore:null,autonomyScore:null,
|
| 2356 |
agentMs,ttfa:agent.ttfa??9999,ttfaMs:agent.ttfaMs??agent.ttfa??9999,toolCalls:agent.toolCalls??0,tokEstimate:0,
|
| 2357 |
-
engine:agent.engine,provider:agent.provider??"?",model:agent.model??agent.engine??"?",lastEvent:agent.lastEvent??null,lastEventAt:agent.lastEventAt??null,breakdown:null,detail:`non valutabile: ${reason}`,unavailable:true,failureReason:reason});
|
| 2358 |
continue;
|
| 2359 |
}
|
| 2360 |
|
|
@@ -2393,7 +2453,7 @@ async function runOneSeed(seed,opts={}){
|
|
| 2393 |
score,ref,buildPassed:vr.buildPassed,testsPassed:vr.testsPassed,
|
| 2394 |
planScore:vr.planScore,executionScore:vr.executionScore,recoveryScore:vr.recoveryScore,
|
| 2395 |
agentMs,ttfa:agent.ttfa??9999,ttfaMs:agent.ttfaMs??agent.ttfa??9999,toolCalls:agent.toolCalls??0,tokEstimate:tokEst,
|
| 2396 |
-
engine:agent.engine,provider:agent.provider??"?",model:agent.model??agent.engine??"?",lastEvent:agent.lastEvent??null,lastEventAt:agent.lastEventAt??null,breakdown,detail:(vr.detail||"").slice(0,200),failureReason:agent.failureReason||null});
|
| 2397 |
}
|
| 2398 |
|
| 2399 |
// ββ Summary ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -2470,6 +2530,8 @@ async function runOneSeed(seed,opts={}){
|
|
| 2470 |
F_robustezza:"robustness",G_operativitΓ :"coding+data_analysis"},
|
| 2471 |
methodology:{
|
| 2472 |
runtime_input:{profile:"fixed-realistic-chat-v1",persona:BENCHMARK_PERSONA,negative_constraints:true,context_messages:BENCHMARK_CONTEXT.length},
|
|
|
|
|
|
|
| 2473 |
canonical_seed:"1337 (stesse domande per tutti gli agenti β usa --rotate per seed diverso)",
|
| 2474 |
coding:"enterprise: Acc(35%)+Stab(20%)+Auto(15%)+Perf(10%)+Spd(10%)+Cost(5%)+Tool(5%)",
|
| 2475 |
nonCoding:"content: Acc(40%)+Struct(20%)+Comp(15%)+Prec(10%)+Auto(5%)+Spd(5%)+Cost(5%)",
|
|
|
|
| 46 |
|
| 47 |
import { spawn } from "child_process";
|
| 48 |
import { writeFileSync, mkdirSync, rmSync, existsSync } from "fs";
|
| 49 |
+
import { join, dirname } from "path";
|
| 50 |
+
import { fileURLToPath } from "url";
|
| 51 |
|
| 52 |
// ββ CLI args ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 53 |
const _A = process.argv.slice(2);
|
|
|
|
| 81 |
const _baseUrlArg = _A.find(a=>a.startsWith("--base-url="));
|
| 82 |
const BASE_URL = (_baseUrlArg ? _baseUrlArg.slice("--base-url=".length) : (process.env.BENCHMARK_BASE_URL ?? process.env.BACKEND_URL ?? "https://baida07-terminal.hf.space")).replace(/\/+$/, "");
|
| 83 |
const TASK_DIR = "/tmp/bench-ext/tasks";
|
| 84 |
+
const RUNNER_DIR = dirname(fileURLToPath(import.meta.url));
|
| 85 |
+
let TSC_BIN = "";
|
| 86 |
+
|
| 87 |
+
async function resolveTypeScriptCompiler(){
|
| 88 |
+
const configured = String(process.env.TSC_BIN ?? "").trim();
|
| 89 |
+
const candidates = configured
|
| 90 |
+
? [configured]
|
| 91 |
+
: [
|
| 92 |
+
join(RUNNER_DIR, "node_modules", ".bin", "tsc"),
|
| 93 |
+
join(process.cwd(), "node_modules", ".bin", "tsc"),
|
| 94 |
+
join(process.cwd(), "node_modules", ".pnpm", "typescript@5.9.3", "node_modules", "typescript", "bin", "tsc"),
|
| 95 |
+
];
|
| 96 |
+
for(const candidate of candidates){
|
| 97 |
+
if(candidate.includes("/") && !existsSync(candidate)) continue;
|
| 98 |
+
const probe = await runCmd(candidate, ["--version"], process.cwd(), 8_000);
|
| 99 |
+
if(probe.exitCode === 0) return candidate;
|
| 100 |
+
}
|
| 101 |
+
return "";
|
| 102 |
+
}
|
| 103 |
const HF_GSM8K = 1319; // openai/gsm8k test split size
|
| 104 |
const HF_BBH = 250; // lukaemon/bbh logical_deduction size
|
| 105 |
const HF_SCIQ = 1000; // allenai/sciq test split size
|
|
|
|
| 892 |
|
| 893 |
// ββ callAgent βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 894 |
async function callAgent(goal,timeoutMs=90000,options={}){
|
| 895 |
+
const t0=Date.now();
|
| 896 |
+
let out="",engine="?",provider="?",model="?",ttfa=null,toolCalls=0,done=false,failed=false,failureReason="",taskId="",lastEvent="",lastEventAt=null;
|
| 897 |
+
let lastEventId=0,streamReconnects=0,heartbeatCount=0,statusChecks=0,replayedEventCount=0,terminalStatus=null,cancelAttempted=false,cancelHttpStatus=null;
|
| 898 |
+
const seenEventIds=new Set();
|
| 899 |
+
const telemetry=()=>({
|
| 900 |
+
taskId:taskId||null,provider:provider||"?",model:model||engine||"?",ttfaMs:ttfa??9999,
|
| 901 |
+
lastEvent:lastEvent||null,lastEventAt,lastEventId,streamReconnects,heartbeatCount,statusChecks,replayedEventCount,
|
| 902 |
+
terminalStatus,cancelAttempted,cancelHttpStatus,
|
| 903 |
+
});
|
| 904 |
const internalToken=process.env.INTERNAL_TOKEN||"";
|
| 905 |
if(!internalToken)return{ok:false,output:"",engine,...telemetry(),toolCalls,durationMs:0,failed:true,failureReason:"INTERNAL_TOKEN mancante"};
|
| 906 |
const ctrl=new AbortController();
|
| 907 |
const timer=setTimeout(()=>ctrl.abort(),timeoutMs);
|
| 908 |
const headers={"Content-Type":"application/json","X-Internal-Token":internalToken};
|
| 909 |
+
const taskHeaders={"X-Internal-Token":internalToken};
|
| 910 |
+
const cancelTask=async()=>{
|
| 911 |
+
if(!taskId||cancelAttempted)return;
|
| 912 |
+
cancelAttempted=true;
|
| 913 |
+
try{const response=await fetch(`${BASE_URL}/api/agent/tasks/${encodeURIComponent(taskId)}`,{method:"DELETE",headers:taskHeaders});cancelHttpStatus=response.status;}catch{cancelHttpStatus=0;}
|
| 914 |
+
};
|
| 915 |
+
const readStatus=async()=>{
|
| 916 |
+
statusChecks++;
|
| 917 |
+
const response=await fetch(`${BASE_URL}/api/agent/tasks/${encodeURIComponent(taskId)}/status`,{method:"GET",headers:taskHeaders,signal:ctrl.signal});
|
| 918 |
+
if(!response.ok)throw new Error(`status HTTP ${response.status}`);
|
| 919 |
+
const body=await response.json();
|
| 920 |
+
terminalStatus=String(body.status||"UNKNOWN");
|
| 921 |
+
return terminalStatus;
|
| 922 |
+
};
|
| 923 |
try{
|
| 924 |
const created=await fetch(`${BASE_URL}/api/agent/tasks`,{
|
| 925 |
method:"POST",headers,
|
|
|
|
| 933 |
taskId=String(createdBody.taskId||"");
|
| 934 |
if(!taskId)return{ok:false,output:"",engine,...telemetry(),toolCalls,durationMs:Date.now()-t0,failed:true,failureReason:"taskId mancante"};
|
| 935 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 936 |
let sawText=false;
|
| 937 |
const rawPayloadLog=[];
|
| 938 |
const processSSEData=(raw)=>{
|
|
|
|
| 955 |
sawText=true;
|
| 956 |
if(!(trimmed.startsWith("{")&&trimmed.endsWith("}")))out+=chunk;
|
| 957 |
ttfa=ttfa??now;
|
| 958 |
+
if(options.earlyComplete === "typescript" && /```(?:typescript|ts)\s*[\\s\\S]{80,}?```/i.test(out)){done=true;return true;}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 959 |
}
|
| 960 |
} else if(eventType==="task_error"){
|
| 961 |
failed=true;failureReason=String(ev.error||"task_error");done=true;return true;
|
|
|
|
| 965 |
if(ev.success===false||result.startsWith("[LLM_UNAVAILABLE]")||result.includes("tutti i provider configurati sono falliti")){
|
| 966 |
failed=true;failureReason=result||"provider_unavailable";engine=ev.engine??engine;done=true;return true;
|
| 967 |
}
|
|
|
|
|
|
|
| 968 |
if(result&&(!sawText||result.length>(out||"").length)&&!sawText)out=result;
|
| 969 |
+
engine=ev.engine??engine;terminalStatus="SUCCESS";done=true;return true;
|
| 970 |
}
|
| 971 |
}catch{}
|
| 972 |
return false;
|
| 973 |
};
|
| 974 |
+
const consumeStream=async()=>{
|
| 975 |
+
const streamHeaders={...taskHeaders};
|
| 976 |
+
if(lastEventId>0)streamHeaders["Last-Event-ID"]=String(lastEventId);
|
| 977 |
+
const response=await fetch(`${BASE_URL}/api/agent/tasks/${encodeURIComponent(taskId)}/stream`,{method:"GET",headers:streamHeaders,signal:ctrl.signal});
|
| 978 |
+
if(!response.ok)throw new Error(`stream HTTP ${response.status}`);
|
| 979 |
+
if(!response.body)throw new Error("stream body mancante");
|
| 980 |
+
const dec=new TextDecoder();let buf="";const rd=response.body.getReader();let stopStream=false,skipReplayData=false;
|
| 981 |
+
try{
|
| 982 |
+
while(!stopStream){
|
| 983 |
+
const{done:closed,value}=await rd.read();
|
| 984 |
+
if(closed){buf+=dec.decode();break;}
|
| 985 |
+
buf+=dec.decode(value,{stream:true});
|
| 986 |
+
const lines=buf.split(/\r?\n/);buf=lines.pop()??"";
|
| 987 |
+
for(const line of lines){
|
| 988 |
+
if(line.startsWith("id:")){
|
| 989 |
+
const id=Number(line.slice(3).trim());
|
| 990 |
+
if(Number.isInteger(id)&&id>0){
|
| 991 |
+
skipReplayData=seenEventIds.has(id);
|
| 992 |
+
if(skipReplayData)replayedEventCount++;
|
| 993 |
+
else seenEventIds.add(id);
|
| 994 |
+
if(id>lastEventId)lastEventId=id;
|
| 995 |
+
}
|
| 996 |
+
continue;
|
| 997 |
+
}
|
| 998 |
+
if(line.startsWith(":")){heartbeatCount++;continue;}
|
| 999 |
+
if(!line.startsWith("data:"))continue;
|
| 1000 |
+
if(skipReplayData){skipReplayData=false;continue;}
|
| 1001 |
+
if(processSSEData(line.slice(5).trim())){stopStream=true;break;}
|
| 1002 |
+
}
|
| 1003 |
+
}
|
| 1004 |
+
if(!stopStream&&buf.trim().startsWith("data:"))processSSEData(buf.trim().slice(5).trim());
|
| 1005 |
+
}finally{try{await rd.cancel();}catch{}}
|
| 1006 |
+
};
|
| 1007 |
+
|
| 1008 |
+
// Il backend supporta resume con Last-Event-ID: un drop del trasporto viene
|
| 1009 |
+
// riallacciato allo stesso task, mai rieseguito in silenzio.
|
| 1010 |
+
while(!done&&!failed&&streamReconnects<=1){
|
| 1011 |
+
await consumeStream();
|
| 1012 |
+
if(done||failed)break;
|
| 1013 |
+
await readStatus();
|
| 1014 |
+
if(streamReconnects>=1)break;
|
| 1015 |
+
streamReconnects++;
|
| 1016 |
+
await new Promise(resolve=>setTimeout(resolve,250));
|
| 1017 |
}
|
| 1018 |
+
if(!done&&!failed){
|
| 1019 |
+
failureReason=`SSE_INCOMPLETE${terminalStatus?`_${terminalStatus}`:""}`;
|
| 1020 |
+
failed=true;
|
| 1021 |
+
if(!["SUCCESS","ERROR","CANCELLED"].includes(String(terminalStatus)))await cancelTask();
|
| 1022 |
}
|
| 1023 |
+
if(options.debugRaw){try{writeFileSync("/tmp/code_correct_retry_sse.log",JSON.stringify({timestamp:new Date().toISOString(),sawText,outputLength:out.length,events:rawPayloadLog,telemetry:telemetry()},null,2));}catch{}}
|
| 1024 |
+
if(done&&!failed&&!sawText&&!out)return{ok:false,output:"",engine,...telemetry(),toolCalls,durationMs:Date.now()-t0,failed:true,failureReason:"NO_OUTPUT"};
|
| 1025 |
+
if(done&&options.earlyComplete)await cancelTask();
|
| 1026 |
}catch(e){
|
| 1027 |
+
await cancelTask();
|
| 1028 |
+
const partial=normalizeAgentOutput(out||"");
|
| 1029 |
+
const salvageFeature=options.earlyComplete === "typescript"&&partial.length>=120&&/(?:interface|type|class|function|const)\b/.test(partial)&&/(?:subscribe|getState|async|await|try|catch)/.test(partial);
|
|
|
|
|
|
|
| 1030 |
return{ok:salvageFeature,output:partial,engine,...telemetry(),toolCalls,durationMs:Date.now()-t0,failed:!salvageFeature,failureReason:e.name==="AbortError"?(salvageFeature?"PARTIAL_TIMEOUT":"TIMEOUT"):String(e.message||e),partial:salvageFeature};
|
| 1031 |
}finally{clearTimeout(timer);}
|
| 1032 |
const finalOutput=normalizeAgentOutput(out);
|
|
|
|
| 2353 |
const n=selected.length;
|
| 2354 |
const hfN=selected.filter(t=>t.hfSource&&!t.hfSource.startsWith("local")).length;
|
| 2355 |
const ghN=[_ghEval,_ghSQL,_ghAdvisory].filter(Boolean).length;
|
| 2356 |
+
const requiresTypeScript = selected.some(task => task.category === "code_correct");
|
| 2357 |
+
if(requiresTypeScript){
|
| 2358 |
+
TSC_BIN = await resolveTypeScriptCompiler();
|
| 2359 |
+
if(!TSC_BIN){
|
| 2360 |
+
throw new Error("BENCHMARK_PREREQUISITE_TYPESCRIPT: esegui pnpm install oppure imposta TSC_BIN su un compilatore TypeScript compatibile prima di misurare code_correct.");
|
| 2361 |
+
}
|
| 2362 |
+
}
|
| 2363 |
|
| 2364 |
_log(`\n${B}${BOLD}ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ${NC}`);
|
| 2365 |
_log(`${B}${BOLD}β EXTENDED BENCHMARK v5 β seed: ${String(seed).padEnd(12)} β${NC}`);
|
|
|
|
| 2414 |
score:null,ref:task.ref,buildPassed:null,testsPassed:null,
|
| 2415 |
planScore:null,executionScore:null,recoveryScore:null,autonomyScore:null,
|
| 2416 |
agentMs,ttfa:agent.ttfa??9999,ttfaMs:agent.ttfaMs??agent.ttfa??9999,toolCalls:agent.toolCalls??0,tokEstimate:0,
|
| 2417 |
+
engine:agent.engine,provider:agent.provider??"?",model:agent.model??agent.engine??"?",lastEvent:agent.lastEvent??null,lastEventAt:agent.lastEventAt??null,lastEventId:agent.lastEventId??0,taskId:agent.taskId??null,streamReconnects:agent.streamReconnects??0,heartbeatCount:agent.heartbeatCount??0,statusChecks:agent.statusChecks??0,replayedEventCount:agent.replayedEventCount??0,terminalStatus:agent.terminalStatus??null,cancelAttempted:agent.cancelAttempted??false,cancelHttpStatus:agent.cancelHttpStatus??null,breakdown:null,detail:`non valutabile: ${reason}`,unavailable:true,failureReason:reason});
|
| 2418 |
continue;
|
| 2419 |
}
|
| 2420 |
|
|
|
|
| 2453 |
score,ref,buildPassed:vr.buildPassed,testsPassed:vr.testsPassed,
|
| 2454 |
planScore:vr.planScore,executionScore:vr.executionScore,recoveryScore:vr.recoveryScore,
|
| 2455 |
agentMs,ttfa:agent.ttfa??9999,ttfaMs:agent.ttfaMs??agent.ttfa??9999,toolCalls:agent.toolCalls??0,tokEstimate:tokEst,
|
| 2456 |
+
engine:agent.engine,provider:agent.provider??"?",model:agent.model??agent.engine??"?",lastEvent:agent.lastEvent??null,lastEventAt:agent.lastEventAt??null,lastEventId:agent.lastEventId??0,taskId:agent.taskId??null,streamReconnects:agent.streamReconnects??0,heartbeatCount:agent.heartbeatCount??0,statusChecks:agent.statusChecks??0,replayedEventCount:agent.replayedEventCount??0,terminalStatus:agent.terminalStatus??null,cancelAttempted:agent.cancelAttempted??false,cancelHttpStatus:agent.cancelHttpStatus??null,breakdown,detail:(vr.detail||"").slice(0,200),failureReason:agent.failureReason||null});
|
| 2457 |
}
|
| 2458 |
|
| 2459 |
// ββ Summary ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 2530 |
F_robustezza:"robustness",G_operativitΓ :"coding+data_analysis"},
|
| 2531 |
methodology:{
|
| 2532 |
runtime_input:{profile:"fixed-realistic-chat-v1",persona:BENCHMARK_PERSONA,negative_constraints:true,context_messages:BENCHMARK_CONTEXT.length},
|
| 2533 |
+
runner_prerequisites:{typescript_required:requiresTypeScript,typescript_bin:requiresTypeScript?TSC_BIN:null},
|
| 2534 |
+
sse_recovery:{resume:"Last-Event-ID",deduplicate_replayed_event_ids:true,max_reconnects:1,status_endpoint:"/api/agent/tasks/{taskId}/status",cancel_on_nonterminal_incomplete:true},
|
| 2535 |
canonical_seed:"1337 (stesse domande per tutti gli agenti β usa --rotate per seed diverso)",
|
| 2536 |
coding:"enterprise: Acc(35%)+Stab(20%)+Auto(15%)+Perf(10%)+Spd(10%)+Cost(5%)+Tool(5%)",
|
| 2537 |
nonCoding:"content: Acc(40%)+Struct(20%)+Comp(15%)+Prec(10%)+Auto(5%)+Spd(5%)+Cost(5%)",
|