3"""Exact reviewed non-command occurrences for the shell caller authority."""
5from __future__
import annotations
7from dataclasses
import dataclass
9PROCESS_CALLS = frozenset(
11 "asyncio.create_subprocess_exec",
12 "asyncio.create_subprocess_shell",
20 "subprocess.check_call",
21 "subprocess.check_output",
25SHELL_FENCE_LANGUAGES = frozenset({
"bash",
"console",
"sh",
"shell",
"zsh"})
26JSON_FENCE_LANGUAGES = frozenset({
"json",
"jsonc"})
27YAML_COMMAND_KEYS = frozenset({
"cmd",
"command",
"run",
"shell"})
28DOCKER_COMMANDS = frozenset({
"CMD",
"ENTRYPOINT",
"RUN"})
31@dataclass(frozen=True)
33 """One reviewed non-executable or structurally nested governed occurrence."""
43 "scripts/ci/gates/tests.sh",
44 "scripts/dev/agent_workspace.sh",
45 "/bin/bash -p -n scripts/dev/agent_workspace.sh",
46 "Bash parses this file without executing it; the executable caller is separately checked.",
49 "scripts/emu/smoke.sh",
50 "scripts/emu/smoke_run.sh",
51 'if ! grep -q "^$fn() {" "$ROOT/scripts/emu/smoke_run.sh"; then',
52 "The smoke selftest reads function declarations as data and never launches the helper.",
55 "scripts/emu/smoke.sh",
56 "scripts/emu/smoke_apps.sh",
58 "ov_apps=\"$(awk '/^uart_expect_override\\(\\)/{f=1} "
59 'f&&/^}/{f=0} f\' "$ROOT/scripts/emu/smoke_apps.sh" | '
60 "grep -oE '^[[:space:]]+[a-z0-9_]+\\)' | tr -d ' )')\""
62 "The smoke selftest parses a case table as data and never launches the helper.",
65 "scripts/git/hook-launcher",
66 "scripts/git/pre-commit",
68 "exec env -u BASH_ENV -u ENV -u PYTHONHOME -u PYTHONPATH "
69 '"$bash_bin" -p "$owner" "${hook_args[@]}"'
72 "The launcher verifies Bash and the immutable hook owner by exact "
73 "path, blob, and inode first."
77 "scripts/ci/lib/container.sh",
80 'exec "${runtime[@]}" run --rm --init -u 0:0 '
81 "--tmpfs /home/ra8-ci:rw,mode=0700 -e RA8_CI_INNER=1 "
82 '-e RA8_CI_FAST="$fast" -e RA8_CI_GATE="$gate" '
83 "-e HOME=/home/ra8-ci "
84 "-e GIT_CONFIG_COUNT=1 -e GIT_CONFIG_KEY_0=safe.directory "
85 "-e GIT_CONFIG_VALUE_0=/workspace "
87 '-e CMAKE_BUILD_PARALLEL_LEVEL="${CMAKE_BUILD_PARALLEL_LEVEL:-'
88 '${RA8_MAX_JOBS:-}}" -v "$repo":/workspace:ro '
89 '${extra[@]+"${extra[@]}"} ${worktree[@]+"${worktree[@]}"} '
90 '${ccache[@]+"${ccache[@]}"} ${toolcache[@]+"${toolcache[@]}"} '
91 '"${nofile[@]}" -w /workspace "$image" /bin/bash -p scripts/ci.sh'
94 "The reviewed container-runtime argv executes the exact privileged "
95 "Bash prefix only after the selected pinned image."