From 32ac8a30ea69c86fd444b5373a52e58bdc7ec2b6 Mon Sep 17 00:00:00 2001 From: Brummel Date: Mon, 8 Jun 2026 10:51:50 +0200 Subject: [PATCH] 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 [] markers, matching the [] 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 --- crates/aura-cli/src/graph.rs | 6 +++--- crates/aura-cli/src/main.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/aura-cli/src/graph.rs b/crates/aura-cli/src/graph.rs index 456d04a..2475e0a 100644 --- a/crates/aura-cli/src/graph.rs +++ b/crates/aura-cli/src/graph.rs @@ -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 `[]` 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:]` +/// in via `leaf_label`), nested composites as opaque `[name]`, an `[]` /// entry marker per input role (wired to its interior targets), and an `[]` /// 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)); } diff --git a/crates/aura-cli/src/main.rs b/crates/aura-cli/src/main.rs index 133a896..278d735 100644 --- a/crates/aura-cli/src/main.rs +++ b/crates/aura-cli/src/main.rs @@ -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}"); }