diff --git a/graphify/detect.py b/graphify/detect.py index 95a26013..23e9198b 100644 --- a/graphify/detect.py +++ b/graphify/detect.py @@ -808,6 +808,7 @@ _SKIP_DIRS = { ".next", ".nuxt", ".turbo", ".angular", ".idea", ".cache", ".parcel-cache", ".svelte-kit", ".terraform", ".serverless", ".graphify", # graphify's own extraction cache — never index self-generated data + ".obsidian", ".smart-env", # Obsidian vault metadata and plugin caches (#2493) ".worktrees", # git worktree convention (#947) — sibling checkouts, always redundant } diff --git a/tests/test_detect.py b/tests/test_detect.py index 576837a2..2c6cc177 100644 --- a/tests/test_detect.py +++ b/tests/test_detect.py @@ -76,6 +76,25 @@ def test_detect_skips_noise_dot_dirs(): assert noise not in f +def test_detect_skips_obsidian_vault_metadata_dirs(tmp_path): + """Obsidian metadata and plugin caches are not part of the source corpus (#2493).""" + for directory in (".obsidian", ".smart-env"): + metadata_dir = tmp_path / directory + metadata_dir.mkdir() + (metadata_dir / "state.json").write_text("{}") + trash_dir = tmp_path / ".trash" + trash_dir.mkdir() + (trash_dir / "state.json").write_text("{}") + (tmp_path / "project.json").write_text("{}") + + result = detect(tmp_path) + + assert result["files"]["code"] == [ + str(trash_dir / "state.json"), + str(tmp_path / "project.json"), + ] + + def test_classify_md_paper_by_signals(tmp_path): """A .md file with enough paper signals should classify as PAPER.""" paper = tmp_path / "paper.md"