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
omega-mv / evidence / OMEGALLM-FRONTIER-20261123 / controls.py
| 1 | """From a post-fix repository root, run traversal controls using the repository seed.""" |
| 2 | import json |
| 3 | from pathlib import Path |
| 4 | import subprocess |
| 5 | import tempfile |
| 6 | |
| 7 | path = "seed/helix/ollm_factory/om_synth.om" |
| 8 | control = Path(path).with_name("frontier-check.om").read_text() |
| 9 | native = Path(path).read_text().split("fn main to int\n", 1)[0] |
| 10 | base = "a4aec7ed5cc8a37f3bea9f851a19f2473c9183b4" |
| 11 | original = subprocess.check_output(["git", "show", base + ":" + path], text=True).split("fn main to int\n", 1)[0] |
| 12 | cases = [ |
| 13 | ("fixed", native, 0), |
| 14 | ("previous", original, 104), |
| 15 | ("truncated", native.replace("for offset ulong sub prevE prevS", |
| 16 | "span = sub prevE prevS\nif gt span 4096\nspan = ulong 4096\nend\nfor offset ulong span"), 2), |
| 17 | ("missing_order", native.replace("syExpandPair i j d and ge j prevS gt i j", |
| 18 | "syExpandPair i j d gt i j"), 3), |
| 19 | ("false_solution", native.replace("if syPoolFull\nput syLvlE d get sySt 3\nret false", |
| 20 | "if syPoolFull\nput syLvlE d get sySt 3\nret true"), 4), |
| 21 | ] |
| 22 | results = {} |
| 23 | with tempfile.TemporaryDirectory() as folder: |
| 24 | for name, program, expected in cases: |
| 25 | exe = Path(folder) / name |
| 26 | with exe.open("wb") as stream: |
| 27 | subprocess.run(["seed/out/omc"], input=(program + control).encode(), stdout=stream, check=True) |
| 28 | exe.chmod(0o700) |
| 29 | results[name] = subprocess.run([exe]).returncode |
| 30 | if results[name] != expected: |
| 31 | raise RuntimeError((name, expected, results[name])) |
| 32 | print(json.dumps(results, sort_keys=True)) |