From 803c9704cc66442f416ea79e8ac62584922ddd01 Mon Sep 17 00:00:00 2001 From: claude Date: Tue, 21 Jul 2026 13:21:11 +0200 Subject: [PATCH] test: red for show's no-project refusal blaming the id (#300 fieldtest) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Outside any project, show_process/show_campaign print 'not found in the project store' — asserting a store that does not exist and blaming the id, where the sibling verbs (campaign_runs, validate) degrade honestly naming the missing Aura.toml. The in-process RED pins: the refusal stays Err, its prose names 'no Aura.toml found up from', and does NOT claim 'not found in the project store'. Diagnosed cause: both show fns lack the env.provenance().is_none() guard their siblings use, so the no-project fallback store's Ok(None) masquerades as an unregistered id. refs #304 --- crates/aura-cli/src/research_docs.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/crates/aura-cli/src/research_docs.rs b/crates/aura-cli/src/research_docs.rs index 46c64a8..4338930 100644 --- a/crates/aura-cli/src/research_docs.rs +++ b/crates/aura-cli/src/research_docs.rs @@ -752,4 +752,31 @@ mod tests { ); assert!(!prose.contains("CostInstrumentKeys"), "Debug leak: {prose}"); } + + /// #300 fieldtest (df_4): outside a project (no Aura.toml → `Env::std()`), + /// show's refusal names the missing project — the honest degradation + /// `validate` and `campaign runs` already share ("no Aura.toml found up + /// from ") — never a "project store" that does not exist. Blaming the + /// id sends an author in the wrong directory chasing a registration that + /// was never the problem. The refusal itself (Err → exit 1) is correct + /// and stays. + #[test] + fn show_outside_a_project_names_the_missing_aura_toml_not_the_id() { + let env = Env::std(); + for (verb, result) in [ + ("process show", show_process("deadbeef", &env)), + ("campaign show", show_campaign("deadbeef", &env)), + ] { + let msg = result.expect_err("show outside a project must refuse"); + assert!( + msg.contains("no Aura.toml found up from"), + "{verb} outside a project must name the missing Aura.toml: {msg}" + ); + assert!( + !msg.contains("not found in the project store"), + "{verb} outside a project must not blame the id against a \ + store that does not exist: {msg}" + ); + } + } }