pub struct Receipt {Show 15 fields
pub schema: String,
pub task: String,
pub model: String,
pub finished_ms: i64,
pub iters: u32,
pub tools_called: u32,
pub input_tokens: u32,
pub output_tokens: u32,
pub passed: bool,
pub checked: bool,
pub reason: String,
pub contract: SealSet,
pub seal_breach: Option<String>,
pub audit_request: Option<String>,
pub digest: String,
}Expand description
The one-page account of a run.
Fields§
§schema: StringSchema marker, so a reader can refuse a shape it does not know rather than silently misread one.
task: StringWhat was asked.
model: StringModel handle that answered, as the provider names it.
finished_ms: i64Wall-clock, milliseconds since the epoch. Supplied by the caller — this crate does not read the clock, so a receipt is reproducible in tests.
iters: u32§tools_called: u32§input_tokens: u32§output_tokens: u32§passed: booltrue only when a check was asked and agreed. false covers both
“checked and refused” and “nobody looked” — Self::checked
distinguishes them, and the distinction matters more than the flag.
checked: boolWhether any acceptance check ran at all.
reason: StringWhy it failed, verbatim from the check. Empty on a pass.
contract: SealSetThe sealed contract, path → digest, as it stood before the first turn.
seal_breach: Option<String>Set when a sealed file moved during the run. A receipt carrying this is evidence of tampering, not of work.
audit_request: Option<String>The audit.request id, when the host runs an audit trail. Follow it to
the full record; the receipt is the summary, not the evidence itself.
digest: StringHash over every field above. See the module docs for what it proves.
Implementations§
Source§impl Receipt
impl Receipt
Sourcepub fn compute_digest(&self) -> String
pub fn compute_digest(&self) -> String
Hash of every field but digest itself.
Over the serialised form with the field cleared, rather than over a hand-written concatenation: a concatenation drifts the moment a field is added and starts silently covering less than it claims to.