test(cli): relocate the _open example twins to tests/fixtures (refs #248)

The four _open blueprints leave the user-facing gallery
(crates/aura-cli/examples/) and become test fixtures; the closed twins
are now the only example corpus (bound params are overridable defaults
since #246, so the closed files serve both run and sweep).

Compile-time embeds follow the move: the emit_* generators and the
shipped_*_serialize byte-pins target tests/fixtures/ (the open fixtures
stay builder-generated and byte-pinned — regenerating after the move
left the tree clean), load_open_r_sma and the axis-probe read the
fixture, and the walk-forward refit test plus the `aura graph` default
sample switch to the closed r_sma.json. graph_construct's open-fixture
tests swap example() -> fixture(), their names dropping the now-false
"shipped example" claim; a new e2e test pins the relocation property
(all four fixtures load and introspect, the gallery holds exactly the
four closed examples).

Intermediate state: cli_run.rs / research_docs.rs / project_load.rs
still reference the old example paths and fail at runtime until the
follow-up migration commit (MIGRATE sites move to the closed twins,
NEEDS-OPEN sites to the fixtures).

Verification: cargo build --workspace; cargo test -p aura-cli --bin
aura; cargo test -p aura-cli --test graph_construct; the three ignored
emit generators re-run byte-stable.
This commit is contained in:
2026-07-13 11:42:03 +02:00
parent d7874e2569
commit 6d3da424f4
7 changed files with 57 additions and 31 deletions
+15 -14
View File
@@ -3378,7 +3378,7 @@ fn dispatch_graph(a: GraphCmd, env: &project::Env) {
}
None if a.blueprint.is_none() => {
let bp = blueprint_from_json(
include_str!("../examples/r_sma_open.json"),
include_str!("../examples/r_sma.json"),
&|t| env.resolve(t),
)
.expect("the shipped r-sma example reloads into a renderable blueprint");
@@ -4053,10 +4053,10 @@ mod tests {
)
.expect("write examples/r_breakout.json");
std::fs::write(
"examples/r_breakout_open.json",
"tests/fixtures/r_breakout_open.json",
blueprint_to_json(&r_breakout_signal(None)).expect("serialize open r_breakout"),
)
.expect("write examples/r_breakout_open.json");
.expect("write tests/fixtures/r_breakout_open.json");
}
/// The shipped examples are a faithful serialisation of the carved signal (#159 cut 2):
@@ -4071,7 +4071,7 @@ mod tests {
);
assert_eq!(
blueprint_to_json(&r_breakout_signal(None)).expect("serialize open"),
include_str!("../examples/r_breakout_open.json"),
include_str!("../tests/fixtures/r_breakout_open.json"),
);
}
@@ -4104,10 +4104,10 @@ mod tests {
)
.expect("write examples/r_meanrev.json");
std::fs::write(
"examples/r_meanrev_open.json",
"tests/fixtures/r_meanrev_open.json",
blueprint_to_json(&r_meanrev_signal(None, None)).expect("serialize open r_meanrev"),
)
.expect("write examples/r_meanrev_open.json");
.expect("write tests/fixtures/r_meanrev_open.json");
}
/// Regenerates the shipped r_channel examples from the carved signal. Run by hand:
@@ -4123,10 +4123,10 @@ mod tests {
)
.expect("write examples/r_channel.json");
std::fs::write(
"examples/r_channel_open.json",
"tests/fixtures/r_channel_open.json",
blueprint_to_json(&r_channel_signal(None)).expect("serialize open r_channel"),
)
.expect("write examples/r_channel_open.json");
.expect("write tests/fixtures/r_channel_open.json");
}
/// The shipped examples are a faithful serialisation of the carved signal
@@ -4140,7 +4140,7 @@ mod tests {
);
assert_eq!(
blueprint_to_json(&r_channel_signal(None)).expect("serialize open"),
include_str!("../examples/r_channel_open.json"),
include_str!("../tests/fixtures/r_channel_open.json"),
);
}
@@ -4222,7 +4222,7 @@ mod tests {
);
assert_eq!(
blueprint_to_json(&r_meanrev_signal(None, None)).expect("open"),
include_str!("../examples/r_meanrev_open.json"),
include_str!("../tests/fixtures/r_meanrev_open.json"),
);
}
@@ -4718,7 +4718,7 @@ mod tests {
/// Loads the shipped open r-sma example (both SMA lengths free) through the
/// public `blueprint_from_json` path.
fn load_open_r_sma() -> Composite {
blueprint_from_json(include_str!("../examples/r_sma_open.json"), &|t| std_vocabulary(t))
blueprint_from_json(include_str!("../tests/fixtures/r_sma_open.json"), &|t| std_vocabulary(t))
.expect("loads")
}
@@ -5161,7 +5161,7 @@ mod tests {
// wraps the signal (name "sma_signal") so the names are prefixed —
// exactly what `--axis` binds.
let env = project::Env::std();
let open = include_str!("../examples/r_sma_open.json");
let open = include_str!("../tests/fixtures/r_sma_open.json");
let space = blueprint_axis_probe(open, &env).param_space();
let names: Vec<&str> = space.iter().map(|p| p.name.as_str()).collect();
assert_eq!(names, ["sma_signal.fast.length", "sma_signal.slow.length"]);
@@ -5174,9 +5174,10 @@ mod tests {
#[test]
fn blueprint_walkforward_family_refits_each_window() {
// The open fixture's two SMA lengths are re-fit per IS window over a 2x2 grid.
// The closed blueprint's two bound SMA lengths are re-fit per IS window over
// a 2x2 grid via the #246 bound-override reopen path (bound = overridable default).
let env = project::Env::std();
let doc = include_str!("../examples/r_sma_open.json");
let doc = include_str!("../examples/r_sma.json");
let axes = vec![
("sma_signal.fast.length".to_string(), vec![Scalar::i64(2), Scalar::i64(3)]),
("sma_signal.slow.length".to_string(), vec![Scalar::i64(4), Scalar::i64(6)]),
+1 -1
View File
@@ -236,7 +236,7 @@ mod tests {
fn render_html_is_self_contained_and_embeds_the_model() {
let env = crate::project::Env::std();
let bp = aura_engine::blueprint_from_json(
include_str!("../examples/r_sma_open.json"),
include_str!("../examples/r_sma.json"),
&|t| env.resolve(t),
)
.expect("the shipped r-sma example reloads into a renderable blueprint");