mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
0e51007b04
* refactor: isolate maestro engine package * perf: deepen maestro facade boundaries
18 lines
743 B
TypeScript
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 };
|
|
}
|