Skip to content

feat(roadmap): refine investigates each question with code and web tools and decides design questions by the best practice, so only decisions reserved for a person wait on one #2398

Description

@dan-petty

Problem or Motivation

devops roadmap refine --confirm at bb46660 put 55 items under "Waiting on a person". Refine's last comment on each item shows three causes:

  1. A fact that refine could look up has no source (about 30 items). The comment asks a person a question such as "Can Gitleaks scan a directory in one run?" (perf(review): Run Gitleaks once per review instead of per file #2232), "What is the path for the rate limiter that all pr commands use to reach GitHub?" (feat(pr): pr commands list their requests in a dry run and make none #2234) or "Which gh release carries the Go 1.27.2 fix?" (fix(security): the service image ships a gh built with go 1.27.2 or later, and the two go stdlib ignores are dropped #1492), each marked "(missing verified source)". Refine plans at most CONST_ROADMAP_REFINE_MAX_SEARCH_QUERIES (3) web searches from the body before the model knows its questions (run_research_step, src/devops_cli/roadmap/refine.py:454-521). The model then answers once, with the cited files and 5 grepped identifiers as its only repository context (collect_context, :399-438). It cannot search the code, read a file or search the web for a question it finds. When the repository is private or tavily.api_key is not set, refine does no web research and says nothing about it. The key is not set in the workstation configuration or in Secret devops/devops-cli, so the run above did no web research.
  2. The body's answered key questions are read as open (about 20 items). _extract_heading_bullets (refine.py:536-557) takes every bullet under a "Key questions" heading as a question, including nested bullets and statements. A question counts as answered only when its normalized text is a substring of a question in the model's reply (validate_proposal, :631-637). So test(cli): tests double only process edges and mirror the source tree #1307, test(cli): every test file sits in the directory mirroring the package it tests or in tests/invariants/, and the root conftest holds only the hermetic floor #1313, feat(roadmap): onboard checks a repository for the roadmap jobs #1359, feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082 and others wait on questions that their bodies already answer ("Decided 2026-10-07: ...", "(proposed) ...", "Proposed: ...").
  3. A design choice is reported as a block (some items). The prompt calls a decision "a choice someone makes" (src/devops_cli/ai/tasks/roadmap_refine_proposal.md). The model then names a choice as a suspected block: ci(image): move the image checks to one path-filtered workflow #1858 waits on "A person must decide whether deletion of cleanup-devcontainer.yml is acceptable".

The owner's rule is to decide an open design question with the standard or open-tool answer and report it. Only merges, review verdicts, milestones, secrets, repository settings and hosts stay with a person (AGENTS.md, "Only a person"). Refine does not apply that rule.

Proposed Solution & Architectural Design

  • Investigation with tools. The proposal step becomes one model run with read-only tools: search the code at the pinned commit (git grep), read a file or a line range at that commit (git show), and search the web through Firecrawl's hosted API (the owner's choice, 2026-10-28) when the repository is public and a key is set. A tool-call budget caps each item. The URLs that a web search returned are the allowed URLs, as today. The separate research-plan step goes.
  • Decisions by best practice. A question has one of three kinds: fact, decision and person. A decision lists the options it compared, each with the reason it was chosen or rejected, and cites the sources for the chosen option: an upstream standard or document, a repository ADR or convention, or AGENTS.md's open-tool rule. Refine renders the chosen option and the rejected ones in the proposed design. person is only for a decision that AGENTS.md reserves for a person. Only a person question and a fact with no verified source wait on a person. A design choice is never a suspected block.
  • Body questions by index. The request gives the model the body's key questions as a numbered list, and each answer names the number of the question it answers. A body question is a top-level bullet that holds a question mark. A question that the body answers already (text after the question mark, or nested bullets under it) is answered. Other bullets are not questions. The substring match goes.
  • Research state in the report. When web search is off, the refine plan says so once and gives the reason (private repository, or no firecrawl.api_key).

Target Subsystem

Roadmap (src/devops_cli/roadmap/refine.py, src/devops_cli/ai/tasks/roadmap_refine_*.md).

Existing Tool Considered

pydantic-ai's agent, the project's model library, runs the investigation loop. Firecrawl's hosted API is the web search, called through the egress factory (firecrawl_search in src/devops_cli/ai/common_tools.py), in place of Tavily. git grep and git show read the pinned commit, as refine does today. Nothing new is built. The change deletes ResearchPlan, run_research_step, roadmap_refine_research.md, _normalize_question and the substring match.

Related

Acceptance criteria

  • With a fake model and a temporary repository, a fact that the model sources through a file it read with the read tool validates, and the item can be Ready.
  • A decision renders its chosen option, the rejected options with their reasons, and its sources, and it does not wait on a person.
  • Only a person question or an unsourced fact puts the item under "Waiting on a person".
  • A body key question that the body answers is not open, and a bullet with no question mark is not a question.
  • With web search off, the plan prints the reason once.
  • uv run devops ci passes.

Proposed design

Problem statement

The refine command plans web searches before the model knows its questions. It reads only a fixed set of files and cannot search the code for a question it discovers. It also misreads answered body questions as open and reports design choices as blocks for a person. These defects leave 55 items stuck under "Waiting on a person."

Acceptance criteria

  • Criterion 1: A fact sourced through a file read with the read tool validates, and the item can reach Ready.
    Verification: Run a test with a fake model and a temporary repository where the model calls the read tool on a file. Assert the fact validates and the item status is Ready.
  • Criterion 2: A decision renders its chosen option, the rejected options with their reasons, and its sources, and does not wait on a person.
    Verification: Run a test where the model returns a decision with options and sources. Assert the rendered output shows the chosen option, rejected options with reasons, and sources. Assert the item is not under "Waiting on a person."
  • Criterion 3: Only a person question or an unsourced fact puts the item under "Waiting on a person."
    Verification: Run tests with a person question, an unsourced fact, a sourced fact, and a decision. Assert only the first two produce a "Waiting on a person" state.
  • Criterion 4: A body key question that the body answers is not open, and a bullet with no question mark is not a question.
    Verification: Run a test with a body containing an answered question (text after the question mark) and a bullet with no question mark. Assert neither is treated as an open question.
  • Criterion 5: With web search off, the plan prints the reason once.
    Verification: Run refine with no tavily.api_key set. Assert the output contains the reason (private repository or no key) exactly once.
  • Criterion 6: The full CI suite passes.
    Verification: Run uv run devops ci and confirm all checks pass.

Key questions

  • Does this issue depend on another issue that must merge first?: Yes. feat(roadmap): refine criteria as requirement, when and then with the existing-tool question #1849 changes the same reply schema and prompt in refine.py and roadmap_refine_proposal.md. The second of the two to merge rebases onto the first. [sources: src/devops_cli/roadmap/refine.py, src/devops_cli/ai/tasks/roadmap_refine_proposal.md]
  • Is setting tavily.api_key a prerequisite for implementing this change?: No. The code handles the absence of the key by printing the reason once. Setting the key is a person's step for production use, not a block for the implementation. (proposed) [sources: src/devops_cli/ai/common_tools.py, AGENTS.md]
  • What question kinds does the new design define?: Three kinds: fact (answer from context or search results), decision (a choice with options compared and a source cited), and person (a decision AGENTS.md reserves for a person). Only person and an unsourced fact wait on a person. [sources: AGENTS.md, src/devops_cli/ai/tasks/roadmap_refine_proposal.md]
  • What existing code is deleted by this change?: The change deletes ResearchPlan, run_research_step, roadmap_refine_research.md, _normalize_question, and the substring match in validate_proposal. [sources: src/devops_cli/roadmap/refine.py:116, src/devops_cli/roadmap/refine.py:454, src/devops_cli/roadmap/refine.py:530, src/devops_cli/roadmap/refine.py:631]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#1849

Activity

  1. added
    source/agent
    type/feature
    on Oct 28, 2026
  2. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Type: type/feature. The candidate adds new capabilities (tool calls, question classification, index-based matching) to the refine command.
    • Priority: P2-Medium. 55 items are stuck, but the workflow still functions and no user-facing feature is broken.
    • Value: High. Unblocks 55 items and removes false 'waiting on a person' states from the roadmap.
    • Effort: High. Requires tool-call infrastructure, prompt redesign, new classification logic, and web-search integration across multiple files.
    • Related: feat(roadmap): refine criteria as requirement, when and then with the existing-tool question #1849, which asks for a different change. Both modify the refine step in refine.py, but #1849 changes the shape of acceptance criteria output while the candidate adds tool use and question classification to the proposal step.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

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

  4. added 2 commits that reference this issue on Oct 28, 2026
    890e228
    95eb8b6
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

    source/agenttype/feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions