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:
- Call
dump_compaction_probe(result)if a debug dumper is configured. - Update verdict-specific metric counters via the appropriate
MetricsCallback::record_compaction_probe_*method. The score,category_scores, threshold, andhard_fail_thresholdtravel through the metrics adapter and are not part of theProbeOutcomepayload. - On internal validation error (
validate_compactionreturnsErr), callMetricsCallback::record_compaction_probe_error()and returnProbeOutcome::Pass. An error must not abort compaction.
The service treats the returned ProbeOutcome exclusively as routing:
HardFail → abort with ProbeRejected; Pass | SoftFail → continue.