Skip to main content

lean_ctx/core/
mod.rs

1// ---------------------------------------------------------------------------
2// Domain: Compression
3// ---------------------------------------------------------------------------
4pub mod adaptive_chunking;
5pub mod adaptive_compression;
6pub mod addons;
7pub mod aggressiveness;
8pub mod attention_context;
9pub mod auto_capture;
10pub mod auto_findings;
11pub mod codebook;
12#[cfg(target_os = "macos")]
13pub mod codesign;
14pub mod compress_preview;
15pub mod compression_safety;
16pub mod compressor;
17#[cfg(feature = "experimental")]
18pub mod context_budget;
19pub mod datadog_push;
20pub mod entropy;
21pub mod etpao;
22pub mod eval_ab;
23pub mod eval_harness;
24pub mod extractive;
25pub mod finops_export;
26pub mod html_crush;
27pub mod information_bottleneck;
28pub mod json_crush;
29pub mod json_sample;
30pub mod markdown_compact;
31pub mod output_sanitizer;
32pub mod policy;
33pub mod pop_pruning;
34pub mod predictive_coding;
35pub mod predictive_prefetch;
36pub mod preservation;
37pub mod process_guard;
38pub mod progressive_compression;
39pub mod protect;
40pub mod rabin_karp;
41pub mod relevance_tracker;
42pub mod rule_artifacts;
43#[cfg(feature = "experimental")]
44pub mod rule_scorer;
45#[cfg(feature = "experimental")]
46pub mod rule_staleness;
47pub mod rules_canonical;
48pub mod rules_channel;
49pub mod rules_overhead;
50pub mod rules_sections;
51pub mod rules_validation;
52pub mod runtime_flags;
53pub mod structural_tokenizer;
54pub mod structured_read;
55pub mod tabular_crush;
56pub mod yaml_crush;
57
58/// Convenience re-export: all compression-related modules.
59pub mod compression {
60    pub use super::adaptive_chunking;
61    pub use super::codebook;
62    pub use super::compression_safety;
63    pub use super::compressor;
64    pub use super::entropy;
65    pub use super::information_bottleneck;
66    pub use super::json_crush;
67    pub use super::json_sample;
68    pub use super::pop_pruning;
69    pub use super::preservation;
70    pub use super::progressive_compression;
71    pub use super::rabin_karp;
72    pub use super::structural_tokenizer;
73}
74
75// ---------------------------------------------------------------------------
76// Domain: Memory
77// ---------------------------------------------------------------------------
78pub mod episodic_memory;
79pub mod interrupt;
80pub mod memory_archive;
81pub mod memory_boundary;
82pub mod memory_capacity;
83pub mod memory_consolidation;
84pub mod memory_guard;
85pub mod memory_lifecycle;
86pub mod memory_policy;
87pub mod memory_salience;
88pub mod multiscale_index;
89pub mod procedural_memory;
90pub mod prospective_memory;
91
92/// Convenience re-export: all memory-related modules.
93pub mod memory {
94    pub use super::episodic_memory;
95    pub use super::memory_boundary;
96    pub use super::memory_consolidation;
97    pub use super::memory_lifecycle;
98    pub use super::memory_policy;
99    pub use super::procedural_memory;
100    pub use super::prospective_memory;
101}
102
103// ---------------------------------------------------------------------------
104// Domain: Graph
105// ---------------------------------------------------------------------------
106pub mod call_graph;
107pub mod community;
108pub mod gamma_cover;
109pub mod graph_analysis;
110pub mod graph_context;
111pub mod graph_coordinator;
112pub mod graph_enricher;
113pub mod graph_export;
114pub mod graph_features;
115pub mod graph_index;
116pub mod graph_parity;
117pub mod graph_provider;
118pub mod pagerank;
119pub mod property_graph;
120pub mod repomap;
121
122/// Convenience re-export: all graph-related modules.
123pub mod graph {
124    pub use super::call_graph;
125    pub use super::community;
126    pub use super::gamma_cover;
127    pub use super::graph_context;
128    pub use super::graph_enricher;
129    pub use super::graph_export;
130    pub use super::graph_features;
131    pub use super::graph_index;
132    pub use super::graph_provider;
133    pub use super::pagerank;
134    pub use super::property_graph;
135}
136
137// ---------------------------------------------------------------------------
138// Domain: Context
139// ---------------------------------------------------------------------------
140pub mod context_artifacts;
141pub mod context_column;
142pub mod context_compiler;
143pub mod context_deficit;
144pub mod context_field;
145pub mod context_handles;
146pub mod context_ir;
147pub mod context_kernel;
148pub mod context_ledger;
149pub mod context_lint;
150pub mod context_os;
151pub mod context_overhead;
152pub mod context_overlay;
153pub mod context_package;
154pub mod context_policies;
155pub mod context_proof;
156pub mod context_proof_v2;
157pub mod context_radar;
158pub mod context_snapshot;
159pub mod cross_source_edges;
160pub mod cross_source_hints;
161
162/// Convenience re-export: all context-related modules.
163pub mod context {
164    pub use super::context_artifacts;
165    pub use super::context_column;
166    pub use super::context_compiler;
167    pub use super::context_deficit;
168    pub use super::context_field;
169    pub use super::context_handles;
170    pub use super::context_ir;
171    pub use super::context_ledger;
172    pub use super::context_os;
173    pub use super::context_overlay;
174    pub use super::context_package;
175    pub use super::context_policies;
176    pub use super::context_proof;
177    pub use super::context_proof_v2;
178}
179
180// ---------------------------------------------------------------------------
181// Domain: Knowledge
182// ---------------------------------------------------------------------------
183pub mod claim_extractor;
184pub mod cognition_loop;
185pub mod cognition_scheduler;
186pub mod knowledge;
187pub mod knowledge_bootstrap;
188pub mod knowledge_bridge;
189pub mod knowledge_embedding;
190pub mod knowledge_provider_extract;
191pub mod knowledge_relations;
192
193/// Convenience re-export: all knowledge-related modules.
194pub mod knowledge_domain {
195    pub use super::claim_extractor;
196    pub use super::cognition_loop;
197    pub use super::knowledge;
198    pub use super::knowledge_bootstrap;
199    pub use super::knowledge_bridge;
200    pub use super::knowledge_embedding;
201    pub use super::knowledge_relations;
202}
203
204// ---------------------------------------------------------------------------
205// Domain: Search & Retrieval
206// ---------------------------------------------------------------------------
207pub mod bm25_cache;
208pub mod bm25_index;
209pub mod content_cache;
210pub mod content_chunk;
211pub mod context_packing;
212pub mod cooccurrence;
213pub mod dense_backend;
214pub mod embedding_index;
215pub mod embedding_quant;
216pub mod embeddings;
217pub mod energy;
218pub mod hybrid_search;
219#[cfg(feature = "pgvector")]
220pub mod pgvector_store;
221#[cfg(feature = "qdrant")]
222pub mod qdrant_store;
223pub mod search_reranking;
224pub mod semantic_cache;
225pub mod semantic_chunks;
226pub mod splade_retrieval;
227pub mod spreading_activation;
228
229/// Convenience re-export: all search-related modules.
230pub mod search {
231    pub use super::bm25_index;
232    pub use super::content_chunk;
233    pub use super::dense_backend;
234    pub use super::embedding_index;
235    pub use super::embeddings;
236    pub use super::hybrid_search;
237    pub use super::search_reranking;
238    pub use super::semantic_cache;
239    pub use super::semantic_chunks;
240    pub use super::splade_retrieval;
241}
242
243// ---------------------------------------------------------------------------
244// Domain: Session & Handoff
245// ---------------------------------------------------------------------------
246pub mod ccp_session_bundle;
247pub mod handoff_ledger;
248pub mod handoff_transfer_bundle;
249pub mod session;
250pub mod session_diff;
251pub mod session_summary;
252pub mod skillify;
253
254/// Convenience re-export: all session-related modules.
255pub mod session_domain {
256    pub use super::ccp_session_bundle;
257    pub use super::handoff_ledger;
258    pub use super::handoff_transfer_bundle;
259    pub use super::session;
260    pub use super::session_diff;
261}
262
263// ---------------------------------------------------------------------------
264// Domain: Attention & Placement
265// ---------------------------------------------------------------------------
266pub mod attention_layout_driver;
267pub mod attention_model;
268pub mod attention_placement;
269pub mod litm;
270
271/// Convenience re-export: all attention-related modules.
272pub mod attention {
273    pub use super::attention_layout_driver;
274    pub use super::attention_model;
275    pub use super::attention_placement;
276    pub use super::litm;
277}
278
279// ---------------------------------------------------------------------------
280// Domain: Neural / ML
281// ---------------------------------------------------------------------------
282pub mod neural;
283// ORT runtime glue links against the `ort` crate, which is only pulled in by the
284// `embeddings` or `neural` features. On platforms ORT does not support (e.g.
285// FreeBSD, see #586) these features are disabled, so the modules must be gated
286// to keep the build clean without them.
287#[cfg(any(feature = "embeddings", feature = "neural"))]
288pub mod ort_environment;
289#[cfg(any(feature = "embeddings", feature = "neural"))]
290pub mod ort_execution_providers;
291
292// ---------------------------------------------------------------------------
293// Domain: Patterns & Shell
294// ---------------------------------------------------------------------------
295pub mod patterns;
296
297// ---------------------------------------------------------------------------
298// Domain: Agents & A2A
299// ---------------------------------------------------------------------------
300pub mod a2a;
301pub mod a2a_transport;
302pub mod agent_identity;
303pub mod agent_runtime_env;
304pub mod agents;
305pub mod autonomy;
306pub mod autonomy_drivers;
307
308// ---------------------------------------------------------------------------
309// Domain: Adaptive & Scoring
310// ---------------------------------------------------------------------------
311pub mod adaptive;
312pub mod adaptive_mode_policy;
313pub mod adaptive_thresholds;
314pub mod auto_mode_resolver;
315pub mod bandit;
316pub mod litm_calibration;
317pub mod mode_predictor;
318pub mod model_registry;
319pub mod task_relevance;
320pub mod token_calibration;
321
322// ---------------------------------------------------------------------------
323// Domain: Diagnostics & Quality
324// ---------------------------------------------------------------------------
325pub mod anomaly;
326pub mod benchmark;
327pub mod benchmark_compare;
328/// Commercial-plane billing substrate (`billing-plane-v1`): plans, entitlements,
329/// and usage metering derived from the signed savings ledger. Never gates local.
330pub mod billing;
331pub mod code_health;
332pub mod cognitive_load;
333pub mod conformance;
334pub mod contracts;
335pub mod cyclomatic;
336pub mod degradation_policy;
337pub mod loop_detection;
338pub mod output_verification;
339pub mod quality;
340pub mod quality_lab;
341pub mod safety_needles;
342pub mod scorecard;
343pub mod setup_report;
344pub mod slo;
345pub mod slow_log;
346pub mod smells;
347pub mod subagent_contract;
348pub mod surprise;
349pub mod verification_observability;
350
351// ---------------------------------------------------------------------------
352// Domain: Config & Infrastructure
353// ---------------------------------------------------------------------------
354pub mod active_inference;
355pub mod agent_attribution;
356pub mod agent_budget;
357pub mod agent_lease;
358pub mod anchor;
359pub mod ann_cache;
360pub mod atomic_fs;
361pub mod attribution;
362pub mod audit_trail;
363pub mod binary_detect;
364pub mod bounce_tracker;
365pub mod budget;
366pub mod budget_tracker;
367pub mod budgets;
368pub mod cache;
369pub mod cache_diagnostics;
370pub mod cache_telemetry;
371pub mod capabilities;
372pub mod capsule_transport;
373pub mod chain_compression;
374pub mod cli_cache;
375pub mod client_capabilities;
376pub mod client_constraints;
377pub mod cloud_files;
378pub mod config;
379pub mod config_heal;
380pub mod consolidation;
381pub mod consolidation_engine;
382pub mod content_handle;
383pub mod context_capsule;
384pub mod contextops;
385pub mod conversation;
386pub mod crash_log;
387pub mod data_consolidate;
388pub mod data_dir;
389pub mod debug_log;
390#[allow(unused)]
391pub mod delivered_ranges;
392pub mod delta_response;
393pub mod deployment_profile;
394pub mod diagnostics_store;
395pub mod editor_signal;
396pub mod egress;
397pub mod error;
398pub mod events;
399pub mod eviction_orchestrator;
400pub mod evidence;
401pub mod evidence_classification;
402pub mod evidence_ledger;
403pub mod extension_registry;
404pub mod extractors;
405pub mod feedback;
406pub mod fep_prefetch;
407pub mod filters;
408pub mod free_energy_budget;
409pub mod gain;
410pub mod git;
411pub mod git_cache;
412pub mod git_signals;
413pub mod git_util;
414pub mod godot;
415pub mod gotcha_tracker;
416pub mod handle;
417pub mod hasher;
418pub mod heatmap;
419pub mod hebbian_cache;
420pub mod hnsw;
421pub mod home;
422pub mod homeostasis;
423pub mod immune_detector;
424pub mod marginal_gate;
425pub mod mcp_catalog;
426pub mod negative_knowledge;
427pub mod ocla;
428pub mod ocla_bus;
429pub mod quality_benchmark;
430pub mod qubo_select;
431pub mod query_aware;
432pub mod session_budget;
433pub mod work_graph;
434
435pub mod agent_registry;
436pub mod compliance;
437pub mod compliance_report;
438pub mod edit_metering;
439pub mod edit_quality;
440pub mod efficacy;
441pub mod evidence_bundle;
442pub mod grammar_usage;
443pub mod graph_cache;
444pub mod http_client;
445pub mod ide_permissions;
446pub mod import_resolver;
447pub mod index_admission;
448pub mod index_bundle;
449pub mod index_filter;
450pub mod index_namespace;
451pub mod index_orchestrator;
452pub mod index_paths;
453pub mod index_progress;
454pub mod ingestion;
455pub mod input_filters;
456pub mod instruction_compiler;
457pub mod integrity;
458pub mod intent_engine;
459pub(crate) mod intent_lang;
460pub mod intent_protocol;
461pub mod intent_router;
462pub mod introspect;
463pub mod io_boundary;
464pub mod io_health;
465pub mod journal;
466pub mod jsonc;
467pub mod knowledge_vault;
468pub mod language_capabilities;
469#[cfg(target_os = "macos")]
470pub mod launchd;
471pub mod layout_pin;
472pub mod learning_sync;
473pub mod levenshtein;
474pub mod limits;
475pub mod llm_enhance;
476pub mod llm_feedback;
477pub mod locomo;
478pub mod logging;
479pub mod mcp_manifest;
480pub mod mdl_selector;
481pub mod multi_repo;
482pub mod nc_compress;
483pub mod ocp;
484pub mod openapi;
485pub mod output_echo;
486pub mod owasp_alignment;
487pub mod path_locks;
488pub mod path_mode_memory;
489pub mod path_resolve;
490pub mod paths;
491pub mod pathutil;
492pub mod persona;
493pub mod pipeline;
494pub mod plugins;
495pub mod portable_binary;
496pub mod profile_suggest;
497pub mod profiles;
498pub mod project_hash;
499pub mod protocol;
500pub mod provider_bandit;
501pub mod provider_cache;
502pub mod providers;
503pub mod read_stub_index;
504pub mod recovery;
505pub mod redaction;
506pub mod reference_docs;
507pub mod roles;
508pub mod route_extractor;
509pub mod saliency;
510pub mod sandbox;
511#[cfg(target_os = "linux")]
512pub mod sandbox_landlock;
513pub mod sandbox_seatbelt;
514pub mod sanitize;
515pub mod savings_autopush;
516pub mod savings_footer;
517pub mod savings_ledger;
518pub mod scent_field;
519pub mod search_delta;
520pub mod search_index;
521pub mod secret_detection;
522pub mod security_posture;
523pub mod sensitivity;
524pub mod server_capabilities;
525pub mod session_token;
526pub mod share;
527pub mod shell_allowlist;
528pub mod startup_guard;
529pub mod stats;
530pub mod structural_diff;
531pub mod symbol_map;
532pub mod syntax_validate;
533pub mod task_briefing;
534/// macOS Seatbelt self-sandbox (#356): wraps launchd-owned daemon/proxy/updater
535/// in a `sandbox-exec` profile that denies `~/Documents`/`~/Desktop`/
536/// `~/Downloads`, so the TCC privacy prompt can never appear.
537#[cfg(target_os = "macos")]
538pub mod tcc_guard_sandbox;
539pub mod tdd_schema;
540pub mod team_slo;
541pub mod telemetry;
542pub mod terse;
543pub mod theme;
544pub mod threshold_learning;
545pub mod tokenizer_translation_driver;
546pub mod tokens;
547pub mod tool_health;
548pub mod tool_lifecycle;
549pub mod tool_profiles;
550pub mod transcript_compact;
551pub mod update_scheduler;
552pub mod updater;
553pub mod version_check;
554pub mod visualizer;
555pub mod walk_filter;
556/// WASM extension runtime (`wasm-abi-v1`): sandboxed, language-independent
557/// compressors and providers. Feature-gated behind `wasm`.
558#[cfg(feature = "wasm")]
559pub mod wasm_ext;
560pub mod web;
561pub mod workflow;
562pub mod workspace_config;
563pub mod wrapped;
564pub mod wrapped_share;
565pub mod wrapped_svg;
566pub mod xdg_migrate;
567
568// ---------------------------------------------------------------------------
569// Feature-gated modules
570// ---------------------------------------------------------------------------
571pub mod archive;
572pub mod archive_fts;
573pub mod artifact_index;
574pub mod artifacts;
575pub mod ast_walk;
576pub mod buddy;
577#[cfg(feature = "tree-sitter")]
578pub mod chunks_ts;
579pub mod deep_queries;
580pub mod deps;
581pub mod editor_registry;
582pub mod firewall;
583pub mod pathjail;
584pub mod signatures;
585#[cfg(feature = "tree-sitter")]
586pub mod signatures_ts;
587pub mod storage_maintenance;
588pub mod structured_compact;
589pub mod type_ref_edges;
590pub mod workspace_trust;