Skip to content
· 9 min LIVE

The Driver Died Mid-Shipment. Twice. The Process Finished Anyway.

EPIC-245 process runtime core, live in production: a durable execution journal owns multi-step agent work, and the runtime is just a replaceable worker reading it. Crash recovery was the design promise - production delivered the proof uninvited when the driver died twice mid-shipment and both times the journal resumed with zero re-executed steps. 0.01 USDC through a real ERC-8183 escrow on Arc testnet, exact to the cent (0.0097 provider + 0.0003 protocol fee), independently checkable on-chain. Before any of it ran: nine rounds of independent adversarial security audit, 2 critical and 6 high findings down to zero - and the two bugs that mattered most were still found only by the live dogfood. Sagas 1987, Helland 2012, and the £48.65M TSB lesson the industry forgot twice.

AB
AgentBadge Team
Agency for the Agentic Web
The Driver Died Mid-Shipment. Twice. The Process Finished Anyway.
🤖 For AI agents: Machine-readable: JSON Markdown llms.txt Agent Guide

We rebuilt how our agents execute multi-step work: instead of one synchronous function call carrying a shipment from offer to payment, a durable execution journal now owns the process, and the runtime is just a replaceable worker that reads it. The design promise was crash recovery; the production proof arrived uninvited when the driver process died twice mid-shipment on live infrastructure, and both times the process resumed from the journal and finished - offer, acceptance, handoff, escrow payment, verification. 0.01 USDC through a real ERC-8183 escrow on Arc testnet, exact to the cent (0.0097 to the provider, 0.0003 protocol fee), independently checkable on-chain. An independent adversarial audit went nine rounds against the runtime - 2 critical and 6 high findings down to zero. The two bugs that mattered most were found neither by tests nor by the audit: the live dogfood caught them.

This is part of the Arc campaign series. Previous published episode: the UI that can’t fake live (EPIC-268). This article is EPIC-245: the process runtime core - the durable execution layer underneath the agent economy, and the first production shipment to survive its own operator.

The problem: one function call isn’t a process

I’ll be honest about what our supply-chain settlement used to be - what most agent systems secretly are: a single synchronous function. Offer, acceptance escrow funding, delivery, payment, verdict - one call stack, one process lifetime, one prayer. If anything in the middle fell over - a deploy, a database hiccup, a machine migration - the operation ended wherever it ended, and the only record of how far it got was a log line. You retry, and you hope the chain tolerates a duplicate. You don’t retry, and money sits in an escrow nobody will ever close.

This is fine until it isn’t. The more valuable the work agents do the less acceptable “the process forgot where it was” becomes. Your shipment isn’t a function. It’s a sequence of commitments, some of them on-chain and irreversible, spread across time.

For a junior: imagine baking bread by reading the whole recipe into your head and then being forbidden from writing anything down. If the power cut happens after you mixed the dough but before the oven you don’t know what you’ve already done when power returns. Did I add the yeast? Do I add it again - twice the yeast, ruined bread - or not at all, flat bread? Now imagine the dough cost real money. that’s the difference between a function and a durable process: the durable process keeps the recipe card with checkmarks, and any cook can pick it up.

The recipe card with checkmarks - a handwritten ledger page where each line is a step (offer, accept, handoff, pay, verify) with a stamped checkbox; a pen lies mid-page, the first entries in one handwriting and the last two in a slightly different hand

The industry learned this in 1987 - then forgot it twice

None of this is new knowledge, which is exactly the embarrassing part. In 1987 Garcia-Molina and Salem published Sagas at ACM SIGMOD - the paper that said: long-running work can’t live inside one database transaction, so break it into steps, persist the progress and define what “undo” means per step. Mainframe batch shops of the same era treated checkpoint/restart as basic hygiene - a batch job that couldn’t resume from its last checkpoint was simply broken. Pat Helland spent decades at Microsoft and Amazon repeating the operational version of the same truth - “Idempotence is not a medical condition” (Communications of the ACM, 2012): in a world where messages get retried, the receiver - not the network - is what makes a repeated operation safe.

The industry forgot it the first time when it moved money movement into synchronous web service calls, and the second time when it moved work into AI agent loops. The cost of forgetting is a matter of public record: when TSB Bank migrated its customers onto a new platform over the weekend of 21-22 April 2018 without a resumable checkpointed process, the failure didn’t end with the outage - it lived on as duplicate payments, missing transactions and balances nobody could reconstruct, because there was no durable record of how far each account’s migration had actually gotten. TSB took until December of that year to return to business-as-usual. The regulators fined the bank £48.65 million, customers were paid £32.7 million in redress, and in a genuinely rare move the Bank of England fined the former CIO personally - £81,620 - for failing to manage the migration. The outage lasted days; the unknown state lasted months. If you run money movement, that’s the sentence that should keep you up at night - not the downtime, the months of not knowing.

We didn’t want to rediscover that bill at agent scale - and if you’re building agents that touch escrow, neither do you. Temporal and its cousins prove the durable-execution pattern works at massive scale; what we needed was a small, audit-shaped version of it that understands escrow, evaluators and agent identity natively - because in our world a “step” can move money on-chain, and “unknown state” isn’t an ops inconvenience, it’s a financial position.

What shipped: the journal’s the process, the runtime is replaceable

EPIC-245 inverted the ownership. The process is no longer a call stack - it’s rows in an execution journal, and the runtime is just a worker that can die at any time:

  • Execution journal - a durable, append-only record in Postgres: process instances, steps, commands with idempotency keys, outcomes. Occurrences are monotonic per process - the journal can’t forget or reorder what already happened, and step payloads are byte-capped so a runaway payload can’t poison the record.
  • Dispatch - every step executes as a command with a stable commandId. The same commandId submitted twice returns the original outcome instead of executing twice - idempotency is structural not a promise to be careful.
  • System steps - the gate operations (ownership checks, policy denials) are runtime-level steps with typed reason codes, not inline if statements. A DENY is a first-class journaled event with a machine-readable reason.
  • Sweeper - a background reaper that finds instances whose lease expired mid-step (the worker died) and re-drives them. Recovery isn’t an operator runbook; it’s the system behaving as designed.
  • Seams - domain logic plugs in through executor adapters. The first one is supply-chain escrow on ERC-8183; the runtime itself knows nothing about shipments, tokens or evaluators.
Dispatch and recovery - a pipeline of steps flowing through a journal spine; below it, a second lane shows a worker node powered down mid-step while the sweeper lifts the step back into the queue

The property I cared about: kill the worker at any step boundary and a fresh worker - any worker, we don’t care which - reconstructs the exact same world from the journal - then continues instead of restarting.

Nine rounds of adversarial audit before it touched production

This runtime moves real escrow money, so we did what has become the project convention: an independent adversarial security review (Arc Studio) before merge. It went nine rounds (2 critical, 6 high findings in round one; zero of either by round nine).

The first round came back with 2 critical and 6 high findings - the kind of report card that ruins your weekend. Among them, the kind of bugs only an adversarial reviewer notices: money fields that a caller could influence through the command payload instead of being derived server-side from the shipment plan; key-resolution paths where the evaluator of an escrow could silently inherit the venue’s operational keys; executor wiring that failed open - a missing configuration meant “no executor, skip” instead of “loudly refuse.”

Every round ended with fixes and regression tests - 229 integration tests green by the end, and the re-audit read the diff. Round nine came back clean: zero critical, zero high. The rules that survived the audit are the ones now enforced by construction:

  • Money fields are plan-derived, never caller-derived. The amounts, recipients and job parameters come from the shipment state in the journal, not from anything a caller can submit.
  • Fail-closed everywhere. No executor configured - the adapter returns SC_EXECUTOR_UNCONFIGURED and the step can’t proceed. Missing configuration is a boot error, not a silent skip.
  • Keys are scoped per role. Provider, evaluator and operations keys are separate EOAs; the wiring throws if any two roles resolve to the same key. The testnet contour never inherits mainnet settings - not even “accidentally the same RPC.”
Nine rounds - a wall of nine stamped review reports arranged in a grid, the first few covered in red annotations that get progressively sparser, the last one bearing a single green seal

The live dogfood: one shipment, real escrow, exact change

With the runtime merged and deployed (flag off - the production server process is untouched by it), we drove one real one-hop shipment end-to-end through the production journal on Arc testnet: shp-dogfood245-2. Tiny money on purpose - $0.01 USDC, real escrow contract, real chain through the real ERC-8183 escrow contract.

The chain of events, all journaled in the production database:

work_offer -> work_accept -> handoff -> pay -> verify

The pay step settled on-chain: transaction 0x96dc77bb…52eb, escrow job 70, status Completed.

Real explorer capture of the settlement transaction - status Success, block 75102886, USDC transfer rows visible; not an illustration

The conservation is exact and independently checkable: 0.0097 USDC to the provider plus 0.0003 protocol fee equals the escrowed 0.01 - to the cent. The verify step’s criteria digest is recorded in the same ledger row, so the verdict binds to exactly the work that was accepted.

The dogfood timeline - five ledger events as stamped stations on a line, two red crash marks between them with green resume arrows, and a small money split at the end showing 0.0097 and 0.0003

And then there’s the crash story - the one we didn’t script.

The driver process running the shipment died twice. Not in a test - in production, on live infrastructure, because Fly.io’s database proxy kills idle-looking connections. Both times the process was simply restarted, and both times it resumed from the journal without re-executing a single completed step. The idempotency keys did what they exist to do: already-done was already-done, and the process continued where the journal said it was. We’d designed crash recovery as a property. Production demonstrated it as an accident. I’ll take that trade any day.

The honest section: what the live run caught that nothing else did

Nine audit rounds and 229 green integration tests didn’t catch the two most interesting bugs. The live dogfood caught both:

Terminal capture of a public JSON-RPC read - getJob(70) returns status 3 Completed with budget 10000 micro-USDC; getJob(69) returns status 0 budget 0, the unfunded contour-bug artifact; no keys, no database
  1. RPC contour pollution. The first run reported a mined transaction with no JobCreated log - impossible, since the transaction had clearly succeeded. The truth: writes went to the testnet endpoint, but receipt reads silently used the ambient mainnet RPC from the production environment. On mainnet, that transaction hash doesn’t exist, so the decoder saw nothing. The first shipment created escrow job 69 on-chain and then “failed” - job 69 is still sitting there, unfunded, a permanent artifact of the bug. The fix: an explicit contour override now ignores ambient RPC configuration entirely, and reads and writes share one endpoint by construction.
  2. Infrastructure kills connections. The database proxy drops connections that look idle - and a process step waiting on a chain confirmation absolutely is. This is exactly the class of failure the journal exists for, so the operational answer is the design itself: retry the driver, let idempotency sort it out.

Also in the name of honesty - because you’d rather hear it from us than guess: the verification of this deployment is currently self-verification. The independent cloud verification session we conventionally run was blocked by an org billing quota at dispatch time; the checklist, task file and all evidence pointers are committed (info/devin-verify-245.md) for the re-run. And the runtime still drives only the supply-chain domain - the remaining process families (software delivery, physical fulfilment) are adapter work ahead of us, and so is flipping the production feature flag on for server-driven execution.

What this opens

The runtime is the floor the next epics stand on:

  • EPIC-246 - policy as process-level gates, not scattered middleware checks.
  • EPIC-248 - handoff between operators: a process paused in the journal can change hands because its state is data, not memory.
  • EPIC-250 - observability over the journal: every process that ever ran is queryable history by construction.

This is also the first durable piece of the Universal Process Semantics program we announced in the layers-and-bricks article: one shared execution layer under every process model, with domain adapters on top. The journal schema was designed so the supply-chain adapter is the first citizen, not the only shape.

Read the arc

Don’t certify. Measure.

  • Settle transaction: 0x96dc77bb…52eb on arcscan (escrow job 70, Completed)
  • Verification report with the full checklist: committed at info/devin-verify-245.md in the repo
  • ERC-8183 reference contract on Arc testnet: 0x0049e5362736c933055e502b3cf3ba90cc0bf6a0
  • The artifact of the contour bug, for the curious: escrow job 69 exists, unfunded, forever - a cheap lesson at 0.01 USDC.

Shipped: durable execution journal, command dispatch with structural idempotency, sweeper recovery, system steps with typed denials, supply-chain escrow adapter - audited through nine adversarial rounds to zero criticals and zero highs, and proven on a live shipment whose operator died twice on the way.