1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Deterministic replay tokens — §λ-L-E Fase 11.c.
//!
//! A [`ReplayToken`] is a compact receipt emitted at every effect
//! invocation (`call_tool`, `llm_infer`, `db_read`, `http_post`,
//! `ws_send`). It carries the minimum information needed to re-run
//! that effect and confirm the output is bit-identical: effect name,
//! canonical-JSON hash of inputs, canonical-JSON hash of outputs,
//! model version, sampling parameters (temperature, top_p, seed),
//! timestamp, and a 128-bit nonce.
//!
//! Regulated verticals (banking, fintech, legaltech, medicaltech)
//! use the token stream as an independently verifiable replay log —
//! an auditor loads the tokens, re-runs each effect under the
//! original model + parameters, and confirms the outputs match. If
//! they diverge, the divergence point is the exact token where the
//! system behaved differently.
//!
//! The on-the-wire format is canonical JSON with the Record
//! Separator (`\x1e`) separator so the hash computation is
//! byte-identical to the 10.g audit chain. Keeping the canonicaliser
//! in lockstep with enterprise audit means tokens emitted here can
//! be anchored to the enterprise hash chain with zero reformatting.
//!
//! This module hosts:
//!
//! - [`token`] — the canonical struct + hash derivation.
//! - [`log`] — the [`ReplayLog`] trait + two impls (in-memory,
//! enterprise-audit-chain adapter shape).
//! - [`executor`] — [`ReplayExecutor`] that re-runs from a token and
//! reports divergence.
pub use ;
pub use ;
pub use ;