Skip to main content

Module exec_misuse

Module exec_misuse 

Source
Expand description

Detect quoted single-command misuse in rch exec (bd-session-history-remediation-ocv9i.13.1).

Agents repeatedly ran rch exec "cargo check --all-targets" — the whole command as one quoted string, with no -- separator. Clap then treats cargo check --all-targets as a single program name and RCH tries to exec a bogus binary. This module detects that shape and, instead of running anything, returns a clear correction: rch exec -- cargo check --all-targets.

detect_exec_misuse is pure: given the argv after exec and whether a -- separator was present, it decides misuse and builds the suggestion. The ExecMisuseReport carries reason_code = exec_quoted_command_misuse, the parsed suggestion, and the original argv for a machine-readable error.

Structs§

ExecMisuseReport
The result of checking rch exec argv for quoted-command misuse.

Constants§

QUOTED_MISUSE_REASON
The stable reason code string for this misuse (not an RCH-Innn incident code — it is a CLI-usage error, surfaced verbatim in the JSON error).

Functions§

detect_exec_misuse
Detect quoted single-command misuse. Pure.