Skip to content

fix(exclude-patterns): enforce exclude_patterns in git indexer and dynamic edges#308

Merged
RaghavChamadiya merged 1 commit into
repowise-dev:mainfrom
joptimus:fix/exclude-patterns-git-indexer
May 30, 2026
Merged

fix(exclude-patterns): enforce exclude_patterns in git indexer and dynamic edges#308
RaghavChamadiya merged 1 commit into
repowise-dev:mainfrom
joptimus:fix/exclude-patterns-git-indexer

Conversation

@joptimus
Copy link
Copy Markdown
Contributor

What

Make exclude_patterns actually exclude files from the git indexer and from dynamic-edge graph construction.

Why

exclude_patterns was honored by file traversal but bypassed in two places (issues 1 and 2 of #296):

  1. The git indexer ran git ls-files and indexed every tracked file, so excluded paths still produced git metadata (churn, ownership, hotspots).
  2. Dynamic-edge creation added a graph node for any co-change/hint target, so excluded files reappeared as phantom nodes even though traversal skipped them.

How

  • GitIndexer accepts exclude_patterns and filters them out of git ls-files. Threaded through _run_git_indexing and the orchestrator's git stage (init path).
  • The incremental update path (_rebuild_graph_and_git) passes exclude_patterns to GitIndexer and filters changed paths via a new _build_filtered_changed_paths helper.
  • GraphBuilder accepts exclude_patterns; add_dynamic_edges no longer creates phantom nodes for excluded targets. Threaded into the ingestion pipeline phase and the update rebuild path.

All filtering uses pathspec (gitwildmatch), consistent with how traversal already applies exclude_patterns.

Tests

  • tests/unit/test_git_indexer.py::TestExcludePatterns: _get_tracked_files filters excluded paths and is a no-op without patterns.
  • tests/unit/cli/test_commands.py::TestBuildFilteredChangedPaths: changed-path filtering.
  • tests/unit/ingestion/test_graph.py::TestDynamicEdgeExcludeFilter: excluded dynamic-edge targets do not create phantom nodes; non-excluded targets still do.
  • Full ingestion + git-indexer + cli suites pass (874 passed, 2 xfailed).

This change is Python-only and does not touch packages/web.

Closes #296 (issues 1 and 2; the remaining issues 3 and 5 are separate follow-up PRs).

@joptimus
Copy link
Copy Markdown
Contributor Author

Part of the #296 exclude_patterns series.

Planned follow-up PRs:

  • Detect config/health-rules changes during repowise update and trigger a full health re-score (issue 3).
  • Add per-repo runtime exclude filtering to MCP tool responses (issue 5).

Keeping these separate so each stays focused and easy to review.

…namic edges

exclude_patterns was honored by file traversal but bypassed by the git indexer
and by dynamic-edge creation, so excluded files still appeared in git metadata
and as phantom graph nodes (issues 1 and 2 of repowise-dev#296).

- GitIndexer accepts exclude_patterns and filters them out of `git ls-files`;
  threaded through _run_git_indexing and the orchestrator git stage (init path).
- The incremental update path passes exclude_patterns to GitIndexer and filters
  changed paths via a new _build_filtered_changed_paths helper.
- GraphBuilder accepts exclude_patterns; add_dynamic_edges no longer creates
  phantom nodes for excluded targets. Threaded into the ingestion phase and the
  update rebuild path.

Tests: GitIndexer ls-files filtering, _build_filtered_changed_paths, and
dynamic-edge phantom-node skipping.

Closes repowise-dev#296 (issues 1 and 2)
@joptimus joptimus force-pushed the fix/exclude-patterns-git-indexer branch from 1b30ada to 80d89e1 Compare May 29, 2026 15:02
Copy link
Copy Markdown
Member

@RaghavChamadiya RaghavChamadiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RaghavChamadiya RaghavChamadiya merged commit f00e799 into repowise-dev:main May 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] exclude_patterns not fully enforced: git indexer and dynamic edges leak excluded files into graph/UI

2 participants