2 """Validate XTM Variant Reification and two originals through the existing ASDF/Case Record harness.
4 The driver checks and retains execution evidence; Lisp performs all parsing,
5 model construction and conformance classification. Historical reports are inputs.
13 from pathlib
import Path
20 sys
.dont_write_bytecode
= True
21 ROOT
= Path(__file__
).resolve().parents
[1]
22 EVIDENCE
= ROOT
/ 'reports/slice-21o'
23 PRIOR
= ROOT
/ 'reports/slice-21n'
24 BASE
= '6f6170b7e9b76ab6b8c117b90e3781b6b8ffe6a3'
25 POLICY
= '(version 1)(allow default)(deny network*)(deny file-write* (subpath "' + str(ROOT
) + '"))'
26 ALLOWED
= {'src/xtm/reader.lisp', 'topic-maps.asd', *['tests/' + p
+ '.lisp' for p
in ['xtm-identity', 'ctm-xtm-mergemap', 'xtm-names', 'xtm-name-scopes', 'xtm-name-item-identities', 'xtm-variants', 'xtm-variant-item-identities', 'xtm-map-reification', 'xtm-name-reification']]}
27 CTM
= {'pass': 262, 'fail': 4, 'unsupported': 0, 'not-run': 7}
28 TARGETS
= ['xtm2/in/variant-reifier.xtm', 'xtm2/in/variant-duplicate-reifier.xtm']
29 EXPLORATORY
= 'xtm2/in/variant-duplicate-reifier2.xtm'
33 return json
.loads(p
.read_text())
37 p
.write_text(json
.dumps(v
, indent
=2, ensure_ascii
=False) + '\n')
41 return hashlib
.sha256(p
.read_bytes()).hexdigest()
45 return subprocess
.check_output(args
, cwd
=ROOT
, text
=True).strip()
48 def prepare_pinned(target
):
49 spec
= importlib
.util
.spec_from_file_location('slice21g', ROOT
/ 'scripts/validate-slice-21n.py')
50 module
= importlib
.util
.module_from_spec(spec
)
51 spec
.loader
.exec_module(module
)
52 return module
.prepare_pinned(target
)
55 def json_differences(before
, after
, path
=''):
56 if type(before
) is not type(after
):
57 return [{'path': path
, 'before': before
, 'after': after
}]
58 if isinstance(before
, dict):
59 assert before
.keys() == after
.keys()
60 return [d
for k
in before
for d
in json_differences(before
[k
], after
[k
], path
+ '/' + k
)]
61 if isinstance(before
, list):
62 assert len(before
) == len(after
)
63 return [d
for i
, (a
, b
) in enumerate(zip(before
, after
)) for d
in json_differences(a
, b
, path
+ '/' + str(i
))]
64 return [] if before
== after
else [{'path': path
, 'before': before
, 'after': after
}]
68 parser
= argparse
.ArgumentParser(description
=__doc__
)
69 parser
.add_argument('--sbcl', default
=os
.environ
.get('SBCL', 'sbcl'))
70 parser
.add_argument('--output', type=Path
)
71 parser
.add_argument('--prepare', type=Path
)
72 args
= parser
.parse_args()
74 print(json
.dumps(prepare_pinned(args
.prepare
)))
76 runtime
= shutil
.which(args
.sbcl
)
77 assert runtime
and command([runtime
, '--version']) == 'SBCL 2.5.4'
78 subprocess
.run(['git', 'merge-base', '--is-ancestor', BASE
, 'HEAD'], cwd
=ROOT
, check
=True)
79 output
= args
.output
.resolve() if args
.output
else Path(tempfile
.mkdtemp(prefix
='topic-maps-21n-'))
80 assert not output
.is_relative_to(ROOT
)
81 output
.mkdir(parents
=True, exist_ok
=True)
82 assert not (output
/ 'execution.json').exists(), 'Choose an unused output directory.'
83 tracked
= command(['git', 'ls-tree', '-r', '--name-only', BASE
]).splitlines()
84 assert set(command(['git', 'diff', '--name-only', BASE
]).splitlines()) & set(tracked
) <= ALLOWED
85 protected
= {p
: sha(ROOT
/ p
) for p
in tracked
if p
not in ALLOWED
}
86 historical
= {p
: h
for p
, h
in protected
.items() if p
.startswith('reports/')}
87 sources
= {p
: sha(ROOT
/ p
) for p
in [*sorted(ALLOWED
), 'tests/xtm-variant-reification.lisp', 'scripts/validate-slice-21o.py',
88 *['reports/slice-21o/' + p
for p
in ['candidate-inventory.json', 'api-preflight.lisp', 'failure-controls.lisp', 'diagnostics.lisp',
89 'before-diagnostics.json', 'baseline-xtm.json', 'baseline-execution.json', 'baseline-ctm.validation.json', 'retargeted-controls.json', 'retargeted-checks.json', 'retargeted-integration.json']]]}
90 previous
= read(PRIOR
/ 'xtm.json')
91 assert read(EVIDENCE
/ 'baseline-xtm.json') == previous
92 assert previous
['statuses'] == {'pass': 68, 'fail': 0, 'unsupported': 0, 'not-run': 0}
93 assert previous
['otherCorpusInputs'] == {'positiveUnexecuted': 53, 'negativeUnregisteredUnexecuted': 3}
94 assert read(PRIOR
/ 'ctm.validation.json')['statuses'] == CTM
95 assert read(EVIDENCE
/ 'baseline-execution.json')['acceptancePassed']
96 assert read(EVIDENCE
/ 'baseline-ctm.validation.json') == read(PRIOR
/ 'ctm.validation.json')
97 inventory
= read(EVIDENCE
/ 'candidate-inventory.json')
98 candidate
= {'candidates': [c
for c
in inventory
['candidates'] if c
['register']]}
99 assert len(inventory
['candidates']) == 3 and inventory
['candidates'][2]['id'] == EXPLORATORY
100 assert [c
['id'] for c
in candidate
['candidates']] == TARGETS
101 assert [c
['sourceBytes'] for c
in candidate
['candidates']] == [326, 493]
102 assert [c
['baselineBytes'] for c
in candidate
['candidates']] == [702, 702]
103 assert not set(TARGETS
) & {c
['id'] for c
in previous
['cases']}
104 assert read(EVIDENCE
/ 'before-diagnostics.json') == read(PRIOR
/ 'after-diagnostics.json')
105 started
= datetime
.datetime
.now(datetime
.timezone
.utc
).isoformat()
108 def run(label
, invocation
, env
, expected_exit
=0):
109 invocation
= ['/usr/bin/sandbox-exec', '-p', POLICY
] + invocation
110 entry
= {'label': label
, 'command': invocation
, 'network': 'denied', 'repositoryWrites': 'denied',
111 'freshProcess': True, 'startedAtUTC': datetime
.datetime
.now(datetime
.timezone
.utc
).isoformat()}
112 result
= subprocess
.run(invocation
, cwd
=ROOT
, env
=env
, stdout
=subprocess
.PIPE
, stderr
=subprocess
.STDOUT
, timeout
=300)
113 (output
/ (label
+ '.log')).write_bytes(result
.stdout
)
114 entry
.update(exitCode
=result
.returncode
, expectedExitCode
=expected_exit
,
115 finishedAtUTC
=datetime
.datetime
.now(datetime
.timezone
.utc
).isoformat())
117 assert result
.returncode
== expected_exit
, f
'{label}: see {output / (label + ".log")}'
118 return result
.stdout
.decode()
120 retained
= output
/ 'retained'
122 env
= {k
: v
for k
, v
in os
.environ
.items() if not k
.startswith('TOPIC_MAPS_')}
123 env
.update(PYTHONDONTWRITEBYTECODE
='1', GIT_OPTIONAL_LOCKS
='0', SBCL
=runtime
)
124 with tempfile
.TemporaryDirectory(prefix
='topic-maps-21n-sources-') as temp_name
:
125 provenance
= json
.loads(run('source-preparation', ['python3', str(Path(__file__
)), '--prepare', temp_name
+ '/sources'], env
))
126 save(output
/ 'source-preparation.json', provenance
)
127 env
.update(CL_SOURCE_REGISTRY
=provenance
['sourceRegistry'], TOPIC_MAPS_REPORT
=str(retained
/ 'core.json'),
128 TOPIC_MAPS_XTM_REPORT
=str(output
/ 'xtm.json'), TOPIC_MAPS_XTM_MERGEMAP_REPORT
=str(retained
/ 'xtm-mergemap'),
129 TOPIC_MAPS_REGISTERED_ORIGINALS_REPORT
=str(retained
/ 'slice20a'), TOPIC_MAPS_REGISTERED_NEGATIVES_REPORT
=str(retained
/ 'slice20b'),
130 TOPIC_MAPS_PROLOG_REPORT
=str(retained
/ 'slice20c'), TOPIC_MAPS_EMPTY2_REPORT
=str(retained
/ 'slice20e'),
131 TOPIC_MAPS_CTM_INTEGER_REPORT
=str(retained
/ 'slice20f'), TOPIC_MAPS_TRIPLE_REPORT
=str(retained
/ 'slice20g'),
132 TOPIC_MAPS_ENCODING_REPORT
=str(output
/ 'ctm'))
133 prefix
= [runtime
, '--noinform', '--no-sysinit', '--no-userinit', '--script']
134 xml
= run('xml', prefix
+ ['tests/cxml-probe.lisp'], env
)
135 xml_labels
= re
.findall(r
'^CXML-CHECK-PASS (.+)$', xml
, re
.M
)
136 assert len(xml_labels
) == len(set(xml_labels
)) == 146 and 'CXML-SUMMARY 146 PASS 0 FAIL' in xml
137 api_probe
= run('variant-reifier-api-preflight', prefix
+ [str(EVIDENCE
/ 'api-preflight.lisp')], env
)
138 assert 'VARIANT-REIFIER-API-PREFLIGHT-PASS:' in api_probe
139 xtm_log
= run('xtm', prefix
+ ['scripts/fresh-xtm.lisp'], env
)
140 xtm
= read(output
/ 'xtm.json')
141 labels
= re
.findall(r
'^XTM-CHECK-PASS (.+)$', xtm_log
, re
.M
)
142 assert labels
== xtm
['checks'] and len(labels
) == len(set(labels
))
143 rename
= read(EVIDENCE
/ 'retargeted-checks.json')
144 assert len(rename
) == 22 and set(rename
) <= set(previous
['checks'])
145 control_retargets
= read(EVIDENCE
/ 'retargeted-controls.json')['controls']
146 assert len(control_retargets
) == 9
147 retained_labels
= [rename
.get(label
, label
) for label
in previous
['checks']]
148 assert set(retained_labels
) <= set(labels
)
149 assert [label
for label
in labels
if label
in set(retained_labels
)] == retained_labels
150 assert f
'XTM-SUMMARY {len(labels)} PASS 0 FAIL; 62 original CXTM PASS; 8 negative originals PASS' in xtm_log
151 assert xtm
['statuses'] == {'pass': 70, 'fail': 0, 'unsupported': 0, 'not-run': 0}
152 assert xtm
['otherCorpusInputs'] == {'positiveUnexecuted': 51, 'negativeUnregisteredUnexecuted': 3}
153 assert xtm
['cases'][:68] == previous
['cases']
154 for field
, value
in previous
.items():
155 approved
= [(row
['before'], row
['after']) for row
in control_retargets
if row
['field'] == field
]
157 assert len(xtm
[field
]) == len(value
)
158 changed
= [(a
, b
) for a
, b
in zip(value
, xtm
[field
]) if a
!= b
]
159 assert changed
== approved
, field
161 assert a
['condition']['class'] == b
['condition']['class'] == 'XTM-UNSUPPORTED'
162 assert a
['condition']['code'] == 'reification' and b
['condition']['code'] == 'resource-data-datatype'
163 assert "<variant reifier=" in a
['sourceText'] and "<variant reifier=" in b
['sourceText']
164 elif field
not in ['scope', 'statuses', 'otherCorpusInputs', 'checks', 'cases']:
165 assert xtm
[field
] == value
, field
166 assert len(xtm
['cases']) == len({c
['id'] for c
in xtm
['cases']}) == 70
167 assert [c
['id'] for c
in xtm
['cases'][68:]] == TARGETS
168 assert all(c
['status'] == 'pass' and c
['actualOutcome'] == 'cxtm-match' for c
in xtm
['cases'][68:])
169 assert len(xtm
['variantReifierOriginals']) == 2
170 regression
= run('regression', [str(ROOT
/ 'scripts/test.sh')], env
)
171 run('diagnostics', prefix
+ [str(EVIDENCE
/ 'diagnostics.lisp')],
172 dict(env
, TOPIC_MAPS_21O_ROOT
=str(ROOT
), TOPIC_MAPS_21O_DIAGNOSTICS
=str(output
/ 'after-diagnostics.json'), TOPIC_MAPS_21O_EXTRA
=str(output
/ 'further-variant-reification.json')))
174 positive_modes
= [('mismatch', 'cxtm-mismatch'), ('xml', 'execution-error'), ('unsupported', 'unsupported'), ('tmdm', 'execution-error')]
175 negative_modes
= [('accepted', 'ctm-acceptance'), ('xml', 'execution-error'), ('unsupported', 'unsupported'), ('wrong-cause', 'execution-error')]
176 families
= {'positive': positive_modes
+ [('xtm', 'execution-error')], 'negative': negative_modes
,
177 'name': positive_modes
, 'scope': positive_modes
, 'iid': positive_modes
, 'variant': positive_modes
,
178 'variant-negative': negative_modes
+ [('tmdm', 'execution-error')],
179 'merge-variant': positive_modes
+ [('xtm', 'execution-error')],
180 'resource-ref': positive_modes
+ [('xtm', 'execution-error')],
181 'resource-ref-relative': positive_modes
+ [('xtm', 'execution-error')],
182 'uri-data': positive_modes
+ [('xtm', 'execution-error')],
183 'variant-iid': positive_modes
+ [('xtm', 'execution-error')],
184 'variant-iid-duplicate': positive_modes
+ [('xtm', 'execution-error')],
185 'map-reifier': positive_modes
+ [('xtm', 'execution-error')],
186 'map-reifier-condition': [('wrong-cause', 'foreign-reifier-rejected-as-wrong-condition')],
187 'name-reifier': positive_modes
+ [('xtm', 'execution-error')],
188 'name-reifier-duplicate': positive_modes
+ [('xtm', 'execution-error')],
189 'name-reifier-condition': [('wrong-cause', 'foreign-reifier-rejected-as-wrong-condition')],
190 'name-followup2': positive_modes
+ [('xtm', 'execution-error')],
191 'name-followup3': positive_modes
+ [('xtm', 'execution-error')],
192 'name-followup4': positive_modes
+ [('xtm', 'execution-error')],
193 'variant-reifier': positive_modes
+ [('xtm', 'execution-error')],
194 'variant-reifier-duplicate': positive_modes
+ [('xtm', 'execution-error')],
195 'variant-reifier-condition': [('wrong-cause', 'foreign-reifier-rejected-as-wrong-condition')]}
196 for family
, modes
in families
.items():
197 for mode
, outcome
in modes
:
198 label
= family
+ '-control-' + mode
199 run(label
, prefix
+ [str(EVIDENCE
/ 'failure-controls.lisp')],
200 dict(env
, TOPIC_MAPS_XTM_REPORT
=str(output
/ (label
+ '.json')), TOPIC_MAPS_21O_FAMILY
=family
, TOPIC_MAPS_21O_FAULT
=mode
), expected_exit
=1)
201 result
= read(output
/ (label
+ '.json'))
202 retained_count
= {'positive': 0, 'negative': 26, 'name': 33, 'scope': 43, 'iid': 48, 'variant': 50, 'variant-negative': 55, 'merge-variant': 56, 'resource-ref': 57, 'resource-ref-relative': 58, 'uri-data': 59, 'variant-iid': 60, 'variant-iid-duplicate': 61, 'map-reifier': 62, 'map-reifier-condition': 63, 'name-reifier': 63, 'name-reifier-duplicate': 64, 'name-reifier-condition': 65, 'name-followup2': 65, 'name-followup3': 66, 'name-followup4': 67, 'variant-reifier': 68, 'variant-reifier-duplicate': 69, 'variant-reifier-condition': 70}[family
]
203 assert result
['statuses']['pass'] == retained_count
204 if family
in ['map-reifier-condition', 'name-reifier-condition', 'variant-reifier-condition']:
205 assert len(result
['cases']) == retained_count
206 is_name
= family
== 'name-reifier-condition'
207 is_variant
= family
== 'variant-reifier-condition'
208 wrong_label
= 'variant:native-reuse-reifier' if is_variant
else ('name:native-reuse-reifier' if is_name
else 'reuse-reifier')
209 wrong
= next(row
for row
in result
['variantReifierControls' if is_variant
else ('nameReifierControls' if is_name
else 'mapReifierControls')] if row
['label'] == wrong_label
)
210 assert wrong
['expectedCode'] == 'reifier-conflict'
211 assert wrong
['condition']['class'] == 'REIFICATION-ERROR' and wrong
['condition']['code'] == 'foreign-reifier'
212 assert wrong
['atomicNativeOperation']
213 assert result
['checks'][-1] == 'map-reifier-error:' + wrong_label
+ ':specific-class-code'
215 assert len(result
['cases']) == retained_count
+ 1 and result
['cases'][-1]['actualOutcome'] == outcome
216 assert result
['cases'][:retained_count
] == xtm
['cases'][:retained_count
]
217 if family
in ['map-reifier', 'name-reifier', 'name-reifier-duplicate', 'name-followup2', 'name-followup3', 'name-followup4', 'variant-reifier', 'variant-reifier-duplicate'] and mode
== 'tmdm':
218 outputs
= result
['variantReifierOriginals'] if family
.startswith('variant-reifier') else result
['nameFollowupOriginals'] if family
.startswith('name-followup') else (result
['mapReifierOriginals'] if family
== 'map-reifier' else result
['nameReifierOriginals'])
219 actual_condition
= next(row
for row
in outputs
if row
['id'] == result
['cases'][-1]['id'])['condition']
220 assert actual_condition
['class'] == 'REIFICATION-ERROR' and actual_condition
['code'] == 'reifier-conflict'
221 fault_controls
.append({'family': family
, 'mode': mode
, 'actualOutcome': outcome
,
222 'expectedASDFFailureObserved': True, 'retainedOriginalPasses': retained_count
, 'faultCountedAsPass': False})
225 integration_changes
= read(EVIDENCE
/ 'retargeted-integration.json')
226 for old
in sorted((PRIOR
/ 'retained').glob('*.json')):
227 approved
= next((row
for row
in integration_changes
if row
['report'] == old
.name
), None)
229 assert json_differences(read(old
), read(retained
/ old
.name
)) == approved
['changes']
231 assert read(old
) == read(retained
/ old
.name
), str(old
)
232 verified
.append(str(old
.relative_to(ROOT
)))
233 for suffix
in ['validation', 'cxtm', 'encoding']:
234 old
= PRIOR
/ f
'ctm.{suffix}.json'
235 assert read(old
) == read(output
/ f
'ctm.{suffix}.json'), str(old
)
236 verified
.append(str(old
.relative_to(ROOT
)))
237 totals
= read(ROOT
/ 'reports/slice-19d1/regression-execution.json')['regressionChecks']
238 stages
= read(PRIOR
/ 'execution.json')['stageChecks']
239 assert sum(totals
.values()) == 12100
240 for marker
, count
in dict(totals
, **stages
).items():
241 assert int(re
.search(r
'(?m)^' + marker
+ r
'-PASS: (\d+)', regression
).group(1)) == count
242 assert 'Ran 2 tests' in regression
and 'NFC-ORACLE-PASS: 16294' in regression
243 assert read(output
/ 'ctm.validation.json')['statuses'] == CTM
245 (output
/ 'actual').mkdir()
246 for candidate_case
, result
in zip(candidate
['candidates'], xtm
['variantReifierOriginals']):
247 assert result
['id'] == candidate_case
['id'] and result
['condition'] is None and result
['status'] == 'pass'
248 source
= ROOT
/ 'vendor/cxtm' / result
['id']
249 baseline
= ROOT
/ 'vendor/cxtm/xtm2/baseline' / (source
.name
+ '.cxtm')
250 raw
, actual
= source
.read_bytes(), result
['actualCXTM'].encode('utf-8')
251 assert raw
== bytes
.fromhex(result
['sourceHex']) == result
['sourceText'].encode('utf-8')
252 assert sha(source
) == candidate_case
['sourceSHA256'] and len(raw
) == result
['sourceBytes'] == candidate_case
['sourceBytes']
253 assert actual
== result
['expectedCXTM'].encode('utf-8') == baseline
.read_bytes()
254 assert len(actual
) == result
['actualBytes'] == result
['expectedBytes'] == candidate_case
['baselineBytes']
255 assert sha(baseline
) == candidate_case
['baselineSHA256'] and result
['firstDifferentByte'] is None
256 assert result
['documentIRI'] == candidate_case
['documentIRI'] and result
['sourceKey'] == result
['id']
257 model
= result
['model']
258 identity
= model
['identity']['identity']['nameModel']['identity']
259 assert model
['canonicalVariantReifierInverseEQ'] and model
['variantReifierTopics'] == [4]
260 assert model
['topicReifiedVariants'] == [None, None, None, 1]
261 assert model
['identity']['canonicalNameReifierInverseEQ'] and model
['identity']['nameReifierTopics'] == [None]
262 assert model
['identity']['mapReifierTopic'] is None
263 assert identity
['topicCount'] == 4 and identity
['associationCount'] == 0
264 assert identity
['topics'] == [
265 {'ordinal': 1, 'itemIdentifiers': [result
['documentIRI'] + '#topic'], 'subjectIdentifiers': [], 'subjectLocators': []},
266 {'ordinal': 2, 'itemIdentifiers': [], 'subjectIdentifiers': ['http://psi.topicmaps.org/iso13250/model/topic-name'], 'subjectLocators': []},
267 {'ordinal': 3, 'itemIdentifiers': [result
['documentIRI'] + '#command'], 'subjectIdentifiers': [], 'subjectLocators': []},
268 {'ordinal': 4, 'itemIdentifiers': [result
['documentIRI'] + '#reifier'], 'subjectIdentifiers': [], 'subjectLocators': []}]
269 assert model
['identity']['identity']['nameModel']['names'] == [{'value': 'Topic', 'parent': 1, 'type': 2, 'scope': [], 'itemIdentifiers': [], 'variantCount': 1}]
270 assert model
['identity']['identity']['variants'] == [{'value': 'TOPIC!', 'datatype': 'http://www.w3.org/2001/XMLSchema#string',
271 'parentName': 1, 'scope': [3], 'itemIdentifiers': [], 'reifier': 4}]
272 assert result
['primaryQualifiedParserCalls'] == 1 and result
['sourceVariantCount'] == TARGETS
.index(result
['id']) + 1
273 (output
/ 'actual' / baseline
.name
).write_bytes(actual
)
274 comparisons
.append(dict(result
, sourceSHA256
=sha(source
), baselineSHA256
=sha(baseline
),
275 actualSHA256
=hashlib
.sha256(actual
).hexdigest(), executedInASDFTestOp
=True))
276 before
, after
= read(EVIDENCE
/ 'before-diagnostics.json'), read(output
/ 'after-diagnostics.json')
277 assert len(before
) == len(after
) == 124
278 assert [c
['id'] for c
in before
] == [c
['id'] for c
in after
]
279 changes
= [{'id': a
['id'], 'before': b
, 'after': a
} for b
, a
in zip(before
, after
) if b
!= a
]
280 save(output
/ 'diagnostic-changes.json', changes
)
281 assert {c
['id'] for c
in changes
} == set(TARGETS
+ [EXPLORATORY
])
282 for change
in changes
:
283 assert change
['before']['condition']['class'] == 'XTM-UNSUPPORTED' and change
['before']['condition']['code'] == 'reification'
284 assert change
['after']['condition'] is None and change
['after']['byteExact']
285 further
= read(output
/ 'further-variant-reification.json')
286 assert further
['id'] == EXPLORATORY
and not further
['registered'] and further
['registeredStatus'] == 'not-run'
287 assert further
['byteExact'] and further
['condition'] is None and further
['model']['canonicalVariantReifierInverseEQ']
288 assert not {EXPLORATORY}
& {case
['id'] for case
in xtm
['cases']}
289 assert comparisons
[0]['actualCXTM'] == comparisons
[1]['actualCXTM'] == further
['actualCXTM']
290 pending_negative
= ['xtm2/invalid/' + stem
+ '.xtm' for stem
in
291 ['reifier-collision', 'role-duplicate-reified', 'topicref-no-fragment-id']]
292 assert not set(pending_negative
) & {case
['id'] for case
in xtm
['cases']}
293 save(output
/ 'diagnostic-changes.json', changes
)
294 lock
= read(ROOT
/ 'references/corpus-lock.json')
295 for entry
in lock
['files']:
296 p
= ROOT
/ 'vendor/cxtm' / entry
['path']
297 assert p
.stat().st_size
== entry
['size'] and sha(p
) == entry
['sha256']
298 for snapshot
in [protected
, historical
, sources
]:
299 assert snapshot
== {p
: sha(ROOT
/ p
) for p
in snapshot
}
300 assert set(command(['git', 'diff', '--name-only', BASE
]).splitlines()) & set(tracked
) <= ALLOWED
301 save(output
/ 'variant-reifier-originals.json', {'kind': 'executed-original-variant-reification-registration', 'cases': comparisons
})
302 save(output
/ 'diagnostics.json', {'kind': 'read-only-observations-no-extra-registration',
303 'originalObservations': 124, 'unchangedOriginalObservations': 124 - len(changes
),
304 'diagnosticChanges': changes
, 'registeredCases': TARGETS
, 'negativeOriginalsRemainingNotRun': pending_negative
,
305 'other121ObservationsUnchanged': True, 'additionalSuccessfulOriginalRemainingNotRun': EXPLORATORY
})
306 save(output
/ 'failure-controls.json', {'kind': 'executor-fault-controls-not-corpus-results', 'controls': fault_controls
})
307 save(output
/ 'integrity.json', {'protectedBaseFilesSHA256': protected
, 'historicalReportsSHA256': historical
, 'executionSourcesSHA256': sources
})
308 statuses
= dict(xtm
['statuses'], **{'not-run': sum(xtm
['otherCorpusInputs'].values())})
309 save(output
/ 'execution.json', {'kind': 'xtm-variant-reification-original-registration-validation', 'baseCommit': BASE
,
310 'branch': command(['git', 'branch', '--show-current']), 'runtime': 'SBCL 2.5.4', 'startedAtUTC': started
,
311 'finishedAtUTC': datetime
.datetime
.now(datetime
.timezone
.utc
).isoformat(), 'runs': runs
,
312 'sourcePreparation': 'source-preparation.json', 'retainedLispChecks': 12100, 'retainedChecks': totals
,
313 'stageChecks': stages
, 'xmlQualificationChecks': 146, 'nativeVariantReifierAPIPreflightPassed': True, 'standaloneXTMChecks': len(labels
),
314 'retainedXTMChecks': len(previous
['checks']), 'retargetedUnsupportedCheckNames': rename
,
315 'newXTMChecks': len(labels
) - len(previous
['checks']), 'retargetedUnsupportedControlRows': control_retargets
,
316 'retainedOriginals': 68, 'retainedOriginalResultsUnchanged': True, 'newPositiveOriginals': 2,
317 'originalByteComparisons': [{'id': c
['id'], 'actual': c
['actualBytes'], 'baseline': c
['expectedBytes'], 'firstDifferentByte': None} for c
in comparisons
], 'faultControls': len(fault_controls
),
318 'diagnosticOriginalObservations': 124, 'diagnosticChangedOriginals': [c
['id'] for c
in changes
],
319 'xtmStatusesBefore': {'pass': 68, 'fail': 0, 'unsupported': 0, 'not-run': 56}, 'xtmStatusesAfter': statuses
,
320 'xtmStatusChanges': [{'id': id, 'before': 'not-run', 'after': 'pass', 'actualOutcome': 'cxtm-match'} for id in TARGETS
],
321 'ctmStatusesBefore': CTM
, 'ctmStatusesAfter': CTM
, 'ctmStatusChanges': [],
322 'knownFailuresUnchanged': [c
['id'] for c
in read(output
/ 'ctm.validation.json')['cases'] if c
['status'] == 'fail'],
323 'pythonUnitTests': 2, 'nfcOracleComparisons': 16294, 'retainedNonXTMReportsVerifiedAgainstSlice21N': verified
,
324 'historicalReportFilesVerified': len(historical
), 'protectedBaseFilesVerified': len(protected
), 'pinnedCorpusFilesVerified': len(lock
['files']),
325 'historicalReportsUnchanged': True, 'originalSourcesAndBaselinesUnchanged': True, 'productionChanges': ['src/xtm/reader.lisp: Variant Reification via existing native II resolver'], 'protectedSubsystemsUnchanged': ['TMDM', 'CTM', 'CXTM', 'XML'], 'retargetedIntegrationReports': integration_changes
,
326 'newDependencyDownloads': 0, 'persistentLispImagesTouched': False,
327 'executionAuthorization': 'Regular require_escalated approval; tests additionally deny network and repository writes; no symlink/configuration changes.',
328 'fullOfflineNixRebuild': 'NOT-RUN; fresh SBCL loads with verified pinned local sources and existing XML patches.', 'acceptancePassed': True})
329 print(json
.dumps({'acceptancePassed': True, 'xtm': statuses
, 'ctm': CTM
, 'checks': len(labels
), 'output': str(output
)}))
332 if __name__
== '__main__':