From da37f596f2c7d3fee5a68376d5c4cca2734aaa2c Mon Sep 17 00:00:00 2001 From: claude Date: Tue, 21 Jul 2026 13:29:39 +0200 Subject: [PATCH] fix: show outside a project names the missing Aura.toml, not the id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit show_process/show_campaign now guard env.provenance().is_none() before touching the registry — the guard their siblings (campaign_runs, validate_campaign_file) already carry — refusing with the honest degradation prose ('needs a project ... no Aura.toml found up from {cwd}') instead of blaming the id with 'not found in the project store' against a store that does not exist. Refusal exit 1 unchanged. The register-verb sibling gap (silently creating a stray ./runs/) is deliberately NOT touched here — tracked as #305. RED-first: the in-process pin landed at 803c970; independent verify re-ran it green with the suite. closes #304 --- crates/aura-cli/src/research_docs.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/aura-cli/src/research_docs.rs b/crates/aura-cli/src/research_docs.rs index 4338930..44b4912 100644 --- a/crates/aura-cli/src/research_docs.rs +++ b/crates/aura-cli/src/research_docs.rs @@ -263,6 +263,15 @@ fn register_process(file: &PathBuf, env: &Env) -> Result<(), String> { } fn show_process(id: &str, env: &Env) -> Result<(), String> { + if env.provenance().is_none() { + let cwd = std::env::current_dir() + .map(|d| d.display().to_string()) + .unwrap_or_default(); + return Err(format!( + "process show needs a project: the document store lives under the \ + project store root (no Aura.toml found up from {cwd})" + )); + } let registry = env.registry(); match registry.get_process(id).map_err(|e| e.to_string())? { Some(bytes) => { @@ -584,6 +593,15 @@ fn register_campaign(file: &PathBuf, env: &Env) -> Result<(), String> { } fn show_campaign(id: &str, env: &Env) -> Result<(), String> { + if env.provenance().is_none() { + let cwd = std::env::current_dir() + .map(|d| d.display().to_string()) + .unwrap_or_default(); + return Err(format!( + "campaign show needs a project: the document store lives under the \ + project store root (no Aura.toml found up from {cwd})" + )); + } let registry = env.registry(); match registry.get_campaign(id).map_err(|e| e.to_string())? { Some(bytes) => {