feat: close link sub property codecs
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
import { readFile, writeFile } from 'node:fs/promises'
|
||||
import { resolve } from 'node:path'
|
||||
|
||||
const root = resolve(new URL('..', import.meta.url).pathname)
|
||||
const load = (path) => readFile(resolve(root, path), 'utf8').then(JSON.parse)
|
||||
const outputPath = resolve(root, 'config/freecad-property-linksublistglobal-promotion.json')
|
||||
const [inventory, success, failure, mutation, roundTrip, chrome, semantics, progress] = await Promise.all([
|
||||
load('config/freecad-property-linksublistglobal-inventory.json'),
|
||||
load('config/freecad-property-linksublistglobal-success.json'),
|
||||
load('config/freecad-property-linksublistglobal-failure.json'),
|
||||
load('config/freecad-property-linksublistglobal-mutation.json'),
|
||||
load('config/freecad-property-linksublistglobal-roundtrip.json'),
|
||||
load('config/chrome-property-linksublistglobal-verification.json'),
|
||||
load('config/freecad-native-property-semantics.json'),
|
||||
load('config/freecad-follow-up-task-progress.json'),
|
||||
])
|
||||
const fail = (message) => { throw new Error(`FreeCAD PropertyLinkSubListGlobal promotion generation failed: ${message}`) }
|
||||
const requiredCompletedPhases = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
|
||||
const completed = new Map(progress.completedTasks?.map((entry) => [entry.id, entry]) ?? [])
|
||||
for (const phase of requiredCompletedPhases) if (!completed.has(`PROP-app-propertylinksublistglobal-${phase}`)) fail(`phase ${phase} is not completed in the evidence ledger`)
|
||||
if (inventory.status !== 'pass' || inventory.propertyType !== 'App::PropertyLinkSubListGlobal' || inventory.recordCount !== 1 || inventory.objectTypeCount !== 1 || inventory.writableRecordCount !== 1) fail('inventory evidence is invalid')
|
||||
for (const [name, artifact] of Object.entries({ success, failure, mutation, roundTrip, chrome })) if (artifact.status !== 'pass') fail(`${name} evidence is not passing`)
|
||||
const propertyType = semantics.types?.find(({ typeId }) => typeId === 'App::PropertyLinkSubListGlobal')
|
||||
if (propertyType?.support !== 'native-editable-codec' || propertyType.recordCount !== 1 || propertyType.objectTypeCount !== 1 || propertyType.statusNames?.length !== 0) fail('global property semantics did not promote App::PropertyLinkSubListGlobal')
|
||||
const opaque = semantics.supportSummary?.['opaque-fcstd-proxy']
|
||||
const editable = semantics.supportSummary?.['native-editable-codec']
|
||||
if (opaque?.typeCount !== 43 || opaque.recordCount !== 450 || editable?.typeCount !== 37 || editable.recordCount !== 4377) fail('global property support summary is not synchronized')
|
||||
if (roundTrip.classification?.zeroUnknownDrift !== true || roundTrip.classification.globalBacklinksPreserved !== true || roundTrip.classification.nativeDependenciesNormalized !== true || chrome.persistence?.loadedType !== 'App::PropertyLinkSubListGlobal' || chrome.persistence.fcstdElement !== 'LinkSubList' || chrome.persistence.loadedDependencyCount !== 2 || chrome.ui?.dependencyCount !== 2 || chrome.release?.workerTerminated !== true) fail('round-trip or browser closure evidence is incomplete')
|
||||
const report = {
|
||||
schemaVersion: 1,
|
||||
status: 'pass',
|
||||
taskId: 'PROP-app-propertylinksublistglobal-I',
|
||||
baseline: semantics.baseline,
|
||||
propertyType: 'App::PropertyLinkSubListGlobal',
|
||||
recordCount: 1,
|
||||
phaseEvidence: Object.fromEntries(requiredCompletedPhases.map((phase) => [phase, completed.get(`PROP-app-propertylinksublistglobal-${phase}`).evidence])),
|
||||
promotion: {
|
||||
from: inventory.classification,
|
||||
to: propertyType.support,
|
||||
facadeValueModel: 'same-document-object-and-ordered-sub-element-pair-list',
|
||||
writableRecords: 1,
|
||||
objectTypeCount: 1,
|
||||
propertyStatus: '',
|
||||
linkScope: 'Global',
|
||||
runtimeDependencyEdges: chrome.ui.dependencyCount,
|
||||
fcstdElement: chrome.persistence.fcstdElement,
|
||||
nativeRoundTripValue: roundTrip.classification.resavedValue,
|
||||
browserRoundTripValue: chrome.persistence.loadedValue,
|
||||
globalBacklinksPreserved: roundTrip.classification.globalBacklinksPreserved,
|
||||
nativeDependenciesNormalized: roundTrip.classification.nativeDependenciesNormalized,
|
||||
zeroUnknownDrift: roundTrip.classification.zeroUnknownDrift,
|
||||
},
|
||||
exactBlockerSync: {
|
||||
nativeEditableTypes: editable.typeCount,
|
||||
nativeEditableRecords: editable.recordCount,
|
||||
opaqueTypes: opaque.typeCount,
|
||||
opaqueRecords: opaque.recordCount,
|
||||
exactPromotionReady: semantics.exactPromotionReady,
|
||||
exactBlocker: semantics.exactBlocker,
|
||||
},
|
||||
systemExact: false,
|
||||
generatedAt: new Date().toISOString(),
|
||||
}
|
||||
await writeFile(outputPath, `${JSON.stringify(report, null, 2)}\n`)
|
||||
console.log(JSON.stringify({ status: 'freecad-property-linksublistglobal-promotion-generated', output: 'config/freecad-property-linksublistglobal-promotion.json', promotion: report.promotion, exactBlockerSync: report.exactBlockerSync }, null, 2))
|
||||
Reference in New Issue
Block a user