Repository navigation
Description
Problem Description
Refine never looks again at a Ready item that a person opened, also after a person edits the body or adds a scope comment. When the edit or the comment adds a blocker, the item keeps status/ready and the old Dependencies of the refine section. The stage job reads only the Dependencies section of the body. So a blocker that is in a comment, or in another section of the body, does not hold the stage job back.
Examples (checked 2026-11-19):
- feat(roadmap): run the reconcile sweep on a cluster schedule #4574 is Ready since 2026-11-11T15:29Z. The refine round at 818ac6f wrote the Dependencies "None.". The scope comment of 2026-11-12T10:13Z adds "Merge first" feat(roadmap): one watch row for plan and delivery PRs #5024, refactor(roadmap): run the stage cleanup in the status lane #5026, feat(roadmap): keep schedules, intake and ledgers in Valkey #4565 and feat(k8s): let Argo Workflows run roadmap pods in devops #4566. refactor(roadmap): run the stage cleanup in the status lane #5026 and feat(k8s): let Argo Workflows run roadmap pods in devops #4566 are open. The owner decision of 2026-11-13, which is now in the body, makes the sweep run
due_jobs(feat(roadmap): one due_jobs function names the due jobs of an item #5504, open). The record holdsrefine.body_hashc0331dca…, but the text outside the refine section now hashes to601e21de…. - feat(roadmap): run intake and scoped intake in their own pods #4567 is Ready since 2026-11-12T02:09Z, with the refine Dependencies
#4412(closed 2026-11-11). The owner decision of 2026-11-13 in the body says "It waits for feat(roadmap): keep schedules, intake and ledgers in Valkey #4565 and feat(k8s): let Argo Workflows run roadmap pods in devops #4566." The record holdsrefine.body_hash6880de34…, and the current text hashes to72df3154…. - feat(ai): generate the project digest from code at run time #3904 is Ready since 2026-11-07. The scope comment of 2026-11-12T04:12Z adds name resolvers and "Depends on: feat(docs): generated pages name their source and stay complete #4889" (open). Refine did not look again, and the stage job planned the item on 2026-11-17 from the body of 2026-11-07. The merged plan (PR docs(openspec): plan #3904 Generate the project digest at run time #6164) has no resolver and says "Dependencies: None." (
openspec/changes/3904-generate-the-project-digest-from-code/proposal.md:69-71). - 7 of the 223 Ready items have a body that a person changed after the refine round: ci(image): move the image checks to one path-filtered workflow #1858, build(docker): build the runner image FROM devtools with no tool install #4361, refactor(security): tools are found on PATH and not in tools.lock #4362, chore(k8s): plan the LiteLLM upgrade beyond 1.103 #4406, feat(roadmap): PR, review and check events start a scoped sweep #4413, feat(roadmap): run intake and scoped intake in their own pods #4567 and feat(roadmap): run the reconcile sweep on a cluster schedule #4574. The owner opened all 7.
Today the stage job holds #4574 because its Dependencies section names 4 open items by quoted title (#4565, #4568, #4573, #4567, the fix of #4803). #5026, #4566 and #5504 are not in that section. When the 4 title dependencies close, the stage job can take #4574 while #5026, #4566 or #5504 is still open.
Cause, at origin/main 0d90de5:
_refinable(src/devops_cli/roadmap/refine/refine.py:2830-2846) takes a Ready item in three cases only. The item has no refine record (_is_unrefined_ready,refine.py:2820-2827). It holds a covering tool that no round asked about (_needs_second_look,refine.py:663-675). Or a bot opened it and the approval no longer holds (is_approved,src/devops_cli/roadmap/trust.py:54-62).is_approvedis always true for an item that a person opened, so a body edit does not end the Ready state.- The module docstring gives the wait rules: a comment after the start of the wait, a closed blocker, or a changed watched file. These rules apply only to an item that waits. A Ready item does not wait.
docs/roadmap/refine.md:19says that a Ready item with an open dependency "goes back to New". No round reaches a refined Ready item, so this does not occur.- feat(roadmap): refine looks again when a related item merges #5515 (open) makes refine due for the dependents of a merged item. Its due mark meets the same Ready filter in
_refinable. So this change also lets feat(roadmap): refine looks again when a related item merges #5515 reach a Ready dependent.
Reproduction Steps
- Run
devops roadmap explain 4574. - Read the Refine line: "Refine job: no. The item is Ready. A round takes a Ready item only when no round refined it, or when it holds a covering tool that no round asked about."
- Read the comment of 2026-11-12T10:13Z on feat(roadmap): run the reconcile sweep on a cluster schedule #4574. It names refactor(roadmap): run the stage cleanup in the status lane #5026 and feat(k8s): let Argo Workflows run roadmap pods in devops #4566 under "Merge first", and both are open.
- Read the refine section of feat(roadmap): run the reconcile sweep on a cluster schedule #4574: Dependencies "None.", and
checked-at818ac6f.
Expected vs Actual Behavior
- Expected: a Ready item gets one refine round after a person edits the text outside the refine section. A trusted comment after the last round also gives one round. The round sets the item back to New when it finds an open blocker. Then the refine section names the blocker, and the stage job reads it.
- Actual: the item stays Ready with the old section. The new blockers are only in a comment or in another section, and no job reads them as blockers.
Environment Diagnostics
- DevOps CLI Version: 0.180.0 (origin/main 0d90de5).
- Execution Environment:
devops roadmap explainin the devcontainer on 2026-11-19. Hashes frombody_hashes(src/devops_cli/roadmap/body_hash.py:63) on the current bodies, with the job record removed.
Logs, Traces, or Terminal Output
$ devops roadmap explain 4574
Phase: ready. Phase age: 5d 20h 38m.
Refine job: no. The item is Ready. A round takes a Ready item only when no round refined it, or when it holds a covering tool that no round asked about.
Stage job: no. The item depends on the open issue #4565, #4568, #4573, #4567.Pre-Submission Checklist
- I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
- I have checked existing issues and pull requests to ensure this is not a duplicate. Searches: "refine Ready item again", "stale Ready", "scope comment refine Ready", "refine second look", "Ready item new dependency", "refine looks again". feat(roadmap): refine looks again when a related item merges #5515 (open) makes refine due for the dependents of an item that a merged pull request closed. It does not cover an edit or a comment on the item itself. fix(roadmap): refine reads a dependency that the body names by title #4803 and fix(roadmap): refine reads a dependency named by title #4877 (closed) added the quoted-title read for later rounds only.
Existing Tool Considered
A change of the selection rule of refine. The record already holds refine.body_hash and refine.comments_seen, so the test needs no new read. No tool applies. Cost: about 40,000 tokens and 1 hour.
Acceptance Criteria
- Test first: a Ready item that a person opened, with a text outside the refine section that differs from
refine.body_hash, is refinable. The test fails on the base. - A test: a Ready item with a trusted comment after its last refine round is refinable.
- A test: an unchanged Ready item with no new comment is not refinable, so a round costs no model call for it.
- A round that finds an open blocker sets the Ready item back to New with
refine.blocked_by, asdocs/roadmap/refine.md:19says. - Live proof: after the release, the next refine round sets feat(roadmap): run the reconcile sweep on a cluster schedule #4574 back to New and names refactor(roadmap): run the stage cleanup in the status lane #5026 and feat(k8s): let Argo Workflows run roadmap pods in devops #4566.
Dependencies
None.
Alternatives check of 2026-11-19: none.
Tool: none found.
Reason: Searches returned only unrelated tools, such as OWASP Dependency-Track and stale-issue helpers; none offers a refine selection rule, a hash of the body outside the refine section, or a Ready item trigger from an edit or trusted comment.
Proposed design
Problem statement
Refine does not select a Ready item again after a person edits the body or adds a trusted comment. The item keeps status/ready and the old Dependencies section. The stage job reads only that section. It can plan the item while a new blocker is open. Refine must select such an item again and set it back to New when it finds an open blocker.
Acceptance criteria
Requirement: Edited Ready item is refinable
Refine SHALL select an open Ready item again when the hash of the text outside its refine section differs from refine.body_hash.
Scenario: Person edits the body of a Ready item
- WHEN a test builds an open Ready item with a refine record whose
refine.body_hashis the hash of the old text outside the refine section, writes a new body, and calls_refinablewithunrefined_ready=Falseand no trusted comment - THEN the test asserts that
_refinablereturns the item
Requirement: New trusted comment is refinable
Refine SHALL select an open Ready item again when a trusted comment is newer than its last refine round.
Scenario: Person comments on a Ready item
- WHEN a test builds an open Ready item with a refine record and a comment by a trusted person after its last refine round, and calls
_refinablewithunrefined_ready=False - THEN the test asserts that
_refinablereturns the item
Requirement: Bot comment is not refinable
Refine MUST NOT select an open Ready item again for a comment that a bot wrote.
Scenario: Bot comments on a Ready item
- WHEN a test builds an open Ready item with a comment after its last refine round from a bot, and calls
_refinablewithunrefined_ready=False - THEN the test asserts that
_refinablereturns an empty list
Requirement: Unchanged Ready item is not refinable
Refine MUST NOT select an open Ready item when its text matches refine.body_hash and no trusted comment is newer than its last refine round.
Scenario: Sweep with no edit and no new comment
- WHEN a test builds an open Ready item with a matching
refine.body_hash, no trusted comment after its last refine round, and calls_refinablewithunrefined_ready=False - THEN the test asserts that
_refinablereturns an empty list
Requirement: Round records the edited body hash
A refine round on a Ready item SHALL record refine.body_hash as the hash of the text outside the refine section.
Scenario: A round keeps a Ready item Ready
- WHEN a test calls
apply_refineon a Ready item with a plan that adds no dependency and with a body edited outside the refine section - THEN the test asserts that
refine.body_hashequalsbody_hashes(item.body)[0]
Requirement: Refine section write does not change the body hash
The value that refine.body_hash records MUST NOT change when a round writes only the refine section.
Scenario: A round writes the refine section
- WHEN a test calls
body_hasheson a body, writes a new refine section into the body, and callsbody_hasheson the result - THEN the test asserts that the body hash is the same before and after the write
Requirement: Open blocker returns a Ready item to New
A refine round that finds an open issue as a dependency MUST set the item Status to New and name the open issue in refine.blocked_by and in the refine section.
Scenario: New scope comment names an open blocker
- WHEN a test calls
apply_refinewith a plan whose proposal names an open issue as a dependency - THEN the test asserts that the item Status is New, that
refine.blocked_bynames the open issue, and that the refine section lists the open issue under Dependencies
Requirement: Explain names the edited body
devops roadmap explain MUST report the edited body as the reason that refine is due.
Scenario: Explain an edited Ready item
- WHEN a test calls
explain_itemandrender_explanationon a Ready item whose body differs fromrefine.body_hash - THEN the test asserts that the rendered Refine line names the edit of the body
Requirement: Explain names the new comment
devops roadmap explain MUST report a new trusted comment as the reason that refine is due.
Scenario: Explain a Ready item with a new comment
- WHEN a test calls
explain_itemandrender_explanationon a Ready item with a trusted comment after its last refine round - THEN the test asserts that the rendered Refine line names the new comment
Existing Tool Considered
The alternatives check in the issue body returned none on 2026-11-19 and found no tool. The change builds its own code: about 40,000 tokens to build, keep and fix it, and about 1 hour.
Key questions
- Which Ready items does refine select today?:
_refinableselects an open item when its Status is New, when it is a Ready item with no refine record (_is_unrefined_ready), when it is a Ready item that holds a covering tool no round asked about (_needs_second_look), or when it is a Ready item that a bot opened andis_approvedno longer accepts.is_approvedreturns true for an item that a person opened. An edit or a comment does not end the Ready state of that item. [sources: src/devops_cli/roadmap/refine/refine.py:3297, src/devops_cli/roadmap/refine/refine.py:3287, src/devops_cli/roadmap/refine/refine.py:680, src/devops_cli/roadmap/trust.py:54] - What does
refine.comments_seenhold today, and which round writes it?:refine.comments_seenholds an integer comment count, asstr(item.comments). It is not a list of comment IDs._refine_markswrites it only on a waiting New item. It does not write it on a Ready item. [sources: src/devops_cli/roadmap/stores/store.py:155, src/devops_cli/roadmap/stores/store.py:182, src/devops_cli/roadmap/refine/refine.py:4376, tests/roadmap/refine/test_roadmap_refine_recorded_wait.py:105, openspec/specs/roadmap-refine/waits/spec.md:107] - How does
_refinablelearn about comments and their authors?: The caller passes the comments of each item and a trust predicate to_refinable. The trust predicate accepts a comment from a person and rejects a comment from a bot._refinablekeeps no store dependency. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:3297, src/devops_cli/roadmap/trust.py:54, src/devops_cli/roadmap/refine/refine.py:4376]- Chosen: Pass comments and a trust predicate into
_refinable. The caller has the store. The function can then compare a trusted comment with the last round and keep one selection rule. - Rejected: Read comments inside
_refinable._refinabletakes only a sequence of items. It has no store and cannot read comments. - Rejected: Use
refine.comments_seenas a list of comment IDs. The key holds an integer count._refine_marksdoes not write it on a Ready item.
- Chosen: Pass comments and a trust predicate into
- How does refine tell that a person edited the body of a Ready item?: Compare the current hash of the text outside the refine section from
body_hasheswithrefine.body_hash. (best practice) [sources: src/devops_cli/roadmap/body_hash.py:444, src/devops_cli/roadmap/refine/refine.py:3297, docs/roadmap/refine.md:19]- Chosen: Hash the text outside the refine section and compare it with
refine.body_hash. The record already holds the hash. The refine section is left out, so a round does not make the item due again. - Rejected: Hash the whole body and compare it with
refine.body_hash. A round writes the refine section, so every item would be due after each round. - Rejected: Compare the title and the body. The record holds no title hash. A new blocker is in the body or in a comment.
- Chosen: Hash the text outside the refine section and compare it with
- Which comments make a Ready item due again?: A comment from a trusted author after the last refine round makes the item due again. The last round time is
refine.repeated_atwhen the record sets it, else the time of the newest refine comment. A comment from a bot does not make the item due. (best practice) [sources: docs/roadmap/refine.md, src/devops_cli/roadmap/trust.py:54, src/devops_cli/roadmap/refine/refine.py:3297]- Chosen: A trusted comment after the last round. It catches a new scope comment. It leaves out a bot comment, so the item does not stay due.
- Rejected: Any comment after the last round. A bot comment, such as a stage comment, would make the item due again and again.
- Rejected: A new comment count in
refine.comments_seen. The key holds a count and is not written on Ready items. A bot comment would also change the count.
- Does the new rule apply to every Ready item or only to the items that a person opened?: It applies to every Ready item. (best practice) [sources: src/devops_cli/roadmap/trust.py:54, src/devops_cli/roadmap/refine/refine.py:3297]
- Chosen: Every Ready item. The record exists for each refined item.
is_approvedreads the body only, so a new comment on an item that a bot opened is not caught today. - Rejected: Only the Ready items that a person opened. It leaves the same gap for an item that a bot opened and a person later comments on.
- Chosen: Every Ready item. The record exists for each refined item.
- What does a round do when it finds an open blocker on a Ready item?: It sets the item Status to New and names the open issue in the refine record and in the Dependencies part of the refine section. (best practice) [sources: docs/roadmap/refine.md:19, src/devops_cli/roadmap/refine/refine.py:4568]
- Chosen: Set Status to New and name the open issue in the refine section. The stage job reads the Dependencies section of the body. The open issue then holds the stage job back.
- Rejected: Keep Status Ready and add a note. The stage job reads only the Dependencies section. It would plan the item while the blocker is open.
- Should
devops roadmap explainreport the new reason?: Yes. Add the edited body and the new trusted comment to the reason that the command prints. (best practice) [sources: tests/roadmap/test_roadmap_explain.py, src/devops_cli/roadmap/refine/refine.py:3297]- Chosen: Report the edit and the new comment in the reason. The reproduction reads that line. A stale reason misleads a person.
- Rejected: Leave the reason unchanged. The line would say the item is not due while the sweep selects it.
- Which tests prove the new rule offline?: Tests under
tests/roadmap/refine/build a Ready item with a refine record and call_refinablewith comments. The helpers intests/support/roadmap_refine.pybuild the item and its record. A test intests/roadmap/test_roadmap_explain.pyreads the Refine line. [sources: tests/roadmap/refine/test_roadmap_refine_selection.py, tests/roadmap/test_roadmap_explain.py, tests/support/roadmap_refine.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 19, 2026
Both modify _refinable to add a new trigger for re-examining Ready items, but #5515 triggers on a related item merge while this candidate triggers on a body edit or trusted comment.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.
dan-petty commentedon Nov 25, 2026
Returned to New: the refined specification for
#6452assumes arefine.comments_seenformat and a_refinablesignature that do not exist onorigin/main.Evidence from
origin/main:src/devops_cli/roadmap/stores/store.py:155-158, 182andopenspec/specs/roadmap-refine/waits/spec.md:107:RefineRecordKey.COMMENTS_SEEN("refine.comments_seen") holds an integer comment count (str(item.comments)), not a list of comment IDs (src/devops_cli/roadmap/refine/refine.py:2710, 2728,tests/roadmap/refine/test_roadmap_refine_recorded_wait.py:105-108).src/devops_cli/roadmap/refine/refine.py:4376-4408(_refine_marks): does not writeRefineRecordKey.COMMENTS_SEENwhen refining a Ready item (only_read_markswrites it on waiting New items); additionally, existing Ready fixtures intests/roadmap/test_roadmap_explain.py:553-559set placeholderBODY_HASH: "body"without hashing the body or settingCOMMENTS_SEEN.src/devops_cli/roadmap/refine/refine.py:3232-3247(_refinable(items, *, unrefined_ready)): takesSequence[Item]only, with noRoadmapStoreparameter and no access to individual comment IDs or authors (is_person_comment), so_refinablecannot distinguish a trusted comment from a bot comment (Scenario: Bot comments on a Ready item).Per
AGENTS.mdRule 2, no compensating change to_refinableorrefine.comments_seenwas made here. Refine can specify either a new record key for seen comment IDs/counts written on Ready items and passing comment/trust lookup into candidate selection, or another design matchingorigin/main.3 remaining items
devops-cli-service commentedon Nov 25, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
fix(roadmap): refine looks again at an edited Ready item (#6452)
fix(roadmap): refine looks again at an edited Ready item (#6452)
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