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#226 (code only)

closed derived 80f382fccfafdfc9 #226

Imported from GitHub aien-dev/omega-mv#226 (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 4ccaf558e6e061775398e242b1b35a08c8dce365 · Head 6447d9c4c14773f8bdef4960594351de9a8c7492

Apply it

git checkout -b patch-80f382fccfafdfc9 4ccaf558e6e061775398e242b1b35a08c8dce365
curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/80f382fccfafdfc9.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
226
6447d9c4c14773f8bdef4960594351de9a8c7492
{"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":226,"url":"https://github.com/aien-dev/omega-mv/pull/226","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:51Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 9d16d08d1..ad5f4b9c8 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -5,6 +5,7 @@ Every model below did real work. A model is listed only for work it did. The orc
 
 | Model | What it did |
 |---|---|
+| Codex | BUILD receipt cleanliness enforcement and optional diagnostic pointer regression fixes |
 | Claude Opus 5.5 | Numeric GB10 operations (LDS_STS, REDUCE_SUM), the independent CPU oracle, the Gate 5 qualifier and its receipts, and the fixes from review |
 | Codex (GPT-6.1 Sol) | Code review of the numeric changes (patch checks, receipt blobs, GPU lock handling) |
 | Gemini 3.8 Flash | Code review of the numeric changes (patch checks, qualifier script, build rules) |
diff --git a/Makefile b/Makefile
index 8272bfabb..eeadc8c53 100644
--- a/Makefile
+++ b/Makefile
@@ -1852,6 +1852,7 @@ test-resolve: tests/test_omega_resolve.c $(OUT_DIR)/compiler/oscv $(RESOLVE_SRC)
 	  build_mutant lock-order-sorted        lock-order             resolve lock-refuses-unsorted                        '        if (n > 0 && strcmp(ents[n - 1].name, en.name) == 0) {'; \
 	  build_mutant missing-receipt          missing-receipt        resolve refuse-missing-receipt                       '    if (fr != 0) return fail(err, OMEGA_RES_UNVERIFIED_DEPENDENCY, 0, sid, "receipt unavailable");'; \
 	  build_mutant rule1-name               rule1-name             resolve refuse-receipt-file-holds-another-receipt    '    if (0) {'; \
+	  build_mutant rule-clean               rule-clean             resolve refuse-dirty-receipt-in-build                '    if (0) {'; \
 	  build_mutant rule4-semantic           rule4-semantic         resolve refuse-receipt-does-not-name-program         '    if (0) {'; \
 	  build_mutant rule4-source             rule4-source           resolve refuse-stale-receipt                         '        if (0) {'; \
 	  build_mutant rule3                    rule3                  resolve refuse-receipt-output-digest-is-not-evidence-root '    if (0) {'; \
@@ -1902,4 +1903,4 @@ test-resolve: tests/test_omega_resolve.c $(OUT_DIR)/compiler/oscv $(RESOLVE_SRC)
 	  build_mutant prod-authority-trim      prod-authority         receipt  receipt-refuses-production-blank-authority       '        if (b == 0) { ef(&e, "receipt: PRODUCTION receipts require an authority reference%s", ""); goto done; }'; \
 	  build_mutant prod-spelling            prod-spelling          receipt  receipt-refuses-production-test-only-authority   '        int bad = strstr(low, "test-only") || strstr(low, "testonly");'; \
 	  build_mutant prod-bad-refused         prod-bad-refused       receipt  receipt-refuses-production-test-only-authority   '        if (bad && 0) { ef(&e, "receipt: a TEST_ONLY signer cannot produce a PRODUCTION receipt%s", ""); goto done; }'
-	@echo "test-resolve: PASS (all checks, ASan/UBSan clean, all 64 mutants killed)"
+	@echo "test-resolve: PASS (all checks, ASan/UBSan clean, all 65 mutants killed)"
diff --git a/src/omega_resolve.c b/src/omega_resolve.c
index adcd36c8b..a18ed3b1b 100644
--- a/src/omega_resolve.c
+++ b/src/omega_resolve.c
@@ -301,6 +301,12 @@ int omega_resolve_check_record_receipt(const OmegaResolver *r, const OmegaVcView
         rc = fail(err, OMEGA_RES_RECEIPT_HASH_MISMATCH, 0, sid, "the file stored under receipt %s holds another receipt", rid);
         goto done;
     }
+    /* A digest authenticates receipt bytes, not a clean source checkout.
+     * DEV may inspect this evidence, but its output remains tainted. */
+    if (r->domain == OMEGA_DOMAIN_BUILD && rcpt.dirty) { /* VC1R:rule-clean */
+        rc = fail(err, OMEGA_RES_UNVERIFIED_DEPENDENCY, 0, sid, "receipt %s was produced from a dirty checkout", rid);
+        goto done;
+    }
     /* rule 4: the receipt names this program (semantic id), then this source (digest) */
     snprintf(want, sizeof want, "sha256:%s", sid);
     if (!has_artifact(&rcpt, want)) { /* VC1R:rule4-semantic */
@@ -480,7 +486,7 @@ static int resolve_node(Walk *w, const uint8_t id[32], const uint8_t *lock_recei
         }
     if (rec->admission_kind == OMEGA_VCS_ADMISSION_VERIFIED) { /* VC1R:verified-needs-receipt */
         rc = omega_resolve_check_record_receipt(r, vc, w->err);
-        if (rc) { if (name) snprintf(w->err->subject, sizeof w->err->subject, "%s", name); goto out; }
+        if (rc) { if (name && w->err) snprintf(w->err->subject, sizeof w->err->subject, "%s", name); goto out; }
     }
     if (w->n == w->cap) {
         size_t nc = w->cap ? w->cap * 2 : 16;
diff --git a/src/omega_resolve.h b/src/omega_resolve.h
index 1dc6843bf..8c6b5e325 100644
--- a/src/omega_resolve.h
+++ b/src/omega_resolve.h
@@ -142,7 +142,9 @@ int omega_resolve_imports(const OmegaResolver *r, const OmegaLock *lock, const c
 
 /* SPEC 5.1 for one record: the receipt named by vc->receipt_id against profile, semantic id,
  * source digest, evidence root and the receipt ids of the record's dependencies (read from the
- * store). Steps 5 and 6 of the chain; exported for the admit path and tests. */
+ * store). BUILD also requires a clean-checkout receipt; DEV may inspect dirty
+ * evidence, with the normal DEV output taint. Steps 5 and 6 of the chain;
+ * exported for the admit path and tests. */
 int omega_resolve_check_record_receipt(const OmegaResolver *r, const OmegaVcView *vc, OmegaResolveError *err);
 
 /* ---- the one door into the store ---- */
diff --git a/tests/test_omega_resolve.c b/tests/test_omega_resolve.c
index efb280b22..d41dbdb11 100644
--- a/tests/test_omega_resolve.c
+++ b/tests/test_omega_resolve.c
@@ -103,7 +103,7 @@ typedef struct {
     const char *inputs[4]; int n_in;
     const char *deps[4]; int n_dep;
     char root[65];
-    int assert_pass, extra_key, dup_key, lease, no_assertion;
+    int assert_pass, extra_key, dup_key, lease, no_assertion, dirty;
     const char *authority;
 } RJ;
 static void rj_default(RJ *j) {
@@ -122,7 +122,7 @@ static char *rj_emit(const RJ *j, const char *idhex, size_t *len) {
     if (j->dup_key) PF("\"kind\": \"%s\",\n", j->kind);
     if (j->extra_key) PF("\"surprise\": 1,\n");
     PF("\"tier\": \"%s\",\n\"result\": \"%s\",\n\"timestamp\": 1786000000,\n", j->tier, j->result);
-    PF("\"repo\": \"fixture\",\n\"commit\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n\"dirty\": false,\n");
+    PF("\"repo\": \"fixture\",\n\"commit\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n\"dirty\": %s,\n", j->dirty ? "true" : "false");
     PF("\"toolchain\": \"fixture\",\n\"procedure\": \"%s\",\n\"machine\": \"host\",\n\"env_class\": \"%s\",\n", j->procedure, j->env_class ? j->env_class : j->tier);
     PF("\"input_artifacts\": [");
     for (int i = 0; i < j->n_in; i++) PF("%s\"%s\"", i ? ", " : "", j->inputs[i]);
@@ -203,7 +203,7 @@ static void w_free(W *w) {
 
 typedef struct {
     const char *prof, *ver, *tier, *result;
-    int assert_fail, skip_sid, stale_src, wrong_root, extra_rdep, wrong_kind, no_store, swap, taint, boot, lease;
+    int assert_fail, skip_sid, stale_src, wrong_root, extra_rdep, wrong_kind, no_store, swap, taint, boot, lease, dirty;
 } Opt;
 static Opt opt0(void) {
     Opt o; memset(&o, 0, sizeof o);
@@ -250,6 +250,7 @@ static int add_comp(W *w, uint8_t b0, const uint8_t (*deps)[32], uint32_t nd, co
     hx(root, root_h);
     RJ j; rj_default(&j);
     j.kind = o->wrong_kind ? "some-other-kind" : o->prof;
+    j.dirty = o->dirty;
     j.tier = o->tier; j.result = o->result; j.assert_pass = !o->assert_fail; j.lease = o->lease;
     memcpy(j.root, root_h, 65);
     if (!o->skip_sid) { snprintf(inp[j.n_in], 80, "sha256:%s", sid_h); j.inputs[j.n_in] = inp[j.n_in]; j.n_in++; }
@@ -689,6 +690,18 @@ static void t_refusals(void) {
     check("resolve-accepts-verified-record", r.rc == 0 && r.h.resolved && r.h.closure.n == 1 && r.h.n_imports == 1);
     run_free(&r); w_free(&w);
 
+    o = opt0(); o.dirty = 1;
+    one_foo(&o, OMEGA_DOMAIN_BUILD, &r, &w);
+    check("refuse-dirty-receipt-in-build", refused(&r, "UNVERIFIED_DEPENDENCY", OMEGA_RES_UNVERIFIED_DEPENDENCY));
+    run_free(&r); w_free(&w);
+    one_foo(&o, OMEGA_DOMAIN_DEV, &r, &w);
+    check("allow-dirty-receipt-in-dev", r.rc == 0);
+    { uint8_t ir[32]; OmegaArtifactMeta meta;
+      check("dirty-dev-ir-digest", ir_of(&r, ir) == 0);
+      omega_artifact_meta_make(&meta, OMEGA_DOMAIN_DEV, ir, r.h.closure.digest);
+      check("dirty-dev-output-remains-tainted", meta.tainted == 1); }
+    run_free(&r); w_free(&w);
+
     /* UNVERIFIED_DEPENDENCY: the pinned id is not in the store */
     w_init(&w);
     { Opt a = opt0(); add_comp(&w, 0x51, NULL, 0, &a); }
@@ -701,6 +714,10 @@ static void t_refusals(void) {
     o = opt0(); o.no_store = 1;
     one_foo(&o, OMEGA_DOMAIN_BUILD, &r, &w);
     check("refuse-missing-receipt", refused(&r, "MISSING_RECEIPT", OMEGA_RES_MISSING_RECEIPT));
+    { const char *names[] = { "foo" }; OmegaClosure out = {0};
+      int rc = omega_resolve_imports(&r.h.resolver, &r.lock, names, 1, &out, NULL);
+      check("missing-receipt-null-error-safe", rc == OMEGA_RES_MISSING_RECEIPT && out.n == 0);
+      omega_closure_free(&out); }
     run_free(&r); w_free(&w);
 
     /* RECEIPT_HASH_MISMATCH, one cause per check */
@@ -1493,6 +1510,7 @@ static const struct { const char *mutant, *check; } MUTANTS[] = {
     { "lock-order-sorted", "lock-refuses-unsorted" },
     { "missing-receipt", "refuse-missing-receipt" },
     { "rule1-name", "refuse-receipt-file-holds-another-receipt" },
+    { "rule-clean", "refuse-dirty-receipt-in-build" },
     { "rule4-semantic", "refuse-receipt-does-not-name-program" },
     { "rule4-source", "refuse-stale-receipt" },
     { "rule3", "refuse-receipt-output-digest-is-not-evidence-root" },