Skip to content

[Indexer] Exclude nested worktrees from source discovery #98

Description

@samchon

Problem

Source discovery descends nested agent worktrees and other nested repositories. In the current graph and ttsc checkouts, maxFiles: 5 selected five .claude/worktrees/** files and no source from the checkout being indexed. Uncapped runs merge foreign branches into one graph.

Root cause

walkSourceFiles excludes a fixed directory list but does not stop at nested VCS/worktree roots. .claude/worktrees is not ignored, and cleanup cannot prevent it from reappearing.

Consequence surface

Static/LSP input sets, language discovery, max-file caps, resident freshness, dogfood, real-server experiments, and benchmark fixture isolation can all describe a different checkout from the requested root.

Acceptance

  • Exclude nested worktree and repository roots before sorting, capping, hashing, or language discovery; provide an explicit opt-in for intentionally vendored repositories.
  • Cover .claude/worktrees, a generic nested .git file/directory marker, static, LSP, resident refresh, mixed languages, capped and uncapped walks.
  • Preserve ordinary dependency-directory policy and deterministic source ordering.
  • Pass build, focused/full tests, coverage, and the zero-spend benchmark preflight before remeasurement.

Related: #60, #63, #67, #93.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions