fix(detect): honor .graphifyignore for the memory tree (fixes #2267) - #2272
Open
Munawarx wants to merge 1 commit into
Open
fix(detect): honor .graphifyignore for the memory tree (fixes #2267)#2272Munawarx wants to merge 1 commit into
Munawarx wants to merge 1 commit into
Conversation
…y-Labs#2267) The memory tree (graphify-out/memory/, where saved Q&A results are filed back into the graph) was exempt from the ignore check, so a user could never exclude their own Q&A output from the corpus. detect.py guarded the _is_ignored call with 'not in_memory', silently bypassing user patterns. Remove the guard so ignore patterns apply to the memory tree like every other path. Default behavior (memory included unless explicitly ignored) is preserved. Adds a regression test (test_graphifyignore_excludes_memory_tree) matching the existing tests/test_detect.py style. Fixes Graphify-Labs#2267
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
.graphifyignorepatterns are silently bypassed forgraphify-out/memory/, so users cannot exclude their own saved Q&A output from the corpus. The tree gets re-ingested on every run and node counts grow for reasons unrelated to the source tree.Root cause
In
graphify/detect.pythe ignore check is guarded:The
not in_memorycondition means user ignore patterns never apply to the memory tree. This is issue #2267, Option 1 (the maintainer-friendly fix the reporter requested).Solution
Remove the
not in_memoryguard so_is_ignoredapplies to the memory tree like every other path. Default behavior is unchanged: memory is still ingested unless explicitly ignored.As a side benefit, the hidden/noise filter (which also keyed off
in_memory) now correctly applies to the memory tree, so stray dotfiles dropped there are no longer unconditionally picked up.Testing
test_graphifyignore_excludes_memory_treeintests/test_detect.py(matches existing style, usestmp_path)..graphifyignore, memory is still ingested (default loop intact).graphify-out/, nestedproj/graphify-out/memory/, and negation patterns behave correctly.Expected impact
Users can finally scope the graph to the source tree only. Removes silent config-ignored behavior.
Fixes #2267