Skip to content

fix(roadmap): Share one tracker rule with refine - #5963

Merged
dan-petty merged 4 commits into
mainfrom
fix/3703-refine-leaves-out-a-tracker-as
Nov 16, 2026
Merged

dan-petty merged 4 commits into
mainfrom
fix/3703-refine-leaves-out-a-tracker-as

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

The refine job has no tracker rule, while the stage job leaves out an item with sub-issues or the label type/epic. This change shares one tracker test on Item.is_tracker, makes the refine round leave a tracker out, explains the reason with refine_left_tracker, and leaves out a named tracker under --item.

Closes #3703

Change: openspec/changes/archive/2026-11-16-3703-refine-leaves-out-a-tracker-as/

@devops-cli-service devops-cli-service Bot added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 16, 2026
@devops-cli-service

Copy link
Copy Markdown
Contributor Author

The steps of the job:

Stopped at group 2.

Failure class: provider.
Action taken: none.
Action left: retry: run the item again.

Step Status Attempts Tokens in/out Last failing command
group 1 done 1 2172621/8862 pytest on base: tests/roadmap/stores/test_roadmap_item_tracker.py
group 2 stopped 1 0/0 -

Reason:

ModelServerError: HTTP 504, model openrouter/deepseek/deepseek-v4.1-flash-1017, body: litellm.Timeout: Timeout Error: OpenrouterException - Message: A Timeout Occurred, Metadata: {<text>: <text>}, User ID:

Last message of the agent (a claim that no check verified): none.

The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

Step Status Attempts Tokens in/out Last failing command
group 1 done 1 2172621/8862 pytest on base: tests/roadmap/stores/test_roadmap_item_tracker.py
group 2 stopped 1 0/0 -
  • fail-to-pass of group 1: fails on the base commit. Tests that fail on the base commit: tests.roadmap.stores.test_roadmap_item_tracker::test_is_tracker_is_true_for_sub_issues_and_for_the_epic_label[epic-with-sub-issues], tests.roadmap.stores.test_roadmap_item_tracker::test_is_tracker_is_true_for_sub_issues_and_for_the_epic_label[epic-label], tests.roadmap.stores.test_roadmap_item_tracker::test_is_tracker_is_true_for_sub_issues_and_for_the_epic_label[sub-issues], tests.roadmap.stores.test_roadmap_item_tracker::test_is_tracker_is_true_for_sub_issues_and_for_the_epic_label[plain].

@devops-cli-service
devops-cli-service Bot force-pushed the fix/3703-refine-leaves-out-a-tracker-as branch from d60e55f to ddf92ab Compare November 16, 2026 12:44
@devops-cli-service

Copy link
Copy Markdown
Contributor Author

The steps of the job:

Stopped at group 2.

Failure class: provider.
Action taken: none.
Action left: retry: run the item again.

Step Status Attempts Tokens in/out Last failing command
group 2 stopped 1 2393480/9504 -

Reason:

ModelServerError: HTTP 504, model openrouter/deepseek/deepseek-v4.1-flash-1017, body: litellm.Timeout: Timeout Error: OpenrouterException - Message: A Timeout Occurred, Metadata: {<text>: <text>}, User ID:
Refused commands: git 1. Other retries: 0.

Last message of the agent (a claim that no check verified): none.

The job discarded this work. Read it before you retry:

diff --git a/tests/roadmap/refine/test_roadmap_refine_tracker.py b/tests/roadmap/refine/test_roadmap_refine_tracker.py
new file mode 100644
index 000000000..8b2cf83a3
--- /dev/null
+++ b/tests/roadmap/refine/test_roadmap_refine_tracker.py
@@ -0,0 +1,179 @@
+"""A refine round leaves out an item that is a tracker, as the stage job does: it has sub-issues or
+the label `type/epic`, so its sub-issues deliver it (#3703).
+"""
+
+from __future__ import annotations
+
+from pathlib import Path
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+    from tests.support.fakes.model import ModelFake
+import pytest
+
+from devops_cli.config import constants
+from devops_cli.config.constants import CONST_ROADMAP_STATUS_READY
+from devops_cli.lang import MESSAGES
+from devops_cli.roadmap.refine.refine import (
+    apply_refine,
+    plan_refine,
+    refine_left_out,
+)
+from devops_cli.roadmap.stores.store import ItemField
+from tests.support.fakes.roadmap_store import InMemoryRoadmapStore
+from tests.support.roadmap_refine import (
+    PLACED,
+    READY,
+    REPO,
+    comment_bodies,
+    require_item,
+    seed_item,
+)
+
+pytestmark = pytest.mark.usefixtures("keyring_store")
+
+
+TRACKER_TEXT = MESSAGES.roadmap.refine_left_tracker
+
+
+def _seed_sub_issue_tracker(store: InMemoryRoadmapStore, *, sub_issues: int = 2) -> int:
+    """A New backlog P1 item that GitHub records `sub_issues` sub-issues for."""
+    number = store.seed_issue(
+        "feat(roadmap): the parent",
+        body="The parent body.",
+        fields=PLACED,
+        sub_issues=sub_issues,
+    )
+    store.set_field(require_item(store, number), ItemField.STATUS, "New")
+    return number
+
+
+def _seed_epic_tracker(store: InMemoryRoadmapStore) -> int:
+    """A New backlog P1 item with the label `type/epic` and no sub-issue."""
+    return seed_item(store, "New", "P1-High", labels=("type/epic",))
+
+
+def _tracker_writes(store: InMemoryRoadmapStore, *numbers: int) -> list[int]:
+    """The numbers of `numbers` that a job wrote to, in the order of the writes."""
+    return [w.number for w in store.job_writes() if w.number in numbers]
+
+
+def test_a_round_leaves_out_an_item_with_sub_issues_and_an_item_with_the_epic_label(
+    git_repo: Path, store: InMemoryRoadmapStore, model_fake: ModelFake
+) -> None:
+    """A round takes neither a tracker with sub-issues nor one with the label `type/epic`: both
+    wait with the tracker text, and the round sends no model request and writes no comment, no
+    body and no field for them (#3703)."""
+    store.seed_visibility(is_private=True)
+    parent = _seed_sub_issue_tracker(store)
+    epic = _seed_epic_tracker(store)
+    plain = seed_item(store, "New", "P1-High")
+    bodies = {number: store.read_issue_body(number) for number in (parent, epic)}
+    model_fake.answer(READY)
+
+    plan = plan_refine(store, repo=REPO, source=git_repo)
+    apply_refine(store, plan)
+
+    assert (
+        [r.item.number for r in plan.refined_items],
+        sorted((w.item.number, w.step, w.details) for w in plan.waiting_items),
+        model_fake.call_count,
+        [comment_bodies(store, number) for number in (parent, epic)],
+        {number: store.read_issue_body(number) for number in (parent, epic)},
+        require_item(store, parent).job_record,
+        require_item(store, epic).job_record,
+        _tracker_writes(store, parent, epic),
+    ) == (
+        [plain],
+        [(parent, "none", (TRACKER_TEXT,)), (epic, "none", (TRACKER_TEXT,))],
+        1,
+        [[], []],
+        bodies,
+        {},
+        {},
+        [],
+    )
+
+
+def test_a_named_tracker_is_left_out(
+    git_repo: Path, store: InMemoryRoadmapStore, model_fake: ModelFake
+) -> None:
+    """`--item` on a tracker takes no item: the round sends no model request, writes no comment,
+    and the item keeps its body and its record (#3703)."""
+    store.seed_visibility(is_private=True)
+    tracker = _seed_sub_issue_tracker(store, sub_issues=1)
+    body = store.read_issue_body(tracker)
+    writes_before = store.job_writes()
+
+    plan = plan_refine(store, repo=REPO, source=git_repo, item_number=tracker)
+    apply_refine(store, plan)
+
+    assert (
+        plan.refined_items,
+        [(w.item.number, w.step, w.details) for w in plan.waiting_items],
+        model_fake.call_count,
+        comment_bodies(store, tracker),
+        store.read_issue_body(tracker) == body,
+        store.job_writes() == writes_before,
+    ) == ([], [(tracker, "none", (TRACKER_TEXT,))], 0, [], True, True)
+
+
+def test_a_tracker_of_an_untrusted_author_gets_no_notice_comment(
+    git_repo: Path, store: InMemoryRoadmapStore, model_fake: ModelFake
+) -> None:
+    """The tracker check runs before the author check, so a tracker that an outside account
+    opened waits with the tracker text and gets no notice comment (#3703)."""
+    store.seed_visibility(is_private=True)
+    tracker = store.seed_issue(
+        "feat(roadmap): an outside tracker",
+        body="The parent body.",
+        fields=PLACED,
+        author_association="NONE",
+        sub_issues=2,
+    )
+    store.set_field(require_item(store, tracker), ItemField.STATUS, "New")
+
+    plan = plan_refine(store, repo=REPO, source=git_repo)
+    apply_refine(store, plan)
+
+    assert (
+        [(w.item.number, w.step, w.details, w.notice) for w in plan.waiting_items],
+        model_fake.call_count,
+        comment_bodies(store, tracker),
+    ) == ([(tracker, "none", (TRACKER_TEXT,), False)], 0, [])
+
+
+def test_refine_left_out_gives_the_tracker_text(store: InMemoryRoadmapStore) -> None:
+    """`devops roadmap explain` reads the reason from `refine_left_out`: a tracker gets the
+    tracker text, and a plain item gets none (#3703)."""
+    parent = _seed_sub_issue_tracker(store)
+    epic = _seed_epic_tracker(store)
+    plain = seed_item(store, "New", "P1-High")
+
+    assert (
+        refine_left_out(store, require_item(store, parent)),
+        refine_left_out(store, require_item(store, epic)),
+        refine_left_out(store, require_item(store, plain)),
+    ) == (TRACKER_TEXT, TRACKER_TEXT, None)
+
+
+def test_a_plain_item_is_still_refined(
+    git_repo: Path, store: InMemoryRoadmapStore, model_fake: ModelFake
+) -> None:
+    """An item with no sub-issue and no `type/epic` label refines as before: one model request,
+    the Ready Status, and its comment (#3703)."""
+    store.seed_visibility(is_private=True)
+    plain = seed_item(store, "New", "P1-High")
+    model_fake.answer(READY)
+
+    plan = plan_refine(store, repo=REPO, source=git_repo)
+    apply_refine(store, plan)
+
+    (comment,) = comment_bodies(store, plain)
+    assert (
+        [r.item.number for r in plan.refined_items],
+        plan.waiting_items,
+        model_fake.call_count,
+        require_item(store, plain).status,
+        comment.startswith(constants.CONST_ROADMAP_REFINE_COMMENT_MARKER),
+    ) == ([plain], [], 1, CONST_ROADMAP_STATUS_READY, True)

The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

Step Status Attempts Tokens in/out Last failing command
group 2 stopped 1 2393480/9504 -

@devops-cli-service

Copy link
Copy Markdown
Contributor Author

The steps of the job:

Stopped at group 2.

Failure class: provider.
Action taken: none.
Action left: retry: run the item again.

Step Status Attempts Tokens in/out Last failing command
group 2 stopped 1 0/0 -

Reason:

ModelServerError: HTTP 504, model openrouter/deepseek/deepseek-v4.1-flash-1017, body: litellm.Timeout: Timeout Error: OpenrouterException - Message: A Timeout Occurred, Metadata: {<text>: <text>}, User ID:

Last message of the agent (a claim that no check verified): none.

The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

Step Status Attempts Tokens in/out Last failing command
group 2 stopped 1 0/0 -

@dan-petty
dan-petty force-pushed the fix/3703-refine-leaves-out-a-tracker-as branch from d48d692 to 2e3213e Compare November 16, 2026 18:17
@dan-petty
dan-petty marked this pull request as ready for review November 16, 2026 18:26
@dan-petty
dan-petty self-requested a review as a code owner November 16, 2026 18:26
@dan-petty
dan-petty merged commit d1a2ce8 into main Nov 16, 2026
27 checks passed
@dan-petty
dan-petty deleted the fix/3703-refine-leaves-out-a-tracker-as branch November 16, 2026 18:34
dan-petty pushed a commit that referenced this pull request Nov 16, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.167.1](v0.167.0...v0.167.1)
(2026-11-16)


### Bug Fixes

* **roadmap:** Share one tracker rule with refine
([#5963](#5963))
([d1a2ce8](d1a2ce8))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): refine leaves out a tracker, as stage does

1 participant