From bdafbdef59ccb37428cd6449ce8723068d9cb018 Mon Sep 17 00:00:00 2001 From: claude Date: Mon, 13 Jul 2026 23:28:25 +0200 Subject: [PATCH] fix(cli): unwrap the walkforward UnknownKnob Debug frame into bare prose render_bind_error's catch-all Debug-framed UnknownKnob although its payload is already a fully-prosed message; the variant now renders the payload alone. The two tests that pinned the frame verbatim repoint to the prose fragments. Exit 2 unchanged. Completes the #247 defect family: no Rust identifier reaches a user's stderr on either verb path. closes #269 --- crates/aura-cli/src/main.rs | 11 +++++------ crates/aura-cli/tests/cli_run.rs | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/crates/aura-cli/src/main.rs b/crates/aura-cli/src/main.rs index 9c03911..c9b3698 100644 --- a/crates/aura-cli/src/main.rs +++ b/crates/aura-cli/src/main.rs @@ -1920,12 +1920,10 @@ fn override_paths( /// (`KindMismatch { .. }` / `MissingKnob("..")`), the two variants the sweep /// terminal actually raises past `override_paths`' own pre-flight (which /// already rejects an unresolvable axis name as prose before either call -/// site below ever reaches the terminal). Other variants keep the -/// established `{:?}` rendering unchanged — in particular `UnknownKnob` -/// already carries a fully-prosed message string at both call sites here -/// (wrapped from `override_paths`' own `Result<_, String>`), and pinned -/// tests (`aura_walkforward_emits_an_unknown_axis_rejection_once` et al.) -/// depend on that Debug-wrapped shape. +/// site below ever reaches the terminal). `UnknownKnob` already carries a +/// fully-prosed message string (wrapped from `override_paths`' own +/// `Result<_, String>`) — unwrapped here rather than Debug-framed (#269), so +/// the walkforward path's rejection reaches stderr as bare prose too. fn render_bind_error(e: &BindError) -> String { match e { BindError::MissingKnob(name) => format!( @@ -1936,6 +1934,7 @@ fn render_bind_error(e: &BindError) -> String { "axis {knob}: expected {expected:?}, supplied {got:?} — \ see `aura sweep --list-axes`" ), + BindError::UnknownKnob(msg) => msg.clone(), other => format!("{other:?}"), } } diff --git a/crates/aura-cli/tests/cli_run.rs b/crates/aura-cli/tests/cli_run.rs index 0958d93..010047d 100644 --- a/crates/aura-cli/tests/cli_run.rs +++ b/crates/aura-cli/tests/cli_run.rs @@ -4563,8 +4563,8 @@ fn aura_walkforward_over_a_blueprint_rejects_an_unknown_axis() { assert_eq!(out.status.code(), Some(2), "an unknown axis must fail clean, not panic"); let stderr = String::from_utf8(out.stderr).expect("utf-8"); assert!( - stderr.contains("Knob") && stderr.contains("nope"), - "names the unresolved axis via BindError: {stderr}" + stderr.contains("names no param") && stderr.contains("nope"), + "names the unresolved axis via the prose payload (#269): {stderr}" ); assert!(!stderr.contains("panicked"), "must reject cleanly, never panic: {stderr}"); } @@ -4596,7 +4596,7 @@ fn aura_walkforward_emits_an_unknown_axis_rejection_once() { assert_eq!(out.status.code(), Some(2), "an unknown axis must fail clean, not panic"); let stderr = String::from_utf8(out.stderr).expect("utf-8"); assert!(!stderr.contains("panicked"), "must reject cleanly, never panic: {stderr}"); - let emits = stderr.matches("UnknownKnob").count(); + let emits = stderr.matches("names no param").count(); assert_eq!( emits, 1, "attempt {attempt}: the axis rejection must be emitted exactly once, got {emits}: {stderr:?}",