Repository navigation
Description
Problem or Motivation
The stage planning job permits a task group to change a workflow file under .github/workflows/ without requiring a workflow contract test in tests/invariants/test_workflow_contracts.py.
In issue #2163 (pull request #4031), the stage planner placed the .github/workflows/ci.yml edit in Group 2 with the verification command uv run devops ci --check --only actionlint,zizmor, and deferred the contract test to Group 3.
This design has two defects:
- It breaks the test-first rule of AGENTS.md (Rule 4: "Test new behavior first"): Group 2 modified behavior without an executable test proving the change.
- The verification command
uv run devops ci --check --only actionlint,zizmoris vacuous for validating the added step because it passes on the base before the change and only verifies syntax, not step configuration or existence.
Proposed Solution & Architectural Design
- Extend
path_problemsinsrc/devops_cli/roadmap/stage/stage_paths.py:- When a task group lists a workflow file (
.github/workflows/*.yml) inchanges, require that the same group (or change) liststests/invariants/test_workflow_contracts.pyinchanges.
- When a task group lists a workflow file (
- Update the stage planner prompt (
src/devops_cli/ai/tasks/roadmap_stage_change.md) to instruct the model that workflow changes require an invariant contract test in the same group. - This prevents vacuous verification commands on workflow modifications and ensures test-driven implementation for CI automation.
Target Subsystem
AI & Agentic Review Pipeline
Existing Tool Considered
path_problems in src/devops_cli/roadmap/stage/stage_paths.py. The change extends existing path validation rules: approximately 8,000 tokens to build and test.
Standards Compliance
- I confirm this proposal aligns with AGENTS.md engineering principles (cyclomatic complexity <= 10, nesting <= 5, zero bare exceptions, tests that cover the changed lines).
- I am willing to submit a pull request implementing this feature with accompanying tests.
Source: #4031
Proposed design
Problem statement
The stage planner lets a task group change a workflow under .github/workflows/ without a workflow contract test. The group can then pass actionlint and zizmor while it adds no executable test for the change. The change adds a path rule and a prompt instruction that require the contract test in the same group.
Acceptance criteria
Requirement: Workflow change requires contract test
The stage path check SHALL report a problem when a task group changes a workflow file and does not list the workflow contract test in the same group.
Scenario: Workflow change without contract test
- WHEN A task group lists
.github/workflows/ci.ymlinchangesand does not listtests/invariants/test_workflow_contracts.pyinchanges. - THEN
path_problemsreturns a problem that names.github/workflows/ci.ymlandtests/invariants/test_workflow_contracts.py.
Requirement: Workflow change with contract test passes
The stage path check MUST accept a task group that changes a workflow file and lists the workflow contract test in the same group.
Scenario: Workflow change with contract test
- WHEN A task group lists
.github/workflows/ci.ymlandtests/invariants/test_workflow_contracts.pyinchanges. - THEN
path_problemsreturns no problem for the workflow contract rule.
Requirement: No workflow change needs no contract test
The stage path check MUST not require the workflow contract test from a task group that changes no workflow file.
Scenario: Source change only
- WHEN A task group reads
.github/workflows/ci.ymland changes onlysrc/devops_cli/roadmap/stage/stage_paths.py. - THEN
path_problemsreturns no problem for the workflow contract rule.
Requirement: Every workflow file is covered
The stage path check SHALL apply the contract-test rule to every file under .github/workflows/ with the suffix .yml.
Scenario: Each workflow file
- WHEN A task group lists any
.github/workflows/*.ymlfile inchangesand omitstests/invariants/test_workflow_contracts.py. - THEN
path_problemsreturns a problem for that workflow file.
Requirement: Prompt states the rule
The stage planner prompt SHALL instruct the model to list the workflow contract test in the same group as a workflow change.
Scenario: Prompt instruction
- WHEN The stage planner prompt
src/devops_cli/ai/tasks/roadmap_stage_change.mdis read. - THEN It holds an instruction that a group changing a file under
.github/workflows/also liststests/invariants/test_workflow_contracts.pyinchanges.
Existing Tool Considered
No alternatives check has run. The need is a repository-specific path rule, and no open, maintained tool covers it. The change extends the existing path_problems in src/devops_cli/roadmap/stage/stage_paths.py, which lacks the workflow contract-test rule; build, keep and fix cost is about 8,000 tokens and about 2 hours.
Key questions
- Which group must list the workflow contract test when it changes a workflow file?: The same group that changes the workflow file must list
tests/invariants/test_workflow_contracts.pyinchanges. (best practice) [sources: AGENTS.md, tests/invariants/test_workflow_contracts.py]- Chosen: Same group. AGENTS.md Rule 4 requires a test with the behavior change, and the group's verification command can run that test.
- Rejected: Any later group. A later group leaves the workflow change with no executable test in the group that makes it.
- Rejected: No contract test requirement. The current rule permits actionlint and zizmor to pass without a test of the added step.
- Which workflow paths must trigger the new rule?: Every
.github/workflows/*.ymlpath in a group'schangeslist must trigger the rule. (best practice) [sources: .github/workflows/ci.yml, tests/invariants/test_workflow_contracts.py]- Chosen: Every
.ymlworkflow under.github/workflows/. The issue names*.yml, and every workflow file in this repository has that suffix. - Rejected: Only
ci.yml. The defect applies to every workflow file, not onlyci.yml. - Rejected: Every file under
.github/workflows/, including.yaml. The issue and the repository use.yml; broadening the rule adds no covered file.
- Chosen: Every
- Where does the new rule live?: The new rule lives in
path_problemsinsrc/devops_cli/roadmap/stage/stage_paths.py, beside the existing path checks. (best practice) [sources: src/devops_cli/roadmap/stage/stage_paths.py, src/devops_cli/roadmap/stage/stage_change.py]- Chosen: Extend
path_problems. The function already receives every group and the staged tree, and the stage job calls it. - Rejected: Add a separate check in
stage_change.py. It repeats the group loop and the problem text ofpath_problems. - Rejected: Rely on the prompt only. A prompt instruction is not a deterministic check.
- Chosen: Extend
- What must the stage planner prompt say about a workflow change?: The prompt must say that a group that changes a file under
.github/workflows/also liststests/invariants/test_workflow_contracts.pyinchanges. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, AGENTS.md]- Chosen: Add an explicit instruction. The model reads the prompt before it writes a group, and the path check enforces the rule.
- Rejected: Change only
path_problems. The model can avoid the problem only when the prompt states the rule. - Rejected: Change only the prompt. The prompt is not a check, and a model can ignore it.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-10: none.
Tool: none found.
Activity
dan-petty commentedon Nov 7, 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 closes a gap in stage validation but does not block a release or fix a user-facing defect.It prevents one class of vacuous workflow verifications in the roadmap pipeline.It extends an existing path_problems rule and a prompt file; the body estimates about 8,000 tokens of work.Both extend path_problems to require a specific test file in the changes list when a specific file type is changed; #3972 targets network policy files, the candidate targets workflow files.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at fe1d00b (see proposed design in issue body).
devops-cli-service commentedon Nov 10, 2026
Alternatives check: none
Reason: Searches for a maintained tool that requires a test to accompany a GitHub Actions workflow change returned only unrelated pages, and no tool works on the roadmap stage planner's per-group
changeslists. The need is a repository-specific rule inpath_problemsplus a prompt line; the workflow checkers the repository already uses (actionlint, zizmor) only validate syntax and security, not thattests/invariants/test_workflow_contracts.pyis in the same group, so no open tool covers it.Tool: none found
Lacks:
changesliststests/invariants/test_workflow_contracts.pyroadmap_stage_change.mdinstruction are specific to this repository's stage plannerSearches run:
Sources:
Checked on 2026-11-10. A person decides what this means for the item. The check changes no label and closes no issue.
fix(roadmap): keep the workflow cases of the stage plan tests green (#…
fix(roadmap): enforce the workflow contract test without a prompt edit (
devops-cli-service commentedon Nov 15, 2026
Released in v0.159.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.159.0
devops-cli-service commentedon Nov 15, 2026
Live since 2026-11-15 23:51 UTC
fix(roadmap): Stop plan rules that ask for config value tests (#6091)