Repository navigation
Description
Problem or Motivation
A person on a workstation reads the roadmap Service state through Grafana, kubectl logs or devops roadmap explain. None gives the health, the budgets, the items and claims of each repository or the runs in one command. The read API gives this state.
Proposed Solution & Architectural Design
devops roadmap service status|items|item|runs|budgetsread the API.- The client uses httpx and the same pydantic models as the routes.
- It uses
service.api.urlwhen it is set, else it opens its ownkubectl port-forward, and fails with an error that names the setting when neither works (no unconfigured fallback URL). - The token
clicomes from the keyring. --dry-runmakes no request and returns the would-be request.- The MCP generator makes read tools of these commands.
- feat(roadmap): a run console: follow a run and read its history #3076 (
devops roadmap follow) can share the client for the run history.
Target Subsystem
SDLC, Git & PR Governance (CLI: src/devops_cli/commands/roadmap.py).
Existing Tool Considered
httpx and the route models (existing dependencies); kubectl port-forward. Cost: about 200,000 tokens and 3 hours to build, about 10,000 tokens a month to keep, about 30,000 tokens to fix.
Acceptance Criteria
- Each subcommand prints the answer of its route, with
--jsonoutput. - With no
service.api.urland no reachable cluster, the command fails with an error that namesservice.api.url. --dry-runmakes no request.- The MCP server lists the read tools.
- Tests use a fake HTTP edge, not a live Service.
Dependencies
- "feat(service): serve a read-only roadmap API with OpenAPI".
- "feat(roadmap): keep a record of each roadmap run" (for
runs).
Source: #4517
Alternatives check of 2026-11-23: none.
Tool: none found.
Reason: Searches found only generic HTTP clients (HTTPie) and Kubernetes dashboards (k9s); neither reads the project's roadmap Service routes nor supplies the five subcommands, the port-forward fallback, the keyring token, the dry-run preview or the MCP read tools.
Lacks:
- No status, items, item, runs or budgets subcommands
- No service.api.url setting with port-forward fallback
- No keyring cli bearer token or --dry-run request preview
- No generated MCP read tools
Proposed design
Problem statement
Build the five devops roadmap service read commands after #4581 and #4582 merge; no design question or person decision remains. A person on a workstation cannot read the roadmap Service state in one command. Grafana, kubectl logs and devops roadmap explain each show only part of the health, budgets, items, claims and runs. The read-only API of #4581 holds this state. This change adds devops roadmap service status|items|item|runs|budgets with --json, --dry-run, keyring authentication and generated MCP read tools.
Acceptance criteria
Requirement: Status command
devops roadmap service status SHALL print the JSON answer of the Service status route when --json is set.
Scenario: Status as JSON
- WHEN A person runs
devops roadmap service status --jsonagainst the fake HTTP edge. - THEN The command sends one GET to the status path. It prints the JSON body and exits 0.
Requirement: Subcommand set
The service group SHALL provide the status, items, item, runs and budgets subcommands.
Scenario: Help lists the subcommands
- WHEN A person runs
devops roadmap service --help. - THEN The output lists
status,items,item,runsandbudgets.
Requirement: One item
devops roadmap service item MUST read one item, named by its number, and print its JSON answer when --json is set.
Scenario: Item by number
- WHEN A person runs
devops roadmap service item 4595 --jsonagainst the fake HTTP edge. - THEN The client sends one GET to the item path for 4595. It prints the JSON body.
Requirement: Items list
devops roadmap service items SHALL print the JSON answer of the items route when --json is set.
Scenario: Items as JSON
- WHEN A person runs
devops roadmap service items --jsonagainst the fake HTTP edge. - THEN The command sends one GET to the items path. It prints the JSON body and exits 0.
Requirement: Runs list
devops roadmap service runs SHALL print the JSON answer of the runs route when --json is set.
Scenario: Runs as JSON
- WHEN A person runs
devops roadmap service runs --jsonagainst the fake HTTP edge. - THEN The command sends one GET to the runs path. It prints the JSON body and exits 0.
Requirement: Budgets list
devops roadmap service budgets SHALL print the JSON answer of the budgets route when --json is set.
Scenario: Budgets as JSON
- WHEN A person runs
devops roadmap service budgets --jsonagainst the fake HTTP edge. - THEN The command sends one GET to the budgets path. It prints the JSON body and exits 0.
Requirement: Table output
Each service subcommand SHALL print a table when --json is absent.
Scenario: Status as a table
- WHEN A person runs
devops roadmap service statuswith no--json. - THEN The command prints a table of the status fields and exits 0.
Requirement: Configured base URL
The client SHALL send each request to the base URL that the setting service.api.url gives.
Scenario: Setting names the Service
- WHEN
service.api.urlishttps://roadmap.example.testand a person runsdevops roadmap service budgets. - THEN The fake transport records one GET to
https://roadmap.example.testat the budgets path. It records no request to another host.
Requirement: Port-forward fallback
The client MUST open its own kubectl port-forward to the Service when service.api.url is not set.
Scenario: No setting and a reachable cluster
- WHEN
service.api.urlis not set and the process edge reports thatkubectl port-forwardstarts. - THEN The process edge records
kubectl port-forwardfor the Service. The fake transport records one GET to the local port, and the process edge records the stop of the forward.
Requirement: Error names the setting
The command MUST fail with an error that names service.api.url when the setting is not set and no port-forward works.
Scenario: No setting and no cluster
- WHEN
service.api.urlis not set andkubectl port-forwardfails. - THEN The command exits 1 and prints an error that contains
service.api.url. The fake transport records no request.
Requirement: Keyring token
The client SHALL send the keyring token cli as a bearer token on each request.
Scenario: Token from the keyring
- WHEN The keyring holds the token
cliand a person runsdevops roadmap service status. - THEN The request carries the header
Authorization: Bearer <token>with the keyring value.
Requirement: Missing token
The command MUST fail with an error that names the keyring entry cli when no token is stored.
Scenario: No token
- WHEN The keyring has no
clientry and a person runsdevops roadmap service status. - THEN The command exits 1 and prints an error that contains
cli. The fake transport records no request.
Requirement: Dry run
--dry-run MUST make no request and print the request that the command would send.
Scenario: Dry run of status
- WHEN A person runs
devops roadmap service status --dry-run. - THEN The command prints the method, the URL and the header names with the bearer token masked. The fake transport records no request, and the process edge records no port-forward.
Requirement: MCP read tools
The MCP server SHALL list one read-only tool for each service subcommand.
Scenario: Tool list
- WHEN A client lists the tools of the
devops-cliMCP server. - THEN The list holds a read-only tool for
service status,items,item,runsandbudgets.
Requirement: Offline tests
The tests MUST use a fake HTTP edge and MUST NOT contact a live Service.
Scenario: Tests with no cluster
- WHEN The tests of the
servicecommands run with no cluster and no network. - THEN Each test passes against the installed transport and opens no socket.
Existing Tool Considered
No open tool covers the need; build the thin client on the project's existing HTTP entry point. The alternatives check in the issue body (2026-11-23) recorded verdict none and named no tool; its block lists what the generic tools lack. The change builds a thin client on the project's devops_cli.http.entry.http_client seam and the existing generate_mcp_tools generator. Written cost: about 200,000 tokens and 3 hours to build, about 10,000 tokens a month to keep, and about 30,000 tokens to fix.
Key questions
- Which HTTP client does the
servicegroup use?: The group usesdevops_cli.http.entry.http_clientwith the private egress level and the read retry policy. The client decodes the pydantic models of the routes. It maps a failed response to a CLI error. (best practice) [sources: ARCHITECTURE.md:211, ARCHITECTURE.md:216, src/devops_cli/http/entry.py:55, src/devops_cli/k8s/service_http.py:45]- Chosen: The project's
http_cliententry point. It is the one place that builds the client, so the egress check, the retry policy and the test seam apply. - Rejected: A raw HTTP client. It skips the egress check and the one entry point that ARCHITECTURE.md records.
- Rejected: A client generated from the OpenAPI document. It adds a generator and a second client that builds its own transport, outside the egress check.
- Chosen: The project's
- Which code opens the port-forward?: A
kubectl port-forwardsubprocess on a free loopback port. The client starts it and stops it for the one command. It uses the project's process helpers and the liveness check ofport_forward_daemon, not the long-lived daemon manager. (best practice) [sources: src/devops_cli/k8s/port_forward_daemon.py:1, src/devops_cli/commands/k8s/networking.py:1041]- Chosen:
kubectl port-forwardsubprocess. It uses the kubectl that the CLI already needs, forwards one Service for one command, and reuses the project's process and liveness helpers. - Rejected: txn2/kubefwd. It forwards every Service of a namespace and runs as a long-lived process, not for one command.
- Rejected: The
k8s://service proxy. The API server consumes the Authorization header, so the Service'sclibearer token cannot reach it. It also needsservices/proxyRBAC. - Rejected: A port-forward through the Kubernetes Python client. It adds a websocket path and more code than the subprocess.
- Chosen:
- How do the tests reach the API with no live Service?: They install the project's HTTP transport seam with
install_transportand thewebfixture. The fake answers on a mock transport. No test opens a socket. (best practice) [sources: ARCHITECTURE.md:211, src/devops_cli/http/entry.py:227, tests/support/fakes/http.py:171]- Chosen: The
webfixture andinstall_transport. It replaces the transport that the entry point builds, so the real client, egress level and retry policy stay in the test. - Rejected: A raw mock transport outside the seam. It bypasses the entry point and tests a client that the product does not build.
- Rejected: A live Service in CI. It needs a cluster and a token, and the tests must run offline.
- Rejected: The
responseslibrary. It adds a dependency that the project's transport seam replaces.
- Chosen: The
- How does the client find the base URL of the Service?: It reads
service.api.url, a new nested field of theservicesettings group. When the setting is empty, it opens its ownkubectl port-forwardto the Service. When both fail, it exits 1 with an error that namesservice.api.url. (best practice) [sources: src/devops_cli/config/settings.py:1566, src/devops_cli/k8s/service_http.py:45]- Chosen: Setting, then port-forward, then error. A person reaches a deployed Service with the setting, and a local cluster with no setup.
- Rejected: Setting only. A person with a local cluster must set the URL by hand in each shell.
- Rejected: Port-forward only. It ignores a deployed Service that the setting names.
- Rejected: A default URL when both fail. It sends the request to a host that nobody named.
- Where does the client get the token for the read API?: From the keyring entry
cliin thedevops-cliservice, read withget_keyring_secret('cli'). The client sends it asAuthorization: Bearer <token>. When the entry is missing, the command exits 1 with an error that namescliand sends no request. (best practice) [sources: src/devops_cli/config/os_keyring.py:191, src/devops_cli/config/constants.py:28]- Chosen: The keyring entry
cli. The workstation keyring holds the secrets of the CLI, and no secret lands in a file or a shell history. - Rejected: An environment variable. A shell history and a process listing show the value.
- Rejected: The settings file. The value is a secret, and a plain file holds it.
- Chosen: The keyring entry
- What does
--dry-runprint, and what does it send?: It prints the method, the URL and the headers of the would-be request through the@dry_run_class("request-plan")path, with the bearer token masked. It sends no request and starts no port-forward. (best practice) [sources: src/devops_cli/commands/roadmap.py:1014, src/devops_cli/roadmap/request_plan.py:1280, src/devops_cli/dry_run/decorator.py:22]- Chosen: Print the would-be request and send nothing. It matches the
--dry-runrule of every roadmap command. - Rejected: Send the request and discard the answer. The rule says that a dry run makes no request.
- Chosen: Print the would-be request and send nothing. It matches the
- How do the read tools reach the MCP server?: The five commands join
CONST_MCP_EXPOSURE_TABLEas read-only entries.generate_mcp_toolsregisters one tool for each from the command metadata. (best practice) [sources: src/devops_cli/config/constants.py:306, src/devops_cli/ai/mcp/generator.py:528]- Chosen: The exposure table and
generate_mcp_tools. One table stays the only list of the tools and their read-only mark. - Rejected: Hand-written tools in
server.py. A second list drifts from the commands. - Rejected: FastMCP's OpenAPI generator. It builds a second tool set from the API document and bypasses the CLI registry, the dry run and the keyring token.
- Chosen: The exposure table and
- How does each subcommand format its output?: A table by default and the route JSON with
--json, throughresolve_formatandemit_serialized. (best practice) [sources: src/devops_cli/output/serialization.py:43, src/devops_cli/output/serialization.py:90, src/devops_cli/commands/roadmap.py:1039]- Chosen: A table by default and
--json. It matchesroadmap explainandroadmap plan-check. - Rejected: JSON only. A person at a terminal reads a table faster.
- Chosen: A table by default and
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.Useful CLI convenience but not blocking; users can still read state via Grafana or kubectl logs.Gives a person one command to read all Service state, replacing several manual steps.Body estimates about 3 hours to build with existing dependencies (httpx, pydantic models).Both read run history from the Service, but the candidate builds multiple CLI subcommands (status, items, item, runs, budgets) while #3076 builds a single follow command for live trace.devops-cli-service commentedon Nov 13, 2026
Alternatives check: none
Reason: The searches turned up only generic building blocks — HTTP client libraries such as httpx, a bulk Kubernetes service-forwarding helper (kubefwd) and an OpenAPI-to-MCP framework (fastmcp) — and none of them reads the roadmap Service's status, items, claims, runs or budgets. The state sits behind the project's own read-only API, so the subcommands, keyring
clitoken,service.api.url/port-forward fallback,--dry-runand generated MCP read tools are new code the issue itself has to build on those dependencies.Tool: none found
Lacks:
service status|items|item|runs|budgetssubcommands over the roadmap read API--jsonoutputservice.api.urlsetting with a fallback that opens its ownkubectl port-forwardand a clear error when neither worksclitoken from the keyring--dry-runthat makes no request and returns the would-be requestTools considered:
Searches run:
Sources:
Checked on 2026-11-13. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 14, 2026
Refine cannot set this item to Ready at b15faab while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.