Clear cargo warnings: drop v2.1 classifier scaffold, annotate tool_router
Three of the four dead-code warnings (`ClassifierHint`, `PolicyClassifier`, `NoopClassifier`) were the v2.1 classifier scaffold sitting unused since PR-1. Deleted — being unused for weeks was a stronger "no concrete plan" signal than its presence was a "TODO" signal. Trivial to re-add when we actually do the classifier (v0.4.0 candidate). Fourth warning was rmcp's `#[tool_router]` macro generating internal references to a `tool_router` field on TileService that rustc's dead-code pass can't see through. Added `#[allow(dead_code)]` with a brief comment on why. `cargo build` is now clean of the four standing dead-code warnings. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
139730259a
commit
3d4e0fabe5
3 changed files with 14 additions and 24 deletions
10
memory.md
10
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<Self>` 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 "..." _ <id>`). 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.
|
||||
|
|
|
|||
|
|
@ -301,6 +301,10 @@ pub struct TileService {
|
|||
pending: Arc<PendingActions>,
|
||||
rate_limiter: Arc<WriteRateLimiter>,
|
||||
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<Self>,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<ClassifierHint, anyhow::Error>;
|
||||
}
|
||||
|
||||
pub struct NoopClassifier;
|
||||
|
||||
impl PolicyClassifier for NoopClassifier {
|
||||
fn classify(&self, _tool: &str, _args_repr: &str) -> Result<ClassifierHint, anyhow::Error> {
|
||||
Ok(ClassifierHint::Ask)
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Hard-deny patterns (compiled-in, non-overridable)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue