rho-coding-agent 1.10.0

A lightweight agent harness inspired by Pi
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::{UsageEvent, UsageLedgerError};

/// Result of an idempotent ledger write.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum RecordOutcome {
    Inserted,
    Duplicate,
}

/// Synchronous, replaceable boundary for durable per-request accounting.
///
/// Implementations should finish the durable write before returning. Callers
/// must treat errors as accounting diagnostics rather than model-call errors.
pub trait UsageRecorder: Send + Sync {
    fn record(&self, event: &UsageEvent) -> Result<RecordOutcome, UsageLedgerError>;
}