pub mod citation;
mod engine;
pub mod hallucination;
pub mod truth;
pub use citation::{
Citation, CitationEngine, CitationStrength, CodeLocation, GroundedClaim, UngroundedClaim,
UngroundedReason,
};
pub use engine::{extract_code_references, GroundingEngine};
pub use hallucination::{
Hallucination, HallucinationCheck, HallucinationDetector, HallucinationSeverity,
HallucinationType,
};
pub use truth::{MaintainedTruth, TruthInvalidation, TruthMaintainer, TruthStatus};
#[derive(Debug, Clone)]
pub enum GroundingResult {
Verified {
evidence: Vec<Evidence>,
confidence: f32,
},
Partial {
supported: Vec<String>,
unsupported: Vec<String>,
suggestions: Vec<String>,
},
Ungrounded {
claim: String,
suggestions: Vec<String>,
},
}
#[derive(Debug, Clone)]
pub struct Evidence {
pub node_id: u64,
pub node_type: String,
pub name: String,
pub file_path: String,
pub line_number: Option<u32>,
pub snippet: Option<String>,
}
pub trait Grounded {
fn ground_claim(&self, claim: &str) -> GroundingResult;
fn find_evidence(&self, name: &str) -> Vec<Evidence>;
fn suggest_similar(&self, name: &str, limit: usize) -> Vec<String>;
}