Skip to content

docs(service): decide the roadmap Service read API #4581

Closed

Description

@dan-petty

Problem or Motivation

The roadmap Service has no API. Its HTTP surface is two webhook routes, two probes and /metrics, with OpenAPI turned off. The owner asked for roadmap Service API endpoints on 2026-11-11. The pipeline dashboard, the cluster start page and the CLI need a read of the Service state (health, budgets, items, claims, runs). When the state moves into Valkey and the work into pods, no process memory holds this state any more, so the API must read Valkey.

Three choices need a record: where the API lives, who can reach it, and which writes it does not have.

Proposed Solution & Architectural Design

Add an ADR (next free number) that records:

  • A small read-only API at /api/v1/roadmap/ in the webhook router, the one long-running process that the move keeps (2 replicas at the end).
  • The one route list with the data source of each route: health, repos, repos/{owner}/{name}/items, repos/{owner}/{name}/items/{number}, claims, runs, runs/{run_id}, budgets, openapi.json. Each answer has as_of, links and one list or object field. A repository is two path segments, parsed with RepoRef. run_id is the uid of the Job or Workflow.
  • Reads come from valkey-roadmap only. A read never sends a GitHub request or a model request.
  • Exposure: in the cluster only. No Ingress, no Cloudflare Access application. ADR 0003 line 16 ("every other route of the service stays private") stays true. The readers are Grafana (Infinity), the start page widget and the CLI through its own kubectl port-forward.
  • Auth: one named read-only bearer token for each reader (grafana, startpage, cli), compared in constant time. The fact that Grafana gives anonymous viewers what its token reads, from the home address with no login.
  • No write in v1, and the open tool that covers each write: labels and comments trigger the rows (ADR 0009, ADR 0017); the argo CLI submits, retries and suspends Workflows; limits and suspensions are GitOps changes; the halt clear is a command in the router pod. A pause that lives only in Valkey would break the rule that Valkey never holds the only copy of a decision.
  • It links to the naming ADR for keys and to the ADR of the move for state. It does not change ADR 0003.

Target Subsystem

SDLC, Git & PR Governance (roadmap Service: docs/adr/).

Existing Tool Considered

FastAPI (already the Service framework) generates the OpenAPI document. The argo CLI, GitHub labels and GitOps cover the writes. No build in this item. Cost: about 100,000 tokens and 1 hour, no keep cost.

Acceptance Criteria

  • The ADR records the placement, the route list with the data source of each route, the in-cluster exposure, the token rule, the Grafana exposure fact and each write that the API does not have with the open tool that covers it.
  • The ADR links to the naming ADR and to the ADR of the move.
  • The ADR holds no hostname, private address or token value.

Dependencies

  • "docs(roadmap): record the roadmap Service move to jobs and Valkey".
  • "feat(roadmap): name each repository's resources from one RepoRef" (the naming ADR).
  • Owner decision 2026-11-11: the API serves read-only routes for the dashboard (Grafana, the start page widgets and the CLI read) and the webhook routes; no write routes. Item titles of private repositories may show in Grafana.

Source: #4517

Proposed design

Problem statement

The roadmap Service has no API. Its HTTP surface is two webhook routes, two probes and /metrics, with OpenAPI turned off. The pipeline dashboard, the cluster start page and the CLI cannot read the Service state, and the move of state to Valkey and work to pods leaves no process memory to read. The owner asked on 2026-11-11 for read-only API routes for the dashboard and the CLI. One ADR records the placement, the route list and data sources, the in-cluster exposure, the token rule and the writes that the API does not have.

Acceptance criteria

Requirement: Placement in the webhook router

The ADR SHALL record that the read API lives at /api/v1/roadmap/ in the webhook router.

Scenario: Placement recorded

  • WHEN A reader opens the new ADR at docs/adr/0025-*.md.
  • THEN The ADR names the webhook router as the host and gives /api/v1/roadmap/ as the route prefix.

Requirement: Route table with data source

The ADR SHALL list each route of the read API with its data source.

Scenario: Every route listed

  • WHEN A test reads the route table of the ADR.
  • THEN The table holds a row for health, repos, repos/{owner}/{name}/items, repos/{owner}/{name}/items/{number}, claims, runs, runs/{run_id}, budgets and openapi.json, each row names its data source, every state route names valkey-roadmap, and openapi.json names the FastAPI schema.

Requirement: Run id names one run

The ADR SHALL state that run_id is the uid of the Kubernetes Job or Argo Workflow.

Scenario: Run id recorded

  • WHEN A test reads the route table row for runs/{run_id}.
  • THEN The row states that run_id is the uid of the Job or Workflow.

Requirement: Answer envelope

Each answer of the read API SHALL hold as_of, links and one list or object field.

Scenario: Envelope recorded

  • WHEN A test reads the response section of the ADR.
  • THEN The section states the fields as_of and links and one list or object field for every route.

Requirement: Repository in the route path

The ADR SHALL state that a repository in a route path is two path segments parsed with RepoRef.

Scenario: RepoRef named

  • WHEN A test searches the ADR for the repository path rule.
  • THEN The ADR names RepoRef and the two path segments {owner} and {name}.

Requirement: Valkey is the only read source

The ADR SHALL record that a read uses valkey-roadmap only and sends no GitHub request and no model request.

Scenario: No external call on a read

  • WHEN A test reads the data source section of the ADR.
  • THEN The section names valkey-roadmap as the only source and states that a read sends no GitHub request and no model request.

Requirement: In-cluster exposure

The ADR SHALL record that the read API is reachable inside the cluster only.

Scenario: No public route

  • WHEN A test reads the exposure section of the ADR.
  • THEN The section states no Ingress and no Cloudflare Access application, names Grafana, the start page widget and the CLI as the readers, and quotes "every other route of the service stays private" as still true.

Requirement: One token for each reader

The ADR SHALL name one read-only bearer token for each reader, grafana, startpage and cli, compared in constant time.

Scenario: Token rule

  • WHEN A test reads the auth section of the ADR.
  • THEN The section names the three readers, states one read-only token for each, and states a constant-time comparison.

Requirement: Grafana anonymous viewer

The ADR SHALL record that Grafana gives an anonymous viewer what its token reads.

Scenario: Grafana fact

  • WHEN A test reads the auth section of the ADR.
  • THEN The section states that an anonymous Grafana viewer from the home address reads what the grafana token reads, with no login.

Requirement: No write route

The ADR SHALL record that v1 has no write route and SHALL name the tool that covers each write.

Scenario: Each write has a tool

  • WHEN A test reads the write section of the ADR.
  • THEN The section names labels and comments, the argo CLI, GitOps changes and the halt clear command, each with the tool or path that covers it.

Requirement: Links to the other ADRs

The ADR SHALL link to the naming ADR and to the ADR of the move.

Scenario: Links present

  • WHEN A test reads the links of the new ADR.
  • THEN The ADR links to ADR 0022 and to ADR 0021.

Requirement: No secret in the text

The ADR MUST hold no hostname, no private address and no token value.

Scenario: No secret found

  • WHEN A test scans the new ADR for an address or a token value.
  • THEN The scan finds no hostname, no private address and no token value.

Existing Tool Considered

No alternatives check was recorded. FastAPI, already the Service framework (src/devops_cli/server/service.py:1090), covers the route handling and the OpenAPI document; it lacks the valkey-roadmap read model, the per-reader token check and the as_of/links envelope, which the project adds in the router when it builds the API. The argo CLI covers Workflow submit, retry and suspend (https://argo-workflows.readthedocs.io/en/latest/cli/argo_submit/); GitHub labels and comments cover the triggers; GitOps covers limits and suspensions. This item builds no code, so it has no keep cost; the ADR costs about 100,000 tokens and 1 hour.

Key questions

  • Are the two dependencies of this item delivered?: Yes. ADR 0022 holds the naming rule and ADR 0021 holds the move; both are in docs/adr/, so the new ADR can link to them. ADR 0021 line 51 also records that the router serves the read-only API that this item records. [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:51, docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md, CHANGELOG.md:108]
  • Where does the roadmap Service read API live?: In the webhook router, the one long-running process that the move keeps, under /api/v1/roadmap/. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:51, docs/adr/0003-polling-is-how-the-roadmap-sees-changes.md:18, src/devops_cli/server/service.py:1090]
    • Chosen: the webhook router. ADR 0021 line 51 says the router serves the read-only API, and it is the only long-running process that the move keeps.
    • Rejected: a new read-only deployment. It adds a process to run, patch and monitor, and reads the same Valkey.
    • Rejected: the CLI only, with no HTTP route. Grafana and the start page widget cannot run the CLI.
  • Who can reach the read API?: Readers inside the cluster only. The API has no Ingress and no Cloudflare Access application. (best practice) [sources: docs/adr/0003-polling-is-how-the-roadmap-sees-changes.md:18, docs/adr/0009-one-webhook-router-delivers-each-event-to-the-consumers-subscribed-to-it.md:13]
    • Chosen: in-cluster only. ADR 0003 line 18 keeps every route except the webhook path private, and ADR 0009 line 13 pins each provider to tunnel or cluster, with only GitHub public.
    • Rejected: an Ingress with Cloudflare Access. It adds a public surface that ADR 0003 keeps private.
    • Rejected: the existing webhook path. It puts reads on the one public path.
  • How does a reader authenticate to the read API?: One named read-only bearer token for each reader, grafana, startpage and cli, compared in constant time. (best practice) [sources: src/devops_cli/server/routes/webhooks.py:96-111, src/devops_cli/ai/mcp/remote.py:43-60, docs/adr/0009-one-webhook-router-delivers-each-event-to-the-consumers-subscribed-to-it.md:8]
    • Chosen: one named token for each reader. Each reader has its own token, so one leak revokes one reader; the router already compares a token with secrets.compare_digest and the MCP server with hmac.compare_digest.
    • Rejected: one shared token. A leak needs a change for all three readers at once.
    • Rejected: Cloudflare Access service tokens. The API has no Ingress and no Access application.
    • Rejected: mTLS. It needs a client certificate for each reader, which is more work than a bearer token.
  • Where do the token values live?: In the cluster Secret. The ADR holds no token value. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md:5, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:88]
    • Chosen: the cluster Secret. ADR 0004 line 5 keeps the privileged key in the cluster Secret only, and ADR 0021 line 88 makes the Valkey passwords generated credentials of devops k8s push-secrets.
    • Rejected: the ADR text. It publishes the secret in the repository.
    • Rejected: a GitOps values file. The repository holds the value.
  • Where does a read get its data?: From valkey-roadmap only. A read sends no GitHub request and no model request. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:99, ARCHITECTURE.md:226]
    • Chosen: valkey-roadmap only. ADR 0021 moves the coordination state to Valkey, and no process memory holds it after the move.
    • Rejected: a GitHub request for each read. It spends the rate limit and makes each read slow.
    • Rejected: a cache in process memory. Two replicas would answer from different states.
  • What does each answer hold?: Each answer holds as_of, links and one list or object field. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:51, src/devops_cli/server/service.py:1103]
    • Chosen: an envelope with as_of and links. The reader tells the age of the data and finds the next route.
    • Rejected: a bare list. It gives no time and no link.
    • Rejected: the raw Valkey value. It ties each reader to the key layout.
  • How does a route path name a repository?: Two path segments, {owner} and {name}, parsed with RepoRef. (best practice) [sources: docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md:47, src/devops_cli/github/repo_ref.py:1-12, ARCHITECTURE.md:228]
    • Chosen: RepoRef on two path segments. ADR 0022 makes RepoRef the one parser of owner/name.
    • Rejected: one segment with owner/name. A slash in a path segment needs escaping.
    • Rejected: a GitHub repository id. An id is not readable and the route list names the owner and the name.
  • What does run_id name?: The uid of the Kubernetes Job or Argo Workflow. Today a run id is the name of the runner Job (manual for a run that no Service started), but a unit name is fixed by its inputs and Kubernetes can reuse a name after deletion, so the uid is what names one run across retries. (best practice) [sources: docs/roadmap/implement.md:90, docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md:56, https://kubernetes.io/docs/concepts/overview/working-with-objects/names/]
    • Chosen: the uid of the Job or Workflow. The uid is unique across the cluster and immutable, so a retry or a reused name cannot make two runs share an id.
    • Rejected: the name of the Job or Workflow. ADR 0022 fixes a unit name by its inputs, and Kubernetes can reuse a name after deletion, so a name does not identify one run across time.
    • Rejected: an id that Valkey generates. It is not the engine's identity, so a reader cannot find the Job or Workflow from the id, and it adds a second source of identity.
  • Which writes does the API not have, and which tool covers each?: No write route in v1. Labels and comments on GitHub are the write path: a label change makes a job due at once, and a trusted implement: retry comment resumes a stopped or suspended row; the argo CLI submits, retries and suspends Workflows; limits and suspensions are GitOps changes; the halt clear is a command in the router pod. (best practice) [sources: docs/adr/0016-labels-hold-the-roadmap-items-fields.md:34, docs/adr/0009-one-webhook-router-delivers-each-event-to-the-consumers-subscribed-to-it.md:24, docs/adr/0017-each-subscribed-webhook-event-runs-the-update-scoped-to-it.md:12, src/devops_cli/roadmap/implement/implement_limits.py:1-9, docs/CONFIGURATION.md:270, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:161]
    • Chosen: a read-only API with the existing tools. Each write already has a tool or a Git path that a person or a job runs.
    • Rejected: write routes in the API. A pause that lives only in Valkey breaks the rule that Valkey never holds the only copy of a decision.
    • Rejected: a pause key in Valkey. ADR 0021 rule 1 forbids a decision whose only copy is in Valkey.
  • Does the ADR change ADR 0003?: No. ADR 0003 line 18 stays true, and the read API is one more private route. (best practice) [sources: docs/adr/0003-polling-is-how-the-roadmap-sees-changes.md:18, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:27]
    • Chosen: no change to ADR 0003. The API stays private, so the webhook path remains the only public route.
    • Rejected: amend ADR 0003. The exposure rule does not change, so no amendment is necessary.
  • Which number does the new ADR take?: 0025, the next free number after ADR 0024. [sources: docs/adr/0024-the-project-owns-its-design-tokens-in-the-dtcg-format-and-style-dictionary-builds-them.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-13: not-applicable.
Class: docs, no search.
Tool: none found.

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/docs
    scope/service
    status/new
    value/medium
    effort/low
    on Nov 11, 2026
  3. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

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

    • Type: type/docs. The docs prefix of the title gives the type.
    • Scope: scope/service. The (service) scope of the title gives the scope.
    • Priority: P2-Medium. Blocks the API implementation but is a design document, not a user-facing change.
    • Value: Medium. Prevents rework by fixing architectural decisions, but is not a user-facing feature.
    • Effort: Low. One ADR document, estimated at 1 hour with no ongoing cost.
    • Related: chore(docs): record roadmap service decisions and the machine-account and polling adrs #756, which asks for a different change. Both record roadmap Service decisions in ADRs, but #756 covers machine-account and polling while this covers the read API design.
  4. added
    priority/p2-medium
    on Nov 11, 2026
  5. added
    status/ready
    and removed
    status/new
    on Nov 12, 2026
  6. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: docs. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-13. A person decides what this means for the item. The check changes no label and closes no issue.

  8. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 17, 2026
  9. removed
    status/in-review
    on Nov 17, 2026
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/lowpriority/p2-mediumscope/servicesource/agenttype/docsvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions