From 53bbcedeecd49a10168583ba540710cc03d19dc3 Mon Sep 17 00:00:00 2001 From: Brummel Date: Thu, 9 Jul 2026 23:04:12 +0200 Subject: [PATCH] =?UTF-8?q?test(cli):=20RED=20=E2=80=94=20sweep/walkforwar?= =?UTF-8?q?d=20must=20refuse=20--trace=20with=20a=20#224=20pointer=20(#168?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The clap help promises "persists each member's taps" and the chart hint recommends `aura sweep --trace`, but every blueprint-mode arm discards the flag (run_blueprint_sweep's `let _ = persist`, the --real sugar's persist_taps: vec![]) — the surface advertises trace-recording the code drops. Pin the decided honest behaviour: sweep/walkforward refuse --trace up front (exit 2, naming the flag and pointing forward to the deferred trace feature #224), mirroring the aura run / mc refusals. refs #168 --- crates/aura-cli/tests/cli_run.rs | 56 ++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/crates/aura-cli/tests/cli_run.rs b/crates/aura-cli/tests/cli_run.rs index 00d6280..733b920 100644 --- a/crates/aura-cli/tests/cli_run.rs +++ b/crates/aura-cli/tests/cli_run.rs @@ -2730,6 +2730,62 @@ fn aura_sweep_loads_a_blueprint_and_persists_a_sweep_family() { let _ = std::fs::remove_dir_all(&cwd); } +/// Property (#168, refuse-don't-lie): `aura sweep`/`aura walkforward` must REFUSE +/// `--trace` with a forward-pointer to the deferred per-member-trace feature (#224), +/// never silently accept it. The clap help ("also persists each member's taps") and +/// the chart `NotFound` hint ("run `aura sweep --trace` first") advertise +/// trace-recording, but no blueprint-mode arm persists per-member taps — +/// `run_blueprint_sweep` reads `let _ = persist;` and the dissolved `--real` sugar +/// sets `persist_taps: vec![]` — so a bare accept makes the surface lie. This mirrors +/// the existing `aura run` / `aura mc` `--trace` refusals (exit 2, refuse-don't-guess). +/// Driven over the SYNTHETIC path (both open knobs bound, no `--real`), so the test is +/// autonomous: no recorded archive, no project. Today `sweep --trace` exits 0 (silent +/// accept) and `walkforward --trace` exits 2 with a GENERIC usage string (no #224) — +/// both are the lying/pointer-less surface this pins. +#[test] +fn sweep_and_walkforward_refuse_trace_with_a_forward_pointer() { + let fixture = format!("{}/examples/r_sma_open.json", env!("CARGO_MANIFEST_DIR")); + for verb in ["sweep", "walkforward"] { + let cwd = temp_cwd(&format!("{verb}-trace-refusal")); + let out = Command::new(BIN) + .args([ + verb, + &fixture, + "--axis", + "sma_signal.fast.length=2,4", + "--axis", + "sma_signal.slow.length=8,16", + "--trace", + "fam", + ]) + .current_dir(&cwd) + .output() + .expect("spawn aura --trace"); + assert_eq!( + out.status.code(), + Some(2), + "`aura {verb} --trace` must be refused (exit 2); got {:?}, stderr: {}", + out.status, + String::from_utf8_lossy(&out.stderr), + ); + let stderr = String::from_utf8_lossy(&out.stderr); + assert!( + stderr.contains("--trace"), + "`aura {verb}` refusal names the offending flag: {stderr}" + ); + assert!( + stderr.contains("#224"), + "`aura {verb}` refusal points forward to the deferred trace feature (#224): {stderr}" + ); + assert!( + out.stdout.is_empty(), + "`aura {verb} --trace` must emit no report on stdout: {}", + String::from_utf8_lossy(&out.stdout), + ); + let _ = std::fs::remove_dir_all(&cwd); + } +} + /// Property (#158/#164, C18/C11/C12): a blueprint sweep content-addresses its topology /// — the canonical blueprint is persisted ONCE under `runs/blueprints/.json`, /// keyed by the very SHA256 every member's manifest carries, holding exactly the bytes