generated from coulomb/repo-seed
Ignore runtime var during repository scans
This commit is contained in:
@@ -114,6 +114,34 @@ def test_scanner_javascript_typescript_package_records_package_facts(tmp_path):
|
||||
assert ("test", "routes.spec.ts", "src/api/routes.spec.ts") in facts
|
||||
|
||||
|
||||
def test_scanner_ignores_runtime_var_checkouts(tmp_path):
|
||||
repo = tmp_path / "repo-scoping-like"
|
||||
repo.mkdir()
|
||||
(repo / "README.md").write_text("# Repo Scoping\n", encoding="utf-8")
|
||||
checkout = repo / "var" / "checkouts" / "llm-connect"
|
||||
checkout.mkdir(parents=True)
|
||||
(checkout / "README.md").write_text(
|
||||
"# LLM Connect\nSupports OpenRouter fallback.\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
(checkout / "providers.py").write_text(
|
||||
"provider_registry = {'openrouter': OpenRouterAdapter}\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
result = DeterministicScanner().scan(repo)
|
||||
|
||||
facts = {(fact.kind, fact.name, fact.path) for fact in result.facts}
|
||||
assert result.file_count == 1
|
||||
assert ("documentation", "README", "README.md") in facts
|
||||
assert all(not fact.path.startswith("var/") for fact in result.facts)
|
||||
assert (
|
||||
"llm_provider",
|
||||
"OpenRouter",
|
||||
"var/checkouts/llm-connect/README.md",
|
||||
) not in facts
|
||||
|
||||
|
||||
def test_scanner_records_llm_provider_and_fallback_facts(tmp_path):
|
||||
repo = tmp_path / "llm-connect-like"
|
||||
repo.mkdir()
|
||||
|
||||
Reference in New Issue
Block a user