Skip to content

quilt kernel P7: canon ledger — Layer H, the git log verified against the claim - #8

Closed
SuperInstance wants to merge 1 commit into
quilt-kernel-p6-tidepoolfrom
canon-ledger-p7
Closed

SuperInstance wants to merge 1 commit into
quilt-kernel-p6-tidepoolfrom
canon-ledger-p7

Conversation

@SuperInstance

Copy link
Copy Markdown
Owner

What

Fleet canon Layer H lands on hermit. Doctrine (SuperInstance/SuperInstance#18): the repo's git log IS the ledger. verify(t) replays the log and verifies every packet against the Layer C claim (CANON.md, hermit#7). The claim becomes load-bearing: drift fails CI, loudly, at the commit that caused it.

Rules enforced

  1. Feed integrity — a kernel commit (src/quilt/**) fails verification if the claim no longer says feeds: [tidepool]. Editing CANON.md to drop the acknowledgment breaks the ledger on every kernel packet.
  2. Canonical-doc removal attribution — a canonical doc removed from the claim's canonical_docs is attributed to the exact commit that deleted it (tree check against commit AND parent, not the worktree).
  3. Replay determinism — rebuilding the packet log from the same commits yields the same FNV-1a 64 replayHash, or the ledger is forked.

Numbers

  • src/quilt/canon-ledger.ts (~200 lines) + tests/canon-ledger.test.ts11/11 pass, hermetic tmp-git fixtures, no network
  • Full suite: 411 pass / 4 pre-existing env fails (lobster artwork pipeline — verified failing on the clean base branch, magick/dwebp env)
  • Smoke on hermit itself (implicit mode, CANON.md pending CANON.md: hermit joins the fleet canon (Layer C) #7): 4 packets replayed, all tagged feeds:tidepool

CLI

bun run src/quilt/canon-ledger.ts [repoPath]   # exit 1 on failure

Stacked on #6 (quilt-kernel-p6-tidepool). Layers: #7 = Layer C claim, this = Layer H ledger.

… the claim

Fleet canon doctrine: the repo's git log IS the ledger. verify(t) replays
the log and verifies every packet against the Layer C claim (CANON.md).
In hermit this was provable but unclaimed: the bench contract and quilt
kernel commits exist, the claim didn't. Now the claim is load-bearing.

- src/quilt/canon-ledger.ts
  - parseClaim/loadClaim: Layer C front matter -> typed claim (yaml)
  - buildPackets: git log replay over the claim's scope (canonical docs
    + CANON.md + src/quilt/), oldest first, each packet tagged with the
    claim fields it serves (feeds:tidepool, canonical_docs:<path>, claim)
  - verify: kernel commits fail if the claim drops feeds:[tidepool];
    a canonical doc's REMOVAL is attributed to the exact commit that
    deleted it (tree check against commit and parent, not the worktree)
  - replayHash: FNV-1a 64 over the canonical serialization — drift is
    one string, not a feeling (same algo as the fleet rate limiter)
  - CLI: bun run src/quilt/canon-ledger.ts [repo] — exit 1 on failure
  - Implicit mode when CANON.md is absent (this ref predates PR #7):
    kernel scope only, packets ok with a declared warning

- tests/canon-ledger.test.ts: 11 hermetic fixtures (tmp git repos), no
  network. Includes replay determinism (rebuild -> identical hash) and
  ledger growth changing the hash.

Suite: 411 pass / 4 pre-existing env fails (lobster artwork pipeline,
verified failing on the clean base branch — magick/dwebp env).

Ref: SuperInstance/SuperInstance PR openclaw#18 (fleet-canon doctrine), hermit PR #7 (Layer C claim)
SuperInstance added a commit that referenced this pull request Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant