Skip to content

fix(roadmap): the alternatives check reads the ADRs and the item tool #3505

Closed

Description

@dan-petty

Problem

The alternatives check can give a covers verdict for a tool that the project already rejected, or for a tool that the item already uses. Refine then asks "Adopt the tool, or keep the item and give the reason" (src/devops_cli/lang/en/messages.py:2132, CoversQuestion at src/devops_cli/roadmap/refine.py:439). A person must answer a question that the repository already answers.

The cause: _request (src/devops_cli/roadmap/alternatives.py:535) gives the model the issue, the replies and a budget, and no ADR. No code compares the tool in the reply with the tools that the item names.

Evidence: 5 covers verdicts, and each one got the refine question.

3 of these verdicts came before the window 2026-11-03T15:05Z to 2026-11-04T15:05Z, and 2 came just after it. In the window the check gave none 7, not-applicable 6, partly 6 and covers 0.

#2951 makes a verdict a condition of Ready, so more verdicts reach a person. This item should land before #2951 (inferred).

A failed check is not part of this item: _in_retry_delay (alternatives.py:479) takes it again after roadmap.alternatives.retry_days, default 3.

Expected

  • The check gets the titles and decisions of the ADRs in docs/adr/.
  • A tool that an ADR rejected reads as rejected, and refine asks no "adopt or keep" question. The comment keeps the tool URL and the ADR number, because a newer fact can change an ADR.
  • A tool that the item already names reads as in use, and refine asks no question. Where possible, code decides this without the model: validate_reply (alternatives.py:757) compares the tool URL or package name in the reply with the item text. The comparison reads the text outside the job's block, as _request does, because the block of an earlier check names the tool.

Acceptance criteria

  • A scripted-model test: a reply names temporalio/temporal, and an ADR fixture rejects Temporal. The comment names the tool URL and the ADR number, and covers_question gives no question.
  • A scripted-model test: a reply names a tool that the item body names. The verdict reads as in use, and covers_question gives no question.
  • A test: a tool name that only the job's block holds does not count as in use.
  • A test: a tool that no ADR rejects and that the item does not name keeps covers and its question.
  • A test: a repository with no docs/adr/ gives the same verdict as before this change.
  • A test: the request holds the ADR titles and decisions, cut to a token cap.

devops roadmap eval has no alternatives set (src/devops_cli/commands/roadmap_eval.py:20-23), so these tests use a scripted model.

Existing tool considered

docs/adr/ as data, and markdown-it-py, which refine.py already uses. validate_reply holds the comparison. The Firecrawl search stays. The change adds no library.

Related

Related: #2951, #2950, #2944

Proposed design

Problem statement

The alternatives check can give a covers verdict for a tool that an ADR rejected or that the item already uses. Refine then asks a person to adopt the tool or to keep the item with a reason, and the repository already answers that question. The check reads no ADR and compares no tool name with the item, so 5 covers verdicts each asked the question. The change gives the check the ADR titles and decisions and compares the reply tool with the item text, so these cases give no question.

Acceptance criteria

Requirement: ADR titles and decisions in the request

The alternatives request SHALL hold the title and the decision of each ADR in docs/adr/, cut to a token cap.

Scenario: The request holds the ADR titles and decisions

  • WHEN a repository holds ADR files and the check builds its request
  • THEN the request text holds each ADR title and decision, and its length stays inside the token cap

Requirement: A rejected tool names its ADR

The check SHALL record a tool that an ADR rejects as rejected, with the tool URL and the ADR number.

Scenario: A reply names a tool that an ADR rejects

  • WHEN the model reply names temporalio/temporal and an ADR rejects Temporal
  • THEN the comment names the tool URL and the ADR number, and covers_question returns no question

Requirement: A tool the item names is in use

The check MUST record a tool that the item text names as in use, and MUST give no covers question.

Scenario: A reply names a tool that the item body names

  • WHEN the model reply names a tool and the item text outside the job's block names the same URL or package
  • THEN the recorded check reads in use and covers_question returns no question

Requirement: The job's block does not count as item text

The comparison MUST read only the item text outside the job's block.

Scenario: A tool name that only the job's block holds

  • WHEN the tool name appears only inside the job's block of an earlier check
  • THEN the check records the tool as not in use and keeps its covers question

Requirement: No ADR and no item name keeps covers

The check SHALL keep the covers verdict and its question when no ADR rejects the tool and the item does not name it.

Scenario: A covering tool that no ADR rejects and the item does not name

  • WHEN the model reply names a tool, no ADR rejects it and the item text does not name it
  • THEN the check records covers and covers_question returns the adopt-or-keep question

Requirement: A repository without ADRs is unchanged

The check MUST give the same verdict as before this change when the repository has no docs/adr/ directory.

Scenario: A repository with no docs/adr/

  • WHEN the check runs on a repository with no docs/adr/ directory
  • THEN the verdict and the question equal the values before this change

Existing Tool Considered

No alternatives check has run on this item. markdown-it-py covers the markdown parse of docs/adr/, and src/devops_cli/roadmap/refine.py already imports it. No open, maintained library covers the ADR-rejection or in-use decision, because that is a rule over this repository's own ADR files and item text, so the change builds that comparison. Written cost: about 3,000 tokens of new code, about 60,000 tokens to build, test and fix it, and about one day of elapsed time.

Key questions

  • How does the check read the titles and decisions of the ADRs?: Parse each docs/adr/*.md with markdown-it-py, which refine.py already imports. Take the first heading as the title and the prose after it as the decision, and sort by file name. (best practice) [sources: src/devops_cli/roadmap/refine.py, docs/adr/0001-github-is-the-roadmap-source.md]
    • Chosen: markdown-it-py parse. It is already a dependency, it handles the ADR markdown, and it gives the heading and the prose text.
    • Rejected: Regex on the first heading and the first paragraph. It breaks on setext headings and fenced code, and the repository already has a markdown parser.
    • Rejected: A new front-matter convention in each ADR. It changes every ADR file and adds a format that no ADR uses today.
  • Where does the check compare the reply tool with the ADR decisions and the item text?: In validate_reply in src/devops_cli/roadmap/alternatives.py, which already checks the reply against the item and its sources. (best practice) [sources: src/devops_cli/roadmap/alternatives.py:757, src/devops_cli/roadmap/alternatives.py:535]
    • Chosen: validate_reply. It holds the reply checks and already reads the item, so one place decides the reply.
    • Rejected: A new function after validate_reply. It adds a second pass and a second place that knows the reply shape.
    • Rejected: The prompt only. A model gives no deterministic answer, and the issue asks for code where possible.
  • How does the record keep the rejected or in-use state?: Add a disposition field to the recorded check block, with rejected and the ADR number, or in-use. The verdict stays covers. covers_question returns None when disposition is set, and an old block parses with disposition = None. (best practice) [sources: src/devops_cli/roadmap/refine.py, src/devops_cli/roadmap/alternatives.py]
    • Chosen: A disposition field on the record. The four verdicts stay stable for the metrics and the eval, and an old block parses unchanged.
    • Rejected: Two new verdict values, rejected and in-use. It changes the verdict enum, the metrics and the eval for a state that no metric needs.
    • Rejected: The comment only, with no record. covers_question reads the record, so a comment alone cannot stop the question.
  • How does the comparison match a tool in the item text?: Normalize the reply's tool URL to its owner/name slug and its last segment, then look for the slug, the last segment and the package name in the item text outside the job's block. Match on a word boundary and ignore case. (best practice) [sources: src/devops_cli/roadmap/alternatives.py:757, src/devops_cli/roadmap/alternatives.py:535]
    • Chosen: Normalized slug and package-name match. It finds temporalio/temporal and temporal in the item text, and it needs no model.
    • Rejected: Exact URL match. The item text names Temporal, not the full URL, so an exact match misses it.
    • Rejected: Model comparison. It is not deterministic, and the issue asks for code where possible.
  • How large is the token cap for the ADR text?: Cut the ADR text to the tokens that remain in the request budget after the item and the replies, so the request stays inside the context window. The cut keeps each ADR title and the first sentence of its decision. (best practice) [sources: src/devops_cli/roadmap/alternatives.py:535]
    • Chosen: Cut to the remaining request budget. It adapts to the item size and keeps the request inside the context window.
    • Rejected: A fixed module constant. A large item would still overflow, and a small item would waste budget.
    • Rejected: No cap. A repository with many ADRs pushes the item and the replies out of the window.
  • Does the item body already have a helper that removes the job's block?: Yes. The body hash leaves out the job's block, and _request reads the item text outside it. The comparison reuses the same block-stripping. [sources: src/devops_cli/roadmap/body_hash.py, src/devops_cli/roadmap/alternatives.py:535]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 4, 2026
  2. dan-petty commented on Nov 4, 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/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It prevents real wrong questions (5 documented cases) and should land before dan-petty/devops-cli#2951 increases their volume.
    • Value: Medium. It removes a recurring source of wasted human answers and prevents growth of that waste after dan-petty/devops-cli#2951.
    • Effort: Medium. It modifies _request, adds ADR reading, adds URL comparison in validate_reply, and requires five scripted-model tests.
    • Related: feat(roadmap): Gate Ready on alternatives verdict or exempt class #2951, which asks for a different change. Both concern the alternatives check and refine interaction, but this item fixes the check to suppress covers verdicts for rejected or in-use tools, while dan-petty/devops-cli#2951 gates Ready status on having a verdict.
  3. added
    priority/p2-medium
    on Nov 4, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 5, 2026
  5. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

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

  6. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 6, 2026
  7. removed
    status/in-review
    on Nov 6, 2026
  8. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-06 04:26 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/mediumpriority/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions