Backend-agnostic grounding gate for D4. Splits a reflect answer into
clauses, asks the configured EntailmentVerifier whether the cited-memory text
entails each, and applies the pass/fail policy — returning the unsupported clauses so
the agentic loop can re-enter targeting exactly what wasn't grounded.
This module owns the clause split and the policy; the verifier owns only the per-clause judgement. Opts:
:entailment_verifier— verifier module (defaultEntailmentVerifiers.Noop, i.e. off). All other opts pass through to the verifier (:llm,:provider, …).:entailment_min_supported— fraction of clauses that must be supported to pass (default1.0— every clause must be grounded).
Safe by construction: a blank answer passes (nothing to verify), and a verifier that returns a malformed result is treated as all-supported so a broken gate never blocks an answer.
Summary
Functions
Check that answer's clauses are entailed by evidence (cited-memory text).
Types
@type result() :: %{ passed?: boolean(), clauses: [String.t()], verdicts: [Foresight.Reflect.EntailmentVerifier.verdict()], unsupported_clauses: [String.t()] }