Skip to content

feat(cli): add the tool pass-through registry and its ADR #6597

Done

Description

@dan-petty

Problem

#5223 is a tracker. Its five sub-issues give the route names of five tool groups. Refine and stage skip a tracker, so no item builds the core scope of #5223: the pass-through registry and its ADR.

Other work needs the registry: the pass-through class that #4840 defers, and the "Merge first" lines of #5229 and #5230.

Scope

  1. ADR. Record the rule of the owner request of 2026-11-12 on feat(cli): tool commands pass unknown arguments to the tool #5223: a command that runs a tool takes the command names and the options of the tool, and passes its arguments through. A command of an API-based tool takes the names of the API route. Use the next free ADR number, because 0026 is in use. Use the form of docs/adr/README.md.
  2. Registry. Add src/devops_cli/core/passthrough.py. The key of an entry is the tool path (gh run list). An entry holds:
    • the devops paths (a gh pr entry names devops gh pr <verb> and devops pr <verb>)
    • the runner (run_gh, or run_subprocess with the isolated environment of the tool)
    • read or write
    • the owned options and the refused options, with the names of the tool
    • the MCP allowlist: each option that an MCP caller can give, with its arity and its caps
    • the cost of one run, and the page rule of -L/--limit
    • the timeout
  3. Never-wrapped list. The registry lists the gh verbs that devops never wraps: pr merge, auth, secret set, repo delete and release.

The other points of the design of #5223 are not in this item: the command shape, the runner, help, dry run, MCP, the recorded flags and the resolver (points 3 to 10).

Acceptance criteria

  • Test first: a test reads the entry gh run list from the registry. It finds the devops paths, the runner, the read mode, and the owned and refused options of the entry. The test fails on the base.
  • A test: the never-wrapped list holds the five verbs, and no entry has a path that the list holds.
  • A test: each devops path of an entry is a registered command.
  • uv run devops docs check passes.

Dependencies

None.

Source

Source: #5223

Alternatives check of 2026-11-21: none.
Tool: none found.
Reason: Searches returned no maintained tool for this registry. Generic CLI frameworks and the gh CLI pass arguments through, but none holds per-entry devops paths, option ownership, an MCP allowlist, cost, timeout and never-wrapped rules.

Lacks:

  • Registry keyed by tool path with devops aliases
  • Owned and refused options per entry
  • MCP allowlist with arity and caps
  • Run cost, page rule and timeout per entry
  • Never-wrapped verb list enforcement

Proposed design

Problem statement

No item builds the core scope of #5223: the pass-through registry and its ADR. Other work needs the registry: the pass-through class that #4840 defers, and the merge-first lines of #5229 and #5230. This item adds ADR 0035, the registry entry for gh run list, and the never-wrapped gh verb list.

Acceptance criteria

Requirement: ADR 0035 uses the MADR form

The project SHALL add ADR 0035 in the MADR form of docs/adr/README.md.

Scenario: ADR form test passes

  • WHEN A developer runs uv run devops ci test tests/invariants/test_adr_records.py.
  • THEN The command exits 0 and reports no rule failure for ADR 0035.

Requirement: ADR 0035 records the pass-through rule

ADR 0035 MUST state the pass-through rule of the owner request of 2026-11-12 on #5223.

Scenario: ADR index and docs check pass

  • WHEN A developer runs uv run devops docs check.
  • THEN The command exits 0 and the ADR index in docs/adr/README.md lists record 0035.

Requirement: Registry holds the gh run list entry

The pass-through registry SHALL hold one entry keyed by gh run list.

Scenario: The entry has its fields

  • WHEN A test reads devops_cli.core.passthrough.REGISTRY['gh run list'].
  • THEN The entry has devops gh run list in its devops paths, runner run_gh, mode read, and non-empty owned and refused option maps.

Requirement: Registry test fails on the base commit

The registry test MUST fail on the base commit before the module exists.

Scenario: Test first

  • WHEN A developer runs uv run devops ci test tests/core/test_passthrough.py on the base commit.
  • THEN The command exits non-zero and names the missing devops_cli.core.passthrough module.

Requirement: Never-wrapped gh verbs have no entry

The registry SHALL list pr merge, auth, secret set, repo delete and release as never wrapped.

Scenario: The list has five verbs and no entry

  • WHEN A test reads NEVER_WRAPPED and REGISTRY.
  • THEN The set equals the five verbs, and no registry key equals or starts with a listed verb plus a space.

Requirement: Registry paths resolve to registered commands

Each devops path in a registry entry MUST resolve to a command registered in the CLI.

Scenario: Every path resolves

  • WHEN A test walks each entry's devops paths and resolves each path in the CLI command tree.
  • THEN Each path resolves to a registered command, and the test reports no missing path.

Requirement: Registry entry holds cost, page rule and timeout

The gh run list entry SHALL hold a run cost, a page rule for -L/--limit, and a timeout.

Scenario: Operational limits are present

  • WHEN A test reads the gh run list entry.
  • THEN The entry has a positive cost, a page rule that names -L and --limit, and a positive timeout.

Requirement: Registry entry holds an MCP allowlist

The gh run list entry SHALL hold an MCP allowlist with an arity and caps for each allowed option.

Scenario: MCP allowlist is complete

  • WHEN A test reads the MCP allowlist of the gh run list entry.
  • THEN Each allowed option has an arity and a cap, and every allowed option is in the owned options.

Requirement: Documentation check passes

The documentation check SHALL pass after the ADR and index update.

Scenario: Docs check

  • WHEN A developer runs uv run devops docs check.
  • THEN The command exits 0.

Existing Tool Considered

The alternatives check of 2026-11-21 in the issue body gives verdict none and names no tool. It lists the needs that no maintained tool covers: a registry keyed by tool path with devops aliases, owned and refused options, an MCP allowlist with arity and caps, run cost, page rule, timeout, and never-wrapped enforcement. The project builds src/devops_cli/core/passthrough.py itself. The written cost is about 80k tokens and 1.5 engineer-days to build, and about 10k tokens per year to keep and fix.

Key questions

  • Which ADR number and status does the new record use?: Use ADR 0035 with status accepted, date 2026-11-12, decision-makers [owner], issue 6597 and tracker 5223. The index ends at 0034, and 0026 is in use. An accepted record carries a body-hash. (best practice) [sources: docs/adr/README.md]
    • Chosen: ADR 0035, status accepted. The index ends at 0034, and the README requires the accepted status and body-hash before merge.
    • Rejected: ADR 0035, status proposed. The pull request sets accepted before it is ready, so the final record is accepted.
    • Rejected: ADR 0026. Record 0026 is in use by the GitHub settings record.
  • How does the registry represent an entry?: Use a frozen dataclass PassthroughEntry and a module-level REGISTRY: dict[str, PassthroughEntry] keyed by the tool path. The fields are devops_paths, runner, mode, owned_options, refused_options, mcp_allowlist, run_cost, page_rule and timeout. (best practice) [sources: src/devops_cli/core/process.py:1195, src/devops_cli/github/rate_limiter.py:1888, ARCHITECTURE.md:184]
    • Chosen: Frozen dataclass and dict. It gives typed fields and an immutable entry, and a test can read it offline.
    • Rejected: TypedDict. It gives no runtime validation of the option maps or the timeout.
    • Rejected: Plain dict. It gives no type check and no stable field names.
  • Which runner does the gh run list entry hold?: Use run_gh, because the entry runs the gh CLI and must use the GitHub rate limiter and the gh authentication. Use run_subprocess with the isolated environment only for a tool that has no dedicated runner. (best practice) [sources: src/devops_cli/github/rate_limiter.py:1888, src/devops_cli/core/process.py:1195, ARCHITECTURE.md:184]
    • Chosen: run_gh. It keeps the GitHub rate limit and the gh authentication for the entry.
    • Rejected: run_subprocess. It bypasses the GitHub rate limiter and the gh authentication.
  • Which devops paths does the gh run list entry name?: Name devops gh run list in this item. Add devops run list when the CLI registers the run group. The test requires every named path to resolve to a registered command. (best practice) [sources: src/devops_cli/commands/gh.py]
    • Chosen: Only devops gh run list. The gh command is registered, and the test requires every named path to resolve.
    • Rejected: devops gh run list and devops run list. This item adds no run group, so it cannot show that the second path resolves.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/feature
    scope/cli
    source/agent
    status/new
    value/medium
    effort/medium
    on Nov 21, 2026
  2. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 21, 2026
  4. devops-cli-service commented on Nov 21, 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 (7)

    Tools considered:

    Searches run:

    • GitHub CLI gh command wrapper Python library subcommand registry, results: 5
    • Python library registry mapping CLI commands pass-through to wrapped tool options, results: 5
    • MCP server tool allowlist argument arity caps configuration, results: 5
    • typer click pass-through arguments to external command subcommand, results: 5
    • cyclopts python CLI library, results: 5
    • GitHub CLI extensions wrap gh commands, results: 5
    • open source registry of wrapped CLI tool commands with option ownership and allowlist, results: 5

    Sources:

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

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Live since 2026-11-25 02:42 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/clisource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions