mirror of
https://github.com/instructkr/claude-code.git
synced 2026-04-07 03:38:46 +03:00
chore: additional AI slop cleanup and enforcer wiring from sessions 1/5
Session 1 (ses_2ad65873): with_enforcer builders + 2 regression tests Session 5 (ses_2ad67e8e): continued AI slop cleanup pass — redundant comments, unused_self suppressions, unreachable! tightening Session cleanup (ses_2ad6b26c): Python placeholder centralization Workspace tests: 363+ passed, 0 failed.
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
//! Permission enforcement layer that gates tool execution based on the
|
||||
//! active `PermissionPolicy`.
|
||||
//!
|
||||
//! This module provides `PermissionEnforcer` which wraps tool dispatch
|
||||
//! and validates that the active permission mode allows the requested tool
|
||||
//! before executing it.
|
||||
|
||||
use crate::permissions::{PermissionMode, PermissionOutcome, PermissionPolicy};
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -34,7 +30,7 @@ impl PermissionEnforcer {
|
||||
}
|
||||
|
||||
/// Check whether a tool can be executed under the current permission policy.
|
||||
/// Uses the policy's `authorize` method with no prompter (auto-deny on prompt-required).
|
||||
/// Auto-denies when prompting is required but no prompter is provided.
|
||||
pub fn check(&self, tool_name: &str, input: &str) -> EnforcementResult {
|
||||
let outcome = self.policy.authorize(tool_name, input, None);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user