Skip to content

Commit a15c678

Browse files
authored
Merge pull request #98 from study8677/codex/skip-generated-scan-artifacts
Skip generated RepoBrain artifacts during scans
2 parents 2f452b2 + 8ee0d45 commit a15c678

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

engine/repobrain_engine/hub/_constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
".nuxt",
2727
"target",
2828
"vendor",
29+
".repobrain",
30+
"artifacts",
2931
})
3032
"""Superset of all previously duplicated ``_SKIP_DIRS`` definitions.
3133

engine/tests/test_hub_scanner.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,19 @@ def test_full_scan_skips_node_modules(tmp_path: Path) -> None:
6363
assert report.file_count == 1
6464

6565

66+
def test_full_scan_skips_generated_artifacts(tmp_path: Path) -> None:
67+
artifacts = tmp_path / "artifacts"
68+
artifacts.mkdir()
69+
(artifacts / "plan.md").write_text("# generated plan\n", encoding="utf-8")
70+
(tmp_path / "app.py").write_text("print('hi')\n", encoding="utf-8")
71+
72+
report = full_scan(tmp_path)
73+
74+
assert report.file_count == 1
75+
assert "artifacts/plan.md" not in report.file_metadata
76+
assert "app.py" in report.file_metadata
77+
78+
6679
def test_full_scan_top_dirs(tmp_path: Path) -> None:
6780
(tmp_path / "src").mkdir()
6881
(tmp_path / "tests").mkdir()
@@ -360,3 +373,22 @@ def test_extract_structure_skips_node_modules(tmp_path: Path) -> None:
360373
result = extract_structure(tmp_path)
361374
assert "node_modules" not in result
362375
assert "app.js" in result
376+
377+
378+
def test_extract_structure_skips_generated_state_and_artifacts(tmp_path: Path) -> None:
379+
"""Generated RepoBrain state and artifact files should not self-pollute."""
380+
rb_dir = tmp_path / ".repobrain"
381+
rb_dir.mkdir()
382+
(rb_dir / "structure.md").write_text("# previous structure\n", encoding="utf-8")
383+
artifacts = tmp_path / "artifacts"
384+
artifacts.mkdir()
385+
(artifacts / "plan.md").write_text("# generated plan\n", encoding="utf-8")
386+
(tmp_path / "src").mkdir()
387+
(tmp_path / "src" / "app.py").write_text("print('hi')\n", encoding="utf-8")
388+
389+
result = extract_structure(tmp_path)
390+
391+
assert ".repobrain" not in result
392+
assert "artifacts" not in result
393+
assert "src" in result
394+
assert "app.py" in result

0 commit comments

Comments
 (0)