From a7d465d2b533b27d5ffa59ecb67a307c98df701b Mon Sep 17 00:00:00 2001 From: claude Date: Mon, 13 Jul 2026 21:52:32 +0200 Subject: [PATCH] =?UTF-8?q?test:=20red=20executable-spec=20for=20#264=20cu?= =?UTF-8?q?t=202=20=E2=80=94=20aura=20data=20list=20enumerates=20symbols?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit aura data list must print the archive's symbols sorted, one per line, exit 0 — the discovery step before aura data coverage. Hostless RED over the synthetic SYMA+SYMB archive; fails on the absent 'list' subcommand (clap exit 2), not on scaffolding. refs #264 --- crates/aura-cli/tests/cli_run.rs | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/crates/aura-cli/tests/cli_run.rs b/crates/aura-cli/tests/cli_run.rs index c139755..7698107 100644 --- a/crates/aura-cli/tests/cli_run.rs +++ b/crates/aura-cli/tests/cli_run.rs @@ -5904,3 +5904,36 @@ fn data_coverage_reports_month_span_and_interior_gap_range() { "first (2024-01) and last (2024-06) present month reported: {stdout}" ); } + +/// Property (#264, list cut 2): `aura data list` enumerates the symbols the +/// archive contains, one per line, sorted — the discovery step a campaign +/// author (or an agent operating through the CLI alone, the deployment +/// posture) needs before `aura data coverage `, since without it the +/// inventory is obtainable only by listing the archive directory outside +/// aura. The archive root resolves through the same project path as `coverage` +/// (`Env::data_path` — a project-local `[paths] data` override when set). Over +/// a hermetic synthetic archive holding two symbols (`SYMA` 2024-01..08 and +/// `SYMB` 2024-03..06), the verb exits 0 and prints EXACTLY the two symbol +/// names in ascending order, one per line — `SYMA` before `SYMB`, nothing +/// else. +#[test] +fn data_list_enumerates_archive_symbols_one_per_line_sorted() { + let (cwd, _g) = fresh_project_with_data(); + let out = std::process::Command::new(env!("CARGO_BIN_EXE_aura")) + .args(["data", "list"]) + .current_dir(&cwd) + .output() + .expect("spawn aura data list"); + assert_eq!( + out.status.code(), + Some(0), + "exit: {:?}, stderr: {}", + out.status, + String::from_utf8_lossy(&out.stderr) + ); + let stdout = String::from_utf8(out.stdout).expect("utf-8 stdout"); + // The whole contract: the two archive symbols, sorted, one per line, and + // nothing else — this is the inventory a campaign author reads before + // scoping an instrument matrix. + assert_eq!(stdout, "SYMA\nSYMB\n", "sorted symbol enumeration: {stdout:?}"); +}