Skip to content

global add: re-adding one repo deletes other repos' cross-repo edges (prune removes shared external nodes; hash gate never restores) (PE-80066) #89

Description

@filipechagas

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions