lean-ctx-engine 3.12.13

LeanCTX | OSS library: the open-source runtime for the Context Gateway for AI agents behind the lean-ctx CLI, MCP server and proxy integrations.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
// ---------------------------------------------------------------------------
// Domain: Compression
// ---------------------------------------------------------------------------
pub mod activity;
pub mod admitted_sources;
pub mod auto_capture;
pub mod auto_findings;
pub mod behavior_nudge;
pub mod cockpit_launch_record;
pub mod codebook;
#[cfg(target_os = "macos")]
pub mod codesign;
pub mod command_root;
pub mod compressor;
pub(crate) mod engine_artifact;
pub mod engine_interface;
pub mod entropy;
pub mod etpao;
pub mod extractive;
pub mod finops_export;
pub(crate) mod foreign_mcp;
pub use lean_ctx_compress::html_crush;
pub mod intelligence_runtime;
pub mod json_crush;
// pub only for lean-ctx-engine-ext; not public API
#[doc(hidden)]
pub mod migration_lock;
pub mod output_sanitizer;
pub mod policy;
pub mod process_capture;
pub mod protect;
pub mod rabin_karp;
pub mod relevance_tracker;
pub mod rooted_read;
pub mod rule_artifacts;
pub mod rules_canonical;
pub mod rules_channel;
pub mod rules_dedup;
pub mod rules_overhead;
pub(crate) mod rules_sections;
pub(crate) mod rules_validation;
pub mod runtime_flags;
pub mod shared_context;
pub mod solution_tracker;
pub mod structured_read;
pub use lean_ctx_compress::tabular_crush;
#[allow(unreachable_pub)]
#[cfg(windows)]
pub(crate) mod windows_file;
#[cfg(windows)]
pub mod windows_private;
pub use lean_ctx_compress::yaml_crush;

// ---------------------------------------------------------------------------
// Domain: Memory
// ---------------------------------------------------------------------------
pub mod interrupt;
pub mod legacy_adoption;
pub mod memory_archive;
pub mod memory_boundary;
pub(crate) mod memory_capacity;
pub(crate) mod memory_consolidation;
pub mod memory_guard;
pub mod memory_lifecycle;
pub mod memory_policy;
pub(crate) mod memory_salience;

// ---------------------------------------------------------------------------
// Domain: Graph
// ---------------------------------------------------------------------------
pub mod call_graph;
pub mod graph_context;
pub mod graph_enricher;
pub mod graph_export;
pub mod graph_index;
pub mod graph_provider;
pub mod property_graph;

// ---------------------------------------------------------------------------
// Domain: Context
// ---------------------------------------------------------------------------
pub mod context_admission;
pub mod context_compiler;
pub mod context_field;
pub mod context_ir;
// Accidental historical surface retained for source compatibility. Public
// embedders should use `engine::ContextEngine` or `lean-ctx-sdk`.
pub mod context_checkpoint;
#[doc(hidden)]
pub mod context_kernel;
pub mod context_ledger;
pub mod context_os;
pub mod context_overhead;
pub mod context_overlay;
pub mod context_package;
pub mod context_proof;
pub mod context_quality;
pub mod context_store;
pub mod cross_source_edges;
pub mod cross_source_hints;
pub mod customer_proof_v2;

// ---------------------------------------------------------------------------
// Domain: Knowledge
// ---------------------------------------------------------------------------
pub mod execution_ledger;
pub mod knowledge;
pub mod knowledge_consolidate;
pub mod knowledge_embedding;
pub mod knowledge_provider_extract;
pub mod knowledge_relations;
pub mod outcome;

// ---------------------------------------------------------------------------
// Domain: Search & Retrieval
// ---------------------------------------------------------------------------
pub mod bm25_cache;
pub mod bm25_index;
pub mod bm25_store;
pub mod bounded_lock;
pub mod content_cache;
pub mod content_chunk;
pub mod derivation_cache;
pub mod embedding_access;
pub mod embedding_index;
pub(crate) mod embedding_quant;
pub mod embeddings;
pub mod energy;
pub mod hybrid_search;
pub mod instruction_files;
pub mod mcp_roots;
pub mod read_mode;
pub mod reference_store;
pub mod search_hook;
pub mod search_kernel;
pub mod search_reranking;
pub mod search_walk;
pub mod semantic;

// ---------------------------------------------------------------------------
// Domain: Session & Handoff
// ---------------------------------------------------------------------------
pub mod handoff_ledger;
pub mod handoff_transfer_bundle;
pub mod session;
pub mod session_rights;
pub mod session_summary;
pub mod signer_trust;

// ---------------------------------------------------------------------------
// Domain: Attention & Placement
// ---------------------------------------------------------------------------
pub mod litm;

// ---------------------------------------------------------------------------
// Domain: Embeddings / ML
// ---------------------------------------------------------------------------
// ORT runtime glue links against the `ort` crate, which is only pulled in by the
// `embeddings` feature. On platforms ORT does not support (e.g.
// FreeBSD, see #586) these features are disabled, so the modules must be gated
// to keep the build clean without them.
#[cfg(all(feature = "embeddings", any(feature = "ort-cuda", test)))]
pub(crate) mod ort_cuda_imports;
#[cfg(feature = "embeddings")]
pub mod ort_environment;
#[cfg(feature = "embeddings")]
pub mod ort_execution_providers;

// ---------------------------------------------------------------------------
// Domain: Patterns & Shell
// ---------------------------------------------------------------------------
pub mod patterns;

// ---------------------------------------------------------------------------
// Domain: Agents & A2A
// ---------------------------------------------------------------------------
pub mod a2a;
pub mod a2a_transport;
pub mod agent_identity;
pub mod agent_templates;
pub mod agents;
pub mod canonical;
pub mod cloud_gate;

// ---------------------------------------------------------------------------
// Domain: Adaptive & Scoring
// ---------------------------------------------------------------------------
pub mod adaptive;
pub mod adaptive_policy;
pub mod adaptive_thresholds;
pub mod auto_mode_resolver;
pub mod decision_loop;
pub mod execution_lifecycle;
pub mod execution_protocol;
pub mod model_catalog;
pub mod model_registry;
pub mod task_relevance;
pub mod task_spine;

// ---------------------------------------------------------------------------
// Domain: Diagnostics & Quality
// ---------------------------------------------------------------------------
pub mod code_health;
pub mod conformance;
pub mod contracts;
pub mod output_verification;
pub(crate) mod safety_needles;
pub mod slow_log;
pub mod surprise;

// ---------------------------------------------------------------------------
// Domain: Config & Infrastructure
// ---------------------------------------------------------------------------
pub mod active_inference;
pub mod agent_budget;
pub mod agent_lease;
pub(crate) mod ann_cache;
pub mod atomic_fs;
pub mod attribution;
pub mod audit_trail;
pub mod binary_detect;
pub mod bounce_tracker;
pub mod budget;
pub mod budgets;
pub mod cache;
pub mod capabilities;
pub mod capsule_transport;
pub mod causal_attribution;
pub mod ccr;
pub mod claude_host;
pub mod claude_md;
pub mod client_capabilities;
pub mod client_constraints;
pub mod cloud_files;
pub mod cloud_signals;
pub mod config;
pub mod config_heal;
pub mod consolidation;
pub mod consolidation_engine;
pub mod context_capsule;
pub mod conversation;
pub mod data_consolidate;
pub mod data_dir;
pub mod debug_log;
pub mod diagnostics_store;
pub mod dynamic_tools;
pub mod egress;
pub mod error;
pub mod events;
pub mod eviction_orchestrator;
pub(crate) mod evidence;
pub mod extension_registry;
pub mod extractors;
pub mod file_lock;
pub mod filters;
pub mod gain;
pub mod git;
pub mod git_worktree;
pub(crate) mod godot;
pub mod gotcha_tracker;
pub mod governor_hosts;
pub mod handle;
pub mod hasher;
pub mod heatmap;
pub mod hnsw;
pub mod home;
pub mod homeostasis;
pub mod hook_mode;
pub mod host_coverage;
pub mod host_state;
pub mod immune_detector;
pub mod mcp_catalog;
pub mod ocla;
pub mod ocla_bus;
pub mod work_graph;
pub mod work_graph_delegation;
pub mod work_graph_store;

pub mod agent_registry;
pub mod compliance_evidence;
pub mod edit_metering;
pub mod edit_quality;
pub mod evidence_bundle;
pub mod failure_template;
pub mod grammar_usage;
pub mod graph_cache;
pub mod host_env;
pub mod http_client;
pub use lean_ctx_syntax::import_resolver;
pub mod index_admission;
pub mod index_filter;
pub mod index_namespace;
pub mod index_orchestrator;
pub mod index_paths;
pub mod index_progress;
pub mod ingestion;
pub mod input_filters;
pub mod installation_id;
// Compiled into build.rs (`#[path]`); here only for its tests.
#[cfg(test)]
mod build_origin;
pub mod integrity;
pub mod intent_engine;
pub(crate) mod intent_lang;
pub mod intent_protocol;
pub mod intent_router;
pub mod introspect;
pub mod io_boundary;
pub mod io_health;
pub mod journal;
pub mod jsonc;
pub mod language_capabilities;
#[cfg(target_os = "macos")]
pub(crate) mod launchd;
pub mod layout_pin;
pub mod levenshtein;
pub mod limits;
pub mod mcp_manifest;
pub mod multi_repo;
pub(crate) mod nc_compress;
pub mod ocp;
pub mod openapi;
pub mod opencode_config;
pub mod owasp_alignment;
pub mod path_mode_memory;
pub mod path_resolve;
pub mod path_suggest;
pub mod paths;
pub mod pathutil;
pub mod persona;
pub mod phase_timing;
pub mod pipeline;
pub mod portable_binary;
pub mod product_capabilities;
pub mod profiles;
pub mod project_hash;
/// Kernel store boundary of protected sessions: the pinned child rules, the
/// in-process store-path check and the launcher's control-file profiles.
pub mod protected_store;
pub mod protocol;
pub mod provider_bandit;
pub mod providers;
pub mod proxy_endpoint;
pub mod proxy_introspect;
pub mod proxy_metrics;
pub mod proxy_usage;
pub mod proxy_value_metrics;
pub mod read_stub_index;
pub mod recovery;
pub mod redaction;
pub mod reference_docs;
/// Request ledger of a serving process: counters, oldest pending request and
/// last completions for doctor and health (#2197).
pub mod request_ledger;
pub mod response_optimizer;
pub mod roles;
pub mod root_selection;
pub mod sanitize;
pub mod savings_footer;
pub mod savings_ledger;
pub mod savings_tracker;
pub mod scent_field;
pub mod search_delta;
pub mod search_index;
pub mod secret_detection;
pub mod secure_fs;
pub mod security_events;
pub mod sensitivity;
pub mod server_capabilities;
pub mod session_token;
pub mod shell_allowlist;
pub mod shell_file_effects;
pub mod startup_guard;
pub mod stats;
pub mod vault_map;
pub use lean_ctx_syntax::syntax_validate;
/// macOS Seatbelt self-sandbox (#356): wraps launchd-owned daemon/proxy/updater
/// in a `sandbox-exec` profile that denies `~/Documents`/`~/Desktop`/
/// `~/Downloads`, so the TCC privacy prompt can never appear.
#[cfg(target_os = "macos")]
pub mod tcc_guard_sandbox;
pub mod tdd_schema;
pub mod telemetry;
pub mod telemetry_aggregate;
pub mod telemetry_consent;
pub mod telemetry_failure;
pub mod telemetry_features;
pub mod telemetry_ledger;
pub mod telemetry_notices;
pub mod telemetry_send;
pub mod telemetry_v2;
pub mod terse;
pub mod text_decode;
pub mod theme;
pub mod tokens;
pub mod tool_catalog;
pub mod tool_health;
pub mod tool_lifecycle;
pub mod tool_profiles;
pub mod tool_visibility;
pub mod transcript_compact;
pub mod triage;
pub mod untrusted;
pub mod update_scheduler;
pub mod updater;
pub mod value;
pub mod value_gate;
pub mod version_check;
pub mod walk_filter;
/// WASM extension runtime (`wasm-abi-v1`): sandboxed, language-independent
/// compressors and providers. Feature-gated behind `wasm`.
#[cfg(feature = "wasm")]
pub(crate) mod wasm_ext;
pub mod web;
pub mod workflow;
pub mod wrapped;
pub(crate) mod wrapped_share;
pub(crate) mod wrapped_svg;
pub mod xdg_migrate;

// ---------------------------------------------------------------------------
// Feature-gated modules
// ---------------------------------------------------------------------------
pub mod archive;
pub mod archive_fts;
pub mod artifacts;
#[cfg(feature = "tree-sitter")]
// pub only for lean-ctx-engine-ext; not public API
#[doc(hidden)]
pub use lean_ctx_syntax::ast_walk;
#[cfg(feature = "tree-sitter")]
pub mod chunks_ts;
pub use lean_ctx_syntax::deep_queries;
pub mod deps;
#[cfg(test)]
mod doc_claims;
pub mod editor_registry;
pub mod feature_list;
pub mod firewall;
pub mod pathjail;
pub mod pathjail_autobind;
pub mod pathjail_scope;
pub mod pathjail_write;
pub mod signatures;
#[cfg(feature = "tree-sitter")]
pub use lean_ctx_syntax::signatures_ts;
pub mod type_ref_edges;
pub mod workspace_authority;
pub mod workspace_trust;