oharness_critic/lib.rs
1//! Critics and reflectors for open-harness (plan §11).
2//!
3//! A [`Critic`] inspects a just-completed assistant turn and returns a
4//! [`CriticVerdict`] — accept, reject, revise, or abort. The loop is
5//! responsible for invoking critics and acting on their verdicts; this
6//! crate only ships the trait surface and the shipped implementations.
7//!
8//! A [`Reflector`] inspects a finished episode (task + outcome +
9//! evaluation) and optionally emits a [`oharness_core::Reflection`] for
10//! the next iteration of a `run_reflexion` loop. Reflections are threaded
11//! back into subsequent calls via the [`ReflectionInjector`] middleware,
12//! which is a `RequestLayer` that prepends reflections as a system-prompt
13//! suffix or first-user-message prefix.
14//!
15//! Shipped impls are behind feature flags so the trait crate itself stays
16//! dep-free:
17//!
18//! | impl | feature |
19//! |------|---------|
20//! | [`shipped::NullReflector`] | — (always available) |
21//! | [`shipped::LlmReflector`] | — |
22//! | [`shipped::RegexDenyCritic`] | `regex-deny` |
23//! | [`shipped::TestCritic`] | `test-runner` |
24//! | [`shipped::LlmJudgeCritic`] | `llm-judge` |
25//!
26//! `ConstitutionalCritic` is deliberately deferred — its principle-based
27//! revision flow has more configuration surface than M2 needs right now.
28
29pub mod composite;
30pub mod critic;
31pub mod injector;
32pub mod reflector;
33pub mod shipped;
34
35pub use composite::{AggregationPolicy, CompositeCritic};
36pub use critic::{AssessmentContext, Critic, CriticTrigger, CriticVerdict};
37pub use injector::{ReflectionInjector, ReflectionPlacement};
38pub use reflector::Reflector;