Skip to main content

Module grounding

Module grounding 

Source
Expand description

KG↔LLM grounding evaluation — does a model’s asserted claim actually trace to the graph facts it cited?

The output gate (inference/orchestrator.rs::orchestrate_inference) already refuses any LLM output that carries no provenance citation. That is a presence check. This library deepens it into a support check: given the structured claim the model emitted (AgentOutput::semantic_quin) and the resolved cited facts, it measures the degree to which the claim is supported by those facts and returns a graded verdict.

§Why this is knowledge-level, not wisdom-level

Grounding only asks “is this asserted knowledge traceable to attested facts?” — a Data→Knowledge check the machine is allowed to make. It never authors the final “ought”; weakly-grounded claims are routed to human review, not silently accepted or rewritten. This mirrors the engine-wide identity discipline: a partial match is a proposal requiring ratification (closeMatch), never an asserted fact.

§Fail-closed

No citations, or a claim that traces to nothing in the evidence, yields GroundingVerdict::Ungrounded — the gate blocks. A score is only ever produced from real component arithmetic over the cited quins; nothing is fabricated.

Kernel-class Reduction over the evidence set; CPU path always present (§13).

Re-exports§

pub use claim_support::component_support;
pub use claim_support::entity_grounding;
pub use claim_support::report;
pub use claim_support::GroundingReport;
pub use evaluate::evaluate_grounding;
pub use evaluate::evaluate_output_grounding;
pub use evaluate::grounding_verdict;
pub use evaluate::resolve_citations;

Modules§

claim_support
The support arithmetic: how strongly a claim triple is backed by a set of cited fact quins. Pure over NQuins — no I/O, fully testable.
evaluate
Turn the support arithmetic into a verdict, and resolve provenance citations into the facts the arithmetic needs.

Structs§

GroundingThresholds
Thresholds partitioning the grounding score into the three verdicts. deny < permit.

Enums§

GroundingVerdict
The graded outcome of grounding a claim in cited evidence.

Traits§

GroundingResolver
Resolves a provenance citation hash to its full fact quin. Implemented by whatever holds the graph (the daemon’s quin store, a temporal-graph snapshot, a test stub). Grounding needs the full triple of each cited fact — a bare hash is not enough — so the gate activates only where facts are resolvable, and never false-denies a grounded claim for lack of a resolver.