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
4 changes: 2 additions & 2 deletions docs/roadmap/alternatives.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ The comment gives:
- the verdict and the reason of the model for it;
- the tool on one line, with its URL, license, last activity and maintained state, as in the block;
- what the tool covers and lacks;
- one block that GitHub shows closed, `Searches (<count>)`. It holds the tools considered: every tool whose facts the run read, each with its URL, license and last activity. It also holds the answered searches with their number of results. Last, it holds at most five sources, and a line that says how many more the comment leaves out. GitHub shows each URL as a link;
- one block that GitHub shows closed, `Searches (<count>)`. It holds the tools considered: every tool whose facts the run read, each with its URL, license and last activity. It also holds the answered searches with their number of results. Last, it holds every source of the reply. GitHub shows each URL as a link;
- one sentence that says a person decides what the check means for the item.

The prompt asks the model for a brief reply: a reason of one sentence, and a few short items in `covers`, `lacks` and `sources`. The check refuses no reply for its length and cuts no text of the model. The comment of a skip class is one line, for example `Alternatives check: not-applicable (docs item; no search).`
The prompt asks the model for a brief reply: a reason of one sentence, and a few short items in `covers`, `lacks` and `sources`. The check refuses no reply for its length and cuts no text or list of the model. The comment of a skip class is one line, for example `Alternatives check: not-applicable (docs item; no search).`

A check that posts a comment adds a new one. It never changes the comment of an earlier check.

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

## Decisions
- **List every source.** The comment writes each source of the reply in the closed block, in the order of the reply, with duplicates removed as before. The owner's rule of 2026-11-17 forbids a cap that loses context.
- **No new bound in the prompt or the schema.** The prompt asks for a few sources as guidance (#6168), and the schema sets no length.

## Rejected alternatives
- **A higher bound**: it is still a cap that can lose context.
- **Sources outside the closed block**: a long list would make the open comment long again.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Proposal: #6177

## Why
The comment of `devops roadmap alternatives` shows at most five sources (`CONST_ROADMAP_ALTERNATIVES_MAX_COMMENT_SOURCES`). When the reply cites more, it shows the first five and the line "N more sources are left out". On 2026-11-17 the owner said that the jobs must have no hard caps that make a job fail or lose context. Refine, stage and implement read this comment as context, so the bound removes sources that they could read. Since #6174 (#6168), the sources are in the closed `<details>` block, so a long list does not make the open comment longer.

## What Changes
- The closed block of the comment lists every source of the reply.
- `CONST_ROADMAP_ALTERNATIVES_MAX_COMMENT_SOURCES`, its row in the table of limits, `_source_section` and the message `alternatives_comment_sources_left_out` go.

## Capabilities
- `roadmap-alternatives`: the requirement "The comment shows at most five sources" becomes "The comment shows every source".

## Impact
- A reply with more than five sources gets a longer closed block. The open part of the comment does not change.
- No setting, no command and no dependency changes. The change fits one pull request.

## Feasibility
- `git grep -n MAX_COMMENT_SOURCES origin/main` gives the one bound: `_source_section` in `src/devops_cli/roadmap/alternatives.py`, the constant in `src/devops_cli/config/constants.py`, its row in `tests/roadmap/test_roadmap_limit_classes.py`, and one test.
- No reader parses the sources or the "left out" line. The readers of the comment read its marker, and the refine prompt reads its text.

## Existing Tool Considered
None applies: the change deletes a bound in the render of the job. It adds no code.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## REMOVED Requirements

### Requirement: The comment shows at most five sources
**Reason**: The bound left sources out of the context that refine, stage and implement read, and the owner forbids caps that lose context (2026-11-17, #6177).
**Migration**: The requirement "The comment shows every source" lists each source in the closed block.

## ADDED Requirements

### Requirement: The comment shows every source
The folded block of the comment SHALL show every source of the reply, and SHALL leave none out.

#### Scenario: More than five sources
- **WHEN** the reply cites eight sources that the tools returned
- **THEN** the folded block shows all eight, no source is outside the block, and the comment has no line that counts sources left out
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Tasks

## 1. Behavior

- [x] 1.1 Change the sources test: a reply with eight sources shows all eight in the closed block and no "left out" line
- Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_alternatives.py`
- [x] 1.2 Remove the bound, its constant, its row in the table of limits and its message
- Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_alternatives.py tests/roadmap/test_roadmap_limit_classes.py`

## 2. Documents

- [x] 2.1 Update `docs/roadmap/alternatives.md` and the spec `roadmap-alternatives`
- Verification: `$ uv run devops openspec check`
14 changes: 7 additions & 7 deletions openspec/specs/roadmap-alternatives/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,6 @@ The comment SHALL list every tool whose facts the run read with its URL, license
- **WHEN** a run makes ten searches and names a covering tool with three covers and three lacks
- **THEN** the comment outside the folded block holds only the marker, the heading, the reason, the tool line, the covers, the lacks and the footer, and the block `Searches (10)` lists the ten queries

### Requirement: The comment shows at most five sources
The folded block of the comment SHALL show at most five sources, and SHALL say how many more it leaves out.

#### Scenario: More sources than the bound
- **WHEN** the reply cites eight sources that the tools returned
- **THEN** the folded block shows five and the line `3 more sources are left out`

### Requirement: A check never changes an earlier comment
A check SHALL add a new comment and SHALL NOT change the comment of an earlier check.

Expand Down Expand Up @@ -806,3 +799,10 @@ The `alternatives.reply_fixable` decision point SHALL run in mode `shadow` and r
#### Scenario: Shadow records a band and keeps the 3-day wait
- **WHEN** the mode of `alternatives.reply_fixable` is `shadow` and the reply is a fixable refusal
- **THEN** the result line holds the band `review` and the job makes no second model call and sets the next try 3 days later

### Requirement: The comment shows every source
The folded block of the comment SHALL show every source of the reply, and SHALL leave none out.

#### Scenario: More than five sources
- **WHEN** the reply cites eight sources that the tools returned
- **THEN** the folded block shows all eight, no source is outside the block, and the comment has no line that counts sources left out
2 changes: 0 additions & 2 deletions src/devops_cli/config/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3583,8 +3583,6 @@ class WebhookExposure(StrEnum):
CONST_ROADMAP_ALTERNATIVES_MAX_SEARCHES: Final[int] = 10
CONST_ROADMAP_ALTERNATIVES_MAX_FACT_READS: Final[int] = 30
CONST_ROADMAP_ALTERNATIVES_SEARCH_RESULTS: Final[int] = 5
# The most sources that the comment of a check shows (#2944).
CONST_ROADMAP_ALTERNATIVES_MAX_COMMENT_SOURCES: Final[int] = 5
CONST_ROADMAP_ALTERNATIVES_MAINTAINED_DAYS: Final[int] = 365
# A PyPI package states its license in `license_expression`, in `license` (a name when it is short,
# else the whole text) or in a classifier that starts with the prefix.
Expand Down
1 change: 0 additions & 1 deletion src/devops_cli/lang/en/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3238,7 +3238,6 @@ class RoadmapMessages:
alternatives_comment_queries: str = "Searches run:"
alternatives_comment_search: str = "{query}, results: {results}"
alternatives_comment_sources: str = "Sources:"
alternatives_comment_sources_left_out: str = "{count} more sources are left out"
alternatives_comment_item: str = "- {text}"
# The block that GitHub shows closed: the tools considered, the searches and the sources.
alternatives_comment_fold_open: str = "<details><summary>Searches ({count})</summary>"
Expand Down
25 changes: 6 additions & 19 deletions src/devops_cli/roadmap/alternatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,11 @@
`CONST_ROADMAP_ALTERNATIVES_COMMENT_MARKER`. It changes no label and closes no issue. The comment
gives the verdict, the model's reason for it, the tool on one line, and what it covers and lacks
(#2944). One block that GitHub shows closed holds every tool whose facts the run read, each search
with its number of results, and at most `CONST_ROADMAP_ALTERNATIVES_MAX_COMMENT_SOURCES` sources
(#6168). A skip class gets one line. The prompt asks for a brief reply; the job refuses no reply
for its length and cuts no text of it. A check adds a comment and never changes an earlier one. A
comment after the job's last one reaches the next check as a reply. A skipped item gets only
`alternatives.failed_at` and `alternatives.failed_error` in its job record; a written check
clears both.
with its number of results, and every source of the reply (#6168, #6177). A skip class gets one
line. The prompt asks for a brief reply; the job refuses no reply for its length and cuts no text
or list of it. A check adds a comment and never changes an earlier one. A comment after the job's
last one reaches the next check as a reply. A skipped item gets only `alternatives.failed_at` and
`alternatives.failed_error` in its job record; a written check clears both.

The check is off when the repository is private, its visibility cannot be read, or no search
provider is configured: a verdict `none` would then say that no tool exists when none was looked for.
Expand Down Expand Up @@ -92,7 +91,6 @@
CONST_ROADMAP_ALTERNATIVES_MAINTAINED_DAYS,
CONST_ROADMAP_ALTERNATIVES_MAX_ADR_TOKENS,
CONST_ROADMAP_ALTERNATIVES_MAX_BODY_TOKENS,
CONST_ROADMAP_ALTERNATIVES_MAX_COMMENT_SOURCES,
CONST_ROADMAP_ALTERNATIVES_MAX_FACT_READS,
CONST_ROADMAP_ALTERNATIVES_MAX_LICENSE_CHARS,
CONST_ROADMAP_ALTERNATIVES_MAX_SEARCHES,
Expand Down Expand Up @@ -890,7 +888,7 @@ def _folded_section(check: Check) -> list[str]:
lists = [
_considered_section(check.considered),
_search_section(check.searches),
_source_section(check.sources),
_list_section(texts.alternatives_comment_sources, check.sources),
]
shown = [section for section in lists if section]
if not shown:
Expand All @@ -905,17 +903,6 @@ def _folded_section(check: Check) -> list[str]:
]


def _source_section(sources: Sequence[str]) -> list[str]:
"""At most `CONST_ROADMAP_ALTERNATIVES_MAX_COMMENT_SOURCES` sources, each a URL that GitHub
shows as a link, and a line that says how many the comment leaves out (#2944)."""
texts = MESSAGES.roadmap
shown = list(sources[:CONST_ROADMAP_ALTERNATIVES_MAX_COMMENT_SOURCES])
left_out = len(sources) - len(shown)
if left_out:
shown.append(texts.alternatives_comment_sources_left_out.format(count=left_out))
return _list_section(texts.alternatives_comment_sources, shown)


def _list_section(title: str, lines: Sequence[str]) -> list[str]:
item = MESSAGES.roadmap.alternatives_comment_item
return [title, *(item.format(text=line) for line in lines)] if lines else []
Expand Down
20 changes: 8 additions & 12 deletions tests/roadmap/test_roadmap_alternatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
CONST_ROADMAP_ALTERNATIVES_COMMENT_MARKER,
CONST_ROADMAP_ALTERNATIVES_END_MARKER,
CONST_ROADMAP_ALTERNATIVES_MAX_ADR_TOKENS,
CONST_ROADMAP_ALTERNATIVES_MAX_COMMENT_SOURCES,
CONST_ROADMAP_ALTERNATIVES_MAX_FACT_READS,
CONST_ROADMAP_ALTERNATIVES_MAX_SEARCHES,
CONST_ROADMAP_ALTERNATIVES_START_MARKER,
Expand Down Expand Up @@ -1763,13 +1762,10 @@ def test_a_reply_with_no_reason_is_refused_by_its_schema() -> None:
AlternativesReply.model_validate({"verdict": "none"})


def test_the_comment_folds_at_most_the_bound_of_sources_and_says_how_many_it_left_out(
def test_the_comment_folds_every_source_of_the_reply_and_leaves_none_out(
store: InMemoryRoadmapStore,
) -> None:
urls = [
f"https://example.com/source-{n}"
for n in range(CONST_ROADMAP_ALTERNATIVES_MAX_COMMENT_SOURCES + 3)
]
urls = [f"https://example.com/source-{n}" for n in range(8)]
tools = AlternativesTools(store=store, allowed_urls=set(urls))
tools.searches.append(alternatives.Search("scanner", len(urls)))
number = _item(store)
Expand All @@ -1780,12 +1776,12 @@ def test_the_comment_folds_at_most_the_bound_of_sources_and_says_how_many_it_lef
check = alternatives.validate_reply(item, reply, tools, NOW, ())

assert not isinstance(check, alternatives.CheckFailure)
_, folded = _fold_of(check.comment)
shown = [line for line in folded.splitlines() if line.startswith("- https://")]
assert (shown, "- 3 more sources are left out" in folded) == (
[f"- {url}" for url in urls[:CONST_ROADMAP_ALTERNATIVES_MAX_COMMENT_SOURCES]],
True,
)
shown, folded = _fold_of(check.comment)
assert (
[line for line in folded.splitlines() if line.startswith("- https://")],
"https://" in shown,
"left out" in check.comment,
) == ([f"- {url}" for url in urls], False, False)


def test_a_reply_longer_than_the_prompt_asks_is_written_whole(
Expand Down
4 changes: 0 additions & 4 deletions tests/roadmap/test_roadmap_limit_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,6 @@
"was 6; PyPI and GitHub reads of one item",
),
"CONST_ROADMAP_ALTERNATIVES_SEARCH_RESULTS": ("kept", "the size of the answer of one search"),
"CONST_ROADMAP_ALTERNATIVES_MAX_COMMENT_SOURCES": (
"kept",
"the sources that one comment shows, so a person can read it",
),
"CONST_ROADMAP_ALTERNATIVES_MAX_BODY_TOKENS": (
"raised",
"was 4096; a quarter of the planner window",
Expand Down