31 lines
3.8 KiB
Python
31 lines
3.8 KiB
Python
# coding: utf-8
|
|
from pathlib import Path
|
|
import json,hashlib,importlib.util,uuid,shutil
|
|
R=Path('/Users/korizatou114/Projects/とりにく工房ゲーム制作部');A=R/'artifacts/original-completion-2026-10-02';O=A/'p23-02-native-input-copy-local-r335';C=A/'p23-02-native-input-copy-candidate-r333'
|
|
spec=importlib.util.spec_from_file_location('runner335',R/'tools/run_all_tests.py');r=importlib.util.module_from_spec(spec);spec.loader.exec_module(r)
|
|
def pin(p):return dict(path=str(p),bytes=p.stat().st_size,sha256=r.sha(p))
|
|
review=A/'p23-02-native-input-copy-build-actual-independent-review-r334.json';assert r.read(review)['host_build_accepted']
|
|
assert shutil.disk_usage(A).free>=528*1048576 and not (O/'input.json').exists()
|
|
v=r.read(A/'p23-02-native-reconstruction-local-r211/input.json');stage=A/'p23-02-native-guest-bulk-local-r315/stage'
|
|
library=A/'p23-02-native-input-copy-build-r334/libtree_numeric_core.macos.template_debug.dylib'
|
|
private=Path('/private/tmp')/('TheTree-input-copy-r335-'+uuid.uuid4().hex);private.mkdir();copied=private/'candidate.dylib';copied.write_bytes(library.read_bytes());assert copied.read_bytes()==library.read_bytes()
|
|
config=O/'candidate.gdextension';config.write_text('[configuration]\nentry_symbol = "the_tree_numeric_library_init"\ncompatibility_minimum = "4.7.2"\nreloadable = false\n\n[libraries]\nmacos.debug.arm64 = '+json.dumps(str(copied))+'\n')
|
|
specs=[q.copy() for q in v['specs']]
|
|
specs[2]=dict(name='keys',qa=str(O/'keys.gd'),expected_checks=31,case_count=4,label='Guest pipeline boundaries: ')
|
|
fixed={k:q for k,q in v['pins'].items() if k in ['engine','helper','run_all','profile_guard','fixture','oracle','custom_QA','golden_runtime','QA_local','QA_runtime','QA_parents','base124']}
|
|
fixed['key_base']=pin(A/'p23-02-native-guest-pipeline-boundaries-r195.gd')
|
|
for q in specs:
|
|
name=q['name'];qa=Path(q['qa']);fixed['QA_'+name]=pin(qa)
|
|
wrapper=(A/'p23-02-native-reconstruction-local-r211'/(( 'parents' if name=='parents' else 'boundaries' if name=='keys' else name)+'-guarded.gd')).read_text()
|
|
if name=='keys':wrapper=wrapper.replace(str(A/'p23-02-native-guest-pipeline-boundaries-r195.gd'),str(qa))
|
|
# Prior wrappers used escaped Unicode in their literals.
|
|
prior=A/'p23-02-native-reconstruction-local-r209/access.gdextension'
|
|
wrapper=wrapper.replace(json.dumps(str(prior)),json.dumps(str(config)))
|
|
if name=='keys':wrapper=wrapper.replace(json.dumps(str(A/'p23-02-native-guest-pipeline-boundaries-r195.gd')),json.dumps(str(qa)))
|
|
out=O/(name+'-guarded.gd');out.write_text(wrapper);fixed['starter_'+name]=pin(out)
|
|
for k,p in dict(original_library=library,library=copied,config=config,host_review=review,host_root=A/'p23-02-native-input-copy-build-root-verification-r334.json',host_execution=A/'p23-02-native-input-copy-build-r334/execution.json',candidate_input=C/'input.json',native_cpp=C/'source/tree_numeric_core.cpp',native_hpp=C/'source/tree_core.hpp',runner=A/'p23-02-native-input-copy-local-r335.py',prepare=Path(__file__)).items():fixed[k]=pin(p)
|
|
v.update(parent=str(stage),stage=str(stage),expected_stage=r.inventory(stage,stage=True),pins=fixed,specs=specs,source_before=r.source_refs(R),default_before=r.default_player(R),doc4_before={n:r.sha(R/'docs/plans/original-completion-2026-10-02'/n) for n in v['doc4_before']},support_inventory=r.inventory(r.SUPPORT),scope='r333/library334 four finite local phases: existing nearest ownership/parent boundaries, input-key shapes, original150 Runtime oracle; no performance/adoption/unit acceptance',engine_processes=4,compiler_processes=0,full_regression_runs=0,expected_total_seconds=[5,45],stage_clones=0,library_copies=1,unit_accepted=False)
|
|
v.pop('repair_scope',None)
|
|
with (O/'input.json').open('x') as f:json.dump(v,f,ensure_ascii=False,indent=2);f.write('\n')
|
|
print(dict(pins=len(fixed),specs=specs,free=shutil.disk_usage(A).free))
|