Repository navigation
Description
Problem or Motivation
src/devops_cli/roadmap/implement/implement_shell_policy.py:119-215allowsuv,ruffandmypy, and listsLOCAL_COMMANDSthat are alluv run devops, in every repository.- The refusals point to
uv run pytest. - The dotfiles runner log of 2026-11-01 shows
uv run bash tests/test_tmux_conf.sh ... program uv, ok. So the agent useduvto get around the refusal of other programs. roadmap_implement_step.md:45names "ruff, the ast-grep rules of src and tests, and the OpenSpec gate" for every target, but the job runs the hooks of the target.
Proposed Solution & Architectural Design
- The shell policy keeps the base set (git and the read tools) and the refusal logic in code.
- The preset adds its programs, local commands and refusal texts. devops-cli: the current tables. neutral:
devopsandopenspecfrom the image, and nouv,rufformypy. - A preset only selects from
RUNNER_TOOLS. A test fails when a preset names a program thatNOT_IN_RUNNERlists. - The implement prompt renders the 3 tables and a hooks sentence through feat(ai): the prompt loader renders Jinja with project values #4633. The hooks sentence lists the hook ids of the trusted
.pre-commit-config.yaml, or says that there are none. - The pull request has a security section, because the allowlist is a security surface (SECURITY.md item 6).
Target Subsystem
SDLC, Git & PR Governance (src/devops_cli/roadmap/implement/implement_shell_policy.py).
Existing Tool Considered
The shell policy and the bubblewrap sandbox stay. No tool gives an allowlist from a toolchain, so the preset data feeds the existing policy. Cost: about 80 lines, 20 prompt tests move, about 300,000 tokens and 4 hours to build, about 5,000 tokens a month to keep.
Acceptance Criteria
- A test: the devops-cli preset gives the same allowed and refused decisions as today for each case in the current 22 shell-policy test files.
- A test: with the neutral preset,
uv run bash x.shis refused andgit grep foois allowed. - A test: every program of every preset is in
RUNNER_TOOLSand not inNOT_IN_RUNNER. - A test: the rendered prompt for a repository with no hooks does not contain "ruff" or "ast-grep".
- The pull request has a security section.
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Source: #4627
Alternatives check of 2026-11-26: partly.
Tool: nickderobertis/allowlister (https://github.com/nickderobertis/allowlister), MIT, last activity 2026-11-13, maintained.
Reason: Searches found allowlister, a Rust CLI that decides allow, deny, ask or defer for one shell command from one per-project config, with argv matching and read-only and repo-write profiles. It covers only the allowlist half, with no toolchain preset, refusal texts or prompt rendering.
Covers:
- Per-project config with argv, glob and regex rules
- Allow, deny, ask and defer verdicts
- Recommended read-only and repo-write profiles
Lacks:
- No toolchain preset sourced from RUNNER_TOOLS
- No refusal texts naming the command to run instead
- No rendering of preset tables or trusted hook ids
- Enforces through agent harness hooks, not the runner sandbox
Proposed design
Problem statement
The prompt work can proceed now. The shell tables cannot: #6527 deleted implement_shell_policy.py, and #6521 decides whether the allowlist returns. The implement prompt does not name the trusted pre-commit hook ids that the job runs. The agent cannot see which hooks will run before the push.
Acceptance criteria
Requirement: The prompt lists the trusted hook ids
The implement prompt SHALL list the ids of the hooks of the trusted .pre-commit-config.yaml at the base commit in one sentence.
Scenario: The prompt names the ruff hook of the trusted config
- WHEN the prompt renders for a repository whose trusted
.pre-commit-config.yamlholds theruff-checkhook - THEN the rendered prompt holds
ruff-check
Requirement: A repository with no hooks says so
The implement prompt MUST say that there are no hooks when the trusted .pre-commit-config.yaml at the base commit holds no hook.
Scenario: The prompt of a repository with no hooks names no tool
- WHEN the prompt renders for a repository whose trusted
.pre-commit-config.yamlholds no hooks - THEN the rendered prompt holds no
ruffand noast-grepand says that there are no hooks
Requirement: A hook the image cannot run is left out
The hooks sentence SHALL name only the hooks that the job runs, so it MUST leave out each hook of HOOK_PROGRAMS whose program the image lacks.
Scenario: A hook whose program is missing is left out
- WHEN the trusted config holds a hook of
HOOK_PROGRAMSwhose program is not onPATH - THEN the rendered prompt does not name that hook id
Requirement: The hook ids come from the base commit
The hook ids MUST come from the trusted .pre-commit-config.yaml at the base commit, not from the .pre-commit-config.yaml of the checkout.
Scenario: A checkout edit cannot change the sentence
- WHEN the checkout's
.pre-commit-config.yamllists a hook that the base commit does not hold - THEN the rendered prompt names only the hooks of the base commit
Existing Tool Considered
The alternatives check of 2026-11-26 in the issue body gives the verdict partly for nickderobertis/allowlister (MIT, last activity 2026-11-13, maintained). The block's Covers: and Lacks: lists state what the tool covers and lacks. It does not render a hooks sentence, so this plan builds that sentence in implement_step.py and implement_hooks.py: about 40 lines and four prompt tests, about 80,000 tokens and 1.5 hours to build, about 20,000 tokens and 2 hours to fix, and about 1,000 tokens a month to keep.
Key questions
- Which programs and commands does the shell policy hold today?: None. At this commit
src/devops_cli/roadmap/implement/implement_shell_policy.pyis deleted.step_shellbuilds the stock harnessShellwith emptyallowed_commands,denied_commandsanddenied_operators. Every program of the runner image runs. The shell tables wait on chore(roadmap): hold incremental stage and implement work #6521. [sources: src/devops_cli/roadmap/implement/implement_shell.py:59, src/devops_cli/roadmap/implement/implement_shell.py:64, src/devops_cli/roadmap/implement/implement_shell.py:67, docs/ROADMAP_WORKFLOW.md:314] - Which programs does the runner image hold, and which does it lack?:
RUNNER_TOOLSholds each program of the runner image with its source and the reason a Job needs it.NOT_IN_RUNNERnames each program that no step of a Job counts on, with the reason.hooks_without_programsreturns the ids of the hooks whose program is missing. [sources: src/devops_cli/roadmap/runner_tools.py:119, src/devops_cli/roadmap/runner_tools.py:245, src/devops_cli/roadmap/runner_tools.py:235] - How does a repository select its preset?: The base commit's
.devops/roadmap.tomldeclaresproject.toolchain.resolve_profilemaps the name throughPRESETS. A repository with no file getsNEUTRAL_PRESET.devops-cliandneutralare the two presets. [sources: src/devops_cli/roadmap/project_profile.py:90, src/devops_cli/roadmap/project_profile.py:108, src/devops_cli/roadmap/toolchains.py:75] - Does the preset still supply the shell programs, local commands and refusal texts?: No. refactor(roadmap): run implement on stock Coder with a real shell #6527 removed the implement allowlist and refusal table. The preset keeps the checks and commands of feat(roadmap): a toolchain preset sets the implement checks #4635 and adds no shell table. The shell part moves to a new issue that waits on chore(roadmap): hold incremental stage and implement work #6521. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:314, src/devops_cli/roadmap/toolchains.py:17, SECURITY.md:22]
- Chosen: Keep the preset as the checks and commands of feat(roadmap): a toolchain preset sets the implement checks #4635, and defer the shell tables. the shell policy that would read the tables is deleted, and chore(roadmap): hold incremental stage and implement work #6521 decides whether it returns
- Rejected: Add
programs,local_commandsandrefusalstoToolchainPreset. it would add fields that no code reads, and it would reintroduce the allowlist that refactor(roadmap): run implement on stock Coder with a real shell #6527 removed before chore(roadmap): hold incremental stage and implement work #6521 decides - Rejected: Restore
implement_shell_policy.pyand select it by preset. it reverses the recorded decision of refactor(roadmap): run implement on stock Coder with a real shell #6527 while the re-architecture of chore(roadmap): hold incremental stage and implement work #6521 is open
- How does the implement prompt get the hook ids of the target?:
run_stepalready receives the trusted config path ashooks.build_step_inputspasses it tostep_instructions(hooks). That function parses the ids of the file and passes them toload_task_prompt. The file istrusted_config(source, ref): the.pre-commit-config.yamlof the base commit minus the hooks whose program the image lacks. With no file, the prompt says that there are no hooks. (best practice) [sources: src/devops_cli/roadmap/implement/implement_step.py:387, src/devops_cli/roadmap/implement/implement_step.py:2419, src/devops_cli/roadmap/implement/implement_step.py:2493, src/devops_cli/roadmap/implement/implement_hooks.py:99, src/devops_cli/roadmap/implement/implement_hooks.py:113]- Chosen: Parse the trusted config path that
run_stepalready receives. the step holds that path for the hook run, so the sentence and the run read the same file - Rejected: Read the
.pre-commit-config.yamlof the checkout. the agent can edit it, so an edit such asrepos: []would hide the hooks (implement_hooks.py:12-14) - Rejected: Keep a fixed list of hook ids in the prompt. it is wrong for a target whose hooks differ, and the current prompt already holds no fixed list (refactor(roadmap): run implement on stock Coder with a real shell #6527)
- Chosen: Parse the trusted config path that
- How does the prompt render the hooks sentence?: The prompt uses the Jinja context of feat(ai): the prompt loader renders Jinja with project values #4633.
step_instructions(hooks)passes ahooksvalue toload_task_prompt.roadmap_implement_step.mdholds the sentence or the no-hooks text. The token count ofbuild_step_inputsincludes the sentence, so the hooks path goes tobuild_step_inputsbefore it measures the inputs. (best practice) [sources: src/devops_cli/roadmap/implement/implement_step.py:191, src/devops_cli/roadmap/implement/implement_step.py:194, src/devops_cli/ai/tasks/roadmap_implement_step.md:45, tests/ai/test_ai_task_loader.py:104]- Chosen: A
hookskey in the Jinja context ofstep_instructions. feat(ai): the prompt loader renders Jinja with project values #4633 renders the prompt through Jinja, andtest_ai_task_loader.py:104asserts that thestr.replacefilling is gone - Rejected: A second prompt file for a repository with hooks. two prompts drift, and the hook ids are data of one sentence
- Rejected: Fill the sentence with
str.replace. the replacement filling is gone since feat(ai): the prompt loader renders Jinja with project values #4633
- Chosen: A
- Does the pull request need a security section?: No. SECURITY.md item 6 names the bubblewrap sandbox that confines shell commands. CONTEXT.md says the shell checks only the first word and is no security boundary. refactor(roadmap): run implement on stock Coder with a real shell #6527 removed the allowlist. A prompt-rendering change touches no allowlist or sandbox setting. (best practice) [sources: SECURITY.md:22, CONTEXT.md:150, docs/ROADMAP_WORKFLOW.md:314]
- Chosen: No security section. the change renders trusted hook ids into the prompt and changes no allowlist, sandbox or credential
- Rejected: Keep the security section of the issue. it would describe an allowlist that refactor(roadmap): run implement on stock Coder with a real shell #6527 deleted, so the section would name no surface of this change
- Are feat(ai): the prompt loader renders Jinja with project values #4633 and feat(roadmap): a toolchain preset sets the implement checks #4635 still open dependencies?: No. The code of feat(roadmap): a toolchain preset sets the implement checks #4635 is in place as
ToolchainPreset,DEVOPS_CLI_PRESET,NEUTRAL_PRESETandPRESETSintoolchains.py. The code of feat(ai): the prompt loader renders Jinja with project values #4633 is in place as the Jinja rendering ofstep_instructionsthroughload_task_prompt. chore(roadmap): hold incremental stage and implement work #6521 is a dependency only of the deferred shell part. [sources: src/devops_cli/roadmap/toolchains.py:17, src/devops_cli/roadmap/toolchains.py:75, src/devops_cli/roadmap/implement/implement_step.py:191]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It parameterises existing behaviour and has no user-facing breakage, so it is not urgent but is planned work.It lets the same runner serve different toolchains without code changes, which is useful but not critical.The body estimates about 80 lines of code and 20 prompt tests to move, which is moderate work.Both shape the implement shell policy table, but #3072 unifies it into one table in the runner image while this candidate parameterises that table by preset.devops-cli-service commentedon Nov 13, 2026
Alternatives check: partly
Reason: The searches found allowlister, a Rust CLI that keeps one per-project allowlist and decides allow/deny/ask/defer for the shell commands an agent proposes, which overlaps the allow/refuse decision the issue wants to parameterise. It does not derive programs from a toolchain preset, emit refusal texts, or render the preset tables and hooks sentence into the implement prompt, so most of the issue's work is still needed.
Tool: nickderobertis/allowlister (https://github.com/nickderobertis/allowlister)
Covers:
uv run bash x.shis judged as a wholeLacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-13. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 14, 2026
Refine cannot set this item to Ready at 0410772 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 1812dd2 (see proposed design in issue body).
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
2 remaining items
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.
devops-cli-service commentedon Nov 29, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
feat(roadmap): render trusted hooks in implement prompt (#4645)
feat(roadmap): render trusted hooks in implement prompt (#4645)
chore(main): release 0.248.0 (#7763)
devops-cli-service commentedon Nov 29, 2026
Released in v0.248.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.248.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:50 UTC