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");Re-exports§
pub use citation::Citation;pub use citation::CitationEngine;pub use citation::CitationStrength;pub use citation::CodeLocation;pub use citation::GroundedClaim;pub use citation::UngroundedClaim;pub use citation::UngroundedReason;pub use hallucination::Hallucination;pub use hallucination::HallucinationCheck;pub use hallucination::HallucinationDetector;pub use hallucination::HallucinationSeverity;pub use hallucination::HallucinationType;pub use truth::MaintainedTruth;pub use truth::TruthInvalidation;pub use truth::TruthMaintainer;pub use truth::TruthStatus;
Modules§
- citation
- Citation Engine — Invention 4.
- hallucination
- Hallucination Detector — Invention 5.
- truth
- Truth Maintenance — Invention 6.
Structs§
- Evidence
- Evidence backing a code claim.
- Grounding
Engine - Engine that verifies code claims against a
CodeGraph.
Enums§
- Grounding
Result - 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.