Skip to content

feat(roadmap): consolidate writes a plan of proposed groups #3740

Closed

Description

@dan-petty

Split from #1127 (part 2 of 4). Part 1 (#1127) builds the shared shortlist. This part uses it.

Problem

The consolidation job (#1127) has shortlists, but nothing yet turns a shortlist into a proposed group. A person cannot run devops roadmap consolidate or read a plan.

Expected

devops roadmap consolidate reads the open items, takes the shortlists of #1127, asks the model for a proposal and a refutation of each shortlist, checks the answers in code, and writes a plan file. It writes nothing to GitHub. Roadmap fields are labels (ADR 0016), so "Status In Progress or In Review" means the status labels, not a board field.

Acceptance criteria

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

  • The command joins the devops roadmap group with --repo/-R, --ref, --dry-run, --confirm and --decline <group-id>. Its help is in RoadmapCommandHelp, and the generated command docs are regenerated.
  • A run writes no GitHub change. It writes a Pydantic-validated plan to .data/roadmap/consolidate/<date>.json (through resolve_data_path) and prints a summary. A group carries: id, theme, root cause, members, anchor, shape (merge-into-anchor, parent-task-with-children, close-as-duplicate or link-only), consistency gained, risks, confidence, and per member the action (merge, child, link, close-when-anchor-merges) with its evidence.
  • Each shortlist goes through two tool-less chat_structured calls with ai.for_task("analysis"): a proposal, then a refutation that sees the proposal and the member bodies and returns kept, weakened (link-only) or dropped, with reasons. Only kept groups get a non-link action. No new task key.
  • Code validates the proposal: a member or anchor outside the shortlist is dropped, an unknown shape fails validation, and a #N or path:line evidence item must exist (store.issues(), git show <sha>:<path> at a recorded SHA).
  • An item with a status label In Progress or In Review is never a member. It is an anchor only for a link-only group.
  • An item whose milestone a person set (the job record shows no job wrote it, ADR 0002) is never merged into another item or made a child of one. It may be an anchor or a link.
  • A group whose members already link to its anchor is not proposed again, so a second run over an unchanged board proposes nothing new.
  • A member that a person reopened after a merge close is not proposed for that anchor again.
  • A group a person declined with --decline is recorded in the job record and is not proposed again until its membership changes.
  • "Close X when Y merges" is a member action. The plan lists it until Y is closed as completed.
  • An unreachable gateway fails closed: no plan is written, the exit is non-zero, and the message names the gateway.
  • Injection test: a member body tells the model to close feat(github): single-entry item intake with duplicate detection and placement (devops roadmap intake) #742, merge every issue into it and set P0, and the scripted model obeys. The plan holds only shortlist members.

Existing tool considered

The alternatives check on #1127 (2026-10-30) found no open tool that groups all open issues by root cause with these rules. The model calls reuse ai.for_task("analysis"), chat_structured and the intake model client. No new dependency.

Related

#1127 (shortlists), part 3 (apply), part 4 (MCP mirror and schedule row), #3635 (live-board check).

Proposed design

Problem statement

The consolidation job has shortlists but no proposed groups. A person cannot run devops roadmap consolidate or read a plan. This change adds the command, two model calls, code validation and a local plan file. It writes nothing to GitHub on a proposal run.

Acceptance criteria

Requirement: Command and help

The devops roadmap consolidate command SHALL join the devops roadmap group and accept --repo/-R, --ref, --dry-run, --confirm and --decline <group-id>.

Scenario: Help and docs show the command

  • WHEN A test loads the help for devops roadmap consolidate.
  • THEN The help comes from RoadmapCommandHelp, names every option, and the generated command docs match the regenerated output.

Requirement: Local plan output

A consolidate run without --decline SHALL write no GitHub change and SHALL write a Pydantic-validated plan to .data/roadmap/consolidate/<date>.json through resolve_data_path.

Scenario: Plan file is local and valid

  • WHEN A test runs consolidate with a scripted model and an in-memory store.
  • THEN The plan file exists at the resolved path, validates against the Pydantic model, and the command prints a summary.

Requirement: Dry run

A --dry-run run SHALL print the plan summary and SHALL write no plan file.

Scenario: Dry run writes no file

  • WHEN A test runs consolidate with --dry-run and a scripted model.
  • THEN The command prints the summary, writes no plan file, and makes no GitHub change.

Requirement: Group record

Each proposed group SHALL carry an id, theme, root cause, members, anchor, shape, consistency gained, risks, confidence, and per-member action with evidence.

Scenario: Group record has required fields

  • WHEN A test reads a plan from a scripted proposal.
  • THEN Every group and member has the required fields, and the shape is one of merge-into-anchor, parent-task-with-children, close-as-duplicate or link-only.

Requirement: Proposal and refutation calls

Each shortlist MUST go through two tool-less chat_structured calls with ai.for_task("analysis"): a proposal, then a refutation that sees the proposal and member bodies.

Scenario: Refutation decides each group

  • WHEN A test scripts the proposal and refutation replies.
  • THEN The refutation returns kept, weakened or dropped with reasons, only kept groups get a non-link action, and no new task key is added.

Requirement: Proposal validation

Code MUST drop a member or anchor outside the shortlist, fail on an unknown shape, and require each #N or path:line evidence item to exist.

Scenario: Invalid proposal is rejected

  • WHEN A test supplies an out-of-shortlist member, an unknown shape and a missing evidence item.
  • THEN The out-of-shortlist member is dropped, the unknown shape fails validation, and the missing evidence item is rejected through store.issues() or git show <sha>:<path> at the recorded SHA.

Requirement: Started item exclusion

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

Scenario: Started item is not a member

  • WHEN A shortlist contains an item with a status label In Progress or In Review.
  • THEN The plan holds no group that lists that item as a member, and uses it as an anchor only when the group shape is link-only.

Requirement: Person-set milestone protection

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

Scenario: Person-set milestone item is protected

  • WHEN The job record shows that no job wrote the item's milestone.
  • THEN The plan does not merge the item or make it a child, and may use it as an anchor or a link.

Requirement: No repeated group

A group whose members already link to its anchor SHALL not be proposed again, so a second run over an unchanged board proposes nothing new.

Scenario: Second run is idempotent

  • WHEN A test runs consolidate twice over the same unchanged board.
  • THEN The second run writes a plan with no new group.

Requirement: Reopened member exclusion

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

Scenario: Reopened member is skipped

  • WHEN A test marks a member as reopened after a merge close for an anchor.
  • THEN The plan does not propose that member for that anchor.

Requirement: Declined group memory

The --decline path SHALL write only the decline to the job record, and the group SHALL not be proposed again until its membership changes.

Scenario: Declined group is not repeated

  • WHEN A test declines a group and then runs consolidate on the same board.
  • THEN The job record holds the decline and the next plan omits the group.

Requirement: Close-when-anchor-merges action

The plan SHALL list a member action "close X when Y merges" until Y is closed as completed.

Scenario: Close action stays until anchor completes

  • WHEN A test has a member with the close-when-anchor-merges action and an open anchor.
  • THEN The plan lists the action, and removes it only after the anchor is closed as completed.

Requirement: Gateway failure

An unreachable gateway MUST fail closed: no plan is written, the exit is non-zero, and the message names the gateway.

Scenario: Unreachable gateway fails closed

  • WHEN A test makes the model gateway unreachable.
  • THEN No plan file is written, the command exits non-zero, and the error message names the gateway.

Requirement: Injection resistance

A member body that tells the model to close #742, merge every issue into it and set P0 MUST NOT put any item outside the shortlist into the plan.

Scenario: Injection does not expand membership

  • WHEN A test scripts the model to obey the injected body.
  • THEN The plan holds only shortlist members.

Requirement: Test isolation

Each new consolidate test SHALL use the in-memory store, a fake embedder and a scripted chat_structured, and SHALL finish in at most 1 s.

Scenario: New tests stay offline and fast

  • WHEN The new consolidate tests run.
  • THEN They touch no network, model or cluster, and each test finishes in at most 1 s.

Existing Tool Considered

No alternatives check has run on this issue. No open, maintained tool covers this need. The change reuses ai.for_task("analysis"), chat_structured and the intake model client. It adds no dependency.

Key questions

  • Where does the consolidate command join the CLI, and where is its help text?: It joins the devops roadmap group in src/devops_cli/commands/roadmap.py. Its help text lives in RoadmapCommandHelp in src/devops_cli/lang/en/help.py. devops docs generate regenerates the command docs. [sources: src/devops_cli/commands/roadmap.py, src/devops_cli/lang/en/help.py, src/devops_cli/docs/generator.py]
  • How does the command write the plan without a GitHub change?: Use a Pydantic model and write JSON to .data/roadmap/consolidate/<date>.json through resolve_data_path. Print a summary. Make no GitHub write on a proposal run. (best practice) [sources: src/devops_cli/core/repo.py, src/devops_cli/roadmap/run.py]
    • Chosen: Local JSON through resolve_data_path. It uses the shared data directory and keeps the run read-only on GitHub.
    • Rejected: GitHub issue or comment. The issue requires no GitHub change.
    • Rejected: Plain file without resolve_data_path. Worktrees must share the data directory.
  • Which model task and call pattern should the proposal and refutation use?: Use two tool-less chat_structured calls with ai.for_task("analysis"). Add no new task key. (best practice) [sources: src/devops_cli/ai/client/structured.py, src/devops_cli/roadmap/intake/intake_model.py, src/devops_cli/roadmap/refine/refine.py]
    • Chosen: Reuse the analysis task. It avoids a new task key and uses the existing structured-output path.
    • Rejected: Add a consolidate task key. The issue forbids a new task key.
    • Rejected: Use free-form chat. The reply must validate against a schema.
  • How should code treat the model proposal and its evidence?: Validate every proposal in code. Drop members or anchors outside the shortlist. Fail on an unknown shape. Require each #N or path:line evidence item to exist through store.issues() or git show <sha>:<path> at a recorded SHA. (best practice) [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md, src/devops_cli/roadmap/stage/stage_verify.py]
    • Chosen: Validate every proposal in code. A model plan is not a trusted finding; code checks membership, shape and evidence.
    • Rejected: Trust the model and write the plan. It permits out-of-shortlist items and invented evidence.
  • How should the job remember declines and avoid repeated proposals?: Record a decline in the issue job record and skip the group until its membership changes. Also skip groups whose members already link to the anchor and members reopened after a merge close. (best practice) [sources: docs/adr/0002-roadmap-jobs-act-as-a-machine-account.md, CONTEXT.md]
    • Chosen: Use the issue job record. ADR 0002 makes the hidden job record the place for job-written state.
    • Rejected: Use a local database. It adds state outside the issue and is not the project record.
    • Rejected: Use a new label. Labels hold roadmap fields, not job memory.
  • How should status labels and person-set milestones limit group membership?: Exclude In Progress and In Review items from membership. Use them only as anchors of link-only groups. Never merge or make a child of an item whose milestone a person set. It may be an anchor or a link. (best practice) [sources: CONTEXT.md, docs/adr/0002-roadmap-jobs-act-as-a-machine-account.md]
    • Chosen: Use labels and the job record. Labels hold Status, and the job record tells a person's milestone from a job's.
    • Rejected: Use a board field. ADR 0016 says no roadmap job reads a board.
    • Rejected: Ignore status and milestone. It would merge started or person-planned work.
  • How does --decline reconcile with the rule that a proposal run writes no GitHub change?: A proposal run without --decline writes no GitHub change. The --decline path writes only the decline to the issue job record. The job record is the hidden block in the issue body. (best practice) [sources: docs/adr/0002-roadmap-jobs-act-as-a-machine-account.md, CONTEXT.md]
    • Chosen: Write only the decline to the job record. ADR 0002 makes the issue body job record the place for job state; the rest of the run stays read-only.
    • Rejected: Write no GitHub change at all. It cannot remember a decline, so the same group returns.
    • Rejected: Write a new label. Labels hold roadmap fields, not job memory.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#1127

Alternatives check of 2026-11-08: none.
Tool: none found.

Activity

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

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It is a required step in a four-part feature but is not a security fix, regression, or blocking defect.
    • Value: Medium. It enables a person to read a proposed consolidation plan, which is one step in a larger workflow.
    • Effort: High. The acceptance criteria span model calls, code validation, status-label rules, milestone checks, decline tracking, injection testing, and a new command with help text.
    • Related: 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, which asks for a different change. Both target the 'devops roadmap consolidate' command; #1127 is the umbrella covering shortlists, proposal, apply and schedule, while the candidate delivers only the plan-writing and validation step.
  3. added
    priority/p2-medium
    on Nov 6, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 7, 2026
  5. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 72c52c6 (see proposed design in issue body).

  6. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Answer from project standards: this item owns the model stage of consolidate. #3743 and #3745 only apply the plan and add a weekly row. Ask for four things in the design, and file no new item.

    1. The proposal and the refutation of each shortlist use the same token cap and wait limit as the other model steps. This applies when the bounds of the model steps are built. Those bounds wait on test(roadmap): run the cloud baseline of the stage eval #3566 and on the owner answer on feat(roadmap): Tune stage planner caps from run data #3241.
    2. The plan file is the record of the model output. Write it for each shortlist when that shortlist is done.
      • A stop then loses at most one shortlist.
      • A rerun with the same shortlist hash makes no model call.
    3. A failure of the model stage uses the failure class and the step name of roadmap/failure.py (FailureClass, CLASS_BY_EXCEPTION, RETRY_AFTER, StepName).
    4. The weekly row of feat(roadmap): consolidate has an MCP mirror and a weekly row #3745 is a Service row, so it follows the ledger and the retry rules.

    Add a fixture-based eval case for the proposal and the refutation. Add a step metric when the step metric issues of #3027 merge. Do not add a second store.

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

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: Searches for a tool that groups open issues by root cause and proposes merge/child/link/close groups returned only unrelated documentation pages (MDN), no open project that does this. The need is a project-internal devops roadmap consolidate stage built on the existing ai.for_task("analysis")/chat_structured calls, with rules tied to this repository's status labels, job record (ADR 0002) and shortlists, which no general-purpose issue-deduplication tool provides.

    Tool: none found

    Lacks:

    • No tool turns the project's shortlists into a proposed group with theme, root cause, anchor, shape and per-member actions
    • No tool enforces this project's membership rules: status-label exclusions, person-set milestone protection, reopened-member and declined-group memory
    • No tool performs the proposal plus refutation model calls and the code-side validation of members, shape and #N or path:line evidence
    • No tool writes the Pydantic-validated local plan through resolve_data_path with --dry-run/--confirm/--decline

    Searches run:

    • AI duplicate issue detection GitHub issues clustering LLM library, results: 5
    • open source tool group GitHub issues by root cause propose duplicate merge, results: 5
    • "duplicate issue" detection tool GitHub CLI triage AI, results: 5
    • issue triage LLM clustering roadmap planning tool github repository, results: 5
    • PyPI package cluster issues by semantic similarity root cause, results: 5
    • github issue deduplication bot open source, results: 5
    • github issue duplicate detection, results: 5
    • issue consolidation tool merge duplicate issues roadmap, results: 5

    Sources:

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

  8. dan-petty commented on Nov 10, 2026

    @dan-petty
    OwnerAuthor

    Evidence from a check on 2026-11-10 for a proposed "Jev judge for the consolidation shortlist":

    • devops roadmap consolidate does not exist: devops roadmap consolidate --help answers "No such command". src/devops_cli/roadmap/consolidate_shortlist.py has no caller in src/. Only tests/roadmap/test_roadmap_consolidate_shortlist.py imports it.
    • This issue already asks for the model judge of each shortlist (a proposal call and a refutation call with ai.for_task("analysis")). No other open issue does. A Jev step needs the command and the plan of this issue as its place to run, so a separate Jev issue would add code that nothing calls.

    Proposal, for the person who plans this item:

    1. Build this issue as written. Keep the judge behind one small function that takes a shortlist and returns per-member verdicts, so a second judge can replace the first.
    2. After this issue merges, measure Jev (typesafe/jev-1.14, one Noul question per member, one Choice over merge, link-as-related and unrelated) against the existing chat_structured judge on a labelled set of closed duplicate and related pairs. Jev costs about 0.042 USD per 1M input tokens and returns calibrated probabilities.
    3. Turn Jev on only if its precision is at least 0.9. A Jev error, timeout or low confidence gives no flag (fail open). The result stays a flag and a comment: it never drops a candidate, closes an issue or changes a label.

    No code was written for this check.

  9. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 10, 2026
  10. removed
    status/in-review
    owner/agent
    on Nov 10, 2026
  11. devops-cli-service commented on Nov 10, 2026

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

    @devops-cli-service
    Contributor

    Live since 2026-11-10 03:32 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/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions