Expand description
Path promotion: auto-create Mounts for frequently-used paths (RFC-025 Phase 5).
Unlike runtime detection (which only matches existing Mounts), this module scans session history to find paths the agent has actually worked on (via tool calls) or the user has explicitly mentioned, counts them, and promotes paths that cross a frequency threshold into Mounts.
§Pipeline
- Extract raw paths from session trajectories (
tool_args) and user messages. - Normalize each path to its project root by walking up the directory
tree until a marker file (
Cargo.toml,package.json,.git, …) is found. This collapses/proj/src/main.rsand/proj/Cargo.tomlinto the single root/proj. - Count normalized roots over a sliding window.
- Promote roots that cross the threshold into Mounts (unless one already covers that root).
§Why background, not realtime
Every extraction requires walking the filesystem (to find markers), so we run this on a cadence (alongside Dream consolidation) rather than on every message. The threshold naturally debounces one-off mentions.
Structs§
- Path
Frequency - A path’s frequency tally within the promotion window.
- Promotion
Config - Configuration for path promotion (mirrors
MountsConfig).
Functions§
- extract_
paths - Extract raw path strings from a single session.
- normalize_
to_ root - Find the project root for
pathby walking up until a marker is found. - tally_
frequencies - Normalize a raw path to its project root, then tally frequencies.