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
| 1 | # Omega Visor V1 — terminal-first semantic interface |
| 2 | |
| 3 | Status: V1 (terminal viewport). Start commit `ceb68d69b6d0b6b11066d4a64f9fadc3f7bf21b5`. |
| 4 | |
| 5 | ## 1. What the Visor is |
| 6 | |
| 7 | Omega Visor is the human/agent interface for inspecting, constructing, verifying, |
| 8 | realizing, executing, comparing and understanding Omega semantic state. It is a |
| 9 | *viewport* over the existing canonical objects, not a second semantic system. |
| 10 | |
| 11 | ```text |
| 12 | OMEGA |
| 13 | ├── Omega Language (spec/omega-language-v0.md) surface syntax, disposable |
| 14 | ├── Omega Compiler (src/language/omega_lower.om) lowers into OmegaGraph |
| 15 | ├── Omega Runtime (src/runtime/) resident World, generations |
| 16 | ├── Omega Library (src/omega_library.c) |
| 17 | └── Omega Visor (src/visor/*.om, tools/omega.om, tools/omega_ops.om, tools/omega_wire.om) |
| 18 | ├── Console visor_console, visor_parse_command |
| 19 | ├── Semantic Explorer visor_semantic |
| 20 | ├── World Explorer visor_world |
| 21 | ├── Machine Explorer visor_machine |
| 22 | ├── Evidence Explorer visor_evidence (+ visor_verify) |
| 23 | ├── Cortex Explorer (V3, not built) |
| 24 | ├── J-Space Explorer (V3, not built) |
| 25 | └── Realization Lab visor_realization |
| 26 | ``` |
| 27 | |
| 28 | ## 2. Non-negotiable rules (enforced by code and tests) |
| 29 | |
| 30 | 1. `OmegaGraph` is the only source of meaning. Every view derives from canonical |
| 31 | objects; nothing in `src/visor` stores a second copy of semantics. |
| 32 | 2. No second AST. The language parse tree (`src/language`) is scratch storage that |
| 33 | is lowered and discarded; its identity is never used. |
| 34 | 3. The Visor may inspect, propose, construct, simulate, or *request*. It cannot |
| 35 | grant. `VisorEffectRequest` has no authorized state and no setter |
| 36 | (spec/visor-authority.md). The link check `tests/visor/check_authority_link.sh` |
| 37 | fails the build if any console/visor/language object references an |
| 38 | authority-mutating runtime symbol. |
| 39 | 4. Effectful work: `Visor -> semantic request -> EffectIntent -> AEGIS/PHYSICS |
| 40 | authority -> bounded execution -> receipt`. The console prints that route and |
| 41 | refuses to execute. |
| 42 | 5. No hidden reasoning is shown. Output is typed views: objects, verification rows, |
| 43 | realizations, cost classes, evidence records, machine models. |
| 44 | 6. `tools/omegatool.c` is untouched; it remains the qualification/reference tool. |
| 45 | 7. The `omega` binary is physics-free: it is pure seeded OM-2, compiled by `seed/out/omc` |
| 46 | from exactly `$(OMEGA_OM_SRCS)` in `mk/00-visor-core.mk` and linking no C object, and |
| 47 | builds with `PHYSICS_DIR=/nonexistent PHYSICS_LOCK_CHECK=0`. The retired C lane |
| 48 | (`tools/omega.c`, `src/visor/*.c` except the test-only runtime adapters `visor_world.c` and |
| 49 | `visor_effect_request.c`, |
| 50 | `src/language/*.c`) is deleted; `make visor-authority-check` scans those OM-2 sources. |
| 51 | |
| 52 | ## 3. Session model (`src/visor/visor.om`, lead-owned; the retired C was `src/visor/visor.h`) |
| 53 | |
| 54 | A `VisorSession` holds one `OmegaGraph`, named bindings (`let x ...`, `fn ...`), |
| 55 | the `_` last result, and bounded tables of `OmegaProgram`s and realizations |
| 56 | (`VisorRealizationEntry`). A binding names an object id, a program index or a |
| 57 | realization index; `visor_resolve` accepts `_`, a name, a 64-hex id or |
| 58 | `sha256:<hex>` and fails closed on anything else. |
| 59 | |
| 60 | A realization entry records both `subject_id` (what the user asked to realize, e.g. |
| 61 | an apply) and `real.semantic_id` (what the existing realizer keyed on, e.g. the |
| 62 | operation). Neither is invented; both are shown. |
| 63 | |
| 64 | ## 4. Commands (V1) |
| 65 | |
| 66 | | command | class | backing API | |
| 67 | |---|---|---| |
| 68 | | `help`, `quit`, `bindings`, `clear` | console | visor_console | |
| 69 | | `let x: u64 = 7`, `x + y`, `fn ...` | construction | omega_language_eval_line -> OmegaGraph builders | |
| 70 | | `inspect <x>`, `type <x>`, `id <x>`, `graph <x>` | inspection | visor_semantic | |
| 71 | | `verify <x>` | inspection | visor_verify (existing omega_verify_* only) | |
| 72 | | `machine` | inspection | visor_machine | |
| 73 | | `realize <x> [for current.machine]`, `alternatives`, `compare`, `why`, `cost` | inspection / construction | visor_realization | |
| 74 | | `run <x>` | pure execution | visor_realization_run_pure -> omega_exec_native_f3; refused when `visor_effect_request_classify` says authority is required | |
| 75 | | `evidence <x>` | inspection | visor_evidence over `evidence/` receipts | |
| 76 | | `world` | inspection | visor_world (unattached in the V1 binary; see §6) | |
| 77 | | `effects <x>` | effect request | visor_effect_request (unauthorized request only) | |
| 78 | |
| 79 | Modes: interactive `omega`; `omega --command "<line>"` (repeatable); |
| 80 | `omega --script <file>` (`-` = stdin); `--json` prints one JSON object per |
| 81 | command. JSON is a serialization of the *view*, never canonical bytes. |
| 82 | |
| 83 | Result printed for `x + y` comes from `visor_semantic_eval_u64`, which walks the |
| 84 | canonical apply and calls the existing `omega_eval_pure_binary_uint` with the |
| 85 | opcode/overflow/width read from the OPERATION object. `run` executes the |
| 86 | realization's machine code. Verify V1 (differential) checks the two agree. |
| 87 | |
| 88 | ## 5. Cost and evidence vocabulary |
| 89 | |
| 90 | `predicted` (static model), `estimated` (machine-model latency), `measured` |
| 91 | (from a receipt), `qualified` (measured under a qualification run) are four |
| 92 | separate slots in `VisorCostView`; V1 never fills `measured` or `qualified`. |
| 93 | Evidence scope is reported exactly as the receipt states it (`host`, `qemu`, |
| 94 | `silicon`, `simulated`, or `unknown`); the Visor never upgrades scope. |
| 95 | |
| 96 | ## 5a. Behaviour rules worth knowing |
| 97 | |
| 98 | - `run` argument count fails closed: an apply with N operands takes either no |
| 99 | explicit arguments (operands come from the graph) or exactly N (full override); |
| 100 | a program takes exactly one input. Anything else is an error and nothing runs. |
| 101 | - After `realize <x>`, the `_` binding becomes the new realization (so `cost _`, |
| 102 | `run _`, `evidence _` refer to it). This is intended; `bindings` shows it. |
| 103 | - Only pure binary u64 applies (ADD/SUB/MUL/AND/OR, wrap overflow) and `fn` |
| 104 | programs realize and run in V1. Everything else is refused with a reason. |
| 105 | - `--script` refuses directories and other non-regular files with exit 2; a |
| 106 | character device such as `/dev/null` reads as an empty script (exit 0). |
| 107 | - Blank script lines produce no JSON object; comment lines do. |
| 108 | |
| 109 | ## 6. Known gaps in V1 (non-claims) |
| 110 | |
| 111 | - The `omega` binary does not link the resident runtime, so `world` reports |
| 112 | "no resident World attached". The snapshot API (`visor_world_snapshot`) is built |
| 113 | and tested separately against a real `RxWorld`. Lane 6 found the runtime's |
| 114 | world/caproot/coherent sources are themselves physics-free, so a later version |
| 115 | can attach a live World without a physics checkout. |
| 116 | - Blackwell: `omega_vector`, `omega_blackwell_qmd/encoder/realize` link |
| 117 | physics-free and are in the `omega` binary, so the machine view lists the |
| 118 | GB10 target as declared and linked; `run` on it is always refused |
| 119 | ("requires GPU submit authority; not linked in Visor V1"). |
| 120 | - Language V0 covers explicit-width integers, bool, `let`, pure `+ - * / & |`, |
| 121 | and `fn` bodies of the shape `((x op imm) op imm ...)`. Everything else fails closed. |
| 122 | - No measured or qualified cost is produced by the Visor itself. |
| 123 | - Hardware identity is an assumed canonical profile unless a Physics descriptor was |
| 124 | ingested (never in V1); the machine view says so in `provenance`. |
| 125 | |
| 126 | ## 6a. Findings in existing code (found by the Visor lanes; not fixed here) |
| 127 | |
| 128 | - FIXED by program realization V0 (`spec/program-realization.md`): `omega_program_realize` |
| 129 | was declared in `omega_program.h` but defined nowhere. It now compiles the canonical body; |
| 130 | `realize` goes through it (never through code the program happens to carry). |
| 131 | - FIXED by program realization V0: `omega_synthesize_realization` ignored its program and |
| 132 | always emitted the fixed `f(x) = 3x - 2` schedule. It now compiles the program for the |
| 133 | machine and verifies native execution against the semantic evaluator; the `synth@` |
| 134 | alternatives are that machine-aware realization, still cross-checked against the direct realization. |
| 135 | - FIXED by program identity v2 (`spec/program-identity.md`): `omega_program_compute_id` |
| 136 | did not hash the program body (same name and contract with a different body gave the |
| 137 | same `program_id`, and the language refused the redefinition as an "identity collision"). |
| 138 | The id now binds the canonical semantic body and the contract (not the name); redefining |
| 139 | `fn t` with a different body yields a distinct id and rebinds `t`. The console still |
| 140 | prints the realization id next to the program id. |
| 141 | - `evidence/M19R/c4d87451….json` is hash-named but its name does not match the |
| 142 | SHA-256 of its bytes (observed only, not judged). |
| 143 | - Since main widened capability generations to 64 bits (PR "cap-generation-64", |
| 144 | merged after this work started), `EffectPayload.capability_generation` in |
| 145 | `omega_types.h` is still 32-bit, so an Omega EFFECT object cannot carry a live |
| 146 | capability reference: the runtime root sees every such reference as stale. This |
| 147 | is fail-closed but means the honest effect path is unrepresentable until the |
| 148 | canonical effect format is widened (an identity-changing core change, separate PR). |
| 149 | Resolved by `spec/effect-cap64-migration.md` (effect object version 0x02, |
| 150 | 64-bit generation). |
| 151 | - Both canonical machine builders set `is_physics_authorized=true` with a |
| 152 | constant placeholder seal; the machine view labels it as such. |
| 153 | - Host CPU part numbers (0xd85/0xd87) are not Neoverse-V2; the DGX Spark profile |
| 154 | is chosen from DMI and labelled assumed, never observed. |
| 155 | |
| 156 | ## 7. Qualification |
| 157 | |
| 158 | `tests/visor/qualification/` + `tools/qualify_visor.sh` (shell glue only; every |
| 159 | assertion lives in C tests and `.omega-session` scripts). Run it on a committed |
| 160 | tree: `tools/qualify_visor.sh [--skip-regression] [--no-asan] [out-dir]`. It |
| 161 | rebuilds the Aienux capability library from the commit in `aienos.lock` (as CI |
| 162 | and `tools/effect_cap64_receipt.sh` do) and records its identity (commit, source |
| 163 | tree, lib sha256) in the receipt. Receipts live in `evidence/VISOR/` as |
| 164 | content-addressed JSON, never overwritten; the tool writes only a new receipt and |
| 165 | never edits tracked files (`evidence/VISOR/VISOR_V1_QUALIFICATION.md` is the frozen |
| 166 | summary written by the retired Python glue up to receipt #5): |
| 167 | |
| 168 | | receipt | commit | verdict | note | |
| 169 | |---|---|---|---| |
| 170 | | `12785aab…json` | ec2ec0b | OMEGA_VISOR_V1_FAIL | found `run` arg-count and `--script` directory defects | |
| 171 | | `4de74cf3…json` | d7e8a4c | OMEGA_VISOR_V1_PASS | after the fixes; 69 hostile cases, 0 crashes | |
| 172 | | `98a63b2e…json` | 23feaad | OMEGA_VISOR_V1_PASS | clean tree (`tree_dirty=false`), same counts as receipt #2 | |
| 173 | | `15d6703c…json` | 6627da2 | OMEGA_VISOR_V1_FAIL | pre-fix merge of 64-bit effect generations | |
| 174 | | `632ba16d…json` | 8a7d95e | OMEGA_VISOR_V1_PASS | merged tree, authority test adapted to 64-bit generations | |
| 175 | |
| 176 | Scope of every receipt: host-only, this DGX Spark, no GPU/silicon claim, GPU gate |
| 177 | suites (m12/m15/m17–m19) not run because the Visor does not touch them. Gates: |
| 178 | |
| 179 | ```text |
| 180 | OMEGA_VISOR_SEMANTIC_PASS language golden vectors + semantic inspection tests |
| 181 | OMEGA_VISOR_VERIFY_PASS verify/evidence tests + end-to-end verify script |
| 182 | OMEGA_VISOR_REALIZE_PASS machine/realization tests + realize/cost/run script |
| 183 | OMEGA_VISOR_AUTHORITY_ISOLATION_PASS hostile tests + link check |
| 184 | OMEGA_VISOR_REGRESSION_PASS existing CPU gates unchanged; GPU gates skipped when .spark-quiet exists |
| 185 | OMEGA_VISOR_V1_PASS all of the above, recorded in evidence/VISOR/ |
| 186 | ``` |
| 187 | |
| 188 | ## 8. After V1 (documented, not implemented) |
| 189 | |
| 190 | - **V2** semantic graph visualization, machine topology visualization, realization |
| 191 | overlays, evidence timelines, World generation timeline. Enabled by: every view |
| 192 | has a JSON serializer and stable ids; `visor_world_snapshot` is versioned. |
| 193 | - **V3** Cortex Explorer, J-Space branch explorer, semantic diff across generations, |
| 194 | branch simulation controls. Enabled by: the world snapshot family is designed to |
| 195 | attach J-Space/Cortex views (extension points named in `visor_world.h`). |
| 196 | - **V4** AIEN conversational interface: natural language -> typed Visor requests; |
| 197 | explanations backed by explicit evidence. Enabled by: the console dispatches |
| 198 | structured `VisorCommand`s, so a language model can emit them instead of text. |
| 199 | - **V5** native graphical environment over AIENOS/Omega with no desktop dependency. |
| 200 | Enabled by: no view depends on stdio; all formatters write into caller buffers. |