Unfolding the Kernel
STREAM · kernel creation

A small fixed reader reads the kernel into being

The kernel is not a program you install. It is a short list of entries, segment 0. A tiny program, the seed, reads them in order, and each entry it reads lets it read more. When it reaches the seal, what it has built is the kernel, and with it the seed can read any log.

K = fold(apply, seed, segment 0) then S = fold(stepK, S₀, log)

Four moments

Before

The seed

A small fixed program. It can read nothing yet but segment 0.

During

Reading segment 0

Entry by entry it adds names, phases, positions and rules to its state K.

After

Seed + K = the reader

At the seal, K is complete. Its identity is the seal's hash.

Use

Reading logs

Any log that names this kernel's hash is read with the full reader.

What is fixed, and what unfolds

The seed · fixed forever
  1. What an entry is: a type of six answers, plus named fields
  2. The ordering rule: a distinction is used only after the act it depends on
  3. One plain text spelling, so there is something to read
  4. One hash function
  5. A small check evaluator: equal, and, not, count, every, first

No verb names, no codebook, no rules about authority.

Segment 0 · data, stored by hash
  • The names of the four phases and all 32 positions
  • The fields every entry may carry
  • The rules: genesis first, re-entry only after a seal, authority, packs, canonical form
  • Other spellings, such as a binary head, declared as options
  • The seal whose hash is the kernel's identity

A new kernel is a new segment 0, read by the same seed.

The chain of distinctions

Each step adds one distinction, and needs the step before it to have something to act on. The type byte records the answers. Read across a row to see which bit the step makes available.

bits: p p · F · M · R R · D · x made available by this step available already not yet
1
in · a boundaryInside versus outside. Every other relation is about a boundary.
OPEN 0x00, the zero byte
ppFMRRDx
2
is · things insideAn inside with nothing told apart is no inside. Genesis names the log and its root.
CREATE 0x04
ppFMRRDx
3
may · to · crossingA boundary carries a rule about who may cross, and something to cross. Both need named things.
GRANT 0x08 · BIND 0x0C
ppFMRRDx
4
direction · crossing backClose what was opened, supersede what was said, withdraw what was given, answer what arrived.
COMMIT · AMEND · REVOKE · ACK 0x02–0x0E
ppFMRRDx
5
phase · sequenceRepeated boundaries leave a between. Begin, end, instant, and sample: looking without crossing.
( ) * time shapes
ppFMRRDx
6
possible · what isn't yetPlans, claims, offers and estimates need facts and sequence to be about.
ATTEST · SCHEDULE · OFFER
ppFMRRDx
7
world · beyond the logThe same relations applied to the work: places, states, energy, money.
ENTER · BECOME · SEND
ppFMRRDx
8
profile · local wordsDialects declared in packs: R:ACT( is ENTER( underneath.
a profile byte follows
ppFMRRDx

How the reader grows while reading segment 0

Segment 0 uses only OPEN, CREATE and COMMIT, whose meanings follow from the bits alone. Nothing it needs comes later in the list.

EntryWhat it saysThe reader can now
00 kernelOpen the kernel's boundaryRecognise a kernel and read plain fields
04 phase:…Name the four phasesTell instant, begin, end and sample apart by name
04 position:…Name all 32 positionsPrint any type as a word, such as OPEN or SEND
04 field:…Declare the fields entries carryRead every field the kernel uses
04 rule:…Genesis first, re-entry only after a seal, authority, packsJudge whether an entry is valid
04 spelling:…Optional binary spellingsRead the same entries written compactly
02 kernelSeal: count and hash of everything aboveProve it read exactly these entries, and name itself by that hash

Three layers, one of them free

LogicThe distinctions and the order they unfold in. This is the kernel.fixed
ShapeAn entry is a type, named fields and a position in the log. No bytes yet.fixed
SpellingText lines, run form, a 40-bit binary head, a BitPads fork. Any spelling that decodes to the same entries.free

How we know it worked

It accepts itself

The finished reader reads segment 0 again under every rule it now holds. A kernel that would refuse its own description is rejected.

It agrees with today's kernel

It must judge the six conformance logs exactly as their EXPECTED file says.

The genesis hole closes

A log must start with 0x00, and 0x00 may follow only a seal (0x02). A missing or second genesis is refused by the ordering rule itself.