From 4daefc7bd5048169208d9001d9e373121d197c3b Mon Sep 17 00:00:00 2001 From: Yeachan-Heo Date: Mon, 25 May 2026 12:55:53 +0000 Subject: [PATCH] Stabilize allowedTools rejection contract in CI Serialize the allowedTools rejection tests with the existing environment/current-directory test guards so full parallel cargo test runs cannot observe a transient project config or cwd from another test while building the tool registry.\n\nConstraint: Post-merge Rust build workflow run 26399647443 failed only in the full cargo test job while the focused test passed locally.\nRejected: Changing allowedTools parser output | the product contract remains correct and focused reproduction preserves the expected unsupported-tool error.\nConfidence: high\nScope-risk: narrow\nDirective: Keep this as test isolation only; do not bundle inventory provenance or ROADMAP work into this follow-up.\nTested: cargo test --manifest-path rust/Cargo.toml -p rusty-claude-cli tests::rejects_unknown_allowed_tools -- --exact --nocapture; cargo test --verbose -p rusty-claude-cli --bin claw; cargo test --verbose; cargo fmt --check; cargo check --workspace --locked; cargo build --workspace --locked\nNot-tested: GitHub Actions rerun before opening PR --- rust/crates/rusty-claude-cli/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs index 00e2fd9c..84a2fc39 100644 --- a/rust/crates/rusty-claude-cli/src/main.rs +++ b/rust/crates/rusty-claude-cli/src/main.rs @@ -11400,6 +11400,8 @@ mod tests { #[test] fn rejects_unknown_allowed_tools() { + let _env_guard = env_lock(); + let _cwd_guard = cwd_guard(); let error = parse_args(&["--allowedTools".to_string(), "teleport".to_string()]) .expect_err("tool should be rejected"); assert!(error.contains("unsupported tool in --allowedTools: teleport")); @@ -11407,6 +11409,8 @@ mod tests { #[test] fn rejects_empty_allowed_tools_flag() { + let _env_guard = env_lock(); + let _cwd_guard = cwd_guard(); for raw in ["", ",,"] { let error = parse_args(&["--allowedTools".to_string(), raw.to_string()]) .expect_err("empty allowedTools should be rejected");