MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / turn_outcomes_root

Function turn_outcomes_root

atomic-agent/src/turn/orchestrator/attestation.rs:19–27  ·  view source on GitHub ↗

The turn-outcomes evidence root: BLAKE3 over the canonical JSON of the session ledger's classified outcomes (boundary pairs + outcomes, in ledger order). Matches [`atomic_core::change::attestation::Attestation`'s `turn_outcomes_root` construction contract.

(session: &AgentSession)

Source from the content-addressed store, hash-verified

17/// ledger order). Matches [`atomic_core::change::attestation::Attestation`'s
18/// `turn_outcomes_root` construction contract.
19fn turn_outcomes_root(session: &AgentSession) -> AgentResult<atomic_core::types::Hash> {
20 let json = serde_json::to_vec(&session.turn_outcomes).map_err(|e| {
21 crate::error::AgentError::AttestationFailed {
22 session_id: session.session_id.clone(),
23 reason: format!("failed to serialize turn outcomes for evidence root: {e}"),
24 }
25 })?;
26 Ok(atomic_core::types::Hash::of(&json))
27}
28
29/// The capture evidence root: BLAKE3 over `(file name, content hash)` pairs
30/// of every capture file in the session's captures directory, sorted by

Callers 1

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected