Repository navigation
Description
Problem or Motivation
18 comment sites use 5 rules (a marker read, a ledger, a record key, an upsert or none): stage.py:2599, :2660, :2733, :2774, :2800, :2859; implement_run.py:865, :1515, :1715, :1780, :1809; implement_submit.py:249; stop_clear.py:276; refine.py:3220; stage_ready.py:122, :143; pr_conflicts.py:129; release_comments.py:110. PR #4978 (#4793) adds a repeat guard in the store, but not one upsert rule. ADR 0021 section 3 rule 5 needs a marker read before each post.
Proposed Solution & Architectural Design
steps/comment.py post(target, marker, key, body): upsert by marker and key, read the marker before a post, and let the #4793 guard refuse a repeat. Change every site in the same pull request. Run the stop-after-each-write harness of #4793 (tests/support/write_stops.py) on stage, refine and implement. Coordinate with #4702 (the gate result on the issue), which also writes a marked comment.
Start after PR #4978 merges and after open-step, which moves implement_run.py:1515. Cost: about 1M tokens and 1 agent-day.
Target Subsystem
Every roadmap job that posts a marked comment (stage, refine, implement, release comments).
Existing Tool Considered
No new tool. The change builds on the repeat guard of #4793 and its write-stop harness.
Acceptance Criteria
- Unit tests: an upsert edits the comment; a second run posts nothing; a repeat is refused.
- The write-stop harness passes for stage, refine and implement.
- A structural test fails when a module other than steps/comment.py calls comment_on_issue or comment_on_pull.
Dependencies
- PR fix(roadmap): a job posts no comment that repeats a recent one #4978 (fix(roadmap): a job posts no comment that repeats a recent one #4793: the repeat guard of job comments)
- refactor(roadmap): one open step for every pull request #5020 (open-step: refactor(roadmap): one open step for every pull request)
- Part of feat(roadmap): track the Service step jobs #5014 (track the Service step jobs).
Source: #5014
Alternatives check of 2026-11-15: not-applicable.
Class: refactor, no search.
Tool: none found.
Proposed design
Problem statement
Roadmap jobs post marked comments through 18 sites with five inconsistent rules. The change adds one writer in steps/comment.py that upserts by marker and key, reads the marker before each post, and uses the #4793 repeat guard. It moves every site in one pull request and checks stop replay for stage, refine and implement.
Acceptance criteria
Requirement: Shared marked-comment writer
The roadmap SHALL provide one marked-comment writer in steps/comment.py with post(target, marker, key, body).
Scenario: Writer updates an existing marked comment
- WHEN A target already holds a comment with the marker and key.
- THEN The writer edits that comment and adds no second comment.
Requirement: Marker read before post
The writer SHALL read the target's marked comments before it writes a comment.
Scenario: Read precedes write
- WHEN The writer posts a marked comment to a target.
- THEN The target records a comment list before the create or update call.
Requirement: Repeat guard refuses a repeat
The writer MUST rely on the #4793 store guard to refuse a repeated marked comment.
Scenario: Second run posts nothing
- WHEN The same marker, key and body already exist on the target.
- THEN The writer makes no comment write, and the store guard refuses the repeat.
Requirement: All comment sites use one writer
Every roadmap module that posts a marked comment SHALL call steps/comment.py, and no other module SHALL call comment_on_issue or comment_on_pull.
Scenario: Structural test rejects a direct caller
- WHEN A module outside
steps/comment.pycallscomment_on_issueorcomment_on_pull. - THEN The structural test fails.
Requirement: Stop replay leaves no extra comments
The stage, refine and implement jobs SHALL pass the stop-after-each-write harness with no extra comments.
Scenario: A stop after each write leaves no extra comment
- WHEN
stop_after_each_writeruns each job. - THEN
StopReplay.extra_comments()is empty for every stop.
Existing Tool Considered
No open, maintained tool or library covers this internal refactor. The alternatives check of 2026-11-15 gave not-applicable for the refactor class and made no search. The project builds steps/comment.py and migrates all comment sites for about 1M tokens and one agent-day.
Key questions
- Should the shared writer live in one roadmap step module?: Yes. Put it in
steps/comment.pyand make every comment site call it. (best practice) [sources: CONTEXT.md, tests/support/write_stops.py]- Chosen: One shared writer in
steps/comment.py. CONTEXT.md says a roadmap step is one module and every caller uses it. - Rejected: Keep per-job comment helpers. Five rules remain and the structural test cannot pass.
- Chosen: One shared writer in
- How should the writer update or create a marked comment?: Read the marked comments, find the key, and update that comment. If no key matches, create one comment. (best practice) [sources: CONTEXT.md, tests/support/write_stops.py]
- Chosen: Read, then upsert by marker and key. It keeps one comment for each key and stops a second run from adding a comment.
- Rejected: Create a new comment each run. Stop replay leaves extra comments.
- Rejected: Edit the last comment by the bot. It can edit the wrong marker or a person's comment.
- Must every comment site move in the same pull request?: Yes. Move every comment site in one pull request. (best practice) [sources: CONTEXT.md, tests/support/write_stops.py]
- Chosen: Move every site in one pull request. A structural test can then forbid direct callers.
- Rejected: Move one job at a time. Mixed rules remain and direct callers pass the structural test.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
Both touch roadmap job comment posting. #4793 adds a guard that refuses a repeat post; the candidate builds a single post() function that replaces all 18 call sites and depends on that guard.devops-cli-service commentedon Nov 15, 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-15. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 16, 2026
Status set to Ready at 181f85e (see proposed design in issue body).
refactor(roadmap): one marked-comment writer for every job (#5025)
refactor(roadmap): one marked-comment writer for every job (#5025)
devops-cli-service commentedon Nov 16, 2026
Released in v0.167.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.167.0
devops-cli-service commentedon Nov 16, 2026
Live since 2026-11-16 18:27 UTC