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

BabbTools for the frontier.

mascot mascot

Making

SeriesHow Stream Was Created

12 · The Books in detail

2026-11-23. The request: "Let's study books in more detail."

The Books answer one question: where did every conserved quantity come from, and where did it go? That covers money and equally energy, compute, tokens, material and people's hours. Entries record movements. Balances are always computed, never written.

What the Books are made of

PartWhat it isDeclared
UnitA kind of quantity, with a dimension and a base unitRegister
AccountA place a quantity sits or passes throughRegister
BookA boundary of accountability (an entity, site, project or household). A balance is per (book, account, unit).Register
PoolAn account that supplies: host energy, a token allowance, shift hours, cashRegister; named per run
MovementA signed amount between accountsLog entries
CloseA sealed period, committed by hashLog entry

Account roles: sources and pools, activities, stocks, outputs, parties.

Two kinds of movement

  • Explicit postings are entries whose whole claim is a transfer (a purchase, a payment, a budget). They carry legs that balance per unit: inv:raw −100 kg → inv:product +92 kg, inv:scrap +8 kg
  • Implied postings come from acts. When a span closes with use: 33.1 CPU-s, ~480 J and its run declared pool = host:build-01, the movement pool → activity is already fully stated. The Books derive it, and nothing extra is written. Consumption is the most frequent movement, so this keeps it at zero extra bytes. The Rust stream-books crate implements exactly this.

Units, and why value isn't converted

  • A conversion holds within a dimension, always (1 kWh = 1000 Wh), so it belongs in the Register.
  • A price crosses dimensions and is contingent (an hour is worth $50), so it belongs in a view.

Workwarrior's units-v1 already enforces this split. Cost, value and margin are views over a versioned price table, and repricing never touches the Books.

Measured, estimated, settled

A movement carries how it is known: - measured: a meter, cgroup counters, API usage; - estimated, marked ~: a run's share of host energy, a provisional charge; - settled: an invoice.

An invoice supersedes the provisional charge, and the difference shows as a correction.

Time and periods

  • Balance at any time: the last Close plus the movements since.
  • A late entry for a closed period: posted as an adjustment in the open period, referencing the closed one (recommended).

Time as a balance

People's hours, machine uptime and an agent's budget are capacity, conserved per actor. Wall time is not conserved. Elapsed time is not the same as time spent from someone's capacity.

Open: an operator clocked onto two machines at once. Split their hours, or flag the overlap? The recommendation is to flag it, unless a declared rule says how to split.

Allotment: the managerial payoff

A budget is a posting from a pool to an allotment account:

host:build-01:energy  −900 J  →  allot:k42  +900 J

Consumption draws against it. Three views follow: - Variance: allotted against used. - Headroom: the surplus left in each pool. - Efficiency: output per unit of input.

These are the figures that let an undertaking hold output steady on less input, or put surplus to work.

Worked example: one agent task

AccountJCPU-sInput tokens
host:build-01 (pool)−610−41.0
provider allowance (pool)−18,000
run:k42 (activity)+610+41.0+18,000
↳ remainder (overhead)~552.50

Each column balances on its own. A dollar figure is a priced view until an invoice settles it.

Read on Telegraph