import { readFile } from 'node:fs/promises'; import { resolve } from 'node:path'; const root = resolve(new URL('..', import.meta.url).pathname); const report = JSON.parse(await readFile(resolve(root, 'config/chrome-native-thickness-history-verification.json'), 'utf8'))
if (report.schemaVersion !== 1 || report.browserId !== 'chrome' || report.crossOriginIsolated !== true || report.status !== 'pass' || report.nativeCapabilities?.operations?.includes('thickness') !== true) throw new Error('Chrome native Thickness capability evidence is invalid.')
if (report.history?.recordCount <= 0 || report.history?.relations?.modified <= 0 || JSON.stringify(report.history?.sourceObjects) !== JSON.stringify(['Base'])) throw new Error('Chrome native Thickness relation evidence is invalid.')
if (report.result?.bitbybitSolids !== 1 || !(report.result?.bitbybitVolume > 0) || report.result?.nativeStructuralValid !== true || report.result?.nativeSolids !== 1 || !(report.result?.nativeVolume > 0) || report.opfs?.markerSuite !== 'thickness' || report.opfs?.markerRemoved !== true || report.afterRelease?.shapeCount !== 0 || report.afterRelease?.kernelReferenceCount !== 0) throw new Error('Chrome native Thickness result or resource evidence is invalid.')
console.log(JSON.stringify({ status: 'chrome-native-thickness-history-pass', browserId: report.browserId, records: report.history.recordCount, relations: report.history.relations, result: report.result, afterRelease: report.afterRelease }, null, 2))
