STREAM v0.1b Direction

Lab 2026-11-30-v0-1b-direction-claude · working drafts, nothing decided unless marked

STREAM v0.1b direction: master design note

Lab: 2026-11-30-v0-1b-direction-claude · Started: 2026-11-30 · Iteration: 6 (see §17 for how iterations are recorded) Status: Working draft. Nothing here is decided. Every item is a proposal for the owner, unless it says Decided with a date. Builds on: the unfolding-replies lab, Stage C, derive_context v2, the direction-bit and Option 9 reports, the Reader A/B reports, and the verb-table work of 2026-11-29.

This note collects the new direction and the elements of a v0.1b kernel in one place. It will be revised in place; the changelog at the end records each iteration.


0. Summary

  1. Each of the seven position bits gets one meaning, the same for every relation.
  2. F, S and O are derivable from the entry and the reader's state by functions the kernel defines. By default they are also stored: the header carries the full 7-bit position, and the reader checks stored = derived. Header-only filtering on every bit keeps working (§1.2).
  3. Direction (D) means establish vs undo. The way something moves lives in the from/to roles, so the header keeps a 1-bit direction field.
  4. Positions are linked by three bit operations (undo, view from the other side, settle), which form an 8-element monoid. Citations between entries are checked with one or two bit operations.
  5. Anything an entry names is born at its first mention, owned by the acting principal. Strict modes turn this off.
  6. Kinds are classified by how they are used (a trait bitset), not by a list declared up front. Packs may declare; the plainest entry still works.
  7. One entry per transfer. The Books post both legs; holds use reserved balances; reversal is an undo.
  8. A log needs exactly two lines to start: preamble and GENESIS. Everything else depends on the use and is set by setup policies.
  9. The four relations are established as four operations, each with a law that can be tested (enclose, call, cross, and self-application of the log's distinctions). Behaviour follows from the laws instead of being written out per relation (§3.4).
  10. Phase is two bits, (opens, closes), separate from c. D closes a relation's standing; phase brackets the act; M marks uncommitted; the absence code marks a missing piece (§3.6).
  11. Two kinds of link between lines. A continuation link continues the same act (undo, the other side's record, settle) and obeys the 8-element monoid. An evidence link says a new act is based on an earlier one (recorded from, forecast from, outcome of) and has its own contract per kind (§3.7).

1. The position and its bits

c = 64F + 32S + 16M + 8O + 2R + D        0 ≤ c ≤ 127        phase: 2 bits, outside c
Bit 0 1 Question it answers Stored or derived
F frame world Does the entry enact the act, or report something seen outside? derivable: has a source role? Stored and checked by default.
S sign substance Is the affected thing a record (many places; an issuer may exist) or a resource (one place at a time; never issued)? derivable: the kind's class (§7.3). Stored and checked by default.
M fact possible Committed, or pending until a later fact cites it? stored
O self other Is the affected party someone other than the principal acted for? derivable: owner lookup. Stored and checked by default.
R in · is · may · to membership · standing of a property · permission interval · quantity flow stored (2 bits)
D into out of Establish, or undo an earlier entry (cited)? stored

1.1 The header's type bits: v0.1 against v0.1b

The v0.1 short header (docs/compact-header/bitpack-header-draft-v0.1.md §4) spends 11 bits on type: Position 7, Phase 2, Modality 1, Direction 1. If Position is the coordinate c, then Modality and Direction repeat bits M and D that are already inside it.

Option Type bits Bits freed from the 30-bit short header
v0.1 as written 7 + 2 + 1 + 1 = 11 —
v0.1b, 7 bits checked c (7) + phase (2) = 9 2
v0.1b, 6 bits R (2) + D (1) + M (1) + phase (2) = 6 5

Freed bits could widen the 12-bit time delta, which is where the open overflow question (X06, freeze gate G5) comes from: +2 bits gives 0–16,383 units, +5 bits gives 0–131,071. The extended header's 12-bit object/kind index is already the back-reference idea of §10 point 3.

1.2 Filtering cost: why the default stores all seven bits

Iteration 3. If F, S and O were only computed (the 6-bit option), every filter on them would need the reader's state:

Where filtering happens 6 bits, computed 7 bits, stored and checked
Header-only scan of a raw log (the v0.1 draft's main reason for the header: "skip the payload unread") F, S, O cannot be filtered; R, D, M, phase can every bit can, one AND per line
A running reader with indexes same cost: c computed once at append, kept in a sidecar index same cost
Tools, shards or archives with no Register snapshot must rebuild state first filter directly
Writing a line derive F, S, O (lookups already done) derive F, S, O, then compare with the stored bits

Proposed default: wire.type = 7 bits checked. The header carries c; the writer's reader derives F, S, O and refuses any line whose stored bits disagree. This changes the claim from "three bits are not stored" to "three bits can't lie". It still frees 2 bits from the v0.1 short header, because v0.1 stores M and D twice. The 6-bit form stays available as a compact profile for constrained links, where every reader keeps state.

Stored O is relative to whoever wrote the line, which is what notifications and the counterparty rule (§3.2) need.

1.3 The type in one byte

Iteration 4. v1's type is one byte (phase << 6 | code). The 128 positions were designed so that a position is one 7-bit ASCII code. Position plus phase is 9 bits, so they can't share one byte. The options:

Option The byte holds Phase F, S, O Header-only filtering
A c (7 bits) + 1 spare bit: a position is one ASCII code its own 2-bit field, as in the v0.1 header stored in c, checked every bit
B S M O R R D + phase (2) = 8 bits in the byte S, O stored and checked; F read from the source role (no state needed, but not header-only) every bit except F
C R R D M + phase (2) + 2 spare in the byte all derived (needs state) not on F, S, O

Proposed: A. The type is c, which is one byte and one ASCII character; phase is a separate aspect field, as the v0.1 header already lays it out. The 9-bit (c, phase) value exists only as a query key in indexes and filters. It is never stored as one field. B is the fallback if phase must live inside the type byte. If source became one of the header's role-presence slots, B would also keep header-only filtering on F. Owner decision (§15 Q11).

1.3.1 Option A in full: two bytes, "what" and "shape"

Iteration 5. The v0.1 short header, without its duplicated Modality and Direction, fits two bytes exactly, plus the time delta:

byte 1   [ change | F  S  M  O  R  R  D ]                    what changes: the position c
byte 2   [ ext    | opens closes | r0 r1 r2 r3 | estimate ]  how the record is shaped
time     12-bit delta (or 14, using the 2 bits saved)
Field Bits From v0.1
change (high bit, byte 1) 1 Change
c 7 Position (Modality and Direction were duplicates of bits inside it)
extended-follows (high bit, byte 2) 1 Extended-follows
phase (opens, closes) 2 Phase
role presence 4 Role presence
estimate 1 Estimate
time delta 12 Time delta
total 28 v0.1: 30

Affected party, per relation: in → the member; is → the bearer of the property; may → the holder of the permission; to → the source book (from).

Actor: actor(e) = the for principal if present, otherwise the recorder. O compares against the actor. The recorder separately needs a record grant from for whenever rec ≠ for.


2. Derivation of F, S and O

F(e) = [ source ∈ roles(e) ]                                  reads: the entry body only
S(e) = [ class(kind(affected(e))) = resource ]                reads: the kind's birth record
O(e) = [ owner(affected(e)) ≠ actor(e) ]                      reads: the object's owner at this position
c(e) = 64F + 32S + 16M + 8O + 2R + D

2.1 Resolving names

An entry names things in its roles: from: book:ops, member: invoice:2041, unit: EUR. Resolving a name means finding the reader's record for that thing as of this position: whether it exists, who owns it, its kind and class, whether it is live, its balance. The reader hashes the canonical name and looks it up in the symbol table (§10).

It must happen for every name, because nothing else in the pipeline can run without it:

v1 already resolves names this way, for declarations in force and for rec/for authority. v0.1b adds no new lookups; it reuses them.

2.2 What a single line tells you


3. Laws

3.1 Bit laws (arithmetic on c)

mirror  μ(c) = c ⊕ 1        undo ↔ establish
view    ν(c) = c ⊕ 8        the same act, recorded by the other side
settle  σ(c) = c ∧ ¬16      pending → committed  (= c − 16 when M = 1)

μ∘μ = id     ν∘ν = id     σ∘σ = σ     μ, ν, σ commute pairwise

They generate an 8-element monoid, {id, μ, ν, μν} × {id, σ}. Every legal link between two entries is one of those eight. The structure mirrors Spencer-Brown's two axioms: crossing twice returns (μ, ν), and calling twice is calling once (σ). This is a parallel worth recording, not a derivation.

3.2 Citation checks

undo:      D(c) = 1  →  cites t,  t live,  c = μ(c_t)
settle:    t pending and open,  c = σ(c_t)          if actor(e) = actor(t)
                                c = ν(σ(c_t))       if actor(e) ≠ actor(t)

3.3 State laws

Law Statement
Once Every pending item and every live establishment is used up at most once (Open-items set).
Zero A frame to entry's legs sum to zero per book and unit, by its form.
Single value is holds one value per property. A new DECLARE replaces the old one; WITHDRAW leaves ⊥ (withdrawn).
Attenuation A granted permission ≤ the granter's (actions ⊆, scope ⊆, validity ⊆, depth <).
Root Every permission path ends at a genesis root.
Position Type, guard and effect read only the state before the entry (plus its births).

3.4 The four relations as four operations

Iteration 3. Stage 0 no longer lists the relations as a given set with a separately written effect for each. It defines four primitive operations, each with one law. A relation is the name of an operation's effect, and it earns the name by passing the law.

Relation Operation Law (checked) State structure it builds Grade
in enclose: draw a boundary with an inside containment is transitive and irreflexive (nothing is inside itself); a resource has one place a partial order (Struct) law: checkable; the mark-boundary experiment already derives it from enclose
is call: give a thing a value under a name idempotent: calling the same value twice changes nothing; one value per name an override map (Reg) law: checkable
to cross: move a measure from one side to the other involution: crossing back returns (reverse = −δ); what leaves one side enters the other (legs sum to zero) an abelian group (Books) law: checkable
may apply the log's distinctions to its own later lines least fixed point: authority is the smallest set closed under the grant rules; every chain ends at a root a closure over grants (Auth), read by guards law: checkable; the name of the operation is open (§15 Q9)

Two operational cuts give the 2×2 (DIGEST §3's grid, now as properties of the effects):

builds structure (chains compose by closure) attaches values (folded per key)
a thing and its place or value in is
between two parties (granter→holder, from→to) may to

The effect-law self-check runs next to the bit-law check at start-up, and in the conformance suite:

is   : set(x,p,v); set(x,p,v)            ≡  set(x,p,v)
to   : post(t); post(reverse t)          ≡  no change;   Σ legs = 0 per unit
in   : enclose(a,b); enclose(b,c)         ⇒  a inside c;   never a inside a
may  : closure(grants) = T(closure(grants)), and is the least such set;  every chain ends at a root

The order they unfold in from genesis (each needs the one before):

GENESIS   mark         log boundary L; inside = this log, outside = everything else; roots inside (trust supplied)
in        enclose      boundaries and members inside L
is        call         things inside get values
to        cross        measures cross between enclosed books; outside:<unit> is the outside of L
may       self-apply   the log's distinctions applied to its own later lines; GENESIS supplied the first

The other bits, read operationally:

Bit Reading
D cross back: close the effect from this position on (exit, withdraw, revoke, inverse)
O an in question: is the affected thing inside the actor's ownership boundary?
S a record is a name that can be called in many places; a resource is an occupant enclosed in one
F whose distinction it is: drawn by this log, or by another observer (the source) and reported in (§3.5)
M indicated but not yet crossed: no effect until a fact settles it

What stays stipulated: that these four operations exist (the kernel's primitives, note 05), trust in the roots, measure (units and quantities), and time (the clock). The words in, is, may, to are names given after the behaviour is established.

3.5 Observed and authoritative state

Iteration 3. F is made operational by where a line writes:

Guards read the authoritative partition. Views can show either, or both side by side.

3.6 Phase

Iteration 4; corrected in iteration 5. Direction approved by the owner 2026-12-01; the questions in §15 Q10–Q12 stay open.

What phase is. Two yes/no answers about the act itself, not about the relation:

closes an interval: no closes an interval: yes
opens an interval: no sample end
opens an interval: yes begin instant

An instant opens and closes at once. A sample does neither: it is a point inside something already open. The shape (four values from two questions) is forced; time itself comes from the clock supplied at genesis. That resolves DIGEST's "forced" grading of step 10 against notes 05 and 06: they were describing different things.

Separation rule. Each mechanism answers one question, so no event can be written two ways:

Mechanism Answers Example
D = 1 this established relation no longer holds from here leaving a group: in, D=1, instant
phase begin/end the act took time: it started here and finished there a VM migration: in, D=0, begin … in, D=0, end
validity role how long an established permission (or other standing) lasts a grant valid Dec 1 → Dec 31
use count how many times a permission can be used a single-use grant: uses: 1
M = 1 not committed; may never happen a hold
absence not-yet one piece of this record will come later an amount known only at the end

When the effect lands:

Phase Effect on the relation's state
instant lands at this line
begin none yet; opens an in-progress item (a committed fact that the act started)
end lands here; cites its begin, same c, and uses it up (the use-once rule, as for settling)
sample none on the relation; adds a reading to a series (observed partition when reported)

A begun act that fails ends with an outcome role, or its begin is undone if it was recorded by mistake.

Laws. μ, ν and σ act on c and leave phase unchanged. The pairing check: end.c = begin.c, begin in progress, end cites begin. If phase codes follow the bits (sample 00, begin 01, end 10, instant 11), then begin ∨ end = instant and p_end = p_begin ⊕ 11. That numbering differs from v0.1's (instant 0, begin 1, end 2, sample 3): owner decision (§15 Q10); a lookup table gives the same reading without renumbering.

Phase and relation. Iteration 5 correction. Iteration 4 marked may × {begin, end, sample} invalid (96 of 512 fact-forms). That was wrong. Applying the separation rule evenly, every relation has acts that take time and states that can be read:

Relation begin / end (the act takes time) sample (a reading inside something ongoing)
in a move or migration presence readings
is an assessment or measurement process; the value lands at end signal readings
to a settlement or a flow over time meter readings (running totals)
may a grant or revocation that takes time to take effect (access spreading across systems; staged rollout). Committed, not usable until end. access scans and reviews, usually reported from outside (F = 1)

Iteration 4's is example ("a value that holds while an activity runs") was standing, not an act, and belongs to D.

What phase is not for:

No fact-form is invalid in advance. All 512 are allowed by the kernel; the Stage A workbook decides per position which are meaningful, and may mark individual cells invalid.

ACT end. Completion of an act is D = 0, phase end. That agrees with the corpus, and preset QToB4's D = 1 would read as reversing an ACT. This supports settling D-02 the corpus's way; the decision stays with the owner (§14).

Naming. Verbs are named per c (128). Phase renders as aspect on the same verb (started, completed, reading). The label pack may carry optional phase-specific names, which is where ZAKO's 13 phase-variant verbs belong.

Iteration 6.

In plain terms. A line can point back at an earlier line for two different reasons:

Why this is needed. The continuation check (§3.2) only allows D, O and M to differ between the two lines. Accepting a reported line into the authoritative books (§3.5) links a world line (F = 1) to a frame line (F = 0), so the continuation check refuses it. Without a second kind of link, the log had no legal way to say "I accepted that reading". The record had already named these links (DIGEST step 11, relations-and-matrix.md "What happens across row boundaries?", note 16, note 19 §9) and said that flipping a bit supplies none of the evidence they need.

The two families:

Continuation (cites) Evidence
Meaning the same act, continued a different act, based on another
Bit rule only D, O, M may differ: the 8-element monoid (§3.1) a stated constraint per kind (below)
Order matters? no: the moves commute yes (note 19: sensing then acting ≠ acting then sensing)
Uses up its target? yes: undone or settled at most once no, except where a kind says so
Shape at most one continuation of each kind per item many-to-many: a web of support

The evidence kinds and their contracts:

Kind From To Bit constraint Must carry Used up?
records a world line a frame line F 1 → 0; same R and S accept or adjust, with reason once per book (no double-posting)
actuates a frame intent (pending or begin) a world outcome F 0 → 1; same R authority used; dispatch id the intent's outcome, once
anticipates one or more facts a forecast the forecast has M = 1 model, assumptions, horizon no
realises a pending line, plus an observation its outcome σ on the pending line (a continuation) plus an evidence link to the observation the observation the pending item, through σ
senses a source a world line F = 1 source, method — (this is the source role; checked with F)
under a grant, mandate or rule an act done under it R may differ — only if the grant has a use count (checked by g_O)

senses and under add no new checks: they are the existing source role and the grant that g_O already finds. Only records, actuates, anticipates and the evidence half of realises add work.

Rejected alternative. Extending the monoid with a move that flips F (16 elements, then 24 with a move that sets M, then moves on R for under) would make one uniform check, but it weakens the check with each move, asserts that crossings commute (false, note 19), cannot be both use-once and reusable, and still needs the same contracts. Flipping F stays available as a filter for drift (positions c and c ⊕ 64), not as a link.

Cost. The check runs only on lines that carry an evidence link, in pipeline step 7 with the continuation check: one array lookup of the cited line's two header bytes, one XOR and one AND per link, and for records and actuates one used-set lookup. It needs no Register access. Most lines carry no evidence link and pay nothing. Replay runs the same step; reading never re-checks.

Open: the exact roles each contract requires are written in the operator workbook (work plan WP09b).


4. Reading pipeline (every line after GENESIS)

 1. bytes      canonical form
 2. position   seal chain / segment
 3. header     R, D, M, phase
 4. resolve    each named identifier → existing id, or birth (§6)
 5. derive     F, S, O
 6. assemble   c; compare with stored c if present
 7. links      continuation checks (§3.2), evidence checks (§3.7), begin/end pairing (§3.6)
 8. guards     §5, cheapest first
 9. effect     Δ from the prior state
10. commit     state ⊕ births ⊕ Δ, atomically; on refusal, journal a refusal receipt and discard the births

open replays every line through the same pipeline. There is one code path for submission and replay, so stored data cannot have skipped a check.


5. Guards

guard(e) = laws ∧ g_P ∧ g_F ∧ g_S ∧ g_R ∧ g_D ∧ g_M ∧ g_O ∧ record-right ∧ policy
Guard Passes when
g_F F = 1 → a source role is present
g_S S = 1 → one place at a time (in), never negative (to). S = 0 → may be in many boundaries; a book may go negative only if declared issuer.
g_R the relation's own precondition (member present for exit, property set for withdraw, interval live for revoke, units match for to)
g_D D = 1 → target live, not already undone
g_M settling → target pending and open; M = 1 → no committed effect
g_O O = 0 → actor owns the affected object. O = 1 → an authority path exists (grant, mandate, or evidence plus attribution for is).
g_P the fact-form (c, phase) is not marked invalid in the workbook; end → cites an in-progress begin with the same c
record-right rec ≠ for → a record grant from for to rec covers c
policy every rule from packs in force holds

The guard is a conjunction, so the order doesn't change the result; it fixes which refusal reason is reported. Packs can only add conditions. Authority comes only from grant facts, never from loading a pack. A refusal is journaled; retries return the same receipt (v1 behaviour).


6. Births by first mention

for each identifier x named in e with lookup(x) = ⊥:
    owner(x) := actor(e)        principals: owner(x) := x (self-owned)
    kind(x)  := the kind e names, or the role default
    born(x)  := position of e

6.1 Role defaults

Role Default kind
from, to on a to entry book
boundary in in boundary
member in in placed with a location role (at) item (a resource)
member in in otherwise; bearer in is thing
holder in may principal
source principal
the unit on a quantity unit

7. Kinds: class and traits inferred from use

7.1 Units come from the plainest entry

People write amounts with a symbol or letters before or after them: 120 EUR, €120, 5 kg, 3h, 2 GB. The symbol is the quantity's kind. It is born at first mention as a unit, like any other name. No unit pack is needed to write or read a quantity. Packs may later supply dimensions, conversions and aliases (€ = EUR).

7.2 How quantities enter a log: intake from outside

Most holdings, money included, enter a log as a plain declaration of what someone holds: "book:ops holds 500 EUR". That is modelled as a handover from outside the log:

to  D=0   from: outside:EUR   to: book:ops   q: 500   unit: EUR

7.3 Record or resource: what the class changes, and how it is set

Iteration 2 correction. Iteration 1 inferred the class from how a quantity first enters. That was wrong: money and kWh both usually enter by intake from outside, so their origin cannot tell them apart.

What the class actually changes:

Relation Record (S = 0) Resource (S = 1)
in may sit in many boundaries at once in exactly one place at a time
to conserved, one book at a time; an issuer book may be declared conserved, one book at a time; no issuer can ever be declared (you cannot record kWh into existence)
copying can be referenced or copied freely cannot be duplicated, only moved

On to the difference is small: it is only whether an issuer may exist. On in it is large.

class(k) = declared class                   if a pack or DECLARE gave one      (packs win)
           resource                         else if k is first placed with a location role (`at`)
                                                 or first moved by an atomic exit-and-enter
           record                           otherwise (the default)

The class is fixed at birth and stored. Later entries read it and never re-infer it. A later conflicting declaration needs an explicit reclassification entry with its own guard.

Known limit: a physical thing first declared without a location ("I bought a chair") is a record until something says otherwise. The cost is only that the "one place at a time" guard doesn't apply to it yet.

7.4 Traits: a kind's role signature

Each kind keeps a small bitset of the roles it has filled. It is updated at commit with one OR, and conflicts are checked with one AND.

Trait Set when the kind…
T0 container is the boundary in an in
T1 member is the member in an in
T2 bearer is the subject of an is
T3 holder holds a permission in may
T4 book is from or to in a to
T5 observer is a source
T6 durative is used with begin/end phases
T7 sampled is used with the sample phase
T8 located is placed in one place at a time (S = 1)

Candidate classes of kind, as trait masks:

Class Mask Examples
book / account T4 wallets, ledgers, stock bins
place / container T0 (+T8 on members) warehouse, host, room
group / tag T0, members S = 0 team, label, folder
item / asset T1 + T8 device, pallet, chair
record / document T2 only invoice, profile, setting
principal / agent T3 person, service, agent
observer / sensor T5 (+T7) meter, registry, feed
activity / process T6 job, shift, deployment
signal / metric T7 + T2 temperature, latency

These are names for patterns, not new kernel types. A view can group by them.

7.5 Tags and groups in a log entry

A tag or group isn't a new construct. It is a boundary whose members are records, so they can sit in many at once:

in  D=0   member: invoice:2041   boundary: tag:urgent        → filed under "urgent"
in  D=0   member: invoice:2041   boundary: team:billing      → also in a team boundary
in  D=1   member: invoice:2041   boundary: tag:urgent        → untagged (cites the first)

Both boundaries are born at first mention. Because invoice:2041 is a record, being in two boundaries passes g_S. A resource (S = 1) placed in a second boundary without leaving the first is refused, or the entry is read as a move if policy allows.


8. Transfers


9. Ownership given to someone else

When an entry creates something and names an owner other than the actor, the recorder may lose control of it at once. Candidate forms:

Form Log shape Recorder afterwards
A. Assign birth with for: X; the recorder needs a record grant from X no control
B. Offer birth owned by the actor, plus a pending ownership transfer (M = 1) to X. X accepts (settles, so ⊕8 applies) or declines (retire). full control until X accepts
C. Assign and retain A plus a GRANT back to the recorder (custodian or manager scope), in the same atomic batch scoped rights
D. Standing acceptance X holds a policy "accept assignments from Y" as A, without a per-item grant

An unsolicited assignment (no grant, no offer, no standing acceptance) is either refused or turned into form B. That choice is a setup policy (§12).

9.1 Notification classes come from the bits

Notify every principal named in an entry, other than the actor, who owns an object in any of its roles. The bits then say what kind of notice it is:

Bits Notice
M = 0, D = 0 something was done to something of yours (inform)
M = 1 something awaits your response (accept, decline, pay)
D = 1 something earlier was undone
settles your pending item your request or offer was answered
F = 1 an outside source reported something about yours

This is a view, not a kernel feature. It is computed from c and the roles, with no extra state.


10. Indexes and compute cost

Question: once births happen by first mention, do the growing numbers of objects, books, kinds and subjects need scans or routine jobs to keep indexes current?

Proposed answer: no. Each index is a function of the log prefix, kept up to date at commit, and the check for "is this new?" is the lookup the reader must do anyway.

  1. Birth costs nothing extra. Step 4 resolves every named identifier, so it hashes and looks it up regardless. A miss is the birth. There is no separate existence check.
  2. Symbol table. Each birth gets the next dense integer id (its birth ordinal). The table is append-only: a hash map from name to id, plus an array from id to record (owner, kind, class, traits, born). An insert costs O(1) amortised.
  3. Optional wire saving. After first mention, an entry may refer to an identifier by its id or by the position of its birth, instead of by name. That skips hashing on read, the way a compressor reuses an earlier string.
  4. Secondary indexes (by kind, owner, unit, c, boundary) are append-only posting lists. Each commit appends to the lists its entry touches: O(1) per index per entry.
  5. Traits and classes are bitsets updated with one OR. Conflict checks are one AND.
  6. Counts (how many kinds, objects, books) are the birth counters. Reading them is O(1).
  7. Checkpoints at each seal. The seal summary records that segment's births and index additions, plus a root hash over the symbol table and indexes. A restart loads the last checkpoint and replays at most one segment. A reader can confirm an index by comparing its root hash at a seal.
  8. Full scans happen only on a cold rebuild, which is a replay: O(n), once.
  9. At large scale, the symbol table moves to sorted runs on disk (LSM-style), with a Bloom filter in front. A filter miss means "definitely new", so the birth needs no disk read.

11. Stage 0: kernel constants and start-up

Everything in this section is fixed before line 1, in the kernel descriptor, whose SHA-256 is the kernel's identity.

D1  sets          B = {0,1}; Phase = {instant, begin, end, sample};
                  Id = canonical strings; Q = decimal strings; ⊥ distinct from 0, ∅ and withdrawn
D2  positions     C = B⁷, c = 64F+32S+16M+8O+2R+D; bit projections; type = c (one byte, §1.3)
                  phase P = B² read as (opens, closes) (§3.6); query key (c, p), 9 bits; wire: two bytes (§1.3.1)
D3  operations    μ, ν, σ and their laws (§3.1)
D4  state         S = (Struct, Reg, Auth, Books, Open, Sym, n, h)
                  Sym = symbol table (§10); Reg reserved properties: owner, kind, class, traits, issuer, born
D5  initial       S₀ = (∅, ∅, ∅, ∅, ∅, ∅, n = 0, h = 0²⁵⁶)
D6  seed kinds    principal, boundary, kind, pack, book, thing, unit   (record); item (resource)
D7  order         permission order ⪯ (§3.3 Attenuation)
D8  actor         actor(e), affected(e) per relation (§1)
D9  births        §6 and role defaults §6.1; intake §7.2; class rule §7.3; traits §7.4
D10 derivation    F, S, O (§2)
D11 links         continuation checks (§3.2); evidence-link contracts (§3.7); begin/end pairing (§3.6)
D12 guards        §5
D13 operations    enclose, call, cross, self-apply, each with its law (§3.4); the relation of a line
                  (in, is, to, may) names the operation its effect applies. Writes go to the
                  authoritative or observed partition by F (§3.5). Open ±; Sym +
D14 step          births → derive → laws → guards → effect → commit, or refusal receipt
D15 seals         seg_hash = sha256(segment bytes); h' = sha256(hex(h) ‖ hex(seg_hash))
D16 identity      K = sha256(descriptor)

Start-up sequence a reader runs:

0.1  load descriptor; compute K
0.2  build the constants and tables (D1–D14)
0.3  check the bit laws over all 128 values of c (128 × 6 comparisons)
0.3b check the four effect laws (§3.4) on a fixed sample state
0.4  state := S₀
0.5  require line 1 = "STREAM/1 kernel=sha256:" ‖ hex(K), else open refuses
0.6  read line 2 as GENESIS (§12)

11.1 Printing the start-up (a bootstrap transcript)

Option: begin a log by printing every Stage 0 operation.

Proposed: publish the Stage 0 transcript once per kernel version as a conformance artifact: the canonical bootstrap transcript, which note 17 lists as missing. Decided 2026-12-01 (owner): printing the start-up into a log is an audit option, verbose-genesis, off by default. When on, it writes the transcript into segment 0 as non-fact trace lines covered by the first seal.


12. Opening entries and setup policies

12.1 Required lines

# Line Effect
1 preamble STREAM/1 kernel=… binds the log to this kernel (not a fact)
2 GENESIS(log_id, roots, clock, tz, seed_hash, policy_hashes) Type fixed by kernel law; allowed only here. Log boundary born, owned by the roots. Roots hold every permission on it (trust is supplied here). Fixes clock, timezone and setup policies.

After line 2 a root can write ordinary entries at once.

12.2 Conditional setup lines

Needed for Lines
others writing principal (by mention or DECLARE) + record GRANT + credential
acting for another record GRANT from for to rec
pulls mandate GRANT from the source owner
issuing sign quantities DECLARE issuer on a book
shared vocabulary, policies, labels BIND packs, one line each

12.3 Setup policies (fixed in GENESIS policy_hashes; may be tightened later by a policy pack)

Policy Values Proposed default Strict mode
births.objects allow / declare-first allow declare-first
births.books allow / declare-first allow declare-first
births.kinds allow / pack-only allow pack-only
births.units allow / pack-only allow pack-only
births.principals allow / declare-first allow (they can't record without a grant) declare-first
class.inference location / pack-only location (§7.3) pack-only
ownership.for-without-grant refuse / offer offer (form B) refuse
resource.second-place refuse / treat-as-move refuse refuse
issuer declared only declared only declared only
wire.type 6 bits / 7 bits checked 7 bits checked (§1.2) 7 bits checked
verbose-genesis off / on off on, for audit

Policies tighten only. A pack may move a value toward strict, never away from it. This matches the guard rule that packs only add conditions.


13. Consequences for the kernel's mathematics

Area v1 v0.1b direction
What carries meaning 8 verbs; the rest declared four operations with laws + bit rules + phase
Entry type in the entry the entry plus the state before it
Conservation checked built into the entry's form
Links between entries conventions citation checks with the μ, ν, σ monoid; use-once rule
State one fold Books: a group (sums, fast balances) · Register and membership: last-writer-wins maps · authority: a derived closure
Seed logic positive Datalog positive + stratified negation over each entry's own roles + time-indexed ownership
Direction field disputed meaning, Option 9 would widen 1 bit, establish/undo; no widening

13.1 Proof obligations

  1. Totality: every admitted entry gets F, S and O, or a stated refusal.
  2. Determinism: the pipeline reads only the prior state plus births; the batch rule is fixed (each entry in a batch is typed against the state before the batch).
  3. Conservation, by induction over frame to entries.
  4. Citation laws and the use-once rule.
  5. Involution and idempotence (§3.1), checked at start-up.
  6. Stored c = derived c, when 7 bits are stored.
  7. Closure terminates under stratified negation; incremental upkeep agrees with recomputation, including under REVOKE.
  8. Replay on open = submission.

14. Effects on open decisions

Item Effect of this direction
D-01 direction Option 9's four modes map onto existing fields (normal = D 0, reversal = D 1, edge = phase, compound = linked entries). No widening.
D-02 ACT end Closing is phase's job, so an ACT end entry establishes: D = 0. This agrees with the corpus; preset QToB4 (D = 1) would read as an undo. Round 4's separation rule (§3.6) supports this. Owner decision; not decided here.
D-03 6-bit claim Honest: 6 stored bits, with three context bits computed by kernel-defined functions. No verb-table lookup.
D-05 depth re-check Removed by replaying through admission on open.
D-11 book key Unit = the quantity's kind (§7.1), so the key is (boundary, unit), and unit symbols can't collide across kinds. Revisit with §7.2–7.3.

15. Open questions

  1. F = enact vs observe, and O = "affected party is not the actor": accept?
  2. Class rule (§7.3): record by default, resource on a location role or a move, packs winning. Accept? And intake from outside:<unit> (§7.2)?
  3. Trait set (§7.4): are these the right nine? Should any trait be fixed at birth like the class, or do all accrue?
  4. Ownership forms (§9): which are kernel-level and which are policy?
  5. Wire type: 7 bits checked as the default (proposed in iteration 3, §1.2), with 6 bits as a compact profile. Accept?
  6. Batch typing rule: state before the batch (proposed) or sequential?
  7. resource.second-place: refuse, or read as a move?
  8. Bootstrap transcript: answered 2026-12-01 (owner): published per kernel; printing into a log is an audit option, off by default.
  9. The operation behind may (§3.4): DIGEST §3 places may with to under crossing (may = "is it allowed to cross?"), and gives re-entry to frame/world and phase. Iteration 3 reads may's operation as the log applying its own distinctions to later lines, which is closer to re-entry (note 06 links re-entry to recording which frame and policy were in force). Both can hold: may is about a crossing and works by self-application. Keep DIGEST's grid and name the operation "self-apply" rather than "re-entry", or adopt re-entry for may?
  10. Phase numbering: renumber to follow the bits (sample 00, begin 01, end 10, instant 11), which changes v0.1 presets and test vectors, or keep v0.1's numbering with a lookup table (§3.6)?
  11. The type byte: option A (c in one byte, phase separate; proposed, in its two-byte form §1.3.1), B (phase in the byte, F read from the source role) or C (§1.3)?
  12. Printability of the two-byte form: binary only; reconciled control characters; or a printable mapping (§1.3.1)?

16. Lineage: what earlier notes already said, and what is new

Iteration 3. Checked against the earlier record so restatement isn't presented as discovery.

Idea in this note Already in the record What v0.1b adds
Relations as operators with laws note 08: each relation an operator on a shared state; in = inclusion order, is = evaluation, may = restricts admissible transitions, to = conserved weighted delta (incidence matrix); the type dispatches the operator; the log is a composition of operators Laws become start-up and conformance checks (§3.4), answering note 08's question 9. The 2×2 is restated as two operational cuts.
Calling idempotent, crossing involutive note 08 ("idempotent and involutive reductions"); note 16 §9 (typed interpretations needed; executing twice need not undo; idempotence doesn't collapse evidence) Tied to bit operations: μ and ν are involutions, σ is idempotent, checked over all 128 positions. Undo is a distinct cited line, not double execution, which is what note 16 §9 required.
The 2×2 of relations DIGEST §3: how things stand (in, is) / crossing (may, to); logic table (transitive part–whole; one value per property; traces to a root; conserved) The same grid, as structure-vs-value and thing-vs-two-parties properties of the effects.
Containment derived from enclose mark-boundary experiment; note 16 (enclose and beside as supplied constructors) Placed first in the unfolding order after GENESIS.
Re-entry and fixed points note 16 §9 (re-entry as recurrence; positive inference reaches a fixed point); note 06 (re-entry and recording the frame in force); DIGEST (re-entry → frame/world, phase) The authority closure as a least fixed point; open question on naming may's operation (§15 Q9).
Direction per operator note 08 table (enter/leave, assert/supersede, allow/withhold, into/out of) Changed: one meaning for D in every relation (establish / undo).
External generation and boundary crossing note 08 ("external generation, loss or boundary crossing must be represented explicitly") outside:<unit> as the outside of the genesis mark (§7.2).
Incremental projections, identical across readers note 08 questions 8 and 9 Segment summaries, checkpoints and root hashes (§10).

New in v0.1b, not found in the earlier record: derived and checked F/S/O with functions defined by the kernel; O relative to the actor, and the ⊕8 counterparty rule; the μ/ν/σ monoid as citation checks; births by first mention, role defaults and seed kinds; kind classes and traits from use; the trim transfer model with holds and intake from outside; setup policies with strict modes; observed and authoritative partitions.


17. How this lab records iterations

Iteration 3. The lab is revised in rounds. Each round may touch one element or several, and the documents aggregate elements. The record has to show both: the lab's iteration number, and each element's own history.

  1. Elements have stable ids. Each piece of the design being iterated has an id (table below). An id never changes, even if the element moves to another section or into its own file.
  2. iterations.csv (in this folder) has one row per element changed per iteration: iteration, date, element, change, summary, decided_by, refs. change is one of added, changed, corrected, withdrawn, decided. decided_by is owner only when the owner decided; otherwise empty.
  3. Lab iteration vs element iteration. The lab iteration is the round number (this note's header). An element's iteration count is the number of rows for that element. The CSV gives both.
  4. Sections carry the round. A section changed in a round starts with an italic line such as Iteration 3. The changelog below summarises each round.
  5. Snapshots. When a round closes, the tabbed page is frozen as artifacts/iteration-NN.html with record.py lab attach … --as artifact. Rounds 1 and 2 were not snapshotted; snapshots start at round 3.
  6. Commits. One commit per round on the lab branch, docs(lab): v0.1b direction, iteration N, made when the owner asks. Git history then gives line-level differences between rounds. 6b. exchanges.md records each owner question or challenge and its outcome, in order, so the reasoning between rounds is kept, not only the results.
  7. The tabbed page has an Iterations tab built from iterations.csv: by round, and by element.
  8. Machine-readable for the site. iterations.csv is plain CSV so the Labs page tooling being built for babb-home can show it without parsing prose.
Element id Covers
EL-bits §1: one meaning per bit
EL-wire §1.1–1.3: header type bits, filtering cost, wire.type, the type byte
EL-derive §2: derivation of F, S, O; resolving names
EL-laws §3.1–3.3: bit laws, citation checks, state laws
EL-relops §3.4–3.5: relations as operations; observed and authoritative state
EL-links §3.7: continuation and evidence links; the six evidence kinds
EL-phase §3.6: phase as (opens, closes); separation rule; effect timing; invalid forms
EL-pipeline §4: reading pipeline
EL-guards §5: guards
EL-births §6: births by first mention; role defaults
EL-kinds §7: units, intake, class, traits, tags
EL-transfers §8: transfers
EL-ownership §9: ownership forms; notifications
EL-indexes §10: indexes and cost
EL-stage0 §11: Stage 0 and start-up; bootstrap transcript
EL-setup §12: opening entries; setup policies
EL-kernel-math §13: consequences and proof obligations
EL-decisions §14–15: effects on decisions; open questions
EL-lineage §16: lineage
EL-process §17: this section; exchanges.md, the record of owner questions and outcomes
EL-workplan technical-work-plan.md
EL-overview system-overview.md
EL-rationale design-rationale.md
EL-math mathematics.md

Changelog

Iteration Date Change
6 2026-12-01 Two families of link (§3.7): continuation links keep the 8-element monoid; evidence links (records, actuates, anticipates, realises, senses, under) each get a contract. Extending the monoid with an F-flip rejected, with reasons; F-flip kept as a drift filter. Cost: only lines with evidence links are checked, in step 7. Owner approved.
5 2026-12-01 Corrected round 4 after the owner's challenge: may takes every phase (grants that take time to take effect; access scans), so no fact-form is invalid in advance; permission spans stay standing (validity role, grant, revoke) and one-off permissions are a use count (§3.6). Corrected the is begin/end example. Option A set out in full as a two-byte "what + shape" layout carrying every v0.1 short-header field in 28 bits (§1.3.1). Q12 added. Exchange log added (exchanges.md).
4 2026-12-01 Phase analysed and set out (§3.6): (opens, closes), the separation rule against D, M and not-yet, effect timing, begin/end pairing, 96 invalid fact-forms, ACT end. Owner approved the direction. Type-byte options (§1.3); proposed: c in one byte, phase separate. g_P guard; Stage 0 D2/D11 and pipeline step 7 updated. Open: phase numbering (Q10), type byte (Q11).
3 2026-12-01 Renamed the direction v0.2 → v0.1b (owner). Default wire changed to 7 bits checked, with the filtering-cost reasoning (§1.2). Relations established as four operations with laws, an effect-law self-check, the unfolding order, and operational readings of every bit (§3.4); observed and authoritative partitions (§3.5). Stage 0 D1/D13 rewritten. Lineage against notes 06, 08, 16, DIGEST and mark-boundary (§16). Iteration recording (§17, iterations.csv).
2 2026-12-01 Added seed kind item (a resource) as the role default for members placed with a location role (§6.1), so location can classify an unnamed kind. Corrected the class rule: origin cannot separate money from resources (§7.3). Added intake from outside for declared holdings (§7.2), resolving names (§2.1), and the v0.1 vs v0.1b type-bit budget (§1.1). Owner decided that printing the start-up is an audit option, off by default (§11.1). Added companion documents: work plan, system overview, design rationale, mathematics.
1 2026-11-30 First version. Collects: single-meaning bits, derived F/S/O, the μ/ν/σ laws, the pipeline, guards, births by first mention, role defaults, unit symbols as kinds, class by origin, kind traits, tags as boundaries, transfers, ownership forms and notification classes, index efficiency, Stage 0, opening entries, setup policies with strict modes, kernel consequences, effects on D-01/02/03/05/11.