mirror of
https://github.com/ruvnet/RuView.git
synced 2026-09-01 13:07:25 +00:00
feat: add physics-constrained pose refinement
This commit is contained in:
27
scripts/pose-physics/verify-harness-tests.mjs
Normal file
27
scripts/pose-physics/verify-harness-tests.mjs
Normal file
@@ -0,0 +1,27 @@
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { spawnSync } from "node:child_process";
|
||||
|
||||
const directory = path.dirname(fileURLToPath(import.meta.url));
|
||||
const run = (script, fixture) =>
|
||||
spawnSync(process.execPath, [path.join(directory, script), path.join(directory, "testdata", fixture)], {
|
||||
cwd: path.resolve(directory, "../.."),
|
||||
encoding: "utf8",
|
||||
});
|
||||
|
||||
const strict = run("verify-splits.mjs", "strict-split-manifest.json");
|
||||
if (strict.status !== 0 || !strict.stdout.includes('"verdict":"PASS"')) {
|
||||
throw new Error(`strict split fixture failed: ${strict.stderr || strict.stdout}`);
|
||||
}
|
||||
|
||||
const leaky = run("verify-splits.mjs", "leaky-split-manifest.json");
|
||||
if (leaky.status === 0 || !leaky.stderr.includes("leakage:")) {
|
||||
throw new Error("leaky split fixture was not rejected with a typed leakage error");
|
||||
}
|
||||
|
||||
const golden = run("verify-golden.mjs", "golden-results.jsonl");
|
||||
if (golden.status !== 0 || !golden.stdout.includes('"verdict":"PASS"')) {
|
||||
throw new Error(`golden replay fixture failed: ${golden.stderr || golden.stdout}`);
|
||||
}
|
||||
|
||||
process.stdout.write(JSON.stringify({ verdict: "PASS", checks: 3 }) + "\n");
|
||||
Reference in New Issue
Block a user