interplane.Get Omega
Read in your language

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

GitHub aien-dev/omega-mv#498 (code only)

closed derived 2f079488b197ef0b #498

Imported from GitHub aien-dev/omega-mv#498 (code only)

GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed).

Base a8ffd2b912c84197d08f963b05f9c7d8b30a3f8a · Head aa563a7dcb22a4f51fe8ac80259eb2e800377fd8

github-advanced-security[bot] commented on tests/visor/test_visor_evidence.c line 31 on 2026-10-16 20:49 UTC

CodeQL / File created without restricting permissions

A file may be created here with mode 0666, which would make it world-writable.

Show more details

github-advanced-security[bot] commented on tests/visor/test_visor_evidence.c line 39 on 2026-10-16 20:49 UTC

CodeQL / File created without restricting permissions

A file may be created here with mode 0666, which would make it world-writable.

Show more details

github-advanced-security[bot] reviewed (COMMENTED) on 2026-10-16 20:49 UTC

Apply it

git checkout -b patch-2f079488b197ef0b a8ffd2b912c84197d08f963b05f9c7d8b30a3f8a
curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/2f079488b197ef0b.patch | git am

Raw patch (mbox) · Diff

Provenance

This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record:

github-import 1
aien-dev/omega-mv
498
aa563a7dcb22a4f51fe8ac80259eb2e800377fd8
{"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":498,"url":"https://github.com/aien-dev/omega-mv/pull/498","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:38:04Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/.crumb b/.crumb
index d121d2dad..c258bf59f 100644
--- a/.crumb
+++ b/.crumb
@@ -77,14 +77,14 @@
           "purpose": "Directory spec. Purpose not yet described by a human."
         },
         {
-          "digest": "dfa36de2ac8649f66f80587abea51a7f166285ee0b92e0e09774c98689055250",
-          "last_commit": "333091a6",
+          "digest": "4d1619bd07e6fdafe11d48112d97d0be335f8ea0763840d0bf45b8f160089cd1",
+          "last_commit": "31e40e29",
           "name": "src",
           "purpose": "Directory src. Purpose not yet described by a human."
         },
         {
-          "digest": "4eb9d4d76234448c0ed691f0aeb9c90d785f8a47b1b1291d728bbe3e1509dc10",
-          "last_commit": "88e24bdd",
+          "digest": "c4113b29ad47df8d7ec7c7a0621157f231556c7b5a0162176a7ad3b801921521",
+          "last_commit": "31e40e29",
           "name": "tests",
           "purpose": "Directory tests. Purpose not yet described by a human."
         },
@@ -95,15 +95,15 @@
           "purpose": "Directory tools. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:e1a8c008214ad5dbc33a3e184d7e882dc56d1d50f9bd14c58f8773992961557e",
-      "compiled_at": "2026-10-18T21:10:38Z",
+      "children_root": "sha256:37452287603d1a9238d36859d990971f19ea9b0c0c0053554b3e971dbb6173b9",
+      "compiled_at": "2026-10-19T21:58:31Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:be7220db494238bb4c33023d1df17286c35f947336bee5fc2e0405c136ec3e73",
+      "digest": "sha256:86d891636318f04192cd7f2078ff533ba782a84b08721901c0a3f5a73a249d23",
       "evidence_files": 11127,
       "evidence_root": "sha256:4528085ec1661c442b64fb5dc8def65067ea2620ff88e42bcf52d58b7642ea6e",
       "files": 14100,
-      "generated_at_commit": "f4a9849fb127f8d2d664dfc56890752ad180c507",
-      "source_tree": "sha256:21f93defce6c9ba159a4bd31083db787e156dfaa4afb80c3427cf88f732f8258"
+      "generated_at_commit": "fb164a31b935bcbbb07b02f5fe3e77d77fc98c29",
+      "source_tree": "sha256:9c51d1106bf44b22e321996a12e2946bff2c6cfb4f81817b0a61b53df0a0884a"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/src/.crumb b/src/.crumb
index 4fe5298a4..1126fe04e 100644
--- a/src/.crumb
+++ b/src/.crumb
@@ -175,21 +175,21 @@
           "purpose": "Directory src/turing. Purpose not yet described by a human."
         },
         {
-          "digest": "daf5e5e90c1ccb4c089220a6545844dbe4078a233f1777e8145b74f1bf5dd5fe",
-          "last_commit": "40d1ea37",
+          "digest": "11575b0cfcbad20d6128d1b5c18a4bd691877ad970fba9f03b0df5665e3fb75f",
+          "last_commit": "3aaa2d87",
           "name": "visor",
           "purpose": "Directory src/visor. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:15012a017b26a269feb256b64875ece2912f5f82c57804baafa3777c4fcb80b9",
-      "compiled_at": "2026-10-16T07:33:43Z",
+      "children_root": "sha256:459a64f0de44cf81c971f79b917135b3979209dff1dc93842a816d413291ba41",
+      "compiled_at": "2026-10-17T00:22:30Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:dfa36de2ac8649f66f80587abea51a7f166285ee0b92e0e09774c98689055250",
+      "digest": "sha256:4d1619bd07e6fdafe11d48112d97d0be335f8ea0763840d0bf45b8f160089cd1",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 537,
-      "generated_at_commit": "1d481ab853a14d3c11eff926ce1e25993085f76a",
-      "source_tree": "sha256:200c9243151691313acb5f86d3e9cb3058f1a1b92ece2a255b3340b691dfb894"
+      "generated_at_commit": "3aaa2d879f6592bdd6fa31823820879a4fed48f0",
+      "source_tree": "sha256:5c72e774499a3fa7045f479f6a6c2f634c34029c547b45d7d42b33342bbe7e5e"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/src/visor/.crumb b/src/visor/.crumb
index d94290b61..2cd4a3cdb 100644
--- a/src/visor/.crumb
+++ b/src/visor/.crumb
@@ -14,20 +14,20 @@
       "children": [
         {
           "digest": "698c7acaafd2fdfc36c30117f7cda86aaacb21a3333d6a6f737a3bed1c990761",
-          "last_commit": "a56d21c",
+          "last_commit": "a56d21c1",
           "name": "rx",
           "purpose": "Directory src/visor/rx. Purpose not yet described by a human."
         }
       ],
       "children_root": "sha256:426a1b15679ed802080b03079613c322df3821181536f0f66596d50c63a2f7cb",
-      "compiled_at": "2026-10-04T13:47:05Z",
+      "compiled_at": "2026-10-17T00:22:30Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:daf5e5e90c1ccb4c089220a6545844dbe4078a233f1777e8145b74f1bf5dd5fe",
+      "digest": "sha256:11575b0cfcbad20d6128d1b5c18a4bd691877ad970fba9f03b0df5665e3fb75f",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 21,
-      "generated_at_commit": "834ee93e4314a42c1127a2fcda8b29cf3b511245",
-      "source_tree": "sha256:a1963f6ba709fb4f1c6175371d26b0f5a8de6d51809035b7320204c2908c2d08"
+      "generated_at_commit": "3aaa2d879f6592bdd6fa31823820879a4fed48f0",
+      "source_tree": "sha256:083843b6110f98e7c70f75dc2a6e584bca081b1f239cc717210f6cd64ee9fbf9"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/src/visor/visor_evidence.c b/src/visor/visor_evidence.c
index 609aa7071..77bfe94ba 100644
--- a/src/visor/visor_evidence.c
+++ b/src/visor/visor_evidence.c
@@ -441,11 +441,29 @@ int visor_evidence_load(const char *path, VisorEvidenceRecord *out) {
 /* ------------------------------------------------------------------ */
 /* Directory walk (sorted, deterministic)                              */
 /* ------------------------------------------------------------------ */
-#define VISOR_EVIDENCE_MAX_FILES 1024
-static char g_paths[VISOR_EVIDENCE_MAX_FILES][256];
-static size_t g_npaths;
+/* omega#404: the walk keeps every regular file (it used to stop at 1024 in readdir order, so with a large evidence/
+ * tree the verdict depended on the filesystem). The list grows on the heap and is sorted after the walk, so the
+ * result is the same for any directory order. VISOR_EVIDENCE_MAX_FILES is only a runaway guard far above any real
+ * tree (11078 files at 2026-10-16); reaching it, or failing to grow the list, marks the view truncated. */
+#define VISOR_EVIDENCE_MAX_FILES (1u << 20)
+typedef char VisorPath[256];
+static VisorPath *g_paths;
+static size_t g_npaths, g_paths_cap;
 static bool g_paths_overflow;
 
+static bool push_path(const char *p) {
+    if (g_npaths >= VISOR_EVIDENCE_MAX_FILES) return false;
+    if (g_npaths == g_paths_cap) {
+        size_t cap = g_paths_cap ? g_paths_cap * 2 : 1024;
+        VisorPath *grown = realloc(g_paths, cap * sizeof(VisorPath));
+        if (!grown) return false;
+        g_paths = grown;
+        g_paths_cap = cap;
+    }
+    memcpy(g_paths[g_npaths++], p, sizeof(VisorPath));
+    return true;
+}
+
 static void walk(const char *dir, int depth) {
     if (depth > 8) return;
     DIR *d = opendir(dir);
@@ -460,8 +478,7 @@ static void walk(const char *dir, int depth) {
         if (lstat(p, &st) != 0) continue;
         if (S_ISDIR(st.st_mode)) { walk(p, depth + 1); continue; }
         if (!S_ISREG(st.st_mode)) continue;               /* symlinks and devices are not followed */
-        if (g_npaths >= VISOR_EVIDENCE_MAX_FILES) { g_paths_overflow = true; continue; }
-        memcpy(g_paths[g_npaths++], p, sizeof(p));
+        if (!push_path(p)) g_paths_overflow = true;
     }
     closedir(d);
 }
@@ -474,7 +491,7 @@ static int collect(const char *root) {
     g_npaths = 0;
     g_paths_overflow = false;
     walk(root, 0);
-    qsort(g_paths, g_npaths, sizeof(g_paths[0]), cmp_path);
+    if (g_npaths > 1) qsort(g_paths, g_npaths, sizeof(g_paths[0]), cmp_path);
     return 0;
 }
 
diff --git a/tests/.crumb b/tests/.crumb
index bd5535a8b..267f7ad60 100644
--- a/tests/.crumb
+++ b/tests/.crumb
@@ -289,21 +289,21 @@
           "purpose": "Directory tests/turing. Purpose not yet described by a human."
         },
         {
-          "digest": "3f19e3034ff999211cb13ab8995ca6c38d0d8e1f5bfbbbd621caaa08412d3f1f",
-          "last_commit": "fed4f077",
+          "digest": "a4bd83d8b29b76464c0ac4be84bd12097b14d1164dfd84b63acf57cc2a6d1ab0",
+          "last_commit": "3aaa2d87",
           "name": "visor",
           "purpose": "Directory tests/visor. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:ddc3618190458bc5073e3bee67ffccc68a2ee9f065f2cb0d86545386a29fddf8",
-      "compiled_at": "2026-10-16T19:04:20Z",
+      "children_root": "sha256:8adf0860a95f0d00a607bd48c82c6a7eb4909820fbb481576bc94dafe7c4e4e1",
+      "compiled_at": "2026-10-17T00:22:30Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:4eb9d4d76234448c0ed691f0aeb9c90d785f8a47b1b1291d728bbe3e1509dc10",
+      "digest": "sha256:c4113b29ad47df8d7ec7c7a0621157f231556c7b5a0162176a7ad3b801921521",
       "evidence_files": 16,
       "evidence_root": "sha256:96d08097822ad95f4e562c19e0ba5df5a035774c48632f1832912c40a27bd27a",
       "files": 1270,
-      "generated_at_commit": "88e24bdd57b27817d030d0ad95f62c3f3eacf426",
-      "source_tree": "sha256:e6c4f0021d383ba2e59da0d85d06a0b98170f6d188289c891b5745200548e6fc"
+      "generated_at_commit": "3aaa2d879f6592bdd6fa31823820879a4fed48f0",
+      "source_tree": "sha256:4bffd8b03c31ee596df2b355d9ef56a62701ae2b21c2f86e9864829843725f28"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/tests/gates/run.sh b/tests/gates/run.sh
index 6c5c918d5..972cf95a0 100755
--- a/tests/gates/run.sh
+++ b/tests/gates/run.sh
@@ -171,7 +171,10 @@ case "$step" in
     grep -q '^OMEGA_EFFECT_CAP64_PASS$' build/effect-cap64.log
     receipt omega_state_projection_receipt.json '"failures": 0,' '"candidate_bound": true,' '"OMEGA_STATE_PROJECTION_PASS": "PASS"'
     receipt rx_action_graph_receipt.json '"failures": 0,' '"candidate_bound": true,' '"OMEGA_ACTION_GRAPH_IR_PASS": "PASS"'
-    receipt omega_incremental_semantics_receipt.json '"OMEGA_INCREMENTAL_SEMANTICS_PASS": "HOST_PASS_ENERGY_UNMEASURED"' '"false_hits": 0,'
+    # omega#404 ruling: PASS (energy meter present, e.g. aien_spbm hwmon on the Spark) and HOST_PASS_ENERGY_UNMEASURED
+    # (no meter, the hosted runner) both pass; which one is recorded as an observation. PASS_UNBOUND and FAIL do not.
+    receipt omega_incremental_semantics_receipt.json '"OMEGA_INCREMENTAL_SEMANTICS_PASS": "\(PASS\|HOST_PASS_ENERGY_UNMEASURED\)"' '"false_hits": 0,'
+    obs incremental_semantics_verdict "$(grep -o '"OMEGA_INCREMENTAL_SEMANTICS_PASS": "[A-Z_]*"' "$(find build/qual-runs -name omega_incremental_semantics_receipt.json -type f -newer "$STEP_MARK" | head -n 1)" | sed 's/.*: //')"
     receipt rx_capability_query_receipt.json '"failures": 0,' '"candidate_bound": true,' '"OMEGA_CAPABILITY_QUERY_PASS": "PASS"'
     receipt rx_semantic_comm_receipt.json '"failures": 0,' '"candidate_bound": true,' '"OMEGA_SEMANTIC_COMMUNICATION_PASS": "PASS"'
     receipt rx_cognitive_routing_receipt.json '"failures": 0,' '"candidate_bound": true,' '"OMEGA_COGNITIVE_ROUTING_PASS": "PASS"'
diff --git a/tests/visor/.crumb b/tests/visor/.crumb
index da6a0aabf..f606bc1ed 100644
--- a/tests/visor/.crumb
+++ b/tests/visor/.crumb
@@ -22,26 +22,26 @@
       "children": [
         {
           "digest": "5ada929bcb152309d4e3cbcf5dc197eab94972fd64efca8b471046a3a89ab6cd",
-          "last_commit": "59c24b2",
+          "last_commit": "59c24b22",
           "name": "qualification",
           "purpose": "Directory tests/visor/qualification. Purpose not yet described by a human."
         },
         {
           "digest": "19402f2edf2008cb5b961c4a369f9b962d18ebe2076a102b0e30aba7f6cda306",
-          "last_commit": "aa78c3f",
+          "last_commit": "aa78c3f2",
           "name": "sessions",
           "purpose": "Directory tests/visor/sessions. Purpose not yet described by a human."
         }
       ],
       "children_root": "sha256:0703c3283bea47ee0bfc6c0bbd8ec55bacd2487c17e31d0d80d1fb90aa592bb5",
-      "compiled_at": "2026-10-04T13:47:05Z",
+      "compiled_at": "2026-10-17T00:22:30Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:3f19e3034ff999211cb13ab8995ca6c38d0d8e1f5bfbbbd621caaa08412d3f1f",
+      "digest": "sha256:a4bd83d8b29b76464c0ac4be84bd12097b14d1164dfd84b63acf57cc2a6d1ab0",
       "evidence_files": 8,
       "evidence_root": "sha256:a2c4aaddc14ed3b6aae059061c23683b4ccf0562046ec883b40f14014fbce670",
       "files": 33,
-      "generated_at_commit": "834ee93e4314a42c1127a2fcda8b29cf3b511245",
-      "source_tree": "sha256:faf6defc59051772c110d364658a03690cfb8928749e63a3935e164b0b524598"
+      "generated_at_commit": "3aaa2d879f6592bdd6fa31823820879a4fed48f0",
+      "source_tree": "sha256:db8f9440816d8e121bff76dd2dbaf741ed70f5700d6d820f0a3dd4b66b3fd750"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/tests/visor/test_visor_evidence.c b/tests/visor/test_visor_evidence.c
index 90dbb320d..e5ec261ce 100644
--- a/tests/visor/test_visor_evidence.c
+++ b/tests/visor/test_visor_evidence.c
@@ -1,7 +1,10 @@
 /* Lane 4: visor_evidence tests (fixtures + read-only pass over the real evidence/ tree).
  * Run from the repo root. Prints "PASS n/n" on success. */
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 #include "omega_canonical.h"
 #include "visor_evidence.h"
@@ -14,6 +17,36 @@ static int g_total, g_pass;
 static VisorEvidenceView v, v2;
 static char txt_a[65536], txt_b[65536], js[65536];
 
+/* omega#404: a tree larger than the old 1024-file walk cap. 1500 non-JSON files plus one parseable receipt named to
+ * sort last: every file must be scanned, the receipt must be found, and nothing is truncated, whatever order the
+ * filesystem returns. The old walk stopped at 1024 files in readdir order (red: scanned 1024, truncated). */
+static void check_large_tree(void) {
+    char root[] = "/tmp/visor_evidence_large_XXXXXX";
+    if (!mkdtemp(root)) { CHECK(0, "large tree: mkdtemp"); return; }
+    char p[512];
+    enum { NFILES = 1500 };
+    int made = 0;
+    for (int i = 0; i < NFILES; ++i) {
+        snprintf(p, sizeof p, "%s/f%04d.txt", root, i);
+        FILE *f = fopen(p, "w");
+        if (f) { fputs("not a receipt\n", f); fclose(f); made++; }
+    }
+    static char buf[65536];
+    size_t n = 0;
+    FILE *src = fopen(FIX "/HOST/host_run_receipt.json", "rb");
+    if (src) { n = fread(buf, 1, sizeof buf, src); fclose(src); }
+    snprintf(p, sizeof p, "%s/zzz_last_receipt.json", root);
+    FILE *dst = fopen(p, "wb");
+    if (dst) { fwrite(buf, 1, n, dst); fclose(dst); }
+    CHECK(made == NFILES && n > 0 && dst, "large tree built (1500 files + 1 receipt)");
+    CHECK(visor_evidence_scan(root, &v) == 0 && v.scanned == NFILES + 1 && v.matched == 1 && v.count == 1 &&
+          v.unparsed == NFILES && !v.truncated, "large tree: every file scanned, receipt found, not truncated");
+    CHECK(v.count == 1 && strstr(v.items[0].path, "zzz_last_receipt.json"), "large tree: the last-sorted receipt is the match");
+    for (int i = 0; i < NFILES; ++i) { snprintf(p, sizeof p, "%s/f%04d.txt", root, i); unlink(p); }
+    snprintf(p, sizeof p, "%s/zzz_last_receipt.json", root); unlink(p);
+    rmdir(root);
+}
+
 static const VisorEvidenceRecord *find(const VisorEvidenceView *view, const char *suffix) {
     size_t L = strlen(suffix);
     for (size_t i = 0; i < view->count; ++i) {
@@ -99,6 +132,8 @@ int main(void) {
     CHECK(visor_evidence_format_json(&v, js, sizeof(js)) > 0 && js[0] == '{' && strstr(js, "\"scope\":\"QEMU\""), "json");
     CHECK(visor_evidence_format_text(&v, txt_b, 32) == -1, "truncation fails closed");
 
+    check_large_tree();
+
     /* --- real evidence/ tree, read-only: format coverage and no upgrade --- */
     if (visor_evidence_scan("evidence", &v) == 0) {
         CHECK(v.scanned >= 70 && v.count == VISOR_EVIDENCE_MAX_ITEMS && v.truncated && v.matched >= 50,