UCD.js Docs

Pipeline Graph

Architecture notes for @ucdjs/pipeline-graph

@ucdjs/pipeline-graph builds graph representations of pipeline definitions for analysis and visualization.

Role

  • Converts sources, files, routes, and outputs into graph nodes and edges.
  • Supports server/UI features that inspect pipeline topology and execution structure.
  • Keeps graph-building logic out of the executor and UI layers.

Mental Model

This package is a view-model builder for pipelines.

The core builder turns four kinds of entities into nodes:

  • source/version nodes
  • file nodes
  • route nodes
  • output nodes

Edges describe how data moves between them.

Method Flows

Graph builder lifecycle

PipelineGraphBuilderPipelineGraphBuilderCallercreatePipelineGraphBuilder()addSourceNode(version)addFileNode(file)addRouteNode(routeId, version)addOutputNode(outputIndex, version, ...)addEdge(from, to, type)build(){ nodes, edges }Caller

Node creation rules

PipelineGraphBuilderPipelineGraphBuilderCalleraddSourceNode("16.0.0")source:16.0.0addFileNode(file)file:16.0.0:pathaddRouteNode("general-category", "16.0.0")route:16.0.0:general-categoryaddOutputNode(0, "16.0.0", property, outputId, locator)output:16.0.0:<qualified-id>Caller

Deduplicated edge building

PipelineGraphBuilderPipelineGraphBuilderalt[key already seen][new edge]CalleraddEdge(from, to, type)compute edge key from|to|typeignore duplicateedge storedCaller

Design Notes

  • Node IDs are deterministic so multiple graph passes can merge or compare safely.
  • Output nodes can carry richer metadata like property names, output IDs, and locators.
  • The builder is mutable during construction but returns plain graph data on build().
  • This package stays intentionally narrow: graph modeling, not execution or layout physics.

Testing Use

  • stable node ID generation
  • edge deduplication
  • output-node metadata merging
  • server/UI graph conversion utilities on top of the raw builder

On this page