universe
universe::Adapter Adapts a resolved model into the software graph: keeps only the structural nodes, hooks each to its structural parent for the containment tree, and lifts every call to the structural level — tallying directed traffic per caller→callee pair so the edge carries direction.
Parent
Inbound
- call universe::Universe · build
- call universe::Universe · fromModel
Outbound
- call → model::Model · graph
- from → universe::GraphNode
- from → universe::SoftwareGraph
Scenarios
Only structural nodes enter the graph; data and callables do not.
- given a resolved model with systems, containers, components, data, and callables
- when the model is adapted into the software graph
- then every system, container, component, and person becomes a graph node
- but data and callables are not placed
Calls lift to the structural level and tally as directed traffic.
- given a call from one component's body into another node
- when relationships are collected
- then the call lifts to the nearest enclosing structural node on each end
- and repeated calls between the same pair sum into one directed edge's traffic
- but a call that lifts to the same node on both ends is dropped
Containment is a tree rooted at the top-level systems.
- given a system holding containers that hold components
- when the graph is built
- then each node records its enclosing parent and the ids it contains
- and the top-level systems are the containment roots, in declaration order
universe::C4Level The C4 abstraction level a node sits at. Only these four enter the graph; data and callables do not — a relationship through them is lifted to the nearest enclosing structural node.
universe::EdgeOut One relationship in the flat snapshot, with its traffic (call count).
Inbound
- from universe::Flatten
universe::Flatten Flattens the software graph into the renderer-facing snapshot: each node's id, level string, and parent id; each relationship's endpoints and traffic. The boundary the web IDE reads — petgraph indices never cross it.
Parent
Inbound
- call universe::Universe · snapshot
Outbound
- from → universe::NodeOut
- from → universe::EdgeOut
Scenarios
The snapshot is deterministic and free of engine internals.
- given the same software graph flattened twice
- when the snapshots are compared
- then nodes and edges appear in the same stable order both times
- but no petgraph index or other engine internal crosses the boundary
universe::FlowDef One entry-point flow: the entry callable's FQN and simple name, the flow's palette colour, and its ordered legs. The renderer draws one filament chain per flow and streams its beads in the flow's colour.
Inbound
- from universe::Universe
universe::FlowHop One call leg of a flow: the caller and callee as structural node ids (the same ids the snapshot places), plus the message label shown on the leg.
Inbound
- from universe::FlowTracer
universe::FlowTracer Traces every entry-point flow: a triggered callable (or a person-owned action) starts a flow; its sequence projection is walked call-by-call and each leg's endpoints lift to the nearest placed structural node — the same lift the Adapter applies to relationships, so flows and edges agree. Colours key from the entry's FQN by a stable hash into a fixed palette — the same keying the web IDE paints with — so a flow keeps its hue everywhere it appears and an unrelated model edit never recolours it.
Parent
Inbound
- call universe::Universe · flows
Outbound
- from → model::GraphNode
- call → emit::Emit · project
- from → universe::FlowHop
Scenarios
A triggered callable or a person-owned action starts a flow.
- given a model with trigger-macro callables and person-owned actions
- when flows are traced
- then each triggered callable and each person-owned callable yields one flow
- and entries are ordered by FQN so the set is stable
Flow legs land on the structural nodes the renderer places.
- given a flow whose calls land on components and callables
- when its hops are traced
- then each leg's caller and callee lift to the nearest placed structural node
- but a leg whose ends lift to the same node, or fail to lift, is dropped
Flows are deterministic: same model, same flows, same colours.
- given the same model traced twice
- when the flow sets are compared
- then flows, hops, and colours are identical
- and a colour keys from its entry's FQN, so an unrelated model edit never recolours a flow
universe::GraphNode A structural node in the software graph: its stable model FQN, its C4 level, and its place in the containment tree (the enclosing node, empty for a top-level system, and the ids it contains). No position — the renderer places it.
Inbound
- from universe::Adapter
universe::NodeOut One node in the flat snapshot: its id, C4 level as a lowercase string, and the id of its containment parent (empty for a top-level system).
Inbound
- from universe::Flatten
universe::Relationship A directed relationship between two structural nodes, weighted by `traffic` — the number of underlying calls lifted onto the pair. Self-relationships are dropped; the count drives the renderer's flow animation.
universe::Snapshot The flat, serialisable contract the web IDE's `ForceGraph` consumes: nodes and directed weighted edges, with no engine internals (petgraph indices) leaking across the boundary. Positions are not here.
Inbound
- from universe::Universe
universe::SoftwareGraph The software graph: structural nodes with the containment tree, directed relationship edges weighted by traffic, and the top-level systems (the containment roots, in model-declaration order). The crate's in-memory form, before flattening to a renderer-facing `Snapshot`.
Inbound
- from universe::Universe
- from universe::Adapter
universe::Universe `crates/pseudoscript-universe`. Maps the resolved C4 model into the software graph the 3D view renders, then flattens it to a determinstic snapshot.
Parent
Inbound
- call doc::Pages · fromModel
- call doc::Pages · snapshot
- call doc::Pages · flows
- call ide::Universe · build
- call ide::Universe · snapshot
- call ide::Universe · flows
Outbound
- from → universe::Snapshot
- from → universe::FlowDef
- from → universe::SoftwareGraph
- call → universe::Adapter · build
- call → universe::Adapter · fromModel
- call → universe::Flatten · snapshot
- call → universe::FlowTracer · flows
Scenarios
Layout is the renderer's job, not this crate's.
- given a software-graph snapshot
- when the web IDE renders the 3D view
- then d3-force-3d assigns every node a position in the browser
- but the crate carries no coordinates — it is pure structure and traffic