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 / research / atemporal / at0 / evaluator / README.md
| 1 | # AT-0 Agent 4: independent adversarial evaluator |
| 2 | |
| 3 | This directory is the independent evaluator for the AT-0 Clock-Free Universe |
| 4 | program (aien-architecture `docs/plans/atemporal/`). Its job is to try to |
| 5 | falsify the AT-0 implementation's claimed correctness, not to confirm it. It |
| 6 | trusts nothing a candidate reports: every number, every check verdict, every |
| 7 | digest and every provenance claim in a result file is recomputed or |
| 8 | re-derived here from the case file alone. |
| 9 | |
| 10 | Pinned references (frozen bytes, verified by digest): |
| 11 | |
| 12 | | document | commit | |
| 13 | |---|---| |
| 14 | | AT0_CASE_V1.md, AT0_RESULT_V1.md, AT0_FREEZE.md (frozen) | aien-architecture `044c9d11256d8642f80eedd42cbae8763faf63f5` | |
| 15 | | AT0_CHARTER.md (updated, contract bytes unchanged) | aien-architecture `00e9f2308666f74e58f524b177b2a31eccdc69ba` | |
| 16 | | AT0_SPEC.md draft (PR #176 head) | aien-architecture `0efd1a14cbdf117bc694b556bb61d031cf80c8f9` | |
| 17 | | AT0_RESULT_V2.md (frozen; digest bd0f9eb8cf3ef7226c3ea18c1c9fbd4db62e0c23a0481afa519830fc1f514b5e; AT0_CASE_V1.md unchanged, d90af74bf818598d28114a73e618f5073706797d7d92d472acc2df404cd663d9) | aien-architecture `c7a7181eda57e353dbff3b7d20cde33fb65faeb2` (#180) and `fe86e43aae63370b3084f78e971a33b81ce75a9d` (#181), both verified here by digest and allowlisted | |
| 18 | |
| 19 | The evaluator reads only complete `AT0_RESULT_V2` files (Agent 0 ruling, |
| 20 | omega#358): the engine and the reference oracle emit component outputs, Agent |
| 21 | 5's runner assembles the full result with verdict block and digests, and this |
| 22 | evaluator judges that assembled file against the case file. It never consumes |
| 23 | component outputs, so its independence from both engine and oracle holds. |
| 24 | |
| 25 | No Python, no external libraries. C11 plus POSIX shell. The only file linked |
| 26 | from outside this directory is omega `src/sha256.c`. |
| 27 | |
| 28 | ## Layout |
| 29 | |
| 30 | ``` |
| 31 | Makefile build/at0-eval (and build/at0-eval-asan) |
| 32 | run.sh the qualification harness; writes results/qualification.json |
| 33 | src/ evaluator sources (see "Design") |
| 34 | cases/positive/ P* cases expected to PASS the physics |
| 35 | cases/negative/ N* negative controls expected to FAIL with named codes |
| 36 | cases/refuse/ R* malformed or invalid cases expected to be REFUSED with a named code |
| 37 | cases/MANIFEST.tsv path, class, exact expected response for all 62 public cases |
| 38 | cases/generate.sh regenerates every public case from `at0-eval gen` plus byte edits |
| 39 | gates/isolation.sh symbol-level isolation gate with positive and negative control objects |
| 40 | HIDDEN_COMMITMENT.txt SHA-256 of the six hidden cases (contents withheld until candidate freeze) |
| 41 | FAILURE_TAXONOMY.md every E4-* finding code, its severity and meaning |
| 42 | ISOLATION_REPORT.md isolation status (UNISOLATED), reproducibility, toolchain |
| 43 | results/ qualification.json (machine-readable) and candidate result copies |
| 44 | ``` |
| 45 | |
| 46 | ## Usage |
| 47 | |
| 48 | ``` |
| 49 | make build |
| 50 | sh run.sh --self-only evaluator self-tests, corpus, mutants, gates, hidden commitment |
| 51 | sh run.sh the same plus the candidate section (BLOCKED_NO_CANDIDATE when unset) |
| 52 | |
| 53 | AT0_CANDIDATE_CASE_TOOL=<cmd> AT0_CANDIDATE_RUN=<cmd> AT0_CANDIDATE_OBJECTS="<objs>" sh run.sh |
| 54 | ``` |
| 55 | |
| 56 | Candidate hooks: `AT0_CANDIDATE_CASE_TOOL <case>` must print `AT0_CASE_OK <id>` |
| 57 | (exit 0) or `AT0_CASE_REFUSED <code>` on stderr (exit 2) exactly as the |
| 58 | contract requires; `AT0_CANDIDATE_RUN <case>` must write a complete |
| 59 | `AT0_RESULT_V2` file to standard output; `AT0_CANDIDATE_OBJECTS` lists the |
| 60 | compute objects or binaries for the isolation gate. `AT0_HIDDEN_DIR` points at |
| 61 | the private case directory (default `~/at0-private/agent4`). Candidate results |
| 62 | for hidden cases are written into the private directory, never into the repo. |
| 63 | |
| 64 | Direct tool commands: |
| 65 | |
| 66 | ``` |
| 67 | build/at0-eval case <file> [--detail] independent AT0_CASE_V1 codec: AT0_CASE_OK <case_id> / AT0_CASE_REFUSED <code> |
| 68 | build/at0-eval result <file> [--case <case>] [--no-shadow] [--json] |
| 69 | verify a result: AT0E_VERIFY PASS|FAIL|INCONCLUSIVE plus findings |
| 70 | build/at0-eval shadow <case> shadow oracle table (kernel, POVM residual, p(k), Pauli, reference) |
| 71 | build/at0-eval synth <case> [mutant] honest synthetic result, or one with a planted defect |
| 72 | build/at0-eval mutants list the 26 planted defects |
| 73 | build/at0-eval gen key=value ... emit a canonical case (name, E, h, ref, psi, tau, w, M, labels, control, expected, codes, minbk, tol*) |
| 74 | ``` |
| 75 | |
| 76 | Exit codes: `case` 0 ok / 2 refused; `result` 0 PASS / 1 FAIL / 3 INCONCLUSIVE. |
| 77 | |
| 78 | ## Design |
| 79 | |
| 80 | **Independent codec** (`at0e_text.c`, `at0e_case.c`). Byte rules, canonical |
| 81 | encodings, fixed line order and the six validity rules of AT0_CASE_V1 are |
| 82 | reimplemented from the contract text, not from any candidate code. The |
| 83 | known-answer example reproduces file digest, `case_id` and `acceptance_id` |
| 84 | exactly, and `gen` re-emits it byte for byte. |
| 85 | |
| 86 | **Exact decision arithmetic** (`at0e_big.c`). Every reported value |
| 87 | (`f64:<hex>`), every bound and every tolerance (scaled decimals) is lifted to a |
| 88 | 4096-bit integer over the common denominator 2^1100 x 10^80. The ten checks and |
| 89 | their tri-state comparison forms are then decided with no rounding at all, so |
| 90 | the checker can never disagree with the contract by a floating-point hair. |
| 91 | |
| 92 | **Shadow oracle** (`at0e_shadow.c`). The physics is recomputed from the case: |
| 93 | exact kernel dimension and matched eigenvalues (rational arithmetic), exact |
| 94 | test for the POVM identity (w = N/M, and for every gap D: D tau not an integer, |
| 95 | D tau M an integer), then long double (113-bit mantissa on this machine) |
| 96 | evaluation of the POVM Frobenius residual, conditional states, clock |
| 97 | probabilities, Pauli probabilities and the Schroedinger reference, with exact |
| 98 | mod-1 angle reduction. The shadow's own bound is stated as ESTIMATED 1e-20, and |
| 99 | a reported value is contradicted only when it differs from the shadow by more |
| 100 | than the sum of both bounds. |
| 101 | |
| 102 | Hand derivations behind the shadow: the conditional state is the Schroedinger |
| 103 | evolution restricted to the matched eigencomponents, phi_k = (1/N) sum over |
| 104 | matched s of exp(-2 pi i e_s (k-r) tau) c_s |e_s>; its norm is independent of k, |
| 105 | so the clock probabilities are flat and sum to wM/N exactly. A wrong tau |
| 106 | therefore shows up only in `povm_residual`, never in `probability_sum`; a wrong |
| 107 | weight shows up in both. |
| 108 | |
| 109 | **Result verification** (`at0e_result.c`). Strict parse of the result file; |
| 110 | recomputation of `verdict_id` and `evidence_digest` with the version's tags; |
| 111 | binding of the embedded case to the supplied case file (file digest, both ids, |
| 112 | semantic and acceptance blocks, name); provenance rules (contract commit in |
| 113 | the verified allowlist, clean tree, oracle digest not equal to engine digest, |
| 114 | UTC time order, placeholder discipline); undefined-token discipline for the |
| 115 | trivial-kernel shape; independent re-derivation of all ten checks, outcome, |
| 116 | failure codes and `expectation_met`; shadow comparison of every value. |
| 117 | |
| 118 | **Mutants** (`at0e_synth.c`). Twenty-six planted defects covering wrong axis, |
| 119 | wrong Y sign, conjugation bug, reversed reference, dephased state, hidden |
| 120 | weight error, hardcoded table, wrong kernel dimension, residual over bound, |
| 121 | hidden non-finite, forged verdict, corrupted evidence, corrupted verdict id, |
| 122 | altered case id, altered tolerance, rebound case, wrong contract commit, dirty |
| 123 | tree, reversed times, oracle equal to engine, NONE bound with non-zero value, |
| 124 | wrong label status (both directions), placeholder with values, CRLF, trailing space. `run.sh` |
| 125 | demands that every defect is caught on a case where it bites (red before |
| 126 | green) and records the pairs where a defect is invisible by construction as |
| 127 | INCONCLUSIVE rather than silently skipping them. |
| 128 | |
| 129 | ## Blind spots (by construction, documented, covered elsewhere) |
| 130 | |
| 131 | - A Y-axis rotation of |0> (P1f) keeps <Y> = 0, so a conjugation bug is |
| 132 | invisible there; it is caught on P1e, P1g and the KAT. |
| 133 | - A field whose rotation angles are multiples of pi at every sampled clock |
| 134 | reading (P2, |h| = 1/2, tau = 1/2) keeps <Y> = 0 and hides a reversed |
| 135 | reference; caught on P1e and P1g. |
| 136 | - Shifting h0 alone (P2b) leaves every probability unchanged, so a table |
| 137 | hardcoded for the unshifted case is indistinguishable there; caught on P1b, |
| 138 | P1c, P1d where tau, N and the reference reading differ. |
| 139 | - A forged verdict on a case whose honest verdict is PASS is a no-op; caught on |
| 140 | N1, N2, N3, N6. |
| 141 | - The spec (PR #176) shows that flipping Hamiltonian signs inside the engine |
| 142 | changes nothing observable: the engine depends only on Psi and the POVM. A |
| 143 | phase-sign defect must therefore be a conjugation bug or a reversed |
| 144 | reference, and only cases with <Y> != 0 can see it. Every case class used for |
| 145 | qualification includes at least one such case, publicly and in the hidden set. |
| 146 | |
| 147 | ## Contract ambiguities found (recorded, not resolved here) |
| 148 | |
| 149 | - A1 (resolved by V2): the trivial-kernel shape in V1 made check 9 FAIL with |
| 150 | CONDITIONAL_UNDEFINED; V2 marks checks 4, 6, 7, 8, 9, 10 NOT_EVALUATED, keeps |
| 151 | check 5 evaluated, and fails check 3 with TRIVIAL_PHYSICAL_STATE. The evaluator |
| 152 | follows V2. |
| 153 | - A2: a rational beyond the +-1048576 limit is a parameter error |
| 154 | (CASE_INVALID_PARAMETER), not a shape error. The contract text orders the |
| 155 | rules that way; the evaluator implements that ordering and R26 exercises it. |
| 156 | - A3: `probability_range` is read as covering the reference probabilities as |
| 157 | well as the reported ones. |
| 158 | - A4: N5 (minimum bound kind RIGOROUS) fails only because the engine states |
| 159 | ESTIMATED bounds; an engine with rigorous interval arithmetic would pass it. |
| 160 | - A6: V2 says a check whose input contains `undefined` is NOT_EVALUATED "for that input". The evaluator reads this per input: with mixed label statuses, checks 7, 8 and 10 are evaluated on the DEFINED labels (and on the clock and reference probabilities, which are always real) and NOT_EVALUATED only when no input remains. N7 (all labels UNDEFINED with a nontrivial kernel, tol_zero_probability = 1) exercises the all-undefined shape; it fails with exactly CONDITIONAL_UNDEFINED. |
| 161 | - A5: the charter's N1 example spectrum (1/2, 1, 3/2, 2) is half-covered with a |
| 162 | broken clock, not uncovered; the corpus uses 1, 2, 3, 4. Agent 0 redefined N1 |
| 163 | the same way independently. |
| 164 | |
| 165 | ## Statuses |
| 166 | |
| 167 | Every test in `results/qualification.json` carries exactly one of PASS, FAIL, |
| 168 | INCONCLUSIVE, NOT_RUN, BLOCKED_NO_CANDIDATE with a specific reason. UNISOLATED |
| 169 | is a property of the whole run (see ISOLATION_REPORT.md), never a test status. |
| 170 | A PASS here is software conformance to the frozen contracts. It is not, and |
| 171 | must not be cited as, a scientific result about time or quantum mechanics. |
| 172 | |
| 173 | ## Independent review (2026-10-09) |
| 174 | |
| 175 | Before merge the sources were reviewed by Opus 5.5 in a separate session with |
| 176 | none of this session's context (Codex was out of usage). It confirmed the |
| 177 | physics derivations and the exact arithmetic and found two blocking bugs, both |
| 178 | fixed and both now covered by public cases: fractions with parts above 2^63 |
| 179 | were truncated before conversion to long double in the shadow oracle (P5, |
| 180 | large rationals, checks P(Z+) = 1/3 at the reference reading), and a 39-digit |
| 181 | integer overflowed the fraction parser so an out-of-range value could reach the |
| 182 | id check (R39, refused CASE_INVALID_PARAMETER). Its further points are applied: |
| 183 | a verification without `--case` is INCONCLUSIVE (E4-UNBOUND-NO-CASE-FILE), a |
| 184 | mutant counts as caught only on FAIL, gate control objects that fail to compile |
| 185 | record NOT_RUN instead of a false PASS, the isolation gate reads dynamic symbol |
| 186 | tables and forbids `syscall`, scaled-decimal bounds above 2^64 convert exactly, |
| 187 | and the shadow bound follows the long double width. |
| 188 | |
| 189 | ## Rulings applied after the first qualification run (omega#358, 2026-10-09) |
| 190 | |
| 191 | - D3 (Agent 0): `control_kind` with a token outside POSITIVE/NEGATIVE, and a |
| 192 | `clock_label_count` larger than the number of `clock_label` lines, are shape |
| 193 | failures (section 1 line grammar), so step 1 fires first: CASE_PARSE_ERROR, |
| 194 | not CASE_INVALID_PARAMETER. The codec and the manifest rows R31 and R36 now |
| 195 | say so. Ambiguity A2 (rational beyond the limit is a range failure) is |
| 196 | unaffected: a well-formed integer that is too large is not a grammar failure. |
| 197 | - D5 (Agent 5): the isolation gate grepped `std..time`, which never matches a |
| 198 | real Rust symbol (legacy mangling writes `_ZN3std4time...`, v0 mangling |
| 199 | `_RNv...3std4time...`). The gate now scans the raw and the demangled symbol |
| 200 | tables for both mangling schemes and the `std::time`, `SystemTime`, `Instant` |
| 201 | spellings, and `run.sh` builds three Rust controls from the oracle compute |
| 202 | crate (clean, std::time mutant, extern "C" clock_gettime mutant) whenever |
| 203 | rustc is available. See ISOLATION_REPORT.md for the G2 sign-off. |
| 204 | - D11 (Agent 0): a bare literal that does not match its fixed value |
| 205 | (`model_family`, `energy_unit`, `clock_povm`, `observables`) is a section 1 |
| 206 | grammar failure: CASE_PARSE_ERROR. Codec and manifest row R37 changed. |
| 207 | - Hardened-libc aliases (Agent 5): the gate now normalises `__name_chk` and |
| 208 | `__name_2` to `name` before matching, and forbids the plain file-read family |
| 209 | (read, write, fread, fwrite, fgets, getline, scanf, mmap, ioctl and friends). |
| 210 | Control object `gates/fortified_read_mutant.c`; harness test |
| 211 | GATE-ISOLATION-FORTIFIED-READ-CAUGHT. |
| 212 | - Candidate freeze (Agent 0/6, omega#358, after omega#366): the six withheld |
| 213 | cases are revealed in `cases/hidden/`. `run.sh` checks them against the |
| 214 | digests committed in HIDDEN_COMMITMENT.txt before the freeze on every run, and |
| 215 | the first hidden run against the frozen candidate is recorded under |
| 216 | `results/hidden-run-<omega commit>/`. |