Repository navigation
Description
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
- Add the D10 rule to the supervise job of feat(roadmap): add incident and supervise jobs that read the SLOs #5477 (no pod). It runs for each open P0 item at every pass, and after each unit result of a P0 item.
- An incident class of feat(roadmap): add incident and supervise jobs that read the SLOs #5477 (an SLO or alert trigger, a red required check on
main) gets: the first semaphore place (Argospec.priority), the next model tier, 2 times the soft caps, effort high, and at most 3 extra attempts under a daily cap of extra P0 spend. - A P0 from inheritance gets order only. No PriorityClass.
- The caps are settings
roadmap.<job>.*of feat(roadmap): make the attempt limits of the failing jobs settings #5440 and docs(adr): job limits are settings with a soft cap and a hard ceiling #5246. The jobs read them at each use, so a person changes them with one ConfigMap edit. - Reuse
failure.pyRETRY_AFTER,stop_clear.pyand the implement tier ladder. - Write
supervise.{attempts, comment_id, capped}. At the cap, write the person causesupervise_capafter the fixable check.
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
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Alternatives check of 2026-11-29: in-use.
The repository already uses this tool.
Tool: Argo Workflows (https://github.com/argoproj/argo-workflows), Apache-2.0, last activity 2026-11-29, maintained.
Reason: Argo Workflows already gives the order control and concurrency limits that the issue names, but it holds no D10 policy for incident against inherited P0 items, the next model tier, doubled caps or a daily extra-spend cap. The project must add that policy in the supervise step.
Covers:
- Workflow spec.priority orders queued workflows
- Semaphore and mutex synchronization limit concurrent work
- Templates and DAG steps run the roadmap jobs
Lacks:
- Incident against inherited P0 classification
- Next model tier, high effort and doubled soft caps
- Daily attempt and extra-spend caps with supervise_cap cause
- Per-item supervise job record keys
Proposed design
Problem statement
Do not start this item until #6521 closes. A P0 item waits in the same queues as other work, and nobody measures the time from a P0 item to a merged PR. The supervise job holds work when an SLO budget is spent but gives no extra resources to a P0 item. D10 gives extra resources only to incident P0 items under a daily cap; an inherited P0 item gets order only. This change adds the D10 rule to the supervise job and records the attempt count, the comment id and the cap flag.
Acceptance criteria
Requirement: Test first for the D10 policy
The change MUST add a test module at tests/roadmap/steps/test_supervise_p0.py that fails on the base commit and passes after the change.
Scenario: New test fails on the base
- WHEN A person runs uv run pytest tests/roadmap/steps/test_supervise_p0.py at the base commit and again after the change.
- THEN The first run exits non-zero with an import error for the policy module, and the second run passes.
Requirement: Each P0 item at each pass
The supervise job SHALL apply the D10 policy to each open P0 item at every pass and after each unit result.
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 a positive Argo spec.priority, the next model tier, doubled soft caps within ceilings, high effort and 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 and the tier after the current one. It returns 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 UTC-day new tokens 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: Clear a stop before an extra attempt
The supervise job SHALL use stop_clear.py to clear a stop before it grants an extra attempt.
Scenario: Stopped incident P0 item
- WHEN A unit test gives a stopped incident P0 item and a free extra-attempt place.
- THEN The policy calls stop_clear and grants the extra attempt.
Requirement: Failure wait from RETRY_AFTER
The supervise job SHALL wait for an extra attempt with the wait of its failure class in RETRY_AFTER.
Scenario: Extra attempt after a failure
- WHEN A unit test grants an extra attempt for a failure class in RETRY_AFTER.
- THEN The policy uses the wait of that class and adds no new wait table.
Requirement: New settings declared and documented
The change MUST declare both roadmap.supervise caps as Variable() settings and list their variables in the census of tests/security/test_config_declarations.py.
Scenario: Settings documents current
- WHEN After the change, a person runs uv run devops docs generate. The person then runs uv run devops ci --check --only docs. The person then runs uv run pytest tests/security/test_config_declarations.py.
- THEN The docs check and the census test pass, and docs/CONFIGURATION.md lists the supervise row with both fields.
Requirement: Pending a person after the merge
A person MUST set roadmap.supervise.daily_extra_spend_cap to a nonzero value, run the weekly drill item as the App after the release, and comment its result lines, time to a PR and extra spend here.
Scenario: Weekly drill after release
- WHEN The change merges, the release publishes, a person sets roadmap.supervise.daily_extra_spend_cap to a nonzero value, and the weekly drill item runs as the App.
- THEN A comment on this issue gives the result lines, the time to a PR and the extra spend.
Existing Tool Considered
Argo Workflows (argoproj/argo-workflows, Apache-2.0) is the existing tool. The alternatives check in the issue body gives the verdict in-use and lists what the tool covers and lacks. The change adds a D10 policy function in the supervise step module. The function supplies what the tool lacks: incident and inherited P0 classification, the next ladder tier and high effort, doubled soft caps within ceilings, and the daily attempt and spend caps with the supervise_cap cause. Written cost: 200,000 to 400,000 agent tokens and 0.5 to 1 day.
Key questions
- Which issues must finish before this item?: The item needs chore(roadmap): hold incremental stage and implement work #6521, 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. chore(roadmap): hold incremental stage and implement work #6521 holds the stage, implement and fix-checks work. The item waits until chore(roadmap): hold incremental stage and implement work #6521 closes. [sources: CONTEXT.md, docs/ROADMAP_WORKFLOW.md]
- Which P0 items get extra resources?: Only incident P0 items get extra resources. An incident class is an SLO or alert trigger, or a red required check on main. An inherited P0 item gets the positive Argo spec.priority only. (best practice) [sources: docs/guidelines/agentic-jobs.md, docs/ROADMAP_WORKFLOW.md]
- Chosen: Incident classes only. D10 gives extra resources only to 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:2404. Set extra_attempts to 3 and daily_extra_spend_cap to 0, and declare both as Variable() fields. Add their variables to the census of tests/security/test_config_declarations.py. The job reads both at each use, so a person changes a cap with one ConfigMap edit. Ship daily_extra_spend_cap at 0 until the owner sets a value. (best practice) [sources: src/devops_cli/config/settings.py:2404, 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 the docs check 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?: Write supervise_cap at the cap, and only after the fixable check finds no fixable failure. (best practice) [sources: docs/guidelines/agentic-jobs.md, src/devops_cli/roadmap/steps/fix_checks.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?: Set a positive Argo Workflow spec.priority, above the default 0. Set no Kubernetes PriorityClass. The admission policy of the roadmap service refuses a priorityClassName on a Job that the Service creates. Argo priority is the order control. (best practice) [sources: k8s/devops/roadmap-service/admissionpolicy.yaml, docs/CLUSTER.md]
- 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:2404, 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. Clamp each to its ceiling where one exists: stage.verify_repair_rounds_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:2404, src/devops_cli/config/settings.py:1747, 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. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, src/devops_cli/config/settings.py:2404]
- Chosen: New tokens. It is the unit of the existing token budgets and 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?: Use the wait of its failure class in RETRY_AFTER of src/devops_cli/roadmap/failure.py:202. The change adds no new wait. (best practice) [sources: src/devops_cli/roadmap/failure.py:202, tests/roadmap/test_roadmap_failure.py]
- 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.
- Where does the D10 policy live?: Add the policy as a function in the 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/init.py, src/devops_cli/roadmap/steps/fix_checks.py]
- Chosen: A function in the 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.
- How is an extra attempt counted?: Count one extra attempt each time the supervise job grants a retry beyond the normal attempt for an incident P0 item. Reset the count at 00:00 UTC. Record the count in supervise.attempts. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, src/devops_cli/roadmap/run.py]
- Chosen: One count for each grant in the UTC day. It matches the daily attempt limit and the job record key in the issue.
- Rejected: One count for each failure. A failure that gets no grant would use the limit.
- Rejected: One count for each model call. A grant can make more than one model call, so the limit would not match the issue.
- How does the supervise job record the comment and the cap?: Write supervise.attempts, supervise.comment_id and supervise.capped to the item's job record. Post one comment for the grant and store its id. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, src/devops_cli/roadmap/run.py]
- Chosen: Write the three job record keys and one comment id. The issue names these keys, and the comment id links the grant to its comment.
- Rejected: Write only the attempt count. It loses the comment link and the cap flag.
- How does the policy use stop_clear?: Use stop_clear.py to clear a stop before the policy grants an extra attempt. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, CONTEXT.md]
- Chosen: Clear the stop before the grant. The issue names stop_clear.py, and a stopped item cannot take the extra attempt.
- Rejected: Grant with the stop in place. The stop keeps the item from running.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 13, 2026
Both touch the supervise job, but #5477 creates the job and the candidate adds the D10 P0 resource rule to it.devops-cli-service commentedon Nov 18, 2026
Owner question: What daily cap does the owner set for extra P0 spend? (a person decides)
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 20, 2026
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.
devops-cli-service commentedon Nov 21, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 22, 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.
devops-cli-service commentedon Nov 23, 2026
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:
Sources:
devops-cli-service commentedon Nov 27, 2026
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.
devops-cli-service commentedon Nov 29, 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.
dan-petty commentedon Nov 30, 2026
Premise check after the release of the hold #6521 (2026-11-30): the supervise job of #5477 does not exist: #5477 closed with only
roadmap/incident.pylanded. Closed as not planned (AGENTS.md rule 2); a person may reopen it, or file a new item from fresh evidence.