Skip to content

feat(roadmap): a consolidation job proposes one task for open items that share a root cause or change surface, and a person applies it (devops roadmap consolidate) #1127

Closed

Description

@dan-petty

Split into four parts (2026-11-06)

The full design does not fit one pull request: it has about 25 requirements, and the estimate is 180,000 tokens and 4 weeks. The refine round of 2026-10-28 proposed four parts. This pull request delivers part 1, the shared shortlist. It closes this issue. Each other criterion moved to the issue that holds its work.

Part Holds Issue
1 Shared nearest-item function, citation and link shortlists, blocked-by read, embedding cache, groups this issue
2 The command, the plan file, the proposal and refutation calls, validation, the rules the plan never breaks #3740
3 --apply for the four shapes, placement on apply, the new blocked-by write #3743
4 The MCP mirror and the weekly row of the due table #3745
live check The dry run on the live board #3635

The premise check of 2026-11-06 found four points of this text stale: the store had no read of blocked-by links (this part adds it), write_issue_body and add_sub_issue exist, there is no duplicateIssueId close (close takes a CloseReason), and roadmap fields are labels (ADR 0016), not board fields.

Problem

Items that share one root cause are filed one at a time, from different scopes and sessions. Each fixes its own site, and nothing applies the fix everywhere it is needed. Grouping them is manual work today:

Owner direction (2026-10-03): review all open items for similar issues that can be grouped into a single task and applied more consistently, and make that grouping part of devops project management in the future.

What the roadmap jobs cover today, and what they leave out:

This item adds the missing job. It extends #742's matcher from one candidate against the board to every open item against every other. It follows #744's rule that proposed decisions count until a person overrides them. It leaves placement to a person. It amends neither #742 nor #744: their write-scope constraints are owner decisions.

Acceptance criteria

All tests use the in-memory store, a fake embedder and no model. They touch no network or cluster, and each new test takes at most 1 s.

Delivered by this pull request (part 1)

  • One nearest-item function ranks items by cosine similarity. Intake calls it, and the intake tests do not change.
  • A shortlist for each open item comes from tools before any model call: shared path citations and backticked identifiers (read as refine reads them), and existing links (blocked-by, sub-issue and parent, the lines "Depends on", "Related", "Split from", "Split off" and "Merged into", and the section "Dependencies"). A citation that many items share is ignored. The nearest items by embedding join with their rank. Each member keeps its evidence.
  • The store reads blocked-by links (RoadmapStore.blocked_by, the REST endpoint dependencies/blocked_by), and the issue listing carries their count. A test covers both stores.
  • Embeddings are cached per item by the hash of the text of a person in the data directory. A test that counts the calls of a fake embedder shows that a second run over unchanged issues embeds nothing.
  • There is no transitive join and no graph code. An item is in one group at most, as the anchor or as a member. The stronger evidence wins a contested item (a shared path and identifier outranks an embedding rank), and a tie goes to the lower anchor number. A test covers an item that two anchors both want.

Moved to #3740 (part 2, the command and the plan)

  • The command and its options (--repo/-R, --ref, --dry-run, --confirm, --decline), and the plan file under the data directory with its Pydantic model.
  • The two tool-less chat_structured calls (proposal and refutation), the validation of the proposal in code, and the pair judgement of the shortlist.
  • The rules the plan never breaks: a started item, an item with a milestone a person set, a group that is already linked, a reopened member, a declined group, and "close X when Y merges".
  • The gateway that is not reachable, and the injection test of the plan.

Moved to #3743 (part 3, --apply)

  • --apply <group-id> --confirm for merge-into-anchor, parent-task-with-children, close-as-duplicate and link-only, with the new blocked-by write.
  • Placement on apply, and the injection test of the apply.

Moved to #3745 (part 4, the mirror and the schedule)

  • The read-only MCP mirror roadmap_consolidate, the weekly row of the due table with its test in tests/test_roadmap_run.py, and the generated docs.

Moved to #3635

  • The dry run on the live board reports the six groups of 2026-10-03 as already linked, and two runs print the same plan.

Key questions

Strategic alignment

Amended 2026-10-04: burn down the overage and borrowed debt

This amendment is withdrawn. #1959 deleted the agent filing quota, open_issue_limit and the budget/borrowed debt, so no overage or borrowed debt exists to burn down.

Alternatives check of 2026-10-30: none.
Tool: none found.

Proposed design

Problem statement

Open roadmap items that share a root cause or change surface are filed one at a time. Each fix lands at one site, and a person must find and group related items by hand. This item adds a weekly consolidation job that proposes groups from deterministic shortlists and two model passes, and a person applies one group with --apply --confirm.

Acceptance criteria

Requirement: Consolidate command and help

The devops roadmap consolidate command SHALL join the devops roadmap group with --repo/-R, --ref, --dry-run, --apply, --confirm and --decline, and its help SHALL live in RoadmapCommandHelp with regenerated command docs.

Scenario: Help lists the consolidate options

  • WHEN a test renders devops roadmap consolidate --help and runs the docs generator
  • THEN the help names each option, the command belongs to the roadmap group, and the generated roadmap command docs include the consolidate help.

Requirement: Dry-run plan file and schema

Without --apply, the command SHALL write no GitHub change, SHALL write a Pydantic-validated plan to .data/roadmap/consolidate/.json through resolve_data_path, and SHALL print a summary; each group SHALL carry id, theme, root cause, members, anchor, a shape from merge-into-anchor, parent-task-with-children, close-as-duplicate or link-only, consistency gain, risks, confidence, and each member action with evidence.

Scenario: Dry run writes only a complete plan

  • WHEN a test runs the command with a fake store and a fixed date
  • THEN the plan file exists at the resolved data path, the model validates every group and member action, the summary prints, and the fake store records no write.

Requirement: Read-only MCP mirror

The roadmap_consolidate MCP tool SHALL build argv that never contains --apply or --confirm.

Scenario: MCP mirror stays read-only

  • WHEN tests/test_fastmcp_contracts.py invokes roadmap_consolidate
  • THEN the argv contains neither --apply nor --confirm.

Requirement: Deterministic shortlists

The job SHALL build each shortlist from the shared nearest-item matcher, shared path or path:line citations and backticked identifiers, and existing blocked-by, sub-issue and body links before any model call.

Scenario: Shared citation creates a shortlist

  • WHEN two item bodies cite the same path:line
  • THEN the pair is in the shortlist and no model call happens before the shortlist is complete.

Requirement: Embedding cache

The job SHALL cache each item embedding by its body hash in the data directory so an unchanged board embeds nothing on a later run.

Scenario: Second run embeds nothing

  • WHEN a test runs the job twice with unchanged bodies and a counting fake embedder
  • THEN the second run makes zero embedder calls.

Requirement: Per-anchor group formation

The job SHALL form each group from one anchor and its shortlist members with no transitive join, and SHALL assign a contested item to the anchor with a shared cited file and symbol over an embedding rank, then to the lower anchor number on a tie.

Scenario: Contested item goes to stronger evidence

  • WHEN two anchors shortlist the same item and one anchor shares a cited file and symbol
  • THEN the item joins the stronger anchor, and on equal evidence it joins the lower-numbered anchor.

Requirement: Proposal and refutation calls

Each shortlist SHALL go through a tool-less proposal call and a tool-less refutation call with ai.for_task("analysis"), and only a kept group SHALL receive a non-link action.

Scenario: Refutation weakens a group to link-only

  • WHEN the refutation call returns weakened for a group
  • THEN the plan gives each member a link-only action.

Requirement: Model output validation

The job SHALL drop a member or anchor outside the shortlist, SHALL drop evidence that does not exist in store.issues() or git show :, and SHALL reject an unknown shape.

Scenario: Unlisted issue and missing path are dropped

Requirement: Started item rule

An item with Status In Progress or In Review SHALL never be a group member and SHALL be an anchor only for a link-only group.

Scenario: In Progress item is not absorbed

  • WHEN a shortlist includes an In Progress item
  • THEN the plan gives that item no merge or child action and uses it only as a link-only anchor.

Requirement: Person milestone rule

An item whose milestone a person set SHALL never be merged into another item or made a child of one, and MAY be an anchor or a link.

Scenario: Person-set milestone blocks a merge

  • WHEN a member has a milestone that the job record shows a person set
  • THEN the plan gives the member a link-only action or makes it an anchor.

Requirement: Already linked groups

A group whose members already link to its anchor by blocked-by, sub-issue or a body line SHALL not be proposed again.

Scenario: Second run proposes nothing new

  • WHEN a test runs the job twice over an unchanged board
  • THEN the second plan proposes no new group.

Requirement: Reopen override

A member that a person reopened after a merge close SHALL not be proposed for that anchor again.

Scenario: Reopen overrides a merge close

  • WHEN a close-then-reopen timeline shows a person reopened the member
  • THEN the plan omits the anchor-member pair.

Requirement: Declined group suppression

A group declined with --decline and recorded in the job record SHALL not be proposed again until its membership changes.

Scenario: Decline suppresses a group

  • WHEN a test declines a group and runs the job again with the same membership
  • THEN the plan omits the group, and after the membership changes the group returns.

Requirement: Close-when-anchor-merges

A close-when-anchor-merges action SHALL remain a member action until the anchor is closed as completed, and only then SHALL --apply propose the close.

Scenario: Close waits for anchor completion

  • WHEN the anchor is open, then closed as completed
  • THEN the plan lists the close action while the anchor is open, and --apply proposes the close only after the anchor is completed.

Requirement: Apply scope and identity

The --apply --confirm command SHALL run as the person gh login and SHALL write only the group members and anchor.

Scenario: Apply writes only the accepted group

  • WHEN a test applies one group with a fake store
  • THEN the store records writes only for that group members and anchor and records the person login.

Requirement: Merge-into-anchor apply

A merge-into-anchor apply SHALL append a marked section to the anchor body with <!-- devops-roadmap-consolidate:start --> and :end -->, copy each member acceptance criteria and key questions verbatim, add the plan root cause as plain text, and close each member as not planned with Merged into #: .

Scenario: Merge preserves text outside the marker

  • WHEN a test applies a merge group to an anchor with existing text
  • THEN the marked section holds the copied text, each member closes as not planned with the comment, and the text outside the section is byte-identical.

Requirement: Parent-task-with-children apply

A parent-task-with-children apply SHALL add sub-issue links, or blocked-by links when the anchor lands first, through new store write operations, and SHALL post one fixed-template comment on the anchor that lists the children and their order.

Scenario: Parent group links children

  • WHEN a test applies a parent group
  • THEN the store records the child links and one anchor comment with the child order.

Requirement: Close-as-duplicate apply

A close-as-duplicate apply SHALL close the member with close_issue as not planned and a comment Duplicate of #: , and MUST NOT call the removed close_as_duplicate operation.

Scenario: Duplicate close uses the current store operation

  • WHEN a test applies a close-as-duplicate group
  • THEN the store records close_issue for the member and no close_as_duplicate call.

Requirement: Link-only apply

A link-only apply SHALL post one fixed-template comment on each member that names the anchor.

Scenario: Link-only comments each member

  • WHEN a test applies a link-only group
  • THEN the store records one comment on each member that names the anchor.

Requirement: Apply placement

A merge SHALL set the anchor Priority to the highest member Priority only when no person set the anchor Priority, and SHALL never change the anchor milestone.

Scenario: Merge respects person placement

  • WHEN a test applies a merge group where the anchor has a person-set Priority and milestone
  • THEN the anchor Priority and milestone stay unchanged, and when no person set the Priority the anchor takes the highest member Priority.

Requirement: Injection containment

A member body that tells the model to close #742, merge every issue and set P0 SHALL NOT make the plan hold items outside the shortlist or make --apply write outside the group or set P0.

Scenario: Injected member body stays in the group

  • WHEN a test uses a scripted model that obeys the injected text
  • THEN the plan holds only shortlist members and no apply write sets P0.

Requirement: Weekly schedule row

The item SHALL add a row to #981 due table that makes the job due weekly and runs last after refinement, and tests/test_roadmap_run.py SHALL test the row.

Scenario: Schedule row runs last

  • WHEN the run table is built
  • THEN the consolidate row is weekly and ordered after refinement.

Existing Tool Considered

No open, maintained tool covers the need. The alternatives check on 2026-10-30 found none. GitHub duplicate detectors compare one new issue with the board; they do not group all open items, support multiple consolidation shapes, validate code evidence, enforce status and milestone rules, or integrate with this CLI, its store and its schedule. The change builds its own code. The written cost is about 180,000 tokens to build, 45,000 tokens a year to keep and fix, and 4 weeks of elapsed time.

Key questions

  • Does the consolidation job apply groups by itself?: No. The scheduled run writes only the plan. A person applies one accepted group with --apply --confirm, which keeps cross-issue writes out of the job. (best practice) [sources: CONTEXT.md, docs/adr/0002-roadmap-jobs-act-as-a-machine-account.md, src/devops_cli/roadmap/store.py]
    • Rejected: Scheduled run applies groups. It would write to other issues without a person, against the intake and refinement write limits.
    • Chosen: Person applies one group. It keeps merges and links a person step and uses the person gh login.
  • How does the job form groups without a graph library?: Use one shared nearest-item matcher and per-anchor shortlists with no transitive join. Assign a contested item by evidence strength, then by the lower anchor number. Use networkx only if transitive groups later prove necessary. (best practice) [sources: src/devops_cli/roadmap/duplicate_eval.py, src/devops_cli/roadmap/intake.py, CONTEXT.md]
    • Rejected: Hand-written union-find. It adds graph code the project must keep and test.
    • Rejected: networkx. It adds a dependency for a join that the design does not need.
    • Chosen: Per-anchor shortlists. It reuses the matcher and gives a deterministic tie-break.
  • Which store operation closes a duplicate member?: Use the current close_issue operation with the not-planned reason and a comment Duplicate of #. Do not reintroduce the removed close_as_duplicate operation or its duplicateIssueId payload. (best practice) [sources: openspec/changes/archive/2026-10-25-2218-intake-flags-possible-duplicates/proposal.md:18, src/devops_cli/roadmap/store.py, src/devops_cli/roadmap/memory_store.py]
    • Rejected: Reintroduce close_as_duplicate. A later change deleted the operation, its GraphQL mutation and its store tests.
    • Chosen: Use close_issue with a duplicate comment. The current store already has close_issue, and the comment keeps the duplicate relation.
  • How does the parent shape write sub-issue and blocked-by links when the store has no write operation?: Add sub-issue and blocked-by write operations to the store protocol, the GitHub store and the memory store, with contract tests. Use the sub-issue link for a parent task and the blocked-by link when the anchor lands first. Do not write links as body text. (best practice) [sources: src/devops_cli/roadmap/store.py, src/devops_cli/roadmap/memory_store.py, CONTEXT.md]
    • Rejected: Write links as body text. It is not a real sub-issue or blocked-by link and the job cannot read it back.
    • Chosen: Add store write operations. The parent shape needs real links, and the store contract tests cover both stores.
    • Rejected: Defer the parent shape. The rest of the job can carry the parent shape once the store writes exist.
  • Why does the job use a refutation pass?: A second tool-less call catches deliberate splits, order already recorded in both bodies, owner-placed anchors and topical-only root causes before a person reviews the plan. Only a kept group gets a non-link action. (best practice) [sources: CONTEXT.md]
    • Rejected: One proposal call. It misses the reasons that a manual pass weakened 45 of 104 candidates to links.
    • Chosen: Proposal and refutation calls. The refutation sees the member bodies and returns kept, weakened or dropped.
  • Which model task and configuration does the job use?: Use the existing analysis and embedding task overrides, as intake uses. Add no new task key. (best practice) [sources: src/devops_cli/roadmap/duplicate_eval.py, CONTEXT.md]
    • Rejected: Add a new consolidation task key. It adds configuration and a model route that the existing analysis task already covers.
    • Chosen: Reuse analysis and embedding. The job makes the same pair judgement and embedding calls as intake.
  • Does the plan rank or prioritize items?: No. The plan records each member milestone and priority so a person can see them. A person orders the items on the board. (best practice) [sources: CONTEXT.md, docs/adr/0001-github-is-the-roadmap-source.md]
    • Rejected: The plan ranks items. Placement stays a person step on the board.
    • Chosen: The plan records placement only. It gives a person the facts and changes no order.
  • How does the job treat close-when-anchor-merges?: It records the close as a member action. It proposes the close only after the anchor is closed as completed. (best practice) [sources: CONTEXT.md, docs/adr/0001-github-is-the-roadmap-source.md]
    • Rejected: Close the member at plan time. The anchor may never merge, and the member would close too early.
    • Chosen: Wait for the anchor to close as completed. It keeps the member open until its anchor lands.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#742, #744, #981

Activity

  1. added
    type/feature
    scope/ai
    scope/github
    priority/p2-medium
    on Oct 3, 2026
  2. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Premise check at 910b823: this item's row is to be due "on a RELEASE_SHIPPED change", but the roadmap Service never sees one. GitHubRoadmapStore.changes_since reads only the issue-events listing (src/devops_cli/roadmap/github_store.py:1290-1305), and RELEASE_SHIPPED is recorded only by the in-memory store (memory_store.py:400). A row tested on the in-memory store would pass and never fire in the Service. On 2026-10-07 the v0.2.28 ship went unseen this way, and a person started v0.2.29 by hand. #1360 makes the poll report the ship. Suggested amendment: depend on #1360 (land after it), and test this row's ship trigger over recorded REST responses for GitHubRoadmapStore, not only on the in-memory store.

  3. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Follow-up to the 2026-10-08 premise check: #1360 landed in v0.2.29, and GitHubRoadmapStore now reports a published Release as RELEASE_SHIPPED (roadmap/github_store.py:2418-2441), tested over recorded REST responses. This item's row fires as written, so the suggested amendment is not needed; #742, #743, #744, #981 and #1153 have landed. Found by the 2026-10-08 backlog review.

  4. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    The proposal at 69636b6 needs splitting into 4 items. A person splits the item into the items below, or replies in a comment or edits the body to keep one item, and the next refine round looks at the item again.

    1. Matcher refactoring and candidate generation: extract feat(github): single-entry item intake with duplicate detection and placement (devops roadmap intake) #742's matcher into a shared function, add citation and link shortlists, add embedding cache by body hash
    2. Model steps and plan output: two tool-less chat_structured calls (proposal and refutation), code validation of the proposal, Pydantic plan model, JSON write to data directory, summary print
    3. Apply modes: merge-into-anchor (marked section, close members), parent-task-with-children (sub-issue or blocked-by links, template comment), close-as-duplicate (duplicateIssueId), link-only (template comment), priority placement, injection test
    4. MCP mirror, scheduling row in feat(roadmap): run the roadmap jobs when they are due (devops roadmap run) #981's due table, help text in RoadmapCommandHelp, generated command docs, and uv run devops ci pass
  5. added
    status/new
    value/medium
    effort/high
    on Oct 28, 2026
  6. devops-cli-service commented on Oct 30, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Tool: none found

    Lacks:

    • Grouping all open issues by shared root cause (not just one-new-against-board duplicate detection)
    • Multiple consolidation shapes (merge-into-anchor, parent-task-with-children, close-as-duplicate, link-only)
    • Validation of proposals against code evidence (path:line, git show)
    • Rules about status, milestone ownership, reopen override
    • Apply mode with marked-section writes, priority placement, and injection safety
    • Integration with a project-specific CLI, store, scheduling, and MCP mirror

    Searches run:

    • AI-powered GitHub issue deduplication grouping consolidation tool

    Sources:

    Checked on 2026-10-30. A person decides what this means for the item. The check changes no label and closes no issue.

  7. 1 remaining item

  8. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at d254410 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • The proposal has no problem statement, no acceptance criterion with its requirement, scenario, WHEN and THEN, or no answer to the existing-tool question. State the problem, the requirements with their scenarios, and the open tool that covers the need or the cost of building it.
  9. added
    status/ready
    and removed
    status/new
    on Nov 5, 2026
  10. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 66a8a63 (see proposed design in issue body).

    Moved to new items: #3635.

  11. added
    owner/agent
    on Nov 6, 2026
  12. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    Answer from project standards, under the owner's instruction of 2026-11-05.

    Question: Is the Ready design real, and does it fit one pull request?

    Answer: The design is real, but it does not fit one pull request. This pull request delivers part 1 of 4, the shared shortlist, and the rest moved to other issues.

    Premise check at origin/main 29309f0:

    • The store has no blocked-by read. The REST endpoint works: GET /repos/dan-petty/devops-cli/issues/3635/dependencies/blocked_by answered [], and the issue payload holds issue_dependencies_summary. Part 1 builds the read.
    • write_issue_body and add_sub_issue exist. close takes a CloseReason that has DUPLICATE, and no duplicateIssueId call exists. Part 3 confirms the REST value before it closes a duplicate.
    • Roadmap fields are labels (ADR 0016), so the started-item rule of part 2 reads status labels.
    • The refine block says "fits in one pull request". The body has about 25 requirements and a cost of about 180,000 tokens and 4 weeks. That contradicts the split that refine proposed on 2026-10-28, so the split stands.

    Split:

    The body of this issue lists what part 1 delivers and which issue holds each moved criterion. A consolidation job proposes and a person applies. Nothing in these parts closes an issue by itself.

    Rule and sources: AGENTS.md rules 1 and 2, the "Partial work" rule of the brief, openspec/config.yaml (a change states whether it fits one pull request), ADR 0016.

  13. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 6, 2026
  14. removed
    status/in-review
    owner/agent
    on Nov 6, 2026
  15. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor
  16. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-06 08:34 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/aiscope/githubtype/featurevalue/medium

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions