diff --git a/src/hook_redirect.rs b/src/hook_redirect.rs index a5d59581..2de1bd1a 100644 --- a/src/hook_redirect.rs +++ b/src/hook_redirect.rs @@ -19,8 +19,11 @@ const GATING_TIMEOUT: Duration = Duration::from_millis(2000); /// default branch, regardless of which of these the agent reaches for. const MUTATING_TOOLS: &[&str] = &[ "Write", + "write", "Edit", + "edit", "NotebookEdit", + "notebookedit", "mcp__lean-ctx__ctx_patch", "mcp__lean-ctx__ctx_edit", ]; @@ -210,6 +213,14 @@ mod tests { assert!(classify("mcp__lean-ctx__ctx_edit", None, ctx).is_some()); } + #[test] + fn classify_blocks_lowercase_edit_and_write_on_master() { + let ctx = (Some("master"), None); + assert!(classify("edit", None, ctx).is_some()); + assert!(classify("write", None, ctx).is_some()); + assert!(classify("notebookedit", None, ctx).is_some()); + } + #[test] fn classify_allows_mutating_tools_on_a_feature_branch() { assert!(classify("NotebookEdit", None, ON_FEATURE_BRANCH).is_none());