fix: forward source_ids/tags scope in AutoHypergraph.search - #90
Merged
yifanfeng97 merged 2 commits intoSep 6, 2026
Merged
Conversation
Owner
|
Merged — thanks for the catch! 🎯 Confirmed: This will ship in the next release. |
yifanfeng97
added a commit
that referenced
this pull request
Sep 6, 2026
Sweeping for the #90 pattern (scope accepted but silently dropped) found three more gaps: - AutoSet: track_sources was enabled on its memory but feed never recorded sources, so the ledger stayed empty forever — scoped search returned nothing, he tag / he feed change detection crashed with AttributeError, and the ledger was never persisted. AutoSet now records + persists its ledger (sources_items.json), supports document-level upsert, remove_source, tags, and scoped search. - Graph_RAG.search / Cog_RAG.search: overrides did not accept source_ids/tags, so he search --source/--tag on those KAs raised a raw TypeError. Both now accept and forward scope. - he search: scope flags on KA types without a ledger (AutoList/ AutoModel) now fail with a clear message instead of a TypeError. Tests: set provenance suite (recording, scoping, tags, upsert, persistence) + scope-forwarding coverage for both method overrides.
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
AutoHypergraph.search()declaressource_ids/tagsscope parameters (forhe search --source/--tag), but when it fans out to the per-type helpers it passes onlytop_k:search_nodes/search_edgesboth accept and forwardsource_ids/tags, so the scope machinery works — the top-levelsearch()just never hands it down. As a result a scoped hypergraph search silently returns unscoped results (no error). The siblingAutoGraph.search()forwards the scope correctly; hypergraph is the copy that lost it.Fix
Forward
source_ids=source_ids, tags=tagsto bothsearch_nodesandsearch_edges, matchingAutoGraph.search().Tests
tests/types/test_hypergraph_search_scope.py: spies on the helpers and assertssearch(query, source_ids=[...], tags=[...])forwards the scope to both. Fails on the pre-fix code.ruff check/ruff format --checkonhyperextractclean.