Skip to content

feat(roadmap): supervise gives an incident P0 item extra resources #5511

Open

Description

@dan-petty

Problem or Motivation

A P0 item waits in the same queues as other work, and nobody measures the time from a P0 item to a merged PR. D10 of the approved pipeline split design (tracker #5482) gives extra resources only to the incident classes, under a daily cap. The supervise job of #5477 holds work when an SLO budget is spent. This item adds the D10 rule to that job.

Proposed Solution & Architectural Design

Target Subsystem

Roadmap Service and roadmap jobs (src/devops_cli/roadmap/steps/).

Acceptance Criteria

  • Test first: an incident P0 gets the next tier and 2 times the caps; an inherited P0 gets order only. The test fails on the base.
  • A test: the fourth extra attempt is refused.
  • A test: spend over the daily cap stops the extras.
  • Live proof: after the merge and the release, the weekly drill item runs as the App. A comment on this issue gives the result lines, the time to a PR and the extra spend.

Existing Tool Considered

Argo Workflows priority and semaphores (installed) and the tier ladder exist. No open tool applies these rules. Build: 200,000 to 400,000 agent tokens and 0.5 to 1 day. The owner sets the daily cap (D9).

Related

Tracker #5482, Phase 5 (last). Depends on #5477 (the incident and supervise jobs), #5510, #4566 (Argo priority) and #5440 (limits as settings). #5246, #5445 (the SRE specification), #4871, #5177, #4843.

Source: #5482

Dependencies

Proposed design

Problem statement

Do not start this item until #6521 closes; it also needs #5477, #5510, #4566 and #5440. The supervise job of #5477 holds work when an SLO budget is spent, but it gives no extra resources to a P0 item. D10 of the approved pipeline split design (tracker #5482) gives extra resources only to incident P0 items. The extra resources are under a daily cap. An inherited P0 item gets order only. This change adds the D10 rule to the supervise job. After the merge and the release, a comment on the issue gives the result lines, the time to a PR and the extra spend.

Acceptance criteria

Requirement: Test first

The change MUST add a test module that fails on the base commit and passes with the D10 policy.

Scenario: New test fails on the base

  • WHEN A person adds tests/roadmap/steps/test_supervise_p0.py to the base commit and runs uv run pytest tests/roadmap/steps/test_supervise_p0.py.
  • THEN pytest exits non-zero with an import error for the policy module, and the same command passes after the change.

Requirement: Each P0 item at each pass

The supervise job SHALL apply the D10 policy to each open P0 item at every pass and again after each unit result of a P0 item.

Scenario: Two items and one unit result

  • WHEN A unit test runs a supervise pass that reads two open P0 items and then returns a unit result for one of them.
  • THEN The policy runs for both items in the pass and runs again for the returned item after the unit result.

Requirement: Incident P0 allocation

The supervise job SHALL give an incident P0 item the Argo priority, the next model tier, doubled soft caps within each ceiling, high effort and at most three extra attempts.

Scenario: Incident class

  • WHEN A unit test calls the D10 policy for an incident P0 item with a known model ladder, soft caps and ceilings.
  • THEN The policy returns a positive Argo spec.priority, the tier after the current one, 2 times each soft cap with no value above its ceiling, effort high, and an extra-attempt limit of 3.

Requirement: Last ladder tier

The supervise job SHALL keep the current model tier when the configured ladder has no tier after it.

Scenario: Last tier

  • WHEN A unit test calls the D10 policy for an incident P0 item whose current tier is the last of its ladder.
  • THEN The policy returns the current tier and grants the other extras.

Requirement: Inherited P0 order only

The supervise job SHALL give an inherited P0 item only the positive Argo spec.priority.

Scenario: Inherited class

  • WHEN A unit test calls the D10 policy for a P0 item that comes from inheritance.
  • THEN The policy returns a positive Argo spec.priority and keeps the model tier, the soft caps, the effort and the attempt limit as they are.

Requirement: No PriorityClass

The supervise job MUST NOT set a Kubernetes PriorityClass on a P0 item's job.

Scenario: Argo priority only

  • WHEN A unit test calls the D10 policy for an incident P0 item and for an inherited P0 item.
  • THEN Neither result holds a priorityClassName and both hold an Argo spec.priority.

Requirement: Fourth extra attempt refused

The supervise job SHALL refuse a fourth extra attempt for an incident P0 item in one UTC day.

Scenario: Extra attempt limit

  • WHEN An incident P0 item has used three extra attempts in the UTC day and the policy considers a fourth.
  • THEN The policy refuses the fourth attempt and records supervise.capped as true.

Requirement: Daily spend cap

The supervise job SHALL stop the extra resources when the new tokens of the extra P0 attempts in the UTC day reach roadmap.supervise.daily_extra_spend_cap.

Scenario: Spend at the cap

  • WHEN A unit test sets the new tokens of the extra P0 attempts in the UTC day to the roadmap.supervise.daily_extra_spend_cap value.
  • THEN The policy grants no extra attempt and records supervise.capped as true.

Requirement: Cap writes the person cause

The supervise job SHALL write the person cause supervise_cap at a cap only after the fixable check finds no fixable failure.

Scenario: Capped item with no fixable failure

  • WHEN An incident P0 item reaches the extra-attempt cap or the daily spend cap and the fixable check finds no fixable failure.
  • THEN The policy writes the person cause supervise_cap and supervise.capped is true.

Requirement: Fixable failure blocks the cap cause

The supervise job SHALL NOT write supervise_cap while the fixable check finds a fixable failure.

Scenario: Capped item with a fixable failure

  • WHEN An incident P0 item reaches the extra-attempt cap or the daily spend cap and the fixable check finds a fixable failure.
  • THEN The policy writes no supervise_cap cause.

Requirement: Settings read at each use

The supervise job SHALL read the P0 resource settings at each use.

Scenario: Changed cap between calls

  • WHEN A unit test changes roadmap.supervise.daily_extra_spend_cap in the settings object between two policy calls.
  • THEN The second call uses the new cap.

Requirement: Job record keys

The supervise job SHALL write supervise.attempts, supervise.comment_id and supervise.capped to the item's job record.

Scenario: Job record after a grant

  • WHEN The supervise job grants an extra attempt and posts one comment.
  • THEN The job record holds the attempt count, the comment id and the capped flag.

Requirement: New settings declared and documented

The change MUST declare roadmap.supervise.extra_attempts and roadmap.supervise.daily_extra_spend_cap as Variable() settings and add both variable names to the census of tests/security/test_config_declarations.py.

Scenario: Settings documents current

  • WHEN A person runs uv run pytest tests/security/test_config_declarations.py and uv run devops ci docs after the change.
  • THEN Both commands pass and docs/CONFIGURATION.md shows the supervise row with both fields.

Existing Tool Considered

No alternatives check has run on this issue. Argo Workflows (Apache-2.0, maintained, in use) gives workflow priority, semaphores and retry strategies. ADR 0008 and ADR 0021 record its use. It lacks the D10 policy. It does not classify an incident P0, choose a model tier or an effort, or double a soft cap. It does not count the extra attempts, stop them at a daily spend cap or write the supervise_cap person cause. The change builds that policy in the supervise step of the roadmap jobs. Written cost: 200,000 to 400,000 agent tokens and 0.5 to 1 day.

Key questions

  • Which P0 items get extra resources?: Only incident P0 items get extra resources: an SLO or alert trigger, or a red required check on main. An inherited P0 item gets the Argo priority only. (best practice) [sources: docs/guidelines/sre.md, docs/guidelines/agentic-jobs.md]
    • Chosen: Incident classes only. D10 gives extra resources only to the incident classes and gives an inherited P0 item order only.
    • Rejected: All P0 items. It gives extra resources to an inherited P0 item and exceeds D10.
    • Rejected: No P0 item. It leaves a P0 item in the same queue and misses D10.
  • How are the cap values set?: Add a roadmap.supervise section to RoadmapConfig at src/devops_cli/config/settings.py:2183. Set extra_attempts to 3 and daily_extra_spend_cap to 0, both as Variable() fields. Add both variable names to the census of tests/security/test_config_declarations.py. The job reads both at each use, so one ConfigMap edit changes them. Ship daily_extra_spend_cap at 0 until the owner sets a value after the D9 A/A pass. The tests use a small configured cap. uv run devops ci docs keeps docs/CONFIGURATION.md current. (best practice) [sources: src/devops_cli/config/settings.py:2183, tests/security/test_config_declarations.py, docs/CONFIGURATION.md]
    • Chosen: A roadmap.supervise settings section. A person changes a cap with one ConfigMap edit and no code change. The census test and uv run devops ci docs keep it declared and documented.
    • Rejected: Hard-coded constants. A person cannot change a cap with one ConfigMap edit.
  • Where does the cap write the person cause?: At the cap, and only after the fixable check finds no fixable failure. The typed cause is supervise_cap. (best practice) [sources: docs/guidelines/agentic-jobs.md, docs/TELEMETRY.md, src/devops_cli/telemetry/instruments.py]
    • Chosen: Write the cause after the fixable check. AW-T5 runs a fixable check before a job refuses work at a cap.
    • Rejected: Write the cause at the cap at once. It writes a person cause for a failure that a retry can fix.
  • How does a P0 item get the first place, and does it use a PriorityClass?: It sets a positive Argo Workflow spec.priority, above the default 0, and sets no Kubernetes PriorityClass. The admission policy roadmap-service-jobs refuses a priorityClassName on a Job that the Service creates, so Argo priority is the order control. (best practice) [sources: docs/CLUSTER.md, k8s/devops/roadmap-service/admissionpolicy.yaml]
    • Chosen: Argo spec.priority only. The admission policy refuses a priorityClassName on a Job of the Service, and the issue names Argo priority.
    • Rejected: Kubernetes PriorityClass. The admission policy refuses priorityClassName, so the Job create fails.
    • Rejected: Both controls. The PriorityClass part is refused and adds nothing to the order.
  • What is the next model tier when the ladder has no tier after the current one?: Take the next entry of roadmap.implement.ladder[<step class>], weakest first. If the current tier is the last, keep it and grant the other extras. Do not hard-code a model tier. (best practice) [sources: src/devops_cli/config/settings.py, docs/CONFIGURATION.md]
    • Chosen: Next configured tier, and the last tier stays. The configured ladder is the tier control of the job, and its default has one tier, so the last tier stays.
    • Rejected: A fixed model tier in the code. It bypasses the configured ladder and the owner's model choice.
    • Rejected: Never change the tier. It misses D10 when the ladder has a next tier.
  • Which soft caps double, and may the doubled value pass a ceiling?: Double repair_rounds, step_token_budget, item_token_budget, step_time_limit_seconds and item_time_limit_seconds, and clamp each to its ceiling: step_token_ceiling and deadline_ceiling_seconds. A cap with no ceiling doubles. The item time limit stays at or below deadline_ceiling_seconds. (best practice) [sources: docs/guidelines/agentic-jobs.md, src/devops_cli/config/settings.py, src/devops_cli/config/settings.py:1663, docs/ROADMAP_WORKFLOW.md]
    • Chosen: Double each soft cap and clamp at its ceiling. It gives 2 times the soft cap without breaking AW-T5 and the nested limits of the settings.
    • Rejected: Double with no ceiling. It breaks AW-T5 and the settings validators, such as the item time limit above deadline_ceiling_seconds.
    • Rejected: Do not double. It misses the D10 allocation.
  • How is the daily extra spend measured?: Count the new tokens of the extra P0 attempts in the UTC day. New tokens are the input tokens that the provider did not read from its cache plus the output tokens. They are the unit of step_token_budget and item_token_budget. The implement job records those counts in implement.spend as new_tokens. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, src/devops_cli/config/settings.py]
    • Chosen: New tokens. It is the unit of the existing token budgets and of the item's spend record, and it does not move with a price change.
    • Rejected: US dollars from the spend ledger. The cost depends on pricing and is 0 for a local model, and the ledger has no item id to attribute an extra attempt.
    • Rejected: Request count. The size of a request varies, so a count does not cap spend.
  • How does an extra attempt wait after a failure?: It uses the wait of its failure class in RETRY_AFTER of src/devops_cli/roadmap/failure.py:185. The change adds no new wait. (best practice) [sources: src/devops_cli/roadmap/failure.py:185, docs/CLUSTER.md]
    • Chosen: Reuse RETRY_AFTER. The project has one wait table for each failure class.
    • Rejected: Add a wait for the supervise job. It adds a second wait table for the same failure classes.
  • Does the item continue while chore(roadmap): hold incremental stage and implement work #6521 is open?: No. The owner froze the item on 2026-11-20 for the re-architecture of tracker refactor(roadmap): re-architect stage and implement on Coder #6519. chore(roadmap): hold incremental stage and implement work #6521 is the hold issue. feat(roadmap): add incident and supervise jobs that read the SLOs #5477, feat(roadmap): a blocker inherits the priority of what it blocks #5510, feat(k8s): let Argo Workflows run roadmap pods in devops #4566 and feat(roadmap): make the attempt limits of the failing jobs settings #5440 are dependencies. A person closes chore(roadmap): hold incremental stage and implement work #6521 to continue the item, or closes the item as not planned. (best practice) [sources: docs/roadmap/refine.md]
  • Where does the D10 policy live?: Add the policy as a function in a new supervise step module, src/devops_cli/roadmap/steps/supervise.py, beside the other step modules. Test it offline with no cluster. The step of feat(roadmap): add incident and supervise jobs that read the SLOs #5477 calls the function at each pass and after each unit result. (best practice) [sources: src/devops_cli/roadmap/steps/fix_checks.py, src/devops_cli/roadmap/steps/init.py]
    • Chosen: A function in a new supervise step module. The roadmap steps live one module each under src/devops_cli/roadmap/steps/, so the policy sits with its step and a unit test checks it offline.
    • Rejected: Inside failure.py. That module holds the failure classes and their waits, not a resource policy.
    • Rejected: A separate package under src/devops_cli/roadmap/. It adds a package for one function that one step calls.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#6521, #5477, #5510, #4566, #5440

Alternatives check of 2026-11-23: 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-23, maintained.
Reason: Searches found no open tool that applies the D10 policy. Argo Workflows, already in use, gives workflow priority ordering, semaphores and retries, but none of the incident P0 resource rules, so it covers only part of the need.

Covers:

  • Positive workflow priority through spec.priority
  • Semaphores and concurrency limits for ordering queued work
  • Retry strategies and limits per workflow step

Lacks:

  • No incident P0 classification, no inherited-P0 rule
  • No model tier or effort selection
  • No doubling of soft caps within ceilings
  • No daily extra-spend cap or supervise_cap cause

Activity

  1. added
    source/agent
    on Nov 13, 2026
  2. added
    type/feature
    scope/roadmap
    status/new
    value/high
    effort/medium
    on Nov 13, 2026
  3. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 13, 2026
  5. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Owner question: What daily cap does the owner set for extra P0 spend? (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

  6. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.

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

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

  9. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (9)

    Tools considered:

    Searches run:

    • Argo Workflows workflow priority semaphore retry strategy, results: 5
    • open source tool automatic resource prioritization SLO incident budget cap, results: 5
    • Keptn SLO-driven remediation Kubernetes tool, results: 5
    • argo-workflows priority field spec.priority documentation, results: 5
    • argoproj argo-workflows github, results: 5
    • Kueue Kubernetes job queueing priorities quotas, results: 5
    • Kyverno policy enforce retry limits and spend caps on jobs, results: 5
    • kubernetes-sigs kueue, results: 5
    • argo-workflows docs workflow spec priority semaphores, results: 5

    Sources:

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/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions