Repository navigation
Description
Problem Description
A refine round reads the comments of an item before its model calls (refine_one_item in src/devops_cli/roadmap/refine/refine.py). It posts its comment at apply time, after the model calls. The next round reads the replies since refine's last comment, and a reply ends the wait only when it is at or after the start of the wait. A person can reply after the read and before the comment posts. That reply is older than the comment, so no later round sends it to the model, and it ends no wait. The reply is lost until another event ends the wait.
PR #6353 (#6196) closes this gap for a round that posts no comment: it records the time of the read as refine.repeated_at. A round that posts its comment still starts the wait at the time of the comment.
Reproduction Steps
- Refine posts a frame on an item at time T.
- A round at T+10 min reads the comments and calls the model. The result changes, so the round posts a comment at apply time T+12 min.
- A person replies at T+11 min.
- The next round runs at T+17 min.
Expected vs Actual Behavior
Expected: the next round sends the reply of T+11 min to the model.
Actual: the reply is older than refine's last comment (T+12 min), so the round keeps the item waiting and the model never reads the reply.
Environment Diagnostics
The base of main after #6196. The test test_a_reply_made_while_a_round_with_no_comment_runs_ends_the_wait in tests/roadmap/refine/test_roadmap_refine_event_comment.py shows the case of a round with no comment.
Logs, Traces, or Terminal Output
None. A time-travel test with plan_refine, a reply, and then apply_refine shows the case.
Source: #6353
Alternatives check of 2026-11-19: none.
Tool: none found.
Reason: Searches found no tool or library for comment cursors or read-time watermarks; the need is an internal fix to the project's own refine loop, recording the read time as PR #6353 already does.
Lacks:
- No external tool for comment cursors or read watermarks
- Wait boundary must be the read time, not the comment time
- Replies older than refine's own comment must still reach the model
Proposed design
Problem statement
Refine reads the comments of an item before its model calls. It posts its comment after the model calls. A person can reply between the read and the comment. That reply is older than refine's last comment, so no later round sends it to the model and it ends no wait. The fix records the time of the read on every round and starts the wait and the reply cursor at that time.
Acceptance criteria
Requirement: The read time is recorded
A refine round that writes a result for an item SHALL record the time at which it read the comments of the item.
Scenario: A round that posts a comment records its read time
- WHEN a round reads the comments of an item at time T and posts its comment at time T+2
- THEN the job record of the item holds the time T under
RefineRecordKey.READ_AT
Requirement: A reply made during the round reaches the model
The next round MUST send to the model each comment of a trusted person that a person made after the recorded read time.
Scenario: A reply between the read and the comment is in the next request
- WHEN a person replies at time T+1, after the read at time T and before the comment of the round at time T+2
- THEN the request of the next round holds that reply in
repliesand the round refines the item
Requirement: A reply already read does not end the next wait
A comment of a trusted person made at or before the recorded read time SHALL NOT end the wait of the item.
Scenario: A reply before the read does not end the wait
- WHEN the only comment of a person follows refine's last comment of an earlier round and is older than the recorded read time
- THEN the next round keeps the item waiting and sends no reply to the model
Requirement: Refine's own comment does not end the wait
A comment that refine wrote MUST NOT end the wait of the item.
Scenario: The comment of the round does not make the next round look again
- WHEN the round posts its comment at time T+2, after its read at time T, and no person replies
- THEN the next round keeps the item waiting and sends no reply to the model
Requirement: A failed round records no read time
A round that fails its job MUST NOT record a read time for the item.
Scenario: A reply read by a failed round is sent again
- WHEN a round reads a reply of a person and then fails with a job failure
- THEN the job record of the item holds no read time from that round and the next round sends the reply to the model
Requirement: An item with no recorded read time uses refine's last comment
A round SHALL start the wait at the time of refine's last comment when the job record of the item holds no read time.
Scenario: An item whose record holds only the earlier repeat time keeps its wait
- WHEN the job record of the item holds
RefineRecordKey.REPEATED_ATand noRefineRecordKey.READ_AT - THEN the round sends the replies that follow refine's last comment and records the read time of this round
Existing Tool Considered
The alternatives check of 2026-11-19 in the issue body records the verdict none, and its block names the need and what no tool covers. The change is therefore an internal fix to the refine loop of this repository. The written cost is about 25,000 tokens to build it and about 5,000 tokens for each later fix. The elapsed time is about half a day.
Key questions
- Which job-record key holds the time at which a round read the comments?: Add
RefineRecordKey.READ_ATand write it on every round that writes a result. No round writesRefineRecordKey.REPEATED_ATafter this change. An item whose record holds only the older key starts its wait at refine's last comment for one round, and it loses no reply. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py, src/devops_cli/roadmap/stores/store.py]- Chosen: new
READ_ATkey. The key names the time that it holds. Therepeatedflag still decides whether the round posts a comment. - Rejected: reuse
REPEATED_AT. The name states that the result is the one of the round before. A round that posts a comment does not repeat the round before. - Rejected: no new record. This is the defect: the wait starts at the time of refine's last comment, which is after the lost reply.
- Chosen: new
- What ends the wait of an item that a round refined and commented on?: A comment of a trusted person made after the recorded read time. A comment that refine wrote does not end the wait. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py, src/devops_cli/roadmap/trust.py]
- Chosen: read time with a trusted author. It catches the reply between the read and the comment. It leaves out refine's own comment, so no round looks at the item again for its own comment.
- Rejected: refine's last comment. This is the defect: the reply of time T+1 is older than the comment of time T+2.
- Rejected: read time with no author filter. Refine's own comment follows the read time, so each round would look at the item again with no end.
- Which comments reach the model as
replies?: The comments of trusted authors made after the recorded read time. Use refine's last comment when the record holds no read time. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py, src/devops_cli/roadmap/trust.py]- Chosen: since the recorded read time. It sends the reply that the round before did not read, and it sends no reply twice.
- Rejected: since refine's last comment. It drops the reply made between the read and the comment. This is the defect.
- Does a round that fails its job record the read time?: No. The next round reads the same comments again and sends them to the model. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py]
- Chosen: record no read time on a job failure. A job failure writes no body and no comment. A recorded time would drop the replies that the round read.
- Rejected: record the read time on every round. The replies of a failed round would never reach the model.
- Which start of the wait does an item use when its record holds no read time?: Refine's last comment, as before. The round then records the read time of its own read. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py, tests/roadmap/refine/test_roadmap_refine_event_comment.py:222, tests/roadmap/refine/test_roadmap_refine_recorded_wait.py]
- Chosen: fall back to refine's last comment. An item that waits now holds only the older repeat key. It loses no reply, and its next round records the read time.
- Rejected: read the older repeat key as the read time. It keeps a key that no round writes after this change.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 19, 2026
Both deal with refine comment timing and wait boundaries, but #6196 changes when a comment is posted while the candidate fixes the timestamp used for the wait boundary.devops-cli-service commentedon Nov 19, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 19, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (3)
Searches run:
Sources:
devops-cli-service commentedon Nov 19, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
fix(roadmap): use _read_at for Ready comment re-selection (#7190) (#7192
chore(main): release 0.219.0 (#7177)
devops-cli-service commentedon Nov 25, 2026
Released in v0.219.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.219.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 17:09 UTC