From d8a7b9ea789706f6a7b7349cd95d11de6dc0822c Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Sun, 18 Oct 2026 07:09:10 -0500 Subject: [PATCH 1/3] crumb: store structure only, so PRs stop colliding on .crumb (RFC-0003 D11) Every merge rewrote the root .crumb: extensions.generated stored source_tree, a sha256 over every tracked file below the directory, plus digests, counts and stamps. Any change anywhere changed the root crumb, so every pair of open pull requests conflicted on it, and the pipeline refused them until rebased. D11: the committed generated block is now compiler (crumb-compile/2) and children[{name, purpose}]. The Merkle digests are still computed in the same order and `crumb digest` prints the root one, but nothing volatile is written. A crumb goes STALE only when its children or their purposes change. Git already fingerprints every tree. Red then green: new test.sh D11 case (two branches changing files in different directories) conflicts on the root .crumb with crumb-compile/1 and merges cleanly with /2. make -C tools/crumb test: 176 PASS. Shell reference crumb-compile.sh updated in step (differential still byte-identical). Pipeline proof 13 compares `crumb digest` instead of the stored digest. This repo's 28 crumbs recompiled once in the new format. Co-authored-by: Drake Stapleton Co-Authored-By: Claude Opus 5.5 --- .crumb | 18 +------------ README.md | 2 +- docs/.crumb | 24 +---------------- docs/CRUMB_PROTOCOL_RFC_0003.md | 10 +++++-- docs/adr/.crumb | 10 +------ docs/archive/plans/.crumb | 14 +--------- docs/archive/plans/2026-09-22/.crumb | 10 +------ docs/archive/plans/2026-09-25/.crumb | 10 +------ docs/crumbs/.crumb | 10 +------ docs/errata/.crumb | 10 +------ docs/plans/.crumb | 32 +---------------------- docs/plans/analog-realization/.crumb | 10 +------ docs/plans/arena-x/.crumb | 10 +------ docs/plans/atemporal/.crumb | 10 +------ docs/plans/belief-estimation/.crumb | 10 +------ docs/plans/dirac/.crumb | 10 +------ docs/plans/discovery/.crumb | 10 +------ docs/plans/fabric/.crumb | 10 +------ docs/plans/mixed-algebra/.crumb | 12 +-------- docs/plans/mixed-algebra/research/.crumb | 10 +------ docs/plans/physics-zero/.crumb | 10 +------ docs/plans/release-readiness/.crumb | 10 +------ docs/plans/vac/.crumb | 10 +------ docs/research/.crumb | 10 +------ docs/specs/.crumb | 10 +------ doctrine/.crumb | 10 +------ scripts/.crumb | 12 +-------- scripts/pipeline-proofs/.crumb | 10 +------ scripts/pipeline-proofs/13-determinism.sh | 4 +-- tools/.crumb | 12 +-------- tools/crumb/.crumb | 10 +------ tools/crumb/crumb-compile.sh | 16 +++++------- tools/crumb/crumb.c | 32 ++++++++++++++--------- tools/crumb/test.sh | 26 +++++++++++++----- 34 files changed, 85 insertions(+), 339 deletions(-) diff --git a/.crumb b/.crumb index a3d38d9..dbae590 100644 --- a/.crumb +++ b/.crumb @@ -21,39 +21,23 @@ "generated": { "children": [ { - "digest": "071993a5efc66bc8d5f02f09bf820ad0930c609a896364645e6d04ca326d4fbd", - "last_commit": "4284e85", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, { - "digest": "852d4f97923032b04f0c24b23c061fce59fda220b5d423465ffec878ca0708b2", - "last_commit": "ac6754c", "name": "doctrine", "purpose": "Directory doctrine. Purpose not yet described by a human." }, { - "digest": "44e7c932a7224961a604200108877820fbe57e84fd36764b654a69ca24e1204a", - "last_commit": "7291eb3", "name": "scripts", "purpose": "Directory scripts. Purpose not yet described by a human." }, { - "digest": "afa286ef45ae5a0a0fd880a27288f50f82138a2a092a0c3684c59597d20c9070", - "last_commit": "7291eb3", "name": "tools", "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:00338bbcee73da197f956fde5d3b3ca998f876b5a6718447cbb9cfe384bbc70a", - "compiled_at": "2026-10-16T15:28:03Z", - "compiler": "crumb-compile/1", - "digest": "sha256:fac7a054bbf20b046d39569b25b3f8b7a62d510ba9e5a8ecd94f44c5b2f96241", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 314, - "generated_at_commit": "4284e850fa160e1f37763c7cbf759c9f1b6051ad", - "source_tree": "sha256:ed98ac64dfb102f3ed9d382f1090344d4f9cb9e9c4fa77046cb14f22a7ba2842" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/README.md b/README.md index be2fe12..1aa8b2b 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ The [Physics Zero Atlas](docs/plans/physics-zero/PHYSICS_ZERO_LAW_ATLAS_V1.md), ## Building -There is no product to build here. The one program is the crumb tool in `tools/crumb` (a C11 program that compiles and verifies the `.crumb` files); `make -C tools/crumb test` builds and tests it, and the shell scripts in `scripts/` have `test_*.sh` companions. On `main` (protected as of 2026-10-01) a CI check named `r16` verifies the R16 status wording against omega evidence and is the only check required on `main`; the `Crumb compiler` and `AIEN Verification` checks also run on pull requests. +There is no product to build here. The one program is the crumb tool in `tools/crumb` (a C11 program that compiles and verifies the `.crumb` files); `make -C tools/crumb test` builds and tests it, and the shell scripts in `scripts/` have `test_*.sh` companions. On `main` (protected as of 2026-10-01) a CI check named `r16` verifies the R16 status wording against omega evidence and is the only check required on `main`; the `Crumb compiler` and `AIEN Verification` checks also run on pull requests. Since 2026-10-18 (RFC-0003 D11) a `.crumb` stores only structure (child folders and their purposes), never fingerprints or timestamps, so pull requests no longer collide on the root `.crumb`; `crumb digest` computes the fingerprint on demand. ## Contributing diff --git a/docs/.crumb b/docs/.crumb index 14f8917..dc4a878 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -37,57 +37,35 @@ "generated": { "children": [ { - "digest": "5aca52cd8998af58a4357fc4c9d2983a206be71f403dee735724d9077ff62da7", - "last_commit": "29780e5", "name": "adr", "purpose": "Directory docs/adr. Purpose not yet described by a human." }, { - "digest": "1b7d47cac8dcbeed3c2ce178d2c07c188e32fdd743e3b69e00c1980aa93d44ea", - "last_commit": "ac6754c", "name": "archive/plans", "purpose": "Directory docs/archive/plans. Purpose not yet described by a human." }, { - "digest": "ace122c86c42992a65ab53566fd1f514734e9762ef6d19363fc4a21cfc018bb7", - "last_commit": "ac6754c", "name": "crumbs", "purpose": "Directory docs/crumbs. Purpose not yet described by a human." }, { - "digest": "0f9f110974f880c3527ac4f9bb755157a9e830080c7aff363e33d187bc22edc4", - "last_commit": "874dc62", "name": "errata", "purpose": "Directory docs/errata. Purpose not yet described by a human." }, { - "digest": "e0520531574f3936bfe2031fdae0eb5c3ea63c696d5277e87a84128555055215", - "last_commit": "d2768e9", "name": "plans", "purpose": "Directory docs/plans. Purpose not yet described by a human." }, { - "digest": "a4cbc6eb5e9859b62779d65d4ee94bf3197e4786e06d1da166cbc14f841a2f59", - "last_commit": "4284e85", "name": "research", "purpose": "Directory docs/research. Purpose not yet described by a human." }, { - "digest": "187ee5c915158c24bdbcd58f548fd605eb73e9b9329ce7f36adabfecf80cf627", - "last_commit": "874dc62", "name": "specs", "purpose": "Directory docs/specs. Purpose not yet described by a human." } ], - "children_root": "sha256:ed55acf711a57373043684b19db8ebf22b54aefb7e4d7449034a891ff4da9aeb", - "compiled_at": "2026-10-16T15:28:03Z", - "compiler": "crumb-compile/1", - "digest": "sha256:071993a5efc66bc8d5f02f09bf820ad0930c609a896364645e6d04ca326d4fbd", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 175, - "generated_at_commit": "4284e850fa160e1f37763c7cbf759c9f1b6051ad", - "source_tree": "sha256:561dad4e22d749c91ef214f4c2d25bb7b683a46d9ad5605c94ce234f2024de41" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/CRUMB_PROTOCOL_RFC_0003.md b/docs/CRUMB_PROTOCOL_RFC_0003.md index 27e52b4..2924aff 100644 --- a/docs/CRUMB_PROTOCOL_RFC_0003.md +++ b/docs/CRUMB_PROTOCOL_RFC_0003.md @@ -21,11 +21,13 @@ Until now people and agents wrote the descriptions in crumbs by hand, and they w `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. +**Amended 2026-10-18 (D11).** The committed `extensions.generated` now holds only `compiler` (`crumb-compile/2`) and `children` (each `{name, purpose}`). The fingerprints described in this section and in section 3 are still computed on every run, in the same order, and `crumb digest` prints the root one, but they are never written into a `.crumb`. Neither are `generated_at_commit`, `compiled_at` or `children[].last_commit`. + ## 3. Merkle rule `digest = sha256(semantic || source_tree || children_root || evidence_root)`, where `semantic` is the compact, key-sorted JSON of the semantic kernel with null keys removed, and the three roots are the lowercase hex digests. `children_root` is the sha256 of each child's digest followed by a newline, in name order. Directories are compiled deepest first (D4), so a parent always embeds its children's final digests. Changing one file therefore changes that directory's digest and those of its ancestors only; siblings stay CURRENT. -## 4. Design decisions D1-D10 (binding; D1-D9 from the reference implementation) and D3a +## 4. Design decisions D1-D11 (binding; D1-D9 from the reference implementation), D3a and D11 | ID | Decision | Trap it closes | |---|---|---| @@ -40,12 +42,14 @@ Until now people and agents wrote the descriptions in crumbs by hand, and they w | 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 `/.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`. | +| D11 | Added 2026-10-18. The committed generated block is structure only: `compiler` and `children[{name, purpose}]`. `source_tree`, `files`, `children[].digest`, `children_root`, `evidence_files`, `evidence_root`, `digest`, `children[].last_commit`, `generated_at_commit` and `compiled_at` are no longer written; the Merkle digests are computed on demand (`crumb digest`). A crumb is STALE only when its children or their purposes change. Supersedes the storage parts of D3, D3a and the "touching one file stales its ancestors" rule. | `source_tree` covered every file below a directory, so any change anywhere rewrote the root `.crumb` and every pair of open pull requests conflicted on it (2026-10-18: most open PRs CONFLICTING, root `.crumb` the only conflicting file). Git already fingerprints every tree; a second copy stored inside the tree it fingerprints can only collide. | ## 5. Commands - `crumb compile [root]`: regenerate stale crumbs (idempotent; a second run rewrites 0). - `crumb verify [root]`: exit 1 and list every stale directory if any committed crumb differs from what compile would write now. This is the CI rule. - `crumb status [root]`: CURRENT, STALE or UNCOMPILED per crumb. +- `crumb digest [root]`: print the root Merkle digest, computed now and never stored (D11). - `crumb propose ""`: write a PROPOSED purpose; `.purpose` is never changed. - `crumb context [path]`: the agent entry point. Prints a freshness line (`Crumbs CURRENT at HEAD ` or `Crumbs STALE: (run crumb compile)`), the top-level tree with each child's purpose (or `PROPOSED: ...`), what the path touches, the crumbs to read (the path's ancestors, root first), current conflicts (shared-store locks on the path), and the newest relevant Continuation Crumb. Output is bounded (at most 40 tree entries, 8 continuation items). @@ -79,7 +83,9 @@ Caveat for stages 4-5: Omega's program representation is still narrow (unary-u64 | Fresh crumbs are UNCOMPILED; `verify` exits 1 | PASS | | Fixed point: second compile rewrites 0 | PASS | | `verify` OK after compile; OK after an empty commit; OK after the compiled change is committed (D3a) | PASS | -| Touching one file: STALE is exactly its directory, its ancestors and the root; siblings stay CURRENT | PASS | +| Touching one file stales no crumb (D11); a new or deleted crumbed child stales only its nearest crumbed parent; siblings stay CURRENT | PASS | +| D11: two branches that change files in different directories merge with no `.crumb` conflict and `verify` stays OK without a recompile (red on crumb-compile/1: conflict on the root `.crumb`) | PASS | +| D11: `crumb digest` prints the root Merkle digest; two clean compiles one second apart give the same digest (pipeline proof 13) | PASS | | `propose` never changes `.purpose`; compile never touches the semantic kernel; a proposal does not make crumbs stale | PASS | | `context` prints all sections, both freshness lines, ancestors, PROPOSED purpose, locks on the path only, bounded output | PASS | | Differential against `crumb-compile.sh` on a scratch repo and on this repo (both tools compile from nothing, so `last_commit` is fresh in both): generated blocks identical, each tool verifies the other's output, whole file byte-identical apart from `compiled_at` | PASS (reported NOT_RUN if `jq` is missing) | diff --git a/docs/adr/.crumb b/docs/adr/.crumb index 2f9b395..11f20b7 100644 --- a/docs/adr/.crumb +++ b/docs/adr/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T13:04:17Z", - "compiler": "crumb-compile/1", - "digest": "sha256:5aca52cd8998af58a4357fc4c9d2983a206be71f403dee735724d9077ff62da7", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 38, - "generated_at_commit": "1d945b55f53ed4c8eb73b7a7555ea54a78bf518a", - "source_tree": "sha256:481f02760bf7ceaa588a692599f2cc168d3b14d4a317050978322674aad29b8f" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/archive/plans/.crumb b/docs/archive/plans/.crumb index 6f8b867..b97dfe4 100644 --- a/docs/archive/plans/.crumb +++ b/docs/archive/plans/.crumb @@ -17,27 +17,15 @@ "generated": { "children": [ { - "digest": "cb7edbc99557c3842778fe56dae720842ddf13d57d1a42da55676ff553994d10", - "last_commit": "27ac46f", "name": "2026-09-22", "purpose": "Directory docs/archive/plans/2026-09-22. Purpose not yet described by a human." }, { - "digest": "6518fb4d48d841b0247f4325619cc769bb577f8fd75f4c86aa527fcb2869bde8", - "last_commit": "38c7cc2", "name": "2026-09-25", "purpose": "Directory docs/archive/plans/2026-09-25. Purpose not yet described by a human." } ], - "children_root": "sha256:fc059fc7af4514c6c5695b5e7f287974d74b71848b2850dfecca9978d4da74bb", - "compiled_at": "2026-10-14T01:16:44Z", - "compiler": "crumb-compile/1", - "digest": "sha256:1b7d47cac8dcbeed3c2ce178d2c07c188e32fdd743e3b69e00c1980aa93d44ea", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 5, - "generated_at_commit": "27ac46f5a8c8950002d48535f838c0982c9e5d35", - "source_tree": "sha256:a4bf5d42c6fcb9afa874f59f89de32444c4401c3def48a68b8af60c978822db2" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/archive/plans/2026-09-22/.crumb b/docs/archive/plans/2026-09-22/.crumb index d1d4c5e..49733cf 100644 --- a/docs/archive/plans/2026-09-22/.crumb +++ b/docs/archive/plans/2026-09-22/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T01:16:44Z", - "compiler": "crumb-compile/1", - "digest": "sha256:cb7edbc99557c3842778fe56dae720842ddf13d57d1a42da55676ff553994d10", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 2, - "generated_at_commit": "27ac46f5a8c8950002d48535f838c0982c9e5d35", - "source_tree": "sha256:aed048fd6700db21fa0ce537db5b3154bbe9b3bea1dbf2fb4d6115fabc55fef7" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/archive/plans/2026-09-25/.crumb b/docs/archive/plans/2026-09-25/.crumb index 35f1490..0d37458 100644 --- a/docs/archive/plans/2026-09-25/.crumb +++ b/docs/archive/plans/2026-09-25/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-04T13:24:43Z", - "compiler": "crumb-compile/1", - "digest": "sha256:6518fb4d48d841b0247f4325619cc769bb577f8fd75f4c86aa527fcb2869bde8", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 2, - "generated_at_commit": "89fda22daf3ddb149c82a36efdc89bc087ad2f0b", - "source_tree": "sha256:b905164e9c6b71dfe6017a59e4b7528c216eea27ebf2828ad9d0455e38ea6b85" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/crumbs/.crumb b/docs/crumbs/.crumb index 5391b99..f687fa3 100644 --- a/docs/crumbs/.crumb +++ b/docs/crumbs/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T01:16:44Z", - "compiler": "crumb-compile/1", - "digest": "sha256:ace122c86c42992a65ab53566fd1f514734e9762ef6d19363fc4a21cfc018bb7", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 5, - "generated_at_commit": "27ac46f5a8c8950002d48535f838c0982c9e5d35", - "source_tree": "sha256:65e27a33c5ff5123f4f7696433c2e5ba79eeef2e2a5831af699f96b580d12608" + "compiler": "crumb-compile/2" }, "owner_lane": "", "seed": { diff --git a/docs/errata/.crumb b/docs/errata/.crumb index f31b9b6..e218cc7 100644 --- a/docs/errata/.crumb +++ b/docs/errata/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-04T13:24:43Z", - "compiler": "crumb-compile/1", - "digest": "sha256:0f9f110974f880c3527ac4f9bb755157a9e830080c7aff363e33d187bc22edc4", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 1, - "generated_at_commit": "89fda22daf3ddb149c82a36efdc89bc087ad2f0b", - "source_tree": "sha256:b5e956c0ff61e853b17ed4f83cddd7e2a78e79b3f00f6beeef4f6326fdbf9405" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/plans/.crumb b/docs/plans/.crumb index c0a8346..1a3b139 100644 --- a/docs/plans/.crumb +++ b/docs/plans/.crumb @@ -41,81 +41,51 @@ "generated": { "children": [ { - "digest": "998ae1dd5e8d72b87d9348d8ace1d94c5e8a3ebfd177e5ce5d827624dd333625", - "last_commit": "ac6754c", "name": "analog-realization", "purpose": "Directory docs/plans/analog-realization. Purpose not yet described by a human." }, { - "digest": "eecb93fc776fe3c4d7f45f1755dc77d89cf4fb422e6542c8a6edb944f605a968", - "last_commit": "a1febd2", "name": "arena-x", "purpose": "Directory docs/plans/arena-x. Purpose not yet described by a human." }, { - "digest": "9c77f0bfebdad5067e40e3f985dcc03b7cfd5f9f782df211c952f85340cb2c16", - "last_commit": "ac6754c", "name": "atemporal", "purpose": "AT-0 Clock-Free Universe research program: charter, frozen AT0_CASE_V1 and AT0_RESULT_V1 contrac" }, { - "digest": "d9a3f043a356154d3e9fc97b097dddc415b02eb1f963d3a940a868299a037eb9", - "last_commit": "ac6754c", "name": "belief-estimation", "purpose": "Directory docs/plans/belief-estimation. Purpose not yet described by a human." }, { - "digest": "8454ec48236060321d9c688fa8fad7723258b48fae5d98fc1a081d0d6aa40b99", - "last_commit": "ac6754c", "name": "dirac", "purpose": "Directory docs/plans/dirac. Purpose not yet described by a human." }, { - "digest": "694d1efaa7edd1dbbf4e2e5adb8a3942bd900ba5b7996e42f8788d5ac85c517d", - "last_commit": "b9aa9a2", "name": "discovery", "purpose": "Directory docs/plans/discovery. Purpose not yet described by a human." }, { - "digest": "f5e2891d09b853edee1bc6c977d83a3669f2ef02aab6322ba5e0fd3c54835011", - "last_commit": "6490acc", "name": "fabric", "purpose": "Directory docs/plans/fabric. Purpose not yet described by a human." }, { - "digest": "d6c2ab697f5519d1b1fba2c55377eea6e119fc489f16363a2cfb3c48567df0d1", - "last_commit": "ac6754c", "name": "mixed-algebra", "purpose": "Directory docs/plans/mixed-algebra. Purpose not yet described by a human." }, { - "digest": "e40bd1c24076a221bc96cd150c12fb1bd6c39b061a497a99d10b81aac2d80802", - "last_commit": "ac6754c", "name": "physics-zero", "purpose": "Directory docs/plans/physics-zero. Purpose not yet described by a human." }, { - "digest": "eac6d699107818822ec7c9acf8cb107ab8221f77783041db7c49a3c46e3a5d67", - "last_commit": "4de457b", "name": "release-readiness", "purpose": "Release-readiness finite workstream (aien-architecture#190): gap assessment, integration plan an" }, { - "digest": "a5c37940a9689146af15ca41f6b45e02770522bfe4003f70acaaad1cf0a9e3d5", - "last_commit": "ac6754c", "name": "vac", "purpose": "VAC (Verifiable Autonomous Computing) finite workstream plan. NOT A MASTER PLAN." } ], - "children_root": "sha256:094a3d682cf25c8519eafc56a03e9a24d37d55f0e19f643c855047f2a49026ce", - "compiled_at": "2026-10-16T07:40:02Z", - "compiler": "crumb-compile/1", - "digest": "sha256:e0520531574f3936bfe2031fdae0eb5c3ea63c696d5277e87a84128555055215", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 69, - "generated_at_commit": "4de457b65fe64a43deeb19ae495243ae63a44409", - "source_tree": "sha256:825d93be5161b35706fb5941509e5d1014a769ab896392b615db4efb1bf4da77" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/plans/analog-realization/.crumb b/docs/plans/analog-realization/.crumb index 45632ff..d8c1618 100644 --- a/docs/plans/analog-realization/.crumb +++ b/docs/plans/analog-realization/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T01:16:44Z", - "compiler": "crumb-compile/1", - "digest": "sha256:998ae1dd5e8d72b87d9348d8ace1d94c5e8a3ebfd177e5ce5d827624dd333625", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 4, - "generated_at_commit": "27ac46f5a8c8950002d48535f838c0982c9e5d35", - "source_tree": "sha256:e51e5c9836371129fd2bf95db7192b305670048e89ac0c2017ced713318c6e70" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/plans/arena-x/.crumb b/docs/plans/arena-x/.crumb index f23d20c..ea8ee8a 100644 --- a/docs/plans/arena-x/.crumb +++ b/docs/plans/arena-x/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-04T13:24:43Z", - "compiler": "crumb-compile/1", - "digest": "sha256:eecb93fc776fe3c4d7f45f1755dc77d89cf4fb422e6542c8a6edb944f605a968", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 1, - "generated_at_commit": "89fda22daf3ddb149c82a36efdc89bc087ad2f0b", - "source_tree": "sha256:60cdf9d48ab68686b962d7bc24ffbdf03d88a8e452cd786f7dde5a9d880ddc45" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/plans/atemporal/.crumb b/docs/plans/atemporal/.crumb index 512fe44..c932381 100644 --- a/docs/plans/atemporal/.crumb +++ b/docs/plans/atemporal/.crumb @@ -2,15 +2,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T01:16:44Z", - "compiler": "crumb-compile/1", - "digest": "sha256:9c77f0bfebdad5067e40e3f985dcc03b7cfd5f9f782df211c952f85340cb2c16", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 13, - "generated_at_commit": "27ac46f5a8c8950002d48535f838c0982c9e5d35", - "source_tree": "sha256:a678f7f01662b9b26abcfc8269b07f0add412de37ccdba27f0abb97e19deaba2" + "compiler": "crumb-compile/2" } }, "name": "atemporal", diff --git a/docs/plans/belief-estimation/.crumb b/docs/plans/belief-estimation/.crumb index a08ef2c..74d0729 100644 --- a/docs/plans/belief-estimation/.crumb +++ b/docs/plans/belief-estimation/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T01:16:44Z", - "compiler": "crumb-compile/1", - "digest": "sha256:d9a3f043a356154d3e9fc97b097dddc415b02eb1f963d3a940a868299a037eb9", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 1, - "generated_at_commit": "27ac46f5a8c8950002d48535f838c0982c9e5d35", - "source_tree": "sha256:9a768311f7a93dcdd250e0d87897fd0c57316f34968294c17c0e8ff9a6e8408c" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/plans/dirac/.crumb b/docs/plans/dirac/.crumb index 27bffce..0869bb9 100644 --- a/docs/plans/dirac/.crumb +++ b/docs/plans/dirac/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T01:16:44Z", - "compiler": "crumb-compile/1", - "digest": "sha256:8454ec48236060321d9c688fa8fad7723258b48fae5d98fc1a081d0d6aa40b99", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 2, - "generated_at_commit": "27ac46f5a8c8950002d48535f838c0982c9e5d35", - "source_tree": "sha256:016ba4b2651abc0da7b01b602ee98fdfc7f04c0359ca5e14a53edd97b8ff1ece" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/plans/discovery/.crumb b/docs/plans/discovery/.crumb index 86b2e21..ae8e62b 100644 --- a/docs/plans/discovery/.crumb +++ b/docs/plans/discovery/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-04T13:24:43Z", - "compiler": "crumb-compile/1", - "digest": "sha256:694d1efaa7edd1dbbf4e2e5adb8a3942bd900ba5b7996e42f8788d5ac85c517d", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 4, - "generated_at_commit": "89fda22daf3ddb149c82a36efdc89bc087ad2f0b", - "source_tree": "sha256:dc29188e6a8ec649cae2ce7f4ce839a9eb46a2ec886d83289a05fe4cd2b16f25" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/plans/fabric/.crumb b/docs/plans/fabric/.crumb index dc37b41..19203c3 100644 --- a/docs/plans/fabric/.crumb +++ b/docs/plans/fabric/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-04T13:24:43Z", - "compiler": "crumb-compile/1", - "digest": "sha256:f5e2891d09b853edee1bc6c977d83a3669f2ef02aab6322ba5e0fd3c54835011", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 1, - "generated_at_commit": "89fda22daf3ddb149c82a36efdc89bc087ad2f0b", - "source_tree": "sha256:e0cfd8cb96e14dc604444b10ff0ebef6d6e5e7ea8fb0245790cf6048b456fd8e" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/plans/mixed-algebra/.crumb b/docs/plans/mixed-algebra/.crumb index 9561ca6..9ec5391 100644 --- a/docs/plans/mixed-algebra/.crumb +++ b/docs/plans/mixed-algebra/.crumb @@ -13,21 +13,11 @@ "generated": { "children": [ { - "digest": "faeb21e72f69dc4ba2333400b5203027c167c5e24ef68871d9b3c861d9dca7a8", - "last_commit": "f1018ec", "name": "research", "purpose": "Directory docs/plans/mixed-algebra/research. Purpose not yet described by a human." } ], - "children_root": "sha256:783746ff00990d5b134d26b57ba4f06b134a8713811c4785eccb7dadfa812c89", - "compiled_at": "2026-10-14T01:16:44Z", - "compiler": "crumb-compile/1", - "digest": "sha256:d6c2ab697f5519d1b1fba2c55377eea6e119fc489f16363a2cfb3c48567df0d1", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 5, - "generated_at_commit": "27ac46f5a8c8950002d48535f838c0982c9e5d35", - "source_tree": "sha256:651561a753a2b39e4ac6d42156db77ca172ef644cb9d1eaf350b5b6b8bff4c6b" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/plans/mixed-algebra/research/.crumb b/docs/plans/mixed-algebra/research/.crumb index be2b6d9..e41896e 100644 --- a/docs/plans/mixed-algebra/research/.crumb +++ b/docs/plans/mixed-algebra/research/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-04T13:24:43Z", - "compiler": "crumb-compile/1", - "digest": "sha256:faeb21e72f69dc4ba2333400b5203027c167c5e24ef68871d9b3c861d9dca7a8", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 2, - "generated_at_commit": "89fda22daf3ddb149c82a36efdc89bc087ad2f0b", - "source_tree": "sha256:9ae4daff5a6e4c63ba259fb8afe229397c5cb902f1091a27b6564933e119d060" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/plans/physics-zero/.crumb b/docs/plans/physics-zero/.crumb index c9b607e..67ce7e7 100644 --- a/docs/plans/physics-zero/.crumb +++ b/docs/plans/physics-zero/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T01:16:44Z", - "compiler": "crumb-compile/1", - "digest": "sha256:e40bd1c24076a221bc96cd150c12fb1bd6c39b061a497a99d10b81aac2d80802", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 3, - "generated_at_commit": "27ac46f5a8c8950002d48535f838c0982c9e5d35", - "source_tree": "sha256:bec6447c0e0580a8f689aaf6a908c1fd5b5fd9654b95c04e5739096a8f0be1c5" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/plans/release-readiness/.crumb b/docs/plans/release-readiness/.crumb index 994c3f7..8e65acf 100644 --- a/docs/plans/release-readiness/.crumb +++ b/docs/plans/release-readiness/.crumb @@ -2,15 +2,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-16T07:40:02Z", - "compiler": "crumb-compile/1", - "digest": "sha256:eac6d699107818822ec7c9acf8cb107ab8221f77783041db7c49a3c46e3a5d67", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 3, - "generated_at_commit": "4de457b65fe64a43deeb19ae495243ae63a44409", - "source_tree": "sha256:787d8b9aa98c40a11b2a21d211d2a8bc29e1f10ae3c8b418eb377c59c67f5e4d" + "compiler": "crumb-compile/2" } }, "name": "release-readiness", diff --git a/docs/plans/vac/.crumb b/docs/plans/vac/.crumb index 6a5a914..e5d1cae 100644 --- a/docs/plans/vac/.crumb +++ b/docs/plans/vac/.crumb @@ -2,15 +2,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T01:16:44Z", - "compiler": "crumb-compile/1", - "digest": "sha256:a5c37940a9689146af15ca41f6b45e02770522bfe4003f70acaaad1cf0a9e3d5", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 2, - "generated_at_commit": "27ac46f5a8c8950002d48535f838c0982c9e5d35", - "source_tree": "sha256:65d24930aaf50fd21a7dd27b2e1c50c1692899a5475321972b45e04ebb720768" + "compiler": "crumb-compile/2" } }, "name": "vac", diff --git a/docs/research/.crumb b/docs/research/.crumb index ed82770..dc03ba8 100644 --- a/docs/research/.crumb +++ b/docs/research/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-16T15:28:03Z", - "compiler": "crumb-compile/1", - "digest": "sha256:a4cbc6eb5e9859b62779d65d4ee94bf3197e4786e06d1da166cbc14f841a2f59", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 6, - "generated_at_commit": "4284e850fa160e1f37763c7cbf759c9f1b6051ad", - "source_tree": "sha256:0c5d0bcb9c615053fad041f2589d4678c5bee7c052681ae85df76bd9349fec9e" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/docs/specs/.crumb b/docs/specs/.crumb index 5c19085..070b028 100644 --- a/docs/specs/.crumb +++ b/docs/specs/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-04T13:24:44Z", - "compiler": "crumb-compile/1", - "digest": "sha256:187ee5c915158c24bdbcd58f548fd605eb73e9b9329ce7f36adabfecf80cf627", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 1, - "generated_at_commit": "89fda22daf3ddb149c82a36efdc89bc087ad2f0b", - "source_tree": "sha256:a8d72a54561847fbf3d39456d5c5f70e6fa38e25d40afc2a96c295f2e9f0d9a0" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/doctrine/.crumb b/doctrine/.crumb index d2d191a..5e14f84 100644 --- a/doctrine/.crumb +++ b/doctrine/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T01:16:44Z", - "compiler": "crumb-compile/1", - "digest": "sha256:852d4f97923032b04f0c24b23c061fce59fda220b5d423465ffec878ca0708b2", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 11, - "generated_at_commit": "27ac46f5a8c8950002d48535f838c0982c9e5d35", - "source_tree": "sha256:293a6d676b7e7205fb2b919f32c2ab67c66306d9262ff64a73821ea8d31aa43e" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/scripts/.crumb b/scripts/.crumb index a7d90bf..6843cd1 100644 --- a/scripts/.crumb +++ b/scripts/.crumb @@ -7,21 +7,11 @@ "generated": { "children": [ { - "digest": "8389e63a46828e9ba6858867eb4ecf2f00b9fad4b8b2ccef9b9124b5a121d9ca", - "last_commit": "7291eb3", "name": "pipeline-proofs", "purpose": "Acceptance proofs 13-21 of the sovereign local pipeline (ADR 0033 amendment 2026-10-11): bash sc" } ], - "children_root": "sha256:a4436bfa88c272f8df98ea3e400ac6e9ec888a6e35d5ca7ece1e60e228e9f5dc", - "compiled_at": "2026-10-16T11:11:15Z", - "compiler": "crumb-compile/1", - "digest": "sha256:44e7c932a7224961a604200108877820fbe57e84fd36764b654a69ca24e1204a", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 26, - "generated_at_commit": "dccc00620d24481bf4b12f6b567c2d496f4e652a", - "source_tree": "sha256:5d9468e4f2a25af66ed366a9b353765f5d2845d3f39a36d72d17c6407b3e0ef1" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/scripts/pipeline-proofs/.crumb b/scripts/pipeline-proofs/.crumb index 4e0dbba..9f57e8b 100644 --- a/scripts/pipeline-proofs/.crumb +++ b/scripts/pipeline-proofs/.crumb @@ -2,15 +2,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-16T11:11:15Z", - "compiler": "crumb-compile/1", - "digest": "sha256:8389e63a46828e9ba6858867eb4ecf2f00b9fad4b8b2ccef9b9124b5a121d9ca", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 15, - "generated_at_commit": "dccc00620d24481bf4b12f6b567c2d496f4e652a", - "source_tree": "sha256:6361cde35dcf2c3de5cc74f6f4ce6c441bee54356bd9d5a2f8eb0dc5fb829f6b" + "compiler": "crumb-compile/2" } }, "layer": "tooling", diff --git a/scripts/pipeline-proofs/13-determinism.sh b/scripts/pipeline-proofs/13-determinism.sh index 5763055..784aa16 100755 --- a/scripts/pipeline-proofs/13-determinism.sh +++ b/scripts/pipeline-proofs/13-determinism.sh @@ -45,8 +45,8 @@ clone_repo "$TMP/c"; clone_repo "$TMP/d"; strip_generated "$TMP/c"; strip_genera ( cd "$TMP/c" && $CRUMB compile . >/dev/null ); sleep 1.1; ( cd "$TMP/d" && $CRUMB compile . >/dev/null ) R2=$(compare "$TMP/c" "$TMP/d" 'del(.extensions.generated.compiled_at)'); num "identical_minus_compiled_at_real_clock=$R2" check_eq "real clock, one second apart: identical apart from the compiled_at stamp" "$R2" "$(all_of "$R2")" -R3=$(compare "$TMP/c" "$TMP/d" '.extensions.generated.digest'); num "identical_digests_real_clock=$R3" -check_eq "every Merkle digest identical" "$R3" "$(all_of "$R3")" +D3c=$(cd "$TMP/c" && $CRUMB digest .); D3d=$(cd "$TMP/d" && $CRUMB digest .); num "root_digest_real_clock=$D3c" # D11: computed on demand, never stored +check_eq "root Merkle digest identical (crumb digest, D11)" "$D3c" "$D3d" R4=$(compare "$TMP/c" "$TMP/d" raw); num "raw_identical_real_clock=$R4" note "raw files under the real clock differ only in compiled_at (informational)" proof_end diff --git a/tools/.crumb b/tools/.crumb index fee0aa8..85c0521 100644 --- a/tools/.crumb +++ b/tools/.crumb @@ -13,21 +13,11 @@ "generated": { "children": [ { - "digest": "46303512a5bede09aaecf195930c326d80f38fc670dcf3fe2b585aa1989505fa", - "last_commit": "7291eb3", "name": "crumb", "purpose": "Directory tools/crumb. Purpose not yet described by a human." } ], - "children_root": "sha256:3528e983fc9cadf34fb3623db8eff77b0c2e110e62e472db3c0019dc8526dfa1", - "compiled_at": "2026-10-16T11:11:15Z", - "compiler": "crumb-compile/1", - "digest": "sha256:afa286ef45ae5a0a0fd880a27288f50f82138a2a092a0c3684c59597d20c9070", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 7, - "generated_at_commit": "dccc00620d24481bf4b12f6b567c2d496f4e652a", - "source_tree": "sha256:2e78ac3a2dea300d11eba0a0693b591903e4836769d5d9f2a468241e5208b73d" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/tools/crumb/.crumb b/tools/crumb/.crumb index 9a6326e..a40a812 100644 --- a/tools/crumb/.crumb +++ b/tools/crumb/.crumb @@ -6,15 +6,7 @@ "extensions": { "generated": { "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-16T11:11:15Z", - "compiler": "crumb-compile/1", - "digest": "sha256:46303512a5bede09aaecf195930c326d80f38fc670dcf3fe2b585aa1989505fa", - "evidence_files": 0, - "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 7, - "generated_at_commit": "dccc00620d24481bf4b12f6b567c2d496f4e652a", - "source_tree": "sha256:2e78ac3a2dea300d11eba0a0693b591903e4836769d5d9f2a468241e5208b73d" + "compiler": "crumb-compile/2" }, "owner_lane": "", "provenance": { diff --git a/tools/crumb/crumb-compile.sh b/tools/crumb/crumb-compile.sh index 1f45678..c42f4b8 100755 --- a/tools/crumb/crumb-compile.sh +++ b/tools/crumb/crumb-compile.sh @@ -28,7 +28,7 @@ set -eu die() { echo "crumb-compile: $*" >&2; exit 1; } need() { command -v "$1" >/dev/null 2>&1 || die "needs $1"; } need git; need jq; need sha256sum -COMPILER="crumb-compile/1" +COMPILER="crumb-compile/2" sha() { sha256sum | cut -c1-64; } ROOT_ARG="${2:-.}" @@ -82,18 +82,16 @@ compute() { # $1 dir -> prints the generated object (without stamps) as JSON 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}]') + kids=$(printf '%s' "$kids" | jq -c --arg n "$k" --arg g "$kdig" --arg p "$kpur" '. + [{name:$n,digest:$g,purpose:$p}]') 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")" - jq -cn --arg c "$COMPILER" --arg st "$st" --argjson nf "$nfiles" --argjson kids "$kids" --arg cr "$cr" \ - --argjson evn "$evn" --arg evr "$evr" --arg dig "$dig" \ - '{compiler:$c, source_tree:("sha256:"+$st), files:$nf, children:$kids, children_root:("sha256:"+$cr), - evidence_files:$evn, evidence_root:("sha256:"+$evr), digest:("sha256:"+$dig)}' + # D11: digests are computed (above) but never written; the committed block is structure only. + : "$nfiles" "$evn" + jq -cn --arg c "$COMPILER" --argjson kids "$kids" '{compiler:$c, children:($kids | map({name, purpose}))}' } -strip_stamps() { jq -cS "del(.generated_at_commit, .compiled_at)"; } +strip_stamps() { jq -cS .; } # D11: stamps are no longer written; a leftover stamp means STALE cmd=${1:-help} changed=0; stale=0; total=0 @@ -115,7 +113,7 @@ case "$cmd" in compile) tmp="$d/.crumb.tmp.$$" jq -S --argjson g "$new" --arg h "$HEAD" --arg t "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \ - '.extensions = (.extensions // {}) | .extensions.generated = ($g + {generated_at_commit:$h, compiled_at:$t})' \ + '.extensions = (.extensions // {}) | .extensions.generated = $g' \ "$d/.crumb" > "$tmp" && mv "$tmp" "$d/.crumb" changed=$((changed+1)); echo "COMPILED $d" ;; esac diff --git a/tools/crumb/crumb.c b/tools/crumb/crumb.c index fc755ef..f626a05 100644 --- a/tools/crumb/crumb.c +++ b/tools/crumb/crumb.c @@ -2000,9 +2000,7 @@ static J *comp_object(Comp *c, const char *d, char *dig_out) { /* the generate } char *kt = slurp(kcf); J *kj = kt ? jparse(kt) : NULL; const char *kp = kj ? jstrval(kj, "purpose") : NULL; if (!kp) kp = ""; 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(kname)); 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, "purpose", jstr(kpur)); /* D11: structure only */ jpush(kids, o); sha_add(&crs, kdig, strlen(kdig)); sha_add(&crs, "\n", 1); (void)kdig_own; } @@ -2010,14 +2008,13 @@ static J *comp_object(Comp *c, const char *d, char *dig_out) { /* the generate Sha ds; sha_init(&ds); sha_add(&ds, semc, strlen(semc)); sha_add(&ds, sth, 64); sha_add(&ds, crh, 64); sha_add(&ds, evh, 64); char dgh[65]; sha_hex(&ds, dgh); /* D3: content only, no stamps */ strcpy(dig_out, dgh); - J *g = jnew(JOBJ); char t[80]; - jset(g, "compiler", jstr("crumb-compile/1")); - snprintf(t, sizeof t, "sha256:%s", sth); jset(g, "source_tree", jstr(t)); - jset(g, "files", jnum(nfiles)); jset(g, "children", kids); - snprintf(t, sizeof t, "sha256:%s", crh); jset(g, "children_root", jstr(t)); - jset(g, "evidence_files", jnum(nev)); - snprintf(t, sizeof t, "sha256:%s", evh); jset(g, "evidence_root", jstr(t)); - snprintf(t, sizeof t, "sha256:%s", dgh); jset(g, "digest", jstr(t)); + /* D11 (2026-10-18): the committed block is structure only. The fingerprints above (source_tree, children_root, + * evidence_root, digest) changed with every file anywhere below, so every PR rewrote the root .crumb and every pair + * of open PRs conflicted on it. They are still computed (dig_out, `crumb digest`) but never written. */ + (void)nfiles; (void)nev; + J *g = jnew(JOBJ); + jset(g, "compiler", jstr("crumb-compile/2")); + jset(g, "children", kids); jsort(g); return g; } /* D3a (added by the C port): children[].last_commit is derived from history and changes with every commit that @@ -2049,6 +2046,7 @@ static void find_crumbs(const char *top, const char *rel, CDir **out, size_t *n, } /* mode: 'c' compile, 'v' verify, 's' status. Returns number of stale crumbs; *total set. */ +static char root_digest[72]; /* D11: root fingerprint of the last compile_engine run; printed by `crumb digest`, never stored */ static int compile_engine(char mode, const char *root, int quiet, int *total_out, char *head_out) { Comp c; memset(&c, 0, sizeof c); char *rq = shq(root), cmd[PATH_MAX + 80]; snprintf(cmd, sizeof cmd, "git -C %s rev-parse --show-toplevel 2>/dev/null", rq); @@ -2083,10 +2081,11 @@ static int compile_engine(char mode, const char *root, int quiet, int *total_out if (stat(full, &sb) || !S_ISREG(sb.st_mode)) continue; total++; char dg[65]; J *nw = comp_object(&c, d, dg); dig_set(&c, d, dg); + if (!strcmp(d, ".")) snprintf(root_digest, sizeof root_digest, "sha256:%s", dg); char *txt = slurp(full); J *cr = txt ? jparse(txt) : NULL; J *old = jnew(JOBJ); if (cr && cr->t == JOBJ) { J *x = jget(cr, "extensions"), *g = x && x->t == JOBJ ? jget(x, "generated") : NULL; - if (g && g->t == JOBJ) { old = jclone(g); jdel(old, "generated_at_commit"); jdel(old, "compiled_at"); } } + if (g && g->t == JOBJ) old = jclone(g); } /* D11: stamps are no longer written, so a leftover stamp means STALE */ jsort(old); strip_lc(old); J *nwc = jclone(nw); strip_lc(nwc); /* D3a: last_commit is a stamp for staleness */ char *ns = jcompact_s(nwc), *os = jcompact_s(old); @@ -2097,7 +2096,7 @@ static int compile_engine(char mode, const char *root, int quiet, int *total_out else { if (!cr || cr->t != JOBJ) die("cannot compile %s: not a JSON object", cp); J *x = jget(cr, "extensions"); if (!x || x->t != JOBJ) { x = jnew(JOBJ); jset(cr, "extensions", x); } - J *g = jclone(nw); jset(g, "generated_at_commit", jstr(head)); jset(g, "compiled_at", jstr(stamp)); + J *g = jclone(nw); /* D11: no generated_at_commit / compiled_at stamps: they put every rewrite on the same line */ jset(x, "generated", g); jsort(cr); char *out = jdump(cr), *tmp = xmalloc(strlen(full) + 32); snprintf(tmp, strlen(full) + 32, "%s.tmp.%ld", full, (long)getpid()); FILE *f = fopen(tmp, "wb"); if (!f) die("cannot write %s", tmp); @@ -2118,6 +2117,11 @@ static int compile_engine(char mode, const char *root, int quiet, int *total_out return stale; } static int cmd_compile(char mode, const char *root) { int t; int s = compile_engine(mode, root, 0, &t, NULL); return mode == 'v' && s ? 1 : 0; } +static int cmd_digest(const char *root) { /* D11: the fingerprint is computed on demand, never stored */ + int t; root_digest[0] = 0; compile_engine('s', root, 1, &t, NULL); + if (!root_digest[0]) die("crumb digest: no root .crumb in %s", root); + printf("%s\n", root_digest); return 0; +} static int cmd_propose(const char *dir, const char *purpose) { /* D5: only extensions.proposed, never .purpose */ char *cp = pjoin(dir, ".crumb"), *txt = slurp(cp); if (!txt) die("no .crumb in %s", dir); @@ -2241,6 +2245,7 @@ static void usage(void) { " explain nearest + inherited crumbs, coordination, commits, evidence, newest continuation\n" " compile [root] RFC-0003: regenerate structural crumb data bottom-up (Merkle digests)\n" " verify [root] exit 1 if any committed crumb differs from what compile would write\n" + " digest [root] print the root fingerprint (computed now, never stored, D11)\n" " status [root] CURRENT / STALE / UNCOMPILED per crumb\n" " propose write extensions.proposed.purpose (never .purpose)\n" " context [path] entry point: tree, what to read, conflicts, continuation, freshness\n" @@ -2278,6 +2283,7 @@ int main(int argc, char **argv) { if (!strcmp(c, "sha256") && a == 0) { Sha s; char h[65]; unsigned char t[8192]; size_t n; sha_init(&s); while ((n = fread(t, 1, sizeof t, stdin)) > 0) sha_add(&s, t, n); sha_hex(&s, h); printf("%s\n", h); return 0; } if (!strcmp(c, "compile") && a <= 1) return cmd_compile('c', a ? v[0] : "."); if (!strcmp(c, "verify") && a <= 1) return cmd_compile('v', a ? v[0] : "."); + if (!strcmp(c, "digest") && a <= 1) return cmd_digest(a ? v[0] : "."); if (!strcmp(c, "status") && a <= 1) return cmd_compile('s', a ? v[0] : "."); if (!strcmp(c, "propose") && a == 2) return cmd_propose(v[0], v[1]); if (!strcmp(c, "context") && a <= 1) return cmd_context(a ? v[0] : "."); diff --git a/tools/crumb/test.sh b/tools/crumb/test.sh index 6938285..e245aeb 100644 --- a/tools/crumb/test.sh +++ b/tools/crumb/test.sh @@ -151,10 +151,24 @@ git add -A && git -c user.name=t -c user.email=t@t commit -qm compiled git -c user.name=t -c user.email=t@t commit -q --allow-empty -m "empty" && "$C" verify . >/dev/null && ok "C3 empty commit keeps verify OK (stamps are not inputs)" || bad "C3 empty commit" echo 'int b2;' > src/deep/b.c; git add -A out=$("$C" verify .); st=$(echo "$out" | grep '^STALE' | awk '{print $2}' | sort | tr '\n' ' ') -[ "$st" = ". src src/deep " ] && ok "C3 touching src/deep/b.c: STALE is exactly src/deep, src and the root (ancestors only)" || bad "C3 ancestor-only staleness (got: $st)" +[ -z "$st" ] && ok "C3 D11 touching src/deep/b.c stales no crumb (file contents are not stored)" || bad "C3 D11 content edit staled crumbs (got: $st)" echo "$out" | grep -q 'docs\|evidence' && bad "C3 sibling dirs stay current" || ok "C3 sibling dirs stay current" "$C" compile . >/dev/null; "$C" verify . >/dev/null && ok "C3 compile after the change: verify OK again" || bad "C3 recompile" git add -A; git -c user.name=t -c user.email=t@t commit -qm "change + compile"; "$C" verify . >/dev/null && ok "C3 verify stays OK after the compiled change is committed (last_commit is not an input, D3a)" || bad "C3 D3a last_commit" +# D11 (RFC-0003 amendment 2026-10-18): the committed generated block holds structure only (which crumbed children, their +# purposes), never fingerprints of file contents. Two PRs that touch files in different directories then never both rewrite +# a .crumb, so they never conflict on one; git already fingerprints every tree, and `crumb digest` computes ours on demand. +g() { git -c user.name=t -c user.email=t@t "$@"; } +g checkout -qb d11x && echo 'int x;' > src/a.c && "$C" compile . >/dev/null && g add -A && g commit -qm x +g checkout -q main && g checkout -qb d11y && echo n2 > docs/n.md && "$C" compile . >/dev/null && g add -A && g commit -qm y +g checkout -q main +if g merge -q --no-edit d11x >/dev/null 2>&1 && g merge -q --no-edit d11y >/dev/null 2>&1; then ok "D11 two PRs in different directories merge with no .crumb conflict" +else bad "D11 two PRs in different directories conflict on: $(git diff --name-only --diff-filter=U | tr '\n' ' ')"; g merge --abort 2>/dev/null; fi +"$C" verify . >/dev/null && ok "D11 verify OK on main after both merges, without a recompile" || bad "D11 verify after both merges" +"$C" digest . | grep -qE '^sha256:[0-9a-f]{64}$' && ok "D11 digest computes the root fingerprint on demand" || bad "D11 digest" +mkdir -p lib && echo 'int l;' > lib/l.c && "$C" seed . >/dev/null && g add -A +"$C" verify . >/dev/null; [ $? -eq 1 ] && ok "D11 a new crumbed directory still stales its parent (structure is checked)" || bad "D11 structure staleness" +"$C" compile . >/dev/null && "$C" verify . >/dev/null && g add -A && g commit -qm lib && ok "D11 compile records the new child" || bad "D11 compile new child" before=$(jq -r .purpose docs/.crumb); sem0=$(jq -cS '{purpose,layer,invariants,exports,related,boundaries}' src/.crumb) "$C" propose docs "Design notes and decision records" | grep -q PROPOSED && ok "C3 propose prints PROPOSED" || bad "C3 propose" [ "$(jq -r .purpose docs/.crumb)" = "$before" ] && [ "$(jq -r .extensions.proposed.purpose docs/.crumb)" = "Design notes and decision records" ] && [ "$(jq -r .extensions.proposed.status docs/.crumb)" = PROPOSED ] && ok "C3 propose never changes .purpose, writes extensions.proposed" || bad "C3 propose purpose" @@ -164,7 +178,7 @@ for h in 'TREE' 'YOUR TASK TOUCHES' 'READ THESE CRUMBS' 'CURRENT CONFLICTS' 'REL echo "$ctx" | grep -q "^== $h" && ok "C3 context prints section: $h" || bad "C3 context section: $h" done "$C" verify . >/dev/null && ok "C3 propose does not stale crumbs (proposal is not a digest input)" || bad "C3 propose stale" -echo x >> src/a.c; git add -A; "$C" context src/a.c | grep -q "^Crumbs STALE: 2 .*run crumb compile" && ok "C3 context freshness: STALE: n (run crumb compile)" || bad "C3 context stale line" +jq '.purpose="Deep sources for the context test"' src/deep/.crumb > src/deep/.crumb.t && mv src/deep/.crumb.t src/deep/.crumb; git add -A; "$C" context src/a.c | grep -q "^Crumbs STALE: 1 .*run crumb compile" && ok "C3 context freshness: STALE: n (run crumb compile)" || bad "C3 context stale line" "$C" compile . >/dev/null; "$C" context src | grep -q '^Crumbs CURRENT at HEAD' && ok "C3 context freshness: CURRENT at HEAD " || bad "C3 context current line" "$C" context src/deep/b.c | grep -q 'src/.crumb' && "$C" context src/deep/b.c | grep -q 'src/deep/.crumb' && ok "C3 context recommends the path's ancestor crumbs" || bad "C3 context ancestors" "$C" context . | grep -q 'PROPOSED: Design notes' && ok "C3 context shows PROPOSED purpose for a child without .purpose" || bad "C3 context proposed" @@ -177,14 +191,14 @@ echo x >> src/a.c; git add -A; "$C" context src/a.c | grep -q "^Crumbs STALE: 2 "$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)" +[ "$st" = "src src/mid/leaf " ] && ok "C3 D7+D11 new crumb under an uncrumbed dir stales itself and its nearest crumbed ancestor only" || 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)" +[ "$st" = "src " ] && ok "C3 D7+D11 deleting the deep crumb stales its parent src (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" @@ -193,13 +207,13 @@ git add -A; git -c user.name=t -c user.email=t@t commit -qm "orphan removed" "$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 st=$("$C" verify . | grep '^STALE' | awk '{print $2}' | sort | tr '\n' ' ') -[ "$st" = ". src " ] && ok "C3 D10 adding .crumbignore stales only the parent and its ancestors (children list changed)" || bad "C3 D10 ignore stale set (got: $st)" +[ "$st" = "src " ] && ok "C3 D10+D11 adding .crumbignore stales only the parent (children list changed)" || bad "C3 D10 ignore stale set (got: $st)" "$C" compile . >/dev/null [ "$(cat src/deep/.crumb)" = "$ev0" ] && ok "C3 D10 compile never rewrites a .crumb under an ignored subtree" || bad "C3 D10 ignored crumb rewritten" jq -e '.extensions.generated.children | map(.name) | index("deep") == null' src/.crumb >/dev/null && ok "C3 D10 ignored directory is not a child of its parent" || bad "C3 D10 ignored child listed" "$C" status . | grep -q 'src/deep' && bad "C3 D10 status lists ignored dir" || ok "C3 D10 status does not list the ignored directory" echo 'int b3;' > src/deep/b.c; git add -A; st=$("$C" verify . | grep '^STALE' | awk '{print $2}' | sort | tr '\n' ' ') -[ "$st" = ". src " ] && ok "C3 D10 a file under the ignored subtree still stales the enclosing crumbs, never the ignored one" || bad "C3 D10 enclosing stale (got: $st)" +[ -z "$st" ] && ok "C3 D10+D11 a file under the ignored subtree stales nothing" || bad "C3 D10 enclosing stale (got: $st)" "$C" compile . >/dev/null; [ "$(cat src/deep/.crumb)" = "$ev0" ] && ok "C3 D10 ignored crumb still untouched after that compile" || bad "C3 D10 ignored crumb touched" rm .crumbignore; "$C" compile . >/dev/null; "$C" verify . >/dev/null && ok "C3 D10 removing .crumbignore and recompiling returns to OK" || bad "C3 D10 remove ignore" git add -A; git -c user.name=t -c user.email=t@t commit -qm "post-ignore" From 82ed359a9d9f2aed6dd46f7e5b3eee23d6aeb14d Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Sun, 18 Oct 2026 11:36:48 -0500 Subject: [PATCH 2/3] crumb: read crumb-compile/1 blocks by structure (D11 migration) verify and status now judge a leftover crumb-compile/1 generated block by the same structure-only rule as /2 (children names and purposes), so one installed tool reads every repo while each one recompiles at its own pace. compile still rewrites a /1 block as /2. Without this, installing the /2 tool on the Spark judge marks every crumb in every repo STALE (checked on origin/main of 8 repos: sc 16/16, omega 157/157, aienos 91/91 ...), and keeping the old tool marks this PR's own 28 crumbs STALE (the Spark status for d8a7b9ea was BLOCKED for exactly that). Red then green: the new test "D11 verify accepts a /1 block whose structure is current" fails on d8a7b9ea and passes here; make -C tools/crumb test exit 0. Co-Authored-By: Claude Opus 5.5 --- docs/CRUMB_PROTOCOL_RFC_0003.md | 2 +- tools/crumb/crumb-compile.sh | 1 + tools/crumb/crumb.c | 15 +++++++++++++++ tools/crumb/test.sh | 9 +++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/CRUMB_PROTOCOL_RFC_0003.md b/docs/CRUMB_PROTOCOL_RFC_0003.md index 2924aff..9aec078 100644 --- a/docs/CRUMB_PROTOCOL_RFC_0003.md +++ b/docs/CRUMB_PROTOCOL_RFC_0003.md @@ -42,7 +42,7 @@ Until now people and agents wrote the descriptions in crumbs by hand, and they w | 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 `/.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`. | -| D11 | Added 2026-10-18. The committed generated block is structure only: `compiler` and `children[{name, purpose}]`. `source_tree`, `files`, `children[].digest`, `children_root`, `evidence_files`, `evidence_root`, `digest`, `children[].last_commit`, `generated_at_commit` and `compiled_at` are no longer written; the Merkle digests are computed on demand (`crumb digest`). A crumb is STALE only when its children or their purposes change. Supersedes the storage parts of D3, D3a and the "touching one file stales its ancestors" rule. | `source_tree` covered every file below a directory, so any change anywhere rewrote the root `.crumb` and every pair of open pull requests conflicted on it (2026-10-18: most open PRs CONFLICTING, root `.crumb` the only conflicting file). Git already fingerprints every tree; a second copy stored inside the tree it fingerprints can only collide. | +| D11 | Added 2026-10-18. The committed generated block is structure only: `compiler` and `children[{name, purpose}]`. `source_tree`, `files`, `children[].digest`, `children_root`, `evidence_files`, `evidence_root`, `digest`, `children[].last_commit`, `generated_at_commit` and `compiled_at` are no longer written; the Merkle digests are computed on demand (`crumb digest`). A crumb is STALE only when its children or their purposes change. Supersedes the storage parts of D3, D3a and the "touching one file stales its ancestors" rule. Migration (C tool): `verify` and `status` judge a leftover `crumb-compile/1` block by the same structure-only rule, so one installed tool reads both formats while repos recompile at their own pace; `compile` rewrites it as `/2`. | `source_tree` covered every file below a directory, so any change anywhere rewrote the root `.crumb` and every pair of open pull requests conflicted on it (2026-10-18: most open PRs CONFLICTING, root `.crumb` the only conflicting file). Git already fingerprints every tree; a second copy stored inside the tree it fingerprints can only collide. | ## 5. Commands diff --git a/tools/crumb/crumb-compile.sh b/tools/crumb/crumb-compile.sh index c42f4b8..a523820 100755 --- a/tools/crumb/crumb-compile.sh +++ b/tools/crumb/crumb-compile.sh @@ -24,6 +24,7 @@ # D9 Output is written with jq -S (sorted keys) via tmp+rename, byte-stable, so `verify` can be an exact comparison. # D10 (C tool only) /.crumbignore subtrees never take part in compile/verify/status; this shell reference # does not implement D10, so the differential holds only for repositories without a .crumbignore. +# D11 migration (C tool only): verify/status read a leftover crumb-compile/1 block by structure; this reference does not. set -eu die() { echo "crumb-compile: $*" >&2; exit 1; } need() { command -v "$1" >/dev/null 2>&1 || die "needs $1"; } diff --git a/tools/crumb/crumb.c b/tools/crumb/crumb.c index f626a05..800a297 100644 --- a/tools/crumb/crumb.c +++ b/tools/crumb/crumb.c @@ -2021,6 +2021,20 @@ static J *comp_object(Comp *c, const char *d, char *dig_out) { /* the generate * touches the child, exactly like the stamps of D3. It is written by compile but never decides STALE; otherwise a * PR could never pass verify (committing changes last_commit, which would need another compile, forever). */ static void strip_lc(J *g) { J *k = jget(g, "children"); if (k && k->t == JARR) for (size_t i = 0; i < k->n; i++) if (k->v[i]->t == JOBJ) jdel(k->v[i], "last_commit"); } +/* D11 migration: verify and status judge a crumb-compile/1 block by structure only, the same rule as /2, so one + * installed tool reads both formats while repos recompile at their own pace. compile still rewrites /1 into /2. */ +static J *struct_only(const J *g) { + const char *cv = jstrval(g, "compiler"); + if (!cv || strcmp(cv, "crumb-compile/1")) return jclone((J *)g); + J *o = jnew(JOBJ), *kids = jnew(JARR), *k = jget(g, "children"); + if (k && k->t == JARR) for (size_t i = 0; i < k->n; i++) { + const J *c = k->v[i]; if (c->t != JOBJ) continue; + const char *nm = jstrval(c, "name"), *pu = jstrval(c, "purpose"); + char *p = xstrdup(pu ? pu : ""); chomp(p); + J *e = jnew(JOBJ); jset(e, "name", jstr(nm ? nm : "")); jset(e, "purpose", jstr(p)); jpush(kids, e); + } + jset(o, "compiler", jstr("crumb-compile/2")); jset(o, "children", kids); jsort(o); return o; +} typedef struct { char *d; int depth; } CDir; static int cdcmp(const void *a, const void *b) { const CDir *x = a, *y = b; @@ -2086,6 +2100,7 @@ static int compile_engine(char mode, const char *root, int quiet, int *total_out J *old = jnew(JOBJ); if (cr && cr->t == JOBJ) { J *x = jget(cr, "extensions"), *g = x && x->t == JOBJ ? jget(x, "generated") : NULL; if (g && g->t == JOBJ) old = jclone(g); } /* D11: stamps are no longer written, so a leftover stamp means STALE */ + if (mode != 'c') old = struct_only(old); jsort(old); strip_lc(old); J *nwc = jclone(nw); strip_lc(nwc); /* D3a: last_commit is a stamp for staleness */ char *ns = jcompact_s(nwc), *os = jcompact_s(old); diff --git a/tools/crumb/test.sh b/tools/crumb/test.sh index e245aeb..95df89b 100644 --- a/tools/crumb/test.sh +++ b/tools/crumb/test.sh @@ -169,6 +169,15 @@ else bad "D11 two PRs in different directories conflict on: $(git diff --name-on mkdir -p lib && echo 'int l;' > lib/l.c && "$C" seed . >/dev/null && g add -A "$C" verify . >/dev/null; [ $? -eq 1 ] && ok "D11 a new crumbed directory still stales its parent (structure is checked)" || bad "D11 structure staleness" "$C" compile . >/dev/null && "$C" verify . >/dev/null && g add -A && g commit -qm lib && ok "D11 compile records the new child" || bad "D11 compile new child" +# D11 migration: a crumb-compile/1 block (fingerprints, stamps) is judged by structure only, so one installed tool reads +# repos that have not recompiled yet; a structural change still stales it, and compile rewrites it as /2. +cp .crumb "$T/root.crumb2" +jq '.extensions.generated |= (.compiler = "crumb-compile/1" | .source_tree = "sha256:00" | .digest = "sha256:00" | .compiled_at = "2026-01-01T00:00:00Z" | .children |= map(. + {digest: "00", last_commit: "0000000"}))' "$T/root.crumb2" > .crumb +"$C" verify . >/dev/null && ok "D11 verify accepts a /1 block whose structure is current" || bad "D11 verify refused a current /1 block" +jq '.extensions.generated.children[0].purpose = "something else"' .crumb > "$T/root.crumb1" && cp "$T/root.crumb1" .crumb +"$C" verify . >/dev/null; [ $? -eq 1 ] && ok "D11 a /1 block with a changed child purpose is STALE" || bad "D11 /1 structure staleness" +"$C" compile . >/dev/null && [ "$(jq -r .extensions.generated.compiler .crumb)" = crumb-compile/2 ] && [ "$(jq -r '.extensions.generated | has("source_tree")' .crumb)" = false ] && "$C" verify . >/dev/null && ok "D11 compile rewrites a /1 block as /2" || bad "D11 /1 -> /2 rewrite" +cmp -s .crumb "$T/root.crumb2" && ok "D11 the /2 rewrite equals the original /2 block" || bad "D11 /2 rewrite differs" before=$(jq -r .purpose docs/.crumb); sem0=$(jq -cS '{purpose,layer,invariants,exports,related,boundaries}' src/.crumb) "$C" propose docs "Design notes and decision records" | grep -q PROPOSED && ok "C3 propose prints PROPOSED" || bad "C3 propose" [ "$(jq -r .purpose docs/.crumb)" = "$before" ] && [ "$(jq -r .extensions.proposed.purpose docs/.crumb)" = "Design notes and decision records" ] && [ "$(jq -r .extensions.proposed.status docs/.crumb)" = PROPOSED ] && ok "C3 propose never changes .purpose, writes extensions.proposed" || bad "C3 propose purpose" From b1ab415a1cd34b1083f0c65bc7977bdb8af7e20c Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Sun, 18 Oct 2026 11:42:33 -0500 Subject: [PATCH 3/3] Revert "crumb: read crumb-compile/1 blocks by structure (D11 migration)" This reverts commit 82ed359. Not needed: sc#605 makes the Spark judge check aien-architecture with the tool at the commit under test and every other repo with its crumb.lock pin, so no single installed tool has to read both formats. Tree is identical to d8a7b9ea; D11 stays as written. Co-Authored-By: Claude Opus 5.5 --- docs/CRUMB_PROTOCOL_RFC_0003.md | 2 +- tools/crumb/crumb-compile.sh | 1 - tools/crumb/crumb.c | 15 --------------- tools/crumb/test.sh | 9 --------- 4 files changed, 1 insertion(+), 26 deletions(-) diff --git a/docs/CRUMB_PROTOCOL_RFC_0003.md b/docs/CRUMB_PROTOCOL_RFC_0003.md index 9aec078..2924aff 100644 --- a/docs/CRUMB_PROTOCOL_RFC_0003.md +++ b/docs/CRUMB_PROTOCOL_RFC_0003.md @@ -42,7 +42,7 @@ Until now people and agents wrote the descriptions in crumbs by hand, and they w | 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 `/.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`. | -| D11 | Added 2026-10-18. The committed generated block is structure only: `compiler` and `children[{name, purpose}]`. `source_tree`, `files`, `children[].digest`, `children_root`, `evidence_files`, `evidence_root`, `digest`, `children[].last_commit`, `generated_at_commit` and `compiled_at` are no longer written; the Merkle digests are computed on demand (`crumb digest`). A crumb is STALE only when its children or their purposes change. Supersedes the storage parts of D3, D3a and the "touching one file stales its ancestors" rule. Migration (C tool): `verify` and `status` judge a leftover `crumb-compile/1` block by the same structure-only rule, so one installed tool reads both formats while repos recompile at their own pace; `compile` rewrites it as `/2`. | `source_tree` covered every file below a directory, so any change anywhere rewrote the root `.crumb` and every pair of open pull requests conflicted on it (2026-10-18: most open PRs CONFLICTING, root `.crumb` the only conflicting file). Git already fingerprints every tree; a second copy stored inside the tree it fingerprints can only collide. | +| D11 | Added 2026-10-18. The committed generated block is structure only: `compiler` and `children[{name, purpose}]`. `source_tree`, `files`, `children[].digest`, `children_root`, `evidence_files`, `evidence_root`, `digest`, `children[].last_commit`, `generated_at_commit` and `compiled_at` are no longer written; the Merkle digests are computed on demand (`crumb digest`). A crumb is STALE only when its children or their purposes change. Supersedes the storage parts of D3, D3a and the "touching one file stales its ancestors" rule. | `source_tree` covered every file below a directory, so any change anywhere rewrote the root `.crumb` and every pair of open pull requests conflicted on it (2026-10-18: most open PRs CONFLICTING, root `.crumb` the only conflicting file). Git already fingerprints every tree; a second copy stored inside the tree it fingerprints can only collide. | ## 5. Commands diff --git a/tools/crumb/crumb-compile.sh b/tools/crumb/crumb-compile.sh index a523820..c42f4b8 100755 --- a/tools/crumb/crumb-compile.sh +++ b/tools/crumb/crumb-compile.sh @@ -24,7 +24,6 @@ # D9 Output is written with jq -S (sorted keys) via tmp+rename, byte-stable, so `verify` can be an exact comparison. # D10 (C tool only) /.crumbignore subtrees never take part in compile/verify/status; this shell reference # does not implement D10, so the differential holds only for repositories without a .crumbignore. -# D11 migration (C tool only): verify/status read a leftover crumb-compile/1 block by structure; this reference does not. set -eu die() { echo "crumb-compile: $*" >&2; exit 1; } need() { command -v "$1" >/dev/null 2>&1 || die "needs $1"; } diff --git a/tools/crumb/crumb.c b/tools/crumb/crumb.c index 800a297..f626a05 100644 --- a/tools/crumb/crumb.c +++ b/tools/crumb/crumb.c @@ -2021,20 +2021,6 @@ static J *comp_object(Comp *c, const char *d, char *dig_out) { /* the generate * touches the child, exactly like the stamps of D3. It is written by compile but never decides STALE; otherwise a * PR could never pass verify (committing changes last_commit, which would need another compile, forever). */ static void strip_lc(J *g) { J *k = jget(g, "children"); if (k && k->t == JARR) for (size_t i = 0; i < k->n; i++) if (k->v[i]->t == JOBJ) jdel(k->v[i], "last_commit"); } -/* D11 migration: verify and status judge a crumb-compile/1 block by structure only, the same rule as /2, so one - * installed tool reads both formats while repos recompile at their own pace. compile still rewrites /1 into /2. */ -static J *struct_only(const J *g) { - const char *cv = jstrval(g, "compiler"); - if (!cv || strcmp(cv, "crumb-compile/1")) return jclone((J *)g); - J *o = jnew(JOBJ), *kids = jnew(JARR), *k = jget(g, "children"); - if (k && k->t == JARR) for (size_t i = 0; i < k->n; i++) { - const J *c = k->v[i]; if (c->t != JOBJ) continue; - const char *nm = jstrval(c, "name"), *pu = jstrval(c, "purpose"); - char *p = xstrdup(pu ? pu : ""); chomp(p); - J *e = jnew(JOBJ); jset(e, "name", jstr(nm ? nm : "")); jset(e, "purpose", jstr(p)); jpush(kids, e); - } - jset(o, "compiler", jstr("crumb-compile/2")); jset(o, "children", kids); jsort(o); return o; -} typedef struct { char *d; int depth; } CDir; static int cdcmp(const void *a, const void *b) { const CDir *x = a, *y = b; @@ -2100,7 +2086,6 @@ static int compile_engine(char mode, const char *root, int quiet, int *total_out J *old = jnew(JOBJ); if (cr && cr->t == JOBJ) { J *x = jget(cr, "extensions"), *g = x && x->t == JOBJ ? jget(x, "generated") : NULL; if (g && g->t == JOBJ) old = jclone(g); } /* D11: stamps are no longer written, so a leftover stamp means STALE */ - if (mode != 'c') old = struct_only(old); jsort(old); strip_lc(old); J *nwc = jclone(nw); strip_lc(nwc); /* D3a: last_commit is a stamp for staleness */ char *ns = jcompact_s(nwc), *os = jcompact_s(old); diff --git a/tools/crumb/test.sh b/tools/crumb/test.sh index 95df89b..e245aeb 100644 --- a/tools/crumb/test.sh +++ b/tools/crumb/test.sh @@ -169,15 +169,6 @@ else bad "D11 two PRs in different directories conflict on: $(git diff --name-on mkdir -p lib && echo 'int l;' > lib/l.c && "$C" seed . >/dev/null && g add -A "$C" verify . >/dev/null; [ $? -eq 1 ] && ok "D11 a new crumbed directory still stales its parent (structure is checked)" || bad "D11 structure staleness" "$C" compile . >/dev/null && "$C" verify . >/dev/null && g add -A && g commit -qm lib && ok "D11 compile records the new child" || bad "D11 compile new child" -# D11 migration: a crumb-compile/1 block (fingerprints, stamps) is judged by structure only, so one installed tool reads -# repos that have not recompiled yet; a structural change still stales it, and compile rewrites it as /2. -cp .crumb "$T/root.crumb2" -jq '.extensions.generated |= (.compiler = "crumb-compile/1" | .source_tree = "sha256:00" | .digest = "sha256:00" | .compiled_at = "2026-01-01T00:00:00Z" | .children |= map(. + {digest: "00", last_commit: "0000000"}))' "$T/root.crumb2" > .crumb -"$C" verify . >/dev/null && ok "D11 verify accepts a /1 block whose structure is current" || bad "D11 verify refused a current /1 block" -jq '.extensions.generated.children[0].purpose = "something else"' .crumb > "$T/root.crumb1" && cp "$T/root.crumb1" .crumb -"$C" verify . >/dev/null; [ $? -eq 1 ] && ok "D11 a /1 block with a changed child purpose is STALE" || bad "D11 /1 structure staleness" -"$C" compile . >/dev/null && [ "$(jq -r .extensions.generated.compiler .crumb)" = crumb-compile/2 ] && [ "$(jq -r '.extensions.generated | has("source_tree")' .crumb)" = false ] && "$C" verify . >/dev/null && ok "D11 compile rewrites a /1 block as /2" || bad "D11 /1 -> /2 rewrite" -cmp -s .crumb "$T/root.crumb2" && ok "D11 the /2 rewrite equals the original /2 block" || bad "D11 /2 rewrite differs" before=$(jq -r .purpose docs/.crumb); sem0=$(jq -cS '{purpose,layer,invariants,exports,related,boundaries}' src/.crumb) "$C" propose docs "Design notes and decision records" | grep -q PROPOSED && ok "C3 propose prints PROPOSED" || bad "C3 propose" [ "$(jq -r .purpose docs/.crumb)" = "$before" ] && [ "$(jq -r .extensions.proposed.purpose docs/.crumb)" = "Design notes and decision records" ] && [ "$(jq -r .extensions.proposed.status docs/.crumb)" = PROPOSED ] && ok "C3 propose never changes .purpose, writes extensions.proposed" || bad "C3 propose purpose"