feat(cli): ship r-sma demo as a proven blueprint-data example (#159 cut 1)
Cut 1 of the hard-wired demo retirement — the copy+prove phase. The r-sma demo strategy now ships as runnable blueprint data under crates/aura-cli/examples/ (r_sma.json closed 2/4, r_sma_open.json open), emitted from the current builder so it is byte-for-byte the builder's serialization. Two load-bearing proofs, captured while the builder is still alive: - byte-fidelity: the shipped examples equal blueprint_to_json(&sma_signal(..)) — the "the copy is identical to the original" evidence the retirement method requires before any original is removed; - grade anchor: `aura run examples/r_sma.json` reproduces the built-in `--harness r-sma` metrics byte-for-byte (expectancy_r/sqn/total_pips/n_trades). Plus two property tests on the shipped copies (beyond the plan, kept as on-topic proof strengthening): the closed example introspects to zero unbound params (genuinely closed), and the open example lists exactly its two SMA-length axes from the public gallery location. Purely additive: the builder (sma_signal) and every inline r-sma surface are retained. The recon showed deleting the builder has a large transitive closure (the synthetic inline surface, the Strategy::RSma enum, ~40 integration tests); that removal is cut 1b, a separate cycle, made safe by the byte-fidelity proof frozen here. Full workspace suite green; clippy -D warnings clean. refs #159
This commit is contained in:
@@ -407,6 +407,13 @@ fn fixture(name: &str) -> String {
|
||||
format!("{}/tests/fixtures/{name}", env!("CARGO_MANIFEST_DIR"))
|
||||
}
|
||||
|
||||
/// The absolute path of a demo blueprint shipped in the public examples/
|
||||
/// gallery (#159 copy+prove) — distinct from `fixture()`, which reads the
|
||||
/// internal tests/fixtures/ copies the emitter builds from.
|
||||
fn example(name: &str) -> String {
|
||||
format!("{}/examples/{name}", env!("CARGO_MANIFEST_DIR"))
|
||||
}
|
||||
|
||||
/// The id extracted from a `registered blueprint {id} ({path})` line.
|
||||
/// Prefix-tolerant across the #194 convention change (the display form dropped
|
||||
/// the glued `content:` prefix): the id is bare either way.
|
||||
@@ -688,3 +695,39 @@ fn graph_params_accepts_an_op_script_matching_its_envelope() {
|
||||
assert_eq!(op_code, Some(0), "params on op-script exits 0: {op_out} {op_err}");
|
||||
assert_eq!(op_out, env_out, "op-script and envelope agree on the raw axis namespace");
|
||||
}
|
||||
|
||||
/// Property (#159): the shipped closed example (`examples/r_sma.json`) is
|
||||
/// genuinely closed, not merely byte-identical to the builder — `graph
|
||||
/// introspect --params` on it reports zero unbound params. The Cut-1
|
||||
/// byte-fidelity proof (`shipped_r_sma_examples_are_byte_identical_to_the_builder`,
|
||||
/// main.rs) only pins the example's bytes to the builder's serialization; it says
|
||||
/// nothing about whether that serialization is actually closed. This pins the
|
||||
/// "closed" claim the demo makes to its audience.
|
||||
#[test]
|
||||
fn shipped_r_sma_example_is_genuinely_closed() {
|
||||
let dir = temp_cwd("example-closed-params");
|
||||
let (stdout, stderr, code) =
|
||||
run_in(&dir, &["graph", "introspect", "--params", &example("r_sma.json")]);
|
||||
assert_eq!(code, Some(0), "stdout: {stdout} stderr: {stderr}");
|
||||
assert_eq!(stdout, "", "the closed example must leave zero params unbound");
|
||||
}
|
||||
|
||||
/// Property (#159): the shipped open example (`examples/r_sma_open.json`) is a
|
||||
/// usable sweep-axis template from its public gallery location, not just a
|
||||
/// byte-identical artifact — `graph introspect --params` lists exactly the two
|
||||
/// unbound SMA lengths, in lowering order, matching the raw axis namespace the
|
||||
/// internal `sma_signal_open.json` fixture prints (#196). The byte-fidelity
|
||||
/// proof only checks the example's bytes match the builder; this checks the
|
||||
/// shipped copy is actually introspectable/bindable from where a consumer runs
|
||||
/// it.
|
||||
#[test]
|
||||
fn shipped_r_sma_open_example_lists_its_axis_namespace() {
|
||||
let dir = temp_cwd("example-open-params");
|
||||
let (stdout, stderr, code) =
|
||||
run_in(&dir, &["graph", "introspect", "--params", &example("r_sma_open.json")]);
|
||||
assert_eq!(code, Some(0), "stdout: {stdout} stderr: {stderr}");
|
||||
assert_eq!(
|
||||
stdout, "fast.length:I64\nslow.length:I64\n",
|
||||
"the raw open params, in order, from the public gallery copy"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user