Skip to content

fix(merge): preserve repository-local identities#1691

Open
oleksii-tumanov wants to merge 2 commits into
Graphify-Labs:v8from
oleksii-tumanov:fix/lossless-multi-repo-merge
Open

fix(merge): preserve repository-local identities#1691
oleksii-tumanov wants to merge 2 commits into
Graphify-Labs:v8from
oleksii-tumanov:fix/lossless-multi-repo-merge

Conversation

@oleksii-tumanov

@oleksii-tumanov oleksii-tumanov commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep node IDs, hyperedges and existing community partitions distinct for each repository in merge-graphs
  • derive deterministic repository tags from input paths, including configured graph output dirs, and allow one explicit --repo-tag per input
  • carry forward valid repository-local hyperedges while pruning malformed entries or unknown members
  • leave persistent global add updates for a follow-up after this merge behavior is reviewed

Related to #585

Result

Relevant excerpt from the same orders and payments inputs (community and hyperedge fields condensed):

Before (v8)

Merged 2 graphs -> 4 nodes, 2 edges
orders communities: 0, 1
payments communities: 0, 1
hyperedges: []

Community IDs overlap, and both hyperedges are dropped.

After

Merged 2 graphs [orders, payments] -> 4 nodes, 2 edges, 2 hyperedges
orders communities: 0, 1
payments communities: 2, 3
orders::request_flow -> [orders::entry, orders::worker]
payments::request_flow -> [payments::entry, payments::worker]

Communities are disjoint and both repository-local hyperedges survive.

Testing

  • uv run --frozen pytest tests/test_merge_graphs_cli.py -q (12 passed)
  • uv run --frozen pytest tests/test_merge_graphs_cli.py tests/test_global_graph.py tests/test_hypergraph.py tests/test_build_merge_hyperedges_and_prune.py tests/test_export.py -q (98 passed)
  • uv run --frozen ruff check graphify/build.py graphify/cli.py tests/test_merge_graphs_cli.py (passed)
  • uv run --frozen graphify update . (rebuilt graph.json and GRAPH_REPORT.md; no tracked changes)

@oleksii-tumanov oleksii-tumanov force-pushed the fix/lossless-multi-repo-merge branch from 88f0574 to 35866d7 Compare July 10, 2026 04:15
@oleksii-tumanov

Copy link
Copy Markdown
Contributor Author

Rebased after the module-layout changes from #1737 and re-ran the repo guidance check:

  • uv run --frozen graphify update . rebuilt graph.json and GRAPH_REPORT.md; no tracked changes remained.

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.

1 participant