Files
MeltMind/tools/phase2_local_coordinator.py
T

20 lines
985 B
Python

"""Explicit engineering adapter: replace only coordinator Git storage backend."""
import importlib,json,sys
from pathlib import Path
from phase2_h1_worker_v2 import checked,sha
import phase2_fixed_io
from phase2_local_freeze_io import freeze,ENGINEERING,BASE
def run(module,root):
e=json.loads(ENGINEERING.read_text());job=e['jobs'][root.name]
if job['module']!=module:raise PermissionError('Unapproved coordinator')
for p,h in e['engineering_sha256'].items():checked(BASE/p,h)
checked(root/'contract.json',job['contract_sha256']);phase2_fixed_io.verify(root,'launch')
target=importlib.import_module(module)
if target.freeze is not phase2_fixed_io.freeze:raise RuntimeError('Unexpected existing storage adapter')
# No scientific function, source, config, model, or guard changes.
# Children still execute the original pinned entry; original verify reads the same proof format.
target.freeze=freeze
target.run(root)
if __name__=='__main__':run(sys.argv[1],Path(sys.argv[2]))