Design question: one signed receipt per billable turn and per paid job
Three open threads are circling the same record, so before anyone proposes a kind I want to ask where you'd want it to live.
#5652 wants budgets built on NIP-AM turn metrics and is careful to keep reported, estimated and unknown cost apart. #2426 wants a job acceptance to state its terms and the result to report against them. #9207 is the 402 case - a turn didn't happen because the provider said pay, and 25 minutes later nothing in the channel says why. #2958 pushes paid agents to a follow-up.
They all need the same small thing: a signed record per billable turn and per paid job. Who asked, what was agreed (terms, or a budget), what ran (model, provider, whether it went to shared compute), what it cost as reported and as estimated - kept as two fields, never merged - and the outcome. Signed by the agent key like every other Buzz event, and chained, so a reader can tell when entries are missing rather than just absent. With that in place the dashboard in #5652 is a sum anyone with read access (#8556) can re-add, and a paid listing in #2958 has something to settle against.
Part of this exists already. 44200 (NIP-AM, landed with #4000) is one signed event per turn with a per-session turnSeq, an estimated costUsd, pricingIdentity, and a rule that consumers never merge estimated and wire-reported cost. What it doesn't carry is who asked, the terms or budget, a provider-reported cost next to the estimate, shared compute, the outcome against the terms, or the paid-job half - and it is encrypted to the owner, so nobody else can check it.
In buzz-app the live surface is now the Usage plugin (Settings → Usage). It reads each harness's own session files on the computer and shows the cost the harness recorded, or else token counts at published API prices, and it says itself that this is a best-effort estimate, not your bill. The receipt is what turns that estimate into something checkable: the same numbers, signed per turn, with the reported and the estimated cost side by side.
Questions for maintainers:
- Is there a preferred seam - a payload on 44200, a sibling kind next to it, or something the harness writes and the relay stores like any other event?
- Cost fields on the record, or referenced by digest? 44200 is encrypted to the owner, and a receipt someone else can check has to show something.
- Do you want the job half (#2426) and the turn half (#5652) to be one record shape or two that reference each other?
What we have, so you can judge if it's useful. A deal record profile with a closed set of step types (baseline, intent, check, verdict, approval, action, outcome, close and a few more), each party sealing its own close and a reconcile over the two: https://github.com/action-state-group/evidencebook/tree/v0.13.8/dealprofile/x-deal-v0. And a small listener that turns an observed, already-signed Buzz event into a signed evidence record (a carry of the event, not a re-signing) without touching Buzz: https://github.com/action-state-group/capsule-emit-buzz. Neither talks to NIP-AM. The evidence layer itself runs in mesh-llm and will be available there as a plugin. If you name a seam I'll write the mapping as a short note in our repo and link it here rather than land it cold.
I run Action State. This is our area, so weigh it accordingly.