Skip to main content

CompactionProbeCallback

Trait CompactionProbeCallback 

Source
pub trait CompactionProbeCallback: Send {
    // Required method
    fn validate<'a>(
        &'a mut self,
        to_compact: &'a [Message],
        summary: &'a str,
    ) -> Pin<Box<dyn Future<Output = ProbeOutcome> + Send + 'a>>;
}
Expand description

Probe-validation callback invoked by ContextService::compact_context after the LLM produces a candidate summary.

§Contract (mandatory)

Implementations MUST, before returning:

  1. Call dump_compaction_probe(result) if a debug dumper is configured.
  2. Update verdict-specific metric counters via the appropriate MetricsCallback::record_compaction_probe_* method. The score, category_scores, threshold, and hard_fail_threshold travel through the metrics adapter and are not part of the ProbeOutcome payload.
  3. On internal validation error (validate_compaction returns Err), call MetricsCallback::record_compaction_probe_error() and return ProbeOutcome::Pass. An error must not abort compaction.

The service treats the returned ProbeOutcome exclusively as routing: HardFail → abort with ProbeRejected; Pass | SoftFail → continue.

Required Methods§

Source

fn validate<'a>( &'a mut self, to_compact: &'a [Message], summary: &'a str, ) -> Pin<Box<dyn Future<Output = ProbeOutcome> + Send + 'a>>

Validate the candidate summary produced from to_compact messages.

Implementors§