Skip to content

feat(roadmap): Add toolsets for implement and review from one registry #3244

Closed

Description

@dan-petty

Problem

Three places choose tools for a model that works on the project, and none shares a definition:

A tool that fixes a defect in one place stays missing in the others. The planning role of #3219 lists 28 tools and does not include the stage tools, and the implement step cannot use the MCP tools without staging them in the runner container.

Proposed change

  1. List the tools of the implement and review jobs in a table of the same shape as the stage toolsets (a name, a one-line purpose, read-only or not).
  2. Add roadmap.implement.toolset and roadmap.review.toolset with a base value that equals today.
  3. Choose one definition for a read-only tool that two jobs use. Preferred: the tool is a plain function with a typed argument, wrapped for pydantic-ai in the job and for FastMCP in the role server, so the code exists once.
  4. Make the planning role table of feat(mcp): serve role-scoped tool sets over authenticated HTTP #3219 name the stage tools as the same functions.
  5. Extend the comparison of feat(roadmap): add toolset comparison to stage planner eval #3239 to these jobs: one compare form for each job.

Acceptance criteria

  1. Each of the three jobs has a toolset setting with a documented base value.
  2. A test fails when a tool is in a role table or a toolset and not in the registry.
  3. The stage tools of feat(roadmap): the stage planner gets references, read_issue and find_issues, chosen by a toolset setting #3238 are available through the MCP planning role from the same functions.
  4. No tool is defined twice.

Notes

Start with the design as a comment on this issue: the list of the implement step tools today, and the code that would be shared. Do not start before #3238 and the MCP server PR (#3233) merge.

Related: #3238, #3219, #3233, #3239.

Dependencies

Proposed design

Problem statement

Three places choose tools for a model that works on the project: the stage planner, the implement job and the MCP role servers. Each keeps its own list, so a tool that one place fixes stays missing in the others. The stage toolset names nine tools, and the implement and review jobs have no toolset setting at all. This change gives each job a toolset setting from one registry, defines each read-only tool once, and adds a test that fails when a table names a tool that the registry lacks.

Acceptance criteria

Requirement: Shared tool registry

The project SHALL keep one tool registry, and each entry SHALL hold a name, a one-line purpose, a read-only flag, the job or role that holds the tool, and the function.

Scenario: Registry entry fields

  • WHEN a test reads every entry of the registry
  • THEN each entry has a non-empty name, a one-line purpose, a boolean read-only flag, at least one job or role name and a callable function

Requirement: Toolset settings of the implement and review jobs

The settings roadmap.implement.toolset and roadmap.review.toolset SHALL exist, and each base value SHALL equal the tools that its job holds today.

Scenario: Default toolsets match today's tools

  • WHEN a test reads the default base value of both settings
  • THEN each value lists exactly the tool names that its job holds today

Requirement: Stage toolset from the registry

The roadmap.stage.toolset setting SHALL keep its base and extended values, and each name in either value SHALL be an entry of the registry.

Scenario: Stage toolset names

  • WHEN a test reads the base and extended values of the stage toolset
  • THEN every name is a key of the registry, and base still lists the nine tools that it lists today

Requirement: Registry check

A test MUST fail when a role table or a toolset names a tool that the registry does not hold.

Scenario: Unknown tool name

  • WHEN a role table or a toolset names a tool that is absent from the registry
  • THEN the test fails and its message names the table and the missing tool

Requirement: Single tool definition

Each tool MUST have exactly one function definition, and the job wrapper and the role server MUST wrap that function.

Scenario: Duplicate definition check

  • WHEN a test compares the function of each registry entry with the function that the job and the role server wrap
  • THEN each tool name maps to one function object, and no wrapper holds a second definition

Existing Tool Considered

No alternatives check has run. The libraries pydantic-ai (https://ai.pydantic.dev/tools/) and FastMCP (https://gofastmcp.com/servers/tools) wrap a plain Python function as a tool, so each covers the wrapping. Neither library gives a shared tool registry, per-job toolset settings or a cross-check test, so the change builds those. The written cost is about 40,000 tokens to build the registry, the two wrappers, the settings and the tests. The cost to keep and fix that code is about 8,000 tokens each month, and the elapsed time is about 16 hours.

Key questions

  • Where does the shared tool registry live?: Put the registry in a new module, src/devops_cli/roadmap/tools.py. Both the roadmap jobs and the MCP server import it, and the MCP package stays one consumer. (best practice) [sources: src/devops_cli/ai/mcp/roles.py, src/devops_cli/ai/mcp/server.py, src/devops_cli/config/settings.py]
    • Chosen: New module src/devops_cli/roadmap/tools.py. Both the roadmap jobs and the MCP server import it, and the MCP package stays one consumer of the registry.
    • Rejected: Extend src/devops_cli/ai/mcp/roles.py. The roadmap jobs would import the MCP server package for their own tools.
    • Rejected: Extend src/devops_cli/roadmap/stage_tools.py. The implement and review tools are no stage tools, and the stage job loads only its own set.
  • What does one entry of the registry hold?: A table with one entry for each tool: a name, a one-line purpose, a read-only flag, the job or role that holds the tool, and the function. The stage toolsets use the same shape. (best practice) [sources: src/devops_cli/ai/mcp/roles.py, src/devops_cli/config/settings.py]
    • Chosen: A table with one entry for each tool. One table holds the name, the purpose, the read-only flag and the holder, as the stage toolsets do.
    • Rejected: A dictionary of name to function. It holds no purpose, no read-only flag and no holder, so the toolset defaults need a second source.
    • Rejected: One class for each tool. It adds more code than a table entry for the same data.
  • How does each toolset base value stay equal to the registry?: Each registry entry names the job or role that holds it, and the default toolset reads that list. No list is copied into the settings defaults. (best practice) [sources: src/devops_cli/config/settings.py, src/devops_cli/config/defaults.py]
    • Chosen: Derive the value from the registry holder tags. One table is the source, so a new tool cannot miss a toolset.
    • Rejected: Copy the tool names into src/devops_cli/config/defaults.py. Two lists drift, and that drift is the defect that this issue fixes.
    • Rejected: Read the tool names from the agent at run time. The agent holds wrapped functions, so it gives no stable names for a setting.
  • Which definition shares a read-only tool between a job and the MCP role server?: Use one plain function with typed arguments in the shared registry. Wrap it with pydantic-ai in the job and with FastMCP in the role server. src/devops_cli/ai/mcp/server.py already wraps scan_uv_audit, scan_osv and check_threat_intel this way. (best practice) [sources: src/devops_cli/ai/mcp/server.py, src/devops_cli/ai/mcp/roles.py]
    • Chosen: One plain function, wrapped in each host. The function exists once, and pydantic-ai and FastMCP both wrap a plain function with typed arguments.
    • Rejected: One copy in the job and one in the role server. The two copies drift, and the acceptance criterion forbids a second definition.
    • Rejected: The job calls the MCP server over HTTP. The runner container must then stage the MCP server, which is the problem that this issue removes.
  • How does a test find a tool that a role table or a toolset names and the registry lacks?: One parametrized test reads every role table and every toolset value, and asserts that each name is a registry key. The failure names the table and the missing tool. (best practice) [sources: tests/ai/mcp/test_mcp_roles.py, src/devops_cli/ai/mcp/roles.py, tests/roadmap/test_roadmap_stage_plan.py]
    • Chosen: One parametrized test over every table and toolset. It checks all tables in one place and names the failing table.
    • Rejected: A run-time check when the MCP server starts. It misses the job toolsets, and it fails after the process starts.
    • Rejected: A test and a run-time check. The test gives the same guard, and the second check adds code and a failure mode.
  • Which toolset settings exist at this commit, and how many stage tools do they name?: The stage job has roadmap.stage.toolset. Its base value names nine read-only tools, and its extended value adds references, read_issue and find_issues. The implement job and the review job have no toolset setting, so this change adds both. The three tools of feat(roadmap): the stage planner gets references, read_issue and find_issues, chosen by a toolset setting #3238 are absent, so no criterion names them. [sources: src/devops_cli/config/settings.py]
  • Why does the planning role table not name the stage tools today?: The role tables name only tools that need nothing from the files of the job. On the server, a path that the model gives is a path of the server. The stage tools read the staged checkout at paths that the model gives, so the planning role cannot serve them without a server that reads the job's checkout. [sources: src/devops_cli/ai/mcp/roles.py, src/devops_cli/roadmap/stage_tools.py]
  • Do the MCP server and its job role tables exist at this commit?: Yes. src/devops_cli/ai/mcp/server.py builds the FastMCP server, and src/devops_cli/ai/mcp/roles.py holds the planning, implementation and review tables. The change builds on both and needs no new server. [sources: src/devops_cli/ai/mcp/server.py, src/devops_cli/ai/mcp/roles.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#3238

Alternatives check of 2026-11-06: in-use.
The item already names this tool.
Tool: pydantic/pydantic-ai (https://github.com/pydantic/pydantic-ai), MIT, last activity 2026-11-06, maintained.

Activity

  1. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 2, 2026
  2. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

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

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It depends on #3238 and #3233 merging and prevents tool drift but does not block a release.
    • Value: Medium. It stops tool definitions from diverging across three jobs, reducing defects from missing tools.
    • Effort: Medium. It requires new settings, a shared tool wrapper, test updates, and extending the compare form to two more jobs.
    • Related: feat(roadmap): add toolset comparison to stage planner eval #3239, which asks for a different change. Both extend toolset comparison, but #3239 covers only the stage planner while the candidate adds implement and review jobs plus a single tool definition source.
  3. added
    priority/p2-medium
    status/ready
    and removed
    status/new
    on Nov 2, 2026
  4. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.

    Evidence:

    placeholder

  6. added
    status/new
    status/ready
    and removed
    status/ready
    status/new
    on Nov 2, 2026
  7. 30 remaining items

  8. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261107-155352-cc61 ended: succeeded.
    Image digest: sha256:a749ebb3536caecc7657f0f63ce4640b04998bf6789935093570c9f5034ffab0

    The last lines of its log:

    Tool call: shell, started: grep -rn BaseStatus\\|fail_to_pass\\|fail-to-pass --include=<masked> src/devops_cli/roadmap/implement/implement_run.py | ...
    Tool call: shell, program grep, ok.
    Tool call: read_file, ok.
    Tool call: shell, started: uv run devops ci fail-to-pass --help ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: grep -n toolset src/devops_cli/roadmap/stage/stage_tools.py | head ...
    Tool call: read_file, ok.
    Tool call: shell, program grep, ok.
    Tool call: shell, started: uv run devops ci fail-to-pass --base ...
    Tool call: shell, program uv, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/stage/test_roadmap_stage_tools.py ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run devops ci fail-to-pass --base ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: grep -n MESSAGES src/devops_cli/roadmap/stage/stage_tools.py
    Tool call: shell, started: grep -rn <masked> src/devops_cli/roadmap/stage/*.py | head ...
    Tool call: shell, program grep, ok.
    Tool call: shell, program grep, ok.
    Tool call: shell, started: uv run ruff check src/devops_cli/roadmap/stage/stage_tools.py tests/roadmap/stage/test_roadmap_stage_tools.py
    Tool call: shell, started: uv run mypy --strict src/devops_cli/roadmap/stage/stage_tools.py 2>&1 ...
    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: shell, started: grep -rn toolset= --include=<masked> src/ tests/ ...
    Tool call: shell, started: uv run devops ci test tests/roadmap/stage/test_roadmap_stage_toolbox.py ...
    Tool call: shell, program grep, ok.
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/stage/test_roadmap_stage_verify.py ...
    Tool call: shell, started: uv run devops ci --only constructs,test-tree ...
    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: shell, started: git status --short
    Tool call: shell, started: git diff --stat
    Tool call: shell, program git, ok.
    Tool call: shell, program git, ok.
    Failure class ci_infra. Action left: retry.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    Elapsed: 23m 9s
    
  9. removed
    owner/service
    on Nov 7, 2026
  10. added a commit that references this issue on Nov 7, 2026
  11. added
    status/planned
    and removed
    status/blocked
    on Nov 13, 2026
  12. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor

    Cleared the stop at group 2 by the rule digest: the runner image changed since the stop, from sha256:a749ebb3536caecc7657f0f63ce4640b04998bf6789935093570c9f5034ffab0 to sha256:d1e93fe46eb1c1dca8c811f1b2a15213cab1a175349a07ec786e31bc88dc0226, and the class ci_infra of the stop is one that a new attempt can fix. The item is Planned again, and the Service takes it in the next round. The Service clears at most 2 for each class and 6 for each item by digest. A stop of another class, a new stop on this image, and a stop over a limit wait for a comment implement: retry.

  13. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.

  14. added
    status/in-progress
    status/in-review
    and removed
    status/planned
    status/in-progress
    on Nov 22, 2026
  15. removed
    status/in-review
    on Nov 23, 2026
  16. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-23 01:38 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/roadmaptype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions