Skip to content

Prune uploaded and pasted graphs correctly - #73

Merged
Ianyliu merged 3 commits into
mainfrom
agent/fix-issue-5-graph-pruning
Jul 26, 2026
Merged

Prune uploaded and pasted graphs correctly#73
Ianyliu merged 3 commits into
mainfrom
agent/fix-issue-5-graph-pruning

Conversation

@Ianyliu

@Ianyliu Ianyliu commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • retain each tab's original source, render options, and presentation state
  • re-render uploaded and pasted DOT through /api/graphs/render when pruning
  • keep default Terraform-project pruning on its compatibility endpoints
  • make upstream/downstream traversal cycle-safe
  • preserve an isolated selected node
  • add backend and Node browser-state regressions for cycles, multiple tabs, uploads, pastes, and option retention
  • document selection followed by the red prune action

Root Cause

Uploaded and pasted tabs kept their initial SVG and JSON objects in closure arguments. The prune handler requested a focused graph, but then immediately overwrote that response with the stale upload objects. The graph traversal also queued cyclic nodes indefinitely and only retained a selected node when it had an edge.

User Impact

Prune now operates on the graph visible in the selected tab—not the mounted Terraform project or an earlier rendering. Cyclic graphs terminate safely, isolated resources remain visible, and separate tabs cannot overwrite each other's source or options.

Validation

  • /tmp/blast-radius-plan-venv/bin/python -m pytest -q — 21 passed, 7 subtests passed
  • node --test tests/frontend/*.test.js — passed
  • node --check blastradius/server/static/js/blast-radius.js
  • real cyclic DOT render/refocus through the API — HTTP 200, two nodes and two edges
  • git diff --check main...HEAD
  • Windows wheel workflow now runs the Node browser-state regression

Compatibility

Default project graphs continue to use /graph.svg and /graph.json. Uploaded and pasted graphs use the render API introduced for #45. Existing tab, search, selection, and prune controls retain their behavior and presentation.

Fixes #5

Copilot AI review requested due to automatic review settings July 26, 2026 04:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Ianyliu
Ianyliu merged commit 6e3246e into main Jul 26, 2026
5 checks passed
@Ianyliu
Ianyliu deleted the agent/fix-issue-5-graph-pruning branch July 26, 2026 04:05
@Ianyliu Ianyliu mentioned this pull request Jul 26, 2026
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.

Inability to prune graph

2 participants