from preflight import R,g,HEAD
from pathlib import Path
source=Path('/tmp/codex/ltb1021/2026-09-12_contextra-rtp-anchor_r01/build.py').read_text()
source=source.replace("v=json.loads((R/'verify.json').read_text());assert v['errors']==v['failures']==v['sdk']==0", "assert (R/'plan.json').exists()")
source=source.replace("rtp-anchor-7913605-", "fire-runtime-3a883f2-")
source=source.replace("digest=g.hashlib.sha256(json.dumps(hashes,sort_keys=True).encode()).hexdigest()", "digest=g.hashlib.sha256((HEAD+json.dumps(hashes,sort_keys=True)).encode()).hexdigest()")
ns=dict(__name__='builder');exec(compile(source,'bounded_builder','exec'),ns)
ns['EDITED']=['tests/native_metadata_fixture.cpp','tests/sdk_frame_identity_probe.py']
if __name__=='__main__':
    assert not (R/'build-started.json').exists()
    (R/'build-started.json').write_text(g.json.dumps(dict(head=HEAD,build_count=1)))
    ns['main']()
