Files
Web_FreeCAD_Bitbybit/native/freecad-naming-probe/smoke-test.mjs
wangdequan f97eae4153
Some checks failed
real-verification / chrome (push) Has been cancelled
real-verification / freecad-oracle (push) Has been cancelled
real-verification / wasm (push) Has been cancelled
feat: add candidate FreeCAD naming SDK and attachment oracles
Build and verify the candidate-only FreeCAD naming bridge and OCCT worker path, including three-stage StringHasher restoration. Add Datum, ShapeBinder, attachment-mode, and PartDesign structure oracles plus offline SDK build plans and CI boundary checks.
2026-08-13 17:16:07 -04:00

46 lines
2.0 KiB
JavaScript

import createProbe from './dist/freecad-private-naming-source-probe.js'
import { inspectWasmStaticArchive } from '../../scripts/freecad-naming-sdk-lib.mjs'
const archive = await inspectWasmStaticArchive(new URL('./dist/libFreeCADPrivateNamingProbe.a', import.meta.url))
if (archive.memberCount !== 7 || archive.wasmObjectCount !== 7 || archive.llvmBitcodeCount !== 0) {
throw new Error(`Unexpected FreeCAD private naming source archive: ${JSON.stringify(archive)}`)
}
const probe = await createProbe()
const result = probe.freecadPrivateNamingSourceProbe()
if (result !== 'Edge12;:M;CUT;:H2a:7,E') throw new Error(`Unexpected FreeCAD private naming source probe result: ${result}`)
const stringHasherResult = probe.freecadPrivateStringHasherSourceProbe()
if (stringHasherResult !== 'plain=1;hashed=2;mapped=5;index=12;related=2') {
throw new Error(`Unexpected FreeCAD StringHasher source probe result: ${stringHasherResult}`)
}
const elementMapResult = probe.freecadPrivateElementMapSourceProbe()
if (elementMapResult !== 'stored=#1;:H2a,F;tag=42;original=Edge12;:M;CUT;serialized=115;restored=1') {
throw new Error(`Unexpected FreeCAD ElementMap source probe result: ${elementMapResult}`)
}
for (const forbidden of ['freecadNamingAbiVersion', 'freecadNamingCapabilitiesJson', 'freecadNamingEvidenceJson']) {
if (typeof probe[forbidden] === 'function') throw new Error(`Source prerequisite probe must not export production ABI callback ${forbidden}.`)
}
console.log(JSON.stringify({
status: 'source-prerequisite-pass',
freecadVersion: '1.1.1',
sourceCommit: '0108fd4b4850cc46e625b60e53cea7a7bbe69f8d',
linkedSources: [
'App/IndexedName.cpp',
'App/MappedName.cpp',
'App/StringHasher.cpp',
'App/MappedElement.cpp',
'App/ElementNamingUtils.cpp',
'App/ElementMap.cpp',
'Base/Handle.cpp',
],
sourceArchive: {
name: 'libFreeCADPrivateNamingProbe.a',
...archive,
productionEligible: false,
},
result,
stringHasherResult,
elementMapResult,
productionWorkerLinked: false,
}, null, 2))