import fs from 'node:fs'; import assert from 'node:assert/strict'; import { createHash } from 'node:crypto'; const read = file => JSON.parse(fs.readFileSync(file, 'utf8')); const hash = bytes => createHash('sha256').update(bytes).digest('hex'); const release = read('releases/latest.json'), baseline = read('docs/task-control-release-code-baseline.json'); assert.equal(release.installer.version, '1.20.1'); assert.equal(release.installer.candidateDirectory, 'Agent-Workbench-1.20.1-win-x64-20261101052415729'); const initial = read('.qa/task-control-first-candidate.json'); assert.notEqual(initial.portableRoot, release.portableRoot); for (const row of [...baseline.inputs, ...baseline.builds, ...baseline.benchmarks]) { const bytes = fs.readFileSync(row.path); assert.equal(bytes.length, row.bytes, row.path); assert.equal(hash(bytes), row.sha256, row.path); } const log = '.qa/task-control-final-package.log', bytes = fs.readFileSync(log); for (const kind of ['portable', 'source', 'installer']) { const item = release[kind], contents = fs.readFileSync(item.path); assert.equal(contents.length, item.bytes); assert.equal(hash(contents), item.sha256); } fs.writeFileSync('.qa/task-control-final-candidate.json', JSON.stringify(release, null, 2) + '\n', { flag: 'wx' }); const result = { success: true, version: '1.20.1', codeCommit: baseline.codeCommit, release, unchangedInputs: true, logPath: log, logBytes: bytes.length, logSha256: hash(bytes), firstCandidate: { portableRoot: initial.portableRoot, accepted: false, reason: 'Built before final split-pane layout and sealed-Run UI verification updates; retained unchanged.' }, completedAt: fs.statSync('releases/latest.json').mtime.toISOString(), recordedAt: new Date().toISOString() }; fs.writeFileSync('.qa/task-control-f-package-result.json', JSON.stringify(result, null, 2) + '\n', { flag: 'wx' }); console.log(JSON.stringify({ success: true, immutableRelease: release.installer.candidateDirectory, inputs: baseline.inputs.length }));