Spaces:
Running
Running
sync: 190 file da Baida98/AI@83eea3de (2026-08-26 12:09 UTC) [deploy-all]
#117
by Baida07 - opened
- benchmark-extended.mjs +4 -1
benchmark-extended.mjs
CHANGED
|
@@ -448,7 +448,9 @@ async function repairDataAnalysisIfNeeded(task, agent, timeoutMs) {
|
|
| 448 |
if (task.category !== "data_analysis" || agent.failed) return {agent,retried:false,reason:null};
|
| 449 |
let first;
|
| 450 |
try { first = await task.verify(agent.output || ""); } catch { return {agent,retried:false,reason:null}; }
|
| 451 |
-
|
|
|
|
|
|
|
| 452 |
const detail = String(first.detail || "validator non superato");
|
| 453 |
const repairGoal = `${task.prompt}\n\n---\nDATA_ANALYSIS REPAIR OBBLIGATORIO\nLa risposta precedente non ha superato il controllo deterministico: ${detail}.\nNon chiedere ulteriori dati e ignora ogni contesto non presente nel JSON qui sopra. Calcola di nuovo dai record forniti: (1) somma tutti i valori e dividi per il numero di mesi; (2) individua il valore massimo e il suo mese; (3) individua il valore fuori scala e il suo mese.\nRestituisci esclusivamente queste quattro righe, senza introduzione, spiegazioni o Markdown aggiuntivo:\n- **Media: N**\n- **Picco: MESE (N)**\n- **Anomalia: MESE (N)**\n- **Trend: testo breve**\nUsa i nomi mese presenti nel JSON e valori numerici effettivamente calcolati. Non copiare esempi o placeholder.`;
|
| 454 |
if (!F_JSON) process.stdout.write(` ⟳ repair data_analysis (${detail.slice(0,60)})... `);
|
|
@@ -1909,6 +1911,7 @@ async function makeDataAnalysis(rng){
|
|
| 1909 |
const score=Object.values(ok).filter(Boolean).length/3;
|
| 1910 |
return{buildPassed:score>=0.33,testsPassed:score>=0.66,
|
| 1911 |
accuracy:score,structure:/\*\*/.test(o)?0.9:0.4,completeness:score>=0.66?0.9:0.5,precision:score,
|
|
|
|
| 1912 |
detail:`avg:${ok.avgOk}(got:${avgGot}exp:${avg}) peak:${ok.peakOk} anom:${ok.anomOk}`};
|
| 1913 |
},isNonCoding:true};
|
| 1914 |
}
|
|
|
|
| 448 |
if (task.category !== "data_analysis" || agent.failed) return {agent,retried:false,reason:null};
|
| 449 |
let first;
|
| 450 |
try { first = await task.verify(agent.output || ""); } catch { return {agent,retried:false,reason:null}; }
|
| 451 |
+
const analysisChecks = first.analysisChecks ?? {};
|
| 452 |
+
const allNumericChecksPassed = ["avgOk", "peakOk", "anomOk"].every((key) => analysisChecks[key] === true);
|
| 453 |
+
if (allNumericChecksPassed) return {agent,retried:false,reason:null};
|
| 454 |
const detail = String(first.detail || "validator non superato");
|
| 455 |
const repairGoal = `${task.prompt}\n\n---\nDATA_ANALYSIS REPAIR OBBLIGATORIO\nLa risposta precedente non ha superato il controllo deterministico: ${detail}.\nNon chiedere ulteriori dati e ignora ogni contesto non presente nel JSON qui sopra. Calcola di nuovo dai record forniti: (1) somma tutti i valori e dividi per il numero di mesi; (2) individua il valore massimo e il suo mese; (3) individua il valore fuori scala e il suo mese.\nRestituisci esclusivamente queste quattro righe, senza introduzione, spiegazioni o Markdown aggiuntivo:\n- **Media: N**\n- **Picco: MESE (N)**\n- **Anomalia: MESE (N)**\n- **Trend: testo breve**\nUsa i nomi mese presenti nel JSON e valori numerici effettivamente calcolati. Non copiare esempi o placeholder.`;
|
| 456 |
if (!F_JSON) process.stdout.write(` ⟳ repair data_analysis (${detail.slice(0,60)})... `);
|
|
|
|
| 1911 |
const score=Object.values(ok).filter(Boolean).length/3;
|
| 1912 |
return{buildPassed:score>=0.33,testsPassed:score>=0.66,
|
| 1913 |
accuracy:score,structure:/\*\*/.test(o)?0.9:0.4,completeness:score>=0.66?0.9:0.5,precision:score,
|
| 1914 |
+
analysisChecks:ok,
|
| 1915 |
detail:`avg:${ok.avgOk}(got:${avgGot}exp:${avg}) peak:${ok.peakOk} anom:${ok.anomOk}`};
|
| 1916 |
},isNonCoding:true};
|
| 1917 |
}
|