Skip to main content

Module core

Module core 

Source

Modules§

a2a
active_inference
Active Inference Preload — predictive context loading.
adaptive
adaptive_chunking
Adaptive chunk sizing from a rough “prefrontal” budget controller (tight → signatures, generous → full bodies).
adaptive_compression
Cache-aware compression decisions using provider billing economics (#1195).
adaptive_thresholds
agent_attribution
ETPAO Attribution for multi-agent chains (P11 / DIM 4).
agent_budget
agent_lease
Bounded, payload-free ownership leases for multi-agent mutation planning.
anchor
Hash-anchored line identifiers — the shared spine of anchored editing (epic #1008 / GL#1009).
anomaly
Anomaly detection using Welford’s online algorithm for running mean/variance and triggering alerts at >3x standard deviation.
anti_interrupt
Anti-Interruption Score (F7) — cognitive impact metrics beyond token savings.
archive
archive_fts
attention_context
Attention-Weighted Context Assembly.
attention_layout_driver
attention_model
Heuristic attention prediction model for LLM context optimization.
attention_placement
U-shaped placement (primacy/recency): alternate placing ranked items at context head vs tail.
attribution
Deterministic identifiers and grouping for savings attribution records.
audit_trail
auto_mode_resolver
autonomy_drivers
bandit
Bandit-based read-mode selection for ctx_read auto-mode. This is core OSS infrastructure for optimizing read modes, distinct from the commercial Adaptive Intensity feature (Section 8) which governs Solution Intelligence intensity levels.
benchmark_compare
billing
Commercial-plane billing substrate (billing-plane-v1): plans, entitlements, and usage metering derived from the signed savings ledger. Never gates local. Commercial-plane billing substrate (billing-plane-v1, EPIC 13.6).
bm25_cache
bm25_index
bounce_tracker
budget_tracker
Runtime budget tracking against role limits.
budgets
cache
cache_diagnostics
Provider cache diagnostics integration (#1311).
call_graph
canonical
Canonical JSON serialization and Ed25519 signatures for signed artifacts.
capabilities
capsule_transport
Local reference transport for authenticated OCLA A2A capsule delivery (P11).
causal_attribution
Causal outcome attribution (OSS stub).
chain_compression
Chain Compression — context deduplication between agent hops (P11 / DIM 4).
claim_extractor
Claim Extraction — decomposes context pipeline outputs into verifiable claims.
code_health
Native code-health engine — clean code as a token-cost lever.
codebook
cognitive
Cognitive Budget Allocator (F3) — Miller’s Law for LLM context.
cognitive_load
Cognitive Load Theory–style scoring for code context (intrinsic / extraneous / germane).
command_cwd
Which directory a command’s segments actually run in (GH #1661, #1662).
community
Community detection on the code graph.
compact_directive
Store for the agent-driven conversation-compaction directive (#1570 P1).
compliance
Framework compliance mappings + coverage reports (GL #424, H3 Epic A).
compliance_report
Signed CISO compliance report (GL #677) — “the deliverable a CISO shows auditors”.
compressor
config
conformance
Conformance & reproducibility scorecard (conformance-v1, EPIC 12.17).
consolidation
Consolidation engine for provider data — hippocampal sleep replay.
consolidation_engine
Canonical session→knowledge consolidation (#995 Phase 4).
content_cache
Resident, bounded file-content cache shared across the search-index build and ctx_search (issue #148).
content_chunk
Universal content chunk — the atomic unit of the Context Engine.
content_handle
Content-addressed handles for zero-cost re-reads (#1315).
context_artifacts
context_capsule
Payload-free, delta-capable contract for multi-agent context handoffs.
context_column
Context Column — the cortical column abstraction for data source pipelines.
context_deficit
context_field
Context Field Theory (CFT) – unified potential function for context items.
context_handles
Context Handles – sparse, lazy references to context items.
context_ir
context_ledger
context_os
context_overhead
Honest accounting of the fixed per-turn context lean-ctx injects (GitHub #361).
context_overlay
Reversible context overlays — user/policy manipulations that modify context items without changing source files (“synaptic modulation”).
context_policies
Context Policy Engine – declarative rules for context governance.
context_prefetch
Predictive context pre-loading (OSS stub).
context_proof_v2
ContextProofV2 — Claim-based verification schema.
context_radar
contracts
cooccurrence
Hebbian file co-access graph — “files that fire together, wire together”.
cost_per_outcome
crash_log
Persistent crash log for panic diagnosability.
cross_customer_learning
Cross-customer learning (OSS stub).
cross_source_edges
Cross-source graph edges — connects external data to code via the graph index.
cross_source_hints
Cross-source hints — lateral connections between cortical columns.
data_dir
decision_loop
End-to-end wiring from task triage through execution-value assessment.
decision_loop_runtime
Non-blocking bridge between MCP tool execution and the decision loop.
deep_queries
Tree-sitter deep queries for extracting imports, call sites, and type definitions.
degradation_policy
delta_response
Delta responses for re-reads after edits (#1316).
dense_backend
diagnostics_store
Active compiler/linter diagnostics as a context-priority signal (#499).
echo_ratio
Echo Ratio computation — output-to-input token ratio.
edit_metering
Edit-efficiency metering (#1008, honest-metering philosophy #361).
editor_registry
editor_signal
Editor focus signal (#500).
embedding_index
Persistent, incremental embedding index.
embeddings
Embedding engine for semantic code search.
energy
Electricity-footprint estimate for saved tokens.
entropy
episodic_memory
Episodic Memory — persistent cross-session experiences with outcomes.
error
etpao
ETPAO: Effective Tokens per Accepted Outcome (#1318).
eval_ab
Deterministic with/without output-quality eval (#232).
eval_harness
Retrieval evaluation harness for lean-ctx hybrid search.
events
evidence_bundle
Evidence bundle generator (evidence-bundle-v1, GL #425, H3 Epic A).
evidence_classification
Deterministic classification of savings evidence.
evidence_flow
End-to-end provider-run evidence assembly.
evidence_ledger
execution_ledger
Append-only, task-aware execution ledger.
extension_registry
Pluggable read-modes, compressors, and chunkers (extension-registry-v1).
extractors
Format extractors & format-aware chunkers (extractors-v1, EPIC 12.13).
feedback
finops_export
FinOps cost/savings export (GL #402): CloudZero CBF, Vantage, FOCUS CSV.
fleet_analytics
Fleet analytics (OSS stub).
gain
gamma_cover
Minimal TF-IDF chunk subset covering peers within γ bits of residual information.
git_cache
TTL-based cache for git command results.
gotcha_tracker
grammar_usage
Persistent per-extension signature-backend telemetry (GH #690 Phase 2).
graph_context
Graph-driven context loading — automatically includes related files based on Property Graph proximity and token budgeting.
graph_export
graph_features
Multi-layer graph descriptors inspired by GNN message passing: PageRank (global importance), local clustering, HITS hubs/authorities, and weakly-connected community ids.
graph_index
graph_provider
handle
Stable cross-turn symbol handles: path#name@Lline.
hasher
Central hashing utility using BLAKE3.
heatmap
hebbian_cache
Hebbian Co-Access Cache with Boltzmann-Temperature Eviction.
hnsw
Lightweight HNSW (Hierarchical Navigable Small World) index for approximate nearest neighbors.
home
homeostasis
Homeostatic Memory Guard — Proactive multi-level resource management.
html_crush
Deterministic HTML content extractor — extracts article/main content from web pages, converts to clean markdown, discards boilerplate (#1124).
hybrid_search
Hybrid search combining BM25 (lexical) with dense vector search.
ib
Task-aware Information Bottleneck compression (F1).
ide_permissions
Read the active IDE’s tool-permission configuration and resolve an effective action for a lean-ctx tool, so lean-ctx can mirror (“inherit”) the user’s IDE permission rules instead of forming a second, ungoverned execution path.
import
Import facts from local AI coding-session histories.
import_resolver
Import-to-file resolution (AST-driven import strings → project paths).
index_admission
Admission control for heavy index builds (#685).
index_bundle
Encrypted index bundles for the hosted Personal Index (GL #392).
index_orchestrator
index_progress
Shared progress counters for index builds (BM25, semantic, graph). Build code reports here; CLI / status_json read snapshots. Decouples builders from the orchestrator (no module cycles).
ingestion
Ingestion front-door (ingestion-spec-v1).
input_filters
Inbound content filters (GL #675) — the input side of the Great Filter.
integration_proof
Executable end-to-end proof for the task decision pipeline.
intent_engine
intent_protocol
interrupt
User-initiated cooperative cancellation (Ctrl-C / SIGINT).
introspect
Cognition introspection — proves that each scientific subsystem is wired and actually active at runtime.
io_boundary
io_health
journal
json_crush
Deterministic JSON crusher — single source of truth for structural JSON compaction (#934, Headroom “Smart Crusher” port, GitLab #935).
json_sample
Statistical JSON array row-sampling (#1147, SmartCrusher-equivalent).
jsonc
knowledge
knowledge_bridge
Cross-Agent Knowledge Bridge — controlled sharing of high-confidence facts between agents.
knowledge_embedding
Embedding-based Knowledge Retrieval for ctx_knowledge.
knowledge_provider_extract
Knowledge auto-extraction from provider data (issues, PRs, DB schemas).
knowledge_relations
knowledge_router
Runtime routing from task references to bounded context bundles.
language_capabilities
litm
litm_calibration
Empirical LITM placement calibration (#539, EFF-2).
live_evidence_ledger
Bounded, append-only evidence emitted for completed live tool calls.
llm_enhance
Optional LLM enhancement layer.
loop_detection
marginal_gate
Marginal Information Gate (#1308).
mcp_catalog
MCP Tool-Catalog Federation (#210) — Engine pillar.
mcp_manifest
mdl_mode
MDL Read Mode (F8) — structural descriptions for compact code representation.
mdl_selector
Minimum Description Length–style selection among abstract read modes (proxy compressed lengths).
measurement
Customer-facing A/B measurement for unoptimized baselines and lean-ctx treatment.
memory_archive
Multi-store, lossless memory archive (#995 Phase 1).
memory_guard
Process-level RAM guardian with adaptive eviction and hard OOM protection.
memory_lifecycle
Memory Lifecycle Management — consolidation, decay, compaction, archival.
memory_policy
memory_scheduler
FSRS-based Context Memory Scheduler (F5).
metering
Local, append-only metering for the free product.
mode_predictor
model_router
Thompson Sampling model router (OSS stub).
multi_repo
multiscale_index
Renormalization-Inspired Multi-Scale Indexing.
negative_knowledge
Negative knowledge tracking (#1314).
nudge
Nudge economy for budget advisories (#1570 P2, DCP-inspired).
ocla
Open Context & Token Lifecycle Architecture (OCLA) public OSS contract.
ocla_bus
OCLA Event Bus (P2 / Track B — Event-Backbone).
ocp
Open Context Protocol (OCP) v0.1 export adapter.
openapi
OpenAPI 3.0 document for the public /v1 surface, generated from a single in-code endpoint inventory (endpoints). The HTTP route that serves it lives in http_server; the SSOT lives here so it stays compiled and drift-tested without the http-server feature.
opencode_config
Single source of truth for locating OpenCode’s global config file.
outcome
Outcome contracts, local signal adapters, and deterministic evaluation.
output_sanitizer
Output sanitizer: detects and cleans degenerate model artifacts from compressed output.
output_verification
path_resolve
Shared path-resolution for tool handlers.
pathjail
paths
Typed XDG base-directory resolvers for lean-ctx (GH #408 / GL #602).
pathutil
patterns
persona
Context personas (persona-spec-v1).
pipeline
Context Pipeline
policy
Context Policy Packs v1 — Policies-as-Code (GL #489).
pop_pruning
predictive_coding
Predictive Coding for mode outputs — send only prediction errors (deltas).
predictive_prefetch
Predictive Prefetch via Free Energy Minimization.
preservation
pro_triggers
Local, contextual Pro conversion nudges.
procedural_memory
Procedural Memory — recurring workflow detection and template storage.
process_guard
Global concurrency limiter for lean-ctx processes.
profiles
Agent profiles — workload-specific configurations.
progressive_compression
Progressive compression: newest segments stay verbose; older tiers lose detail under exponential budget shrink.
property_graph
Property Graph Engine — SQLite-backed code knowledge graph.
protocol
provenance
Durable provenance records for file edits and git checkpoints.
provider_bandit
Provider Bandit — Thompson Sampling for provider selection.
provider_cache
Provider caching awareness — helps LLM providers cache repeated context.
providers
quality
quality_scorecard
query_aware
Query-aware adaptive compression (#1312).
rabin_karp
reference_docs
Generated reference documentation.
relevance_tracker
Proactive context expansion (#1122): automatically injects previously compressed data when it becomes relevant to the current request.
roles
Role-based access control for agent governance.
rule_artifacts
The committed LEAN-CTX.md rule artifacts as (relative_path, content) pairs — the single source shared by the regenerator (gen_rules example) and the drift gate (tests/rules_drift.rs) so the project copy and the rust/ copy can never disagree.
rule_scorer
Rule-relevance scoring (#1141): scores agent config rules against the current working context to determine which rules to inject.
rules_canonical
Canonical rules source — single source of truth for all lean-ctx guidance.
rules_channel
Cross-channel rule deduplication policy (#684).
saliency
Saliency Map — information-theoretic chunk ranking and deduplication.
sandbox
savings_footer
savings_ledger
Verified Savings Ledger (G1) — the per-event, auditable counterfactual store.
savings_tracker
Per-session compression accounting, persisted when the tracker is dropped.
scent_field
Stigmergic scent field for zero-token multi-agent coordination (#540, EFF-3).
scorecard
Reproducible scorecard (#211): one command → compression savings + retrieval recall/MRR + latency over a fixed, deterministic scenario matrix.
search_index
Resident line-search index for ctx_search (Phase 1 of the efficiency epic).
search_reranking
Post-RRF Reranking Pipeline for code-aware search.
secret_detection
security_posture
Unified, human-facing view of lean-ctx’s two independent security planes:
semantic_cache
semantic_chunks
Semantic Chunking with Attention Bridges.
sensitivity
Per-item sensitivity model with a uniform policy floor (#212).
server_capabilities
GET /v1/capabilities — runtime discovery of what this lean-ctx instance supports, so any client (any language) can branch on real features instead of trial calls. The HTTP route lives in http_server; the payload builder lives here so it stays compiled (and drift-tested) without the http-server feature.
session
session_budget
Session-level cumulative context budget (#1307).
session_token
setup_report
shadow
Counterfactual cost and quality reporting for completed tasks.
shared_context
shell_allowlist
Shell allowlist with AST-based command parsing.
signatures
Signature extraction — regex fallback layer.
solution_auto_capture
Heuristics for recognizing solution decisions from edit context.
solution_commercial
Commercial Solution Intelligence API stubs. All functions return enterprise license errors in OSS builds. Full implementations live in lean-ctx-enterprise/crates/intelligence/.
solution_rules
Solution-selection guidance for injected instructions.
solution_tracker
solution_types
Backward-compatible Solution Intelligence type exports.
spreading_activation
Spreading activation — associative retrieval over a weighted graph.
startup_guard
stats
storage_maintenance
Daemon-safe storage maintenance.
structural_diff
Structural diff using tree-sitter chunk identities (named declarations).
structural_tokenizer
Structural tokenizer treating idiomatic multi-token spans as single motifs.
surprise
Predictive Surprise Scoring — conditional entropy relative to LLM knowledge.
symbol_map
tabular_crush
Deterministic tabular (CSV/TSV) crusher — columnar redundancy factoring for delimited data (#982, Headroom tabular-compressor port, GitLab Epic #973).
task_briefing
task_relevance
task_spine
MCP ingress task lineage and thread-local propagation.
tdd_schema
telemetry
Telemetry and metrics collection following OpenTelemetry GenAI conventions.
terse
Terse Compression Engine
theme
threshold_learning
Online-learned per-extension compression-threshold deltas (#538, EFF-1).
token_calibration
Provider-authoritative tokenizer calibration evidence (CO-05).
tokenizer_translation_driver
tokens
tool_profiles
triage
trust
Open trust primitives for identity, classification, policy, and evidence.
value_gate
End-to-end task value assessment: execution cost → outcome → CPAO.
verbosity
Behavioral Verbosity Learning (F10) — adaptive compression recommendations.
wasserstein
Wasserstein Token Allocator (F4) — Optimal Transport for context budgets.
web
Web & research context layer.
work_graph
Bounded Work Graph for multi-agent orchestration (P11 / DIM 4).
workflow
wrapped
yaml_crush
Deterministic YAML crusher — structural compaction for YAML documents (#985, Headroom YAML-compressor port, GitLab Epic #973).