Skip to content

Commit b269c60

Browse files
fix: filter venv/cache/build noise from changed files, reindex all commits
Added _is_noise() filter to core/diff_reader.py to strip venv/, node_modules/, __pycache__/, .pyc and other build artifacts from the changed files list before they reach the LLM or appear in the build log. Imported the same filter in scripts/reindex.py and reindexed all commits — ffaff32 (the venv leak commit) now shows 3 clean files instead of 688+ noise entries. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f1f2e97 commit b269c60

4 files changed

Lines changed: 322 additions & 2280 deletions

File tree

core/diff_reader.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
import subprocess
22

3+
# Directory prefixes that are never meaningful to track as feature files.
4+
# These are dependency/build/cache directories that can appear in diffs
5+
# when .gitignore wasn't set up yet or was misconfigured.
6+
_NOISE_PREFIXES = (
7+
"venv/",
8+
".venv/",
9+
"env/",
10+
".env/",
11+
".gitmind/venv/",
12+
"node_modules/",
13+
"__pycache__/",
14+
".mypy_cache/",
15+
".pytest_cache/",
16+
".tox/",
17+
"dist/",
18+
"build/",
19+
".eggs/",
20+
"*.egg-info/",
21+
)
22+
23+
_NOISE_SUFFIXES = (".pyc", ".pyo", ".pyd")
24+
25+
26+
def _is_noise(path: str) -> bool:
27+
for prefix in _NOISE_PREFIXES:
28+
if path.startswith(prefix) or ("/" + prefix) in ("/" + path):
29+
return True
30+
for suffix in _NOISE_SUFFIXES:
31+
if path.endswith(suffix):
32+
return True
33+
return False
34+
335

436
def _is_first_commit() -> bool:
537
result = subprocess.run(
@@ -34,7 +66,7 @@ def get_changed_files() -> list[str]:
3466
raw = result.stdout.strip()
3567
if not raw:
3668
return []
37-
return [f for f in raw.split("\n") if f.strip()]
69+
return [f for f in raw.split("\n") if f.strip() and not _is_noise(f)]
3870

3971

4072
def get_commit_message() -> str:

0 commit comments

Comments
 (0)