fix: bind performance evidence to production resources

This commit is contained in:
2026-09-02 08:53:00 +03:00
parent 5b7e47c2a2
commit e3ac3a4db4
23 changed files with 642 additions and 60 deletions

View File

@@ -2,10 +2,13 @@
import { readFile } from 'node:fs/promises';
import { aggregateFiveDriveTraces } from './lib/performance-aggregation.mjs';
const paths = process.argv.slice(2);
const args = process.argv.slice(2);
if (args[0] !== '--trust-policy' || typeof args[1] !== 'string') throw new Error('Pass --trust-policy followed by an explicit trusted public-key policy.');
const policy = JSON.parse(await readFile(args[1], 'utf8'));
const paths = args.slice(2);
if (paths.length !== 5) throw new Error('Pass exactly five explicit drive-trace.v1 JSON paths.');
const runs = [];
for (const path of paths) runs.push(JSON.parse(await readFile(path, 'utf8')));
const aggregate = aggregateFiveDriveTraces(runs);
const aggregate = aggregateFiveDriveTraces(runs, policy);
process.stdout.write(`${JSON.stringify(aggregate, null, 2)}\n`);
if (!aggregate.passes) process.exitCode = 1;