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

BabbTools for the frontier.

mascot mascot
All materials

05 — Genesis enforcement: genesis-first/only in the new reader

2026-11-29-prep-05-genesis-enforcement.md View the source file

Morgen's decision: "Yes of course reader when loading a new kernel enforces genesis."

The rule (exact)

For any log opened under the new kernel (seed-identified; the unfolding kernel, not v1):

  1. The first entry MUST be GENESIS. It is the atomic constructor GENESIS(log_id, roots, clock, timezone, seed_hash, policy_hashes) (note 12 §3.3). It is accepted only as the first entry under the seed's bootstrap rule. "Genesis is not permitted in Segment 0 and may occur only as the first entry of a working log." (note 12 §3.2)
  2. No second GENESIS is permitted. Any GENESIS after the first entry is rejected. A second genesis mid-file must not silently replace the root — that is one of the two v1 holes (kernel-model OVERVIEW Arc II).
  3. The first recorder must be one of the stated roots. The rec of the GENESIS entry must be in the root list it names.
  4. The seed hash in GENESIS must match the kernel the reader was loaded with. A log naming a different seed is not read under this kernel — it is refused with "not this seed", the same way v1 refuses a wrong kernel (open: not this one, conformance case 05).
  5. Genesis lowers deterministically into in, is, may projections (file 04). The lowering is part of the fold, not a separate step.

Rejection behaviour

ViolationReader behaviour
First entry is not GENESISopen refuses: open: first entry is not GENESIS. The log is not opened, not folded, not partially read.
Second GENESIS anywhere laterRefused at the position it appears: verify: seg N: second GENESIS. Earlier entries remain as read; the log is not trusted past that point.
First recorder not in rootopen: GENESIS recorder is not a stated root.
Seed hash mismatchopen: not this seed.
GENESIS in Segment 0Refused: Segment 0 is the bootstrap (boundary → kinds → rules → seal); GENESIS belongs to a working log, not to the seed.
Missing root / empty rootsRefused at init time (stream init refuses to create a log with no root) and at open time. (v1's Log::init panics on empty genesis roots — the new reader must refuse cleanly, not panic.)

Key point: rejection happens at open, not only at explicit verify(). The v1 gap was exactly this: open() does not verify seals and does not call Entry::check(), so a tampered log opens fine and only explicit verify() catches it. The new reader must not repeat that shape — open enforces genesis, canonical form, and kernel/seed identity; verify additionally recomputes every seal and chain. A log that fails open is not a log the reader will fold.

What stays v1 (unchanged)

v1 logs are not retroactively subjected to this rule. v1's genesis is a convention (OPEN kind=genesis, first entry by convention, not enforced), and v1 logs already in existence were created under that convention. The new rule applies to logs opened under the new kernel (new seed hash). Whether v1 logs migrate, import, or stay parallel is Stage H — not decided here, not decided by this rule.

Conformance vectors (to be written in the Lab)

Positive: a well-formed GENESIS first, with named root and key, opens and folds. Negative (each must be refused with the named error):

  • first entry is an ACT, not GENESIS;
  • a second GENESIS at position 10;
  • GENESIS whose recorder is not in root;
  • GENESIS naming a different seed hash;
  • GENESIS in Segment 0;
  • empty root list;
  • a log whose first entry is GENESIS but whose seal chain is broken (seal failure is separate from genesis failure — both must be reported, and the genesis check must not mask the seal check).