Skip to content

Keep opposite relationship directions distinct in graph paths - #822

Merged
WaylandYang merged 3 commits into
deeplethe:devfrom
Maya-Kid:codex/preserve-path-directions
Sep 20, 2026
Merged

WaylandYang merged 3 commits into
deeplethe:devfrom
Maya-Kid:codex/preserve-path-directions

Conversation

@Maya-Kid

@Maya-Kid Maya-Kid commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Problem

With both A —supplies→ B and B —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:

  • Baseline store and authenticated MCP regressions each fail specifically because one direction is missing.
  • Fixed store path suite: 5 passed. Checks include 1–3 hops, reverse endpoints, same-direction duplicates, confidence preference, max_paths, KB isolation, fixed at/as_of, retraction, and unchanged stored facts.
  • Authenticated MCP test preserves both rendered arrows and verifies business rows are unchanged.
  • Format, workspace Clippy (-D warnings), workspace tests and build pass: 940 passed, 0 failed, 1 ignored live-public-HTTPS test.
  • Unchanged frontend tree: reused the freshly verified T2 frontend checks (91 tests and build).

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.

@WaylandYang
WaylandYang merged commit ae5ef12 into deeplethe:dev Sep 20, 2026
4 checks passed
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.

2 participants