Found while instrumenting Brain to query the merged global graph for PE-80066 (https://lawnstarter.atlassian.net/browse/PE-80066). Fork v8 @ 5e9d95c11837aeabbbb5d90cb45544f49dc58ca4 (CLI 0.9.40).
Summary
Re-adding one repo to the global graph deletes other repos' cross-repo edges. global add prunes a repo before re-adding it, and prune_repo_from_graph (graphify/build.py:1939-1943) removes every node carrying that tag plus every incident edge. A shared external node carries the tag of whichever repo contributed it first, so re-adding that repo destroys every other repo's edges into the shared node — and a repo whose own graph is unchanged is skipped by the hash gate and never puts them back.
Measured (12-repo merged graph)
- A rebuild that re-added 9 of 12 repos took the merged graph from 6,349 cross-repo links to 3,602.
- The demo node
Lawnstarter\API\Client dropped from degree 30 to degree 5.
- Interleaving remove-then-add per repo does not fix it: that pass left partners-api with 0 of its 15 edges, because partners-api had attached to a shared node that properties-api's later removal pruned.
Workaround
Purge every tag first, then add all repos (a full rebuild). Brain's scripts/graphify/build-global-graph.py ships this as --rebuild-all; after that pass the demo node is back to degree 30 with all three contributing repos present.
Why it matters
The natural incremental workflow — "repo X changed, global add its new graph" — silently corrupts the merged graph a little more on every run, and the damage lands on repos other than the one being updated.
Found while instrumenting Brain to query the merged global graph for PE-80066 (https://lawnstarter.atlassian.net/browse/PE-80066). Fork
v8@5e9d95c11837aeabbbb5d90cb45544f49dc58ca4(CLI 0.9.40).Summary
Re-adding one repo to the global graph deletes other repos' cross-repo edges.
global addprunes a repo before re-adding it, andprune_repo_from_graph(graphify/build.py:1939-1943) removes every node carrying that tag plus every incident edge. A shared external node carries the tag of whichever repo contributed it first, so re-adding that repo destroys every other repo's edges into the shared node — and a repo whose own graph is unchanged is skipped by the hash gate and never puts them back.Measured (12-repo merged graph)
Lawnstarter\API\Clientdropped from degree 30 to degree 5.Workaround
Purge every tag first, then add all repos (a full rebuild). Brain's
scripts/graphify/build-global-graph.pyships this as--rebuild-all; after that pass the demo node is back to degree 30 with all three contributing repos present.Why it matters
The natural incremental workflow — "repo X changed,
global addits new graph" — silently corrupts the merged graph a little more on every run, and the damage lands on repos other than the one being updated.