Keep opposite relationship directions distinct in graph paths - #822
Merged
WaylandYang merged 3 commits intoSep 20, 2026
Merged
Conversation
Signed-off-by: dada-yan <BinjunYann@gmail.com>
Signed-off-by: dada-yan <BinjunYann@gmail.com>
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
With both
A —supplies→ BandB —supplies→ A,paths_between(A, B)returned only one path. Its final deduplication key contained the nodes and predicate labels, so two different relationship directions collided. The authenticated MCP output consequently lost one arrow.Change
Include each edge's direction relative to its preceding path node in the existing deduplication key. Same-direction duplicate observations still collapse. Candidate generation, ranking, time filters, entity ownership replay, hub limits, and budgets are unchanged.
Validation
Linux, dedicated PostgreSQL/pgvector,
UTOPIA_TEST_REQUIRE_DB=1:-D warnings), workspace tests and build pass: 940 passed, 0 failed, 1 ignored live-public-HTTPS test.This can make previously omitted directional paths visible and occupy existing result slots. No storage migration, write-path, relation identity, or inference change. Reverting changes future query results only.
Combined regression verification
All five independent fixes merge cleanly onto the same dev baseline. On the combined Linux branch, format, workspace Clippy, build and the full test suite pass (952 passed, 0 failed, 1 explicitly ignored live-public-HTTPS test). A shared authenticated RDF fixture verifies unbound values, subsecond history and explicit ontology links together in Turtle and JSON-LD. Removing each fix individually makes its regression fail again; restoring all fixes returns the full suite to 952 passing tests. No database migration or historical rewrite is included.