Wait for a child process with output-size and time limits.
Kills the process if either limit is exceeded, returning what was
captured so far. Prevents unbounded memory growth on commands that
produce massive output (e.g. rg -i "pattern" over a large tree).
Hard ceiling for a per-call timeout_ms override: generous enough for any
legitimate build/release job, low enough that a typo’d value cannot wedge
the executor for days.
Label inserted between stdout and stderr of a FAILED command so the agent can
attribute the error to the right stream instead of guessing — and never has to
re-run the command raw just to locate the failure. See #809 / #812.
Shared allowlist gate for the CLI shell entrypoints — -c (via exec) and
-t (via exec_argv). Both must apply the SAME boundary so the track path
(the default shell hook) cannot be weaker than the compress path.
Join captured stdout and stderr for display/recovery. On failure (non-zero
exit) with both streams present, a labeled delimiter separates them; success
output keeps the plain stdout\nstderr shape (determinism, #498).
Execute a command from pre-split argv without going through sh -c.
Used by -t mode when the shell hook passes "$@" — arguments are
already correctly split by the user’s shell, so re-serializing them
into a string and re-parsing via sh -c would risk mangling complex
quoted arguments (em-dashes, #, nested quotes, etc.).
Execute an allowlist-admitted value through the existing post-gate routes.
Admission is complete before this function runs; no allowlist check belongs
here. Dispatch is considered attempted before entering a child helper, so a
spawn failure with exit 127 is still an attempted dispatch.