import { readFile } from 'node:fs/promises' import { resolve } from 'node:path' const root = resolve(new URL('..', import.meta.url).pathname) const load = async (path) => JSON.parse(await readFile(resolve(root, path), 'utf8')) const [abi, matrix, plan] = await Promise.all([ load('config/freecad-sketcher-partdesign-abi-contract.json'), load('config/compatibility-matrix.json'), load('config/freecad-web-exact-parity-plan.json'), ]) const fail = (message) => { throw new Error(`FreeCAD private naming boundary: ${message}`) } const tasks = plan.programs.flatMap((program) => program.tasks) const task = tasks.find((entry) => entry.id === 'EX-TSN-02') if (!task) fail('EX-TSN-02 is missing from the exact parity plan.') if (abi.privateNamingAbi?.shippedWorkerImplementation !== 'not-linked') fail('the shipped ABI contract must remain not-linked until the production artifact exports verified callbacks.') if (abi.claim?.exactFreeCadParity !== false) fail('the supported facade contract cannot claim exact FreeCAD parity.') if (matrix.nativeOcctHistory?.freecadNamingBuild?.status !== 'contract-only') fail('the FreeCAD naming build must remain contract-only before a locked SDK and callback probe exist.') if (task.status !== 'in_progress') fail(`EX-TSN-02 must remain in_progress, received ${String(task.status)}.`) if (matrix.systemExactEvaluation?.exact !== false) fail('systemExact must remain false.') const blockers = matrix.systemExactEvaluation?.blockers ?? [] if (!blockers.includes('shipped Worker lacks the FreeCAD-linked private naming ABI implementation')) fail('systemExact blockers must retain the missing FreeCAD-linked Worker implementation.') if (!task.exactBlockedBy?.includes('The shipped Worker does not link the FreeCAD private naming implementation for every builder')) fail('EX-TSN-02 must retain its production Worker linkage blocker.') console.log(JSON.stringify({ status: 'boundary-pass', shippedWorkerImplementation: 'not-linked', task: { id: task.id, status: task.status }, systemExact: matrix.systemExactEvaluation.exact, sdkStatus: matrix.nativeOcctHistory.freecadNamingBuild.status, }, null, 2))