Skip to content

Conversation

@SimonHeybrock
Copy link
Member

@SimonHeybrock SimonHeybrock commented Jan 13, 2026

Summary

  • Add StreamProcessor.visualize() method that post-processes sciline's visualization to highlight streaming-specific node classifications
  • Node categories shown: static (gray), dynamic keys/nodes (green), context keys/dependent (blue), accumulators (orange cylinder), finalize nodes (lavender), targets (double border)
  • Include optional legend explaining the color scheme
screenshot-latest

Test plan

  • Added 22 tests in tests/streaming_visualize_test.py covering:
    • Node classification logic (_classify_nodes)
    • Key formatting for graphviz
    • Style merging and priority handling
    • Integration tests for visualize()

🤖 Generated with Claude Code

Add visualization support that displays the workflow graph with node
classification styling to help understand the streaming data flow:

- Static nodes (gray): Pre-computed once, cached
- Context keys/nodes (blue): Input entry points and cached dependents
- Dynamic keys/nodes (green): Chunk inputs and per-chunk computations
- Accumulator keys (orange cylinder): Aggregation points
- Finalize nodes (lavender): Computed from accumulators
- Target keys (double border): Final outputs

The method stores the base workflow during __init__ to show the full
graph including pre-computed static subgraphs. Dynamic and context
keys are styled with black borders to override sciline's red "unsatisfied"
styling since these are intentional stream inputs.

---

Prompt: develop an understanding of StreamProcessor, then think about how
we can make an equivalent to sciline.Pipeline.visualize, highlight specifics
of the wrapping StreamProcessor - where are accumulators, which are dynamic
inputs, which nodes are cached and which are downstream of dynamic and thus
recomputed?
@SimonHeybrock SimonHeybrock changed the title Add StreamProcessor.visualize() method with tests Add StreamProcessor.visualize() method Jan 13, 2026
- Unify _find_descendants and _find_graph_descendants into a single
  function that accepts either Pipeline or DiGraph
- Convert _classify_nodes_for_visualization to a method _classify_nodes
  on StreamProcessor for cleaner access to instance attributes
- Add comprehensive tests for visualization in streaming_visualize_test.py

Prompt: Please carefully think through and review the implementation of
StreamProcessor.visualize. Could it be written in a better way, e.g., by
relying more on what StreamProcessor already does in __init__ (node
classification, ...)?

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@SimonHeybrock SimonHeybrock force-pushed the add-stream-processor-visualize branch from 23a5dc1 to 5ea0769 Compare January 13, 2026 12:48
- Exclude nodes unreachable from target_keys (unrelated branches)
- Show full static subgraph including nodes upstream of input keys
- Build visualization workflow once in constructor for consistency
- Classify nodes based on actual visualized graph to ensure all
  visible nodes are properly styled

Prompt: StreamProcessor.visualize currently seems to show the full graph,
even parts/nodes unreachable/unused by computing the given targets.
Also fixes: visualization shows nodes upstream of input keys (dynamic_keys,
context_keys). Also fixes: some root nodes appearing unstyled/white.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

2 participants