Expand description
The Receipt: an offline-verifiable, Ed25519-signed record of a session.
Payload per the brief Module G: session id, agent identity block (version/charter/instance_uid), tool-call summary, cost, stop reason, event-chain hash, signature, signer public-key reference. Subjects are an enum so the same envelope covers signed-workflow chains and retroactive ATIF promotions (Module H reconciliation).
Money is carried as integer micro-USD — floats never touch a signed field.
Structs§
- Cost
Summary - Aggregate cost for the session (integers only — JCS-exact).
- Receipt
- A complete receipt: body + detached signature over the version’s
signing message (see
signing_message— bareJCS(body)for v1, domain-tagged and length-framedJCS(body)for v2). - Receipt
Body - The signed body (everything except the signature itself).
- Tool
Call Summary - Aggregate tool-call statistics for the session.
Enums§
- Receipt
Error - Receipt errors.
- Receipt
Subject - What this receipt attests.
Constants§
- RECEIPT_
DOMAIN_ TAG_ V2 - Domain-separation tag prepended to every version-2 receipt signing message. The trailing NUL makes the tag self-delimiting so no JCS body could extend it into a different tag.
- RECEIPT_
VERSION - Version of the receipt format itself (evolution surface).
Functions§
- new_
body - Convenience constructor filling issuance time and ids.
- signing_
message - Build the exact byte message the receipt signature covers for a
given
receipt_version, from the JCS canonical form of the body.