The workbench surface audit scrapes module names out of the web module registry and iterates two viewports, so its record count is a product, never a constant. Removing OpenSCAD dropped the registry from 32 to 31 modules and moved the expected count from 64 to 62, while 65 places in the tooling still asserted 64 - re-running the audit would have failed every gate with no actual regression behind it. Add tools/audit64.mjs as the single owner of the coverage rule: auditCoverage(), auditCoverageComplete() and audit64Satisfied(). The success test requires records === expectedRecords only when the snapshot carries an expectation, so freshly produced evidence (62 records plus expectedRecords 62) and historical evidence captured before the removal (64 records, no expectation) are both judged against their own coverage. The 111 archived CAM snapshots stay valid instead of being reclassified as regressions, and a real 62-vs-64 shortfall still fails. Converted callers: 56 build_cam_*_profile.mjs, 5 tools/mcp/replay-*.mjs, close-official-case.mjs, run_partdesign_official_suite.mjs, run_p6_assembly_testcore_chrome.mjs, run_p6_bim_arch_component_chrome.mjs and run-official-native-shape-profile.mjs. The producer in run_p6_cam_chrome.mjs now writes the derived expectedRecords so downstream gates compare against an authoritative expectation. Also fix artifacts that would have revived the removed module: sync-assets.mjs unconditionally re-copied the OpenSCAD runtime probe into public/kernel on every sync-kernel run, and its sources still exist in the build tree. Drop that loop, the dead displayOwners entry in audit-geometry-boundary.mjs, and the 14 MB vendored openscad-wasm. Keep the parity matrix self-consistent: module_count follows rows (31), and the business completion audit derives its expected module count from the matrix instead of hardcoding 32, which would otherwise make completion unreachable. Rebuilt dist and re-ran the audit against an ephemeral isolated static host: 31 modules, 2 viewports, 62 records, 0 failures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
123 lines
5.3 KiB
JavaScript
123 lines
5.3 KiB
JavaScript
#!/usr/bin/env node
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { audit64Satisfied } from "./audit64.mjs";
|
|
|
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
const docs = path.join(root, "docs");
|
|
const dir = path.join(docs, "current", "business-evidence", "desktop-test-cam-testpathopdeburr-20261030");
|
|
const desktop = JSON.parse(fs.readFileSync(path.join(docs, "p6", "cam-deburr-chrome.json"), "utf8"));
|
|
const mobile = JSON.parse(fs.readFileSync(path.join(docs, "p6", "cam-deburr-chrome-mobile.json"), "utf8"));
|
|
const caseId = "desktop-test.Mod.CAM.CAMTests.TestPathOpDeburr";
|
|
const EXPECTED = 7;
|
|
|
|
const contract = {
|
|
schema: "freecad-web-official-case-acceptance-contract/v1",
|
|
caseId,
|
|
source: "freecad-source/src/Mod/CAM/CAMTests/TestPathOpDeburr.py",
|
|
enabledOfficialMethods: EXPECTED,
|
|
prerequisites: [
|
|
"absolute TestPathOpDeburr.py and Path/Op/Deburr.py paths",
|
|
"official MockToolBit fixture with Diameter, FlatRadius and CuttingEdgeAngle",
|
|
"PathDeburr.toolDepthAndOffset returns depth, offset, extra and info",
|
|
"Qt Signal/QT_TRANSLATE_NOOP shims and stdlib numpy/tsp_solver bridges",
|
|
],
|
|
passConditions: [
|
|
"all 7 official methods pass",
|
|
"end mill (diameter 20, angle 180) at depth 1 with 0.01 step gives depth 0.01 and offset 9 with info false",
|
|
"legacy tool (angle 0) gives the same depth and offset",
|
|
"document count returns 0 to 0",
|
|
"desktop and mobile have no page errors, overflow or external requests",
|
|
"64-record workbench audit passes on each host",
|
|
],
|
|
failureClassification: {
|
|
prerequisite: "source paths, Deburr import or MockToolBit construction fail before methods",
|
|
product: "official chamfer depth or offset assertion fails",
|
|
presentation: "viewport, network or console failure",
|
|
audit: "workbench audit failure",
|
|
},
|
|
persistence: {
|
|
applicable: false,
|
|
reason: "deburr math runs on in-memory tool descriptors with no document",
|
|
database: "not used; SQLite WASM/OPFS is the project persistence standard when needed",
|
|
},
|
|
};
|
|
|
|
function complete(report) {
|
|
const result = report.cases.centroid.state.response?.result;
|
|
const pre = result?.preflight;
|
|
const probe = pre?.probe;
|
|
return (
|
|
report.result === "pass" &&
|
|
result?.schema === "freecad-web-cam/test-path-op-deburr/v1" &&
|
|
result.tests?.length === EXPECTED &&
|
|
result.tests.every((t) => t.passed === true) &&
|
|
result.guiUp?.[0] === "bool" &&
|
|
result.guiUp?.[1] === false &&
|
|
pre?.passed === true &&
|
|
Math.abs((probe?.endMill?.depth ?? -1) - 0.01) < 1e-6 &&
|
|
Math.abs((probe?.endMill?.offset ?? -1) - 9) < 1e-6 &&
|
|
probe?.endMill?.info === false &&
|
|
Math.abs((probe?.legacy?.depth ?? -1) - 0.01) < 1e-6 &&
|
|
Math.abs((probe?.legacy?.offset ?? -1) - 9) < 1e-6 &&
|
|
result.documentCountBefore === 0 &&
|
|
result.documentCountAfter === 0 &&
|
|
report.cases.layout.state.crossOriginIsolated === true &&
|
|
report.cases.layout.state.bodyOverflow === false &&
|
|
report.cases.layout.state.propertiesInViewport === true &&
|
|
report.network.externalRequestCount === 0 &&
|
|
report.network.httpFailures.length === 0 &&
|
|
report.exceptions.length === 0 &&
|
|
report.audit64.status === "passed" &&
|
|
audit64Satisfied(report.audit64) &&
|
|
report.audit64.failures === 0
|
|
);
|
|
}
|
|
|
|
const passed = complete(desktop) && complete(mobile);
|
|
const profile = {
|
|
schema: "freecad-web-official-case-profile/v1",
|
|
caseId,
|
|
status: passed ? "passed" : "incomplete",
|
|
sourceMapped: true,
|
|
implementationStatus: "native_web_owner_ready",
|
|
integrationStatus: passed ? "passed" : "integration_pending",
|
|
acceptancePassed: passed,
|
|
preflight: desktop.cases.centroid.state.response.result.preflight,
|
|
officialMethods: {
|
|
expected: EXPECTED,
|
|
desktop: desktop.cases.centroid.state.response.result.tests,
|
|
mobile: mobile.cases.centroid.state.response.result.tests,
|
|
},
|
|
viewports: {
|
|
desktop: { viewport: desktop.viewport, layout: desktop.cases.layout.state, pageErrors: desktop.exceptions, overflow: desktop.cases.layout.state.bodyOverflow },
|
|
mobile: { viewport: mobile.viewport, layout: mobile.cases.layout.state, pageErrors: mobile.exceptions, overflow: mobile.cases.layout.state.bodyOverflow },
|
|
},
|
|
audit64: { desktop: desktop.audit64, mobile: mobile.audit64 },
|
|
persistence: contract.persistence,
|
|
evidence: [
|
|
"acceptance-contract.json",
|
|
"cam-deburr-native-desktop.json",
|
|
"cam-deburr-native-mobile.json",
|
|
"cam-deburr-browser-desktop.json",
|
|
"cam-deburr-browser-mobile.json",
|
|
"workbench-surface-audit-desktop.json",
|
|
"workbench-surface-audit-mobile.json",
|
|
"cam-deburr-desktop.png",
|
|
"cam-deburr-mobile.png",
|
|
].map((file) => `docs/current/business-evidence/desktop-test-cam-testpathopdeburr-20261030/${file}`),
|
|
};
|
|
|
|
fs.mkdirSync(dir, { recursive: true });
|
|
fs.writeFileSync(path.join(dir, "acceptance-contract.json"), `${JSON.stringify(contract, null, 2)}\n`);
|
|
fs.writeFileSync(path.join(dir, "desktop-test-cam-deburr-profile.json"), `${JSON.stringify(profile, null, 2)}\n`);
|
|
console.log(JSON.stringify({
|
|
status: profile.status,
|
|
methods: EXPECTED,
|
|
depth: profile.preflight.probe.endMill.depth,
|
|
offset: profile.preflight.probe.endMill.offset,
|
|
audits: [profile.audit64.desktop.records, profile.audit64.mobile.records],
|
|
}));
|
|
process.exitCode = passed ? 0 : 1;
|