import hashlib,importlib.util,json
from pathlib import Path
HERE=Path(__file__).resolve().parent;spec=importlib.util.spec_from_file_location('original_oracle',HERE.parent/'oracle-original.py');m=importlib.util.module_from_spec(spec);spec.loader.exec_module(m)
for lane in ['B','C']:
    root=HERE/'private'/lane;source=json.loads((root/'before.json').read_text());value=m.oracle(source,lane);f=root/'expected-before-http.json';assert not f.exists();f.write_text(json.dumps(value,ensure_ascii=False,indent=2)+'\n');f.chmod(0o600);print(json.dumps({'lane':lane,'expected_sha256':hashlib.sha256(f.read_bytes()).hexdigest(),'nutrition_sum':value['data']['nutrition_sum'],'HTTP':0}))
