Repository navigation
feat(roadmap): add gate tools to the runner, one shell policy - #3111
Conversation
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.
|
Test results and review findings for #3072. Fail-to-pass: Image scan: Full Findings fixed:
Declined: a redirect check for the programs with access |
…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
🤖 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>
## 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
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,tailandfindended 3 of 13 stops on 2026-11-01.What changes:
RUNNER_TOOLSandNOT_IN_RUNNERinsrc/devops_cli/roadmap/runner_tools.pylist each program that the image holds or leaves out, with the reason. Tests fail when adevops cirow, a hook, a required job ofci.yml, a live-marked test ortools.lockneeds a program that is in neither table.runnerstage addscurl,jqand promtool (tools.lockmoves to 3.15.1, which passes the image scan). Its last step runspython -m devops_cli.roadmap.runner_tools, so a missing tool or a wrong pin fails the build. The smoke test ofci.ymlandrelease.ymlruns the same check and bounds the image size.actionlint,shellcheckand Trivy. The image scan fails on the newest release of each. A Job cannot run theactionlintrow, the IaC scan or theauditrow (no npm), so the pull request runs them. feat(runner): add actionlint, shellcheck, Trivy when scan passes #3108 tracks their return.src/devops_cli/roadmap/implement_shell_policy.py. The allowlist, the refusal hint, the prompt anddocs/ROADMAP_WORKFLOW.mdread it. The shell now runsgrep,cat,ls,head,tailandfind. It refusesfindarguments that run a program or write a file, any word with$infind, and a redirect to a file for a read-only program.Closes #3072