detect() hard-includes <out>/memory/ and bypasses all ignore rules
Summary
detect() unconditionally appends <out>/memory/ to scan_paths and then exempts those files from every ignore mechanism, so saved query notes re-enter the corpus on every incremental update. There is no supported way to exclude them.
Evidence (graphifyy 0.9.63, installed from PyPI)
In graphify/detect.py:
- L1820-1824 — the dir is appended to
scan_pathsunconditionally:# Always include graphify-out/memory/ - query results filed back into the graph memory_dir = root / GRAPHIFY_OUT / "memory" ... if memory_dir.exists(): scan_paths.append(memory_dir) - L1848 / L1859 —
in_memory_treeskips the ignore-aware dir pruning. - L1932-1938 —
in_memoryskips both noise filtering and_ignored_for_scan(p), so.gitignoreand.graphifyignorenever apply:in_memory = memory_dir.exists() and str(p).startswith(str(memory_dir)) if not in_memory: ... if not in_memory and _ignored_for_scan(p):
Meanwhile --memory-dir only redirects writes (save-result/reflect) — it does not change the scan root, so pointing memory elsewhere still leaves the hard-include watching <out>/memory/.
Impact
Running graphify save-result (or any flow that writes <out>/memory/) followed by graphify --update re-ingests the tool's own query notes. In our repo this added 62 "Query Memory" nodes and ~10 communities of self-referential noise; the only workaround is keeping <out>/memory/ absent entirely (or redirecting memory writes outside the output dir).
Suggested fix
Any of these closes the hole:
- Honor
_ignored_for_scaninside the memory dir (drop thein_memoryexemptions), so a.graphifyignore//memoryentry works; or - Gate the hard-include behind a flag (e.g.
graphify detect --include-memory), default off; or - Resolve the scan path from the same
--memory-diroption used for writes, so relocating memory actually relocates the scan.
Option 1 is the least surprising: users expect ignore files to be authoritative.
Source: Graphify-Labs/graphify