Skip to content

fix(roadmap): alternatives gives rejected for a tool in use #6441

Done

Description

@dan-petty

Problem Description

The alternatives check still gives false rejected verdicts after #4661 (PR #5062, merged 2026-11-12). Three open items hold rejected for a tool that the project uses, or for the project itself:

Item Check Tool Basis line Why it is false
#5524 2026-11-17 kubernetes/kubernetes Rejected by ADR 0021 ADR 0021:267 rejects "A Kubernetes Lease for each lock". It rejects a Lease, not Kubernetes. The project runs on Kubernetes (k8s/).
#5323 2026-11-16 cli/cli Rejected by ADR 0006 ADR 0006:29 rejects "Everything through the gh CLI" for the session requests only. The project uses gh (devops gh), and the item adds more gh pass-through commands.
#4719 2026-11-14 <owner>/devops-cli Rejected by ADR 0014 The tool is the repository itself. ADR 0014:60 is a rejected option with a link to https://github.com/<owner>/devops-cli/issues/2086.

The cause has two parts:

  1. rejects() (src/devops_cli/roadmap/adr.py:318) says that an ADR rejects a tool when a rejected option names the tool. names() (adr.py:283) matches the full owner/name anywhere, also in a link target: _spans puts each href in the marked spans (adr.py:267). It matches a one-word name in strong emphasis or a code span, also when the word only qualifies another thing ("Kubernetes Lease", "gh CLI").
  2. _verdict_of (src/devops_cli/roadmap/alternatives.py:1123) tests the ADR (:1140) before the inventory (:1149). So a tool that the inventory holds can get rejected.

The model only proposes the ADR number. The job confirms it with rejects(), and that test is too loose. Tracker #4624 (body line 117) sets the target "false rejected verdicts: 0".

Reproduction Steps

  1. On origin/main (0d90de5), run rejects() for each ADR in force:

    from pathlib import Path
    from devops_cli.roadmap.adr import adr_of, rejects
    p = "docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md"
    print(rejects(adr_of(p, Path(p).read_text()), "kubernetes/kubernetes", "kubernetes"))  # True
  2. Do the same for ADR 0014 with ("<owner>/devops-cli", "devops-cli") and for ADR 0006 with ("cli/cli", "gh"). Each gives True.

  3. Read the alternatives blocks of feat(roadmap): the poll frees the check-out of a gone job #5524, feat(gh): pass through gh repo, gh ruleset, gh variable and gh org #5323 and feat(roadmap): the implement Job gates before its PR #4719. Each says rejected and names the ADR above.

Expected vs Actual Behavior

Expected:

  • An ADR rejects a tool only when a rejected option is about that tool. A link target, or a word that qualifies another thing ("Kubernetes Lease", "gh CLI"), does not reject the tool.
  • The check never gives rejected for the repository of the item.
  • An ADR that rejects a tool on one path still gives rejected on that path. Example: ADR 0018 rejects bubblewrap for the planner run tool, and feat(roadmap): wire sandboxed run tool into stage toolbox and prompt #4098 (check of 2026-11-18) has that verdict, although .devcontainer/Dockerfile:302 installs bubblewrap. So "inventory first" alone is not a correct fix. The plan chooses the rule.

Actual: rejects() gives True for tools in use. Replay over the ADRs in force at 0d90de5:

Tool names ADRs that rejects() confirms
kubernetes/kubernetes, kubernetes 0005, 0016, 0021, 0022
<owner>/devops-cli, devops-cli 0014, 0018, 0022
valkey-io/valkey, valkey 0008, 0021, 0022
astral-sh/uv, uv 0021

Environment Diagnostics

  • DevOps CLI Version: 0.180.0 (origin/main 0d90de5)
  • Python Version: 3.14.10
  • Execution Environment: the alternatives job of the roadmap Service in the cluster; the replay ran in the devcontainer.

Logs, Traces, or Terminal Output

# Alternatives block of #5524
Alternatives check of 2026-11-17: rejected.
Rejected by ADR 0021. A newer fact can change an ADR.
Tool: kubernetes/kubernetes (https://github.com/kubernetes/kubernetes), Apache-2.0, last activity 2026-11-17, maintained.

# Alternatives block of #4719
Alternatives check of 2026-11-14: rejected.
Rejected by ADR 0014. A newer fact can change an ADR.
Tool: <owner>/devops-cli (https://github.com/<owner>/devops-cli), MIT, last activity 2026-11-14, maintained.

# Verdicts of 7 days (Prometheus)
sum by (verdict) (increase(devops_cli_roadmap_alternatives_total[7d]))  ->  rejected ~17, in-use ~225

Pre-Submission Checklist

Acceptance Criteria

Dependencies

Merge order

#6347 (open) changes _verdict_of too. It is no blocker: rebase before the second of the two merges.

Related

Tracker #4624: target "false rejected verdicts: 0".

Alternatives check of 2026-11-19: none.
Tool: none found.
Reason: Searches found ADR authoring CLIs and generic Markdown parsers, but none decides whether a rejected ADR option names a tool as its subject or orders that test against the inventory, so the repository-specific rule still needs its own code.

Lacks:

  • No matching of a tool name in a rejected ADR option
  • No separation of link targets and qualifiers from the option subject
  • No verdict order over own repository, ADR and inventory

Proposed design

Problem statement

The alternatives check gives false rejected verdicts. It matches a tool name in a link target or in a qualifier such as Kubernetes Lease or gh CLI. It also tests the ADR before the inventory, so a tool in use can get rejected. The fix makes the ADR match precise, treats the item's own repository as in use, and keeps genuine path-specific rejections such as ADR 0018 bubblewrap.

Acceptance criteria

Requirement: Ignore link targets

rejects() SHALL ignore Markdown link targets when it matches a tool name.

Scenario: A repository named only in an issue link

  • WHEN a test calls rejects() on ADR 0014 with the tool names <owner>/devops-cli and devops-cli
  • THEN the call returns False.

Requirement: Kubernetes qualifier does not reject

rejects() SHALL NOT match a bare tool name that only modifies a different head noun in a rejected option title.

Scenario: A Kubernetes Lease

  • WHEN a test calls rejects() on ADR 0021 with the tool names kubernetes/kubernetes and kubernetes
  • THEN the call returns False.

Requirement: gh CLI instrument does not reject

rejects() SHALL NOT match a bare tool name that only follows the preposition through in a rejected option title.

Scenario: Everything through the gh CLI

  • WHEN a test calls rejects() on ADR 0006 with the tool names cli/cli and gh
  • THEN the call returns False.

Requirement: Bundling CodeQL is a method

rejects() SHALL NOT match a bare tool name that only names the object of bundling in a rejected option title.

Scenario: The CodeQL CLI bundled by licence

  • WHEN a test calls rejects() on ADR 0005 with the tool names github/codeql and CodeQL
  • THEN the call returns False.

Requirement: Genuine path rejection stays

_verdict_of SHALL return rejected for a tool that a rejected ADR option names as its subject, even when the inventory holds the tool.

Scenario: ADR 0018 rejects bubblewrap

  • WHEN a test calls _verdict_of with the ADR 0018 text, an inventory that holds bubblewrap, and the tool bubblewrap
  • THEN the verdict is rejected.

Requirement: Own repository is in use

_verdict_of SHALL return in-use and never rejected for the item's own repository.

Scenario: The item repository appears in a rejected ADR link

  • WHEN a test calls _verdict_of with the item repository <owner>/devops-cli, the ADR 0014 text, and a tool that names <owner>/devops-cli
  • THEN the verdict is in-use.

Requirement: Replay of known false rejections

The check SHALL give no rejected verdict when it replays the ADR text and inventory of commit 0d90de50b for #5524, #5323 and #4719.

Scenario: Three known false rejections

Requirement: Census tests pass

The ADR census tests SHALL pass with the new rejection rule.

Scenario: The census suite

  • WHEN uv run pytest tests/roadmap/test_roadmap_adr.py tests/roadmap/test_roadmap_alternatives.py runs
  • THEN it exits 0.

Requirement: Spec states the rule

The roadmap-alternatives spec SHALL state the precise rejection rule and the verdict order.

Scenario: The change's spec delta validates

  • WHEN uv run openspec validate --strict runs on the change
  • THEN it exits 0 and the spec delta holds the updated requirements for rejects() and _verdict_of.

Existing Tool Considered

The alternatives check in the issue body (2026-11-19) gives none with no tool. It lists the lacks: no matching of a tool name in a rejected ADR option, no separation of link targets and qualifiers, and no verdict order. The change extends existing functions in src/devops_cli/roadmap/adr.py and src/devops_cli/roadmap/alternatives.py. Written cost: about 8k tokens to build and test, about 2k tokens for each later change to keep and fix, and about one engineer-day.

Key questions

  • How does rejects() decide that a rejected ADR option names a tool?: Parse each rejected option title with a Markdown inline parser. Remove link targets before the match. Match the full owner/name in the title. Match a bare name only when it is part of the head noun phrase of the option: the head noun, a product-name compound, or a versioned name. Do not match a bare name that modifies a different head noun, such as Kubernetes Lease, or that follows through, such as gh CLI. Treat bundling the CodeQL CLI as a method, not a tool subject, and update the ADR 0005 census expectation to False. Keep the product-name cases true: agent-sandbox controller, IBM Carbon tokens, GitHub Primer primitives and DBOS Transact in-process. (best practice) [sources: src/devops_cli/roadmap/adr.py:253, src/devops_cli/roadmap/adr.py:267, src/devops_cli/roadmap/adr.py:283, src/devops_cli/roadmap/adr.py:318, tests/roadmap/test_roadmap_adr.py:459, tests/roadmap/test_roadmap_alternatives.py:1325, openspec/specs/roadmap-alternatives/spec.md:492]
  • In what order does _verdict_of test the item repository, the ADR and the inventory?: Test the item's own repository first and return in-use. Then test the precise ADR rejection and return rejected. Then test the inventory and return in-use. Then use the model verdict. This order keeps ADR 0018 bubblewrap rejected and stops a tool in use from getting rejected through a loose ADR match. (best practice) [sources: src/devops_cli/roadmap/alternatives.py:1172, openspec/specs/roadmap-alternatives/spec.md]
    • Rejected: Test the inventory before the ADR. ADR 0018 rejects bubblewrap for the planner run tool, although .devcontainer/Dockerfile:302 installs bubblewrap.
    • Rejected: Keep the ADR before the inventory with the current matcher. The current matcher gives false rejected for tools in use.
    • Chosen: Test the own repository, then the precise ADR, then the inventory. It keeps genuine path-specific rejections and gives in-use for the item's own repository.
  • Which open, maintained tool or library covers this need?: No open, maintained tool or library covers this need. The alternatives check in the issue body (2026-11-19) gives none with no tool. It lists the lacks: no matching of a tool name in a rejected ADR option, no separation of link targets and qualifiers, and no verdict order. The change extends existing functions in src/devops_cli/roadmap/adr.py and src/devops_cli/roadmap/alternatives.py. Written cost: about 8k tokens to build and test, about 2k tokens for each later change to keep and fix, and about one engineer-day. (best practice) [sources: src/devops_cli/roadmap/adr.py, src/devops_cli/roadmap/alternatives.py, openspec/specs/roadmap-alternatives/spec.md]
    • Rejected: Use a generic Markdown parser for link spans. It parses Markdown but does not decide the subject of a rejected option or the verdict order.
    • Rejected: Use an ADR authoring tool. It manages ADR files and does not match a tool name or order the verdict.
    • Chosen: Extend the existing matcher and verdict function. The change is small and stays in the code that owns the rule.
  • Should the census replay keep or flip the ADR 0005 github/codeql expectation, and how are CLI qualifiers and multi-word or versioned subjects distinguished?: Flip the ADR 0005 expectation to False. ADR 0005 rejects bundling the CodeQL CLI by its licence, not the CodeQL tool. The rule uses the head noun phrase: a bare name matches when it is the head or part of a product-name head. It does not match when it modifies a different head noun or follows through. A version stays part of the head. A product-name compound stays part of the head. This keeps APScheduler 4, agent-sandbox controller, IBM Carbon tokens, GitHub Primer primitives and DBOS Transact in-process true, and makes Kubernetes Lease, gh CLI and CodeQL CLI false. (best practice) [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md:52, tests/roadmap/test_roadmap_adr.py:459, tests/roadmap/test_roadmap_adr.py:463, tests/roadmap/test_roadmap_alternatives.py:1325, openspec/specs/roadmap-alternatives/spec.md:492]
    • Rejected: Keep the ADR 0005 expectation true. It treats a method rejection as a tool rejection and conflicts with the gh CLI case.
    • Chosen: Flip the ADR 0005 expectation to false. It is consistent with the method and subject rule.
    • Rejected: Special-case CLI as a tool suffix. It keeps gh CLI true and does not separate the two cases.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 19, 2026
  2. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 19, 2026
  4. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  5. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (9)

    Tools considered:

    Searches run:

    • python markdown parser ignore link targets match text AST inline, results: 5
    • open source tool parse architecture decision records ADR markdown options rejected, results: 5
    • adr-tools github architecture decision records command line, results: 5
    • markdown-it-py python markdown parser github, results: 5
    • log4brains architecture decision records documentation tool, results: 5
    • "architecture decision record" linter tool options, results: 5
    • markdown-it-py, results: 5
    • adr-tools, results: 5
    • check whether architecture decision record rejects a tool automatically, results: 5

    Sources:

  6. added
    status/ready
    and removed
    status/new
    on Nov 19, 2026
  7. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  8. added
    owner/agent
    on Nov 25, 2026
  9. 5 remaining items

  10. removed
    owner/agent
    on Nov 25, 2026
  11. added
    status/ready
    and removed
    status/new
    on Nov 25, 2026
  12. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  13. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 25, 2026
  14. removed
    status/in-review
    owner/agent
    on Nov 25, 2026
  15. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-25 17:09 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