Skip to content

feat(roadmap): run intake and scoped intake in their own pods #4567

Open

Description

@dan-petty

Problem or Motivation

Scoped intake takes 64 s at p50 and 194 s at p99, with the wait for the one model slot of the Service process. The scoped queue is in memory, so a rollout drops each queued update. About 240 scoped updates run a day. Batch intake runs in the Service pod and dies with each rollout.

Proposed Solution & Architectural Design

Removes: the triage lane, enqueue_scoped and _pending_scoped (src/devops_cli/server/service.py:467,500-585), the in-pod body of _run_intake_adapter (run.py:473-506), the use of model_call_slot in the Service.

Target Subsystem

SDLC, Git & PR Governance (roadmap intake, webhook router).

Existing Tool Considered

Argo Workflows mutex and semaphore; Kubernetes API create from the router. WorkflowEventBinding and Argo Events are rejected in the ADR of the move (they duplicate the router). Cost: about 120,000 tokens and 6 hours to build, about 10,000 tokens a month to keep, about 20,000 tokens to fix. About 240 pods a day, each with cold GitHub reads.

Acceptance Criteria

  • An opened issue gets one intake unit within 15 s of the delivery (router log and the creation time).
  • A batch and a scoped intake of one repository never write the intake record at the same time.
  • A repeated delivery makes no second unit; a failed create leaves a due mark and no delivery key.
  • The ADR 0017 behaviours stay: no last success from a scoped update; the record keeps every other entry.
  • Measure: delivery to decision for scoped intake, p50 of 60 s or less; accepted issues deliveries against intake units, no loss.

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: Searches and the repository facts confirm Argo Workflows, the engine that ADR 0021 and ADR 0008 chose and the issue already names. Its template mutex, semaphore and deadline run each intake in its own pod. The router, the due selection and the ADR 0017 record rule stay project code.

Covers:

  • Pod for each run, with retries and a deadline
  • Mutex on the WorkflowTemplate, so every unit of one repository takes it
  • Semaphore to hold the triage concurrency at 1
  • Queued work behind a mutex, so a rollout loses no unit

Lacks:

  • No webhook receiver, HMAC check or delivery dedupe
  • No router scoped sweep and no due selection
  • No intake record, so the ADR 0017 rules stay in project code
  • Needs the Kubernetes create from the router and the Valkey state

Owner decision 2026-11-13

The approved pipeline split (tracker #5482) makes this pod the triage unit: intake, the retitle summary (#5507) and premise (#5508), at most 5 items for each pass, semaphore triage 1, no clone. No due mark: the router runs a scoped sweep, and due_jobs selects the items. A placed P0 sets no refine mark; refine is due by its predicate. It waits for #4565 and #4566.

Proposed design

Problem statement

The Service pod runs batch intake and scoped intake. A rollout stops batch intake and drops each queued scoped update, because the scoped queue is in memory. Scoped intake waits for the one model slot of the Service and takes 64 s at p50 and 194 s at p99. This item moves the triage unit to WorkflowTemplate roadmap-intake on Argo Workflows. The triage unit runs intake, the retitle summary and the premise for at most 5 items. The router starts one scoped sweep, and the due selection picks the items.

Acceptance criteria

Requirement: Intake template synchronization

WorkflowTemplate roadmap-intake SHALL carry the mutex intake-<owner>.<name>, the semaphore triage with a limit of 1, and a deadline of 900 s for a batch pass or 600 s for a one-item pass.

Scenario: Template fields

  • WHEN The k8s check runs uv run devops ci --check --only k8s on the change.
  • THEN The check passes with WorkflowTemplate roadmap-intake carrying the mutex intake-<owner>.<name>, the semaphore triage at 1, and the 900 s batch deadline or the 600 s one-item deadline.

Requirement: Intake template runs no clone

WorkflowTemplate roadmap-intake MUST run no git clone step.

Scenario: No clone step

  • WHEN The k8s check runs uv run devops ci --check --only k8s on the change.
  • THEN The check passes with WorkflowTemplate roadmap-intake carrying no git clone step.

Requirement: Triage selection cap

The triage unit MUST take at most 5 items in one pass.

Scenario: Six candidates

  • WHEN A test gives six candidates to the triage selection with DEFAULT_ROADMAP_INTAKE_LIMIT.
  • THEN The selection returns five candidates.

Requirement: Triage unit runs retitle and premise

The triage unit SHALL run the intake selection, the retitle summary and the premise for each selected item.

Scenario: One selected item

  • WHEN A test runs the triage unit for one selected item with a fake intake selection, a fake retitle step and a fake premise step.
  • THEN The fake intake selection records the item, and the fake retitle step and the fake premise step each record one call for the item.

Requirement: Hold writes no intake due key

During a hold, the router MUST start no scoped sweep and MUST write no intake due key.

Scenario: Hold active

  • WHEN A signed issues opened delivery arrives for a managed repository during a hold.
  • THEN The fake service manager records no scoped sweep, and the fake due store records no roadmap:v1:due:<owner>/<name>:intake key.

Requirement: Router starts one scoped sweep

For an issues opened, edited or reopened delivery, the router MUST start one scoped sweep for the repository and MUST write no intake due key.

Scenario: Opened issue delivery

  • WHEN A signed issues opened delivery arrives for a managed repository and no hold is active.
  • THEN The fake service manager records one scoped sweep for the repository, and the fake due store records no roadmap:v1:due:<owner>/<name>:intake key.

Requirement: Due selection submits the triage unit

The scoped sweep MUST select the intake items with run_due_jobs and _intake_due, and the intake row MUST submit one roadmap-intake unit for them.

Scenario: Due jobs selection

  • WHEN A test runs run_due_jobs for a repository with one candidate and one new issue.
  • THEN The intake row is due and its fake unit creator records one roadmap-intake unit.

Requirement: Repeated delivery is idempotent

A repeated issues delivery ID MUST NOT create a second scoped sweep or a second triage unit.

Scenario: Duplicate delivery ID

  • WHEN The router receives the same delivery ID two times.
  • THEN The router records the second delivery as a duplicate, and one scoped sweep and one triage unit exist.

Requirement: Failed unit create counts a failure

When the create of the triage unit fails, the intake row MUST count one failure, MUST write no intake due key and MUST write no delivery key.

Scenario: Unit create fails

  • WHEN The intake row submits a roadmap-intake unit and the Kubernetes create returns an error.
  • THEN The row counts one create failure, the fake due store records no roadmap:v1:due:<owner>/<name>:intake key, and the fake delivery store records no delivery key.

Requirement: One intake writer for each repository

A batch intake and a scoped intake of one repository MUST NOT write the intake record at the same time.

Scenario: Both units take the template mutex

  • WHEN A test builds a batch intake unit and a scoped intake unit for one repository.
  • THEN Both units come from WorkflowTemplate roadmap-intake, whose mutex is intake-<owner>.<name>.

Requirement: Intake row submits only for work

The intake row MUST submit a roadmap-intake unit only when the due rule selects a candidate or a new issue.

Scenario: No selected item

  • WHEN The intake row runs for a repository and _intake_due selects no candidate and no new issue.
  • THEN The row submits no workflow, and its fake unit creator records no unit.

Requirement: No refine mark from a placed P0

A placed P0 or critical fix MUST NOT write a refine due key or a refine_due stamp, and the refine row MUST stay due by its own rule.

Scenario: Critical fix placed

  • WHEN The triage unit places a P0 item that fixes a defect.
  • THEN The unit writes no refine_due stamp and no roadmap:v1:due:<owner>/<name>:refine key, and the refine row is due in the same round by its own rule.

Requirement: Scoped intake keeps the ADR 0017 record rule

A scoped intake MUST NOT write a last success entry and MUST keep every other entry of the intake record.

Scenario: Scoped intake writes the record

  • WHEN A scoped intake writes the intake record of a repository.
  • THEN The record has no new last success entry and keeps every other entry.

Requirement: Service triage lane and scoped queue removed

The change MUST remove TRIAGE_LANE_ROWS, _SCOPED_INTAKE, enqueue_scoped and _pending_scoped, and MUST keep the intake row in DEFAULT_DUE_TABLE.

Scenario: Removed intake names are absent

  • WHEN A test imports devops_cli.roadmap.run and devops_cli.server.service and looks up each removed name.
  • THEN The lookup finds none of TRIAGE_LANE_ROWS, _SCOPED_INTAKE, enqueue_scoped and _pending_scoped, and DEFAULT_DUE_TABLE holds the intake row.

Requirement: Triage runs in a unit, not in the Service process

The triage work MUST run as a roadmap-intake unit and MUST NOT call plan_intake or take the Service model_call_slot.

Scenario: Intake adapter submits a unit

  • WHEN A test runs _run_intake_adapter for a due intake row with a fake unit creator and a fake model slot.
  • THEN The fake unit creator records one roadmap-intake unit, the adapter calls no plan_intake, and the fake model slot records no take.

Requirement: Pending a person after the merge

After the merge and the release, a person SHALL run the triage unit as the App on the issues opened in the last 7 days and SHALL report the delivery-to-decision measure.

Scenario: Live proof

  • WHEN The change merges and releases.
  • THEN The person adds a result comment with one result line for each issue opened in the last 7 days, the p50 delivery-to-decision time of the scoped intakes, and the count of accepted issues deliveries against the triage units.

Existing Tool Considered

Argo Workflows (argoproj/argo-workflows, Apache-2.0, maintained) is the open tool. The alternatives check of 2026-11-26 in the issue body gives the verdict in-use, and the repository already uses the tool. The block of that check lists what the tool covers and lacks. This proposal uses the engine for the pod-per-run execution and the template mutex, semaphore and deadline. Project code supplies the router scoped sweep and the due selection. It supplies the triage unit submission, the removal of the Service lane and queue, and the ADR 0017 record rule. The project code for those parts costs about 120,000 tokens and 6 hours to build. It costs about 10,000 tokens a month to keep and about 20,000 tokens to fix, as the issue body states.

Key questions

  • Which component runs the triage unit?: Argo Workflows runs the triage unit as a pod from WorkflowTemplate roadmap-intake. The template holds the mutex intake-<owner>.<name>, the semaphore triage at 1 and the deadline of its run type. The project builds no workflow engine. (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/roadmap/job_launcher.py]
    • Chosen: Argo Workflows pod. ADR 0021 section 2 puts intake and scoped intake in the unit table, and the project already runs the controller.
    • Rejected: Service poll. It keeps the in-memory queue and dies with each rollout.
    • Rejected: Argo Events. It adds a second webhook receiver beside the router, and ADR 0021 rejects it.
  • What does the router do for an issues delivery?: It starts one scoped sweep for the repository and writes no intake due key. During a hold, it starts no sweep and writes no intake due key. The sweep runs run_due_jobs with _intake_due, and the intake row submits the triage unit. (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, src/devops_cli/server/routes/webhooks.py, src/devops_cli/roadmap/run.py]
    • Chosen: Router starts a scoped sweep. The owner decision of 2026-11-13 sets it, and the due selection of the sweep picks the items.
    • Rejected: Intake due mark. The owner decision of 2026-11-13 removes the intake due mark.
    • Rejected: Direct unit create from the router. The owner decision of 2026-11-13 replaces it with a scoped sweep whose due selection picks the items.
  • Where does the mutex intake-<owner>.<name> live?: On WorkflowTemplate roadmap-intake. Every unit of one repository takes that mutex, and no caller can skip it. (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, docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md, docs/adr/0017-each-subscribed-webhook-event-runs-the-update-scoped-to-it.md]
    • Chosen: WorkflowTemplate mutex. Every unit of one repository takes the same mutex, and no caller can skip it.
    • Rejected: Workflow mutex. A caller can create a Workflow without the mutex.
    • Rejected: No mutex. A batch and a scoped intake can write the record at the same time.
  • What limit does the semaphore triage have?: 1. The owner decision of 2026-11-13 sets the triage unit to one pod. That limit replaces the 2 pods of ADR 0021 section 5. (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: 1 pod. The owner decision of 2026-11-13 sets 1 for this unit.
    • Rejected: 2 pods. ADR 0021 section 5 set 2 on 2026-11-11, before the 2026-11-13 owner decision.
  • How many items does one triage pass take?: At most 5 items. The default DEFAULT_ROADMAP_INTAKE_LIMIT is 5. (best practice) [sources: src/devops_cli/config/defaults.py:1010, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
    • Chosen: At most 5 items. The owner decision sets the cap, and ADR 0021 section 2 gives one batch of at most 5 candidates.
    • Rejected: Every candidate. It ignores the cap and spends a long batch.
    • Rejected: One item only. It runs no batch intake.
  • What steps does the triage unit run?: The triage unit runs the intake selection, the retitle summary and the premise for each selected item. It takes at most 5 items in one pass. (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/roadmap/run.py]
    • Chosen: Intake, retitle and premise in one unit. The owner decision of 2026-11-13 makes this pod the triage unit, and tracker feat(roadmap): track the roadmap pipeline split into jobs #5482 sets the pipeline split.
    • Rejected: Intake only. It leaves the retitle summary and the premise outside the triage unit.
    • Rejected: Separate pods for retitle and premise. It adds pods, and the owner decision sets one triage unit.
  • How does a placed P0 or critical fix reach refinement?: It writes no refine mark and no refine_due stamp. The refine row is due by its own rule, which makes refine due in the same round when the triage unit placed a critical fix or a P0 item. (best practice) [sources: src/devops_cli/roadmap/run.py]
    • Chosen: Refine predicate. The owner decision of 2026-11-13 removes the refine mark and leaves refine due by its predicate.
    • Rejected: Refine due key or refine_due stamp. The owner decision says no refine mark.
    • Rejected: DAG chain. It couples the workflows and keeps the pod alive, and ADR 0021 rejects DAG chains.
  • Does the item use Argo Events or WorkflowEventBinding?: No. The existing router starts the scoped sweep. ADR 0021 rejects Argo Events and WorkflowEventBinding as a second webhook path. (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/server/routes/webhooks.py]
    • Chosen: Existing router. It already verifies each delivery and starts a repository round.
    • Rejected: Argo Events. It adds a second receiver, a second HMAC check and at least 4 more pods.
    • Rejected: WorkflowEventBinding. It needs argo-server with a public route and repeats the router checks.
  • Which Service and roadmap code does this item remove?: It removes TRIAGE_LANE_ROWS, _SCOPED_INTAKE, enqueue_scoped, _pending_scoped, the in-pod body of _run_intake_adapter and its model_call_slot use. It keeps the intake row in DEFAULT_DUE_TABLE. [sources: src/devops_cli/roadmap/run.py:1284, src/devops_cli/roadmap/run.py:1414, src/devops_cli/roadmap/run.py:1333, src/devops_cli/server/service.py:467, src/devops_cli/server/service.py:500-585, src/devops_cli/roadmap/run.py:473-506]
  • What does due_jobs name?: The repository has no function due_jobs. The due selection is run_due_jobs, and the intake rule is _intake_due. [sources: src/devops_cli/roadmap/run.py]
  • Is fix(service): route issues webhooks past scoped intake #4412 still a dependency?: No. fix(service): route issues webhooks past scoped intake #4412 is merged and archived, and its routing is in SCOPED_UPDATES. This item replaces that routing. [sources: src/devops_cli/roadmap/run.py:1444, openspec/changes/archive/2026-11-11-4412-route-issues-webhooks-past-scoped-intake/proposal.md]
  • Which items must be delivered before this one?: feat(roadmap): keep schedules, intake and ledgers in Valkey #4565 (the Valkey state) and feat(k8s): let Argo Workflows run roadmap pods in devops #4566 (the engine). ADR 0021 section 7 puts them before the intake job, and the owner decision of 2026-11-13 sets the wait. WorkflowLauncher is the interface that feat(k8s): let Argo Workflows run roadmap pods in devops #4566 replaces. (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/roadmap/job_launcher.py]
  • Is the two-container template of feat(roadmap): the model container of a unit holds no credential #5506 available?: No. No WorkflowTemplate in k8s/devops/kustomization.yaml carries two containers at this commit. This part goes to a new issue and waits for feat(roadmap): the model container of a unit holds no credential #5506. [sources: k8s/devops/kustomization.yaml]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4565, #4566

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/feature
    scope/roadmap
    status/new
    value/high
    effort/high
    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 fixes data loss on rollouts and improves latency, but depends on two other items and is not a critical defect.
    • Value: High. Prevents loss of queued updates on every rollout and cuts scoped intake p50 from 64 s toward 60 s or less.
    • Effort: High. Requires a new Argo WorkflowTemplate, router changes, removal of existing Service code, and coordination with #4412.
    • Related: fix(service): route issues webhooks past scoped intake #4412, which asks for a different change. Both address webhook routing for scoped intake, but #4412 fixes specific routing gaps in the Service while the candidate moves all intake execution into dedicated pods and removes the triage lane.
  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 1db29f7 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.

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: src/devops_cli/server/service.py, src/devops_cli/server/routes/webhooks.py.

  6. added
    status/ready
    and removed
    status/new
    on Nov 12, 2026
  7. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: The searches surfaced no single tool that delivers the whole item; the closest is Argo Workflows, the Kubernetes-native workflow engine that ADR 0021/ADR 0008 already chose and that the issue names, which supplies the pod-per-run execution, the WorkflowTemplate mutex/semaphore and the template deadline, but not the webhook routing, delivery accounting or the durable due marks. Those remain the router's and Valkey's work, so it covers only part of the 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:

    • Runs each intake and scoped intake as a pod of its own, as a Kubernetes-native step/DAG workflow engine
    • WorkflowTemplate-level mutex intake-<owner>.<name> and semaphore triage, so batch and scoped intake of one repository share one writer and one concurrency cap
    • A template deadline (900 s batch, 600 s single issue) that ends a stuck intake pod

    Lacks:

    • Webhook HMAC verification, duplicate-delivery refusal and delivery-to-unit accounting: the project's router still has to create the intake unit
    • Durable due marks (roadmap:v1:due:<owner>/<name>:intake and :refine) for holds, failed creates and placed critical fixes; Valkey holds these
    • The intake-row rule that submits only when a candidate or new issue exists, and the removal of the Service triage lane, enqueue_scoped, _pending_scoped and model_call_slot
    • ADR 0017 behaviour (no last-success write from a scoped update, every other entry kept) is project logic, not something the engine enforces

    Tools considered:

    Searches run:

    • Argo Workflows mutex semaphore synchronization WorkflowTemplate, results: 5
    • Argo Workflows workflow runs each step in its own pod activeDeadlineSeconds, results: 5
    • argo-workflows docs synchronization mutex semaphore example, results: 5
    • argoproj argo-workflows github repository, results: 5
    • "argo work" workflows synchronization semaphore mutex kubernetes, results: 5
    • argo workflows readthedocs synchronization mutex semaphore workflowtemplate deadline, 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.

  9. added
    status/new
    and removed
    status/ready
    on Nov 25, 2026
  10. devops-cli-service commented on Nov 25, 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 27, 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/highpriority/p2-mediumscope/roadmapsource/agentstatus/newtype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions