Files
Michał Pierzchała 0e51007b04 refactor: isolate maestro engine package (#1506)
* refactor: isolate maestro engine package

* perf: deepen maestro facade boundaries
2026-07-30 20:58:20 +02:00

18 lines
743 B
TypeScript

import { createHash } from 'node:crypto';
// Normal CI cannot re-derive fixtures without Java, so verification recomputes
// this tamper-evident seal over generated content. The scheduled regeneration
// job closes the remaining gap by re-running the JVM harness against the pinned
// artifacts and comparing the generated bytes.
export function fixtureContentHash(fixtureWithoutSeal: unknown): string {
return createHash('sha256').update(JSON.stringify(fixtureWithoutSeal)).digest('hex');
}
export function checkFixtureSeal(parsedFixture: Record<string, unknown>): {
expected: string;
actual: unknown;
} {
const { contentHash, ...content } = parsedFixture;
return { expected: fixtureContentHash(content), actual: contentHash };
}