Skip to main content

QueryEngine

Struct QueryEngine 

Source
pub struct QueryEngine;
Expand description

The central query executor.

Implements all 24 query types defined in the AgenticCodebase specification. Each method takes a shared reference to a CodeGraph and query-specific parameters, returning a strongly-typed result or an AcbError.

Implementations§

Source§

impl QueryEngine

Source

pub fn new() -> Self

Create a new query engine.

Source

pub fn symbol_lookup<'g>( &self, graph: &'g CodeGraph, params: SymbolLookupParams, ) -> AcbResult<Vec<&'g CodeUnit>>

Look up symbols by name with optional filters.

Source

pub fn dependency_graph( &self, graph: &CodeGraph, params: DependencyParams, ) -> AcbResult<DependencyResult>

Build the forward dependency graph from a unit.

Source

pub fn reverse_dependency( &self, graph: &CodeGraph, params: DependencyParams, ) -> AcbResult<DependencyResult>

Build the reverse dependency graph (who depends on this unit).

Source

pub fn call_graph( &self, graph: &CodeGraph, params: CallGraphParams, ) -> AcbResult<CallGraphResult>

Build a call graph centered on a function.

Source

pub fn type_hierarchy( &self, graph: &CodeGraph, params: HierarchyParams, ) -> AcbResult<HierarchyResult>

Explore the type hierarchy (ancestors and/or descendants).

Source

pub fn containment<'g>( &self, graph: &'g CodeGraph, unit_id: u64, ) -> AcbResult<Vec<&'g CodeUnit>>

Find all units contained within the given unit, recursively.

Source

pub fn pattern_match( &self, graph: &CodeGraph, params: PatternParams, ) -> AcbResult<Vec<PatternMatch>>

Match units against a simple pattern DSL.

Brute-force cosine-similarity search over feature vectors.

Source

pub fn impact_analysis( &self, graph: &CodeGraph, params: ImpactParams, ) -> AcbResult<ImpactResult>

Analyse the impact of changing a unit.

Source

pub fn test_coverage( &self, graph: &CodeGraph, unit_id: u64, ) -> AcbResult<CoverageResult>

Compute test coverage information for a unit.

Source

pub fn cross_language_trace( &self, graph: &CodeGraph, params: TraceParams, ) -> AcbResult<TraceResult>

Trace FFI bindings across language boundaries.

Source

pub fn collective_patterns( &self, graph: &CodeGraph, params: CollectiveParams, ) -> AcbResult<CollectiveResult>

Query collective intelligence patterns.

Currently returns a placeholder result since the collective intelligence backend is not yet integrated.

Source

pub fn temporal_evolution( &self, graph: &CodeGraph, unit_id: u64, ) -> AcbResult<EvolutionResult>

Get the temporal evolution of a code unit.

Source

pub fn stability_analysis( &self, graph: &CodeGraph, unit_id: u64, ) -> AcbResult<StabilityResult>

Analyse the stability of a code unit.

Source

pub fn coupling_detection( &self, graph: &CodeGraph, params: CouplingParams, ) -> AcbResult<Vec<Coupling>>

Detect couplings between code units.

Source

pub fn dead_code<'g>( &self, graph: &'g CodeGraph, params: DeadCodeParams, ) -> AcbResult<Vec<&'g CodeUnit>>

Detect potentially dead (unreachable) code.

Source

pub fn prophecy( &self, graph: &CodeGraph, params: ProphecyParams, ) -> AcbResult<ProphecyResult>

Predict likely future breakages based on code patterns.

Source

pub fn concept_mapping( &self, graph: &CodeGraph, concept: &str, ) -> AcbResult<ConceptMap>

Map a concept to related code units.

Source

pub fn migration_path( &self, graph: &CodeGraph, params: MigrationParams, ) -> AcbResult<MigrationPlan>

Plan a migration from one unit to another.

Source

pub fn test_gap( &self, graph: &CodeGraph, params: TestGapParams, ) -> AcbResult<Vec<TestGap>>

Find units that have high change counts or complexity but no tests.

Source

pub fn architectural_drift( &self, graph: &CodeGraph, params: DriftParams, ) -> AcbResult<DriftReport>

Check for architectural drift against declared rules.

Source

pub fn similarity( &self, graph: &CodeGraph, params: SimilarityParams, ) -> AcbResult<Vec<SimilarityMatch>>

Find units similar to a given unit by feature vector.

Source

pub fn shortest_path( &self, graph: &CodeGraph, from: u64, to: u64, ) -> AcbResult<PathResult>

Find the shortest path between two units.

Source

pub fn hotspot_detection( &self, graph: &CodeGraph, params: HotspotParams, ) -> AcbResult<Vec<Hotspot>>

Detect code hotspots based on change frequency, stability, and complexity.

Trait Implementations§

Source§

impl Clone for QueryEngine

Source§

fn clone(&self) -> QueryEngine

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QueryEngine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for QueryEngine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more