refactor(aura-engine): rename NodeHandle::in_/out to input/output

The trailing underscore on in_() was a keyword-escape scar (`in` is reserved).
Rename the NodeHandle port/field accessors to input()/output(), which also
aligns the authoring surface with the schema's own nomenclature
(NodeSchema.inputs/output, "input port"/"output field"): node.input("lhs")
now reads in the same vocabulary the schema uses, instead of a second one.

Mechanical, behaviour-preserving: the two method definitions plus every call
site in builder.rs and the aura-cli sample blueprints. Full workspace green;
clippy --all-targets -D warnings clean.
This commit is contained in:
2026-06-14 10:35:52 +02:00
parent 50105c1957
commit b6174cff80
2 changed files with 48 additions and 48 deletions
+28 -28
View File
@@ -156,10 +156,10 @@ fn sma_cross(name: &str) -> Composite {
let slow = g.add(Sma::builder().named("slow")); // slow SMA leg
let sub = g.add(Sub::builder());
let price = g.input_role("price");
g.feed(price, [fast.in_("series"), slow.in_("series")]);
g.connect(fast.out("value"), sub.in_("lhs"));
g.connect(slow.out("value"), sub.in_("rhs"));
g.expose(sub.out("value"), "cross");
g.feed(price, [fast.input("series"), slow.input("series")]);
g.connect(fast.output("value"), sub.input("lhs"));
g.connect(slow.output("value"), sub.input("rhs"));
g.expose(sub.output("value"), "cross");
g.build().expect("sample sma_cross wiring resolves")
}
@@ -181,11 +181,11 @@ fn signals(name: &str) -> Composite {
.bind("weights[2]", Scalar::F64(0.5)),
);
let price = g.input_role("price");
g.feed(price, [trend.in_("price"), momentum.in_("price")]);
g.connect(trend.out("cross"), blend.in_("term[0]")); // trend.cross → blend.term[0]
g.connect(momentum.out("histogram"), blend.in_("term[1]")); // momentum.histogram → blend.term[1]
g.connect(momentum.out("signal"), blend.in_("term[2]")); // momentum.signal → blend.term[2]
g.expose(blend.out("value"), "signal");
g.feed(price, [trend.input("price"), momentum.input("price")]);
g.connect(trend.output("cross"), blend.input("term[0]")); // trend.cross → blend.term[0]
g.connect(momentum.output("histogram"), blend.input("term[1]")); // momentum.histogram → blend.term[1]
g.connect(momentum.output("signal"), blend.input("term[2]")); // momentum.signal → blend.term[2]
g.expose(blend.output("value"), "signal");
g.build().expect("sample signals wiring resolves")
}
@@ -211,11 +211,11 @@ fn sample_blueprint_with_sinks() -> (
let eq = g.add(Recorder::builder(vec![ScalarKind::F64], Firing::Any, tx_eq));
let ex = g.add(Recorder::builder(vec![ScalarKind::F64], Firing::Any, tx_ex));
let price = g.source_role("price", ScalarKind::F64);
g.feed(price, [sig.in_("price"), broker.in_("price")]);
g.connect(sig.out("signal"), exposure.in_("signal")); // blended signal -> Exposure
g.connect(exposure.out("exposure"), broker.in_("exposure")); // exposure -> broker slot 0
g.connect(broker.out("equity"), eq.in_("col[0]")); // equity -> sink
g.connect(exposure.out("exposure"), ex.in_("col[0]")); // exposure -> sink
g.feed(price, [sig.input("price"), broker.input("price")]);
g.connect(sig.output("signal"), exposure.input("signal")); // blended signal -> Exposure
g.connect(exposure.output("exposure"), broker.input("exposure")); // exposure -> broker slot 0
g.connect(broker.output("equity"), eq.input("col[0]")); // equity -> sink
g.connect(exposure.output("exposure"), ex.input("col[0]")); // exposure -> sink
let bp = g.build().expect("sample blueprint wiring resolves");
(bp, rx_eq, rx_ex)
}
@@ -371,15 +371,15 @@ fn macd(name: &str) -> Composite {
let signal = g.add(Ema::builder().named("signal")); // signal EMA of the MACD line
let hist = g.add(Sub::builder()); // histogram = MACD line signal
let price = g.input_role("price");
g.feed(price, [fast.in_("series"), slow.in_("series")]);
g.connect(fast.out("value"), line.in_("lhs")); // fast → line
g.connect(slow.out("value"), line.in_("rhs")); // slow → line
g.connect(line.out("value"), signal.in_("series")); // line → signal EMA
g.connect(line.out("value"), hist.in_("lhs")); // line → histogram
g.connect(signal.out("value"), hist.in_("rhs")); // signal → histogram
g.expose(line.out("value"), "macd"); // the MACD line
g.expose(signal.out("value"), "signal"); // the signal line
g.expose(hist.out("value"), "histogram"); // the histogram
g.feed(price, [fast.input("series"), slow.input("series")]);
g.connect(fast.output("value"), line.input("lhs")); // fast → line
g.connect(slow.output("value"), line.input("rhs")); // slow → line
g.connect(line.output("value"), signal.input("series")); // line → signal EMA
g.connect(line.output("value"), hist.input("lhs")); // line → histogram
g.connect(signal.output("value"), hist.input("rhs")); // signal → histogram
g.expose(line.output("value"), "macd"); // the MACD line
g.expose(signal.output("value"), "signal"); // the signal line
g.expose(hist.output("value"), "histogram"); // the histogram
g.build().expect("sample macd wiring resolves")
}
@@ -397,11 +397,11 @@ fn macd_strategy_blueprint(
let eq = g.add(Recorder::builder(vec![ScalarKind::F64], Firing::Any, tx_eq));
let ex = g.add(Recorder::builder(vec![ScalarKind::F64], Firing::Any, tx_ex));
let price = g.source_role("price", ScalarKind::F64);
g.feed(price, [macd_node.in_("price"), broker.in_("price")]);
g.connect(macd_node.out("histogram"), exposure.in_("signal")); // histogram → Exposure
g.connect(exposure.out("exposure"), broker.in_("exposure")); // exposure → broker slot 0
g.connect(broker.out("equity"), eq.in_("col[0]")); // equity → sink
g.connect(exposure.out("exposure"), ex.in_("col[0]")); // exposure → sink
g.feed(price, [macd_node.input("price"), broker.input("price")]);
g.connect(macd_node.output("histogram"), exposure.input("signal")); // histogram → Exposure
g.connect(exposure.output("exposure"), broker.input("exposure")); // exposure → broker slot 0
g.connect(broker.output("equity"), eq.input("col[0]")); // equity → sink
g.connect(exposure.output("exposure"), ex.input("col[0]")); // exposure → sink
g.build().expect("macd_strategy wiring resolves")
}