Skip to main content

Module core

Module core 

Source

Modules§

a2a
a2a_transport
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_mode_policy
adaptive_thresholds
addons
Addon ecosystem: community extensions for lean-ctx (#858).
agent_budget
agent_identity
agent_registry
First-class agent identities: registry + lifecycle (GL #433, H3 Epic D).
agent_runtime_env
Bridge agent runtime/session environment variables across lean-ctx processes.
agents
aggressiveness
Single 0.0–1.0 compression-intensity knob.
anchor
Hash-anchored line identifiers — the shared spine of anchored editing (epic #1008 / GL#1009).
ann_cache
Process-wide cache for the HNSW AnnIndex used by dense semantic search.
anomaly
Anomaly detection using Welford’s online algorithm for running mean/variance and triggering alerts at >3x standard deviation.
archive
archive_fts
artifact_index
artifacts
ast_walk
Stack-safe traversal of tree-sitter ASTs.
atomic_fs
Shared, policy-free atomic-write mechanics.
attention
Convenience re-export: all attention-related modules.
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.
audit_trail
auto_capture
Opt-in automatic knowledge capture from tool outputs.
auto_findings
auto_mode_resolver
autonomy_drivers
bandit
benchmark
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).
binary_detect
bm25_cache
bm25_index
bounce_tracker
buddy
budget_tracker
Runtime budget tracking against role limits.
budgets
cache
cache_telemetry
Read-cache reliability telemetry.
call_graph
capabilities
ccp_session_bundle
chunks_ts
Tree-sitter AST-aware code chunking for semantic search.
claim_extractor
Claim Extraction — decomposes context pipeline outputs into verifiable claims.
cli_cache
client_capabilities
client_constraints
cloud_files
Detection of cloud-backed placeholder files (OneDrive “Files On-Demand” on Windows, iCloud Drive “dataless” files on macOS).
code_health
Native code-health engine — clean code as a token-cost lever.
codebook
cognition_loop
Hebbian-inspired Cognition Loop — periodic background reorganization of knowledge. Runs 9 steps: seed promote, structural repair, fidelity check, lateral synthesis, contradiction resolution, hebbian strengthen, decay, compact, observation synthesis.
cognition_scheduler
Opportunistic, time-gated trigger for the background Cognition Loop.
cognitive_load
Cognitive Load Theory–style scoring for code context (intrinsic / extraneous / germane).
community
Community detection on the code graph.
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”.
compress_preview
compress_preview — a read-only “what would compression do to this?” inspector (#984, Headroom #1267).
compression
Convenience re-export: all compression-related modules.
compression_safety
compressor
config
config_heal
Heal a config.toml that got stranded in the DATA dir (#594).
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.
context
Convenience re-export: all context-related modules.
context_artifacts
context_column
Context Column — the cortical column abstraction for data source pipelines.
context_compiler
Context Compiler – builds minimal context packages under budget constraints.
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_lint
Injected-context linter (#960) — keeps lean-ctx’s OWN injected context (the rules block + advertised tool descriptions) high-signal.
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_package
context_packing
Submodular context packing — choosing which items to include under a budget so the selected set maximises coverage of what the task cares about.
context_policies
Context Policy Engine – declarative rules for context governance.
context_proof
context_proof_v2
ContextProofV2 — Claim-based verification schema.
context_radar
context_snapshot
Context Snapshot (CONTEXT_SNAPSHOT_V1) — the git-anchored, signed, temporal artifact behind the Context Time Machine (GL epic #1022, Phase 0 #1023).
contextops
contracts
conversation
Conversation identity for read-cache scoping.
cooccurrence
Hebbian file co-access graph — “files that fire together, wire together”.
crash_log
Persistent crash log for panic diagnosability.
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.
cyclomatic
Cyclomatic complexity via tree-sitter (decision-point counting).
data_consolidate
Consolidate a split data layout into one canonical directory (GH #414).
data_dir
datadog_push
Agentless Datadog export (GL #401, setup path B).
debug_log
Opt-in human-readable debug log of intercepted tool activity (#520).
deep_queries
Tree-sitter deep queries for extracting imports, call sites, and type definitions.
degradation_policy
dense_backend
deps
diagnostics_store
Active compiler/linter diagnostics as a context-priority signal (#499).
edit_quality
Quality loop v1 (#494): compression-caused edit failures feed back into mode selection.
editor_registry
editor_signal
Editor focus signal (#500).
efficacy
Learning-efficacy evidence (#549, VIS-3).
egress
Egress / output DLP for agent writes & actions (GL #676) — the output side of the Great Filter.
embedding_index
Persistent, incremental embedding index.
embedding_quant
int8 scalar quantization + SIMD-friendly scoring for embedding vectors.
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
eval_ab
Deterministic with/without output-quality eval (#232).
eval_harness
Retrieval evaluation harness for lean-ctx hybrid search.
events
eviction_orchestrator
Connects the RSS-based memory_guard to real cache eviction via HomeostasisController.
evidence
Evidence schema — an attributable claim with a confidence score and source.
evidence_bundle
Evidence bundle generator (evidence-bundle-v1, GL #425, H3 Epic A).
evidence_ledger
extension_registry
Pluggable read-modes, compressors, and chunkers (extension-registry-v1).
extractive
Extractive prose compression: keep the most informative sentences within a char budget instead of truncating to the prefix.
extractors
Format extractors & format-aware chunkers (extractors-v1, EPIC 12.13).
feedback
fep_prefetch
FEP prefetch (#9): active-inference-style warmup.
filters
finops_export
FinOps cost/savings export (GL #402): CloudZero CBF, Vantage, FOCUS CSV.
firewall
Context firewall: replace large tool outputs with a compact digest + retrieval ref.
free_energy_budget
Free-Energy Budget — optimal context allocation under token constraints.
gain
gamma_cover
Minimal TF-IDF chunk subset covering peers within γ bits of residual information.
gateway
MCP Tool-Catalog Gateway (#210).
git
Native git support: remote-repo reading (cached shallow clone) and a shadow history of agent changes.
git_cache
TTL-based cache for git command results.
git_signals
Git working-set signals for relevance ranking (#497).
git_util
Minimal, dependency-free git shell-outs shared by the context-artifact and analysis tools (ctx_impact, ctx_architecture, context_artifacts).
godot
Godot-specific parsers and helpers.
gotcha_tracker
graph
Convenience re-export: all graph-related modules.
graph_analysis
Static dependency-graph analyses (God-Nodes, import cycles).
graph_cache
Resident graph-index cache (Phase 5 of the efficiency epic).
graph_context
Graph-driven context loading — automatically includes related files based on Property Graph proximity and token budgeting.
graph_coordinator
Non-blocking, PropertyGraph-first build coordinator for the dashboard graph routes (#696 phase C).
graph_enricher
Unified Graph Enricher — indexes Git history, tests, and knowledge into the PropertyGraph.
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_parity
Shadow-mode parity harness (#682.3): prove the PropertyGraph reproduces everything graph_index exposes through the GraphProvider facade — symbols, edges and structural dependencies — before any backend flip (#682.4) relies on PG.
graph_provider
handle
Stable cross-turn symbol handles: path#name@Lline.
handoff_ledger
handoff_transfer_bundle
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.
hybrid_search
Hybrid search combining BM25 (lexical) with dense vector search.
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.
immune_detector
Immune detector (#8): artificial-immune-system screening for context poisoning.
import_resolver
Import-to-file resolution (AST-driven import strings → project paths).
index_bundle
Encrypted index bundles for the hosted Personal Index (GL #392).
index_namespace
index_orchestrator
index_paths
Index path utilities — project-root normalization and graph match keys.
information_bottleneck
QUITO-X–style trade-off: compress by dropping low token-entropy lines while targeting an output/input token ratio.
ingestion
Ingestion front-door (ingestion-spec-v1).
input_filters
Inbound content filters (GL #675) — the input side of the Great Filter.
instruction_compiler
integrity
Build-origin integrity verification and rebrand resistance.
intent_engine
intent_protocol
intent_router
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).
jsonc
knowledge
knowledge_bootstrap
knowledge_bridge
Cross-Agent Knowledge Bridge — controlled sharing of high-confidence facts between agents.
knowledge_domain
Convenience re-export: all knowledge-related modules.
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_vault
Zero-knowledge Personal-Cloud knowledge vault (GL #467) — the E2E envelope for /api/sync/knowledge.
language_capabilities
layout_pin
XDG layout commitment pin (GL #623 / #624).
learning_sync
Team sync of the learning layers (#550, VIS-4).
limits
litm
litm_calibration
Empirical LITM placement calibration (#539, EFF-2).
llm_enhance
Optional LLM enhancement layer.
llm_feedback
locomo
LoCoMo memory benchmark (#291).
logging
loop_detection
mcp_manifest
mdl_selector
Minimum Description Length–style selection among abstract read modes (proxy compressed lengths).
memory
Convenience re-export: all memory-related modules.
memory_archive
Multi-store, lossless memory archive (#995 Phase 1).
memory_boundary
memory_capacity
Single memory capacity manager (#995 Phase 2).
memory_consolidation
Sleep-inspired consolidation for in-memory knowledge entries (NREM merge, REM prune, replay boost).
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_salience
Content salience for memory: a cheap, deterministic keyword score over a fact/finding’s raw text.
mode_predictor
model_registry
multi_repo
multiscale_index
Renormalization-Inspired Multi-Scale Indexing.
nc_compress
Non-code compression tuning (nc-compress-v1, EPIC 12.14).
neural
Neural context compression — trained models replacing heuristic filters.
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.
ort_environment
ONNX Runtime global environment: single init per process, runtime dylib loading.
ort_execution_providers
GPU execution provider selection: per-vendor feature flags, session-level config.
output_echo
Output-echo detection (#501).
output_sanitizer
Output sanitizer: detects and cleans degenerate model artifacts from compressed output.
output_verification
owasp_alignment
Maps lean-ctx security features to the OWASP Top 10 for Agentic Applications (2025). Used by lean-ctx audit CLI and /v1/audit/events endpoint.
pagerank
PageRank computation on the Property Graph.
path_locks
Process-wide per-path advisory locks.
path_mode_memory
Persistent per-path bounce memory (#496).
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
plugins
policy
Context Policy Packs v1 — Policies-as-Code (GL #489).
pop_pruning
portable_binary
predictive_coding
Predictive Coding for mode outputs — send only prediction errors (deltas).
predictive_prefetch
Predictive Prefetch via Free Energy Minimization.
preservation
procedural_memory
Procedural Memory — recurring workflow detection and template storage.
process_guard
Global concurrency limiter for lean-ctx processes.
profile_suggest
Repo-stack-aware profile recommendation (#851).
profiles
Context Profiles
progressive_compression
Progressive compression: newest segments stay verbose; older tiers lose detail under exponential budget shrink.
project_hash
property_graph
Property Graph Engine — SQLite-backed code knowledge graph.
prospective_memory
protect
Explicit, deterministic preservation of user-marked spans across every compressor (read, shell, proxy, prose).
protocol
provider_bandit
Provider Bandit — Thompson Sampling for provider selection.
provider_cache
Provider caching awareness — helps LLM providers cache repeated context.
providers
quality
qubo_select
QUBO context-selection spike (#10) — research only, never the default.
rabin_karp
read_stub_index
Persistent, conversation-scoped index of fully-delivered file reads (#955).
redaction
reference_docs
Generated reference documentation.
repomap
Repo map: PageRank-based symbol importance ranking across a codebase.
roles
Role-based access control for agent governance.
route_extractor
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.
rules_canonical
Canonical rules source — single source of truth for all lean-ctx guidance.
rules_channel
Cross-channel rule deduplication policy (#684).
rules_overhead
Shared accounting for the rules files an agent auto-loads each session.
safety_needles
saliency
Saliency Map — information-theoretic chunk ranking and deduplication.
sandbox
sandbox_landlock
sandbox_seatbelt
sanitize
savings_autopush
Opt-in background auto-push of the local savings batch to the team server.
savings_footer
savings_ledger
Verified Savings Ledger (G1) — the per-event, auditable counterfactual store.
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
Convenience re-export: all search-related modules.
search_delta
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_diff
Session diffing — structured comparison of two session states.
session_domain
Convenience re-export: all session-related modules.
session_summary
AI session summaries (#292): periodically distil the working session into a compact, semantically-recallable digest.
session_token
setup_report
share
Frictionless share helpers: copy text to the OS clipboard and open files/URLs.
shell_allowlist
Shell allowlist with AST-based command parsing.
signatures
Signature extraction — regex fallback layer.
signatures_ts
skillify
Skillify (#290): distill a project’s recurring session patterns into versioned, git-committable .cursor/rules/skillify-*.mdc rule files.
slo
Context SLOs — configurable service level objectives for context metrics.
slow_log
smells
Code smell detection engine.
splade_retrieval
SPLADE-style sparse expansion layered on BM25 candidate retrieval.
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.
structured_compact
Lossless compaction of structured data (JSON / JSON Lines).
structured_read
subagent_contract
Sub-agent context contracts (GL#450).
surprise
Predictive Surprise Scoring — conditional entropy relative to LLM knowledge.
symbol_map
syntax_validate
Post-edit syntax gate (#1008): a tree-sitter parse check used to reject an edit that turns a cleanly parsing file into a broken one.
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
tdd_schema
team_slo
Team-server SLO instrumentation — the measurement half of the hosted-index reliability gate (GL #391).
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).
tokenizer_translation_driver
tokens
tool_health
lean-ctx tools health — does every advertised MCP tool and injected rule earn its always-on token cost? (#848)
tool_lifecycle
Shared tool lifecycle — ensures CLI and MCP paths have identical side effects.
tool_profiles
transcript_compact
Transcript/conversation compaction for agent session JSONL files.
type_ref_edges
Cross-file type-reference edges (GH #398).
update_scheduler
OS-specific auto-update scheduler management. Supports macOS LaunchAgent, Linux systemd/cron, Windows Task Scheduler.
updater
verification_observability
version_check
visualizer
Data collection and HTML rendering for the interactive visualizer.
walk_filter
Central filter_entry predicate shared by every directory walker (graph/index builders, ctx_search, ctx_tree, ctx_glob, CLI scans).
web
Web & research context layer.
workflow
workspace_config
workspace_trust
Workspace trust for project-local .lean-ctx.toml overrides (GH security audit, finding 4).
wrapped
wrapped_share
Opt-in, self-hostable Wrapped share page.
wrapped_svg
Shareable SVG “Wrapped” card.
xdg_migrate
On-demand XDG split migration (GH #408 / GL #606).
yaml_crush
Deterministic YAML crusher — structural compaction for YAML documents (#985, Headroom YAML-compressor port, GitLab Epic #973).