/ Stream
build 2026.12.03 · --:--:-- UTC · RSS

BabbTools for the frontier.

mascot mascot
All materials

Reply 01: Kernel self-building

01-kernel-self-building.md View the source file

Date: Sun 2026-11-29, 01:49 EST

User question: "those are great, thanks! now looking at my kernel work, perhaps what's in rust, and other documents, help me also articulate more how we so far have approached the ways in which the kernel can sort of build itself through appying checks to its first and subsequent logs, building up lines in order to check and buildin its own earlity which it then confirms. remind me about all that" [verbatim, Morgen's spelling]

Source: Side chat "Study stream repo (babbworks/stream)", chat_id 5a4a8f6c-4ca2-485a-b4d8-9fec312fd1ca. Assistant reply reproduced in full and verbatim from the chat transcript. Sources cited in the reply are at babbworks/stream main 525c084.

Status: Lab/prose record of a discussion. Not adopted, not frozen, no kernel code, no status relabelling.


Yes — and this is the part where the v1 kernel as built and the unfolding-kernel aspiration are two different stories, so I'll keep them apart. The short version first, then the full reminder.

The short version: in v1 the kernel does not build itself from nothing. It starts from a fixed, hashed descriptor, and the log builds itself — its Register, its authority, its vocabulary — by folding entries in order, each entry read under the declarations in force at its own position. The checks are what let each later line trust the earlier ones: canonical form, authority tracing to genesis, seals chaining segments, rejections journaled so a retry gets the same answer. The unfolding model is the aspiration to shrink that fixed beginning down to a seed plus a segment 0 that learns its vocabulary — and that part is not built, and the sources say so plainly.

1. The fixed beginning v1 actually starts from

spec/kernel.descriptor (68 lines, 3,688 B) — "This file is the kernel. Its SHA-256 is the kernel's identity." That hash is fed5b36e80bad10c0545aa82ad5996175cebeb56e0af166162ddb5ff0c09202b, independently recomputed and matching the README.

Every log's first line is the preamble, exactly:

STREAM/1 kernel=sha256:<64 lowercase hex>

"This line never changes form under any kernel version." Then genesis follows and "fixes the log's identity, its root authority, its first clock and its timezone" (design/stream/kernel-identity.md):

1752300000 OPEN log:c1 {"clock":"ntp","kind":"genesis","log":"c1","rec":"actor:root","root":["actor:root"],"tz":"UTC"}

The descriptor's three core rules, the whole kernel in one paragraph:

  1. Append only. Nothing written is ever changed or removed.
  2. An entry is valid if it is well formed, canonical, and its recorder's authority traces to a root named in genesis.
  3. An entry is read under the declarations in force at its position.

Rule 3 is the one that lets the log build itself up: "The third rule is what lets a vocabulary grow without disturbing history. A later declaration changes how later entries read, never how earlier ones did." (kernel-identity.md)

2. How the log builds its own state, line by line, in order

This is the fold. The master formula, from docs/overview/stream-overview.md:

S = f_θ(L) = fold(step_θ, S₀, L)

S₀ is the empty state — in the unfolding model's language, four empty containers: structure, Register, authority, Books. Every entry is then applied in sequence, and the state at any address is the fold over the prefix up to that address. Nothing is stored as a balance; balances, boards, traces and views are folds over the log.

What gets built up, in order:

  • The Register — declarations enter it as they're read. A CREATE declares a unit, a profile, a view; a BIND adopts a whole pack of them at once. Packs are hashed bundles (PACK/1 name=<name>, identity = SHA-256 of the bytes), stored under blobs/<sha256>, and adoption is one BIND entry by root or an admin grant. Conflicts are refused — same (kind, object) with a different payload — and identical re-adoption is accepted. Each declaration enters the Register at the BIND's address, marked with the pack name.
  • Authority — genesis names the roots. GRANT / REVOKE then extend or remove it, and recording for another needs a record grant matching for (with * globs, e.g. agent:*). The README quick-start is the worked example: init --root actor:founder → adopt both packs → GRANT host:build-01 for agent:* → the host can then record R:ACT( / R:ACT) for the agent, and the operator cannot.
  • Meaning — "An entry is read under the declarations in force at its position," so a word's meaning is positional, not timeless. Upgrades are new versions; old entries keep their old meaning. That's why the kernel can change by AMEND at a segment boundary without rewriting history.
  • The Books — balances are never stored, they're computed: explicit legs that must sum to zero per book/unit, plus implied postings (an end-phase entry with use + pool moves pool → activity with zero extra bytes). Close commits by hash of the balance table, not by restating balances.

3. The checks — how each line confirms the ones before it

This is the part you were asking about, and there are four different checks, at four different moments:

  • At opening — canonical form. An entry is valid only if re-serialising it reproduces its bytes exactly: keys sorted by byte order, no duplicates, no whitespace, integers only, quantities as decimal strings. Conformance case 04 is the proof: a single line with keys text before rec — the only defect is key order — must fail to open with open: not in canonical form. Case 05 is the kernel check: a log naming the wrong kernel (64 zeros) must fail with open: not this one.
  • At submission — authority and retries. A submission is checked against the declarations in force at that position. And a rejection is itself journaled: an ACK entry carrying refused. That was found by testing (analysis 02): rejected submissions used to consume sequence numbers with no trace, so now the refusal is written to the journal, a retry with the same digest returns the original receipt, and refusals are sticky even if a grant is added later.
  • At sealing — the chain. A seal's sha256 covers every byte of its segment before the seal line, preamble included. Then chain = sha256(hex(previous chain) || hex(sha256)), genesis chain = 64 zeros. The next segment opens with OPEN kind=segment carrying prev = that chain. Conformance case 03 is the tamper test: one byte changed ("q":"38" → "39") with the seal hash unchanged must be caught as verify: seg 1: body hash mismatch. Case 06 is the broken chain: segment 2's prev as 64 fs must fail with verify: seg 2: does not open with prev = previous chain.
  • At verification — verify(). The explicit command recomputes every seal and chain. The web app's Seal and Verify screen does the same.

And the honest caveat, from the study, which any articulation has to carry: in the Rust code as built, open() does not verify seals and does not call Entry::check() — a tampered log opens fine, and only an explicit verify() catches it. And verify() doesn't check authority, retry consistency, or genesis roots, and stops silently at the first missing segment. So "the kernel checks itself as it goes" is true of the design — canonical form at open, authority at submission, seals at verify — but not yet true of every code path.

4. The two holes in "building its own authority"

This is where the sources are bluntest, and it's the part that matters most for the narrative you're building:

  • Genesis is not enforced in v1. The kernel-model DIGEST §10 records the two holes testing found: a log whose first entry isn't genesis "opens with no name and no roots", and a second genesis mid-file silently replaces the root and verify() doesn't notice. The descriptor's core rules don't state genesis-first/only.
  • Authority does not arise from distinctions. From design/stream/unfolding-kernel.md: "Not established; trust is supplied." From note 12 §3.3: "Root trust is a declared convention at the seed boundary, not a theorem of the distinction algebra." The seed-boundary process log puts it as a table row: "A root's assertion that it is root authenticates itself — False without an external trust/signature premise." The toy-reader probe is explicit about this: "The root is passed to the toy reader out of band. This is deliberate: it tests the honest boundary around authority rather than letting genesis invent its own trust."

So the v1 story is: authority is declared in genesis, then traced line by line — and the tracing is real and checkable — but the root itself is supplied from outside the log, not derived inside it.

5. The unfolding aspiration — the kernel that would build itself

This is the part that isn't built, and the dossier's Tier 1 materials are the record of it:

  • The seed language (note 15): eight forms — relation, rule, action, activate, invoke, fresh, emit, retire — with state split Kn (active definitions) / Bn (base facts) / Cn (derived closure, disposable), and a finite-closure termination argument. The activation dialogue is: definition proposal → check → recorded result → authorized activation → later expressions can invoke it. Every activation/action must be understood from the preceding accepted prefix — that's note 16b, the bootstrap transcript.
  • The three beginnings (note 16 §2, unfolding-kernel.md): formal (an initial expression and permitted transformations), machine (an interpreter able to represent and run them), organizational (the trust and governance under which records and activations are accepted). "An empty formal state still presupposes the calculus that interprets it."
  • The codeable plan (note 12): a fixed reader contract, a bootstrap sequence, GENESIS as an atomic constructor — accepted only as the first entry, lowering into in/is/may — Stages A–H. In the kernel-model Arc III, genesis is the zero byte: 0x00 may only follow 0x02.
  • The mark-boundary experiment (T2-02): the only executable construction from a mark in the repo — empty sequence + mark + enclose, entry/exit *() → (*) → *(), with its own premise inventory in premises.json stating what's supplied vs derived, and its explicit limit: "not a derivation from nothing", and it "does not derive MAY, IS, TO, authority, phases, or the 128-cell map."

And the gaps that stay gaps: the seed text does not exist, no canonical bootstrap transcript, seed minimality not established, the Books' fit to the seed language incomplete. Note 17 lists both the seed text and the transcript as missing deliverables.

How I'd put it in one sentence for the narrative

The kernel as built is a fixed, hashed page that a log names and then grows under — each line checked against the declarations in force at its position, each segment sealed to the last, each rejection journaled — so the log's authority, vocabulary and balances are all built up in order and can be re-derived by folding from the start. The kernel as aspired to is that same growth with the fixed page shrunk to a seed that the reader learns from, line by line, through the activation dialogue — and the sources are clear that the seed, the transcript, and the derivation of authority from distinctions are the three things that don't exist yet.

Want me to turn this into the next narrative — a second page, or a new part in the Genesis artifact — built around that fold-and-check sequence, with the v1 mechanisms drawn as a timeline and the unfolding aspiration drawn as the dialogue?