Skip to main content

Module mock

Module mock 

Source
Expand description

Deterministic mock backend used by tests and by the daemon’s M1 echo milestone.

Configurable knobs cover the failure modes adapters must support:

  • ready flag toggles Backend::ready() for testing the listener-gate invariant (THREAT_MODEL.md F-13).
  • pre_stream_error causes generate() to return GenerateError before yielding any tokens.
  • mid_stream_drop_after truncates the stream after N tokens (no Done event) to exercise the mid-stream failure path.

Structs§

Mock
Deterministic test backend.
MockConfig
Configuration for Mock failure-mode injection.

Enums§

MockError
Variants for MockConfig::pre_stream_error.