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

closed derived 234ac8acc2ec786d #387

Imported from GitHub aien-dev/omega-mv#387 (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 6a7a50e98e8e27f138e24feb752832381cb2d96d · Head 95419af1774d936d4cafe11032fa9903cd7f2ef8

Apply it

git checkout -b patch-234ac8acc2ec786d 6a7a50e98e8e27f138e24feb752832381cb2d96d
curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/234ac8acc2ec786d.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
387
95419af1774d936d4cafe11032fa9903cd7f2ef8
{"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":387,"url":"https://github.com/aien-dev/omega-mv/pull/387","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:40Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/.crumb b/.crumb
index fa85f5e71..0361ac69b 100644
--- a/.crumb
+++ b/.crumb
@@ -87,14 +87,14 @@
           "purpose": "Directory spec. Purpose not yet described by a human."
         },
         {
-          "digest": "20df1488b5097b3dd816f33ac66fd6adff4c224bcdfcdb0f1f528c9ba15f8294",
-          "last_commit": "c232f147",
+          "digest": "6f2382aa4a43051c056432af6ef420b1b85ed6988c2f9ca4de373033eccd816b",
+          "last_commit": "1e8614cc",
           "name": "src",
           "purpose": "Directory src. Purpose not yet described by a human."
         },
         {
-          "digest": "4405dd867c07c00ecd36438d84cdc032964cbb602acf0e7879e7d04c1b0f0306",
-          "last_commit": "c232f147",
+          "digest": "3b456bbcc69519f5fface865e59242df8da23d6b11fd457d2e94529e832bdf57",
+          "last_commit": "1e8614cc",
           "name": "tests",
           "purpose": "Directory tests. Purpose not yet described by a human."
         },
@@ -105,15 +105,15 @@
           "purpose": "Directory tools. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:a3e22417aa8a93c54be0f58911a29a344171f57e7b4ea39f27f11d70c1eb512d",
-      "compiled_at": "2026-10-10T07:10:33Z",
+      "children_root": "sha256:a2e005018652233722224251b5d18bacc3fcd968169828c643c9b047960c4ae3",
+      "compiled_at": "2026-10-10T07:24:11Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:70ecff8baceced23db2763990a33f5859bb2af1ddfe20a2b1cdaaf666cc4a34b",
+      "digest": "sha256:c5dffbd9f2e9790e212078a6cf0749c3b0100065a604f162574ac085380d3731",
       "evidence_files": 6829,
       "evidence_root": "sha256:d430e46c9eac00396e5c58c2c8e60eb961500973312cc5eee25cf9d37e75bea2",
       "files": 9236,
-      "generated_at_commit": "8986a9d15f651e2554c9cc18bac5f52f9a682081",
-      "source_tree": "sha256:06912de6ab43af74d37816795507a4a6ea95f61062dffdc261099ced29df4560"
+      "generated_at_commit": "1e8614cc3a570e6e626400147489f669d5fba455",
+      "source_tree": "sha256:b158053e61dcafea03696d2a5b4c576015614ebc648a986c2d95e4d9b9c2ca18"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/src/.crumb b/src/.crumb
index efb50da19..07c953f94 100644
--- a/src/.crumb
+++ b/src/.crumb
@@ -115,8 +115,8 @@
           "purpose": "Directory src/language. Purpose not yet described by a human."
         },
         {
-          "digest": "533a65c9091db1180f3effaad24a9e4e18edb019095fbeee72896842256824ae",
-          "last_commit": "c232f147",
+          "digest": "098b6c8811fb0917f1de003d48b0b25d695e7d7a41418605b55ef44320d91c09",
+          "last_commit": "1e8614cc",
           "name": "osh",
           "purpose": "osh (Omega-native shell, arch#158) lexer unit: layout list, generator, osh_lex.osc, C reference "
         },
@@ -175,15 +175,15 @@
           "purpose": "Directory src/visor. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:929f3977e499383b95697b8580b85402005a7b084fa4a66f66ca0d1052b99118",
-      "compiled_at": "2026-10-10T07:03:49Z",
+      "children_root": "sha256:8a164931ea5b78a8824b25f26ab37eda9672423486f4ed4d4459f8617c3498a2",
+      "compiled_at": "2026-10-10T07:24:11Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:20df1488b5097b3dd816f33ac66fd6adff4c224bcdfcdb0f1f528c9ba15f8294",
+      "digest": "sha256:6f2382aa4a43051c056432af6ef420b1b85ed6988c2f9ca4de373033eccd816b",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 445,
-      "generated_at_commit": "c232f14719faa20164d737af494a368061866e83",
-      "source_tree": "sha256:9372ca100be9726ff75e8f29626894dd76cd26ff38eb838e64d3a5cd9b927fb7"
+      "generated_at_commit": "1e8614cc3a570e6e626400147489f669d5fba455",
+      "source_tree": "sha256:cf056f13995c596df4b36479ab7d95641e43fe84a0fda01e58b6f548f7e85f66"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/src/osh/.crumb b/src/osh/.crumb
index 2beddccb8..77319c7a3 100644
--- a/src/osh/.crumb
+++ b/src/osh/.crumb
@@ -3,21 +3,21 @@
     "generated": {
       "children": [
         {
-          "digest": "38f6dfb3bf8da056fd3463410dccfd45ca6554e2b41879e2d7f3fdf64d7392ad",
-          "last_commit": "c232f147",
+          "digest": "15ce5cb71c0547b717abce36dff3c63c29b6766b23ef806e7935045ca7d603d7",
+          "last_commit": "1e8614cc",
           "name": "host",
           "purpose": "osh Linux host: execution service (request decoder, resolution, builtins, redirections, pipeline"
         }
       ],
-      "children_root": "sha256:806c9878b9234cb364d70ef8ba6abe25df737141697c2bcbeac26e054e7583aa",
-      "compiled_at": "2026-10-10T07:03:49Z",
+      "children_root": "sha256:cf4e92d998888dd79e8eec2ed0e3b1730eea823995e985aada3228620dc4b854",
+      "compiled_at": "2026-10-10T07:24:11Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:533a65c9091db1180f3effaad24a9e4e18edb019095fbeee72896842256824ae",
+      "digest": "sha256:098b6c8811fb0917f1de003d48b0b25d695e7d7a41418605b55ef44320d91c09",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 31,
-      "generated_at_commit": "c232f14719faa20164d737af494a368061866e83",
-      "source_tree": "sha256:3fdf2a33db4e72afbd86eafd246acbb94b27e38bc21c2e63b9e3b0e6523e2cca"
+      "generated_at_commit": "1e8614cc3a570e6e626400147489f669d5fba455",
+      "source_tree": "sha256:0c2a3abb95e2f09be421278a6736067337ddf04e1c37153748ed829aa618af6f"
     }
   },
   "name": "osh",
diff --git a/src/osh/host/.crumb b/src/osh/host/.crumb
index a95935ea4..63044a9a2 100644
--- a/src/osh/host/.crumb
+++ b/src/osh/host/.crumb
@@ -3,14 +3,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-10T07:03:49Z",
+      "compiled_at": "2026-10-10T07:24:11Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:38f6dfb3bf8da056fd3463410dccfd45ca6554e2b41879e2d7f3fdf64d7392ad",
+      "digest": "sha256:15ce5cb71c0547b717abce36dff3c63c29b6766b23ef806e7935045ca7d603d7",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 16,
-      "generated_at_commit": "c232f14719faa20164d737af494a368061866e83",
-      "source_tree": "sha256:c4b1744b1ef3b4033108eb0f9b8939193a5eee3f40e878996d0250d546dfb7de"
+      "generated_at_commit": "1e8614cc3a570e6e626400147489f669d5fba455",
+      "source_tree": "sha256:a9648776cf471738c88903f519845bf1105765646384b6131d8a6ea265f48b91"
     }
   },
   "name": "host",
diff --git a/src/osh/host/osh_host.h b/src/osh/host/osh_host.h
index 4dcffc2eb..bf35c36d2 100644
--- a/src/osh/host/osh_host.h
+++ b/src/osh/host/osh_host.h
@@ -129,6 +129,9 @@ typedef int (*OshEffectHook)(void *ctx, const OshBinding *b, int op, const char
 typedef struct OshSession {
     OshVar *vars;
     size_t nvars, capvars;
+    char **raw_env;              /* imported entries whose name is not an identifier ("A B=1", "1X=2", "BASH_FUNC_f%%=..."):
+                                    never shell variables, but handed verbatim to every child as bash does (#344 RISK-7) */
+    size_t nraw;
     int last_status;             /* $? */
     int fd[3];                   /* the shell's own stdin/stdout/stderr (default 0,1,2); never closed by osh */
     int interactive;             /* nonzero: foreground pipelines take the terminal on tty_fd */
@@ -152,7 +155,7 @@ typedef struct OshSession {
 } OshSession;
 
 /* Fill the variable table from envp (NAME=value strings; entries without '=' or with an invalid name are ignored)
- * and set PWD per POSIX (kept if it names the current directory, else getcwd). All imported variables are exported. */
+ * and set PWD per POSIX (kept if it names the current directory, else getcwd). All imported variables are exported; entries whose name is not an identifier are kept in raw_env for children only. */
 int osh_session_init(OshSession *s, char *const *envp);
 void osh_session_free(OshSession *s);
 const char *osh_var_get(const OshSession *s, const char *name);               /* NULL if unset */
diff --git a/src/osh/host/osh_vars.c b/src/osh/host/osh_vars.c
index 3c9e40045..5aad4504b 100644
--- a/src/osh/host/osh_vars.c
+++ b/src/osh/host/osh_vars.c
@@ -89,6 +89,18 @@ static int pwd_names_cwd(const char *p)
     return p && p[0] == '/' && stat(p, &a) == 0 && stat(".", &b) == 0 && a.st_dev == b.st_dev && a.st_ino == b.st_ino;
 }
 
+/* Keep an imported entry whose name is not an identifier. bash never makes it a variable and never shows it in
+ * `export -p`, yet every child still receives it; dropping it would starve tools that read their own odd entries. */
+static int raw_keep(OshSession *s, const char *entry)
+{
+    char **nr = realloc(s->raw_env, (s->nraw + 1) * sizeof *nr);
+    if (!nr) return -1;
+    s->raw_env = nr;
+    if (!(nr[s->nraw] = strdup(entry))) return -1;
+    s->nraw++;
+    return 0;
+}
+
 int osh_session_init(OshSession *s, char *const *envp)
 {
     memset(s, 0, sizeof *s);
@@ -100,10 +112,12 @@ int osh_session_init(OshSession *s, char *const *envp)
         if (!eq || eq == *envp) continue;
         size_t nl = (size_t)(eq - *envp);
         char name[256];
-        if (nl >= sizeof name) continue;
-        memcpy(name, *envp, nl);
-        name[nl] = 0;
-        if (!osh_name_valid(name)) continue;
+        int ident = nl < sizeof name;
+        if (ident) { memcpy(name, *envp, nl); name[nl] = 0; ident = osh_name_valid(name); }
+        if (!ident) {
+            if (raw_keep(s, *envp)) { osh_session_free(s); return -1; }
+            continue;
+        }
         if (osh_var_export(s, name, eq + 1)) { osh_session_free(s); return -1; }
     }
     if (!pwd_names_cwd(osh_var_get(s, "PWD"))) {
@@ -121,6 +135,10 @@ void osh_session_free(OshSession *s)
     free(s->vars);
     s->vars = NULL;
     s->nvars = s->capvars = 0;
+    for (size_t i = 0; i < s->nraw; i++) free(s->raw_env[i]);
+    free(s->raw_env);
+    s->raw_env = NULL;
+    s->nraw = 0;
 }
 
 void osh_envp_free(char **envp)
@@ -132,7 +150,7 @@ void osh_envp_free(char **envp)
 
 char **osh_build_envp(const OshSession *s, const OshAssign *ov, int nov)
 {
-    char **e = calloc(s->nvars + (size_t)nov + 1, sizeof *e);
+    char **e = calloc(s->nvars + s->nraw + (size_t)nov + 1, sizeof *e);
     if (!e) return NULL;
     size_t n = 0;
     for (size_t i = 0; i < s->nvars; i++) {
@@ -146,6 +164,10 @@ char **osh_build_envp(const OshSession *s, const OshAssign *ov, int nov)
         memcpy(str + nl + 1, v->value, vl + 1);
         e[n++] = str;
     }
+    for (size_t i = 0; i < s->nraw; i++) { /* verbatim; their names are not identifiers so no override can match them */
+        if (!(e[n] = strdup(s->raw_env[i]))) { osh_envp_free(e); return NULL; }
+        n++;
+    }
     for (int k = 0; k < nov; k++) {
         size_t nl = strlen(ov[k].name), vl = strlen(ov[k].value);
         char *str = malloc(nl + vl + 2);
diff --git a/tests/.crumb b/tests/.crumb
index 641e0dbe5..ea1b687a5 100644
--- a/tests/.crumb
+++ b/tests/.crumb
@@ -199,8 +199,8 @@
           "purpose": "Simulated M16 driver for numeric resource-lifecycle tests. No device execution or numeric parity"
         },
         {
-          "digest": "cfe2153fbe174096ed94d42ab23fe87a7a0587913166d0ea3fe8636c26f6aaa3",
-          "last_commit": "c232f147",
+          "digest": "15237aba0370ba7eb3befdb23addbcf9ecfbd47f7d7e4a518eadb0ebda39f33a",
+          "last_commit": "1e8614cc",
           "name": "osh",
           "purpose": "osh lexer host driver, vendored aien-protocols PR#16 draft vectors (5ae5292)"
         },
@@ -289,15 +289,15 @@
           "purpose": "Directory tests/visor. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:cfe7652a1025666e2b3abc661c0dd027a504e6b9b3bf009186deca93ed177095",
-      "compiled_at": "2026-10-10T07:03:49Z",
+      "children_root": "sha256:5e321e0cf0a6dd0324553624f8b148c7f827729f83b3a272f5c24fbb88ec0edc",
+      "compiled_at": "2026-10-10T07:24:11Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:4405dd867c07c00ecd36438d84cdc032964cbb602acf0e7879e7d04c1b0f0306",
+      "digest": "sha256:3b456bbcc69519f5fface865e59242df8da23d6b11fd457d2e94529e832bdf57",
       "evidence_files": 11,
       "evidence_root": "sha256:d5c1bceb4d57ef0eb42797c58801b5926509711614c3e38bb7105b6efa3942f2",
       "files": 948,
-      "generated_at_commit": "c232f14719faa20164d737af494a368061866e83",
-      "source_tree": "sha256:17ae5796613d62944c9feba7d19078ccdf76aa1c165b29e324d68433e0f0e31a"
+      "generated_at_commit": "1e8614cc3a570e6e626400147489f669d5fba455",
+      "source_tree": "sha256:b745c2ce00fcfcf01f5d7d882e5060946f0ff34d1694f46c5036d2015bafa6b2"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/tests/osh/.crumb b/tests/osh/.crumb
index 5d6664f6b..820b1d698 100644
--- a/tests/osh/.crumb
+++ b/tests/osh/.crumb
@@ -9,8 +9,8 @@
           "purpose": "end-to-end tests of the osh program: argprint helper plus a runner comparing native and OSH_INTE"
         },
         {
-          "digest": "8cafcafd34533ed60a6372202a13b33e562488f7c39a92e9a6739888dda2ecb2",
-          "last_commit": "c232f147",
+          "digest": "4e96eafa5d50a39c3bab64ba958c0f72df2172644e5bb022a1e43409dc36a149",
+          "last_commit": "1e8614cc",
           "name": "host",
           "purpose": "tests for the osh Linux host adapter execution service (hand-built request records, helper-mode "
         },
@@ -21,15 +21,15 @@
           "purpose": "Core-only step traces of the osh shell units over fixture scripts (OSH-AIENOS-0 differential fix"
         }
       ],
-      "children_root": "sha256:5c1280781d81ea21dd8624affb5a98559ef526f34e8b2e3408de11457d5e3364",
-      "compiled_at": "2026-10-10T07:03:49Z",
+      "children_root": "sha256:ff0187ef47106b27e7a54d87c9b5a643faddd20c5733f8c052e96712f973fa01",
+      "compiled_at": "2026-10-10T07:24:11Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:cfe2153fbe174096ed94d42ab23fe87a7a0587913166d0ea3fe8636c26f6aaa3",
+      "digest": "sha256:15237aba0370ba7eb3befdb23addbcf9ecfbd47f7d7e4a518eadb0ebda39f33a",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 93,
-      "generated_at_commit": "c232f14719faa20164d737af494a368061866e83",
-      "source_tree": "sha256:627213beac2cb555eff2b8555b6cdefa8f1c7146ac399c7b6210230de3b1dc82"
+      "generated_at_commit": "1e8614cc3a570e6e626400147489f669d5fba455",
+      "source_tree": "sha256:abfe52976d5e38390e59d12e50b30be34c8deeba14bfa31bf7c60dfb47be8e42"
     }
   },
   "name": "osh-tests",
diff --git a/tests/osh/host/.crumb b/tests/osh/host/.crumb
index 2f015347f..02d6f4905 100644
--- a/tests/osh/host/.crumb
+++ b/tests/osh/host/.crumb
@@ -3,14 +3,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-10T07:03:49Z",
+      "compiled_at": "2026-10-10T07:24:11Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:8cafcafd34533ed60a6372202a13b33e562488f7c39a92e9a6739888dda2ecb2",
+      "digest": "sha256:4e96eafa5d50a39c3bab64ba958c0f72df2172644e5bb022a1e43409dc36a149",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 3,
-      "generated_at_commit": "c232f14719faa20164d737af494a368061866e83",
-      "source_tree": "sha256:eb592378cb5f1792745dad3c1e4007ac2432c2ec8b39ad0c79b76e049591ebf9"
+      "generated_at_commit": "1e8614cc3a570e6e626400147489f669d5fba455",
+      "source_tree": "sha256:05bb9f92feb9134e74b7727ddaf110a6357d7cb139a636788217c8ad727a088b"
     }
   },
   "name": "host-tests",
diff --git a/tests/osh/host/test_osh_host.c b/tests/osh/host/test_osh_host.c
index a5667bf29..96a4e3d2f 100644
--- a/tests/osh/host/test_osh_host.c
+++ b/tests/osh/host/test_osh_host.c
@@ -187,11 +187,8 @@ static int count_fds(void)
     return n - 1; /* the DIR itself */
 }
 
-static void t_begin(T *t, const char *path)
+static void t_begin_env(T *t, const char *path, char *const *env)
 {
-    extern char **environ;
-    char *env[] = {"HOME=/nonexistent-home", "LANG=C", NULL};
-    (void)environ;
     osh_session_init(&t->s, env);
     osh_var_export(&t->s, "PATH", path);
     snprintf(t->op, sizeof t->op, "%s/cap.out", g_tmp);
@@ -205,6 +202,12 @@ static void t_begin(T *t, const char *path)
     t->s.binding.cap_generation = 1;
 }
 
+static void t_begin(T *t, const char *path)
+{
+    char *env[] = {"HOME=/nonexistent-home", "LANG=C", NULL};
+    t_begin_env(t, path, env);
+}
+
 static void t_end(T *t)
 {
     close(t->ofd);
@@ -1349,19 +1352,44 @@ static void test_direct_equals_record(void)
     t_end(&t);
 }
 
+/* bash 5.2: `env 'A B=1' bash -c env` still shows "A B=1"; the entry is not a variable but every child gets it (#344 RISK-7) */
+static void test_raw_env(void)
+{
+    T t; OshBuilder *b; OshResult r;
+    char *env[] = {"HOME=/nonexistent-home", "LANG=C", "A B=1", "1X=2", NULL};
+    t_begin_env(&t, "/usr/bin:/bin", env);
+    b = nb(0, 0);
+    helper(b, "env", "A B", NULL);
+    go(&t, b, &r);
+    char *o = t_out(&t);
+    CHECK(strcmp(o, "1\n") == 0, "child sees A B=1 (got %s)", o);
+    free(o);
+    t_clear(&t);
+    b = nb(0, 0);
+    helper(b, "env", "1X", NULL);
+    go(&t, b, &r);
+    o = t_out(&t);
+    CHECK(strcmp(o, "2\n") == 0, "child sees 1X=2 (got %s)", o);
+    free(o);
+    CHECK(osh_var_get(&t.s, "A B") == NULL && osh_var_get(&t.s, "1X") == NULL, "not shell variables");
+    t_end(&t);
+}
+
 static void test_session_env(void)
 {
     OshSession s;
-    char *env[] = {"A=1", "B=two=2", "=bad", "NOEQ", "9x=1", "C=", NULL};
+    char *env[] = {"A=1", "B=two=2", "=bad", "NOEQ", "9x=1", "C=", "A B=1", "BASH_FUNC_f%%=() {  echo hi; }", NULL};
     CHECK(osh_session_init(&s, env) == 0, "init");
     CHECK(strcmp(osh_var_get(&s, "A"), "1") == 0 && strcmp(osh_var_get(&s, "B"), "two=2") == 0 && osh_var_get(&s, "C") && !*osh_var_get(&s, "C"), "imported");
-    CHECK(osh_var_get(&s, "NOEQ") == NULL && osh_var_get(&s, "9x") == NULL, "malformed entries ignored");
+    CHECK(osh_var_get(&s, "NOEQ") == NULL && osh_var_get(&s, "9x") == NULL && osh_var_get(&s, "A B") == NULL, "malformed entries are not variables");
     CHECK(osh_var_get(&s, "PWD") != NULL, "PWD set");
     OshAssign ov[2] = {{"A", "9"}, {"Z", "z"}};
     char **e = osh_build_envp(&s, ov, 2);
-    int a = 0, z = 0, n = 0;
-    for (char **p = e; *p; p++) { n++; a += !strcmp(*p, "A=9"); z += !strcmp(*p, "Z=z"); }
-    CHECK(a == 1 && z == 1 && n == 5, "fresh envp with override (n=%d)", n);
+    int a = 0, z = 0, n = 0, raw = 0;
+    for (char **p = e; *p; p++) { n++; a += !strcmp(*p, "A=9"); z += !strcmp(*p, "Z=z");
+        raw += !strcmp(*p, "9x=1") + !strcmp(*p, "A B=1") + !strcmp(*p, "BASH_FUNC_f%%=() {  echo hi; }"); }
+    CHECK(a == 1 && z == 1 && n == 8, "fresh envp with override (n=%d)", n);
+    CHECK(raw == 3, "non-identifier entries reach children verbatim, as bash does (%d/3)", raw);
     osh_envp_free(e);
     CHECK(osh_var_set(&s, "bad name", "x") < 0 && osh_var_export(&s, "", NULL) < 0, "invalid names refused");
     osh_var_set(&s, "U", "u");
@@ -2061,7 +2089,7 @@ int main(int argc, char **argv)
 
     if (argc > 2 && !strcmp(argv[1], "--only")) { g_only_set = 1; g_only = argv[2]; }
     alarm(300); /* watchdog: a hang must fail the run, not stall it */
-    if (want("env")) test_session_env();
+    if (want("env")) { test_session_env(); test_raw_env(); }
     if (want("simple")) test_simple_and_path();
     if (want("builtins")) test_builtins();
     if (want("printf")) { test_printf(); test_printf_review(); }