pub trait ContextColumn: Send + Sync {
// Required methods
fn id(&self) -> &'static str;
fn display_name(&self) -> &'static str;
fn is_active(&self) -> bool;
fn ingest(
&self,
query: &str,
ctx: &ColumnContext,
) -> Result<ColumnInput, String>;
// Provided methods
fn compress(
&self,
input: &ColumnInput,
ctx: &ColumnContext,
) -> Result<ColumnCompressed, String> { ... }
fn verify(
&self,
compressed: &ColumnCompressed,
ctx: &ColumnContext,
) -> Result<ColumnOutput, String> { ... }
fn process(
&self,
query: &str,
ctx: &ColumnContext,
) -> Result<ColumnOutput, String> { ... }
}Expand description
The cortical column trait — uniform processing pipeline for any data source.
Each implementation represents one “column” in the cortex: filesystem, GitHub, Jira, PostgreSQL, etc. All columns share the same interface but process different input modalities.
Required Methods§
Sourcefn id(&self) -> &'static str
fn id(&self) -> &'static str
Unique column identifier (matches provider ID for external columns).
Sourcefn display_name(&self) -> &'static str
fn display_name(&self) -> &'static str
Human-readable name for discovery/logging.
Sourcefn ingest(
&self,
query: &str,
ctx: &ColumnContext,
) -> Result<ColumnInput, String>
fn ingest( &self, query: &str, ctx: &ColumnContext, ) -> Result<ColumnInput, String>
L4 (Input Layer): Ingest raw data and produce ContentChunks.
For filesystem: read file, parse AST, extract chunks. For GitHub: fetch API, parse JSON, normalize to chunks. For DB: query schema/data, structure as chunks.
Provided Methods§
Sourcefn compress(
&self,
input: &ColumnInput,
ctx: &ColumnContext,
) -> Result<ColumnCompressed, String>
fn compress( &self, input: &ColumnInput, ctx: &ColumnContext, ) -> Result<ColumnCompressed, String>
L2/3 (Predictive Compression): Compress chunks based on task context.
Uses the mode predictor (Thompson Sampling) to select the optimal compression mode, then applies it. The prediction compares expected vs actual information content (predictive coding).
Sourcefn verify(
&self,
compressed: &ColumnCompressed,
ctx: &ColumnContext,
) -> Result<ColumnOutput, String>
fn verify( &self, compressed: &ColumnCompressed, ctx: &ColumnContext, ) -> Result<ColumnOutput, String>
L5 (Output + Verification): Validate output, check budget, discover hints.
Ensures the compressed output meets quality thresholds and stays within the token budget. Also discovers cross-source hints by checking chunk references against the graph index.
Sourcefn process(
&self,
query: &str,
ctx: &ColumnContext,
) -> Result<ColumnOutput, String>
fn process( &self, query: &str, ctx: &ColumnContext, ) -> Result<ColumnOutput, String>
Full pipeline: L4 → L2/3 → L5, with L6 context flowing top-down.
Convenience method that chains all layers. Override individual layers for custom behavior per column.