feat: advance TSN drift and ordered pair evidence
This commit is contained in:
@@ -13,6 +13,19 @@ const oraclePath = resolve(root, 'config/freecad-composite-history-elementmap-or
|
||||
const resavePath = resolve(root, 'config/freecad-composite-history-resave-verification.json')
|
||||
const outputPath = resolve(root, 'config/freecad-recovered-naming-classification.json')
|
||||
const fail = (message) => { throw new Error(`FreeCAD recovered naming classification: ${message}`) }
|
||||
const collectDifferences = (reference, replay, path = '$', differences = []) => {
|
||||
if (same(reference, replay)) return differences
|
||||
if (Array.isArray(reference) && Array.isArray(replay)) {
|
||||
for (let index = 0; index < Math.max(reference.length, replay.length); index += 1) collectDifferences(reference[index], replay[index], `${path}[${index}]`, differences)
|
||||
return differences
|
||||
}
|
||||
if (reference && replay && typeof reference === 'object' && typeof replay === 'object') {
|
||||
for (const key of new Set([...Object.keys(reference), ...Object.keys(replay)])) collectDifferences(reference[key], replay[key], `${path}.${key}`, differences)
|
||||
return differences
|
||||
}
|
||||
differences.push({ path, reference, replay })
|
||||
return differences
|
||||
}
|
||||
if (!existsSync(executable)) fail(`native executable is missing: ${executable}`)
|
||||
|
||||
const [reference, referenceResave, harnessContent, harnessBytes] = await Promise.all([
|
||||
@@ -56,7 +69,7 @@ const classifications = recoveredNamingDecisions.map((decision) => {
|
||||
})
|
||||
validateRecoveredNamingSnapshot(referenceSnapshot)
|
||||
validateRecoveredNamingSnapshot(replaySnapshot)
|
||||
if (!same(referenceSnapshot, replaySnapshot)) fail(`${decision.caseId} fingerprints differ between the locked reference and independent native replay.`)
|
||||
if (!same(referenceSnapshot, replaySnapshot)) fail(`${decision.caseId} fingerprints differ between the locked reference and independent native replay: ${JSON.stringify(collectDifferences(referenceSnapshot, replaySnapshot))}`)
|
||||
return {
|
||||
...decision,
|
||||
reference: referenceSnapshot,
|
||||
|
||||
Reference in New Issue
Block a user