Merge remote-tracking branch 'upstream/main' into pr-70

# Conflicts:
#	src/config/index.ts
#	src/llm/index.ts
#	src/server.ts
#	src/setup.ts
#	src/types/index.ts
This commit is contained in:
Joseph Magly committed 2026-07-17 01:39:59 -04:00
commit be3eb7cb44
75 files changed
+7788 -586

No files matched your search

+44 -2
View File
@@ -159,9 +159,9 @@ check('VERIFY gate implemented', /VERIFY gate|never appeared in tool output/.tes
check('REFLECT gate implemented', /REFLECT gate/.test(bench), 'forced mid-run pivot');
// ── CLAIM 4: capability breadth ─────────────────────────────────────────────
console.log('\nCLAIM 4 — capability: 83 tools, 8-operator kill-chain');
console.log('\nCLAIM 4 — capability: 108 tools, 8-operator kill-chain');
// DISTINCT tools = external-binary adapters (catalog.ts TOOL_ADAPTERS id:) + custom
// built-in tools (index.ts BUILTIN_TOOLS top-level name:). NOT a name:/id: regex count
// built-in/external tools (index.ts top-level name:). NOT a name:/id: regex count
// (that double-counts each tool's id+name AND every parameter name).
const catalogSrc = fs.existsSync(R('src/arsenal/catalog.ts')) ? fs.readFileSync(R('src/arsenal/catalog.ts'), 'utf8') : '';
const indexSrc = fs.existsSync(R('src/arsenal/index.ts')) ? fs.readFileSync(R('src/arsenal/index.ts'), 'utf8') : '';
@@ -229,6 +229,48 @@ console.log('\nCLAIM 7 — CVE-Zero-v2 (held-out): hunt generalizes to fresh uns
}
}
// ── INTEGRITY GATE: every scored solve is oracle-grounded (no phantom pass) ───
// Every check above credits a solve straight from the committed `verdict` (detected /
// score===1). This gate closes the obvious tamper hole in that trust: a scored solve must
// still AGREE with its own committed flag oracle. A solve is oracle-grounded iff EITHER the
// agent's self-reported flag matches the committed `expected` under the same case-insensitive
// compare the harness uses (ciMatch), OR the harness auto-detected `expected` verbatim in tool
// output (auto_detected — the agent didn't self-report, so `reported` may be "UNKNOWN").
// Anything scored as a solve that is NEITHER is a phantom pass: a hand-edited `detected:true`
// whose committed oracle does not back it. This wires ciMatch (until now defined but unused)
// into an executable gate, and rejects a fabricated placeholder credited via the self-report path.
console.log('\nINTEGRITY GATE — every committed solve is oracle-grounded (no phantom pass, no fabricated flag)');
const oracleGrounded = (v) =>
ciMatch(v.reported, v.expected) || v.auto_detected === true || /auto-?detected/i.test(String(v.reason || ''));
const scanSolves = (files) => {
let solves = 0, phantom = 0, fabricated = 0, grounded = 0;
for (const f of files) {
const v = (((JSON.parse(fs.readFileSync(f, 'utf8')).results) || [{}])[0] || {}).verdict || {};
if (!(v.detected === true || v.score === 1)) continue;
solves++;
if (oracleGrounded(v)) grounded++; else phantom++;
// A fabricated placeholder may only ever be "credited" via the self-report path.
if (ciMatch(v.reported, v.expected) && looksFabricated(v.reported)) fabricated++;
}
return { solves, phantom, fabricated, grounded };
};
const xbenFiles = [...BESTBALL_DIRS, ...WHITEBOX_DIRS].flatMap((sub) =>
glob(R('bench/xbow/results/' + sub), /^xben_\d+_24.*\.json$/));
const cybenchFiles = [...glob(R('bench/cybench/results'), /^clean-.*\.json$/),
...glob(R('bench/cybench/results'), /^service-cybsvc_.*\.json$/)];
const ig = scanSolves([...xbenFiles, ...cybenchFiles]);
check('every scored solve is oracle-grounded (self-report ≡ committed oracle, or auto-detected)',
ig.phantom === 0, `${ig.phantom} phantom / ${ig.solves} scored solves`);
check('no fabricated placeholder flag is credited as a self-reported solve',
ig.fabricated === 0, `${ig.fabricated} fabricated / ${ig.solves} scored solves`);
// Informational — how much of the Cybench headline is backed by an oracle-bearing per-run
// artifact vs. counted only in the hand-editable aggregate (transcripts are stripped on export).
{
const cRun = scanSolves(cybenchFiles);
const aggSolved = fs.existsSync(cf) ? JSON.parse(fs.readFileSync(cf, 'utf8')).solved : null;
console.log(` ℹ️ Cybench: aggregate reports ${aggSolved} solved · ${cRun.grounded} oracle-grounded per-run artifact(s) committed · ${(aggSolved ?? 0) - cRun.grounded} aggregate-only`);
}
// ── verdict ─────────────────────────────────────────────────────────────────
console.log(`\n════════ ${fail === 0 ? '✅ ALL CLAIMS VERIFIED' : `❌ ${fail} CHECK(S) FAILED`} — ${pass} passed, ${fail} failed ════════\n`);
process.exit(fail === 0 ? 0 : 1);