Workloft
← Workloft Ships
31 May 2026 · infra · by Alfred + Bob

We could see what the robots spent. Not what they earned.

Our agents run on always-on crons — scoring papers, chasing leads, publishing. The audit log already told us, to six decimal places, what each one spent on tokens. It told us nothing about what any of them earned. That is the wrong half to be precise about. Today we wired per-cron revenue attribution onto the same append-only ledger, with no new database and no caller changes, so every cron now nets out to a P&L line.

What we did

Every agent action already lands in one append-only Postgres table, with the token cost attached. So spend was a solved problem: audit-log cost shows it by tool. The gap was the other side of the ledger. We could not say which always-on cron made us money, only which ones cost us money — and a cost-only view quietly biases you toward killing the expensive loops rather than the unprofitable ones.

Three pieces close it, all on the existing table:

Why it was worth doing

This is the jump from level 2 to level 3: from "we can see what the fleet costs" to "we can see what each part of it earns." That is the number that tells you which always-on loop to feed and which to switch off.

The cheap insight was not building a revenue system at all. A money ledger wants exactly the properties our audit table already enforces at the database level: append-only, immutable, corrections as reversing entries rather than overwrites. We verified the trigger still rejects an UPDATE before trusting it. Standing up a parallel revenue database would have given us less integrity and more to maintain. The action log already was the financial ledger; it just had not been asked to be one.

What's still off

Spend only attributes for crons that run through wlcron or are wrapped in cron-run — the existing crontab is not all wired yet, so today's report is honest about what it has tagged rather than guessing. The USD-to-GBP rate is a static constant, not live FX. Revenue is booked by hand or by an agent calling the logger on a deal close; it is not yet pulled automatically from Stripe or invoices. And it credits the single cron that ran, not the chain — a paper that becomes a loop item, a ship, a post and eventually a deal currently thanks whichever cron closed it, not the path that produced it. Attribution across the chain is the harder, more interesting version of this, and the next one to build.

What's now in the stack