Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/roadmap/refine.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The comment of refine is one event line. It names the next step and the parts of

A proposal that names an open issue as a dependency is not whole. The item waits on that issue. Refine does not set it to Ready, and a Ready item goes back to New. A closed dependency holds nothing back.

One rule decides which open dependency holds an item back, for refine, stage, implement and the cycle check (`open_blockers` of `src/devops_cli/roadmap/dependencies.py`, #6450). No job closes a tracker: it closes after its sub-issues. So the parent tracker of the item, and each tracker above the parent, is no blocker. Another open tracker holds the item back with its open sub-issues: the item waits on them and not on the tracker, a sub-issue that is a tracker gives its own open sub-issues, and a tracker with no open sub-issue holds nothing back. The issue listing gives the parent of each issue, so the rule sends no request for each item. Refine reads the whole listing for these links only when a dependency is an open tracker, so a closed parent between the item and a tracker above it breaks no chain, as in the stage job. The hold issue #6521 has no sub-issue and no label `type/epic`, so it is no tracker, and it holds the item back. A recorded wait follows the same rule: a recorded parent tracker ends the wait in the next round, and a recorded tracker gives the wait its open sub-issues. The Dependencies part of the section still names the tracker that the proposal names.

The Dependencies section of the body names an issue as `#N` or by its quoted title, such as `- "feat(roadmap): run each refine item in its own pod".`. Each `#N` of the section names a blocker, also in prose, such as `- #N`, `#5134, #5135`, `Merge first: #N`, `Depends on #N`, `#N (merged first).` or `Open the pull request after the pull request of #N merges.`. A missed blocker lets a job take an item while its blocker is open, so the rule keeps a `#N` unless the text says that it names a link (#6451):

- A block (a paragraph or the text of a list item) that starts with `None` or `No`, such as `None. #N uses these records.`, names no blocker.
Expand All @@ -26,7 +28,7 @@ The Dependencies section of the body names an issue as `#N` or by its quoted tit
- A block that names an issue that merges in either order (`No merge order`, `Rebase before the second of the two merges`) names no blocker.
- A `#N` in parentheses with other words is a note and names no blocker, and `(#N)` alone names one. So the hold line `- #6521 (hold: ... of #6519)` names the hold issue #6521 and not the tracker #6519.

The narrower rule removes false dependencies, so it sets a new version of the rules (`CONST_ROADMAP_REFINE_RULES_SINCE`, 2026-11-20T14:03:08Z). An item that waits on a person under the older rule, such as an item in a dependency cycle that a false dependency made, gets one new look. The new version ends no blocked wait: an item keeps its recorded blockers until they close, a person replies or a person edits the body.
The narrower rule removes false dependencies, so it sets a new version of the rules (`CONST_ROADMAP_REFINE_RULES_SINCE`, 2026-11-20T14:03:08Z). An item that waits on a person under the older rule, such as an item in a dependency cycle that a false dependency made, gets one new look. The new version ends no blocked wait: an item keeps its recorded blockers until none is an open blocker, a person replies or a person edits the body.

Refine adds each issue that the body names by title to the dependencies of the proposal: the one open item with that exact title, else the one closed item with it. Quoted text that is no Conventional Commit title names no issue, and a list item that names `#N` names its issue by the number.

Expand Down Expand Up @@ -106,7 +108,7 @@ Refine reads the title in each round, so the first round after a title with a li

## Items that are trackers

An item with sub-issues or the label `type/epic` is a tracker. Its sub-issues deliver it, so refine leaves it alone. The item waits with the text of `refine_left_tracker`, also under `--item`. The round makes no model call and writes nothing for it. A person closes the parent.
An item with sub-issues or the label `type/epic` is a tracker. Its sub-issues deliver it, so refine leaves it alone. The item waits with the text of `refine_left_tracker`, also under `--item`. The round makes no model call and writes nothing for it. A person closes the parent. A tracker holds back no item of its own: a dependency on a tracker waits on its open sub-issues (see the dependency rule above).

## Parts that cannot be built now

Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap/stage.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The default filter is `status=ready`. The job takes the Ready items of any type,

A plan is an OpenSpec change, so the job plans only in a repository whose default branch holds `openspec/config.yaml`. In a repository with no such file, it leaves out every item, also the item that `--item` names, with a reason that names the file. It pushes no branch and calls no model, and the stage row names the file in its outcome for onboarding ([onboard](onboard.md)). `devops roadmap explain` prints the same reason.

The job leaves out an item that is not Ready, and some other items: for example an item with the label `needs-split`, an item that depends on an open issue (a `#N` under the Dependencies section that names a blocker, such as `- #N`, `Merge first: #N` or `Depends on #N`, as [refine](refine.md) reads it, or the issue of a quoted title), and an item that an agent or a person claimed. A parent link, a child link, a tracker, a related issue, a reverse link, an issue that merges in either order, a note in parentheses and the source line of intake name no dependency. [roadmap-stage/selection](../../openspec/specs/roadmap-stage/selection/spec.md) holds the full list, in the requirement "The job leaves out the items it must not stage". The plan says why for each item that it leaves out. `--why` also lists the open items that the filter does not name.
The job leaves out an item that is not Ready, and some other items: for example an item with the label `needs-split`, an item that depends on an open issue (a `#N` under the Dependencies section that names a blocker, such as `- #N`, `Merge first: #N` or `Depends on #N`, as [refine](refine.md) reads it, or the issue of a quoted title), and an item that an agent or a person claimed. A parent link, a child link, a tracker, a related issue, a reverse link, an issue that merges in either order, a note in parentheses and the source line of intake name no dependency. An open tracker is no blocker either (#6450): the parent tracker of the item and each tracker above it hold nothing back, and another open tracker holds the item back with its open sub-issues, so the reason names the sub-issues. The stage job reads the record of a refine round (`refine.blocked_by`) with the same rule, and the implement job reads the Dependencies section of the body and of the plan with it. [roadmap-stage/selection](../../openspec/specs/roadmap-stage/selection/spec.md) holds the full list, in the requirement "The job leaves out the items it must not stage". The plan says why for each item that it leaves out. `--why` also lists the open items that the filter does not name.

## The limit on Planned items

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-11-20
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Design

## Decisions

- **One rule in `dependencies.py`.** `open_blockers(item, numbers, found, tree)` decides the open blockers for refine, stage, implement and the dependency graph. `found` reads one dependency: the jobs give `store.item`, as before, and the graph gives the open items of its sequence, so the graph sends no request. `dependencies.py` imports from `refine.py`, so `refine.py` imports the rule inside its helper `_blockers`.
- **The tree reads every Item, and only when it must.** `ItemTree` reads the `parent` of each Item from a read that it calls the first time a caller asks for a link. Stage and implement give `store.items()`, which they read for the quoted titles. Refine gives `store.items` too, as a lazy read: the round gives that tree to `DependencyGraph.of`, which keeps it as `DependencyGraph.tree`, and the proposal check and the blocked wait read it there. So refine and stage read the same ancestors, also through a closed parent. The rule reads the tree only when a dependency is an open tracker. `GitHubRoadmapStore` keeps the whole listing after its first read, the Service reads it through the incremental snapshot, and `validate_proposal` already reads it for each refined item.
- **A blocked wait builds no graph while no recorded blocker is open.** The wait computes its blockers first and builds the graph for the cycle check only when a blocker is open, so `devops roadmap explain` and `refine --item` read no open listing for a closed blocker.
- **An ancestor is no blocker, whatever its state.** The rule skips the parent that the item names before it reads the dependency, and a tracker above the parent when the tree holds the link. A parent has a sub-issue, so it is a tracker, and only a tracker can be an ancestor.
- **Another tracker gives its open sub-issues.** The rule follows the sub-issues that are trackers, with a set of the trackers already read, and skips the item and its ancestors. The order is the order of the dependencies, then the number order of the sub-issues. The listing gives no order of the sub-issues of a parent, so the number order is the stable order.
- **A tracker with no open sub-issue holds nothing back.** It has no open work, and no job closes it.
- **The graph applies the same rule.** An edge from an item to its parent tracker made a cycle when the tracker named the item, so refine gave the person step for a cycle that holds nothing back. An edge to another tracker hid a cycle through its sub-issues. `test_an_edge_to_the_parent_tracker_closes_no_cycle` and `test_an_edge_to_another_tracker_leads_through_its_open_sub_issues` show both results. An item that names itself is no blocker of itself, so it gets no self-loop.
- **The reason names the numbers only.** The text of a wait and of a reason names the open sub-issues, and adds no new message. The recorded blockers of a new round are the sub-issues, so a later wait reads them directly.
- **`validate_proposal` keeps the tracker.** The Dependencies part of the refine section names each known dependency of the proposal. The blocker rule removes the tracker when it decides a blocker.

## Rejected alternatives

- **The rule in `store.py`.** The store reads items. It does not decide which open item holds a job back. Only the tree of the read is in the store.
- **Leave out every tracker.** An item that waits on the work of another tracker then waits on nothing.
- **A new read of `issues/<n>/parent` and `issues/<n>/sub_issues` for each item.** The listing already gives the parent of each issue, so these reads add a request for each item and give no new data.
- **The tree from the open items of the round in refine.** A closed parent breaks the chain of ancestors, so a tracker above a closed parent counts as another tracker in refine and as an ancestor in stage. On 2026-11-20 this read lost an ancestor of #4876 (#4679, #4735), #5047 (#4771), #5049 (#4780) and #5922 (#4675, #4735). `test_a_tracker_above_a_closed_parent_holds_nothing_back` fails with that tree.
- **Keep the graph edges as they are.** The two graph tests above fail with the old edges.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Proposal: #6450

## Why

Refine, stage and implement count an open tracker as an open dependency (#6450). A tracker is an item with sub-issues or the label `type/epic` (`Item.is_tracker`). No job closes a tracker: it closes after its sub-issues. So an item that waits on its own parent tracker waits with no end, and an item that waits on another tracker waits for that whole plan and for a person.

## What Changes

- `Item` gets the field `parent`, the number of the issue that has the item as a sub-issue. The issue listing of GitHub already gives it, and `IssueRecord.parent` already holds it, so the store sends no new request.
- The new class `ItemTree` in `src/devops_cli/roadmap/stores/store.py` gives the ancestors of an item and the open sub-issues of an issue from the Items of one read. It calls the read only when a dependency is an open tracker. Refine gives it `store.items`, so a closed parent breaks no chain of ancestors.
- The new function `open_blockers` in `src/devops_cli/roadmap/dependencies.py` is the one rule that decides the open blockers of an item:
- The item itself, its parent tracker and each tracker above it is no blocker.
- An open tracker gives its open sub-issues in its place. A sub-issue that is a tracker gives its own. The item and its ancestors are never in that list. A tracker with no open sub-issue holds nothing back.
- Any other open dependency is a blocker, as before. A closed issue holds nothing back.
- The order is the order of the dependencies, then the order of the sub-issues, with no duplicate.
- Each reader uses the rule: the refine proposal (`_open_dependencies`), the recorded blocked wait of refine (`_open_blockers`), the Dependencies section and the record in the stage job (`open_dependency`, `_recorded_blocker`), the Dependencies section and the plan proposal in the implement job (`open_dependency`, `open_issue_dependencies`), and the edges of `DependencyGraph`. A recorded wait on a parent tracker ends in the next round, and a recorded wait on another tracker names the open sub-issues of that tracker. `devops roadmap explain` gives the same reasons.
- `validate_proposal` keeps each known dependency of the proposal, so the Dependencies part of the refine section still names the tracker. Only the blocker decision changes.
- The hold line of #6521 still holds an item: #6521 has no sub-issue and no `type/epic` label, so it is no tracker.
- The change carries a spec delta, because the next step of refine, the reasons of stage and implement and the output of `devops roadmap explain` change.
- The change fits one pull request.

## Capabilities

### New Capabilities

None.

### Modified Capabilities

- `roadmap-dependency-cycle`: The dependency graph names a cycle for each item, The path of an item is a shortest cycle, The round builds one graph from the listing it already reads, One rule decides the open blockers of an item (added), Another tracker holds an item back with its open sub-issues (added)
- `roadmap-refine/waits`: An open dependency outside a cycle blocks the item, The last blocker to close ends the block
- `roadmap-stage/selection`: The stage selection leaves out an item with an open recorded blocker, An open tracker holds back no Ready item (added)
- `roadmap-implement-job/selection`: The implement judge leaves out an open dependency

## Impact

- Code: `src/devops_cli/roadmap/dependencies.py`, `src/devops_cli/roadmap/stores/store.py`, `src/devops_cli/roadmap/refine/refine.py`, `src/devops_cli/roadmap/stage/stage.py`, `src/devops_cli/roadmap/implement/implement.py`
- Documents: `docs/roadmap/refine.md`, `docs/roadmap/stage.md`
- Tests: `tests/roadmap/test_roadmap_dependencies.py`, `tests/roadmap/refine/test_roadmap_dependency_graph.py`, `tests/roadmap/refine/test_roadmap_refine_blocked.py`, `tests/roadmap/refine/test_roadmap_refine_cycle.py`, `tests/roadmap/stage/test_roadmap_stage_selection.py`, `tests/roadmap/implement/test_roadmap_implement_selection.py`

## Feasibility

- The live records on 2026-11-20: #4671 holds `refine.blocked_by` `4624`, its parent. #4600 holds `4517,4598`, and #4517 is its parent. #5230 holds `5223,5229`, and #5223 is its parent. #4733 holds `4624,4720,4742,4759,4761`, and #4624 and #4742 are trackers. Each record holds `refine.next_step` `blocked`.
- `devops roadmap explain 4671` on origin/main b5c9d1214 gave "Refine job: no. The item waits for #4624 to close." `devops roadmap explain 4909` gave "Stage job: no. The item depends on the open issue #4893.", and #4893 is the parent of #4909.
- One read of the 813 open issues and pull requests on 2026-11-20 gave 803 open items and 44 open trackers. 30 open items have a recorded or a body blocker that is an open tracker: 5 name an ancestor, 25 name another tracker. 129 open items name #6521 in their Dependencies section, and #6521 is an open item that is no tracker.
- `_open_dependencies` and `_open_blockers` (`src/devops_cli/roadmap/refine/refine.py`) and `open_issue_dependencies` (`src/devops_cli/roadmap/dependencies.py`) kept each open issue and did not read `Item.is_tracker`.
- The REST issue listing gives `parent_issue_url` and `sub_issues_summary` for each issue. `_IssuePayload.parent` (`src/devops_cli/roadmap/stores/github_store.py`) maps the URL to the number, `IssueRecord.parent` holds it, and `item_of` copies each field that `Item` declares. So `Item.parent` needs no new request.
- `src/devops_cli/roadmap/dependencies.py` imports `body_dependencies` and `DependencyGraph` from `src/devops_cli/roadmap/refine/refine.py`. So refine imports the rule inside a function, as it does for `premise.definition_lines`.

## Existing Tool Considered

The GitHub sub-issues data (`parent_issue_url` and `sub_issues_summary` of the issue listing) gives the tree, and the store already reads it. No open, maintained tool or library decides the blockers of a roadmap item. The rule costs about 40,000 tokens and 1 hour to build, keep and fix. The change deletes `_is_open` of `src/devops_cli/roadmap/refine/refine.py`.
Loading