interplane.Get Omega
Read in your language

aien-architecture-mv

Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.

Brought by drakestapleton

GitHub aien-dev/aien-architecture-mv#208 (code only)

closed derived e059a46a8e18b474 #208

Imported from GitHub aien-dev/aien-architecture-mv#208 (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 f05541b28506a3c3b6858c6d5e5181c4cc83bcf7 · Head ee4b992da20011415d3cec4e4f7bf67c6a1694a8

Apply it

git checkout -b patch-e059a46a8e18b474 f05541b28506a3c3b6858c6d5e5181c4cc83bcf7
curl -fsSL https://interplane.io/drakestapleton/aien-architecture-mv/patches/e059a46a8e18b474.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/aien-architecture-mv
208
ee4b992da20011415d3cec4e4f7bf67c6a1694a8
{"kind":"github-import","owner":"aien-dev","repo":"aien-architecture-mv","number":208,"url":"https://github.com/aien-dev/aien-architecture-mv/pull/208","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:56Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/.crumb b/.crumb
index 3ac66f1..5711be6 100644
--- a/.crumb
+++ b/.crumb
@@ -21,8 +21,8 @@
     "generated": {
       "children": [
         {
-          "digest": "76d78c1ebc7b2c7a0e0f289131d6631e32fbbcce8bdf40b6d8fd3057eb2b2ada",
-          "last_commit": "ac67623",
+          "digest": "70d9230285c422ca3110af8ff0a7577dbd3bd8998bfa1e88aff2e3f9d1699897",
+          "last_commit": "57b62d3",
           "name": "docs",
           "purpose": "Directory docs. Purpose not yet described by a human."
         },
@@ -33,27 +33,27 @@
           "purpose": "Directory doctrine. Purpose not yet described by a human."
         },
         {
-          "digest": "8f2e6f212505e3a91f4fe12dba0fdf26c1fdb66a6c4ef126ebca921552f3404b",
-          "last_commit": "0f11240",
+          "digest": "49cbeb77d72e03b36387a66b0c379073bc64cd12a4b7487be91f4810f4e89147",
+          "last_commit": "0e5e0cc",
           "name": "scripts",
           "purpose": "Directory scripts. Purpose not yet described by a human."
         },
         {
-          "digest": "ec76c5bf9076b78f83c172599f929ae8eee117d11ad90bf6bb94f59d25652984",
-          "last_commit": "8566870",
+          "digest": "c23d700ed9187da8eb0363e6a06ddda1449809cbf02b0a7857c83d0a92e349e8",
+          "last_commit": "57b62d3",
           "name": "tools",
           "purpose": "Directory tools. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:3baeb3360304121620f2db6f0e337822a614b644315839e3ed8e640a113bb441",
-      "compiled_at": "2026-10-11T16:21:36Z",
+      "children_root": "sha256:fd2b7a2ce273f9b7c5f60221b3ad6c57d7fd05b49fa70d3ef582d12194c92972",
+      "compiled_at": "2026-10-11T16:36:23Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:db6a94eb3320495d39e09806bc846ab32fce1973a0f81533e6fae9d90a39761c",
+      "digest": "sha256:38922d4b46900ea276424f661a9905e35e617b1f3037828c89660c7f559b0b22",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 294,
-      "generated_at_commit": "0f11240583a8f5fd1ac5eab047fb42bc6e0258d7",
-      "source_tree": "sha256:445b0c95ddfa3b18b82a2095ba2f2509133074308702f427624cce689d3a3817"
+      "generated_at_commit": "0e5e0cc616a8752a0e424f6db7c2d65a38b240e5",
+      "source_tree": "sha256:79ee3afdebe6279d7f9fffc7d7b8bd351035815dab4ffb264a999e157ed69040"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/docs/.crumb b/docs/.crumb
index b30d76e..4b3059e 100644
--- a/docs/.crumb
+++ b/docs/.crumb
@@ -38,13 +38,19 @@
       "children": [
         {
           "digest": "a267b4219ee3550bc8832fd07fdcb0baf36cf13f3e447356012e99898d2af8d0",
-          "last_commit": "591629d",
+          "last_commit": "f05541b",
           "name": "adr",
           "purpose": "Directory docs/adr. Purpose not yet described by a human."
         },
+        {
+          "digest": "b762355cfafd4b2071ede1f4d9034b02578f53d3437fc57aeba82008dca5604d",
+          "last_commit": "38c7cc2",
+          "name": "archive/plans",
+          "purpose": "Directory docs/archive/plans. Purpose not yet described by a human."
+        },
         {
           "digest": "3a652cbe470a451d15b8891b99f92c1637e218296e409c37d7bbb7bec210c13d",
-          "last_commit": "ac67623",
+          "last_commit": "f05541b",
           "name": "crumbs",
           "purpose": "Directory docs/crumbs. Purpose not yet described by a human."
         },
@@ -73,15 +79,15 @@
           "purpose": "Directory docs/specs. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:af89e4891ec6af220ce9db6f1a2a6920b0b8d59f427dddceee1a281ee3deecea",
-      "compiled_at": "2026-10-11T16:21:36Z",
+      "children_root": "sha256:ca7f28baffe004ea406f1f505489759f6557abfeaa8327aa4d170e18b2e8dbb8",
+      "compiled_at": "2026-10-11T16:34:02Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:76d78c1ebc7b2c7a0e0f289131d6631e32fbbcce8bdf40b6d8fd3057eb2b2ada",
+      "digest": "sha256:70d9230285c422ca3110af8ff0a7577dbd3bd8998bfa1e88aff2e3f9d1699897",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 169,
-      "generated_at_commit": "0f11240583a8f5fd1ac5eab047fb42bc6e0258d7",
-      "source_tree": "sha256:b1ef5f8680403d83b130efc01ee6d872b8ed86a3cd942ca27ff3e45f2151c509"
+      "generated_at_commit": "57b62d3b7dc34a59451de3b3cf9611bd4672106c",
+      "source_tree": "sha256:5bcacfab9c92a3afbc077736d508a9d5506928e021bc972c4f59e00aa42ad9fa"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/docs/CRUMB_PROTOCOL_RFC_0003.md b/docs/CRUMB_PROTOCOL_RFC_0003.md
index 575272e..27e52b4 100644
--- a/docs/CRUMB_PROTOCOL_RFC_0003.md
+++ b/docs/CRUMB_PROTOCOL_RFC_0003.md
@@ -19,7 +19,7 @@ Until now people and agents wrote the descriptions in crumbs by hand, and they w
 
 ## 2. Generated block
 
-`extensions.generated` holds: `compiler` (`crumb-compile/1`), `source_tree` (sha256 of the sorted `blob path` lines of tracked files below the directory), `files` (count), `children` (one entry per immediate child directory that has a `.crumb`: `name`, `digest`, first 96 characters of its `purpose`, `last_commit`), `children_root`, `evidence_files`, `evidence_root`, `digest`, plus two stamps that are not inputs: `generated_at_commit` and `compiled_at`. Master crumbs (any crumb with children) are therefore generated summaries of their children: an agent reads one file and descends only where relevant.
+`extensions.generated` holds: `compiler` (`crumb-compile/1`), `source_tree` (sha256 of the sorted `blob path` lines of tracked files below the directory), `files` (count), `children` (one entry per NEAREST crumbed descendant directory, found by walking down through directories that hold no `.crumb`: `name` (path relative to this directory, e.g. `archive/plans`), `digest`, first 96 characters of its `purpose`, `last_commit`), `children_root`, `evidence_files`, `evidence_root`, `digest`, plus two stamps that are not inputs: `generated_at_commit` and `compiled_at`. Master crumbs (any crumb with children) are therefore generated summaries of their children: an agent reads one file and descends only where relevant.
 
 ## 3. Merkle rule
 
@@ -36,7 +36,7 @@ Until now people and agents wrote the descriptions in crumbs by hand, and they w
 | D4 | Bottom-up order, deepest first. | A parent's `children[]` must hold final child digests. |
 | D5 | The compiler never writes the semantic kernel; `propose` writes only `extensions.proposed`. | An LLM description must not silently become architectural truth. |
 | D6 | `last_commit` per child ignores `.crumb` files (`':!**/.crumb'`). | Compile commits would count as changes to the code. |
-| D7 | Only directories that already hold a `.crumb` take part; `crumb seed` decides membership. | One mechanism for membership, not two. Hidden child directories are not listed as children. |
+| D7 | Only directories that already hold a `.crumb` take part; `crumb seed` decides membership. Children are the nearest crumbed descendants: the walk descends through directories without a `.crumb` (amended 2026-10-11). | One mechanism for membership, not two. Before the amendment only immediate children were listed, so a `.crumb` under an uncrumbed directory was outside the root digest and its deletion was invisible to `verify` and `pr-gate.sh` (lane CRUMB proof 19 b2, aien-architecture#207). Now every compiled crumb is reachable from the root; the walk uses the same traversal policy as `find_crumbs` (D10 and build-directory exclusions, no symlinks), so a crumb inside a hidden directory is listed too. |
 | D8 | Evidence is tracked files whose path has a component named `evidence` or `receipts`, or ending `.receipt.json`; `evidence_root` hashes their blob ids in path order. | Receipts become part of the fingerprint, so a changed receipt shows up as STALE. |
 | D9 | Output is key-sorted JSON, written to a temporary file then renamed, byte-stable. | `verify` can be an exact comparison. |
 | D10 | A directory listed in `<root>/.crumbignore` (one relative directory per line, the same file `crumb seed` reads) is excluded with its whole subtree from compile, verify and status: no `.crumb` under it is read as a child or rewritten. Its tracked files still count toward the enclosing crumb's `source_tree` and `evidence_root`. Added 2026-10-04 for the rollout to omega, aienos and physics. | Trees guarded by immutability checks (omega `evidence/`, which holds a seeded `.crumb`; physics `nvrm` and `m16`) would otherwise be rewritten by compile and fail their own CI. The shell reference does not implement D10; the differential holds for repositories without a `.crumbignore`. |
diff --git a/scripts/.crumb b/scripts/.crumb
index ad7bc1b..9ba9c77 100644
--- a/scripts/.crumb
+++ b/scripts/.crumb
@@ -7,21 +7,21 @@
     "generated": {
       "children": [
         {
-          "digest": "803c3893ebea96968f39a514b54b58a574f5903ebe185b43e8ddfa938b30f7ea",
-          "last_commit": "0f11240",
+          "digest": "43d90e632cf726c80edde33297f9c52a1ae5e58f1d2e797a43e6b1fa7fe7080f",
+          "last_commit": "0e5e0cc",
           "name": "pipeline-proofs",
           "purpose": "Acceptance proofs 13-21 of the sovereign local pipeline (ADR 0033 amendment 2026-10-11): bash sc"
         }
       ],
-      "children_root": "sha256:5b89009b153faa0ea23cc00ff6bf572bca83be6bb6e42022d2b9a78329821c2b",
-      "compiled_at": "2026-10-11T16:21:36Z",
+      "children_root": "sha256:1013d9a0bda894cf988bba1f83569460bb169b4c635a6abec93601721d5fa0cb",
+      "compiled_at": "2026-10-11T16:36:23Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:8f2e6f212505e3a91f4fe12dba0fdf26c1fdb66a6c4ef126ebca921552f3404b",
+      "digest": "sha256:49cbeb77d72e03b36387a66b0c379073bc64cd12a4b7487be91f4810f4e89147",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 24,
-      "generated_at_commit": "0f11240583a8f5fd1ac5eab047fb42bc6e0258d7",
-      "source_tree": "sha256:598aeac1da97e689fbd74dd05e8a52b4d33d731a1027fcf19d7df7265bc149e0"
+      "generated_at_commit": "0e5e0cc616a8752a0e424f6db7c2d65a38b240e5",
+      "source_tree": "sha256:1a59a734ac4e380a284361d129708bcfecb503556f0b58db459bae8ebe78a4a9"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/scripts/pipeline-proofs/.crumb b/scripts/pipeline-proofs/.crumb
index 8ca0fe5..e4005e6 100644
--- a/scripts/pipeline-proofs/.crumb
+++ b/scripts/pipeline-proofs/.crumb
@@ -3,14 +3,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-11T16:21:36Z",
+      "compiled_at": "2026-10-11T16:36:23Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:803c3893ebea96968f39a514b54b58a574f5903ebe185b43e8ddfa938b30f7ea",
+      "digest": "sha256:43d90e632cf726c80edde33297f9c52a1ae5e58f1d2e797a43e6b1fa7fe7080f",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 13,
-      "generated_at_commit": "0f11240583a8f5fd1ac5eab047fb42bc6e0258d7",
-      "source_tree": "sha256:bb4f0993b5fd3d7a41509a45f3c2517b79e449cec8486ebcca4aec418b1b1c98"
+      "generated_at_commit": "0e5e0cc616a8752a0e424f6db7c2d65a38b240e5",
+      "source_tree": "sha256:cd8e02afd50bd8a4e8be88daf83c23303ebfa3316092033cf81af05f26135363"
     }
   },
   "layer": "tooling",
diff --git a/scripts/pipeline-proofs/19-pr-gate-refuses-stale.sh b/scripts/pipeline-proofs/19-pr-gate-refuses-stale.sh
index c387ead..e01b4a0 100755
--- a/scripts/pipeline-proofs/19-pr-gate-refuses-stale.sh
+++ b/scripts/pipeline-proofs/19-pr-gate-refuses-stale.sh
@@ -42,11 +42,11 @@ check_eq "stale tree: pr-gate exits 1" "$RC" 1
 check "stale tree: stops at GATE crumb: FAIL" grep -q '^GATE crumb: FAIL crumb verify did not print OK' <<<"$OUT"
 note "$(grep '^GATE crumb' <<<"$OUT" | cut -c1-110)"
 
-# (b) missing: a .crumb deleted. RFC-0003 D7 digests only IMMEDIATE children, so a deletion is visible to
-# `crumb verify` only when the deleted crumb's parent directory itself holds a crumb.
-#   (b1) parent holds a crumb (immediate child): must be refused.
-#   (b2) parent holds no crumb (deep leaf under uncrumbed directories): today's tool cannot see it; recorded as a
-#        FAILED assertion with the exact limit, not fixed here (lane CRUMB brief: record, do not fix silently).
+# (b) missing: a .crumb deleted. RFC-0003 D7 (amended 2026-10-11): children[] holds the NEAREST crumbed descendants,
+# so every .crumb is reachable from the root digest and any deletion must be refused.
+#   (b1) parent holds a crumb (immediate child).
+#   (b2) parent holds no crumb (deep leaf under uncrumbed directories): the orphan case that was invisible before the
+#        amendment (recorded as FAILED in the first run of 2026-10-11, fixed in tools/crumb/crumb.c the same day).
 IMM=""; DEEP=""
 for d in $(crumb_dirs "$W" | grep -v '^\.$'); do
   p=${d%/*}; [ "$p" = "$d" ] && p=.
@@ -62,11 +62,8 @@ if [ -n "$DEEP" ]; then
   branch missing-deep; git -C "$W" rm -q "$DEEP/.crumb"; git -C "$W" commit -qm "delete $DEEP/.crumb"
   SHA=$(push missing-deep); fx deep missing-deep "$SHA"
   export CASE=deep; measure gate_missing_deep "$GATE" proof-repo 1 --worktree "$W" --dry-run
-  if [ "$RC" -eq 1 ] && grep -q '^GATE crumb: FAIL' <<<"$OUT"; then echo "  ok   missing deep crumb refused"
-  else
-    echo "  FAIL RECORDED LIMIT: deleting $DEEP/.crumb is invisible to crumb verify (RFC-0003 D7 digests immediate children only; its parent ${DEEP%/*} has no .crumb); pr-gate rc=$RC"
-    FAILS=$((FAILS+1))
-  fi
+  check_eq "missing deep crumb (orphan, parent ${DEEP%/*} has no .crumb): pr-gate exits 1" "$RC" 1
+  check "missing deep crumb: stops at GATE crumb: FAIL" grep -q '^GATE crumb: FAIL' <<<"$OUT"
 else
   note "no deep crumb without a crumbed parent in this repository; (b2) not applicable"
 fi
diff --git a/scripts/pipeline-proofs/RESULTS-2026-10-11.md b/scripts/pipeline-proofs/RESULTS-2026-10-11.md
index a849276..3136010 100644
--- a/scripts/pipeline-proofs/RESULTS-2026-10-11.md
+++ b/scripts/pipeline-proofs/RESULTS-2026-10-11.md
@@ -1,52 +1,81 @@
 # Acceptance proofs 13-21: measured results, 2026-10-11 (lane CRUMB)
 
-Machine: DGX Spark GB10, 20 cores, load 0.3 to 2.8 during the runs (another agent's cargo build was active part of the time).
-Tool: `~/.local/bin/crumb` built from `tools/crumb/crumb.c` at aien-architecture `7fe8e26` (no change to the tool in this lane).
-Repositories: aien-architecture at `7fe8e26` (27 crumbs, 307 tracked files) and aien-sovereign-core main at `5ef7720` (16 crumbs, 3797 tracked files).
-Every proof ran on a temporary `git clone`; nothing in either checkout was modified. Times are wall-clock milliseconds of one run (`date +%s%3N` around the command), not averages.
+Two runs on the same day. Run 2 (follow-up, orphan crumbs) is current; run 1 is kept below as the record of the limit it found.
 
-## Verdicts
+## Run 2: after the D7 amendment (children = nearest crumbed descendants)
 
-| Proof | aien-architecture | aien-sovereign-core | Property |
+Machine: DGX Spark GB10, 20 cores. Tool: `tools/crumb/crumb` built from `crumb.c` at aien-architecture `57b62d3` (branch `pipeline/crumb-orphan`), on PATH ahead of `~/.local/bin/crumb`.
+Repositories: aien-architecture at `f2e6b0b` (28 crumbs, 323 tracked files; this branch, crumbs compiled with the new rule) and aien-sovereign-core main `c26f4d7` re-crumbed locally with the new rule in one crumb-only commit (`~/workspace/pipeline/tmp-sc`, 16 crumbs, 3797 tracked files).
+Every proof ran on a temporary `git clone`; times are wall-clock milliseconds of one run, not averages. `run-all.sh`: arch proven=9 failed=0 not_applicable=1; sc proven=10 failed=0.
+
+| Proof | aien-architecture | aien-sovereign-core | Numbers |
+|---|---|---|---|
+| 13 determinism | PROVEN | PROVEN | frozen clock, two compiles from nothing: 28/28 and 16/16 `.crumb` byte-identical; real clock: identical minus `compiled_at` 28/28, 16/16, digests 28/28, 16/16 |
+| 14 fixed point | PROVEN | PROVEN | compile at HEAD rewrites 0; from nothing 28 (16) then 0; porcelain empty after the crumb commit |
+| 15 stale set | PROVEN | PROVEN | one file change: 5 of 28 (`docs/plans/mixed-algebra/research` chain), 2 of 16 (`crates/aien-scheduler/src/bin` + root); compile rewrites exactly that set |
+| 16 siblings | PROVEN | PROVEN | 23 of 28 and 14 of 16 CURRENT; two subtrees stale exactly the union of the chains |
+| 17 claims | PROVEN | PROVEN | second worktree's claim exits 2 (`BLOCKED ... held by agent-A`); claim 26/39 ms, refusal 14/14 ms, close 22/23 ms |
+| 18 crumb-only build | not applicable (no Cargo) | PROVEN | after a `.crumb`-only commit `cargo build -v --locked --offline`: Compiling 0, Dirty 0, Fresh 444, 212 ms (warm-up 13525 ms; target dir `pipeline/target-cold`, kept) |
+| 19 admission | PROVEN | PROVEN | `pr-gate.sh` refuses: STALE tree (`FAIL: 5 of 28` / `2 of 16 crumbs stale`), deleted immediate-child crumb (`docs/.crumb`, `crates/aien-cli/src/.crumb`), **deleted orphan crumb** (`docs/archive/plans/.crumb`, parent `docs/archive` uncrumbed, 212 ms; `crates/aien-allen-memory/.crumb`, parent `crates` uncrumbed, 409 ms), mixed last commit; passes the compiled control (271 / 447 ms) |
+| 20 rebase-crumb | PROVEN | PROVEN | local bare origin, crumb-only conflict in the root `.crumb`: exit 0, source kept, main's change present, verify OK, last commit crumb-only (2 / 1 files), pushed with lease; 536 / 865 ms |
+| 21 final SHA | PROVEN | PROVEN | pre-crumb SHA verify exits 1 (5 of 28, 2 of 16 stale); separate crumb commit: SHA differs, verify exits 0; re-checked in fresh worktrees |
+
+### The fix (tools/crumb/crumb.c, `57b62d3`)
+`comp_object` collects a crumb's children by walking down through directories that hold no `.crumb` (`collect_kids`, same traversal policy as `find_crumbs`: `.crumbignore`, build-directory and symlink exclusions), so `children[]` holds the NEAREST crumbed descendants and every compiled crumb is reachable from the root digest. A deep child is named by its path relative to the parent crumb directory (`archive/plans`). The shell reference `crumb-compile.sh` follows the same rule; `tools/crumb/test.sh` gained 10 assertions for the orphan case (117 before, 127 now, all PASS, differential against the shell reference on this repository included). RFC-0003 section 2 and D7 are amended in `docs/CRUMB_PROTOCOL_RFC_0003.md`.
+
+### Crumb churn of the new rule (`crumb status` with the new tool on trees compiled with the old one)
+| Repository | commit | crumbs | rewritten by the new rule |
 |---|---|---|---|
-| 13 determinism | PROVEN | PROVEN | 27/27 and 16/16 `.crumb` files byte-identical after two compiles from nothing under a frozen clock; under the real clock one second apart, identical apart from `compiled_at` (digests 27/27, 16/16 identical) |
-| 14 fixed point | PROVEN | PROVEN | compile at HEAD rewrites 0; from nothing: first compile 27 (16) rewritten, second 0, bytes unchanged, `git status --porcelain` empty after the crumb commit |
-| 15 stale set | PROVEN | PROVEN | one file change stales exactly the directory, its crumbed ancestors and the root: 5 of 27 (`docs/plans/mixed-algebra/research` chain), 2 of 16 (`crates/aien-scheduler/src/bin` + root); compile rewrites exactly that set |
-| 16 siblings | PROVEN | PROVEN | 22 of 27 and 14 of 16 crumbs CURRENT; every STALE crumb is in the chain; two changes in different subtrees stale exactly the union of the two chains |
-| 17 claims | PROVEN | PROVEN | second agent's claim on the same target from a linked worktree exits 2 (`BLOCKED ... held by agent-A`); other target succeeds; after close the target is claimable |
-| 18 crumb-only build | not applicable (no Cargo) | PROVEN | after a `.crumb`-only commit `cargo build -v --locked --offline` reports Compiling 0, Dirty 0, Fresh 444 (target dir `pipeline/target-cold`, 27G before, 29G after, not deleted) |
-| 19 admission | PARTIAL (see limit) | PARTIAL (see limit) | `pr-gate.sh` refuses a STALE tree (`GATE crumb: FAIL ... 5 of 27 / 2 of 16 crumbs stale`), refuses a deleted immediate-child crumb (`docs/.crumb`, `crates/aien-cli/src/.crumb`), refuses a mixed last commit, passes the compiled control. FAILED sub-case: a deleted crumb whose parent directory holds no crumb is invisible (below) |
-| 20 rebase-crumb | PROVEN | PROVEN | local bare origin, crumb-only conflict in the root `.crumb`: exit 0, feat's source change kept, main's change present, `crumb verify` OK, last commit touches only `.crumb` (2 and 1 files), pushed with lease |
-| 21 final SHA | PROVEN | PROVEN | pre-crumb SHA: verify exits 1 (5 of 27, 2 of 16 stale); after the separate crumb commit the SHA differs and verify exits 0; re-checked in fresh worktrees of both SHAs |
-
-### Recorded limit (proof 19, sub-case b2), not fixed in this lane
-RFC-0003 section 2 and D7: a parent's `children[]` lists only immediate child directories that hold a `.crumb`. A committed `.crumb` whose parent directory has no `.crumb` (aien-architecture: `docs/archive/plans/.crumb`, parent `docs/archive`; sovereign-core: `crates/aien-allen-memory/.crumb`, parent `crates`) is therefore not reachable from the root digest. Deleting it leaves every remaining crumb CURRENT, `crumb verify` prints OK and `pr-gate.sh` passes the crumb gate (measured: pr-gate exit 0 in both repositories). The STALE rule for changed files is unaffected (the files still count toward the nearest crumbed ancestor's `source_tree`); only crumb membership below an uncrumbed directory is unguarded. Candidates for the fix, to be decided by the orchestrator, not here: make `children[]` the nearest crumbed descendants (skip uncrumbed directories), or have `crumb seed` always crumb the intermediate directories, or add a `crumb verify` membership check against `git ls-files '**/.crumb'`.
-
-## Timings (ms, one run each)
-
-| Operation | aien-architecture (27 crumbs) | sovereign-core (16 crumbs, 3797 files) |
+| aien-architecture | `f05541b` (main) | 28 | 2 (`docs`, `.`) |
+| aien-sovereign-core | `c26f4d7` (main) | 16 | 1 (`.`) |
+| omega | `82f3117` (main, shallow clone) | 154 | 10 |
+| aienos | `3b2004b` (main, shallow clone) | 91 | 8 |
+| physics | `8b23e5a` (main, shallow clone) | 30 | 3 |
+| aien-protocols | `055c4f1` (main, shallow clone) | 34 | 0 |
+
+Each affected repository needs one crumb-only `crumb compile` commit when it moves to a crumb tool built from this change (omega, aienos and physics pin the tool to an aien-architecture commit in `crumb.lock`, so nothing breaks at merge time; sovereign-core has no `crumb.lock` and uses the tool on PATH). The old rule and the new rule agree on every crumb that has no orphan descendant, so a repository with 0 rewritten (aien-protocols) needs nothing.
+
+### Timings, run 2 (ms, one run each)
+
+| Operation | aien-architecture (28 crumbs) | sovereign-core (16 crumbs, 3797 files) |
 |---|---|---|
-| `crumb compile .` at HEAD (0 rewritten) | 184 | 345 |
-| `crumb compile .` from nothing (all rewritten) | 198 | 317 |
-| `crumb verify .` | 160 | 347 |
-| `crumb status .` | 186 | 329 |
-| `crumb context .` | 198 | 308 |
-| `crumb context <deepest file>` | 214 | 337 |
-| `crumb claim` (first, uncontested) | 33 | 46 |
-| `crumb claim` refused (exit 2) | 14 | 16 |
-| `crumb close` | 21 | 23 |
-| `crumb sniff` | 15 | 18 |
-| `scripts/pr-gate.sh --dry-run --worktree` (fake gh, real crumb) | 207 to 266 | 372 to 431 |
-| `scripts/rebase-crumb.sh` (local bare origin, crumb conflict) | 501 | 811 |
-| `cargo build` warm-up on the clone (target-cold) | n/a | 12950 |
-| `cargo build -v` no change / after crumb-only commit | n/a | 217 / 223 |
-
-Regenerated versus unchanged: from nothing 27/27 and 16/16 regenerated; one leaf change regenerates 5 of 27 and 2 of 16, the rest unchanged; rebase onto a moved main regenerated 2 and 1.
-
-## crumb.gate template validation
+| `crumb compile .` at HEAD (0 rewritten) | 200 | 387 |
+| `crumb compile .` from nothing (all rewritten) | 217 | 362 |
+| `crumb verify .` | 187 | 370 |
+| `crumb status .` | 207 | 387 |
+| `crumb context .` | 210 | 396 |
+| `crumb context <deepest file>` | 225 | 354 |
+| `crumb claim` (first, uncontested) | 26 | 39 |
+| `crumb claim` refused (exit 2) | 14 | 14 |
+| `crumb close` | 22 | 23 |
+| `scripts/pr-gate.sh --dry-run --worktree` (fake gh, real crumb) | 212 to 271 | 392 to 453 |
+| `scripts/rebase-crumb.sh` (local bare origin, crumb conflict) | 536 | 865 |
+| `cargo build -v` no change / after crumb-only commit | n/a | 205 / 212 |
+
+Regenerated versus unchanged: from nothing 28/28 and 16/16; one leaf change 5 of 28 and 2 of 16; rebase onto a moved main 2 and 1. The walk through uncrumbed directories costs nothing measurable (compile at HEAD 184 -> 200 ms on arch, 345 -> 387 ms on sc, within the run-to-run spread seen in run 1).
+
+## Run 1: before the amendment (tool at `7fe8e26`), kept as the record
+
+Repositories: aien-architecture at `7fe8e26` (27 crumbs, 307 tracked files) and aien-sovereign-core main at `5ef7720` (16 crumbs). Load 0.3 to 2.8 (another agent's cargo build was active part of the time).
+
+| Proof | aien-architecture | aien-sovereign-core | Property |
+|---|---|---|---|
+| 13 determinism | PROVEN | PROVEN | 27/27 and 16/16 byte-identical under a frozen clock; real clock identical minus `compiled_at` |
+| 14 fixed point | PROVEN | PROVEN | compile at HEAD rewrites 0; from nothing 27 (16) then 0 |
+| 15 stale set | PROVEN | PROVEN | 5 of 27, 2 of 16 |
+| 16 siblings | PROVEN | PROVEN | 22 of 27 and 14 of 16 CURRENT |
+| 17 claims | PROVEN | PROVEN | exit 2 on the contested claim; claim 33/46 ms, refusal 14/16 ms, close 21/23 ms |
+| 18 crumb-only build | not applicable | PROVEN | Compiling 0, Dirty 0, Fresh 444, 223 ms (target-cold 27G before, 29G after) |
+| 19 admission | PARTIAL | PARTIAL | stale tree, deleted immediate-child crumb and mixed last commit refused; control passes; sub-case b2 FAILED (below) |
+| 20 rebase-crumb | PROVEN | PROVEN | 501 / 811 ms |
+| 21 final SHA | PROVEN | PROVEN | pre-crumb verify exits 1; final SHA verify exits 0 |
+
+Recorded limit found by run 1 (proof 19 b2), fixed by run 2: with RFC-0003 D7 as first written, a parent's `children[]` listed only immediate child directories holding a `.crumb`, so a committed `.crumb` whose parent directory had no `.crumb` (`docs/archive/plans/.crumb`; `crates/aien-allen-memory/.crumb`) was not reachable from the root digest. Deleting it left `crumb verify` OK and `pr-gate.sh` passing (pr-gate exit 0 measured in both repositories). Timings of run 1 (ms, arch/sc): compile at HEAD 184/345, from nothing 198/317, verify 160/347, status 186/329, context root 198/308, context deepest file 214/337, pr-gate 207 to 266 / 372 to 431, rebase-crumb 501/811, cargo warm-up 12950, cargo no change 217.
+
+## crumb.gate template validation (run 1, unchanged)
 `docs/crumbs/crumb.gate.template` copied to `tests/gates/crumb.gate` in a temporary clone of this repository; `aien-test` built in release from a throwaway detached worktree of sovereign-core `origin/main` (`cargo build --release --locked --offline -p aien-test`: 8.9 s, build rc 0; worktree removed afterwards).
 `aien-test list` printed `CRUMB-VERIFY pool=host depends_on=- file=tests/gates/crumb.gate` and `1 gates`; `aien-test identity CRUMB-VERIFY` computed `CHECK_ID 4b296ef1f5daa2c713ebdac4833f14d8746c79d72f6999ed9cc2abce55890497` with `scope_binding ""` (portable) over the declared inputs.
 Limit: the runner resolves `run.exec` as `<root>/crumb`; executing the gate needs PATH resolution in the engine (ENGINE lane) or an in-repo wrapper script.
 
 ## How to rerun
-`scripts/pipeline-proofs/run-all.sh <repo> [<repo>...]` (proof 18 needs a cargo workspace and `TARGET_DIR`, default `pipeline/target-cold`). Raw per-proof output of this run was kept outside the repository (`/tmp/proof-{arch,sc}-NN.out`).
+`PATH=$PWD/tools/crumb:$PATH scripts/pipeline-proofs/run-all.sh <repo> [<repo>...]` after `make -C tools/crumb crumb` (proof 18 needs a cargo workspace and `TARGET_DIR`, default `pipeline/target-cold`). A repository compiled with the old rule must be re-crumbed once first, or proof 14 reports a non-zero rewrite at HEAD. Raw per-proof output of run 2 was kept outside the repository (`/tmp/proofs-orphan-{arch,sc}.out`).
diff --git a/tools/.crumb b/tools/.crumb
index b4aece9..b24627e 100644
--- a/tools/.crumb
+++ b/tools/.crumb
@@ -13,21 +13,21 @@
     "generated": {
       "children": [
         {
-          "digest": "58e74c10e99c73369ebd8dae453b0afe3308578aabbade98981638e4df23763a",
-          "last_commit": "d0f0b95",
+          "digest": "37af9458c2b1482c3e277c20fc1a76b37539bebf52ae717fa52cbc4ea0fd96d7",
+          "last_commit": "57b62d3",
           "name": "crumb",
           "purpose": "Directory tools/crumb. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:dc2f609be26e2e39d14f194de5ec76a193eb86298468d749f731f07ab4f6caac",
-      "compiled_at": "2026-10-09T01:09:28Z",
+      "children_root": "sha256:4f6fd4e47241242fb9a5ff73416294df0db8123df532c4f58bdd47f9edc23a72",
+      "compiled_at": "2026-10-11T16:34:02Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:ec76c5bf9076b78f83c172599f929ae8eee117d11ad90bf6bb94f59d25652984",
+      "digest": "sha256:c23d700ed9187da8eb0363e6a06ddda1449809cbf02b0a7857c83d0a92e349e8",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 6,
-      "generated_at_commit": "c3bc5a3c2bc72a7bdd664828db0b433fe0024647",
-      "source_tree": "sha256:46f41f9e084d4116e2074c3eb12a04e3476730f1e47dc6057b5b530d76d38cee"
+      "generated_at_commit": "57b62d3b7dc34a59451de3b3cf9611bd4672106c",
+      "source_tree": "sha256:33ed0e3276ec93db1510c3c73272aa8e01868fd56379b23a8daa2bb73dc21d90"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/tools/crumb/.crumb b/tools/crumb/.crumb
index 214d4e5..655eb64 100644
--- a/tools/crumb/.crumb
+++ b/tools/crumb/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-09T01:09:28Z",
+      "compiled_at": "2026-10-11T16:34:02Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:58e74c10e99c73369ebd8dae453b0afe3308578aabbade98981638e4df23763a",
+      "digest": "sha256:37af9458c2b1482c3e277c20fc1a76b37539bebf52ae717fa52cbc4ea0fd96d7",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 6,
-      "generated_at_commit": "c3bc5a3c2bc72a7bdd664828db0b433fe0024647",
-      "source_tree": "sha256:46f41f9e084d4116e2074c3eb12a04e3476730f1e47dc6057b5b530d76d38cee"
+      "generated_at_commit": "57b62d3b7dc34a59451de3b3cf9611bd4672106c",
+      "source_tree": "sha256:33ed0e3276ec93db1510c3c73272aa8e01868fd56379b23a8daa2bb73dc21d90"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/tools/crumb/crumb-compile.sh b/tools/crumb/crumb-compile.sh
index 4a0a710..1f45678 100755
--- a/tools/crumb/crumb-compile.sh
+++ b/tools/crumb/crumb-compile.sh
@@ -16,7 +16,9 @@
 #      sorted keys). The compiler never writes these keys; `propose` writes only extensions.proposed.purpose.
 #  D6  last_commit per child uses pathspec ':!**/.crumb' so compile commits do not count as changes to the code.
 #  D7  Only directories that already hold a .crumb take part (crumb seed decides membership; this tool never creates
-#      directories' crumbs). Children = immediate subdirectories with a .crumb.
+#      directories' crumbs). Children = the NEAREST crumbed descendants: the walk descends through directories that
+#      hold no .crumb, so every crumb is reachable from the root digest (amended 2026-10-11, orphan crumbs); a deep
+#      child is named by its path relative to the parent crumb directory.
 #  D8  Evidence = tracked files under the directory whose path has a component named evidence or receipts, or that
 #      end in .receipt.json; evidence_root = sha256 of their blob ids in path order.
 #  D9  Output is written with jq -S (sorted keys) via tmp+rename, byte-stable, so `verify` can be an exact comparison.
@@ -59,6 +61,14 @@ enc() { if [ "$1" = "." ]; then echo _root; else printf "%s" "$1" | tr "/" "%";
 subtree() { # $1 dir -> lines "blob path" under it
   if [ "$1" = "." ]; then cat "$WORK/blobs"; else awk -v d="$1/" 'index($2, d)==1' "$WORK/blobs"; fi
 }
+kids_of() { # $1 dir (repo-relative, "." = root) $2 name prefix -> lines "name<TAB>dir": the NEAREST crumbed descendants (D7)
+  for k in $(ls -1A "$1" 2>/dev/null | LC_ALL=C sort); do
+    kd=$([ "$1" = "." ] && echo "$k" || echo "$1/$k")
+    [ -d "$kd" ] && [ ! -L "$kd" ] || continue
+    [ "$k" = ".git" ] && continue
+    if [ -f "$kd/.crumb" ]; then printf '%s\t%s\n' "$2$k" "$kd"; else kids_of "$kd" "$2$k/"; fi
+  done
+}
 compute() { # $1 dir -> prints the generated object (without stamps) as JSON
   d="$1"
   st=$(subtree "$d" | sha)
@@ -68,14 +78,13 @@ compute() { # $1 dir -> prints the generated object (without stamps) as JSON
   evr=$(printf '%s' "$ev" | awk '{print $1}' | sha)
   sem=$(jq -cS '{purpose, layer, invariants, exports, related, boundaries} | with_entries(select(.value != null))' "$d/.crumb" 2>/dev/null || echo '{}')
   kids='[]'
-  for k in $(ls -1 "$d" 2>/dev/null | LC_ALL=C sort); do
-    kd=$([ "$d" = "." ] && echo "$k" || echo "$d/$k")
-    [ -f "$kd/.crumb" ] || continue
+  kids_of "$d" "" | LC_ALL=C sort > "$WORK/kids.$$"
+  while IFS="$(printf '\t')" read -r k kd; do
     kdig=$(cat "$WORK/digest/$(enc "$kd")" 2>/dev/null || jq -r '.extensions.generated.digest // "uncompiled"' "$kd/.crumb")
     kpur=$(jq -r '(.purpose // "") | .[0:96]' "$kd/.crumb")
     klc=$(git log -1 --format=%h HEAD -- "$kd" ':!**/.crumb' 2>/dev/null || echo "")
     kids=$(printf '%s' "$kids" | jq -c --arg n "$k" --arg g "$kdig" --arg p "$kpur" --arg c "$klc" '. + [{name:$n,digest:$g,purpose:$p,last_commit:$c}]')
-  done
+  done < "$WORK/kids.$$"
   cr=$(printf '%s' "$kids" | jq -r '.[].digest' | sha)
   dig=$(printf '%s%s%s%s' "$sem" "$st" "$cr" "$evr" | sha)
   printf '%s' "$dig" > "$WORK/digest/$(enc "$d")"
diff --git a/tools/crumb/crumb.c b/tools/crumb/crumb.c
index d31df1c..841f531 100644
--- a/tools/crumb/crumb.c
+++ b/tools/crumb/crumb.c
@@ -1727,6 +1727,27 @@ static size_t utf8_prefix(const char *s, int cps) {   /* byte length of the firs
     return i;
 }
 static int sstrcmp(const void *a, const void *b) { return strcmp(*(char *const *)a, *(char *const *)b); }
+/* Children of a crumb directory = nearest crumbed descendants (D7 amendment). One traversal policy with find_crumbs. */
+typedef struct { char *rel; char *name; } Kid;   /* rel: repo-relative directory; name: path relative to the parent crumb dir */
+static int kidcmp(const void *a, const void *b) { return strcmp(((const Kid *)a)->name, ((const Kid *)b)->name); }
+static void collect_kids(Comp *c, const char *dir, const char *prefix, Kid **out, size_t *n, size_t *cap) {
+    int root = !strcmp(dir, "."); char *dfull = root ? xstrdup(c->top) : pjoin(c->top, dir); DIR *dp = opendir(dfull);
+    char **names = NULL; size_t nn = 0;
+    if (dp) { struct dirent *e; while ((e = readdir(dp))) if (strcmp(e->d_name, ".") && strcmp(e->d_name, "..")) { names = xrealloc(names, (nn + 1) * sizeof *names); names[nn++] = xstrdup(e->d_name); } closedir(dp); }
+    qsort(names, nn, sizeof *names, sstrcmp);
+    for (size_t i = 0; i < nn; i++) {
+        char *kd = root ? xstrdup(names[i]) : pjoin(dir, names[i]), *kf = pjoin(c->top, kd); struct stat st;
+        if (lstat(kf, &st) || !S_ISDIR(st.st_mode) || skip_generated_dir(kd)) { free(kd); free(kf); continue; }   /* D10 + #355 */
+        char *kc = pjoin(kf, ".crumb"); struct stat sb; int has = !stat(kc, &sb) && S_ISREG(sb.st_mode);
+        size_t pl = strlen(prefix), nl = strlen(names[i]); char *name = xmalloc(pl + nl + 2); memcpy(name, prefix, pl); memcpy(name + pl, names[i], nl + 1);
+        if (has) {
+            if (*n == *cap) { *cap = *cap ? *cap * 2 : 16; *out = xrealloc(*out, *cap * sizeof **out); }
+            (*out)[*n].rel = kd; (*out)[(*n)++].name = name;
+        } else { name[pl + nl] = '/'; name[pl + nl + 1] = 0; collect_kids(c, kd, name, out, n, cap); free(name); free(kd); }
+        free(kf); free(kc);
+    }
+    free(names); free(dfull);
+}
 static J *comp_object(Comp *c, const char *d, char *dig_out) {   /* the generated object, without stamps */
     int root = !strcmp(d, "."); size_t pl = root ? 0 : strlen(d) + 1;
     char pre[PATH_MAX]; if (!root) snprintf(pre, sizeof pre, "%s/", d); else pre[0] = 0;
@@ -1746,16 +1767,15 @@ static J *comp_object(Comp *c, const char *d, char *dig_out) {   /* the generate
         for (int k = 0; ks[k]; k++) { J *v = jget(cr, ks[k]); if (v && v->t != JNULL) jset(sem, ks[k], v); }
     }
     jsort(sem); char *semc = jcompact_s(sem);
-    /* D7: children = immediate subdirectories (not hidden) that hold a .crumb */
-    char *dfull = root ? xstrdup(c->top) : pjoin(c->top, d); DIR *dp = opendir(dfull);
-    char **names = NULL; size_t nn = 0;
-    if (dp) { struct dirent *e; while ((e = readdir(dp))) if (e->d_name[0] != '.') { names = xrealloc(names, (nn + 1) * sizeof *names); names[nn++] = xstrdup(e->d_name); } closedir(dp); }
-    qsort(names, nn, sizeof *names, sstrcmp);
+    /* D7 (amended 2026-10-11, orphan crumbs): children = the NEAREST crumbed descendants. The walk descends through
+     * directories that hold no .crumb (same traversal policy as find_crumbs: skip_generated_dir, lstat, no symlinks),
+     * so every compiled crumb is reachable from the root digest and deleting any .crumb stales its nearest crumbed
+     * ancestor. A deep child is named by its path relative to this crumb's directory ("archive/plans"). */
+    Kid *kids_v = NULL; size_t nn = 0, kcap = 0; collect_kids(c, d, "", &kids_v, &nn, &kcap);
+    qsort(kids_v, nn, sizeof *kids_v, kidcmp);
     J *kids = jnew(JARR); Sha crs; sha_init(&crs);
     for (size_t i = 0; i < nn; i++) {
-        char *kd = root ? xstrdup(names[i]) : pjoin(d, names[i]), *kc = pjoin(kd, ".crumb"), *kcf = pjoin(c->top, kc); struct stat sb;
-        if (skip_generated_dir(kd)) continue;   /* D10 + #355: same policy as the walker */
-        if (stat(kcf, &sb) || !S_ISREG(sb.st_mode)) continue;
+        char *kd = kids_v[i].rel, *kc = pjoin(kd, ".crumb"), *kcf = pjoin(c->top, kc); const char *kname = kids_v[i].name;
         const char *kdig = dig_of(c, kd); char *kdig_own = NULL;
         if (!kdig) {   /* not compiled in this run: fall back to what the crumb says */
             char *kt = slurp(kcf); J *kj = kt ? jparse(kt) : NULL; J *x = kj ? jget(kj, "extensions") : NULL; x = x ? jget(x, "generated") : NULL;
@@ -1765,7 +1785,7 @@ static J *comp_object(Comp *c, const char *d, char *dig_out) {   /* the generate
         char *kpur = xstrdup(kp); kpur[utf8_prefix(kpur, 96)] = 0; chomp(kpur);
         char gq[PATH_MAX * 2 + 64], *kq = shq(kd); snprintf(gq, sizeof gq, "log -1 --format=%%h HEAD -- %s ':!**/.crumb'", kq);
         char *lc = run_git_full(c->top, gq); chomp(lc);
-        J *o = jnew(JOBJ); jset(o, "name", jstr(names[i])); jset(o, "digest", jstr(kdig)); jset(o, "purpose", jstr(kpur)); jset(o, "last_commit", jstr(lc));
+        J *o = jnew(JOBJ); jset(o, "name", jstr(kname)); jset(o, "digest", jstr(kdig)); jset(o, "purpose", jstr(kpur)); jset(o, "last_commit", jstr(lc));
         jpush(kids, o); sha_add(&crs, kdig, strlen(kdig)); sha_add(&crs, "\n", 1);
         (void)kdig_own;
     }
diff --git a/tools/crumb/test.sh b/tools/crumb/test.sh
index 958a70d..10ff8e3 100644
--- a/tools/crumb/test.sh
+++ b/tools/crumb/test.sh
@@ -172,6 +172,23 @@ echo x >> src/a.c; git add -A; "$C" context src/a.c | grep -q "^Crumbs STALE: 2
 "$C" context docs | grep -q 'held by lane-x' && bad "C3 context ignores locks elsewhere" || ok "C3 context ignores locks elsewhere"
 "$C" close lane-x src src/a.c >/dev/null
 [ "$("$C" context src | wc -l)" -lt 80 ] && ok "C3 context output is bounded" || bad "C3 context bounded"
+# orphan crumbs (lane CRUMB proof 19 b2, 2026-10-11): a .crumb under a directory that has NO .crumb is a child of the
+# nearest crumbed ancestor (D7 amended), so deleting it is visible to verify and to pr-gate.sh
+"$C" compile . >/dev/null; git add -A; git -c user.name=t -c user.email=t@t commit -qm "pre-orphan"
+mkdir -p src/mid/leaf && echo 'int l;' > src/mid/leaf/l.c && "$C" create src/mid/leaf leaf "leaf under an uncrumbed directory" code >/dev/null
+git add -A; st=$("$C" verify . | grep '^STALE' | awk '{print $2}' | sort | tr '\n' ' ')
+[ "$st" = ". src src/mid/leaf " ] && ok "C3 D7 new crumb under an uncrumbed dir stales itself, its nearest crumbed ancestor and the root" || bad "C3 D7 orphan stale set (got: $st)"
+"$C" compile . >/dev/null; git add -A; git -c user.name=t -c user.email=t@t commit -qm "orphan compiled"
+"$C" verify . >/dev/null && ok "C3 D7 verify OK after compiling the deep crumb" || bad "C3 D7 verify after deep crumb"
+"$C" compile . | grep -q ', 0 rewritten' && ok "C3 D7 fixed point holds with a deep child" || bad "C3 D7 fixed point deep child"
+jq -e '.extensions.generated.children | map(.name) | index("mid/leaf") != null' src/.crumb >/dev/null && ok "C3 D7 deep crumb is listed as child \"mid/leaf\" of src (path relative to the parent crumb)" || bad "C3 D7 deep child not listed"
+jq -e '.extensions.generated.children | map(.name) | index("mid") == null' src/.crumb >/dev/null && ok "C3 D7 the uncrumbed directory itself is not a child" || bad "C3 D7 uncrumbed dir listed"
+git rm -q src/mid/leaf/.crumb; st=$("$C" verify . | grep '^STALE' | awk '{print $2}' | sort | tr '\n' ' ')
+[ "$st" = ". src " ] && ok "C3 D7 deleting the deep crumb stales src and the root (orphan deletion is visible)" || bad "C3 D7 orphan deletion invisible (got: $st)"
+"$C" verify . >/dev/null; [ $? -eq 1 ] && ok "C3 D7 verify exits 1 after the orphan deletion" || bad "C3 D7 verify exit after orphan deletion"
+"$C" compile . >/dev/null; "$C" verify . >/dev/null && ok "C3 D7 recompile after the deletion returns to OK" || bad "C3 D7 recompile after deletion"
+jq -e '.extensions.generated.children | map(.name) | index("mid/leaf") == null' src/.crumb >/dev/null && ok "C3 D7 deleted deep crumb is gone from src children" || bad "C3 D7 deleted deep child still listed"
+git add -A; git -c user.name=t -c user.email=t@t commit -qm "orphan removed"
 # D10: .crumbignore subtrees never participate in compile/verify/status (omega evidence/, physics nvrm, m16)
 "$C" compile . >/dev/null; git add -A; git -c user.name=t -c user.email=t@t commit -qm "pre-ignore"
 ev0=$(cat src/deep/.crumb); printf '# guarded tree\nsrc/deep/\n' > .crumbignore