pub struct ReplaySummaryBackend { /* private fields */ }Expand description
Deterministic fixture-backed summary backend for CI and tests.
Constructed from a HashMap<RequestKey, SummaryResponse> keyed by the
canonical BLAKE3 of the request fields (SummaryRequest::request_hash).
A lookup miss returns SummaryError::BackendNotConfigured with a
detailed reason so test failure messages stay actionable.
Use ReplaySummaryBackend::from_fixture_file to load a JSON fixture
keyed by (model_name, prompt_template_blake3, ordered source claims, max_output_bytes, decay_job_id).
Implementations§
Source§impl ReplaySummaryBackend
impl ReplaySummaryBackend
Sourcepub fn from_entries(
entries: Vec<ReplaySummaryFixtureEntry>,
) -> Result<Self, SummaryError>
pub fn from_entries( entries: Vec<ReplaySummaryFixtureEntry>, ) -> Result<Self, SummaryError>
Construct a new replay backend from an in-memory request map.
Duplicate request hashes are refused: the caller has either supplied two distinct fixtures that compute to the same request hash (cryptographic collision — implausible) or repeated the same fixture row by mistake (the more common case).
Sourcepub fn from_fixture_file(path: &Path) -> Result<Self, SummaryError>
pub fn from_fixture_file(path: &Path) -> Result<Self, SummaryError>
Load a fixture file from disk and construct the backend.
File is a JSON document matching the ReplaySummaryFixture
shape. Errors map to SummaryError::CallFailed with a
descriptive message so CI logs are actionable.
Sourcepub fn fixture_count(&self) -> usize
pub fn fixture_count(&self) -> usize
Number of fixture entries currently held.
Trait Implementations§
Source§impl Clone for ReplaySummaryBackend
impl Clone for ReplaySummaryBackend
Source§fn clone(&self) -> ReplaySummaryBackend
fn clone(&self) -> ReplaySummaryBackend
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReplaySummaryBackend
impl Debug for ReplaySummaryBackend
Source§impl SummaryBackend for ReplaySummaryBackend
impl SummaryBackend for ReplaySummaryBackend
Source§fn summarize(
&self,
request: &SummaryRequest,
) -> Result<SummaryResponse, SummaryError>
fn summarize( &self, request: &SummaryRequest, ) -> Result<SummaryResponse, SummaryError>
SummaryError::CallFailed.