ultraworkers-claw-code/rust/crates/runtime/src
Yeachan-Heo e2f061fd08 Enforce tool permissions before execution
The Rust CLI/runtime now models permissions as ordered access levels, derives tool requirements from the shared tool specs, and prompts REPL users before one-off danger-full-access escalations from workspace-write sessions. This also wires explicit --permission-mode parsing and makes /permissions operate on the live session state instead of an implicit env-derived default.

Constraint: Must preserve the existing three user-facing modes read-only, workspace-write, and danger-full-access

Constraint: Must avoid new dependencies and keep enforcement inside the existing runtime/tool plumbing

Rejected: Keep the old Allow/Deny/Prompt policy model | could not represent ordered tool requirements across the CLI surface

Rejected: Continue sourcing live session mode solely from RUSTY_CLAUDE_PERMISSION_MODE | /permissions would not reliably reflect the current session state

Confidence: high

Scope-risk: moderate

Reversibility: clean

Directive: Add required_permission entries for new tools before exposing them to the runtime

Tested: cargo fmt; cargo clippy --workspace --all-targets -- -D warnings; cargo test -q

Not-tested: Manual interactive REPL approval flow in a live Anthropic session
2026-04-01 00:06:15 +00:00
..
bash.rs feat: Rust port of Claude Code CLI 2026-03-31 17:43:09 +00:00
bootstrap.rs feat: Rust port of Claude Code CLI 2026-03-31 17:43:09 +00:00
compact.rs Preserve actionable state in compacted Rust sessions 2026-03-31 19:34:56 +00:00
config.rs Unblock typed runtime integration config primitives 2026-03-31 19:17:16 +00:00
conversation.rs Enforce tool permissions before execution 2026-04-01 00:06:15 +00:00
file_ops.rs Close the Claude Code tools parity gap 2026-03-31 22:53:20 +00:00
json.rs feat: Rust port of Claude Code CLI 2026-03-31 17:43:09 +00:00
lib.rs Merge remote-tracking branch 'origin/rcc/api' into dev/rust 2026-03-31 23:41:08 +00:00
mcp_client.rs Add first MCP client transport scaffolding 2026-03-31 20:42:49 +00:00
mcp_stdio.rs Add MCP server orchestration so configured stdio tools can be discovered and called 2026-03-31 23:31:37 +00:00
mcp.rs Add MCP normalization and config identity helpers 2026-03-31 20:23:00 +00:00
oauth.rs Enable Claude OAuth login without requiring API keys 2026-03-31 23:38:05 +00:00
permissions.rs Enforce tool permissions before execution 2026-04-01 00:06:15 +00:00
prompt.rs Keep project instructions informative without flooding the prompt 2026-03-31 19:32:42 +00:00
remote.rs Add fail-open remote proxy runtime primitives 2026-03-31 19:54:38 +00:00
session.rs feat: merge 2nd round from all rcc/* sessions 2026-03-31 17:43:25 +00:00
sse.rs feat: Rust port of Claude Code CLI 2026-03-31 17:43:09 +00:00
usage.rs Make Rust cost reporting aware of the active model 2026-03-31 19:42:31 +00:00