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 / tests / one_layer / acceptance / HARNESS_INTERFACE_V2.md
| 1 | # One-layer stage 2: harness interface (v2, frozen 2026-10-14) |
| 2 | |
| 3 | Contract between the sealed author (writes 60 held-out experiment tasks and at least 10 planted OSC |
| 4 | binary IR defects, sealed) and the harness (`tests/one_layer/acceptance/`, aien-spark/omega#445, |
| 5 | stage 2 of the one-layer plan). It EXTENDS v1 (`HARNESS_INTERFACE.md`, sha256 pinned in `RULES`): |
| 6 | v1 stays valid and unchanged, `ola.sh score` keeps its v1 meaning, and everything v2 does not |
| 7 | restate (file formats, member rules, sealing steps, sandbox, verdict reasons, receipt keys, no time |
| 8 | stamps, receipts never rewritten) is exactly as in v1. The harness builder never reads |
| 9 | `~/workspace/one-layer-sealed-445/` before scoring. If this file must change it gets a new version |
| 10 | line; v2 stays valid. |
| 11 | |
| 12 | ## 1. New candidate kind `oscir` |
| 13 | |
| 14 | | kind | candidate file | requirement keys | what the harness does | |
| 15 | |---|---|---|---| |
| 16 | | `oscir` | `candidate.oscir`: OSC binary IR bytes (spec/one-layer-format.md), raw binary, not hex | the `kind osc` keys: `entry`, `params`, `ret` (v1 section 2) | `osc_ir_decode` (src/compiler/osc_ir.h), then exactly the kind `osc` path: entry lookup, signature check, back end, native run | |
| 17 | |
| 18 | - Decoding happens inside the sandbox. Any decoder refusal is `REJECT decode_refused` with detail |
| 19 | `class=<NAME>` (`osc_ir_refusal_name`, e.g. `class=TRUNCATED`). After a successful decode the |
| 20 | reasons are the kind `osc` ones (`signature_mismatch`, `compile_refused` for a back-end refusal, |
| 21 | `realize_refused`, `wrong_result`, traps, `timeout`, ...). |
| 22 | - Max 1 MiB, as every candidate (`oversize`). |
| 23 | - `hidden/inputs` and `hidden/expected` are as for kind `osc`. |
| 24 | |
| 25 | ## 2. Planted-defect corpus (kind `oscir` cases) |
| 26 | |
| 27 | Same tarball layout, member rules and LABELS format as v1 section 1, with `candidate.oscir` added to |
| 28 | the allowed candidate files (exactly one candidate per case, matching `kind`). Cases of kinds `osc` |
| 29 | and `omegaprog` stay allowed. Counts are no longer fixed: the harness counts from LABELS. |
| 30 | |
| 31 | - Tarball: `~/workspace/one-layer-sealed-445/corpus.tar`; top-level directory `corpus/`. |
| 32 | - Sealing: v1 section 3 with the stage-2 hash file: |
| 33 | `cd ~/workspace/one-layer-sealed-445 && sha256sum corpus.tar > ~/workspace/omega-vision/stage2/SEALED.sha256.tmp && mv ~/workspace/omega-vision/stage2/SEALED.sha256.tmp ~/workspace/omega-vision/stage2/SEALED.sha256` |
| 34 | - Command: `tests/one_layer/acceptance/ola.sh score-v2 ~/workspace/one-layer-sealed-445/corpus.tar ~/workspace/omega-vision/stage2/SEALED.sha256` |
| 35 | - Evidence: `evidence/ONE-LAYER-2/runs/<run_id>/` (verdicts.txt, replay/verdicts.txt, probes.log, |
| 36 | score.txt, meta.txt) and receipts under `evidence/ONE-LAYER-2/receipts/`, as v1 section 4. |
| 37 | - `score.txt`: `defects_rejected=<x>/<D> controls_accepted=<y>/<C> errors=<n>`, the v1 detail |
| 38 | lines, and `oscir_defects=<d> oscir_controls=<c>`, then `GATE PASS|FAIL`. |
| 39 | Gate: every DEFECT rejected, every CONTROL accepted, zero errors, at least 10 DEFECT cases and at |
| 40 | least 5 CONTROL cases of kind `oscir`, every isolation probe blocked and logged, identical |
| 41 | verdicts on two clean replays, clean tree. |
| 42 | |
| 43 | ## 3. Experiment task corpus (held-out tasks) |
| 44 | |
| 45 | One tarball, `~/workspace/one-layer-sealed-445/tasks.tar` (plain POSIX tar, no compression), with |
| 46 | one top-level directory and NO candidates and NO LABELS: |
| 47 | |
| 48 | ``` |
| 49 | tasks/ |
| 50 | cases/<task_id>/ |
| 51 | requirement # public: kind task + the signature (below) |
| 52 | prompt # public: the plain-English task text shown to every model |
| 53 | hidden/inputs # hidden inputs (v1 format, kind osc rules) |
| 54 | hidden/expected # independently computed expected results (v1 format) |
| 55 | hidden/reference.osc # the author's own OSC text solution; must ACCEPT (section 3.3) |
| 56 | ``` |
| 57 | |
| 58 | - `task_id`: `[a-z0-9_-]{1,40}`, must not start with `dev` (reserved for the public dev tasks). |
| 59 | 60 cases in the held-out tarball. Ids must not reveal the expected behaviour's difficulty class. |
| 60 | - Member rules as v1 (regular files and directories only, no links, no absolute paths, no `..`, |
| 61 | no member outside this layout: the whole tarball is refused otherwise). |
| 62 | - **requirement**: exactly the lines `kind task`, `entry <function_name>`, `params <k1> ... <kn>`, |
| 63 | `ret <kind>` (kinds and limits as v1 kind `osc`; comments and blank lines allowed). |
| 64 | - **prompt**: bytes `\n` and 0x20..0x7E only, 1..4096 bytes. It must state everything a correct |
| 65 | solution needs: the computation, the behaviour on every edge case that `hidden/expected` checks, |
| 66 | and, for every `TRAP` line, the condition in words and the trap kind (overflow = 1, division by |
| 67 | zero = 2, index out of bounds = 3, conversion out of range = 5, shift amount too large = 7). It |
| 68 | must not name a representation (no OSC syntax, no IR, no hex) and must not list the hidden inputs. |
| 69 | The entry name and the parameter and return kinds come from `requirement`; the prompt may repeat |
| 70 | them. Write traps only that a natural solution produces from checked arithmetic or conversion in |
| 71 | every representation (signed overflow, division by zero, out-of-range `as` conversion, shift); |
| 72 | prefer `TRAP` (any code) unless the prompt names the code. |
| 73 | - **hidden/inputs**: at least 8 lines. |
| 74 | - **hidden/reference.osc**: OSC text (kind `osc` rules) whose verdict against this case is `ACCEPT ok`. |
| 75 | |
| 76 | ### 3.1 Sealing |
| 77 | |
| 78 | As v1 section 3, with the task tarball and its own hash file, published LAST and atomically: |
| 79 | `cd ~/workspace/one-layer-sealed-445 && sha256sum tasks.tar > ~/workspace/omega-vision/stage2/TASKS.sha256.tmp && mv ~/workspace/omega-vision/stage2/TASKS.sha256.tmp ~/workspace/omega-vision/stage2/TASKS.sha256` |
| 80 | (content: `<64 hex> tasks.tar`). Nothing in the sealed directory changes after this. |
| 81 | |
| 82 | ### 3.2 Public view for the driver |
| 83 | |
| 84 | `tests/one_layer/acceptance/ola.sh tasks-public <tasks.tar> <TASKS.sha256> <outdir>` checks the |
| 85 | seal and the whole layout, then extracts ONLY `requirement` and `prompt` of every case into |
| 86 | `<outdir>/tasks/cases/<task_id>/`. This is all the generation driver and the models ever see. |
| 87 | |
| 88 | ### 3.3 Experiment mode (merge generated candidates, score without LABELS) |
| 89 | |
| 90 | ``` |
| 91 | tests/one_layer/acceptance/ola.sh experiment <tasks.tar> <TASKS.sha256> <candidates_dir> |
| 92 | ``` |
| 93 | |
| 94 | `<candidates_dir>/<set_id>/<task_id>/candidate.osc` or `.../candidate.oscir`: one directory per |
| 95 | candidate set (`set_id` `[a-z0-9_-]{1,40}`, e.g. `a-structured-1` = config A, arm structured, |
| 96 | attempt 1), at most one candidate file per task. Only regular files and directories; a `task_id` |
| 97 | that is not in the corpus, a second candidate file, or any other file refuses the whole run. A task |
| 98 | with no candidate file (directory absent or empty) gets `REJECT no_candidate`. |
| 99 | |
| 100 | Refuses a dirty git tree. Steps: seal check; private extraction (never inside the repo, never |
| 101 | visible to a candidate); every task's `hidden/reference.osc` scored as set `references`; for each |
| 102 | set, each task's candidate merged into a private copy of the case (the requirement's `kind task` |
| 103 | takes the candidate's kind: `candidate.osc` = `osc`, `candidate.oscir` = `oscir`) and scored exactly |
| 104 | as a v1/v2 case; a second clean extraction and execution of every set (verdicts must be |
| 105 | byte-identical); the v1 isolation probes (the `read_labels` probe aims at a `hidden/reference.osc`). |
| 106 | |
| 107 | Evidence: `evidence/ONE-LAYER-2/runs/<run_id>/` (never overwritten) with `meta.txt`, `probes.log`, |
| 108 | `score.txt`, `sets/<set_id>/verdicts.txt` and `sets/<set_id>/replay/verdicts.txt` (including |
| 109 | `references`). Verdict lines and receipts exactly as v1 section 4 (`kind` = `osc` or `oscir`), plus |
| 110 | the reason `no_candidate` (its receipt has `candidate_sha256=-`). Per-case result |
| 111 | is ACCEPT or REJECT (ERROR only for a malformed case, which also invalidates the run). No LABELS |
| 112 | exist and no gate is computed here: success statistics are the experiment protocol's job. |
| 113 | |
| 114 | `score.txt`, one line per set in name order, then three lines: |
| 115 | |
| 116 | ``` |
| 117 | set=<set_id> accepted=<a>/<n> rejected=<r> errors=<e> no_candidate=<k> |
| 118 | references_accepted=<x>/<n> |
| 119 | replay_identical=yes|no probes=PASS|FAIL clean_tree=yes|no |
| 120 | RUN VALID|INVALID |
| 121 | ``` |
| 122 | |
| 123 | `RUN VALID` requires every reference accepted, zero errors in any set, identical replays, every |
| 124 | probe PASS and a clean tree. |
| 125 | |
| 126 | ### 3.4 Reference check before generation |
| 127 | |
| 128 | `tests/one_layer/acceptance/ola.sh tasks-check <tasks.tar> <TASKS.sha256>` is experiment mode with |
| 129 | no candidate sets: only `references`, replay and probes. Run it once after sealing; a task whose |
| 130 | reference is not accepted is reported (by id and reason, nothing hidden is printed). |
| 131 | |
| 132 | ## 4. Public dev tasks |
| 133 | |
| 134 | The experiment's public dev tasks live in the repo (`tests/one_layer/exp445/dev/`) in exactly the |
| 135 | section 3 layout with ids starting `dev`, are packed and sealed by a script there with a local hash |
| 136 | file, and run through the same commands. They are never held-out evidence. |