Skip to content

fix(detect): honor .graphifyignore for the memory tree (fixes #2267) - #2272

Open
Munawarx wants to merge 1 commit into
Graphify-Labs:v8from
Munawarx:munawarx/fix-memory-ignore-2267
Open

fix(detect): honor .graphifyignore for the memory tree (fixes #2267)#2272
Munawarx wants to merge 1 commit into
Graphify-Labs:v8from
Munawarx:munawarx/fix-memory-ignore-2267

Conversation

@Munawarx

Copy link
Copy Markdown

Problem

.graphifyignore patterns are silently bypassed for graphify-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.py the ignore check is guarded:

if not in_memory and _is_ignored(p, root, ignore_patterns, _cache=ignore_cache):
    ignored.append(str(p)); continue

The not in_memory condition 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_memory guard so _is_ignored applies 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

  • Added test_graphifyignore_excludes_memory_tree in tests/test_detect.py (matches existing style, uses tmp_path).
  • Verified the test FAILS on the unfixed code and PASSES with the fix.
  • Regression: with no .graphifyignore, memory is still ingested (default loop intact).
  • Edge cases checked: parent pattern graphify-out/, nested proj/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

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

graphify-out/memory/ cannot be excluded from the corpus — .graphifyignore is bypassed for it and there is no opt-out

1 participant