Skip to content

feat(roadmap): run each alternatives check in its own pod #4573

Open

Description

@dan-petty

Problem or Motivation

The alternatives check runs in the roadmap Service pod, and a rollout kills a check in progress. Alternatives writes its record before its comment, so a kill loses a comment and does not double it (src/devops_cli/roadmap/alternatives.py:1214-1227), but the work runs again.

Proposed Solution & Architectural Design

  • WorkflowTemplate roadmap-alternatives runs the alternatives selection narrowed to one item. Semaphore agent. Deadline 3,600 s on the template. No clone.
  • The pod reaches SearXNG in devops; check its policy in k8s/devops/searxng/.
  • The row becomes a submit.

Removes: the in-pod body of _run_alternatives_adapter (src/devops_cli/roadmap/run.py:704-719).

Target Subsystem

SDLC, Git & PR Governance (roadmap alternatives).

Existing Tool Considered

Argo Workflows semaphore and templates. Cost: about 60,000 tokens and 3 hours to build, about 5,000 tokens a month to keep, about 10,000 tokens to fix.

Acceptance Criteria

  • A check runs in a pod and writes its verdict section.
  • The pod reaches SearXNG, GitHub and PyPI and nothing that the perimeter refuses.
  • Measure: alternatives checks killed by a shutdown, 0 in 7 days.

Dependencies

Source: #4517

Alternatives check of 2026-12-01: in-use.
The repository already uses this tool.
Tool: Argo Workflows (https://github.com/argoproj/argo-workflows), Apache-2.0, last activity 2026-12-01, maintained.
Reason: The issue already names Argo Workflows as its proposed solution, and the repository runs it (ADR 0008, ADR 0021). A WorkflowTemplate with a semaphore and a template deadline runs one alternatives check in its own pod.

Covers:

  • Runs one item per pod from a WorkflowTemplate
  • Synchronization semaphore limits concurrent checks
  • Template activeDeadlineSeconds bounds each run

Lacks:

  • Submit row, pod labels and egress policy are repository glue
  • SearXNG ingress peer needs the new component label
  • In-pod record, verdict block and comment write

Owner decision 2026-11-13

The approved pipeline split (tracker #5482) makes this pod step 1 of the research unit (#5513). It uses the semaphore research 1, not agent, so research never holds an agent slot. Due just in time: the items in the next stage window and P0 items. The 30-day recheck runs only for items in the window. #5506 builds the two-container template on this unit.

  • Live proof: after the merge and the release, the pod runs as the App on the next 5 items of the stage window. A comment gives the result lines with tokens and cost_usd_micros.

Proposed design

Problem statement

The alternatives check runs in the roadmap Service pod. A rollout kills a check in progress and the work runs again. This change runs each check in its own Argo Workflows pod from WorkflowTemplate roadmap-alternatives. The alternatives row submits one workflow for each selected item and runs no check itself.

Acceptance criteria

Requirement: WorkflowTemplate roadmap-alternatives

The repository SHALL define WorkflowTemplate roadmap-alternatives in namespace devops to run the alternatives check for one item in its own pod.

Scenario: Template validation

  • WHEN uv run devops ci --check --only k8s validates the manifests that hold WorkflowTemplate roadmap-alternatives.
  • THEN The check exits 0 and reports no validation error for the template.

Requirement: Template controls

WorkflowTemplate roadmap-alternatives SHALL use synchronization semaphore research with a limit of 1, set activeDeadlineSeconds to 3600, define no clone step or repository volume, and label its pod app.kubernetes.io/name: devops-cli-job with component roadmap-alternatives.

Scenario: Template controls validation

  • WHEN uv run devops ci --check --only k8s validates the template and the ConfigMap that holds semaphore research.
  • THEN The check exits 0 and reports semaphore research at a limit of 1, activeDeadlineSeconds 3600, no clone step or repository volume, and the two pod labels.

Requirement: Submit row

The alternatives row SHALL create one workflow from template roadmap-alternatives for each item that select_items returns, and SHALL return without waiting.

Scenario: Two due items

  • WHEN A test calls _run_alternatives_adapter for a repository of 2 due items with a fake workflow client.
  • THEN The row creates 2 workflows from template roadmap-alternatives with the item numbers, and returns without a wait call.

Requirement: No in-pod check

The Service pod SHALL make no model call and SHALL start no alternatives check process.

Scenario: No model call

  • WHEN A test calls _run_alternatives_adapter with a fake workflow client and a fake model.
  • THEN The fake model records no call, and no alternatives record, verdict block or comment is written.

Requirement: Pod egress

The alternatives pod SHALL reach SearXNG in namespace devops on TCP 8080, the LLM gateway, the cache and public HTTPS for GitHub and PyPI.

Scenario: Kubernetes policy validation

  • WHEN uv run devops ci --check --only k8s validates k8s/devops/networkpolicy.yaml, k8s/devops/searxng/networkpolicy-client.yaml and k8s/devops/searxng/networkpolicy.yaml.
  • THEN The check exits 0 and reports those egress rules for the pod label, and no TCP 6443, private range or cloud metadata address.

Requirement: Verdict write

The pod SHALL write the record, the verdict block and the comment of the alternatives check for its one item.

Scenario: One item writes one result

  • WHEN A test runs the one-item alternatives command with a fake GitHub store, a fake search result and no earlier verdict block.
  • THEN The run writes one record, one verdict block and one comment for that item.

Requirement: Inventory without a clone

The check SHALL read the deployed inventory paths through the roadmap store when it runs with no clone.

Scenario: Deployed path names the tool

  • WHEN A test runs the check with no clone and a fake store whose k8s file names the tool of the item.
  • THEN The verdict is in-use and the record names the tool.

Requirement: Deadline leaves the item due

A workflow that ends at its deadline SHALL leave the item due, so that a later round selects it again.

Scenario: Timed-out workflow

  • WHEN A test calls select_items for an item whose job record holds a timed-out workflow and no verdict block.
  • THEN The selection returns the item and the item holds no verdict block.

Requirement: Pending a person after the merge

The alternatives pod SHALL run as the App on the next 5 items of the stage window after the merge and the release.

Scenario: Live proof

  • WHEN An agent runs the live check uv run devops roadmap follow <n> for each of the next 5 items that the alternatives row submits, after the Live since comment that release_comments posts.
  • THEN Each item has one Workflow of roadmap-alternatives that ended Succeeded, each item has a new date in its verdict block and one job=alternatives result line, and one comment on this issue gives the 5 result lines with tokens and cost_usd_micros and the Workflow names.

Requirement: No check killed by a shutdown

A rollout SHALL kill no alternatives check, so that the count of killed checks is 0 in 7 days.

Scenario: Seven-day count

  • WHEN An agent counts, 7 days after the release, the Workflows of roadmap-alternatives that ended Failed or Error after their pod was deleted, with kubectl get workflows -n devops.
  • THEN The count is 0 and the agent posts the count on this issue.

Existing Tool Considered

The alternatives check of 2026-11-19 in the issue body gives the verdict in-use for argoproj/argo-workflows (https://github.com/argoproj/argo-workflows), Apache-2.0, maintained, because the repository already runs it (ADR 0008, ADR 0021). The block in the issue body lists what the tool covers and lacks. This change adds the repository glue that the block lists as lacking: the submit row that creates one workflow for each selected item, the SearXNG egress policy and its matching ingress peer, the in-pod write of the record, the verdict block and the comment, and the deployed-path inventory read through the store with no clone. The body records about 60,000 tokens and 3 hours to build that glue, about 5,000 tokens a month to keep it, and about 10,000 tokens to fix it.

Key questions

  • Which open, maintained tool runs one alternatives check in its own pod?: Argo Workflows, which the repository already runs. The alternatives check of 2026-11-19 in the issue body gives the verdict in-use for argoproj/argo-workflows. WorkflowTemplate roadmap-alternatives runs the one-item check with synchronization semaphore research and a template deadline. (best practice) [sources: docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
    • Chosen: Argo Workflows WorkflowTemplate. The controller already runs in namespace devops, and the template gives the semaphore and the deadline with no new engine.
    • Rejected: Kubernetes Jobs. A Job has no template, no semaphore and no template deadline, so the change builds those controls.
    • Rejected: Keep the check in the Service pod. A rollout kills the check in progress, and that kill is the problem.
  • Which semaphore does the template use, and does this item change the due rule from the owner decision of 2026-11-13?: The template uses semaphore research with a limit of 1, not agent, as the owner decision of 2026-11-13 sets, so a research pod never holds an agent slot. This item keeps the current due rule. The just-in-time rule for the next stage window and the P0 items, and the 30-day recheck only in the window, belong to research unit feat(roadmap): one research unit runs its steps just in time #5513. (best practice) [sources: docs/CLUSTER.md, docs/ROADMAP_WORKFLOW.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
  • How does the pod run the alternatives selection for one item?: The template runs the existing devops roadmap alternatives command with the item named and the write confirmed. That command already narrows the round to one named item, and it writes its result only when the run is confirmed. (best practice) [sources: src/devops_cli/commands/roadmap.py, src/devops_cli/roadmap/alternatives.py]
    • Chosen: The existing devops roadmap alternatives command. It already names one item and writes its result when confirmed, so no second entry point is needed.
    • Rejected: A new pod entry point. It duplicates the command and adds a path to keep.
    • Rejected: Call the Python selection from a shell step. It bypasses the item selection and the exit path of the command.
  • How does the row learn which items to submit?: The row calls select_items with the settings limit, first_pass_limit, recheck_days and retry_days and the ADR hash of read_adrs, and creates one workflow for each selected item. It MUST NOT call plan_alternatives, because that function builds the model and runs _check_one for each selected item even with no writer. (best practice) [sources: src/devops_cli/roadmap/alternatives.py, src/devops_cli/roadmap/adr.py]
    • Chosen: Call select_items and submit one workflow for each item. The selection is one function with no model call, and each pod stays narrowed to one item.
    • Rejected: Call plan_alternatives with no writer. It builds the model and runs _check_one for each item, so the Service pod would run the check.
    • Rejected: One workflow for the whole round. The template is narrowed to one item, and a deadline kill loses the rest of the round.
  • Does the row wait for the workflow that it creates?: No. The row creates the workflows and returns. The pod writes its own result, and a wait would hold the Service for up to the 3,600 s deadline. The agentic jobs guideline requires that no caller waits for the end of a job. (best practice) [sources: docs/guidelines/agentic-jobs.md, src/devops_cli/roadmap/run.py]
    • Chosen: Create the workflows and return. The pod writes its own record, block and comment, so the row needs no result.
    • Rejected: Wait for the workflow to end. The row would hold the Service for up to an hour.
    • Rejected: Wait with a short timeout. A timeout leaves the result unknown and adds a second path.
  • Does the row keep the in-pod alternatives body as a fallback?: No. Remove the in-pod body from _run_alternatives_adapter and leave the row with one purpose: submit. A fallback keeps the kill path open and gives the row two purposes. (best practice) [sources: src/devops_cli/roadmap/run.py, docs/guidelines/agentic-jobs.md]
    • Chosen: Remove the in-pod body. A rollout can still kill an in-pod check, so the fallback keeps the problem.
    • Rejected: Keep it as a fallback. It gives two paths and leaves the kill path open.
  • Which pod label do the NetworkPolicies select, and how does the pod reach SearXNG, GitHub and PyPI?: The pod keeps app.kubernetes.io/name: devops-cli-job and adds component roadmap-alternatives. This change adds that component to the SearXNG egress block in k8s/devops/searxng/networkpolicy-client.yaml and to the ingress peer in k8s/devops/searxng/networkpolicy.yaml. The pod keeps devops-default-perimeter for DNS, public HTTPS, the gateway, the cache and the OTLP collector. A NetworkPolicy matches addresses and not host names, so no rule names GitHub and PyPI alone. (best practice) [sources: k8s/devops/networkpolicy.yaml, k8s/devops/searxng/networkpolicy.yaml, k8s/devops/searxng/networkpolicy-client.yaml]
    • Chosen: Add the pod label to the existing SearXNG policies. One place holds the SearXNG rule and its allowed hosts, and the perimeter already gives the public HTTPS that GitHub and PyPI need.
    • Rejected: A second NetworkPolicy that lists GitHub and PyPI addresses. A NetworkPolicy matches addresses and not host names, and the address lists of a hosted service change.
    • Rejected: Use no policy. The pod could not reach SearXNG, and the perimeter would be the only guard.
  • Does the alternatives pod need a clone of the repository?: No, but the check keeps the deployed paths. read_inventory returns an empty deployed text when it gets no source, so the change reads the inventory_paths through the roadmap store instead. read_adrs already reads a repository directory through the store. (best practice) [sources: src/devops_cli/roadmap/inventory.py, src/devops_cli/roadmap/stores/store.py, src/devops_cli/roadmap/adr.py]
    • Chosen: Read the deployed paths through the store. One listing and a few file reads keep the in-use verdict for a tool that only a k8s or tf file names, with no clone step.
    • Rejected: Clone the repository. It adds a clone step, credentials and storage that the check does not need.
    • Rejected: Drop the deployed paths. read_inventory gives an empty deployed string with no source, so an in-use tool that only a deployed file names would be missed and the item could get covers.
  • Who runs the live proof after the merge and the release?: An agent runs the live proof and posts the evidence. A person merges the pull request and decides on a measure that misses its target. The agent starts from the Live since comment that release_comments posts on this issue and reads each of the next 5 runs with uv run devops roadmap follow <n>. A check posts a comment only when its result changed, so a missing comment on an unchanged result is no failure. The agent posts one comment with the 5 result lines and the Workflow names, and counts after 7 days the Workflows of roadmap-alternatives that ended Failed or Error because their pod was deleted. (best practice) [sources: AGENTS.md, src/devops_cli/roadmap/alternatives.py, docs/guidelines/agentic-jobs.md]
    • Chosen: An agent runs the live proof and posts the evidence. The owner decision sets the live proof, and the evidence is one comment with the 5 result lines and the Workflow names.
    • Rejected: A person runs the live proof. The owner decision keeps only the merge and the decision on a missed measure for a person.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#6592

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    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/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 prevents lost work during rollouts but the system recovers by re-running, so it is important but not urgent.
    • Value: Medium. It stops rollouts from killing in-progress checks, which saves re-run cost and keeps the record consistent.
    • Effort: Medium. It requires a new WorkflowTemplate, a semaphore, network policy checks, and removal of existing in-pod code.
    • Related: feat(roadmap): the Service runs the alternatives job once a day, and refine reads the recorded tool verdict #2652, which asks for a different change. Both change how the alternatives check executes, but #2652 adds the scheduled run in the Service while the candidate moves execution to individual Argo pods.
  4. added
    priority/p2-medium
    on Nov 11, 2026
  5. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 818ac6f 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.

  6. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: Searches and the repository's ADRs point to Argo Workflows, which the project already runs (ADR 0008 chose it; ADR 0021 puts roadmap jobs in cluster pods) and which provides a WorkflowTemplate, a semaphore and a per-template deadline so each alternatives check runs in a pod of its own. Only repository-specific glue (the submit row, the egress policy and the verdict write) remains, so it covers the whole need.

    The item already names this tool.

    Tool: argoproj/argo-workflows (https://github.com/argoproj/argo-workflows)

    • License: Apache-2.0
    • Last activity: 2026-11-12
    • Maintained: yes

    Covers:

    • WorkflowTemplate defines a reusable template that runs the one-item alternatives check in its own pod
    • Synchronization semaphore limits concurrent alternatives pods (semaphore agent)
    • Template-level activeDeadlineSeconds bounds a check at 3,600 s
    • Workflow status and retry expressions let the row detect a failed or timed-out pod
    • The controller already runs roadmap work in namespace devops, so no new engine is needed

    Lacks:

    • The roadmap submit row in _run_alternatives_adapter that creates the workflow instead of running the check
    • The egress NetworkPolicy allowing SearXNG in devops, GitHub and PyPI and denying all other hosts
    • The in-pod write of the verdict section, comment and record of the alternatives check
    • The failure record and retry-window handling in the roadmap code

    Tools considered:

    Searches run:

    • Argo Workflows WorkflowTemplate semaphore concurrency limit activeDeadlineSeconds, results: 5
    • argo workflows WorkflowTemplate reusable workflow definition documentation, results: 5
    • Argo Workflows synchronization semaphore docs, results: 5
    • "argo-workflows" readthedocs workflow-controller synchronization semaphore example, results: 5
    • argoproj.github.io argo workflows WorkflowTemplate, results: 5

    Sources:

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

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

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at b15faab until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • Who confirms the live proof after the merge and the release? (a person decides)
  8. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    Contributor

    Owner question: See the first point of Open questions in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  9. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor

    Answer to the open question: who confirms the live proof after the merge and the release?

    Decision: an agent runs the live proof and posts the evidence. A person does not do this step.

    • Start: the Live since comment that release_comments posts on this issue.
    • Check: Argo CD shows application devops as Synced and Healthy. WorkflowTemplate roadmap-alternatives is in namespace devops.
    • Check: the next 5 items that the alternatives row submits each get one Workflow of roadmap-alternatives that runs as the App and ends Succeeded. Each item gets a new date in the verdict block of the body and one job=alternatives result line. The agent reads each run with uv run devops roadmap follow <n>.
    • A check posts a comment only when its result changed (src/devops_cli/roadmap/alternatives.py, _posts_comment). A missing comment on an unchanged result is no failure.
    • Evidence: one comment on this issue with the 5 result lines (tokens, cost_usd_micros) and the names of the Workflows.
    • Measure: after 7 days, the agent counts the Workflows of roadmap-alternatives that ended Failed or Error because their pod was deleted (kubectl get workflows -n devops). The target is 0. The agent posts the count.
    • If a check fails, the agent files a new issue with devops roadmap intake and links it here.

    A person keeps two steps: the merge of the pull request, and the decision on a measure that misses its target.

    This step comes after the merge and the release. It does not hold the item from Ready (decision "Post-merge person step" of 2026-11-11 in tracker 4780). Keep it as an acceptance criterion after the merge, not as an open question. Tracker 4780 is a source, not a dependency of this item.

  10. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

  11. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    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.

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/roadmapsource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions