oharness-critic
Critic / Reflector traits, composition, and shipped impls for
open-harness.
What's in here
Critictrait —assess(ctx) -> CriticVerdict. Verdicts:Accept/AcceptWithNote(..)Reject { reason }— terminates the run.Revise { replacement, reason }— in-place turn rewrite; the loop swaps the message and continues (up torevision_depth_cap, default 3).Abort { reason }— hard stop.
CompositeCritic— chain multiple critics with anAggregationPolicy:FirstReject,AllMustAccept,MajorityVote,Weighted(..).Reflectortrait —reflect(episode) -> Option<Reflection>. Runs betweenrun_reflexionepisodes.ReflectionInjector—RequestLayerthat prepends accumulated reflections to the next episode's system prompt.- Shipped impls (all feature-gated):
LlmJudgeCritic(llm-judge) — prompt a judge LLM with a rubric, parseSCORE: <0..1>, compare to threshold.TestCritic(test-runner) — run unit tests as the acceptance criterion.RegexDenyCritic(regex-deny) — reject on regex match.NullReflector,LlmReflector(always) — reflexion-side counterparts.
Quickstart
use ;
use Arc;
let critics = new;
// Pass to `AgentBuilder::with_critics(critics)`.
See the custom_critic, self_refine, and llm_judge_critic
examples in oharness-loop/examples/.
License
Dual-licensed under MIT or Apache-2.0.