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)
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.pyto the base commit and runsuv 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.priorityand 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
priorityClassNameand both hold an Argospec.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.cappedas 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_capvalue. - THEN The policy grants no extra attempt and records
supervise.cappedas 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_capandsupervise.cappedis 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_capcause.
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_capin 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.pyanduv run devops ci docsafter the change. - THEN Both commands pass and
docs/CONFIGURATION.mdshows thesuperviserow 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.supervisesection toRoadmapConfigatsrc/devops_cli/config/settings.py:2183. Setextra_attemptsto 3 anddaily_extra_spend_capto 0, both asVariable()fields. Add both variable names to the census oftests/security/test_config_declarations.py. The job reads both at each use, so one ConfigMap edit changes them. Shipdaily_extra_spend_capat 0 until the owner sets a value after the D9 A/A pass. The tests use a small configured cap.uv run devops ci docskeepsdocs/CONFIGURATION.mdcurrent. (best practice) [sources: src/devops_cli/config/settings.py:2183, tests/security/test_config_declarations.py, docs/CONFIGURATION.md]- Chosen: A
roadmap.supervisesettings section. A person changes a cap with one ConfigMap edit and no code change. The census test anduv run devops ci docskeep it declared and documented. - Rejected: Hard-coded constants. A person cannot change a cap with one ConfigMap edit.
- Chosen: A
- 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 policyroadmap-service-jobsrefuses apriorityClassNameon 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.priorityonly. The admission policy refuses apriorityClassNameon 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.
- Chosen: Argo
- 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_secondsanditem_time_limit_seconds, and clamp each to its ceiling:step_token_ceilinganddeadline_ceiling_seconds. A cap with no ceiling doubles. The item time limit stays at or belowdeadline_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_budgetanditem_token_budget. The implement job records those counts inimplement.spendasnew_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_AFTERofsrc/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.
- Chosen: Reuse
- 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]
- Chosen: Wait for chore(roadmap): hold incremental stage and implement work #6521. The owner froze the item, and the refine rule lets the hold issue block it.
- Rejected: Continue now. It ignores the owner freeze and the re-architecture of tracker refactor(roadmap): re-architect stage and implement on Coder #6519.
- 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.
- Chosen: A function in a new supervise step module. The roadmap steps live one module each under
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
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: