ContextCorrelator

Struct ContextCorrelator 

Source
pub struct ContextCorrelator { /* private fields */ }
Expand description

The main context correlation engine for memory bank workspaces

This structure manages the discovery, parsing, and correlation of workspace context across multiple sub-projects within a memory bank structure.

Implementations§

Source§

impl ContextCorrelator

Source

pub fn new() -> Self

Create a new context correlator

Initializes the correlator with a memory bank navigator for file access. The workspace context will be loaded on first correlation request.

§Arguments
  • navigator - Memory bank navigator for file system access
§Returns
  • ContextCorrelator - New correlator instance
Source

pub fn discover_and_correlate( &mut self, root_path: &Path, ) -> FsResult<&WorkspaceContext>

Discover and correlate workspace context from a given root path

This is the primary entry point for context correlation. It discovers the memory bank structure, parses relevant content, and builds a comprehensive workspace context.

§Arguments
  • root_path - Root path to search for memory bank structure
§Returns
  • Ok(WorkspaceContext) - Complete correlated workspace context
  • Err(FsError) - Discovery or parsing errors
§Example
use airs_memspec::parser::context::ContextCorrelator;
use std::path::PathBuf;

let mut correlator = ContextCorrelator::new();
let context = correlator.discover_and_correlate(&PathBuf::from("."))?;
println!("Found {} sub-projects", context.sub_project_contexts.len());
Source

pub fn get_workspace_context(&self) -> Option<&WorkspaceContext>

Get the current workspace context

Returns the cached workspace context if available, or None if context correlation has not been performed yet.

§Returns
  • Option<&WorkspaceContext> - Current workspace context
Source

pub fn switch_context( &mut self, sub_project_name: &str, switched_by: &str, ) -> FsResult<()>

Switch to a different sub-project context

Updates the current context to point to a different sub-project and updates the current_context.md file accordingly.

§Arguments
  • sub_project_name - Name of the sub-project to switch to
  • switched_by - Identifier for who/what triggered the switch
§Returns
  • Ok(()) - Context switch successful
  • Err(FsError) - File update or validation errors
Source

pub fn get_task_summary(&self, sub_project: Option<&str>) -> Option<TaskSummary>

Get aggregated task status across the workspace

Provides a high-level view of task progress across all sub-projects or for a specific sub-project.

§Arguments
  • sub_project - Optional sub-project name to filter by
§Returns
  • Option<TaskSummary> - Aggregated task summary

Trait Implementations§

Source§

impl Debug for ContextCorrelator

Source§

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

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

impl Default for ContextCorrelator

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.