feat(aura-cli): de-prefix input-role markers ([in:price] -> [price])
Symmetric with the output de-prefix shipped in 2f49165: the composite
definition render now shows input roles as bare [<name>] markers, matching
the [<name>] outputs. One-token change in render_definition's input-role
loop (format!("in:{}", role.name) -> role.name.clone()); the two render
doc comments + the blueprint_view_golden / needle / MACD-render asserts
updated. Render-only; compiled_view_golden byte-identical; aura run --macd
unchanged.
refs #41
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
//! views. `render_blueprint` shows the authored structure — a flat main graph
|
||||
//! wiring the harness with each composite as a single opaque node, plus a
|
||||
//! `where:` section that defines each distinct composite type once (its interior
|
||||
//! with `[in:k]`/`[out]` port markers). `render_compilat` shows the flat
|
||||
//! with `[<name>]` input/output port markers). `render_compilat` shows the flat
|
||||
//! post-inline graph (boundaries dissolved, C23). Rendering reads structure +
|
||||
//! node `label()`s only — never `eval`.
|
||||
//!
|
||||
@@ -180,7 +180,7 @@ fn leaf_label(c: &Composite, index: usize, factory: &LeafFactory) -> String {
|
||||
|
||||
/// Render one composite's interior as a flat graph: interior leaves as
|
||||
/// `[type(param…; #slot…)]` (aliased param names + ordered input-slot stubs folded
|
||||
/// in via `leaf_label`), nested composites as opaque `[name]`, an `[in:<name>]`
|
||||
/// in via `leaf_label`), nested composites as opaque `[name]`, an `[<name>]`
|
||||
/// entry marker per input role (wired to its interior targets), and an `[<name>]`
|
||||
/// node per re-exported output field (wired from its producer). The title line is
|
||||
/// the composite's typed `signature` (`name(p:kind, …) -> (out, …)`); params live
|
||||
@@ -199,7 +199,7 @@ fn render_definition(c: &Composite) -> String {
|
||||
}
|
||||
for role in c.input_roles() {
|
||||
let in_id = labels.len();
|
||||
labels.push(format!("in:{}", role.name));
|
||||
labels.push(role.name.clone());
|
||||
for t in &role.targets {
|
||||
edges.push((in_id, t.node));
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ mod tests {
|
||||
let out = graph::render_blueprint(&sample_blueprint());
|
||||
// the sma_cross body is defined exactly once, with its interior + ports
|
||||
assert_eq!(out.matches("sma_cross(").count(), 1, "definition not rendered once:\n{out}");
|
||||
for needle in ["[SMA]", "[Sub(#A,#B)]", "[in:price]", "[cross]"] {
|
||||
for needle in ["[SMA]", "[Sub(#A,#B)]", "[price]", "[cross]"] {
|
||||
assert!(out.contains(needle), "missing {needle} in definition:\n{out}");
|
||||
}
|
||||
}
|
||||
@@ -504,7 +504,7 @@ mod tests {
|
||||
where:
|
||||
|
||||
sma_cross() -> (cross):
|
||||
[in:price]
|
||||
[price]
|
||||
┌───└───┐
|
||||
↓ ↓
|
||||
[SMA] [SMA]
|
||||
@@ -587,7 +587,7 @@ sma_cross() -> (cross):
|
||||
assert!(out.contains("[EMA(slow)]"), "slow EMA folds its param: {out}");
|
||||
assert!(out.contains("[EMA(signal)]"), "signal EMA folds its param: {out}");
|
||||
assert!(out.contains("[Sub(#A,#B)]"), "Sub shows its two ordered inputs: {out}");
|
||||
assert!(out.contains("[in:price]"), "named MACD input role: {out}");
|
||||
assert!(out.contains("[price]"), "named MACD input role: {out}");
|
||||
assert!(!out.contains("[param:"), "param marker nodes removed: {out}");
|
||||
assert!(!out.contains("[out:"), "output prefix dropped: {out}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user