Premium Experience Upgrade — Architecture, Performance & Polish
Major internal refactoring for long-term maintainability, performance improvements for async I/O, unified error handling, and premium polish across CLI, dashboard, and CI pipeline.
Architecture
- server.rs split — Monolithic
server.rs(1918 lines) split into 4 focused modules:tool_defs.rs(620L),instructions.rs(159L),cloud_sync.rs(136L),server.rs(1001L). Each module has a single responsibility. - Centralized error handling — New
LeanCtxErrorenum incore/error.rswiththiserrorderive.Fromimpls forio::Error,toml::de::Error,serde_json::Error.
Performance
- Async I/O for ctx_shell —
execute_commandwrapped intokio::task::spawn_blockingto prevent blocking the Tokio runtime during shell command execution.
CLI
- Dynamic version — All hardcoded version strings replaced with
env!("CARGO_PKG_VERSION"). - report-issue exit code — Empty title now exits with status 1.
- Theme migration —
print_command_box()migrated from hardcoded ANSI tocore::themesystem. - upgrade → update —
lean-ctx upgradenow deprecation-delegates tolean-ctx update.
Dashboard
- Offline fonts — Removed Google Fonts CDN dependency, system font stacks.
- Dynamic version — Fetched from
/api/versioninstead of hardcoded. - Empty state UX — Links to Getting Started guide.
- Connection retry — Auto-retry with clear message when API unavailable.
Tool Robustness
- ctx_search — Reports files skipped due to encoding/permission errors.
- ctx_read — Warns on unknown mode, shows message when using cache fallback.
- ctx_analyze / ctx_benchmark —
.unwrap()→if let Some(...)safety.
CI
- Deduplicated audit — Removed redundant
cargo auditjob. - Release tests —
cargo test --all-featuresruns before release builds.
Setup
- Compact doctor —
doctor::run_compact()for concise diagnostics during setup.
Full Changelog: v2.16.6...v2.17.0
Full Changelog: v2.16.6...v2.17.0