Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(fact-check): write the per-claim detail file before the degradation guard

nirholasa3b12cb9b689
diff --git a/scripts/fact-check-benchmark.mjs b/scripts/fact-check-benchmark.mjs
index fb41c7a94..cf5b2c60c 100644
--- a/scripts/fact-check-benchmark.mjs
+++ b/scripts/fact-check-benchmark.mjs
@@ -253,14 +253,17 @@ async function mainInProcess(claims, fixture, { publish } = {}) {
}
const score = scoreResults(results);
- refuseIfDegraded(score);
- const report = buildReport({ score, endpoint, fixture, claimCount: claims.length });
// Per-claim detail for diagnosis (not published; scratch aid for whoever is
- // tuning the chain). Written next to nothing public.
+ // tuning the chain). Written next to nothing public, and written BEFORE the
+ // degradation guard: a refused run is exactly the run someone needs the
+ // per-source stances for, and refuseIfDegraded exits the process, so writing
+ // this after it threw away the evidence for every diagnosis it demanded.
if (process.env.FACT_CHECK_DETAIL_FILE) {
await mkdir(dirname(process.env.FACT_CHECK_DETAIL_FILE), { recursive: true });
await writeFile(process.env.FACT_CHECK_DETAIL_FILE, JSON.stringify(details, null, 2) + '\n');
}
+ refuseIfDegraded(score);
+ const report = buildReport({ score, endpoint, fixture, claimCount: claims.length });
console.log(`\nOverall accuracy: ${score.accuracy_pct}% (${score.correct}/${score.total}, ${score.errors} errors)`);
await writeReport(report, { publish });
}