Files
Agent-Workbench/docs/embedded-browser-release-evidence/verifiers/bind-vendor-runtime.before-timestamp-review.mjs
T

22 lines
1.9 KiB
JavaScript

import fs from 'node:fs';
import path from 'node:path';
import assert from 'node:assert/strict';
import { createHash } from 'node:crypto';
const hash = bytes => createHash('sha256').update(bytes).digest('hex');
const read = file => JSON.parse(fs.readFileSync(file));
const beforeFile = 'docs/embedded-browser-b-rejected-candidate-evidence/portable-manifest.json';
const release = read('releases/latest.json'), afterFile = path.join(release.portableRoot, 'MANIFEST.json');
const before = read(beforeFile), after = read(afterFile);
assert.equal(before.version, '1.22.0'); assert.equal(after.version, before.version);
assert.equal(read('.qa/embedded-browser-c-archives-original-result.json').success, true);
const retained = row => /^(?:dist-client|dist-server|dist-desktop|runtime|desktop|scripts|public|examples|benchmarks|research|licenses)\//.test(row.path)
|| ['package.json', 'THIRD_PARTY_NOTICES.txt'].includes(row.path);
const previous = before.files.filter(retained).sort((a, b) => a.path.localeCompare(b.path));
const current = after.files.filter(retained).sort((a, b) => a.path.localeCompare(b.path));
assert.deepEqual(current, previous, 'C vendor/runtime payload differs from B');
const result = { success: true, files: current.length, bytes: current.reduce((total, row) => total + row.bytes, 0),
beforeManifestSha256: hash(fs.readFileSync(beforeFile)), afterManifestSha256: hash(fs.readFileSync(afterFile)),
scope: 'B and C validated portable manifests declare identical complete runtime/vendor, compiled, script, asset, example, benchmark, research and license payloads. This supplements the original input/UI binding; it does not reclassify B source failure. Changed milestone documents and evidence are outside this runtime comparison.' };
fs.writeFileSync('.qa/embedded-browser-c-vendor-runtime-binding.json', JSON.stringify(result, null, 2) + '\n', { flag: 'wx' });
console.log(JSON.stringify(result));