Skip to main content

Module exec_policy

Module exec_policy 

Source
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§

ExecContext
The execution context + explicit overrides for the policy.
ExecDecision
The policy decision plus its message.

Enums§

ExecDisposition
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 command is a known local-state-mutating command. Skips leading env VAR=value assignments and any flags between the tool and subcommand.