Expand description
Active compiler/linter diagnostics as a context-priority signal (#499).
When cargo/tsc/eslint fail, the files they point at are the most
task-relevant files in the project — the agent will read them next to fix
the build. The shell layer already sees this output (CLI lean-ctx -c and
MCP ctx_shell); this store extracts the structured (file, line) pairs
and makes them available to auto-mode, relevance ranking and the triage.
Persistence: ~/.lean-ctx/diagnostics.json — the CLI runs as a separate
process from the MCP server, so an in-memory store would never be seen by
ctx_read’s auto-mode. Entries expire after TTL_SECS; a succeeding run
of the same tool clears its diagnostics.
Structs§
Enums§
Functions§
- apply_
boost - Apply diagnostic boosts to a relevance ranking and re-sort.
- details_
for - Diagnostics for one path:
(line, severity, message)triples. - has_
error - Does any tracked file currently carry a compile error?
- record_
from_ shell - Shell-layer hook: parse diagnostics out of a finished command.
Success clears the tool’s previous diagnostics; failure replaces them.
Cheap for non-diagnostic commands (one
containsprobe). - relevance_
boost - Ranking boost per path: errors dominate, warnings hint (#499).
- severity_
for - snapshot
- Snapshot for ranking/triage consumers:
(path, severity)pairs.