Skip to main content

Module auto_mode_resolver

Module auto_mode_resolver 

Source

Structs§

AutoModeContext
ResolvedMode

Constants§

OUTLINE_MIN_LINES
Above this many lines a ctx_read that names no range answers with an outline; at or below it the file comes whole (owner decision 2026-10-30).

Functions§

configured_default_mode
Returns the configured read-mode default, excluding the profile’s auto sentinel so callers can ask the learned resolver for a per-file decision.
count_source
flush_sources
Persist the in-process counters by adding them into the cumulative on-disk file, then reset the process counters. The counters live in the MCP/CLI process — the dashboard is a separate process and can only see them through this file (#505).
outline_mode
The outline view for a large file: the symbol list with line spans, or the key structure of a data/prose format. A file with no extractable structure gets the header (line count) and a pointer to lines:N-M.
persisted_source_counts
Cumulative auto-mode decision sources from disk (all processes, all time), sorted by count descending. Used by the dashboard’s Live Signals panel.
pressure_downgrade
Unified pressure downgrade table. Used by both context_gate and intent_router pressure paths.
resolve
Single entry point for auto-mode resolution. Merges Pipeline A (select_mode_with_task) and Pipeline B (resolve_auto_mode).
resolve_mode_precedence
Resolves read-mode sources with one documented precedence order: explicit request > configured default > learned selection > built-in default.
source_counts
Snapshot of auto-mode decision sources, sorted by count descending.
unranged_view
Owner rule for a read that names no range (no mode, or auto): a file with more than OUTLINE_MIN_LINES lines comes as its outline, a smaller file comes whole. A pure function of the resolution, the path and the line count, so the delivered view stays byte-stable (#498).