Skip to main content

Module grounding

Module grounding 

Source
Expand description

Grounding — Anti-hallucination layer for code claims.

Verifies that claims about code are backed by graph evidence. An agent cannot assert that code exists without graph confirmation.

§Overview

The grounding system extracts code references from natural-language claims and checks each one against the CodeGraph. Claims that reference symbols, functions, types, or files absent from the graph are flagged as ungrounded — potential hallucinations.

§Usage

use agentic_codebase::grounding::{GroundingEngine, Grounded};

let engine = GroundingEngine::new(&graph);
let result = engine.ground_claim("The function process_payment validates the amount");

Structs§

Evidence
Evidence backing a code claim.
GroundingEngine
Engine that verifies code claims against a CodeGraph.

Enums§

GroundingResult
Result of grounding a claim against the code graph.

Traits§

Grounded
Trait for grounding code claims against a knowledge source.

Functions§

extract_code_references
Extract potential code identifiers from a natural-language claim.