lean-ctx icon indicating copy to clipboard operation
lean-ctx copied to clipboard

bug: `lean-ctx doctor` reports incorrect number of checks passed

Open teadatuntud opened this issue 5 months ago • 2 comments

lean-ctx version: lean-ctx 3.8.7 (official, https://github.com/yvgude/lean-ctx)

OS: Linux

AI tool: Claude Code

What happened: Ran lean-ctx doctor after upgrading to 3.8.7 and noticed the mismatch between the Summary block and the individual checks performed list above it.

What you expected: The Summary block to report the correct number of checks passed / checks total. From the output below, there seem to be 31 individual checks with one failing. Instead of the expected 30/31 passed Summary reports 28/28 passed.

Steps to reproduce:

  1. Upgrade from 3.8.3 to 3.8.7 via lean-ctx update
  2. lean-ctx doctor

Relevant output: Here's the excerpt from the terminal output after running the above commands. Note: the username is redacted.

  ✓  lean-ctx in PATH  /home/<username>/.local/bin/lean-ctx
  ✓  lean-ctx version  lean-ctx 3.8.7  (resolved: /home/<username>/.local/bin/lean-ctx)
  ✓  data dir  exists  /home/<username>/.lean-ctx
  ✓  stats.json  exists  22848 bytes  /home/<username>/.lean-ctx/stats.json
  ✗  XDG layout  47 item(s) in single dir  /home/<username>/.lean-ctx  (run: lean-ctx doctor --fix to split into config/data/state/cache)
  ✓  config.toml  exists  /home/<username>/.lean-ctx/config.toml
  ✓  Shell allowlist  102 command(s) enforced  (add one: lean-ctx allow <cmd>)
  ✓  Path jail  active  (project root only; extend via allow_paths in ~/.lean-ctx/config.toml)
  ✓  Compact-format passthrough  toon  (preserved verbatim, not recompressed)
  ✓  Permission inheritance  on  (on, but no OpenCode permission rules found yet)
  ✓  Proxy upstream  provider defaults
  ✓  Shell aliases  lean-ctx referenced in ~/.bashrc
  ✓  MCP config  lean-ctx found in: Claude Code (/home/<username>/.claude.json)
  ✓  SKILL.md  installed for Claude Code
  ✓  Dashboard port 3333  available on 127.0.0.1
  ✓  Daemon  running (PID 27300)
  ✓  Providers  none configured (enable via [providers] in config.toml)
  ✓  Plan mode  Claude Code  permissions present
  ✓  Session state  no active session  (will be created on first tool call)
  ✓  Build origin  official  https://github.com/yvgude/lean-ctx
  ✓  Cache safety  cache_alignment + provider_cache operational
  ✓  Claude Code instructions  CLAUDE.md block + skill installed  (MCP instructions capped at 2048 chars — full content via CLAUDE.md)
  ✓  BM25 cache  27 index(es), 3.0 MB total
  ✓  Archive FTS  0.2 MB / 500 MB cap
  ✓  Memory profile  balanced  (config: default — single embedding engine, BM25 disk 512 MB)
  ✓  Memory cleanup  aggressive  (default: cache cleared after 5 min idle, single-IDE optimized)
  ✓  RAM Guardian  32 MB / 15.5 GB system (0.2%)  limit: 795 MB (jemalloc, daemon)
  ✓  Capacity all stores within limits
  ✓  Knowledge stores  14 orphaned (238.9 KB reclaimable)  (deleted projects — reclaim: lean-ctx cache prune)
  ✓  Proxy  disabled (optional feature)  enable: lean-ctx proxy enable
  ✓  Deprecations  none active  (register: DEPRECATIONS.toml, policy: CONTRACTS.md)

  LSP (optional — for ctx_refactor):
  ✗  rust  not installed  rustup component add rust-analyzer
  ✗  typescript  not installed  npm install -g typescript-language-server typescript
  ✗  python  not installed  pip install python-lsp-server
  ✗  go  not installed  go install golang.org/x/tools/gopls@latest
  Shadow mode  disabled  (enable: lean-ctx config set shadow_mode true)
  Tool profile  standard  22 balanced tools (recommended) + ctx_call gateway
  Session cache  6 sessions  60/295 reads cached (20% hit) · prove: lean-ctx verify-cache

  Summary:  28/28 checks passed
  Everything looks good.
  LSP servers are optional enhancements (not counted in score)
  lean-ctx 3.8.7 (official, https://github.com/yvgude/lean-ctx)

teadatuntud avatar Jun 16 '26 07:06 teadatuntud

Fixed on main in 65a4ce080c.

The summary diverged from the printed checks because passed/total were two hand-maintained counters: rendered ✗ checks ("XDG layout", "data dir split") were shown but never added to total, so the score overstated health.

All checks now flow through a single accumulator (Scoreboard) that counts exactly what it renders; advisory lines (LSP, providers, MCP bridges) are rendered but explicitly excluded from the score, so display and tally can no longer drift apart.

Will be closed with the next release.

yvgude avatar Jun 16 '26 13:06 yvgude

Fixed in v3.8.8. doctor's passed/total score now matches the checks it actually prints.

Release: https://github.com/yvgude/lean-ctx/releases/tag/v3.8.8

yvgude avatar Jun 17 '26 00:06 yvgude