Skip to content

fix(roadmap): Intake and retitle comments repeat no body or title text #6198

Done

Description

@dan-petty

Problem

Area 5 of the parent item.

Expected behavior

  • A refine deferral candidate carries an apart set on NewCandidate: the parent and the numbers in refine.deferred. _apart does not compare it with them.
  • _reason_lines writes no Related line for a number that the body references. Use the existing #N reference parser of the roadmap package.
  • A "Possible duplicate: #N" line always stays, also when the body names #N (rule: flag, never drop).
  • The Priority line keeps the reason and the P0 granted or refused text, without the value that the label shows.
  • A candidate with no lines left gets no comment (existing behavior, intake.py:1268-1274).
  • The retitle comment keeps the reason, the length and limit, the source of the summary and "Before". It has no After line.
  • Contract tests: the intake reason comment against the candidate body (exempt the Possible duplicate line), and the retitle comment against the title.

Source: #6193

Alternatives check of 2026-11-24: none.
Tool: none found.
Reason: Searches for a library that parses #N references, suppresses comment lines that repeat an issue body or title, or carries a parent/apart set returned no relevant project; the change stays inside the roadmap package's own code.

Lacks:

  • No tool parses #N references from candidate bodies
  • No tool suppresses a comment line that repeats the body or title
  • No tool carries an apart set for duplicate detection
  • No tool builds or contracts the intake and retitle comments

Proposed design

Problem statement

Intake and retitle comments repeat text that the issue body or title already holds. A refine deferral makes intake write Related: #<parent> next to Split from #<parent>, and the Priority line repeats the value of the priority/* label from the same run. The retitle comment repeats the new title in an After line. The fix removes the repeated text and keeps each line that flags a duplicate.

Acceptance criteria

Requirement: A refine deferral names its apart set

NewCandidate SHALL carry an apart set of issue numbers that duplicate detection skips.

Scenario: A refine deferral skips its parent

  • WHEN a test builds a NewCandidate with apart={6167} and runs the duplicate shortlist on it
  • THEN the shortlist holds no issue 6167

Requirement: No Related line for a number in the body

_reason_lines SHALL write no Related: #N line for an issue number that the candidate body references.

Scenario: The body already names the related item

  • WHEN a test calls _reason_lines for a candidate whose body holds #6167 and whose related items hold 6167
  • THEN the lines hold no Related: #6167 line

Requirement: A Possible duplicate line always stays

The reason comment MUST keep each Possible duplicate: #N line, also when the body references #N.

Scenario: The body names the duplicate number

  • WHEN a test calls _reason_lines for a candidate whose body holds #6167 and whose duplicate is 6167
  • THEN the lines hold Possible duplicate: #6167

Requirement: The Priority line drops the label value

The Priority line SHALL hold the reason and the P0 granted or refused text, and SHALL NOT copy the value of the priority/* label.

Scenario: A P0 grant shows one priority value

  • WHEN a test calls _reason_lines for a candidate with a P0 grant and a judgement that gives the reason
  • THEN the Priority line holds the reason and the granted text, and the test counts one P0 in it

Requirement: No comment when no line is left

Intake SHALL write no reason comment when the line list is empty.

Scenario: Each line would repeat the body

  • WHEN a test runs intake on a candidate whose only reason line would repeat the body
  • THEN intake makes no comment request to the fake GitHub client

Requirement: The retitle comment has no After line

The retitle comment SHALL hold the reason, the length and the limit, the source of the summary and the Before line, and SHALL NOT hold an After line.

Scenario: A title changes in the same run

  • WHEN a test runs retitle on an issue whose title changes from old to new
  • THEN the comment holds the Before line with old and holds no - After: line

Requirement: Contract test of the intake comment against the body

A test SHALL fail when a line of the intake reason comment holds an issue number that the candidate body also holds, except a Possible duplicate: line.

Scenario: A related number is in the body

  • WHEN the test builds the reason comment for a candidate whose body holds #6167 and whose related items hold 6167
  • THEN the test passes, and it fails when the Related: #6167 line is put back

Requirement: Contract test of the retitle comment against the title

A test SHALL fail when a line of the retitle comment holds the new title.

Scenario: The new title is in the comment

  • WHEN the test runs retitle for a new title and reads each comment line
  • THEN no line of the comment holds the new title

Existing Tool Considered

The alternatives check of 2026-11-18 in the issue body gives the verdict none and names no tool. The block lists what no external tool does: it parses no #N reference, suppresses no repeated comment line and holds no parent/apart set. This change builds its own code, so here is the written cost: about 150 lines in three modules, an estimated 45k tokens to build, about 9k tokens each year to keep and fix, and about one day elapsed. The repository already holds the reference parser, so the build is smaller than a new dependency.

Key questions

  • Which #N reference parser does _reason_lines use to find a number in the body?: Reuse the existing #N reference parser of the roadmap package. Do not add a second regular expression, because two parsers would disagree on a reference. (best practice) [sources: src/devops_cli/roadmap/intake/intake.py:1099]
    • Chosen: Reuse the existing roadmap parser. The issue names it, and one parser keeps intake and refine in agreement.
    • Rejected: Add a new regular expression in intake. A second parser drifts from the first and adds code to keep.
  • How does a refine deferral candidate tell _apart which numbers to skip?: Add an apart field to NewCandidate, empty by default. Refine sets it to the parent and the numbers in refine.deferred, and _apart removes those numbers from the shortlist. (best practice) [sources: src/devops_cli/roadmap/intake/intake.py:215, src/devops_cli/roadmap/intake/intake.py:866, src/devops_cli/roadmap/intake/intake.py:1232, src/devops_cli/roadmap/refine/refine.py:3258]
    • Chosen: A field on NewCandidate. The candidate carries the numbers, so each caller keeps its current signature.
    • Rejected: A new parameter of _shortlist. It threads the set through each caller of the shortlist.
    • Rejected: A module-level set. Hidden state leaks between candidates and tests.
  • Does refine add a source to a deferral so intake makes a sub-issue link?: No. Refine files a deferral with no source on purpose, so no sub-issue link is made. The apart set, not a source, stops the Related line. A candidate is never a duplicate of the issue that it is split from. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:3258, CONTEXT.md]
    • Chosen: Keep the source empty. A sub-issue link would make the parent and its deferral look like a duplicate pair.
    • Rejected: Set the source to the parent. It adds a link that the split does not need and repeats the parent number.
  • How does _reason_lines keep a Possible duplicate line and drop a Related line for the same number?: Decide by the kind of the line. A Possible duplicate: line always stays, and the body check applies to a Related: line only. (best practice) [sources: src/devops_cli/roadmap/intake/intake.py:1099, CONTEXT.md]
    • Chosen: Check the kind of the line. The rule is flag and never drop, so a duplicate line is not a repeat.
    • Rejected: Apply the body check to each line. It would drop a Possible duplicate line and lose a flag.
  • What does the Priority line hold when the label value goes?: It holds the reason and the P0 granted or refused text. It holds no copy of the value that the priority/* label shows, because intake writes that label in the same run. (best practice) [sources: src/devops_cli/roadmap/intake/intake.py:1278]
    • Chosen: Drop the label value. The label holds the value, so a second copy adds no fact.
    • Rejected: Keep the label value. It repeats the label in the same run, which is the defect.
  • What does the retitle comment keep when the After line goes?: It keeps the reason, the length and the limit, the source of the summary and the Before line. It has no After line, because the comment and the new title are in the same run. (best practice) [sources: tests/roadmap/test_roadmap_retitle.py]
  • How do the two contract tests show that the comment and the body or title agree?: The intake test builds the reason comment and fails when a line holds a number that the body holds, except a Possible duplicate: line. The retitle test fails when a comment line holds the new title. (best practice) [sources: tests/roadmap/intake/test_roadmap_intake_evidence.py, tests/roadmap/test_roadmap_retitle.py]
    • Chosen: Contract tests in the two test modules. A later change to a comment writer fails the test that holds the rule.
    • Rejected: No contract test. The repeat would come back with no test to stop it.
  • Does intake stay silent when no reason line is left?: Yes. The existing behavior writes no comment when the line list is empty. [sources: src/devops_cli/roadmap/intake/intake.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/medium
    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 (3)

    Searches run:

    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 25, 2026
  8. added
    status/in-review
    and removed
    status/in-progress
    on Nov 25, 2026
  9. removed
    status/in-review
    owner/agent
    on Nov 25, 2026
  10. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor
  11. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-25 17:09 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/mediumpriority/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