Skip to content

fix(roadmap): Refine posts a short comment only when its result changes #6196

Closed

Description

@dan-petty

Problem

Area 3 of the parent item. next_step_of (refine.py:1486) takes the comment details from the same proposal that render_proposal_section (:1980) writes to the body: open questions, Fit, open dependencies and the suspected block. Each comment also repeats the checked-at SHA and the Status label ("Status set to Ready at SHA ..."). The owner-question frame repeats the first open question. The repeat guard (comment_repeat.py:83) looks only at the trailing run of refine comments, so a person's or another job's comment lets the same comment post again. The fingerprint depends on the order of the block paths (refine.py:3162).

Live: the SHA equals checked-at in 11 ready comments (#5082, #5033, #5318, #3909, #3907, #5096, #3827, #5112, #5144, #3885, #3902). Blocked comments name the blocker that Dependencies lists (#5319, #5291, #5285, #5217). Repeats: #3655 (3 identical Ready notices), #1928, #6048 (same owner question at 22:03 and 22:22), #5217 (same blocked comment, paths in another order).

Expected behavior

  • The refine body section holds the questions, Fit, suspected block, dependencies, and also "Moved to new items" (from refine.deferred) and the watched files (block paths). Labels hold the Status; checked-at holds the SHA.
  • A refine comment is a short event line that names the step and the body section, with no list, SHA or Status sentence. It posts only when the next step or the section hash differs from the round before. A round that posts no comment records refine.repeated_at.
  • The refine owner-question frame keeps its options, recommendation, evidence and hidden hash, and names the body section in place of the question text. Stage and implement frames keep the question text.
  • Wait selection (_wait_start :2293, :2377) ends a wait from the later of refine's last comment and refine.repeated_at. The model input (_replies_for_model :3371, replies_since_refine :2121) stays anchored at refine's last comment, so no person's reply is lost.
  • _wait_text / _wait_refs (:2210-2228) get the #N and paths from the body section and the replies, not from the comment text.
  • request_plan.py:420 (refine dry run) shows that a comment posts only on a change.
  • A contract test builds the section and the comment from one proposal and fails when a content line of the comment is in the section.

Related

Source: #6193

Alternatives check of 2026-11-18: partly.
Tool: peter-evans/create-or-update-comment (https://github.com/peter-evans/create-or-update-comment), MIT, last activity 2026-11-01, maintained.
Reason: Searches found only the GitHub Actions pair that upserts one bot comment by a body marker; it dedupes repeats but gives no change gate, round record or short event line.

Covers:

  • Updates one existing comment in place by comment id
  • Finds a bot comment by a body string before posting
  • Replaces the body instead of appending a second copy

Lacks:

  • No change gate; the body is rewritten every round
  • No round fingerprint or repeated-at record
  • No short event line, Status or SHA handling
  • A workflow action, not code in the roadmap job

Proposed design

Problem statement

Hold this item until #6195 merges; then make refine post a short event comment only when the next step or the body section hash changes. Today refine repeats the checked-at SHA, the Status, and the first owner question in comments. It can repost after a person comment because the repeat guard reads only the trailing refine run. The change moves round state into the body section and the hidden job record. It makes the section hash independent of block-path order. It keeps wait and model inputs anchored to the right comment.

Acceptance criteria

Requirement: Body section holds round state

The refine body section SHALL hold the open questions, Fit, suspected block, dependencies, moved-to-new-items list and watched block paths.

Scenario: Render section with deferred items and block paths

  • WHEN the test renders the proposal section from a proposal with a question, Fit, a suspected block, dependencies, a deferred item and two block paths
  • THEN the section shows each item under its own heading and shows no checked-at SHA and no Status sentence

Requirement: Short event comment

A refine comment SHALL be one short event line that names the next step and the body section.

Scenario: Build a refine comment

  • WHEN the test builds the refine comment from a proposal
  • THEN the comment is one line, names the next step and the body section, and has no list, SHA or Status sentence

Requirement: Unchanged round posts no comment

Refine SHALL post a comment only when the next step or the body section hash differs from the round before.

Scenario: Unchanged round posts no comment

  • WHEN the test runs two refine rounds with the same next step and the same section content
  • THEN the second round posts no comment and the hidden job record holds refine.repeated_at

Requirement: Changed section posts a comment

Refine SHALL post a comment when the body section hash changes.

Scenario: Changed section posts a comment

  • WHEN the test changes one block path in the proposal and runs the round again
  • THEN the round posts one refine comment

Requirement: Order-independent section hash

The refine section hash SHALL not depend on the order of the block paths.

Scenario: Block paths in another order

  • WHEN the test hashes two proposals with the same block paths in opposite order
  • THEN both proposals give the same hash

Requirement: Repeat guard after person comment

A person comment between refine rounds SHALL NOT let an unchanged refine comment post again.

Scenario: Person comment between identical rounds

  • WHEN the test adds a person comment after a refine comment and runs the same round again
  • THEN the round posts no refine comment

Requirement: Refine owner-question frame

The refine owner-question frame SHALL keep its options, recommendation, evidence and hidden hash and name the body section in place of the question text.

Scenario: Refine owner-question frame

  • WHEN the test builds the refine owner-question frame
  • THEN the frame names the body section and keeps the options, recommendation, evidence and hidden hash

Requirement: Stage and implement frames keep text

Stage and implement question frames SHALL keep the question text.

Scenario: Stage and implement frames

  • WHEN the test builds a stage frame and an implement frame
  • THEN both frames contain the question text

Requirement: Wait start uses repeated_at

Wait selection SHALL start a wait from the later of refine's last comment and refine.repeated_at.

Scenario: Repeated round later than last comment

  • WHEN the test sets refine.repeated_at later than refine's last comment
  • THEN _wait_start returns the refine.repeated_at time

Requirement: Model input keeps person replies

The model input SHALL stay anchored at refine's last comment so that no person reply is lost.

Scenario: Person reply after a silent round

  • WHEN the test builds the model replies after a refine comment and a later refine.repeated_at and a person reply between them
  • THEN _replies_for_model includes the person reply

Requirement: Wait refs from body and replies

_wait_text and _wait_refs SHALL take the issue number and paths from the body section and the replies, not from the comment text.

Scenario: Wait refs with short comments

  • WHEN the test gives a body section and replies with an issue number and paths and gives comments with no list
  • THEN _wait_refs returns the issue number and paths from the body section and replies

Requirement: Dry run shows the comment gate

The refine dry run SHALL show that a comment posts only when the round changes.

Scenario: Dry run unchanged and changed

  • WHEN the test runs the refine dry-run plan for an unchanged round and for a changed round
  • THEN the unchanged plan says no comment posts and the changed plan says a comment posts

Requirement: Contract test for comment and section

A contract test SHALL fail when a content line of the comment is in the section built from the same proposal.

Scenario: Comment content appears in section

  • WHEN the test builds the section and comment from a proposal and adds a comment content line to the section
  • THEN the contract test fails

Existing Tool Considered

The alternatives check in the issue body records partly for peter-evans/create-or-update-comment (MIT, maintained) and lists what it covers and lacks. This proposal keeps the roadmap code. It adds the change gate, the refine.repeated_at record, the short event line, and the order-independent section hash that the tool lacks. The written cost is about one engineer-day and roughly 40k model tokens. The change adds no new dependency.

Key questions

  • Where does refine record a round that posts no comment?: In the hidden refine job record in the issue body as refine.repeated_at. (best practice) [sources: docs/adr/0001-github-is-the-roadmap-source.md, CONTEXT.md, src/devops_cli/roadmap/refine/refine.py:3162]
    • Chosen: Hidden job record refine.repeated_at. The job record is machine state in the issue body and survives person comments.
    • Rejected: Trailing comment run. A person comment breaks the run and lets the same comment post again.
    • Rejected: Status label. Labels hold Status; a round time would add a second label family.
  • What makes a refine comment post?: A change in the next step or in the body section hash since the last round. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:1485, src/devops_cli/roadmap/refine/refine.py:3162]
    • Chosen: Next step or section hash. This posts on a real state change and stays silent on a repeat.
    • Rejected: Full comment hash. The SHA and Status change every round, so every round posts.
    • Rejected: Next step only<|begin▁of▁sentence|>Sunday. It misses changed questions, dependencies, block paths and deferred items.
  • How does the section hash ignore block-path order?: Sort the block paths before the hash. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:3162]
  • Where do _wait_text and _wait_refs read the issue number and paths after comments lose the list?: From the body section and the replies. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:2216, src/devops_cli/roadmap/refine/refine.py:2226, src/devops_cli/roadmap/refine/refine.py:2388]
    • Chosen: Body section and replies. The body keeps the refs and replies can add a new ref.
    • Rejected: Last refine comment. The short event line has no issue number or paths.
    • Rejected: Job record only. A person reply is not in the job record.
  • What anchors wait end and model input?: Wait end uses the later of refine's last comment and refine.repeated_at; model input stays at refine's last comment. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:2297, src/devops_cli/roadmap/refine/refine.py:3371]
    • Chosen: Wait at later of both; model at last comment. A silent round still ends a wait, and a person reply after the last comment stays visible.
    • Rejected: Both at refine.repeated_at. It can hide a person reply that comes after the last comment.
    • Rejected: Both at the last comment. A silent round never ends a wait.
  • What does the refine owner-question frame show?: It keeps its options, recommendation, evidence and hidden hash, and names the body section instead of the question text. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py]
    • Chosen: Name the body section in the refine frame. The comment stays short and the body holds the question text.
    • Rejected: Keep the question text in all frames. The refine comment repeats the first open question.
    • Rejected: Drop options and evidence. A person loses the information needed to answer.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#6195

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/high
    on Nov 17, 2026
  2. dan-petty commented on Nov 17, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 17, 2026
  4. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    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 (8)

    Tools considered:

    Searches run:

    • GitHub comment deduplication post only when content changes, results: 5
    • peter-evans create-or-update-comment action update existing comment, results: 5
    • create-or-update-comment github action, results: 5
    • actions-cool issues-helper create comment duplicate, results: 5
    • GitHub issue comment bot avoid duplicate comments library python, results: 5
    • peter-evans/create-or-update-comment GitHub Action, results: 5
    • GitHub API update comment by identifier bot marker hidden html comment dedupe, results: 5
    • python library upsert github issue comment instead of posting duplicate, results: 5

    Sources:

  5. added
    status/ready
    and removed
    status/new
    on Nov 19, 2026
  6. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 4624bc7 (see proposed design in issue body).

  7. added
    owner/agent
    status/in-progress
    and removed
    status/ready
    on Nov 19, 2026
  8. removed
    status/in-progress
    owner/agent
    on Nov 19, 2026
  9. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor
  10. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-19 06:26 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/highpriority/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions