diff --git a/crates/aura-cli/tests/cli_run.rs b/crates/aura-cli/tests/cli_run.rs index 034fa02..cc4aaee 100644 --- a/crates/aura-cli/tests/cli_run.rs +++ b/crates/aura-cli/tests/cli_run.rs @@ -2992,8 +2992,11 @@ fn walkforward_dissolved_refuses_a_multi_value_stop() { /// #215: --select plateau is no longer refused on the dissolved path — it now /// threads through to the wf stage exactly like the built-in synthetic path. -/// Gated on the shared GER40 archive; skips cleanly on a data refusal (exit 1), -/// same tolerance as the sibling stop-knob-defaulting test. +/// The property is flag acceptance, not window semantics, so the window is +/// bounded (~135 days, one IS(90d)+OOS(30d) roll) rather than streaming the +/// full multi-year archive. Gated on the shared GER40 archive; skips cleanly +/// on a data refusal (exit 1), same tolerance as the sibling +/// stop-knob-defaulting test. #[test] fn walkforward_dissolved_accepts_select_plateau() { let (cwd, _g) = fresh_project(); @@ -3004,6 +3007,7 @@ fn walkforward_dissolved_accepts_select_plateau() { "--axis", "sma_signal.fast.length=3", "--axis", "sma_signal.slow.length=12", "--stop-length", "14", "--stop-k", "2.0", "--select", "plateau:worst", + "--from", "1735689600000", "--to", "1747353600000", ]) .current_dir(cwd) .output() @@ -3090,8 +3094,10 @@ fn walkforward_real_e2e_pins_the_exact_current_plateau_grade() { /// explicit still succeeds, proving the defaulting is per-flag, not /// all-or-nothing (the sibling /// `walkforward_stopless_defaults_the_regime_byte_identically_to_explicit_3_2` -/// pins the both-omitted case). Gated on the shared GER40 archive; skips -/// cleanly on a data refusal. +/// pins the both-omitted case). The property is per-flag defaulting, not +/// window semantics, so the window is bounded (~135 days) rather than +/// streaming the full multi-year archive. Gated on the shared GER40 archive; +/// skips cleanly on a data refusal. #[test] fn walkforward_dissolved_defaults_a_single_omitted_knob() { let (cwd, _g) = fresh_project(); @@ -3101,6 +3107,7 @@ fn walkforward_dissolved_defaults_a_single_omitted_knob() { "walkforward", &fixture, "--real", "GER40", "--axis", "sma_signal.fast.length=3", "--axis", "sma_signal.slow.length=12", "--stop-length", "3", + "--from", "1735689600000", "--to", "1747353600000", ]) .current_dir(cwd) .output() @@ -5268,11 +5275,12 @@ fn mc_dissolves_through_the_campaign_path() { /// to completion by fitting the injected walk-forward roller down to the campaign /// window, instead of refusing late at the executor with "walk_forward windows do not /// fit the campaign window" (exit 1, no remedy reachable from the mc surface). The -/// short window is DERIVED from the live archive — probe GER40's full span via a -/// no-window single-cell sweep, then take the last ~30 days — the same live-archive -/// derivation `generalize_without_explicit_window_resolves_the_intersection_of_all_symbols` -/// uses, so the window stays short as the archive grows and always holds recent bars. -/// The leading sweep stage runs first over the short window; the refusal today fires at +/// short window is a FIXED ~30 days (2025-04-16..2025-05-16, the tail of the +/// ~135-day span the walkforward e2e tests use): what the property needs is "a +/// data-carrying window far shorter than the roller", which a fixed recent window +/// satisfies without the full-archive probe sweep a live-span derivation costs — +/// the archive only grows forward, so the window never falls off its end. The +/// leading sweep stage runs first over the short window; the refusal today fires at /// stage 1 (the walk_forward roller), so this bites only when the window genuinely has /// data. Gated on the GER40 archive; skips cleanly on a data-less host. #[test] @@ -5284,56 +5292,10 @@ fn mc_real_fits_the_injected_roller_to_a_short_window() { let (cwd, _g) = fresh_project(); let fixture = format!("{}/examples/r_sma.json", env!("CARGO_MANIFEST_DIR")); - // Probe GER40's full archive window: a single-cell, no-window sweep records - // `campaign_window_ms(full_window)` into its generated campaign document, in the - // same Unix-ms currency `--from`/`--to` speak (the generalize no-window test's - // derivation). - let full_window = { - let name = "probe-ger40-span"; - let out = std::process::Command::new(env!("CARGO_BIN_EXE_aura")) - .args([ - "sweep", &fixture, "--real", "GER40", - "--axis", "sma_signal.fast.length=3", "--axis", "sma_signal.slow.length=12", - "--name", name, - ]) - .current_dir(cwd) - .output() - .expect("spawn aura sweep probe"); - assert_eq!( - out.status.code(), Some(0), - "the full-archive window-probe sweep must run to exit 0: {}", - String::from_utf8_lossy(&out.stderr) - ); - let dir = cwd.join("runs").join("campaigns"); - let mut resolved = None; - for entry in std::fs::read_dir(&dir).expect("campaigns dir exists after a run") { - let path = entry.expect("readable dir entry").path(); - let doc: serde_json::Value = - serde_json::from_str(&std::fs::read_to_string(&path).expect("read campaign doc")) - .expect("campaign doc parses as JSON"); - if doc["name"].as_str() == Some(name) { - let w = &doc["data"]["windows"][0]; - resolved = Some(( - w["from_ms"].as_i64().expect("from_ms is an integer"), - w["to_ms"].as_i64().expect("to_ms is an integer"), - )); - break; - } - } - resolved.expect("the probe campaign document records GER40's full window") - }; - - // The last ~30 days of the archive: far shorter than the fixed 90+30-day roller, - // so the injected walk_forward cannot fit unless it scales down to the window. - const THIRTY_DAYS_MS: i64 = 30 * 86_400_000; - let sub_from = full_window.1 - THIRTY_DAYS_MS; - let sub_to = full_window.1; - assert!( - sub_from > full_window.0, - "the derived ~30-day sub-window must sit inside the archive span {full_window:?}" - ); - let sub_from_s = sub_from.to_string(); - let sub_to_s = sub_to.to_string(); + // ~30 days, far shorter than the fixed 90+30-day roller, so the injected + // walk_forward cannot fit unless it scales down to the window. + const SUB_FROM_MS: &str = "1744761600000"; + const SUB_TO_MS: &str = "1747353600000"; let out = std::process::Command::new(env!("CARGO_BIN_EXE_aura")) .args([ @@ -5341,7 +5303,7 @@ fn mc_real_fits_the_injected_roller_to_a_short_window() { "--axis", "sma_signal.fast.length=3,5", "--axis", "sma_signal.slow.length=12,20", "--stop-length", "14", "--stop-k", "2.0", "--block-len", "5", "--resamples", "100", "--seed", "42", - "--from", &sub_from_s, "--to", &sub_to_s, + "--from", SUB_FROM_MS, "--to", SUB_TO_MS, ]) .current_dir(cwd) .output()