Render fan-in inputs as source-derived identifiers in the definition view #44
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
In the composite definition view, a leaf with more than one wired input
slot renders its slots as positional stubs in the node label:
[Sub(#A,#B)](
crates/aura-cli/src/graph.rs:182-183,leaf_label).#Ais the targetslot index turned into a letter; it carries no information about where the
value comes from. When several edges fan into the node, a reader cannot tell
which producer feeds
#Aand which feeds#B.The positional letter is the wrong handle. The question a reader asks is
"where does this input come from", and that is answerable from the source
node itself.
Rule
Replace the positional letter with a source-derived identifier, shown in
slot order in the node label:
[Sub(#id0, #id1)].[price]) uses the role'sexisting name verbatim:
#price. A name that already exists is neverre-coined.
that node's render label: the initial of each label component (type-name
initial, capitalized, plus one lowercase initial per shown param alias;
a nested composite uses its name initial).
EMA(slow)->#Es.Uniqueness is scoped to a single node-call: only the sibling inputs of
one node must be collision-free. Two inputs of different nodes may share an
identifier -- an identifier is always read relative to its own
(...), so#Esat oneSuband#Esat another are not confusable.component, prefix-free) only as far as that node-call's own siblings force
it. It is therefore not a stable node id: the same source may render
#Efat one node and
#Eat another, depending on the siblings it mustseparate from there.
Sub(X, X)):not resolvable by lengthening, falls back to a counter suffix.
input slot. A single-input node shows no identifier.
Worked example: MACD
Structure:
line = EMA(fast) - EMA(slow),signal = EMA(signal)of theline,
hist = line - signal. The two multi-input nodes are the twoSubs:Both Subs carry an
#Es, but the first means EMA(slow) and the secondEMA(signal) -- each unambiguous within its own node-call. Because the
namespace is per-node-call (not composite-global),
slowandsignalnevercollide (they never feed the same node), so neither needs lengthening past
its initials.
Edge labels: dropped
The earlier version of this issue proposed labelling the fan-in edges with
the slot letter via ascii-dag's
add_edge(.., Some(label)). Withsource-derived identifiers that is unnecessary: the identifier already names
its source, and the source node is visible in the graph. No edge labels are
introduced --
render_flatkeeps passingNone(
crates/aura-cli/src/graph.rs:85) and ascii-dag's edge-label / collisionbehaviour stays untouched. The whole change is local to
leaf_label.Acceptance
#-prefixedidentifier in slot order, replacing the positional
#A/#B.#price); nonew identifier is coined when a name already exists.
that node's label (type initial + one per shown param alias; composite
-> name initial) that is unique among that node's sibling inputs.
require (per-node-call namespace, not composite-global); prefix-free.
slot).
render_flatstill passesNone.MACD-like fixture (two EMAs feeding one Sub, that Sub feeding another).
Label fan-in edges with their slot letter in the composite definition viewto Render fan-in inputs as source-derived identifiers in the definition view