Skip to main content

Module ctx_quality

Module ctx_quality 

Source
Expand description

ctx_quality — code-health surface for agents.

The agent-facing twin of lean-ctx health: it reads the same engine (crate::core::code_health) and surfaces the navigability score, cognitive-complexity hotspots, and the estimated token “quality tax”.

Actions:

  • report (default): project-wide score + hotspots + quality tax.
  • file: per-function cognitive complexity + naming for one file.
  • delta: cognitive-complexity change of a file vs its git HEAD.

format=json emits machine output. Rendering is deterministic for a given repo state (#498); only the priced tax depends on the configured model.

Functions§

handle
Entry point used by the registered MCP wrapper. path is the resolved (absolute) file path for file/delta; root is the project/repo root.