Add oracle harness: verb goldens and function-level vectors

Records stdout/stderr/exit/files for every impeccable verb over a fixed
corpus and replays them against an alternate implementation. Adds a loader
hook that captures per-function call vectors from the pure engine modules.

Prepared with AI assistance (Claude Code).
This commit is contained in:
Paul Bakaus
2026-08-31 19:56:22 -07:00
parent d3f4cc8f4b
commit 57c1fccf73
212 changed files with 2089 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env node
/**
* Record goldens from the JS implementation.
* node tests/oracle/record.mjs # all cases
* node tests/oracle/record.mjs detect- # only ids starting with a prefix
*/
import { allCases, runCase, writeGolden } from './lib.mjs';
const prefix = process.argv[2] || '';
const cases = (await allCases()).filter(c => c.id.startsWith(prefix));
let n = 0;
for (const c of cases) {
const res = runCase(c, { impl: 'js' });
writeGolden(c.id, res);
n++;
process.stdout.write(`recorded ${c.id} (exit ${res.exit}, ${res.stdout.length}b out, ${Object.keys(res.files).length} files)\n`);
}
process.stdout.write(`\n${n} goldens written\n`);