Repository navigation
Description
Problem
In src/devops_cli/roadmap/implement/implement_wip.py, WipKeeper commits the working tree as a wip: commit when the agent ticks a task and the verification commands of that specific task pass. The implement job then pushes this commit to the remote tracking branch on GitHub.
In issue #3251 / PR #3981, Task 1.2 added tests in tests/roadmap/stage/test_roadmap_stage_manifest.py. When test_roadmap_stage_manifest.py passed, WipKeeper made a WIP commit and pushed it to origin/feat/3251-add-a-test-first-manifest-kind.
However:
- Other tests in the same package (
tests/roadmap/stage/) were failing because the prompt file was not updated yet. - Fast pre-push static checks (
devops ci) were not executed before the push. - Pushing this commit to GitHub triggered the full GitHub Actions CI matrix on a broken commit, marking the pull request checks red and wasting CI runner time.
AGENTS.md rule 5 states that pre-push checks run fast static checks and the required checks of CI gate the merge. Pushing intermediate WIP commits that fail package tests breaks CI on the pull request.
Expected
Before pushing a wip: commit to the remote tracking branch, WipKeeper or the implement job must verify that the commit passes fast static checks and scoped package tests (using plan_tests or pre-push gates). If scoped package tests or static checks fail, WipKeeper should record the commit locally in the workspace to save work, but must not push the failing commit to the remote repository.
Acceptance criteria
-
WipKeeperorimplement_stepruns scoped package checks or fast pre-push checks before pushing awip:commit to origin. - If scoped checks fail, the commit stays local and is not pushed to the remote branch.
- A test verifies that
WipKeeperdoes not push commits that fail scoped package checks.
Feasibility
src/devops_cli/roadmap/implement/implement_wip.py and implement_step.py manage WIP commit creation and push.
plan_tests in devops_cli.roadmap.stage.stage_tests finds package tests for changed paths.
Running fast checks before remote push prevents failed CI runs on draft pull requests.
Existing tool considered
The existing devops ci fast check runner and plan_tests function. No new dependency is needed.
Cost
Build: about 20k tokens and 1 hour. Keep: about 1k tokens per quarter. Fix: about 4k tokens and 0.2 hours.
Related
Found during evaluation of #3251 / PR #3981. Related to #3054 and #3993.
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)
Alternatives check of 2026-11-25: in-use.
The repository already uses this tool.
Tool: pre-commit/pre-commit (https://github.com/pre-commit/pre-commit), MIT, last activity 2026-11-09, maintained.
Reason: The searches found pre-commit, already used by the repository: it can run and block hooks at the pre-push stage, but it selects by file patterns, not plan_tests scoped tests, and ADR 0014 keeps the pre-push hook to fast static checks.
Covers:
- Runs configured hook commands at the pre-push stage
- Aborts the push when a hook exits nonzero
- Selects hook commands by changed-file patterns
Lacks:
- No import-graph selection of scoped package tests
- ADR 0014 limits the pre-push hook to fast static checks
- No record of a refused WIP commit in the implement job
- Hooks can be skipped with --no-verify
Proposed design
Problem statement
The implement job pushes each wip: commit to the remote tracking branch. That path runs no scoped package test and no fast static check. A broken commit then starts the full CI matrix on GitHub and marks the pull request checks red. The change gates the WIP push on the scoped package tests and the fast static checks. A refused commit stays on the local branch, and the record names the failing check. The work waits on #6521, the re-architecture of the stage, implement and fix-checks jobs.
Acceptance criteria
Requirement: Scoped test gate
The implement job SHALL run the scoped package tests that plan_tests selects for the changed paths before it pushes a wip: commit.
Scenario: A failing scoped test keeps the WIP commit off the remote
- WHEN the scoped package tests of a
wip:commit fail - THEN the test sees no push of that commit and a refusal that names the failing test module
Requirement: Fast static check gate
The implement job SHALL run the fast static checks of the pre-push stage before it pushes a wip: commit.
Scenario: A failing fast static check keeps the WIP commit off the remote
- WHEN a fast static check of the pre-push stage fails on a
wip:commit - THEN the test sees no push of that commit and a refusal that names the failing check
Requirement: Green WIP push
The implement job SHALL push a wip: commit when its scoped package tests and its fast static checks pass.
Scenario: A WIP commit with passing checks reaches the remote
- WHEN the scoped package tests and the fast static checks of a
wip:commit pass - THEN the test sees exactly one push of that commit to the remote tracking branch
Requirement: Kept WIP commit
The implement job MUST keep a refused wip: commit on the local branch and MUST NOT push it.
Scenario: A refused WIP commit stays on the local branch
- WHEN the gate refuses a
wip:commit - THEN the test sees that commit as the tip of the local branch and no push of it
Existing Tool Considered
pre-commit (https://github.com/pre-commit/pre-commit), MIT, verdict in-use: the repository already uses this tool. The alternatives check in the issue body gives what pre-commit covers and lacks. The proposal adds what pre-commit lacks. plan_tests selects the scoped package tests for the changed paths. The implement job records the refused wip: commit and the failing module. The gate runs in the job, so no hook skip bypasses it. The cost of this glue code is about 20k tokens and 1 hour to build. It is about 1k tokens per quarter to keep, and about 4k tokens and 0.2 hours to fix.
Key questions
- Does the implement job already run the scoped checks before its final push?: Yes. The agent phase runs the scoped checks after the steps, the documents and the archive.
publishthen pushes the commits that passed. Thewip:push path runs neither the scoped checks nor the fast static checks. [sources: src/devops_cli/roadmap/implement/implement_run.py, src/devops_cli/roadmap/implement/implement_scoped_ci.py:105] - Which checks run before the WIP push?: The scoped package tests that
plan_testsselects for the changed paths, and the fast static checks of the pre-push stage. ADR 0014 keeps the pre-push hook to the fast static checks, so the job adds the scoped package tests and runs both sets before the push. (best practice) [sources: AGENTS.md, src/devops_cli/roadmap/implement/implement_scoped_ci.py:105]- Chosen: The scoped package tests and the fast static checks. They cover the two failures that reached origin and stay inside the 5-minute limit.
- Rejected: The full
devops cicheck. AGENTS.md rule 5 makes a check that averages over 5 min + 1 min tolerance a P0 bug, and the gate runs on eachwip:commit. - Rejected: The scoped package tests only. A failing fast static check would still reach the remote branch.
- Rejected: The fast static checks only. The issue reports that failing package tests also reached the remote branch.
- Where does the WIP push gate run?: In the implement job, in the code path that pushes a
wip:commit.WipKeepermakes the commit and the job owns the remote push, so the gate sits at that push. (best practice) [sources: src/devops_cli/roadmap/implement/implement_step.py]- Chosen: In the implement job, at the WIP push. The job owns the remote push and already holds the scoped checks.
- Rejected: Inside
WipKeeper, where the commit is made.WipKeeperwrites no remote and runs no scoped test. - Rejected: In the pre-push hook only. ADR 0014 keeps the pre-push hook to the fast static checks, and the hook is no place for the scoped package tests.
- What does the job do with a refused WIP commit?: It keeps the commit on the local branch and pushes nothing. The tip of the step stays at that commit, so a later stop keeps the work of the group. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/implement/implement_run.py]
- Chosen: Keep the commit on the local branch. It keeps the work of the group and meets the issue.
- Rejected: Discard the commit. It loses the work of the group.
- Rejected: Amend until the gate passes. An amend hides the refused commit and its reason from the record.
- Rejected: Stop the item at once. A later task can make the scoped tests pass, and the group can continue.
- Can one pull request deliver the gate and its test?: Yes. The gate is one change in the WIP push path of the implement job, and one test covers its record. (best practice) [sources: src/devops_cli/roadmap/implement/implement_step.py, tests/roadmap/implement/test_roadmap_implement_step_commit.py]
- Chosen: One pull request. The change is one gate and the test of its record.
- Rejected: Split the gate and the test. The test proves the gate in the same change, and a second pull request adds review load.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Watched files
A commit on the default branch that changes one of these files starts the next refine round.
src/devops_cli/roadmap/implement/implement_run.pysrc/devops_cli/roadmap/implement/implement_step.py
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.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.Wastes CI runner time and marks PR checks red, but does not block functionality or lose work.Prevents wasted CI runs and broken PR check status on every WIP push that fails package tests.The candidate states about 1 hour build; devops ci and plan_tests already exist and need only a call before the push.Both run scoped checks before a push, but #3043 covers the implement job's group push with repair rounds while the candidate covers WipKeeper's intermediate WIP push with a hard block.dan-petty commentedon Nov 7, 2026
Corroborating evidence from PR #4035 (issue #3253):
WipKeepercommitted03b5eeb6without formattingsrc/devops_cli/roadmap/stage/stage_criteria.pybecauseroadmap_implement_step.mdinstructs the model not to runruff format.Pushing this WIP commit to
origin/feat/3253-map-all-issue-requirements-to-atriggered CI run 42404156774, which failedStatic Analysisonruff format --check.WipKeeper._commitmust format changed Python files or verify fast static checks before it pushes WIP commits to GitHub.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at ba4679c (see proposed design in issue body).
devops-cli-service commentedon Nov 10, 2026
Alternatives check: none
Reason: Two searches found no external tool that gates an implement job's push on scoped package tests and fast static checks. The closest is pre-commit's
pre-pushstage, which is maintained and MIT-licensed. It would only run static hooks on agit push. It does not select tests for the changed paths, report the failing module, or keep a failingwip:commit local. The repository already has a pre-push hook for fast checks (ADR 0014). The gate is glue code inside the job around the repository's ownplan_testsand fast checks.Tool: none found
Covers:
Lacks:
wip:commit localTools considered:
Searches 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.
dan-petty commentedon Nov 11, 2026
Evidence from the defect inventory of 2026-11-11. It reads 14 days of check runs, from 2026-10-27 to 2026-11-10.
CI Quality Gateon Service pull requests failed the stepruff format. The head commit of each of the 7 runs is awip:commit ofdevops-cli-service[bot]: for example032243198bon fix(roadmap): check the test form that a task names #4353,dbfa4c7dc2on docs(openspec): plan #4079 Replay the stage set once and stop the polling #4155, andc1342384f4and1ef2bf1de9on docs(openspec): plan #3244 Add one tool registry for jobs and roles #3959. In the same time, no pull request of a person or of an agent session failedruff format, because the pre-push hook runs it.wip:head commit. 7 of the 10 failed inStatic Analysis.style(roadmap): format the test form step and its tests (#3451)to make the check pass.The step runs
ruff format(_format_failureinsrc/devops_cli/roadmap/implement/implement_step.py) only at the end of the step.WipKeepermakes its commit before that. So the deterministic fixer exists, but it does not run on awip:commit. A possible acceptance criterion: run_format_failureon the paths of awip:commit before the commit, or keep the commit local as this issue proposes.dan-petty commentedon Nov 11, 2026
Scope from the iteration lane plan (2026-11-11)
#4713 makes this issue obsolete (child 14 of #4667). After #4713, a wip push of the implement Job goes to a branch with no pull request and starts no CI run. The full gate runs in the Job pod before the one push that opens the pull request.
This issue closes as not planned, with a link to #4713, when #4713 merges. Do not start work on this issue.
dan-petty commentedon Nov 14, 2026
Cannot complete safely in one low-effort pull request: the gate must run inside WipKeeper.on_commit before _push_passed, format the changed Python files, and keep the WIP commit local on failure. Formatting after the commit needs an amend of the WIP tip, which changes the keeper's tip used by fold/unfold/reset, the implement.wip record, and the stop reset. The design does not say how the tip and the record follow that amend. Split it: (1) gate the WIP push on _scoped_run and keep the commit local on failure, (2) format-before-gate with the WIP tip and record updated, (3) the regression test. Raise the effort if it stays one item.
devops-cli-service commentedon Nov 14, 2026
The proposal at c212f77 needs splitting into 3 items. A person splits the item into the items below, or replies in a comment or edits the body to keep one item, and the next refine round looks at the item again.
devops-cli-service commentedon Nov 18, 2026
The result in the alternatives block of the issue body changed. Before this check:
none, no tool. A person decides what the new result means for the item.Searches (9)
Tools considered:
Searches run:
Sources:
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 20, 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 20, 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 26, 2026
Closed: the WIP keeper no longer exists.
#6562 deleted
implement_wip.py. The implement Job ends at its draft, and a step makes nowip:commit.