Skip to content

feat(k8s): run the question resolver on a schedule #4809

Open

Description

@dan-petty

Problem or Motivation

The question resolver must run with no person and no agent session (owner requirement of 2026-11-11, #4780). No template runs it.

Proposed Solution & Architectural Design

  • A WorkflowTemplate and a CronWorkflow roadmap-resolve:
    • schedules: ['15 */4 * * *'], timezone UTC.
    • concurrencyPolicy: Forbid, startingDeadlineSeconds: 3600.
    • A mutex resolve and the semaphore steward (a new key of the ConfigMap roadmap-limits, value 1).
    • retryStrategy for exit code 75 only.
    • activeDeadlineSeconds: 3600.
    • The ADR 0022 labels.
    • No API token in the main container.
  • ConfigMap keys roadmap.resolve.mode, roadmap.resolve.repos and roadmap.resolve.limit.
  • The first runs use plan mode. The row stays in plan mode until the gold-set gate of the answer child passes.
  • The owner merges this pull request, because it changes a limit (ADR 0021).

Target Subsystem

Kubernetes manifests (k8s/devops/).

Existing Tool Considered

Argo Workflows CronWorkflows and synchronization (installed). Cost to build: about 50,000 tokens and 1.5 hours.

Acceptance Criteria

  • The kustomize render holds the objects.
  • The admission policy admits them.
  • A server-side dry run passes.
  • The first scheduled run in plan mode writes its plan to Loki and nothing to GitHub.

Dependencies

Source: #4780

Owner decision 2026-11-13

The approved pipeline split (tracker #5482, Phase 6) keeps this scope, with the semaphore steward 1.

  • Live proof: after the merge, the schedule runs the resolver one time as the App. A comment gives the Workflow name and the result lines.

Alternatives check of 2026-11-26: in-use.
The repository already uses this tool.
Tool: argoproj/argo-workflows (https://github.com/argoproj/argo-workflows), Apache-2.0, last activity 2026-11-26, maintained.
Reason: Searches found Argo Workflows, the engine the repository already runs and ADR 0021 chose; its CronWorkflow, WorkflowTemplate, retry, timeout and synchronization features cover the scheduled resolve run, leaving only project-specific manifest settings.

Covers:

  • Cron-scheduled Workflow runs in UTC
  • Reusable WorkflowTemplates for one spec
  • Workflow and step timeouts and retries
  • Mutex and semaphore synchronization between runs

Lacks:

  • Project ConfigMap keys roadmap.resolve.mode, repos and limit
  • ADR 0022 labels on objects and pod metadata
  • No-API-token rule for the main container
  • Admission-policy scope for the rendered objects

Proposed design

Problem statement

Build the roadmap-resolve WorkflowTemplate and CronWorkflow. Add the three roadmap.resolve.* keys of ConfigMap devops-cli-config. Add the steward key of ConfigMap roadmap-limits. Add the ADR 0022 labels.

The change uses Argo Workflows and adds no new tool. The pull request waits on #4558, #4566, #4792 and #4808. The owner must merge the pull request because it changes a limit. A person must prove the first scheduled run after the merge. The issue is not Ready until those dependencies merge.

Acceptance criteria

Requirement: Render holds the resolve objects

The kustomize render of k8s/devops SHALL contain a WorkflowTemplate and a CronWorkflow named roadmap-resolve.

Scenario: Render contains the resolve schedule

  • WHEN uv run devops ci --check --only k8s runs
  • THEN The k8s check exits 0 and reports no error for the roadmap-resolve WorkflowTemplate and CronWorkflow.

Requirement: Resolve schedule uses the four-hour cron

The roadmap-resolve CronWorkflow SHALL set schedules to ['15 */4 * * *'] and timezone to UTC.

Scenario: Schedule runs every fourth hour in UTC

  • WHEN uv run devops ci --check --only k8s runs
  • THEN The k8s check exits 0 and reports no error for the resolve schedule and its timezone.

Requirement: Resolve schedule serializes runs

The roadmap-resolve CronWorkflow SHALL set concurrencyPolicy: Forbid and startingDeadlineSeconds: 3600.

Scenario: Schedule forbids a second run

  • WHEN uv run devops ci --check --only k8s runs
  • THEN The k8s check exits 0 and reports no error for the resolve concurrency policy and start deadline.

Requirement: Resolve template bounds one run

The roadmap-resolve WorkflowTemplate SHALL set activeDeadlineSeconds: 3600.

Scenario: Template bounds one run

  • WHEN uv run devops ci --check --only k8s runs
  • THEN The k8s check exits 0 and reports no error for the resolve run deadline.

Requirement: Resolve workflow holds synchronization

The roadmap-resolve WorkflowTemplate SHALL declare mutex resolve and semaphore steward, and ConfigMap roadmap-limits SHALL hold key steward with value 1.

Scenario: Mutex and semaphore are set

  • WHEN uv run devops ci --check --only k8s runs
  • THEN The k8s check exits 0 and reports no error for the resolve mutex, the steward semaphore and its limit.

Requirement: Resolve retries only exit 75

The roadmap-resolve WorkflowTemplate SHALL set retryStrategy to retry exit code 75 only.

Scenario: Retry expression names exit 75 only

  • WHEN uv run devops ci --check --only k8s runs
  • THEN The k8s check exits 0 and reports no error for the resolve retry rule.

Requirement: Resolve objects carry ADR 0022 labels

The roadmap-resolve WorkflowTemplate and CronWorkflow SHALL carry the four ADR 0022 labels, and the template SHALL set them in spec.podMetadata.labels.

Scenario: Objects carry the common labels

  • WHEN uv run devops ci --check --only k8s runs
  • THEN The k8s check exits 0 and reports no error for the resolve labels and the pod metadata labels.

Requirement: Resolve configuration keys exist

ConfigMap devops-cli-config SHALL define roadmap.resolve.mode with value plan, roadmap.resolve.repos with the repository list of the setting service.repos, and roadmap.resolve.limit with value 5.

Scenario: Resolve configuration keys are present

  • WHEN uv run devops ci --check --only k8s runs
  • THEN The k8s check exits 0 and reports no error for the resolve ConfigMap keys.

Requirement: Main container holds no API token

The roadmap-resolve WorkflowTemplate SHALL give no API token to its main container.

Scenario: Main container has no API token

  • WHEN uv run devops ci --check --only k8s runs
  • THEN The k8s check exits 0 and reports no error for the main-container token rule.

Requirement: Admission policy does not reject the resolve objects

The rendered roadmap-resolve objects SHALL contain no Job, and the roadmap-service-jobs admission policy SHALL not reject them.

Scenario: Policy does not reject the resolve objects

  • WHEN uv run devops ci --check --only k8s runs
  • THEN The k8s check exits 0 and reports no error for the admission-policy scope.

Requirement: Server-side dry run accepts the render

The rendered roadmap-resolve objects SHALL pass a server-side dry run.

Scenario: Dry run accepts the resolve objects

Requirement: Pending a person after the merge

The owner SHALL merge the pull request that changes the steward limit.

Scenario: Owner merges the limit change

  • WHEN The pull request passes its checks
  • THEN The owner merges it.

Requirement: Pending a person after the merge

The first scheduled roadmap-resolve run after the merge SHALL write its plan to Loki and nothing to GitHub.

Scenario: First scheduled run in plan mode

  • WHEN The first scheduled run after the merge completes
  • THEN Loki holds the plan lines and GitHub shows no new comment or label from the run.

Existing Tool Considered

argoproj/argo-workflows (https://github.com/argoproj/argo-workflows), Apache-2.0, maintained, verdict in-use: the repository already runs Argo Workflows, and ADR 0021 and ADR 0008 chose it. The alternatives check in the issue body records what the tool covers and lacks. This change adds only what the tool lacks: the roadmap.resolve.mode, roadmap.resolve.repos and roadmap.resolve.limit keys of ConfigMap devops-cli-config, the ADR 0022 labels, the admission-policy scope and the no-token rule of the main container. #4808 supplies the plan-mode and gold-set gate logic and the gateway-key answer step.

Key questions

  • Does the owner decision of 2026-11-13 keep this scope with the steward semaphore at 1?: Yes. The owner decision keeps the scope, and ADR 0021 admits 1 pod of the rows resolve and split through steward. (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]
    • Chosen: Keep the scope and set steward to 1. The owner decision keeps the scope, and ADR 0021 admits 1 pod of resolve and split.
    • Rejected: Reduce the scope to a plain schedule. The owner decision keeps the scope.
    • Rejected: Use the agent semaphore. ADR 0021 assigns the resolve row to steward.
  • Which schedule and synchronization does ADR 0021 give the resolve row?: A CronWorkflow roadmap-resolve with schedules: ['15 */4 * * *'] in UTC, concurrencyPolicy: Forbid, startingDeadlineSeconds: 3600, mutex resolve and semaphore steward. (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]
    • Chosen: Argo CronWorkflow roadmap-resolve with the ADR 0021 row settings. ADR 0021 names the resolve row, its four-hour schedule, its mutex and its steward semaphore.
    • Rejected: Kubernetes CronJob. ADR 0021 moves the roadmap rows to Argo Workflows.
    • Rejected: A schedule inside the Service pod. ADR 0021 keeps only the webhook router in the Service.
  • Who merges the pull request that changes the steward limit?: The owner merges the pull request. Only a person merges pull requests, and this change changes a limit. (best practice) [sources: AGENTS.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: The owner merges the pull request. AGENTS.md reserves merges to a person, and ADR 0021 makes a limit change an owner decision.
    • Rejected: An agent merges the pull request. AGENTS.md forbids it.
    • Rejected: Automatically merge after the checks pass. AGENTS.md forbids it.
  • Which exit code does the retryStrategy retry?: Exit code 75 only. A model refusal is not a temporary fault. (best practice) [sources: CONTEXT.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: Retry exit code 75 only. CONTEXT.md names exit 75 for a later try, and ADR 0021 tries again a pod that exits with 75.
    • Rejected: Retry every failed step. A model refusal is not a temporary fault.
    • Rejected: Do not retry. A temporary fault needs a later try.
  • Which mode does the resolver use on its first scheduled runs?: Plan mode. The key roadmap.resolve.mode is plan, and the row stays in plan until the gold-set gate of the answer child (feat(roadmap): the question resolver answers with verified sources #4808) passes. (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]
  • Which ConfigMap keys configure the resolver?: roadmap.resolve.mode with value plan, roadmap.resolve.repos with the repository list of the setting service.repos, and roadmap.resolve.limit with value 5, in ConfigMap devops-cli-config. (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: The three roadmap.resolve.* keys in devops-cli-config. ADR 0021 names roadmap.<row>.mode and roadmap.resolve.repos, and bounds a run to 5 items.
    • Rejected: Environment variables only. The issue body names ConfigMap keys.
    • Rejected: Command-line flags only. The issue body names ConfigMap keys.
  • Which repositories does roadmap.resolve.repos list?: The repositories of the setting service.repos. ADR 0021 selects each repository of roadmap.resolve.repos, and the Service manages those repositories. (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: The repositories of service.repos. The Service manages those repositories, and the resolver must cover each of them.
    • Rejected: Only dan-petty/devops-cli. The setting service.repos can name more than one repository, so one repository would leave gaps.
    • Rejected: All repositories of the owner. The Service must not run on a repository that it does not manage.
  • Which ConfigMap holds the steward semaphore?: ConfigMap roadmap-limits holds key steward with value 1. [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
  • How do the Workflow steps receive credentials?: The main container gets no API token. Each step gets only the Secret key that its job needs. feat(roadmap): the question resolver answers with verified sources #4808 gives the answer step only the gateway key DEVOPS_CLI_AI_API_KEY, and the deterministic and comment steps use the App key DEVOPS_CLI_SERVICE_GITHUB_APP_PRIVATE_KEY from Secret devops-cli. (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, src/devops_cli/config/constants.py, k8s/devops/roadmap-service/admissionpolicy.yaml]
    • Chosen: No token in the main container, and one Secret key for each step. ADR 0021 forbids an API token in the main container of an agent pod and gives each pod only the keys that its job needs.
    • Rejected: A GitHub token in the main container. The issue body and ADR 0021 forbid it.
    • Rejected: The App key in the answer step. The App key stays out of the model pod, and the answer step gets only the gateway key (feat(roadmap): the question resolver answers with verified sources #4808).
  • Does activeDeadlineSeconds belong to the CronWorkflow or the WorkflowTemplate?: The WorkflowTemplate. It is a WorkflowSpec field, and workflowtemplate-rag-ingest.yaml sets it there. (best practice) [sources: k8s/devops/workflowtemplate-rag-ingest.yaml, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
    • Chosen: The WorkflowTemplate. One template holds the bound for every Workflow it starts, and the existing rag-ingest template sets it there.
    • Rejected: The CronWorkflow. The CronWorkflow only references the template, so the bound would live in two places.
    • Rejected: Both. Two values could disagree, and the Workflow uses the template.
  • Does the CronWorkflow use schedule or schedules?: schedules, a list. ADR 0021 records that Argo v4.0 removed the singular schedule. [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
  • Which objects does the roadmap-service-jobs admission policy evaluate?: Only roadmap units that run as ServiceAccount roadmap-service. The resolve objects are a WorkflowTemplate and a CronWorkflow, so the policy does not evaluate them, and the server-side dry run is the admission gate. [sources: k8s/devops/roadmap-service/admissionpolicy.yaml, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
  • Which names and labels do the resolve objects carry?: Both objects are named roadmap-resolve. They carry app.kubernetes.io/name: devops-cli-job, app.kubernetes.io/component: roadmap-resolve, app.kubernetes.io/part-of: devops-cli-stack and app.kubernetes.io/managed-by: roadmap-service. The WorkflowTemplate also sets them in spec.podMetadata.labels. (best practice) [sources: docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.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: The ADR 0022 common labels on both objects and on spec.podMetadata.labels. ADR 0022 names the common labels of a roadmap object, and the pod metadata carries them to the pods.
    • Rejected: Only the app.kubernetes.io/name label. ADR 0021 needs the name label for the network policies, and ADR 0022 adds the other common labels.
  • Which validator proves the manifest and admission requirements?: uv run devops ci --check --only k8s checks the manifest invariants. kubectl apply --dry-run=server -k k8s/devops checks admission after feat(k8s): let Argo Workflows run roadmap pods in devops #4566. (best practice) [sources: tests/gate/k8s_checks/job_admission_policy.py, tests/invariants/test_k8s_manifests.py]
    • Chosen: uv run devops ci --check --only k8s and, after feat(k8s): let Argo Workflows run roadmap pods in devops #4566, the server-side dry run. The k8s check runs the manifest invariants, and the dry run checks admission.
    • Rejected: A new test that reads the manifests. A manifest criterion names a validator command, not a test that reads the file.
    • Rejected: Only the server-side dry run. It needs cluster access and does not cover the offline manifest invariants.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4558, #4566, #4792, #4808

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/feature
    scope/k8s
    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/feature. The feat prefix of the title gives the type.
    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P2-Medium. It automates a required process but depends on unresolved items and is not blocking other work.
    • Value: Medium. It removes manual runs of the question resolver, but the resolver itself must pass its gold-set gate first.
    • Effort: Low. The body states about 50,000 tokens and 1.5 hours for the manifests and ConfigMap keys.
    • Related: feat(roadmap): run the reconcile sweep on a cluster schedule #4574, which asks for a different change. Both add a CronWorkflow for a roadmap job with Forbid concurrency, but #4574 delivers the reconcile sweep and this candidate delivers the question resolver.
  4. added
    priority/p2-medium
    on Nov 11, 2026
  5. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Scope update from the Service step jobs plan (#5014).

    The owner asked on 2026-11-12 for a separate job for each step that the Service jobs run the same way every time. This issue is the resolve-schedule item of that plan. The plan is extract-first: each repeated step becomes one module and one command (devops roadmap step <name>) that every caller uses, and then the steps that cost most move to their own Jobs.

    Proposed title: feat(k8s): run the question resolver on a schedule

    Problem (plan evidence)

    #4809 runs the question resolver as a CronWorkflow every 4 h. The Argo-native design made resolve a unit for each item and gave its model pod a GitHub token that no step can safely make (plan review). ADR 0021:96 has each pod make its own installation token, which would put the App key in a model pod.

    Added scope

    Keep #4809 as a CronWorkflow (ADR 0023 form, not a unit). Add: a deterministic step puts the issue text and the clone at a pinned SHA on the Workflow volume; the answer step (#4808) gets the gateway key only and no GitHub token; a comment step with the App key posts the marked comment. The question record of question-record and a trusted issue_comment (#4415) set its due mark.

    Cost: as #4809 states.

    Added acceptance

    Merge first

    Coordination

    #4780 stays the parent. The resolver stays the stewards CronWorkflow, not a unit for each item.

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

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: The issue already names Argo Workflows CronWorkflows and synchronization as the installed tool, and ADR 0021/AD 0008 chose Argo Workflows as the roadmap engine over plain CronJobs. Its CronWorkflow, WorkflowTemplate and synchronization features cover the scheduling, mutual exclusion and retry/deadline needs of the issue, so no new tool is needed.

    The repository already uses this tool.

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

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

    Covers:

    • CronWorkflow with a cron schedule and timezone
    • concurrencyPolicy: Forbid for one run at a time
    • mutez and semaphore synchronization across Workflows
    • WorkflowTemplate resue and per-step retryStrategy
    • activeDeadlineSeconds for a bound on one run

    Lacks:

    • The ConfigMap keys roadmap.resolve.mode, .reps and .limit are project configuration, not a tool feature
    • The ADR 0022 labels and the admission policy are repository-specific manifests
    • Plan mode and the gold-set gate are resolver application logic, not scheduling

    Tools considered:

    Searches run:

    • Argo Workflows CronWorkflow mutex semaphore concurrencyPolicy schedule, results: 5
    • argo-workflows.readthedocs.io cron-workflows synchronization mutex semaphore documentation, results: 5

    Sources:

    Checked on 2026-11-14. 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 15, 2026

    @devops-cli-service
    Contributor

    Owner question: Who merges the pull request that changes the steward limit? (a person decides)

    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

  8. devops-cli-service commented on Nov 19, 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 24, 2026

    @dan-petty
    OwnerAuthor

    The owner merges the pull request. Only a person merges pull requests (AGENTS.md).

  10. devops-cli-service commented on Nov 24, 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

  11. devops-cli-service commented on Nov 26, 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/lowpriority/p2-mediumscope/k8ssource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions