Skip to main content

Grounded

Trait Grounded 

Source
pub trait Grounded {
    // Required methods
    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>;
}
Expand description

Trait for grounding code claims against a knowledge source.

Implementors hold a reference to some code knowledge base (typically a CodeGraph) and can verify whether natural-language claims about code are backed by real data.

Required Methods§

Source

fn ground_claim(&self, claim: &str) -> GroundingResult

Verify a natural-language claim about code.

Extracts code references from claim, checks each against the backing graph, and returns a GroundingResult indicating full, partial, or no support.

Source

fn find_evidence(&self, name: &str) -> Vec<Evidence>

Find all evidence nodes matching name.

Searches by exact name first, then by qualified-name substring.

Source

fn suggest_similar(&self, name: &str, limit: usize) -> Vec<String>

Suggest graph names similar to name (for typo correction).

Returns up to limit suggestions sorted by edit distance.

Implementors§