Repository navigation
Description
Update 2026-11-26 (infra move): the valkey-roadmap manifest goes to dan-petty/homelab (follow-up of #4563).
This item keeps the product code. The agent ACL lines are a homelab change, made when this item is built. devops ci --check --only k8s here cannot check them. Record the 10 MB memory plan line with the manifest.
Problem or Motivation
After the move, each roadmap run is a Job or a Workflow that goes away after its TTL or when the sweep deletes a failed unit. A person and the dashboard then cannot see what ran, for how long, at what cost and why it stopped. The Workflows are kept for 1 to 24 hours only.
Proposed Solution & Architectural Design
- Each unit pod of stage, refine, alternatives, intake, scoped intake and implement writes a run record at start and at end:
roadmap:v1:run:<owner>/<name>:<uid>(hash, TTL 30 days) withrun_id= themetadata.uidof its Job or Workflow. The unit name is a field. The record holds counts only: requests, input and output tokens, tool calls, the limit that ended it, the stop reason, the trace id. No text of a tool answer. - Indexes:
roadmap:v1:runs:<owner>/<name>,roadmap:v1:runs:item:<owner>/<name>:<n>,roadmap:v1:runs:all(sorted sets by start time), trimmed to 30 days at each write. - The sweep marks a record whose unit is gone.
GET /api/v1/roadmap/runs(filtersrepo,item,row,phase,since) and/runs/{run_id}serve them, with Tempo and Loki links built from the configured Grafana base URL.- Log lines of a run carry
run_id. - The
agentACL user writesrun:*andruns:*. - Size: about 10 MB for 30 days. Add it to the memory plan of
valkey-roadmap. - Related: feat(roadmap): a run console: follow a run and read its history #3076 (a run console) can read these records for the run history.
Target Subsystem
SDLC, Git & PR Governance (roadmap units and Service API).
Existing Tool Considered
The Argo Workflows archive needs a database and keeps only Workflows, not the stage and runner Jobs; Loki and Tempo keep the logs and traces, and the record links to them. Cost: about 300,000 tokens and 4 hours to build, about 10,000 tokens a month to keep, about 50,000 tokens to fix.
Acceptance Criteria
- Each unit pod writes a record at start and at end with
run_id= its uid and counts only. - The sweep marks a record whose unit is gone.
/runsand/runs/{run_id}serve the records with Tempo and Loki links.- Log lines of a run carry
run_id. - Records and indexes expire after 30 days.
Dependencies
- "feat(service): serve a read-only roadmap API with OpenAPI".
- "feat(roadmap): run each stage item in its own Job" (the first unit with its own uid).
- feat(k8s): let roadmap-service create Argo Workflows #6592 (let roadmap-service create Argo Workflows), for the Workflow units.
Source: #4517
Alternatives check of 2026-12-01: partly.
Tool: mlflow/mlflow (https://github.com/mlflow/mlflow), Apache-2.0, last activity 2026-12-01, maintained.
Reason: Searches and the tool facts show MLflow records run metadata and serves it over a tracking API, so it partly covers the need; it lacks the Valkey TTL store, the sweep marking, and the Tempo and Loki links.
Covers:
- Run records with parameters, metrics and tags
- Start and end times and run status
- Tracking API and web UI for runs
Lacks:
- No 30-day TTL or index trimming
- Needs a separate tracking server and database
- No Tempo or Loki links and no Job uid field
Proposed design
Problem statement
Roadmap units run as Jobs or Workflows that disappear after their TTL or when the sweep deletes a failed unit. A person and the dashboard cannot see what ran, its duration, its cost or why it stopped. The change keeps a durable run record for each unit in valkey-roadmap and serves it through the roadmap API. The run id is the unit name, and the creator writes the Job or Workflow uid as a field.
Acceptance criteria
Requirement: Start record
Each roadmap unit pod SHALL write a start record at roadmap:v1:run:<owner>/<name>:<run_id> with run_id and unit_name equal to the unit name.
Scenario: A refine unit starts
- WHEN A refine unit starts for item 42 of
owner/namewith run iddevops-cli-refine-name-42-1a2b3c4d5e - THEN
roadmap:v1:run:owner/name:devops-cli-refine-name-42-1a2b3c4d5eholds the start time, the item, the row, the phase,run_idandunit_nameequal to the unit name.
Requirement: Unit uid
The creator of a unit SHALL write the metadata.uid of its Job or Workflow into the run record as the uid field.
Scenario: The Service creates a unit
- WHEN The Service creates the Job of a unit and reads uid
8f3cfrom the create response - THEN The record of that unit holds
uidequal to8f3c.
Requirement: End record
Each roadmap unit pod SHALL update its run record at its end with the end time, the stop reason and the name of the limit that ended it.
Scenario: An implement unit ends at a token limit
- WHEN An implement unit ends because its token limit stops it
- THEN Its record holds the end time, the stop reason and the limit name.
Requirement: Counts only
A run record SHALL hold the allowed counts and metadata only and MUST NOT hold tool answer text.
Scenario: A tool returns text
- WHEN A unit writes a record after a tool returns a text answer
- THEN The stored fields are the request, token and tool-call counts, the trace id, the stop reason and the limit. No value holds text from the answer.
Requirement: Indexes
Each record write SHALL add the run id to the repository, item and all indexes with the start time as score.
Scenario: A unit writes a record
- WHEN A unit writes the record of run
r1for item 42 ofowner/nameat start time 1000 - THEN
roadmap:v1:runs:owner/name,roadmap:v1:runs:owner/name:item-42androadmap:v1:runs:allholdr1with score 1000.
Requirement: Detail endpoint
The Service SHALL serve GET /api/v1/roadmap/runs/{run_id} with the required repo query and MUST answer 404 for an unknown run id.
Scenario: A client reads one run
- WHEN A client calls
GET /api/v1/roadmap/runs/r1?repo=owner/nameand thenGET /api/v1/roadmap/runs/r9?repo=owner/name - THEN The first call returns the record with its counts, stop reason, limit and uid, and the second call returns 404.
Requirement: List endpoint
The Service SHALL serve GET /api/v1/roadmap/runs with the filters repo, item, row, phase and since.
Scenario: A client lists the refine runs of item 42
- WHEN A client calls
GET /api/v1/roadmap/runs?item=42&phase=refine - THEN The response holds only the records of item 42 in phase
refine, newest start time first.
Requirement: Sweep marking
The sweep SHALL mark a run record whose unit no longer exists with gone true.
Scenario: A unit is deleted before its end record
- WHEN The sweep finds a record with no end time whose Job or Workflow is gone
- THEN The record holds
gonetrue and keeps its TTL.
Requirement: Retention
Each write SHALL set a TTL of 30 days on the record and on each index, and SHALL trim each index to the last 30 days.
Scenario: An index holds an old member
- WHEN A unit writes a record at time T and an index member is older than 30 days
- THEN The record key and each index key get a TTL of 2592000 seconds, and the index drops the old member.
Requirement: Observability links
Each served record SHALL hold a Tempo link and a Loki link built from the configured grafana.url.
Scenario: A record holds a trace id
- WHEN A client reads a record with trace id
abc123andgrafana.urlishttps://grafana.example - THEN The Tempo link starts with
https://grafana.exampleand holdsabc123, and the Loki link holds the run id.
Requirement: Log correlation
Each log line of a roadmap unit SHALL carry the run id of the unit.
Scenario: A unit writes a log line
- WHEN A unit with run id
r1writes a log line - THEN The log record holds
run_idequal tor1.
Existing Tool Considered
The alternatives check in the issue body records the verdict partly for mlflow/mlflow (https://github.com/mlflow/mlflow), Apache-2.0, maintained. The block lists what the tool covers and lacks. The change supplies the missing Valkey record and indexes, the sweep marking, and the Tempo and Loki links from grafana.url. It adds no tracking server and no second database. Written cost of the Valkey record and the API is about 300,000 tokens and 4 hours to build. It is about 10,000 tokens a month to keep and about 50,000 tokens to fix.
Key questions
- Which store keeps the run records and their indexes?: Valkey
valkey-roadmapkeeps the records and the indexes. ADR 0021 makes it the shared coordination store. It gives TTL and sorted sets. The change adds no second database. (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, ARCHITECTURE.md]- Chosen: Valkey strings and sorted sets in
valkey-roadmap. ADR 0021 deploys it for shared roadmap state. It supports the TTL and sorted sets that the record needs. - Rejected: mlflow/mlflow tracking server. The alternatives block lists the lacks. It needs a second database and a tracking server.
- Rejected: Argo Workflows archive. It archives only completed Workflows. It holds no Job, start record, count or limit.
- Rejected: A new PostgreSQL store. It adds a database to run, keep and back up.
- Chosen: Valkey strings and sorted sets in
- What is the run id of a unit, and how does its record learn the uid of its Job or Workflow?: The run id is the deterministic unit name from
RepoRef.unit_name. The creator passes it inDEVOPS_CLI_ROADMAP_RUN_ID. The creator writes the Job or Workflow uid from the create response asuid. The pod has no Kubernetes token, so it cannot read the uid. (best practice) [sources: src/devops_cli/github/repo_ref.py, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md, k8s/devops/roadmap-service/admissionpolicy.yaml]- Chosen: Deterministic unit name as run id, uid written by the creator.
RepoRef.unit_namegives one stable name. The creator holds the uid from the create response. - Rejected: The Job or Workflow uid as run id. The uid exists only after the create call. The pod cannot write its start record under that id.
- Rejected: Pod uid from the Downward API. A pod uid is not the Job or Workflow uid. The admission policy refuses a fieldRef.
- Chosen: Deterministic unit name as run id, uid written by the creator.
- Which key names hold the run record and its indexes under the repository key spec?: The record key is
roadmap:v1:run:<owner>/<name>:<unit_name>. The indexes areroadmap:v1:runs:<owner>/<name>,roadmap:v1:runs:<owner>/<name>:item-<n>androadmap:v1:runs:all. The body'sroadmap:v1:runs:item:<owner>/<name>:<n>fails the key spec, because the id holds a slash. (best practice) [sources: openspec/specs/repository-names/spec.md, docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md, src/devops_cli/github/repo_ref.py]- Chosen:
roadmap:v1:runs:<owner>/<name>:item-<n>. It keeps one kindruns, so two ACL patterns cover all three indexes.item-<n>is a valid id. - Rejected:
roadmap:v1:runs-item:<owner>/<name>:<n>. It is valid but adds a second index kind and a third ACL pattern. - Rejected:
roadmap:v1:runs:item:<owner>/<name>:<n>. The id holds a slash. The repository key spec refuses it.
- Chosen:
- How does
GET /api/v1/roadmap/runs/{run_id}find a repository-scoped record?: The detail route requires therepoquery parameter. The record key isroadmap:v1:run:<repo>:<run_id>. The run id is the unit name, which does not hold the owner. The list response holdsrepo, so a client has the value. This avoids a fourth index. (best practice) [sources: openspec/specs/repository-names/spec.md, docs/adr/0029-the-roadmap-service-serves-a-read-only-api.md, src/devops_cli/github/repo_ref.py]- Chosen: Required
repoquery parameter on the detail route. The record key is repository-scoped. The unit name does not hold the owner. - Rejected: Global
roadmap:v1:runs:by-idhash. It adds a fourth index and a cleanup path for expired entries. - Rejected:
SCAN MATCHfor the run id. It is slow and not deterministic.
- Chosen: Required
- What does the sweep do to a run record whose unit is gone?: The sweep sets
gonetrue on the record and keeps its TTL. The record stays until the 30-day TTL. The history of a failed unit stays readable. (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, CONTEXT.md]- Chosen: Mark the record as gone. The API can show that the unit disappeared. The history stays for 30 days.
- Rejected: Delete the record. The history of a failed unit would go before its TTL.
- Rejected: Leave the record unmarked. A person cannot tell a running unit from a deleted one.
- What retention do the run records and the indexes use?: The records and the indexes keep 30 days. Each record key and each index key gets a TTL of 2592000 seconds. Each write trims the indexes to the last 30 days. (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, ARCHITECTURE.md]
- Chosen: 30 days. It covers a month of runs and fits the 10 MB estimate of the memory plan.
- Rejected: 7 days. It is too short to compare runs across a month.
- Rejected: 90 days. It goes over the 10 MB estimate.
- Which prefix do the Service routes use?: The routes use the prefix
/api/v1/roadmap, as ADR 0029 records. They sit beside the/api/v1routers of the status and workspace routes. [sources: docs/adr/0029-the-roadmap-service-serves-a-read-only-api.md, src/devops_cli/server/routes/status.py, src/devops_cli/server/routes/workspace.py] - How are the Tempo and Loki links built?: Each link is a Grafana Explore URL at the configured
grafana.url. The Tempo link holds the trace id. The Loki link holds the run id. (best practice) [sources: src/devops_cli/commands/grafana.py, docs/CONFIGURATION.md]- Chosen: Grafana Explore URL at
grafana.url. A person reads the link in the configured Grafana. The query selects the trace or the logs of the run. - Rejected: Direct Tempo or Loki API URL. It bypasses the configured Grafana and is no person-facing link.
- Rejected: A dashboard URL with no query. It does not select the trace or the logs of the run.
- Chosen: Grafana Explore URL at
- Which parts of the issue are product code and which are homelab manifest changes?: The run record, API, log correlation and sweep marking are product code in devops-cli. The
agentACL lines and the 10 MB memory plan line are in thevalkey-roadmapmanifest in dan-petty/homelab. This item defers them to a new homelab issue. (best practice) [sources: CONTEXT.md, k8s/README.md]- Chosen: Defer the homelab manifest change. CONTEXT.md says devops-cli holds no environment tree. The homelab cluster environment lives in dan-petty/homelab. The devops-cli k8s check cannot validate it.
- Rejected: Add the manifest change to this pull request. The file is in another repository. The devops-cli check cannot validate it.
- Rejected: Add a k8s check criterion in this repository. The check cannot read the homelab manifest.
- Which issue numbers do the dependencies in the body have?: The body names docs(service): decide the roadmap Service read API #4581 as the read-only API, feat(roadmap): run each stage item in its own Job #4559 as the stage Job and feat(k8s): let roadmap-service create Argo Workflows #6592 as the Workflow units. The sweep marking adds feat(roadmap): run the reconcile sweep on a cluster schedule #4574, which ADR 0021 section 7 records as the sweep. [sources: docs/adr/0029-the-roadmap-service-serves-a-read-only-api.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md, openspec/changes/archive/2026-11-13-4559-run-each-stage-item-in-its-own-job/proposal.md, CONTEXT.md]
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.It adds observability for roadmap runs but does not block delivery or fix a defect.A person and the dashboard gain visibility into what ran, its cost, and why it stopped, which is useful but not a primary user path.The body estimates about 4 hours to build, covering records, indexes, two API endpoints, sweep marking, and log tagging.Both concern run history, but the candidate creates the records and API endpoints while #3076 is a CLI command that reads them.devops-cli-service commentedon Nov 13, 2026
Alternatives check: in-use
Reason: The searches, and the issue's own "Existing Tool Considered" line, lead to the Argo Workflows workflow archive as the only maintained tool that already keeps a durable record of completed runs with a retention TTL and serves it through an API. It covers only the Workflow half of the need: it archives no plain Jobs and holds no request, token, tool-call, limit or stop-reason counts, so the stage/runner Jobs, the per-item indexes, the sweep marking and the Loki/Tempo links still have to be built.
The repository already uses this tool.
Tool: argoproj/argo-workflows (https://github.com/argoproj/argo-workflows)
Covers:
Lacks:
Tools 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 19, 2026
The result in the alternatives block of the issue body changed. Before this check:
in-use, tool https://github.com/argoproj/argo-workflows. A person decides what the new result means for the item.Searches (10)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 21, 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.