diff --git a/memory.md b/memory.md index 6460399..006e88f 100644 --- a/memory.md +++ b/memory.md @@ -52,6 +52,16 @@ Durable memory for this project. Read at session start, update before session en ## Session log +### 2026-05-26 — Clear cargo warnings: drop v2.1 classifier scaffold, annotate rmcp tool_router + +Four pre-existing dead-code warnings out of every cargo build. Three were the v2.1 classifier scaffold sitting unused in `mcp_policy.rs` (`ClassifierHint` enum, `PolicyClassifier` trait, `NoopClassifier` struct + impl). Deleted — the scaffold being unused for weeks was a stronger "no plan" signal than its presence was a "TODO" signal. If we actually want classifier upgrade-on-Ask later (v0.4.0 candidate), trivial to re-add; the design questions (Anthropic vs Ollama, API key UX, monthly cost cap, privacy disclosure) need a focused session. + +Fourth warning was rmcp's `#[tool_router]` macro generating internal references to a `tool_router: ToolRouter` field on `TileService` that rustc's dead-code pass can't see through. Added `#[allow(dead_code)]` to the field with a comment explaining why. + +`cargo build` is now clean (modulo any new bugs). + +Open follow-up: v0.4.0 classifier ([[v2.1-classifier]]). Design notes for that session — pick Haiku 4.5 via Anthropic API as default; API key in Windows Credential Manager (matches SSH password storage, doesn't sync); 60s cache by `(tool, args_repr)`; classifier can only upgrade Ask → Allow, never downgrade. + ### 2026-05-26 — Backed out idle "claude foreground" filter (kept legacy 5s notify) Shipped earlier today as per-distro, pivoted to per-pane via `TILETOPIA_PANE_ID` env marker, then a probe-script bug surfaced (positional args dropped by `wsl.exe -- bash -c "..." _ `). Fixed the arg-passing by inlining values, but on real-app test the pane still showed idle while claude was running — and at that point the user (rightly) called credit waste and asked to back the whole feature out. diff --git a/src-tauri/src/mcp.rs b/src-tauri/src/mcp.rs index 256a9db..6f9e7eb 100644 --- a/src-tauri/src/mcp.rs +++ b/src-tauri/src/mcp.rs @@ -301,6 +301,10 @@ pub struct TileService { pending: Arc, rate_limiter: Arc, app: AppHandle, + // Used by the code rmcp's `#[tool_router]` macro generates; rustc's + // dead-code pass can't see through the macro, hence the explicit + // suppression rather than a redesign. + #[allow(dead_code)] tool_router: ToolRouter, } diff --git a/src-tauri/src/mcp_policy.rs b/src-tauri/src/mcp_policy.rs index aaa228b..f1d1feb 100644 --- a/src-tauri/src/mcp_policy.rs +++ b/src-tauri/src/mcp_policy.rs @@ -67,30 +67,6 @@ pub enum PolicyDecision { Deny { reason: String, hard: bool }, } -// --------------------------------------------------------------------------- -// Classifier hook (scaffold — no-op default; v2.1 will wire into evaluate) -// --------------------------------------------------------------------------- - -pub enum ClassifierHint { - Allow, - Ask, -} - -pub trait PolicyClassifier: Send + Sync { - /// Called for tool calls that fall through to Ask. Returns a hint that - /// may upgrade the decision to Allow (skipping the confirmation prompt) - /// or stay at Ask. Errors leave the decision unchanged. - fn classify(&self, tool: &str, args_repr: &str) -> Result; -} - -pub struct NoopClassifier; - -impl PolicyClassifier for NoopClassifier { - fn classify(&self, _tool: &str, _args_repr: &str) -> Result { - Ok(ClassifierHint::Ask) - } -} - // --------------------------------------------------------------------------- // Hard-deny patterns (compiled-in, non-overridable) // ---------------------------------------------------------------------------