Skip to main content

mnemo_deal/
lib.rs

1//! v0.4.0 (P1-5) — agent-on-agent deal ledger.
2//!
3//! Anthropic Project Deal (announced 2026-04-25) opens up
4//! agent-on-agent commerce: one agent contracts another to perform a
5//! task and the buyer's host needs a tamper-evident record of the
6//! agreed terms + completion. This crate ships the substrate: a
7//! chained-HMAC log of [`DealEnvelope`]s, each one signed in line
8//! with the existing memory-provenance chain so audit-log export
9//! emits one continuous ledger.
10//!
11//! Three pieces:
12//!
13//! 1. [`envelope::DealEnvelope`] — the minimal contract shape (who,
14//!    what, when, prev_hash, hmac).
15//! 2. [`ledger::DealLedger`] trait + `InMemoryDealLedger` impl —
16//!    append-only log with replay over an offset range.
17//! 3. [`dispute::verify_chain`] + [`dispute::DisputeReport`] — walks
18//!    the chain, finds the first divergence between expected and
19//!    observed hashes, and pinpoints the offset that broke.
20
21pub mod discovery;
22pub mod dispute;
23pub mod envelope;
24pub mod ledger;
25pub mod reputation;
26
27pub use discovery::{AgentAdvertisement, DealCapability, Ed25519PubBytes};
28pub use dispute::{DisputeReport, verify_chain};
29pub use envelope::{AgentId, DealEnvelope, EnvelopeError};
30pub use ledger::{DealLedger, InMemoryDealLedger, LedgerError, LedgerOffset};
31pub use reputation::{ReputationScore, compute_reputation};