Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/tools/adapters/c-i64-import # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / tools / adapters / c-i64-import` 20 lines ยท 1230 bytes Raw Blame History 1 #!/usr/bin/env python3 2 """Transparent host dispatch; C int64 import computation and hashing run in seeded native Omega (spec/universal/translation-s2-v1.md).""" 3 from pathlib import Path 4 import hashlib,json,os,sys 5 root=Path(__file__).resolve().parents[2] 6 NAME='c-i64-import' 7 PIN='`191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`' 8 CLOSURE={'src/source-aware/vendor/sha256.om','src/adapters/c-i64-import.om'} 9 if len(sys.argv)!=1: 10 print('C_IMPORT_BAD_COMMAND: use stdin; no arguments',file=sys.stderr);raise SystemExit(64) 11 try: 12 build=root/'build/S2';m=json.loads((build/'build.json').read_text());exe=build/NAME;a=m['artifacts'][NAME] 13 if a['compiler_sha256']!=PIN:raise ValueError('compiler identity') 14 if set(a['inputs'])!=CLOSURE:raise ValueError('source closure') 15 for rel,digest in a['inputs'].items(): 16 if hashlib.sha256((root/rel).read_bytes()).hexdigest()!=digest:raise ValueError('changed source '+rel) 17 if hashlib.sha256(exe.read_bytes()).hexdigest()!=a['binary_sha256']:raise ValueError('changed artifact') 18 except (OSError,ValueError,KeyError,TypeError) as exc: 19 print('C_IMPORT_STALE_OR_MISSING_BUILD: '+str(exc),file=sys.stderr);raise SystemExit(78) 20 os.execv(exe,[str(exe)])