lean-ctx 3.8.4

Context Runtime for AI Agents with CCP. 71 MCP tools, 10 read modes, 95+ compression patterns, cross-session memory (CCP), persistent AI knowledge with temporal facts + contradiction detection, multi-agent context sharing, LITM-aware positioning, AAAK compact format, adaptive compression with Thompson Sampling bandits. Supports 24+ AI tools. Reduces LLM token consumption by up to 99%.
Documentation
//! Realized per-language capability matrix for the dashboard graph routes.
//!
//! Extracts plain path lists from the index (and optional call edges) and hands
//! them to [`language_capability_matrix_realized`], so the dashboard legend can
//! show real per-language coverage (symbols / imports / calls) for *this*
//! project rather than only static capability flags.

use crate::core::call_graph::CallEdge;
use crate::core::graph_index::ProjectIndex;
use crate::core::language_capabilities::{
    language_capability_matrix_realized, LanguageCapabilityRow,
};

/// Build the realized capability matrix from an index. `call_edges` is `Some`
/// only where call-graph data exists (the call-graph route); the dependency
/// route passes `None`, leaving `calls_found` unmeasured rather than guessing.
pub(super) fn realized_from_index(
    index: &ProjectIndex,
    call_edges: Option<&[CallEdge]>,
) -> Vec<LanguageCapabilityRow> {
    let file_paths: Vec<String> = index.files.keys().cloned().collect();
    let symbol_files: Vec<String> = index.symbols.values().map(|s| s.file.clone()).collect();
    let import_from_files: Vec<String> = index
        .edges
        .iter()
        .filter(|e| e.kind == "import" || e.kind == "reexport")
        .map(|e| e.from.clone())
        .collect();
    let call_caller_files: Option<Vec<String>> =
        call_edges.map(|edges| edges.iter().map(|e| e.caller_file.clone()).collect());

    language_capability_matrix_realized(
        &file_paths,
        &symbol_files,
        &import_from_files,
        call_caller_files.as_deref(),
    )
}