Added
- Context Engine Wiring: Connected all modular Context Layer components into a live, end-to-end pipeline. Nine previously test-only modules now run in production:
- ContextLedger tracks every file the model has seen (path, mode, token count) across the session — enabling pressure detection and smart re-injection.
- StructuredIntent is automatically created on every task change (
set_task), extracting task type, targets, scope, language hint, and urgency from the query. - Task-aware compression (
task_aware_compress): When a StructuredIntent is active, theaggressiveread mode uses intent-focused compression (e.g., FixBug keeps error paths, Refactor keeps interfaces). Falls back to standard compression when no intent exists. - Intent-based relevance (
compute_relevance_from_intent):ctx_preloaduses structured intent targets and scope for richer file relevance scoring instead of plain keyword matching. - Deficit detection: After preloading, the system compares the ContextLedger against the active intent to identify missing files and suggests them to the agent.
- Role-based context depth:
ctx_agent registernow classifies the agent role (Coder, Reviewer, Debugger, Planner, etc.) and returns recommended context settings (preferred mode, file limits, budget ratio). - Structured handoff packages:
ctx_handoff createnow builds aHandoffPackagewith intent snapshot and context window state, enabling richer context transfer between agents.
- Pipeline architecture (
core/pipeline.rs): Formal layer contracts with input/output types, per-layer metrics, and a composable pipeline orchestrator. - Cross-agent knowledge sharing: Agents in the same project can share findings via scratchpad with automatic deduplication.
- New CLI compression patterns: Added compressors for
jest,mocha,tofu(OpenTofu/Terraform),ps,df,du,ping, andjqoutput. Also added routing for linting tools (eslint,pylint,rubocop,golangci-lint), build tools (gradle,mvn,cmake,meson), and monorepo tools (nx,turbo,lerna,rush). - Intent-aware auto mode selection:
ctx_readnow considers the activeStructuredIntentwhen choosing the optimal read mode, matching file content to the current task type. - Graph heat seeding from intent:
StructuredIntenttargets are used as seed nodes for the knowledge graph heatmap, improving relevance scoring for related files.
Refactored
- God-file splits: Major codebase restructuring for maintainability:
server.rs(2185 lines) →server/mod.rs+server/dispatch.rs+server/execute.rs+server/helpers.rscli.rs(1847 lines) →cli/mod.rs+cli/shell_init.rsmain.rs(1475 lines) → 19 lines (logic moved tocli/)hooks.rs(1518 lines) →hooks/mod.rs+hooks/agents.rstool_defs.rs(1095 lines) →tool_defs/mod.rs+tool_defs/granular.rs
- LITM end_block activation: The Lost-In-The-Middle
end_block(findings, test results, next steps) is now injected at the end of instructions, not justbegin_block. - Intent system unification:
intent_engine(task classification) andintent_protocol(tool-call tracking) are now connected —IntentRecordcarriesTaskType. - Task-type-aware IB filter: The information bottleneck filter adapts its structural weights based on the detected task type (FixBug prioritizes error lines, Test prioritizes assertions).
Fixed
- Antigravity MCP config: Removed
autoApproveand use absolute binary path for compatibility. - PathJail auto-allowlist: IDE config directories (
.codex/,.claude/,.cursor/) are automatically allowed in PathJail.
Upgrade
cargo install lean-ctx # or
npm update -g lean-ctx-bin # or
brew upgrade lean-ctxFull Changelog: v3.2.7...v3.2.7