Skip to main content

Crate oharness_critic

Crate oharness_critic 

Source
Expand description

Critics and reflectors for open-harness (plan §11).

A Critic inspects a just-completed assistant turn and returns a CriticVerdict — accept, reject, revise, or abort. The loop is responsible for invoking critics and acting on their verdicts; this crate only ships the trait surface and the shipped implementations.

A Reflector inspects a finished episode (task + outcome + evaluation) and optionally emits a oharness_core::Reflection for the next iteration of a run_reflexion loop. Reflections are threaded back into subsequent calls via the ReflectionInjector middleware, which is a RequestLayer that prepends reflections as a system-prompt suffix or first-user-message prefix.

Shipped impls are behind feature flags so the trait crate itself stays dep-free:

implfeature
shipped::NullReflector— (always available)
shipped::LlmReflector
[shipped::RegexDenyCritic]regex-deny
[shipped::TestCritic]test-runner
[shipped::LlmJudgeCritic]llm-judge

ConstitutionalCritic is deliberately deferred — its principle-based revision flow has more configuration surface than M2 needs right now.

Re-exports§

pub use composite::AggregationPolicy;
pub use composite::CompositeCritic;
pub use critic::AssessmentContext;
pub use critic::Critic;
pub use critic::CriticTrigger;
pub use critic::CriticVerdict;
pub use injector::ReflectionInjector;
pub use injector::ReflectionPlacement;
pub use reflector::Reflector;

Modules§

composite
CompositeCritic — fans an assess call across multiple child critics and reduces via an AggregationPolicy (plan §11.3).
critic
Critic trait, CriticVerdict, AssessmentContext, and the CriticTrigger config enum (plan §11.1, §11.2).
injector
ReflectionInjector — the middleware bridge that turns accumulated Reflections into prompt material the next LLM call will see (plan §11.5).
reflector
Reflector trait (plan §11.4).
shipped
Shipped [Critic] and [Reflector] implementations.