The agent reads · The policy decides · The database enforces
Remit-To is an autonomous accounts-payable agent for freight brokers. It matches invoices to proof, catches duplicates and payment redirects, and holds anything it cannot prove.
The model never decides who gets paid.
Claude reads and explains. rules.ts decides. SpacetimeDB enforces who may approve. When a document disagrees with a verified record, the document loses.
The model produces typed fields and an explanation, nothing more. The same rules.ts runs in the agent to explain, and inside the reducer transaction to decide.
Claude reads the rendered invoice, rate confirmation, POD, NOA and emails. It returns typed fields with a confidence score and a plain-language explanation. It cannot touch assignments, bank records or approvals.
Eight deterministic rule families (thirteen checks) in rules.ts select the amount from the rate con and the payee from verified assignments. Any failed rule is a hold with the rule id, reason and evidence ids attached.
SpacetimeDB reducers re-run the policy on trusted rows, reserve the load and invoice key atomically, and derive the actor from the connection identity. The agent identity cannot approve. Refusals commit to the audit log.
Three seeded loads run end to end through the same path: documents in, decision out, approval by a different human, payment status that never lies.

A June invoice and an "updated banking" email ask us to pay the carrier directly. A verified March assignment says the factor. An unverified email cannot replace a verified payment instruction.
Open L-2041 on the board →
Two requests race for the same load. Unique indexes inside one transaction leave exactly one reservation. The loser's refusal is a committed audit row, not an exception.
Open the re-bill on the board →
Invoice matches rate con and POD. The agent requests; a different human approves; the runner submits with a persisted idempotency key. Status moves to submitted, then simulated_settled, live.
Open L-2037 on the board →pending ──▶ approved ──▶ submitting ──▶ submitted ──▶ simulated_settled │ │ │ │ rejected pending* unknown failed │ submitted / failed pending* prior approval invalidated when the snapshot changes unknown obligation stays reserved; reconcile the stored key
36 synthetic development cases scored against an explicit answer key the agent never reads. Not a blind benchmark. Not a production catch rate.
No money moved. No real dollars saved are claimed. Extraction errors are reported separately from policy errors.