16 · The first Rust build

16 · The first Rust build

Babb

2026-11-23. The request: "Okay code our system in rust." This records how the first version was built and what building it found. The code in this repository has moved on since; see the root README and spec/ for its current state.


What was built (five crates, about 3,000 lines, 18 tests)


babb-table/1
[["Crate", "Contents"], ["stream-kernel", "Grammar, strict canonical JSON, exact decimals, the 64 verbs and the type byte, addresses, seals. no_std, depends only on sha2; built for wasm32-unknown-unknown and thumbv7em-none-eabihf."], ["stream-log", "Segments, receipts, retries by (rec, ps), rejections journaled as ACK, authority from roots and grants, the Register, packs, seals, verification, gaps"], ["stream-books", "Balances from explicit legs and implied use, Close by hash, span pairing, attribution"], ["stream-codec", "Run form: shared context plus time deltas, lossless"], ["stream-cli", "init, append, adopt, seal, close, verify, view, encode, decode, kernel"]]
Crate | Contents
stream-kernel | Grammar, strict canonical JSON, exact decimals, the 64 verbs and the type byte, addresses, seals. no_std, depends only on sha2; built for wasm32-unknown-unknown and thumbv7em-none-eabihf.
stream-log | Segments, receipts, retries by (rec, ps), rejections journaled as ACK, authority from roots and grants, the Register, packs, seals, verification, gaps
stream-books | Balances from explicit legs and implied use, Close by hash, span pairing, attribution
stream-codec | Run form: shared context plus time deltas, lossless
stream-cli | init, append, adopt, seal, close, verify, view, encode, decode, kernel

Also built:
- spec/kernel.descriptor, the kernel itself, one page;
- six conformance logs with EXPECTED;
- starter packs si-units@1 and agent-ops@1.


What building it found



  • The trial's failure cases held. Overlapping punches stayed separate, a forged punch was refused and the refusal journaled, retries returned the original receipt, gaps were reported, and cancelling errors were each refused. The agent cascade's figures matched the Python trial exactly: remainder 2.5 CPU-s and ~55 J, utilisation 0.683, parallelism 0.969.

  • Two test bugs were the tests' fault, not the code's. One test input had its escape sequence decoded before it reached the file. Another had keys out of order, which the strict parser rightly refused.

  • A real no_std catch. f64::powi doesn't exist without the standard library. The codec builds the kernel without std, so the build caught it.

  • A codec bug. The encoder first treated a varying value as shared context, so runs broke after one row (95,737 against 109,737 bytes). Restricting shared context to what consecutive rows have in common fixed it, at about 3.2× smaller. Reaching the trial's ~28× needs positional payloads and template rows.

  • A demo mistake, noted honestly. A deliberately "intruding" agent was correctly accepted, because the grant covered agent:*. A tamper test first edited the wrong line, and was redone.


Decisions made in code



  • Unique verb names: ASSIGN_CLASS (0x05) and DELEGATE_EVENT (0x37). Mapping to ZAKO is by code.

  • Four fields (time type object payload) instead of v1's five, so v1 logs need an importer.

  • Integers only in canonical JSON. Quantities are decimal strings, and ~ marks an estimate.

  • Implied postings from use + pool.

  • AMEND of a declaration carries set.

  • Authority. CREATE, BIND, GRANT, REVOKE and COMMIT need a root or an admin grant. Recording for another actor needs a matching record grant.


Next steps listed then



  1. A WebAssembly view host.

  2. Positional payloads and template rows.

  3. Packed binary and control-character framing.

  4. A declarative view language.

  5. The web shell.

  6. Importers.

  7. A C interface for devices.

  8. The Python trial run against the conformance logs.

Report Page