Skip to content

Feature: scope a scan to a folder / changed files / active file instead of always the full repo #139

Description

@AndresL230

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)

  1. 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.
  2. Changed-files scope — scan only files changed vs. a base (git diff --name-only <base>), for pre-commit / PR-sized scans.
  3. Open / active file scope — scan just the active editor file or all open editors (fast inner-loop).
  4. 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

  • User can run a scan limited to a chosen folder from the sidebar and/or Explorer context menu.
  • User can run a scan limited to git-changed files.
  • CLI gains --changed/--include (or equivalent) mirroring the sidebar scopes.
  • Default behavior unchanged (full-repo scan) when no scope is chosen.
  • Chosen scope is reflected in the results header so the user knows the scan wasn't the whole repo.

Context

Raised while validating cost accuracy across many repos — full-repo scans were the default friction. Related: scope-hygiene #137, calibration #138.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions