Skip to content

feat(roadmap): add gate tools to the runner, one shell policy - #3111

Merged
dan-petty merged 10 commits into
mainfrom
feat/3072-runner-image-tool-parity
Nov 1, 2026
Merged

dan-petty merged 10 commits into
mainfrom
feat/3072-runner-image-tool-parity

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The runner Job now holds more of the tools that the gate and the hooks need, and its shell reads one policy table.

Why: a check that needs a missing tool fails in the Job, or a test that needs it skips there, and the same change fails on the pull request later. Shell refusals of grep, cat, ls, head, tail and find ended 3 of 13 stops on 2026-11-01.

What changes:

  • RUNNER_TOOLS and NOT_IN_RUNNER in src/devops_cli/roadmap/runner_tools.py list each program that the image holds or leaves out, with the reason. Tests fail when a devops ci row, a hook, a required job of ci.yml, a live-marked test or tools.lock needs a program that is in neither table.
  • The runner stage adds curl, jq and promtool (tools.lock moves to 3.15.1, which passes the image scan). Its last step runs python -m devops_cli.roadmap.runner_tools, so a missing tool or a wrong pin fails the build. The smoke test of ci.yml and release.yml runs the same check and bounds the image size.
  • The image does not hold actionlint, shellcheck and Trivy. The image scan fails on the newest release of each. A Job cannot run the actionlint row, the IaC scan or the audit row (no npm), so the pull request runs them. feat(runner): add actionlint, shellcheck, Trivy when scan passes #3108 tracks their return.
  • The shell policy is one table in src/devops_cli/roadmap/implement_shell_policy.py. The allowlist, the refusal hint, the prompt and docs/ROADMAP_WORKFLOW.md read it. The shell now runs grep, cat, ls, head, tail and find. It refuses find arguments that run a program or write a file, any word with $ in find, and a redirect to a file for a read-only program.

Closes #3072

The runner stage adds shellcheck, curl, jq, actionlint, Trivy and promtool from the
same sources as the devcontainer and the gate. A table in code lists each tool and
its version command. The last build step runs it, so a missing tool fails the build.
Tests fail when a row, a hook, a job or a test needs a program outside the table.
…ograms (#3072)

The shell of an implement step runs git, uv, ruff, mypy and the read-only programs
grep, cat, ls, head, tail and find. find refuses -exec, -delete and the other
arguments that run a program or write a file, and the refusal says what to do.
One table now gives the allowlist, the refusal hint, the prompt and the workflow
document, and tests fail when they differ. k8s/README.md states the tools,
the size bound and the pull cost of the runner image.
# Conflicts:
#	src/devops_cli/ai/tasks/roadmap_implement_step.md
Review findings change the plan, so the change leaves the archive. The next archive commit closes it again.
#3072)

A program with access read changed no file only by its own work. A redirect with > wrote a file, and ${U} in a find word hid -exec from the guard.
The guard now refuses a redirect to a file for a read program, and a word with a dollar sign for find.
…#3072)

The image scan fails on the newest actionlint and Trivy, and on promtool 3.15.0. The image now holds promtool 3.15.1, curl and jq. NOTE: actionlint, shellcheck and Trivy wait for a release that passes the scan (#3108).
@dan-petty dan-petty added the type/feature Type feature: a new function label Nov 1, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results and review findings for #3072.

Fail-to-pass: uv run devops ci fail-to-pass --base origin/main shows 2 invariant tests that fail on the base (test_the_documented_size_bound_of_the_runner_image_is_the_bound_of_the_smoke_test, test_the_smoke_test_of_the_runner_image_is_the_same_in_ci_and_in_the_release). The 5 new test modules (shell policy, shell refusal, implement step, tool log, runner tools) cannot be collected on the base, because the modules they test do not exist there.

Image scan: trivy image --scanners vuln --severity HIGH,CRITICAL --ignore-unfixed --exit-code 1 --ignorefile .trivyignore on docker build --target runner exits 0. The build prints "All 28 runner tools run at their pins." The image is 2510467245 bytes (bound 3000000000), 578 MB compressed (522 MB before).

Full uv run devops ci on the host: 16107 tests pass, 2 fail, 1 error. All are host facts that do not touch this change: tests/ai/test_tool_executor_contract.py (popeye on PATH, #2165) and tests/commands/test_devcontainer_install_tools_dry_run.py::test_mark_only_commands_under_global_dry_run (this host has every tool installed, so the status table holds no "not installed" row). Every other check passes. The test check took 7m 29s on a host that ran four agents at the same time.

Findings fixed:

  • Blocker, image scan: the first build failed the scan for actionlint 1.17.0 (Go 1.27.0), Trivy 0.75.0 and promtool 3.15.0. promtool moves to 3.15.1 (Go 1.27.3, x/net 0.60.0), which is clean. No release of actionlint or Trivy passes: Trivy 0.76.1 still holds go-jose 4.1.5, and the only newer actionlint builds are nightly images. So actionlint, shellcheck (only actionlint runs it) and Trivy are in NOT_IN_RUNNER with the finding as the reason. No .trivyignore entry, no lower threshold. feat(runner): add actionlint, shellcheck, Trivy when scan passes #3108 tracks their return.
  • Major, redirect: a read-only program now refuses >, >>, >| and &> to a file. 2>&1, >&2 and >/dev/null run. The test fails first for grep ... > out.txt, cat a >> b and ls > f.
  • Major, expansion: find now refuses any word with $ (-ex${U}ec, -fpr${U}int, -del$IFS), because the shell expands it after the check. The prompt and docs/ROADMAP_WORKFLOW.md now state the redirect rule, so "access read changes no file" is true.
  • Minor, audit row: the proposal, docs/ROADMAP_WORKFLOW.md and k8s/README.md now say that a Job cannot run the audit, actionlint and IaC rows, and that the pull request runs them. The scoped CI of feat(roadmap): the implement job runs the scoped CI before it pushes and repairs failures #3043 chooses which rows a Job runs.
  • Minor, apt pins: shellcheck left the image. For git, curl and jq I declined to pin. Debian gives the version, the base image is pinned by digest, and a pin would fail the build on each security update. The proposal and k8s/README.md state the measured versions (git 2.47.3, curl 8.14.1, jq 1.7). The check proves that each tool runs.

Declined: a redirect check for the programs with access write or network (git, uv, ruff, mypy). Their redirect to .data/agent/scratch/ is a normal use, and they were allowed to redirect before this change.

@dan-petty dan-petty changed the title feat(runner): add gate tools to the runner, one shell policy feat(roadmap): add gate tools to the runner, one shell policy Nov 1, 2026
@dan-petty
dan-petty marked this pull request as ready for review November 1, 2026 21:52
@dan-petty
dan-petty merged commit 7735d8b into main Nov 1, 2026
22 of 23 checks passed
@dan-petty
dan-petty deleted the feat/3072-runner-image-tool-parity branch November 1, 2026 22:07
dan-petty added a commit that referenced this pull request Nov 1, 2026
…3115)

## What changes

The test
`test_a_hostile_agents_md_is_data_and_never_changes_the_instructions`
compares `inputs.instructions` with
`fill_prompt(load_task_prompt("roadmap_implement_step.md"))`. It
compared with the raw prompt, which #3111 stopped returning when it made
`build_step_inputs` fill the two table placeholders. The merge of #3107
and #3111 left the required check Tests & Coverage red on `main`.

## Why

A red `main` blocks every open pull request, such as #3112. The test
still proves its rule: a hostile `AGENTS.md` leaves the instructions
unchanged.

## Verification

- Before: `uv run pytest
tests/roadmap/test_roadmap_implement_step_rules.py -k hostile -n0` on
`origin/main` fails with `(False, True, True)`.
- After: the same file passes (11 tests).

Closes #3114
dan-petty-release Bot added a commit that referenced this pull request Nov 1, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.38.0](v0.37.4...v0.38.0)
(2026-11-01)


### Features

* **review:** osv-scanner toolrun records its database digest
([#3120](#3120))
([5731fac](5731fac))
* **roadmap:** add gate tools to the runner, one shell policy
([#3111](#3111))
([7735d8b](7735d8b)),
closes [#3072](#3072)
* **roadmap:** give the step AGENTS.md and routed rules
([#3107](#3107))
([80a22eb](80a22eb)),
closes [#3097](#3097)
* **roadmap:** run the project hooks and scoped CI in the Job
([#3112](#3112))
([b7ab211](b7ab211)),
closes [#3043](#3043)


### Bug Fixes

* **ai:** send the per-call sampling of LLMClient.chat
([#3126](#3126))
([8207bdc](8207bdc))
* **argo:** replace a token that Argo CD refuses
([#3121](#3121))
([b4955b4](b4955b4))
* **devcontainer:** remove CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC
([#3125](#3125))
([295c32c](295c32c))
* **k8s:** set q8_0 KV cache on every Ollama tier
([#3101](#3101))
([aad0115](aad0115))
* **rag:** raise EmbeddingsError for an empty Ollama URL list
([#3118](#3118))
([111a031](111a031))
* **security:** refuse PYTEST_ADDOPTS and npm_config_logs_dir overrides
([#3119](#3119))
([9fe2af5](9fe2af5))


### Code Refactoring

* **security:** read legacy numeric hosts with getaddrinfo
([#3128](#3128))
([41779f9](41779f9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
dan-petty added a commit that referenced this pull request Nov 2, 2026
## What changes

The Job leaves out of its hook configuration any hook whose program the
runner image does not hold. Today that is
`devops-ci-workflows-pre-push`, which runs `actionlint`. The checks of
the pull request run it.

- `runner_tools.py`: `HOOK_PROGRAMS` (hook id to programs) and
`hooks_without_programs()`.
- `implement_hooks.py`: `trusted_config` drops those hooks from the copy
it writes for every hook run, and a repository that keeps no hook. The
copy is the same text when nothing is dropped.
- Tests: the copy without the hook, the copy with the program on PATH, a
repository with no hook left, the search-path check, and a check that
each skipped hook is in `.pre-commit-config.yaml` and each program is in
`NOT_IN_RUNNER`.

## Why

#3111 left `actionlint` out of the runner image, and #3112 made the Job
run the hooks of the `pre-push` stage. So an item that changes a
workflow file failed that hook in the Job, no agent could repair it, and
the Job stopped with no push. The independent review of #3112 proved the
failure.

## Verification

- `pre-commit validate-config` accepts the repository configuration with
that hook removed (17 of 18 hooks stay).
- `uv run devops ci test tests/roadmap` and the invariant tests pass
(2642 tests).

Closes #3136
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(runner): the runner image carries every development tool, and the shell policy is one table

1 participant