Expand description
Explicit-exec policy for non-compilation commands (bd-session-history-remediation-ocv9i.13.2).
There are two execution contexts and they must behave differently:
- Hook mode (the PreToolUse hook): a non-compilation command stays local and fail-open — RCH must never get in the way of a command the agent didn’t ask it to offload.
- Explicit
rch exec: the user explicitly asked RCH to participate, so silence is wrong. The output must say clearly whether RCH will reject the command, run it remotely by explicit override, or run it locally as a fallback — and the policy is deliberately conservative for commands that mutate local state (formatting, installs), which must never be shipped to a worker where the mutation would land on the wrong filesystem.
decide_exec_policy is the pure decision; ExecDecision carries the
disposition and the operator/agent-facing message.
Structs§
- Exec
Context - The execution context + explicit overrides for the policy.
- Exec
Decision - The policy decision plus its message.
Enums§
- Exec
Disposition - What RCH will do with the command.
Functions§
- decide_
exec_ policy - Decide the explicit-exec policy for a command. Pure and total.
- mutates_
local_ state - Whether
commandis a known local-state-mutating command. Skips leadingenv VAR=valueassignments and any flags between the tool and subcommand.