Repository navigation
Description
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 roadmapgroup with--repo/-R,--ref,--dry-run,--confirmand--decline <group-id>. Its help is inRoadmapCommandHelp, 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(throughresolve_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-duplicateorlink-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_structuredcalls withai.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
#Norpath:lineevidence 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
--declineis 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-runand 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-duplicateorlink-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()orgit 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 roadmapgroup insrc/devops_cli/commands/roadmap.py. Its help text lives inRoadmapCommandHelpinsrc/devops_cli/lang/en/help.py.devops docs generateregenerates 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>.jsonthroughresolve_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_structuredcalls withai.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
#Norpath:lineevidence item to exist throughstore.issues()orgit 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
--declinereconcile with the rule that a proposal run writes no GitHub change?: A proposal run without--declinewrites no GitHub change. The--declinepath 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
Alternatives check of 2026-11-08: none.
Tool: none found.
Activity
dan-petty commentedon Nov 6, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It is a required step in a four-part feature but is not a security fix, regression, or blocking defect.It enables a person to read a proposed consolidation plan, which is one step in a larger workflow.The acceptance criteria span model calls, code validation, status-label rules, milestone checks, decline tracking, injection testing, and a new command with help text.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.feat(roadmap): build the shared shortlist of the consolidation job (#…
devops-cli-service commentedon Nov 7, 2026
Status set to Ready at 72c52c6 (see proposed design in issue body).
dan-petty commentedon Nov 7, 2026
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.
FailureClass,CLASS_BY_EXCEPTION,RETRY_AFTER,StepName).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.
devops-cli-service commentedon Nov 8, 2026
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 consolidatestage built on the existingai.for_task("analysis")/chat_structuredcalls, 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:
Searches run:
Sources:
Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.
dan-petty commentedon Nov 10, 2026
Evidence from a check on 2026-11-10 for a proposed "Jev judge for the consolidation shortlist":
devops roadmap consolidatedoes not exist:devops roadmap consolidate --helpanswers "No such command".src/devops_cli/roadmap/consolidate_shortlist.pyhas no caller insrc/. Onlytests/roadmap/test_roadmap_consolidate_shortlist.pyimports it.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:
typesafe/jev-1.14, one Noul question per member, one Choice over merge, link-as-related and unrelated) against the existingchat_structuredjudge on a labelled set of closed duplicate and related pairs. Jev costs about 0.042 USD per 1M input tokens and returns calibrated probabilities.No code was written for this check.
devops-cli-service commentedon Nov 10, 2026
Released in v0.106.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.106.0
devops-cli-service commentedon Nov 10, 2026
Live since 2026-11-10 03:32 UTC