Skip to content

Fix: Relay Topology Collapse and Neutral Stream Layout#3

Merged
griffinmilsap merged 6 commits into
devfrom
fix/relay-dashboard-collapse
Apr 30, 2026
Merged

Fix: Relay Topology Collapse and Neutral Stream Layout#3
griffinmilsap merged 6 commits into
devfrom
fix/relay-dashboard-collapse

Conversation

@griffinmilsap
Copy link
Copy Markdown
Contributor

Summary

This branch updates the dashboard to treat relay internals as implementation details rather than first-class topology nodes. Internal __relays__ topics are collapsed back to their public collection endpoints across the topology view, profiling view, and trace-highlighting logic. The result is a cleaner graph that still preserves relay behavior for routing and trace control.

It also reworks neutral collection stream rendering. Input and output streams remain anchored to collection boundaries because their semantics are directional, while neutral topics and neutral relays are treated as collection content where appropriate. In scoped collection views, neutral streams are now free-floating layout participants so their placement can be driven by the graph structure instead of a hard-coded boundary lane.

Finally, this branch fixes a stale-topology bug where shutting down the last running graph could leave a cached top-level system visible until the page was refreshed.

What Changed

Topology model and aliasing

  • Extended topology parsing to capture relay metadata, including relay type and internal input/output topics.
  • Added relay alias maps so internal relay topics resolve back to the visible collection endpoint topic.
  • Updated root-scope ownership logic so collections with relay/topic metadata still classify correctly even when their children list is empty.
  • Extended active-trace canonicalization so relay activity highlights the visible stream rather than the internal __relays__ topic.

Topology rendering

  • Rewrote flow generation so relay internal edges are collapsed before layout and self-bridging relay edges are removed from the visible graph.
  • Unified collection-level neutral stream handling so neutral topics and neutral relays share the same placement semantics.
  • Split neutral styling by kind:
    • neutral topics use the collection-topic palette
    • neutral relays use the collection-relay palette
  • In scoped collection views, neutral streams are rendered as content nodes instead of boundary pins, allowing the layout engine to place them where they reduce visual clutter.
  • Fixed the empty-topology cache path so removing the last graph clears the canvas immediately instead of reusing stale flow data.

Profiling and trace control

  • Normalized relay publisher and subscriber topics in the profiling UI so rows display public endpoint topics instead of raw relay internals.
  • Added display endpoint IDs that preserve the endpoint token while collapsing the topic portion for the UI.
  • Updated trace-control behavior so relay publisher tracing keys off publisher_endpoint_id, while downstream subscriber scope continues to follow the visible topic.

Tests and packaged assets

  • Added regression coverage for:
    • relay internal topic collapse
    • collection ownership for relay-backed topics
    • neutral topic/relay lane behavior and styling expectations
  • Regenerated the packaged frontend bundle under src/ezmsg/dashboard/_web/.

Ancillary updates

  • Updated docs/development.md to use uv run pytest tests/backend -q in the frontend packaging workflow.
  • Updated pyproject.toml to source ezmsg from the local ../ezmsg checkout for this branch.
  • frontend/package-lock.json reflects a postcss patch-version refresh.

Testing

  • Added and updated frontend unit tests in:
    • frontend/src/components/topologyGraph.test.ts
    • frontend/src/components/topologyFlowData.test.tsx
  • Frontend package artifacts were rebuilt for the Python package bundle.
  • Manual validation on this branch included exercising the relay path with ../ezmsg/examples/ezmsg_toy.py and confirming that relay rendering and profiling behavior matched the intended collapsed view.

Notes for Review

The highest-risk area is the interaction between relay-topic aliasing and profiling trace control, because the backend still reasons about raw relay publisher endpoints while the dashboard now prefers collapsed public topics for presentation. The current implementation keeps those responsibilities separate: display uses canonicalized public topics, while publisher trace control uses the concrete endpoint identifier expected by the backend.

@griffinmilsap griffinmilsap merged commit a01b717 into dev Apr 30, 2026
11 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.

1 participant