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

BabbTools for the frontier.

mascot mascot
All materials

03 — Three type encodings: the Lab, and what choosing the 3rd commits to

2026-11-29-prep-03-type-encodings-lab.md View the source file

Morgen's direction: "For the issue of #4 three type encodings — this work here will be a 'Lab' with a name which we will initiate once we fetch changes from remote for Stream repo, we now have there a Lab creator into which this experimental work can be placed. As for which to choose I'm not sure — my foggy sense is that the 3rd one is what's relevant to this experiment."

The three encodings

#EncodingFormWhere it lives
E1v1 64-verb byte`phase << 6 \code` — 6 bits verb + 2 bits phase, one bytespec/kernel.descriptor; crates/stream-kernel/src/verb.rs; implemented, 21 tests
E2128-position coordinatec = 64F + 32S + 16M + 8O + 2R + D — 7 bits, 0–127docs/kernel-model/DIGEST.md §2; design/stream/relations-and-matrix.md; note 19
E3Six stored bits + 3 derived context bitsstored: relation 2 \direction 1 \modality 1 \phase 2; derived: frame/world, sign/substance, self/other from kind + roles + log frame via derive_context(...)docs/overview/current-design-vision.md; note 12; note 19 §11 — untested

No migration or final byte layout is approved (note 17). The three coexist with no migration plan.

Morgen's leaning: E3 — what it would commit to

His foggy sense is that E3 is the relevant one for this experiment. Treat that as a leaning, not a decision. If E3 is chosen, here is what it commits to:

Commits to:

  • The context derivation being provable — which is exactly Stage C (file 01). E3 is only viable if derive_context(...) is total and unambiguous on the corpus. If Stage C fails, E3 fails with it, and the choice must be revisited.
  • A derive_context(...) function with a defined domain, a counterexample policy, and an ambiguity verdict (Context | Ambiguous | Invalid) — not a silent default.
  • Retaining the full context in the reference AST until the derivation is proven (note 12). The stored form is a spelling; the AST is the meaning.
  • A migration story for E1 logs: either a deterministic converter (E1 → E3, preserving bytes/evidence), or a declared "v1 logs stay under v1" rule (Stage H: replace / import / parallel). E3 does not read E1 logs by itself.
  • Resolving the bookkeeping seam: steps 6–9 are four doublings (16, 32, 64, 128) while the prose calls them "the three context bits", counting only steps 7–9. Step 6 (modality) is a stored bit in E3, not a derived one — the seam must be named in the seed text.

Commits against:

  • E1 as the canonical encoding for the new kernel (E1 stays valid for v1 logs, but the new kernel's canonical form is E3).
  • E2 as a stored form — E2 remains the coordinate (the address), but it is not what is written on the wire. The 128 positions are still the map; E3 is the spelling of a position plus phase.

What E1 would commit to instead (for contrast): the new kernel speaks v1's byte; no migration needed; but the 128-position model and the context derivation have no wire form at all, and the unfolding kernel would be a v1 reader with a bigger vocabulary — not a new kernel.

What E2 would commit to instead: every position stored in full (7 bits + 2 phase bits = 9 bits, i.e. two bytes or a packed form); no derivation needed, no ambiguity possible; but the compactness claim (six stored bits) is abandoned, and the wire form is larger.

The Lab

  • Proposed Lab id: 2026-11-29-unfolding-kernel-muse (spec §5 naming: YYYY-MM-DD-<short-title>-<author>; date = day the work was created, 2026-11-29; author = muse, a registered id per plan Task 1).
  • Base: 5d18970 (full 5d18970655d14a4bf67394345e377c7a763c73f0 — main after PR #7 merged; PR #8's merge was 7761b9a; see file 10).
  • Kind: changes (not in-place — the Lab produces new files: readers, audit tables, seed text, test vectors; it does not only touch paths on main).
  • Question (draft, for Morgen to approve): "Can a small fixed reader learn its vocabulary from the record — proposal, check, activation — and can six stored bits recover the full 128-position context?"
  • Engages (draft): section:unfolding-kernel, section:relations-and-matrix, section:kernel-identity, section:the-books, element:… (once the element index exists — plan Task 1; until then, section + file references), file:docs/kernel-model/test/corpus.json, file:experiments/mark-boundary/.
  • Folder shape (spec §7): labs/2026-11-29-unfolding-kernel-muse/ with AGENTS.md, CLAUDE.md (@AGENTS.md), README.md, lab.json, files/, artifacts/, evidence/, notes/. A skeleton is staged in this package under labs/ for backfilling.
  • Creation (once the tool exists — it does not yet; see file 10): python3 design/tools/record.py lab new unfolding-kernel --question "…" --author muse --date 2026-11-29 from a checkout at base 5d18970. Until the tool is built (plan Tasks 1–7), the Lab is prepared here, in this package, and backfilled — which is exactly what Morgen asked for in item 10.
  • Status: open on creation (status lives in labs/status.csv, not in lab.json; only the owner accepts/rejects).
  • Size limit: 5 MB for a published lab (spec §12, proposed) — the three lab HTML pages already in docs/labs/ total ~240 KB, so this Lab has room, but the HTML artifacts belong in artifacts/, not in files/.