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:
Jobdori
2026-04-03 18:35:27 +09:00
parent 618a79a9f4
commit 8cc7d4c641
38 changed files with 250 additions and 325 deletions

View File

@@ -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);