omega-harness
Agent skills for operating, encoding and communicating in Omega (.om) and the AIEN repositories
Brought by drakestapleton
GitHub aien-dev/omega-harness#50 (code only)
Apply it
git checkout -b patch-bc474d4ce1a101fc eb07daf4ae9a3aa4cab66049a60c3f3c2be2aced curl -fsSL https://interplane.io/drakestapleton/omega-harness/patches/bc474d4ce1a101fc.patch | git am
Provenance
github-import 1
aien-dev/omega-harness
50
a9994e9a87f840c91fc9a96d58d94c80211189af
{"kind":"github-import","owner":"aien-dev","repo":"omega-harness","number":50,"url":"https://github.com/aien-dev/omega-harness/pull/50","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:39:46Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/skills/omega-encoding/SKILL.md b/skills/omega-encoding/SKILL.md index 4df9171..2a0b5c4 100644 --- a/skills/omega-encoding/SKILL.md +++ b/skills/omega-encoding/SKILL.md @@ -240,6 +240,123 @@ and compare the new hash with the pin yourself ([omega-from-seed.sh#L52-L60](htt Full host qualification is `sh seed/host/check.sh` (author-verified on 2026-10-23 per `seed/host/README.md`); a host pass is never hardware qualification. +## 1b. Ask `omq` what fits at a hole (PENDING: draft omega-mv #838) + +Status: EXERCISED on host only (Linux AArch64, 2026-10-26) at +[omega-mv #838](https://github.com/aien-dev/omega-mv/pull/838) head +`3d8619e58ecb4ef26b92fa9cf8fd12340617aae4`, compiler `seed/out/omc` +`2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f`, `omq` sha256 +`62a21f4462e217f4efcc3eaf1495ca65a0b51a7d47cb1dac25e54a92e1877f9c`: `sh seed/query/check.sh` printed +`SEED QUERY PASS 45 checks`. The PR is a draft and not merged, so `seed/query/` is absent from +main until it lands. Source of every rule below: `seed/query/README.md` at that head. + +`omq` (`seed/query/omq.om`, seeded Omega) reads a program with one hole `??` and prints one JSON +line: what `omc` accepts at the hole. It runs the given `omc` on witness programs and reports only +forms that compiled, so it follows the compiler instead of restating its rules. It still does not +replace compiling and running the finished program (section 1a). + +```sh +seed/out/omc < seed/query/omq.om > omq && chmod +x omq +./omq seed/out/omc < prog.om # one JSON line on stdout +./omq seed/out/omc prefix < reqs.bin # prefix-viability server +``` + +- Hole: a line that is only `??` is a statement hole; `??` inside a line is a value hole. With no + hole `omq` only checks the program. +- Exit: 0 answer printed; 1 more than one hole or a hole outside a function; 2 usage, or a compiler + that fails `omq`'s selftest (`/bin/true` or a wrong path never yields an answer). +- `hole`: 1-based `line`, `kind` (`statement`/`value`), the enclosing function's `fn_line`, block `depth`. +- `check`: `code` 0 when the text before the hole, closed off by a trap and the missing `end`s, + compiles; otherwise the `omc` error `code` and `line`, plus `sev`, `col`, `expect`, `found`, + `obligation`, `span` for an OM-2 diagnostic, a `why` sentence, and possibly a recompiled repair + (`fix_rename`, `fix_move_up` or `fix_append_end`, with `rc_after_fix`). +- `check.status`, one of four values, never a plain VALID: + `INVALID` (`omc` rejects the text and the error lies before the hole: nothing at the hole repairs + it); `INCOMPLETE` (with a hole, the closed-off witness compiles, so a valid completion exists); + `VALID-UNPROVEN` (no hole and `omc` accepts: well formed only, contracts become run-time traps, + no behaviour proven); `UNKNOWN` (the error lies after the hole, in the witness's added closing + lines, and may depend on what the hole holds). +- `scope`: names visible at the hole, typed by probing `omc` (`T[]` for an array; `struct` when + `get NAME F` compiles for a declared struct's first field; `writable` when `put` into it + compiles). Candidates are parameters, `=` bindings, `for` variables and bare `NAME VALUE` + bindings. Names from closed blocks are absent. +- `fns`: function signatures. `next`: forms that compiled at the hole; `<T>` is a slot for a value + of type T. At a value hole `expect` lists the expected types. A user-function call appears with a + concrete argument list. +- `obligations`: `function`, `open` blocks innermost first, `regs_free` (more `ulong` names that + fit before error 12), `contracts` (`requires`/`ensures`, invariants of open loops), `effects` + (host-word effects already used, e.g. `read:fs`, `write:io`, `net`). +- `compiles`: how many times `omc` ran. + +Observed at the pin above (transcript and script retained as host evidence by the author, not in this +repository), from the omega-mv root, with `stmt.om` = `fn main to int` / `n = uint 3` / `??` / `end`: + +```text +$ ./omq seed/out/omc < stmt.om; echo "rc=$?" +{"hole":{"line":3,"kind":"statement","fn_line":1,"depth":1},"check":{"code":0,"status":"INCOMPLETE"},"scope":[{"name":"n","type":"uint"}],"fns":["fn main to int"],"next":["ret <int>","n = <uint>","NEW = <value>","if <bool>","while <bool>","for NAME T COUNT","trap <1..255>","exit <int>"],"obligations":{"function":"fn main to int","open":["fn"],"regs_free":15,"contracts":[],"effects":[]},"compiles":36} +rc=0 +``` + +Value hole, `value.om` = `fn main to int` / `n = uint 3` / `x = add n ??`: + +```text +{"hole":{"line":3,"kind":"value","fn_line":1,"depth":1},"check":{"code":0,"status":"INCOMPLETE"},"scope":[{"name":"n","type":"uint"}],"fns":["fn main to int"],"expect":["uint"],"next":["n","add <uint> <uint>","sub <uint> <uint>","mul <uint> <uint>","div <uint> <uint>","rem <uint> <uint>","and <uint> <uint>","or <uint> <uint>","xor <uint> <uint>","shl <uint> <uint>","shr <uint> <uint>","uint <any>"],"obligations":{"function":"fn main to int","open":["fn"],"regs_free":15,"contracts":[],"effects":[]},"compiles":37} +``` + +Error before the hole, `bad.om` = `fn main to int` / `n = uint 3` / `ret int m` / `??` / `end` +(status `INVALID`, exit 0 because an answer was printed): + +```text +{"hole":{"line":4,"kind":"statement","fn_line":1,"depth":1},"check":{"code":3,"line":3,"sev":"unknown","col":9,"expect":"name","found":"m","obligation":"-","span":[34,35],"why":"unknown name: define it before this line (globals, consts and texts above their first use; locals in an enclosing block that is still open)","status":"INVALID"},"scope":[],"fns":["fn main to int"],"next":[],"obligations":{"function":"fn main to int","open":["fn"],"regs_free":0,"contracts":[],"effects":[]},"compiles":34} +``` + +No hole (`ret int n` in place of `??`), two holes, and a fake compiler: + +```text +{"check":{"code":0,"status":"VALID-UNPROVEN"},"compiles":3} +rc=0 +{"error":"more than one ?? hole","compiles":2} +rc=1 +$ ./omq /bin/true < stmt.om +omq: cannot run the compiler +rc=2 +``` + +Prefix mode: `omq OMC prefix` reads requests on fd 0, each a 4-byte little-endian length then that +many bytes of program prefix, and writes one line `V CODE` per request: whether the prefix can still +be completed to a program `omc` accepts, and the `omc` exit code. `V` per `omq.om` lines 2522-2524: +0 whole unit accepted, 1 prefix still completable, 2 dead, 3 compiler did not run. An open word at +the prefix end longer than any word `omc` accepts (a name over 8 bytes, 63 after omega-mv #837; a +number over 20 bytes) is answered `2`; note lines, text literals and prefixes of `invariant` are +exempt (README lines 94-99 at that head). Requests +`fn main to int` + `x = add`; the same with `x = add int 1 2` / `ret x` / `end`; and +`fn main to int` + `abcdefghij = 1` gave: + +```text +1 4 +0 0 +2 13 +``` + +Limits: one hole per request; a call with several array parameters gives every array parameter the +same candidate rank, so a call needing two different arrays of one element type may be missing from +`next`; struct-typed parameters are not filled; the text after the hole is not checked (it is the +part still to be written); an abstract value appears in `scope` with an empty type; scope order is +first mention, so a loop variable reused after a closed loop of the same name can precede names +declared between the loops; a hole inside an `inline` function whose caller passes a `fresh` array +gives `check` code 27. Each answer costs tens to a few hundred compiles. + +- PENDING [omega-mv #843](https://github.com/aien-dev/omega-mv/pull/843) (draft, not merged, + `seed/out/omc` not reseeded; source OMEGESE 9.13 at head `3f6579b449a5a3a4458dc2bc443bd2a9e51773ff`): + stage 2 is `om2 query`, a lead line at byte 0 of the input to `omc` itself. Under it `omc` prints + one JSON line and never writes a program. No hole and the rest compiles: + `{"check":{"code":0,"status":"VALID-UNPROVEN"}}`, exit 0. Any `omc` error: + `{"check":{"code":C,"line":L,"status":"INVALID"}}`, exit 1 (code, line and status only, no + repairs). A statement `??` hole: `hole`, `scope`, `fns`, `obligations` in `omq`'s key shape, exit 0. + A value hole read as an unknown name: `"status":"UNKNOWN","why":"value holes: use omq (stage 1)"`, + exit 1. Without the lead line `??` keeps its old refusal. NOT_RUN here: the pinned `omc` above has + no `om2 query`, so no output is shown. + ## 2. Program shape ``` diff --git a/skills/omega-harness/SKILL.md b/skills/omega-harness/SKILL.md index 316d30b..f42148a 100644 --- a/skills/omega-harness/SKILL.md +++ b/skills/omega-harness/SKILL.md @@ -72,6 +72,7 @@ fi - Rebuilding with `sh seed/omega-from-seed.sh` rewrites tracked files, including `seed/out/omc.sha256`. Record the expected digest independently beforehand; the rewritten sidecar is not a trust anchor. A self-rebuild fixpoint proves consistency, not correctness and not diverse compilation. At source `ec07d25d5506d33567adbd4d9b518177b7933bad` on 2026-10-26, the seed gate reproduced `499236398aabc652e2dae27fe4bdc4c5db3d3726314356e0dbef23e3345803ec`. Main later used `befb8199db8c4bca188a494dfaac2a6f0ee5c36fcea11188c75666c55fce8a1d`. Main `91b3c9326919faf1491e29ae9276929e8349b8c7` now carries batch compiler `189ada82e00bb440cb41351bd252cc68c54a1b1050051cc42a1df700081c3b54` (contracts, capacity and f32 returns); its host qualification is `evidence/BATCH-189ada82/README.md`. - Gate5 bookkeeping for any compiler change: since main `91b3c932`, `seed/omc/gate5.sh` writes current outputs to `build/seed/r5/evidence/`, never to immutable `evidence/SEED-0/omc/`. The living ledger `seed/omc/size-history.tsv` keeps the old history byte for byte, then one tab-separated row per compiler change (`rewrite change source_lines functions words sha256`). At `91b3c932` the last row is `RM2-capacity-f32` (`189ada82…`). Gate5 checks that the last row's sha256 equals the freshly built `omc`, and it never appends a row itself. So a compiler change adds exactly one row by hand, with values measured from the new build, in the same commit as the change. Never edit an older row to make the check pass, and never point the check back at `evidence/SEED-0`. - Run the changed path and compare exact expected bytes, status and state; a successful compile proves nothing about behavior. Also exercise the failure or refusal boundary most likely to regress. If that is impractical, say exactly what was not run. +- While writing `.om`, ask the compiler what fits instead of guessing: `omq` (`omega-encoding` section 1b; PENDING in draft [omega-mv #838](https://github.com/aien-dev/omega-mv/pull/838), host-EXERCISED at head `3d8619e5`, compiler `2c824805…`, `SEED QUERY PASS 45 checks`) takes a program with one `??` hole and prints the names in scope, the forms `omc` accepted there and the open obligations. Its `INCOMPLETE` or `VALID-UNPROVEN` is a compile-level answer, never behaviour evidence: still compile, run and control the finished program. The compiler-side `om2 query` lead line (PENDING draft [omega-mv #843](https://github.com/aien-dev/omega-mv/pull/843)) is described in the same section. - Run a negative control: change an expected value or feed invalid input, and confirm the check fails. A verifier that also accepts its negative control has not established anything. - Qualification case files (`.cases` in omega-mv) are executed by a conductor, not run directly. More than one conductor exists under `seed/qualification/`, and picking the wrong one looks like a failing gate. Read the conductor's `main` for its argument count first. Observed 2026-10-25 with compiler `734f0a39319fbfa930bcc62cb30dbf06d47d78e126372b74f5baf478e6126b61`: `seed/qualification/om2/gate.om` takes four arguments (`omc pinhash casesfile scratchdir`) and summarises as `OM2GATE PASS cases=N pass=N fail=N invalid=N not_run=N`; `seed/qualification/security673/gate669.om` accepts at most one argument and exits 90 under a four-argument call. A usage status such as 90 from a conductor is INVALID setup, never a qualified refusal. - Executable contracts reuse that conductor. `seed/omc/contracts/contracts.cases` (44 rows) must end `OM2GATE PASS`. `seed/omc/contracts/mutant.cases` builds two broken compilers, one with enforcement disabled and one whose prover accepts any constant predicate, and must exit 1 with `OM2GATE FAIL cases=2 pass=0 fail=2 invalid=0 not_run=0` plus a `VERDICT … FAIL run exit=0 expected=109` line for each. For that suite, exit 1 with the exact verdict lines is the expected outcome; a pass means the negative control failed. `seed/host/check.sh` runs both.