Repository navigation
Description
Problem or Motivation
Plan verify commands have their own program lists and rules in four places:
read_verification(implement_shell_policy.py:485-516);- the stage form gate (stage_form.py:65-89);
- the plan reader (plan_read.py:355-379);
- plan amendment (implement_amend.py:170-209).
The amendment refuses a ! git grep negative search that the stage gate accepts (implement_amend.py:181 against stage_form.py:65-68). The program list is a constant, and the configured lists of the command gate (#5201) do not drive it.
Proposed Solution & Architectural Design
Add the argv profile implement_verify to command_gate/profiles.py.
- Its parse tier is shlex plus the rules of
read_verification, as they are today: NUL, 2,000 characters, and the negative-search grammar. - Its list tier uses the same merged lists and argument models as
implement_shell. It has no Jev tier. - stage_form, plan_read, plan_rewrite and implement_amend call
judge(..., profile=implement_verify). - The convention rules stay where they are: the
uv run devopsform, the manifest form and NOT_IN_RUNNER. - Amendment accepts the negative search, as the stage gate does.
This item edits profiles.py and the plan modules only. It does not touch gate.py, which the Jev item of tracker #5199 changes.
Files: src/devops_cli/roadmap/command_gate/profiles.py, src/devops_cli/roadmap/implement/implement_shell_policy.py, src/devops_cli/roadmap/implement/implement_amend.py, src/devops_cli/roadmap/stage/stage_form.py, src/devops_cli/roadmap/plan_read.py, src/devops_cli/roadmap/plan_rewrite.py, tests/roadmap/command_gate/plan_verify_cases.json, tests/roadmap/command_gate/test_roadmap_command_gate_verify.py, tests/roadmap/implement/test_roadmap_implement_amend.py.
Target Subsystem
SDLC, Git & PR Governance (src/devops_cli/roadmap/, the plan and stage gates).
Existing Tool Considered
The shared command gate of #5201. This item moves code and builds no new part. Cost: about 0.4M tokens and half a day.
Acceptance Criteria
tests/roadmap/command_gate/test_roadmap_command_gate_verify.py:! git grep -n -e foo -- srcgives run in profileimplement_verify;git grep -O xgives refuse with the rule ofread_verification.tests/roadmap/implement/test_roadmap_implement_amend.py: an amendment to a negative-search verify command is accepted.- Real plan pull requests:
tests/roadmap/command_gate/plan_verify_cases.jsonholds every verify command from tasks.md of the 9 open Service plan pull requests and of the merged Service plan pull requests since 2026-11-01 (author app/devops-cli-service, 203 pull requests in total). The test asserts that the shared gate gives the same verdict asread_verificationat origin/main for each of them. The pull request lists each difference with its reason. uv run devops ci test tests/roadmap/command_gate tests/roadmap/stage tests/roadmap/implementpasses.
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)
-
feat(roadmap): check shell commands with a parser and configured lists #5201: the gate package, the lists and the argument models.
Related
- Tracker: feat(roadmap): track the shared command gate #5199.
- This item folds the difference between Gate E (stage form) and Gate G (amendment) on negative searches.
Source: #5199
Alternatives check of 2026-11-22: not-applicable.
Class: refactor, no search.
Tool: none found.
Proposed design
Problem statement
Plan verify commands are judged by four separate call sites. They disagree on negative searches: the stage form accepts a ! git grep command, but the amendment refuses it. The program list is a constant, so the configured lists of the shared command gate #5201 do not drive the plan gates. This change adds the implement_verify profile and makes the four plan call sites use it. The convention rules stay in their current modules.
Acceptance criteria
Requirement: Verify profile accepts a negative search
The implement_verify profile SHALL accept a negative-search verify command that matches the read_verification grammar.
Scenario: Negative search runs
- WHEN A test in
tests/roadmap/command_gate/test_roadmap_command_gate_verify.pycallsjudgewith profileimplement_verifyand the command! git grep -n -e foo -- src. - THEN The judge returns run.
Requirement: Verify profile refuses a bad git command
The implement_verify profile SHALL refuse a git command that read_verification refuses.
Scenario: Refused git command
- WHEN A test calls
judgewith profileimplement_verifyand the commandgit grep -O x. - THEN The judge returns refuse with the
read_verificationreason thatgitruns only as the negative search.
Requirement: Verify profile refuses a NUL word
The implement_verify profile SHALL refuse a verify command whose word holds a NUL byte, as read_verification does.
Scenario: Refused NUL word
- WHEN A test calls
judgewith profileimplement_verifyand a command whose word holds a NUL byte. - THEN The judge returns refuse with the
read_verificationbyte rule.
Requirement: Verify profile refuses an over-long command
The implement_verify profile SHALL refuse a verify command longer than 2,000 characters, as read_verification does.
Scenario: Refused long command
- WHEN A test calls
judgewith profileimplement_verifyand a command whose words hold more than 2,000 characters in all. - THEN The judge returns refuse with the
read_verificationlong-command rule.
Requirement: Verify profile reuses the shell lists
The implement_verify profile SHALL use the same merged lists and argument models as implement_shell.
Scenario: Same list tier
- WHEN A test compares the list tier of
implement_verifywith the list tier ofimplement_shell. - THEN The lists and argument models are equal, and
implement_verifyhas no Jev tier.
Requirement: Four plan call sites use the shared profile
The stage form, plan reader, plan rewrite and amendment SHALL judge verify commands with judge(..., profile=implement_verify).
Scenario: Each caller uses the profile
- WHEN A test patches
judgeinstage_form,plan_read,plan_rewriteandimplement_amendand sends a verify command to each. - THEN Each call records the
implement_verifyprofile.
Requirement: Amendment accepts a negative search
The amendment SHALL accept a negative-search verify command that the stage form accepts.
Scenario: Amend to a negative search
- WHEN A test in
tests/roadmap/implement/test_roadmap_implement_amend.pyamends a verify command to! git grep -n -e foo -- srcand adds a task whose verify is the same command. - THEN Both amendments are applied, not refused.
Requirement: NOT_IN_RUNNER still refuses
The stage content check SHALL still refuse a verify command that names a program of NOT_IN_RUNNER when Feasibility names no capability for it.
Scenario: Program not in runner
- WHEN A test in
tests/roadmap/stage/test_roadmap_stage_content.pysends a plan whose group verify ishelm template k8s/devopsand whose Feasibility names no capability. - THEN The stage content check returns a problem that names
helmas a program that the runner cannot run.
Requirement: Stage form keeps the project form
The stage form SHALL keep the uv run devops form rule in the caller.
Scenario: Project form still refused
- WHEN A test in
tests/roadmap/stage/test_roadmap_stage_verify.pysendsgrep foo src/as a group verify command. - THEN The stage form returns a problem that names the
uv run devopsform.
Requirement: Manifest form keeps its rule
The stage form SHALL keep the manifest verify form uv run devops ci test <path> in the caller.
Scenario: Manifest form still refused
- WHEN A test in
tests/roadmap/stage/test_roadmap_stage_manifest.pysends a manifest group whose verify isuv run devops ci test tests/other.py, a path outside the group. - THEN The stage form returns a problem that names the manifest verify form.
Requirement: Focused suites pass
The change SHALL pass the roadmap command gate, stage and implement test suites.
Scenario: Run the focused suites
- WHEN The command
uv run devops ci test tests/roadmap/command_gate tests/roadmap/stage tests/roadmap/implementruns. - THEN The command exits 0.
Existing Tool Considered
The alternatives check of 2026-11-22 records not-applicable for this refactor and names no tool; see the alternatives block in the issue body for the result. No external open tool is named for this internal refactor. The change reuses the shared command gate of #5201 and writes no new parser or list. Cost: about 0.4M tokens to build, about 30k tokens a month to keep and fix, and half a day of elapsed time.
Key questions
- Which parse tier does the
implement_verifyprofile use?: It usesshlexplus theread_verificationrules: no NUL byte, at most 2,000 characters in all, and the negative-search grammar. It adds no parser. (best practice) [sources: src/devops_cli/roadmap/stage/stage_form.py:65]- Chosen: Reuse
shlexand theread_verificationrules. The rules already exist inread_verification, and one rule then decides the step and the plan gates. - Rejected: Add
bashlex. The project already usesshlex, andbashlexgives no program list, argument model or negative-search grammar. - Rejected: Write a new parser. It duplicates the rules and can drift from the step.
- Rejected: Use the
implement_shellparse tier. The shell tier lacks the NUL, 2,000-character and negative-search rules.
- Chosen: Reuse
- Which list tier does
implement_verifyuse?: It uses the same merged lists and argument models asimplement_shell, so the configured lists of feat(roadmap): check shell commands with a parser and configured lists #5201 drive the plan gates. It has no Jev tier. (best practice) [sources: src/devops_cli/roadmap/implement/implement_amend.py]- Chosen: Reuse the
implement_shelllists. The configured lists of feat(roadmap): check shell commands with a parser and configured lists #5201 then drive the plan gates, and one list decides the shell and the verify command. - Rejected: Keep the local program constant. The constant is the cause of the split behavior.
- Rejected: Add a Jev tier. A plan verify command needs no Jev judgment.
- Chosen: Reuse the
- Which plan modules call
judge(..., profile=implement_verify)?: The stage form, plan reader, plan rewrite and amendment call it. (best practice) [sources: src/devops_cli/roadmap/stage/stage_form.py, src/devops_cli/roadmap/plan_read.py, src/devops_cli/roadmap/plan_rewrite.py, src/devops_cli/roadmap/implement/implement_amend.py]- Chosen: All four plan modules. The issue names four separate implementations, and one rule must decide every plan verify command.
- Rejected: Only the stage form and amendment. The plan reader and rewrite keep their own rules.
- Rejected: Only the amendment. The other three gates still disagree.
- Does the amendment accept a negative-search verify command?: Yes. The amendment uses the shared profile in
_judge_commandand_judge_task, so it accepts the command that the stage form accepts. (best practice) [sources: src/devops_cli/roadmap/implement/implement_amend.py:170, src/devops_cli/roadmap/stage/stage_form.py:65]- Chosen: Accept through the shared gate. The stage form already accepts the command, and the two gates must agree.
- Rejected: Keep the amendment refusal. It keeps the known difference between Gate E and Gate G.
- Do the convention rules move into the
implement_verifyprofile?: No. Theuv run devopsform and the manifest form stay instage_form.py. The NOT_IN_RUNNER rule stays in the stage content check. (best practice) [sources: src/devops_cli/roadmap/stage/stage_form.py, src/devops_cli/roadmap/stage/stage_change.py]- Chosen: Keep them in the stage form and the stage content check. The form rules depend on the plan context, and the NOT_IN_RUNNER rule needs the Feasibility text.
- Rejected: Move them into the profile. The profile would need plan context and would duplicate the stage form and the content check.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
Both address the inconsistency where the stage gate accepts '! git grep' but the implement step refuses it, but the candidate adds a shared 'implement_verify' profile to the command gate while #3263 patched the allowlist directly.devops-cli-service commentedon Nov 16, 2026
Alternatives check: not-applicable
Class: refactor. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Refine cannot set this item to Ready at 8ccd95a 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.
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.
devops-cli-service commentedon Nov 21, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
dan-petty commentedon Nov 30, 2026
Triage under #6519 (owner instruction of 2026-11-30), before the hold #6521 closes. This item adds or extends a gate, refusal, screen, cap, limit, retry, result line, shell allowlist, tool catalog or plan-shape rule of the stage, implement or fix-checks job. #6519 found that 263 of about 900 issues in four weeks added such rules and none replaced the engine. Stage now runs on stock Coder (grade 60 on 30 graded attempts), where the agent reads the repository, runs the checks in its loop and has a real shell; implement follows (#6527). The code paths that this item names have also moved. If the failure class still shows in graded attempts, file a new item from that evidence. Closed as not planned; a person may reopen it.