Repository navigation
Description
Problem
Facts that I checked in implement_run.py.
- Every Job runs
_pull_request, which calls_comment(pull, _NOTHING_YET)._commentbuilds its table fromself.outcomes[since.outcomes:]. A fresh Job that continues a run has an emptyoutcomeslist. So it posts a comment with the body-and no table. The earlier table is not lost on GitHub, but the new comment is empty. - The scoped checks (
_scoped_checks, about 3.5 minutes) and the watch of the PR checks run again in every Job. No mark says that they passed for the same head. implement.spendis written only at a stop or at ready (stop,_ready).- The group mark (
_record(group=..., sha=...)) does not carry the spend. _item_spend()sumsself.outcomesof this Job only.- A killed Job leaves no spend. A continuation starts with a full item budget. With 2 continuations an item can spend three budgets.
- At a stop,
implement.spendis overwritten with the spend of the last Job only.
- The group mark (
- The wait for the PR checks runs up to 3600 s (
monitor_timeout_seconds,watch_pull). The runner writes no log line during it. The stall limit is 4200 s because of this wait (defaults.py).
Expected
This issue is blocked by #3677 (checkpoint of each passed group). #3677 is open and has no pull request. Both change _groups and _start. Start this issue after #3677 merges, and read the final order of the group steps from main. Do not copy the push of #3677.
The steps below name phases, not positions in _groups. They hold for any order that #3677 sets.
- Add the keys
implement.checked_shaandimplement.published_shatoImplementRecordKey(stores/store.py).- Write
checked_shaafter the scoped checks pass. - Write
published_shaafter the push. - Use the existing marks writes. A Job with the same head skips the phase.
- Write
- Put a marker line for the run into the PR comment. Read the comments of the PR once per Job. Update the comment that holds the marker. Do not post a comment whose body is
-. - Write the spend of each passed group in the group mark that exists (
_record(group, sha, spend)). Start the Job budgets (_item_spend) from the recorded sum of the earlier Jobs. At a stop or at ready, write the sum, not the spend of the last Job only. - Write one log line at a set interval during the watch of the PR checks (
watch_pull). Use the existingDEFAULT_ROADMAP_IMPLEMENT_POLL_SECONDSloop. - Request cost per Job: 1 read of the PR comments for the marker. Add 1 read and 1
PATCHfor each of the two phase marks. This gives 5 requests. The spend rides on the group mark and adds none. This is inside the request budget (fix(service): the metrics row sends too many counted requests #3941, fix(service): the request budget counts only what GitHub counts #3946).
Update docs/ROADMAP_WORKFLOW.md and the spec roadmap-implement-job for the two new keys.
Not in this issue:
- the typed result and the hand-off of the check log (the issue feat(roadmap): implement writes a typed result and hands off its log #4071);
- the comment on a stop (fix(roadmap): comment on pull request when implement stops #3997).
Acceptance criteria
-
uv run pytest tests/roadmap/implement/test_roadmap_implement_phase_marks.py -k checked_sha- a second Job at the same head runs zero scoped checks. -
uv run pytest tests/roadmap/implement/test_roadmap_implement_phase_marks.py -k pr_comment_marker- a rerun with no new outcome posts no-comment. One comment holds the table. -
uv run pytest tests/roadmap/implement/test_roadmap_implement_phase_marks.py -k spend_survives_kill- a continuation starts with the spend of the killed Job and stops at the item budget as a sum. -
uv run pytest tests/roadmap/implement/test_roadmap_implement_phase_marks.py -k watch_progress_line- the watch of the checks logs a line at the set interval. -
uv run pytest tests/roadmap/implement/test_roadmap_implement_phase_marks.py -k request_count- a Job sends at most 5 extra requests for the marker and the two phase marks.
Every command above fails on the unchanged code. The pull request cites the fail-to-pass run (devops ci fail-to-pass --base <ref>).
Feasibility
I read these files at origin/main: implement_run.py (_groups, _record, _item_spend, _spend, _push, _scoped_checks, _pull_request, _comment, _checks, _ready, stop), implement_pull.py (watch_pull), stores/store.py (ImplementRecordKey) and defaults.py. I did not run the code.
I checked that #3677 is open and that no open pull request holds a branch for it. An earlier claim said that a rerun posts a second copy of the comment table. That was wrong. The real fault is an empty comment.
Existing tool considered
Item record marks (set_marks), the branch and the ticks of tasks.md as resume state, and the checkpoint of #3677. No library is needed.
Cost
Build: about 90k tokens and 4 h (two keys, the comment marker, the spend sum, the log line, 6 tests). Keep: about 4k tokens per quarter. Fix: about 20k tokens and 1.5 h.
Related
Part of #3027. Blocked by #3677 (must merge first). #3066, #3997 (comment on a stop), #3941, #3946, #3105.
Proposed design
Problem statement
An implement Job repeats work after a continuation. It posts an empty pull request comment with the body -, and it runs the scoped checks again at the same head. It loses the spend of a killed Job, so one item can spend three budgets. It writes no log line during the 3600 s watch of the checks. This change adds two phase marks, one comment marker, a spend total and a progress line.
Acceptance criteria
Requirement: checked_sha skips the scoped checks
The implement Job SHALL write implement.checked_sha after the scoped checks pass and SHALL run no scoped check at a head that the mark records.
Scenario: A second Job at a checked head
- WHEN A second Job starts at a head that
implement.checked_sharecords. - THEN The Job runs zero scoped checks, and
uv run pytest tests/roadmap/implement/test_roadmap_implement_phase_marks.py -k checked_shapasses.
Requirement: published_sha skips the push
The implement Job SHALL write implement.published_sha after it pushes the item branch and MUST NOT push that head again.
Scenario: A second Job at a published head
- WHEN A second Job starts at a head that
implement.published_sharecords. - THEN The Job sends no push for that head, and
uv run pytest tests/roadmap/implement/test_roadmap_implement_phase_marks.py -k published_shapasses.
Requirement: One comment holds the table
The implement Job SHALL keep one pull request comment with the marker line and MUST NOT post a comment whose body is -.
Scenario: A rerun with no new outcome
- WHEN A rerun makes no new outcome.
- THEN The Job posts no comment with the body
-, the marker comment keeps the rows of the earlier Job, anduv run pytest tests/roadmap/implement/test_roadmap_implement_phase_marks.py -k pr_comment_markerpasses.
Requirement: Spend survives a killed Job
The implement Job SHALL write the spend total of the item with each passed group and SHALL start the item budget from the recorded total.
Scenario: A continuation after a killed Job
- WHEN A continuation starts after a Job was killed.
- THEN The continuation starts with the spend of the killed Job, stops at the item budget as a total, and
uv run pytest tests/roadmap/implement/test_roadmap_implement_phase_marks.py -k spend_survives_killpasses.
Requirement: The watch writes a progress line
The implement Job SHALL write one log line at each poll interval during the watch of the pull request checks.
Scenario: A watch longer than one interval
- WHEN The watch of the checks runs for more than one poll interval.
- THEN The Job log holds one progress line for each interval, and
uv run pytest tests/roadmap/implement/test_roadmap_implement_phase_marks.py -k watch_progress_linepasses.
Requirement: The phase marks cost 5 requests
The implement Job SHALL send at most 5 extra requests for the comment marker and the two phase marks.
Scenario: A Job that writes both phase marks
- WHEN A Job reads the pull request comments and writes the two phase marks.
- THEN The Job sends at most 5 extra requests, and
uv run pytest tests/roadmap/implement/test_roadmap_implement_phase_marks.py -k request_countpasses.
Requirement: The documents name the new keys
The change MUST name implement.checked_sha and implement.published_sha in docs/ROADMAP_WORKFLOW.md and in the spec roadmap-implement-job.
Scenario: The record key table
- WHEN The invariant test reads the record key table of docs/ROADMAP_WORKFLOW.md.
- THEN The table lists both keys with what they hold.
Existing Tool Considered
No alternatives check has run on this item. No open, maintained library covers the resume marks of the implement Job. The marks are the job record of the issue, and set_marks already writes them, so this change adds two keys to that record and one marker line to the pull request comment. It builds no code that a library covers. Cost to build: about 90k tokens and 4 h. Cost to keep: about 4k tokens per quarter. Cost to fix: about 20k tokens and 1.5 h.
Key questions
- Where does the Job keep the two phase marks?: In the job record of the issue, as two members of
ImplementRecordKey. The Job writes each one with the existing marks write, and a Job at the same head reads the mark and skips the phase. (best practice) [sources: src/devops_cli/roadmap/stores/store.py, docs/ROADMAP_WORKFLOW.md]- Chosen: New
ImplementRecordKeymarks. The job record survives a Job and a continuation, and the existing marks write adds no new request path. - Rejected: A label on the issue. A label holds a status and no commit SHA, and a label write is a separate request path.
- Rejected: A file on the item branch. A file adds a commit and a push, and the branch may not exist at the first check.
- Chosen: New
- How does the Job keep one pull request comment across Jobs?: The comment holds the hidden marker line. The Job reads the pull request comments once, keeps the rows that the marker comment holds, and adds the rows of its own steps. A Job with no new row sends no write. (best practice) [sources: src/devops_cli/roadmap/implement/implement_run.py, src/devops_cli/config/constants.py]
- Chosen: Marker line and one read of the comments. One read finds the comment, the rows of the earlier Jobs stay, and a person can edit the text around the marker.
- Rejected: Replace the body with the rows of this Job. The rows of the earlier Jobs would go, so no comment would hold the table of the run.
- Rejected: A new comment for each Job. The issue shows the result: an empty comment with the body
-and no table.
- How does the spend of the item survive a killed Job?:
implement.spendholds the total of the item. The Job reads the total at the start, adds the spend of its own steps, and writes the total with each passed group, at a stop and at ready. (best practice) [sources: src/devops_cli/roadmap/implement/implement_run.py, src/devops_cli/roadmap/implement/implement_limits.py, docs/ROADMAP_WORKFLOW.md]- Chosen: The running total on
implement.spend. The key already exists, the group mark already writes it, and the write adds no request. - Rejected: A new key for the carried spend. It adds a second key that must stay in step with
implement.spend. - Rejected: The spend of this Job only. The issue shows the result: an item can spend three budgets with 2 continuations.
- Chosen: The running total on
- Which interval writes the progress line during the watch of the checks?:
DEFAULT_ROADMAP_IMPLEMENT_POLL_SECONDS, which is 30 s. The watch loop already sleeps that interval, so the line adds no wait and no setting. (best practice) [sources: src/devops_cli/config/defaults.py:869, src/devops_cli/roadmap/implement/implement_pull.py:350]- Chosen: Reuse
DEFAULT_ROADMAP_IMPLEMENT_POLL_SECONDS. The watch loop already sleeps that interval, so the line adds no wait. - Rejected: A new setting for the line. It adds a setting to keep, and the loop already has an interval.
- Chosen: Reuse
- Which code does this item change together with feat(roadmap): checkpoint each passed group on origin #3677?:
_groupsand_startinsrc/devops_cli/roadmap/implement/implement_run.py. Both items change these functions, so this item starts after feat(roadmap): checkpoint each passed group on origin #3677 merges, and it reads the final order of the group steps from main. [sources: src/devops_cli/roadmap/implement/implement_run.py] - Does the progress line change the stall limit of the Job?: No. The stall limit stays at
DEFAULT_ROADMAP_IMPLEMENT_DEADLINE_STALL_SECONDS(4200 s), and the line only shows progress. This item does not change the limit. [sources: src/devops_cli/config/defaults.py, src/devops_cli/roadmap/implement/implement_deadline.py]
Fit
Fits in one pull request.
Suspected block
None.
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.The change saves redundant work and fixes spend tracking but is blocked by #3677 and does not block other work.It avoids re-running scoped checks and prevents budget over-spend, but the system functions without it.It touches stores, implement_run, the PR comment logic, the watch loop, and docs across several files.Both concern the implement job continuation, but #3098 keeps and classifies partial work while the candidate adds phase marks and spend tracking across Jobs.devops-cli-service commentedon Nov 8, 2026
Refine cannot set this item to Ready at c8990be 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.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
src/devops_cli/roadmap/implement/implement_run.py.devops-cli-service commentedon Nov 8, 2026
Refine cannot set this item to Ready at c20f73d 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.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
src/devops_cli/roadmap/implement/implement_run.py.devops-cli-service commentedon Nov 9, 2026
Released in v0.98.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.98.0
devops-cli-service commentedon Nov 9, 2026
Live since 2026-11-09 03:15 UTC
fix(roadmap): count the tokens of each implement Job once (#4213)