Summary
Every scan currently walks the entire workspace (eco.scanGlob over the whole repo). On large repos this is slow and noisy, and there's no way to scan just the part you're working on. Add the ability to scope a scan to a subset of the repo rather than always the full tree.
Motivation
Proposed scopes (pick the set worth shipping)
- Path / subdirectory scope — scan a chosen folder (e.g.
src/services). Surfaced as: right-click a folder in the Explorer → "ReCost: Scan this folder"; and CLI positional already supports a directory target.
- Changed-files scope — scan only files changed vs. a base (
git diff --name-only <base>), for pre-commit / PR-sized scans.
- Open / active file scope — scan just the active editor file or all open editors (fast inner-loop).
- Saved scope presets — persist named include-globs per workspace (
workspaceState) so a user can re-run "backend only" without re-typing globs.
Surfaces
- Sidebar: a scope selector on the scan screen (Full repo · This folder · Changed files · Active file), defaulting to Full repo.
- CLI: the positional directory arg already scopes by path; add
--changed [base] and --include <glob,glob> flags to mirror the sidebar.
- Settings: reuse the existing
eco.scanIncludeGlobs allowlist as the underlying mechanism for path/preset scopes.
Out of scope
- Incremental/cached re-scan (only re-analyzing changed files while reusing prior results) — track separately if wanted; this issue is about selecting scope, not caching results.
Acceptance criteria
Context
Raised while validating cost accuracy across many repos — full-repo scans were the default friction. Related: scope-hygiene #137, calibration #138.
Summary
Every scan currently walks the entire workspace (
eco.scanGlobover the whole repo). On large repos this is slow and noisy, and there's no way to scan just the part you're working on. Add the ability to scope a scan to a subset of the repo rather than always the full tree.Motivation
Proposed scopes (pick the set worth shipping)
src/services). Surfaced as: right-click a folder in the Explorer → "ReCost: Scan this folder"; and CLI positional already supports a directory target.git diff --name-only <base>), for pre-commit / PR-sized scans.workspaceState) so a user can re-run "backend only" without re-typing globs.Surfaces
--changed [base]and--include <glob,glob>flags to mirror the sidebar.eco.scanIncludeGlobsallowlist as the underlying mechanism for path/preset scopes.Out of scope
Acceptance criteria
--changed/--include(or equivalent) mirroring the sidebar scopes.Context
Raised while validating cost accuracy across many repos — full-repo scans were the default friction. Related: scope-hygiene #137, calibration #138.