Repository navigation
Description
Split from #4405.
Problem
The local full check devops ci took 11 min 39 s to 23 min 37 s on 2026-11-10 under a load of about 28, and one run waited more than an hour for a gate slot. AGENTS.md rule 5 makes a check that averages more than 5 minutes a P0 bug. The project has no three-run idle record of the ruff, mypy, test, docs and openspec steps, no split of the slowdown between load and the cost of the checks, and no ranked list of fixes.
Why deferred
The three-run idle measurement needs a host with no other agent. Several agents run pytest with xdist on the shared host, so no job can make the host quiet. The recorded data already shows the direction: the test row took 247 s alone and 440 s beside a second gate (src/devops_cli/config/defaults.py:474-480), and a full run took 2.5 minutes on a quiet host (docs/adr/0014-required-checks-gate-the-merge-and-the-pre-push-hook-runs-the-fast-static-checks.md:21). The rest of #4405, the 50 slowest tests and the P0 mark for every check over 300 s, does not wait.
Acceptance criteria
- Three runs of
devops cion an idle host record the wall time of each of the ruff, mypy, test, docs and openspec steps, and the issue holds a table of the idle and loaded times of each step. - The issue states the share of the slowdown that comes from load and the share that is the cost of the checks.
pytest --durations=50lists the 50 slowest tests with their setup and call times, and the slowest test files; the issue namestests/commands/test_scan.pyand its open failures test(scan): scan command tests reach real trivy and semgrep #4288 and fix(ci): scan tests reach the host scanner tools #4321.- The issue holds a ranked list of fixes, and one new issue holds each fix.
- If the mean idle time of a step is more than 300 s, intake sets the priority of this issue to P0.
Proposed design
Problem statement
The local full check devops ci took 11 min 39 s to 23 min 37 s under a load of about 28, and one run waited more than an hour for a gate slot. AGENTS.md rule 5 makes a check that averages more than 5 minutes a P0 bug. The project lacks a three-run idle record of its ruff, mypy, test, docs and openspec steps, a split of the slowdown between load and the cost of the checks, and a ranked list of fixes. The three idle runs wait on a host with no other agent.
Acceptance criteria
Requirement: Idle and loaded step table
The change SHALL add docs/ci-performance.md with a table of the idle and loaded wall time of each devops ci step.
Scenario: Three idle runs recorded
- WHEN A person runs
uv run devops ci --check --no-cachethree times on an idle host. - THEN The table holds three idle times and the recorded loaded time for each of the
lint,format,typecheck,test,docsandopenspecsteps.
Requirement: Cache bypassed
Each of the three idle runs MUST pass --no-cache, so that the measured time is the cost of the checks and not a cached verdict.
Scenario: The method names the command
- WHEN The report states how the three runs were made.
- THEN The command holds
--check --no-cache, and the report states that a cached run would return in seconds.
Requirement: Gate-slot wait apart
The report SHALL record the gate-slot wait apart from the step times and SHALL exclude it from the load and check-cost shares.
Scenario: Wait excluded from the shares
- WHEN The report gives the load share and the check-cost share.
- THEN The report gives the gate-slot wait in seconds for each run, and the two shares sum to 100 without it.
Requirement: Load and check cost split
The report SHALL state the share of the loaded mean that is the idle cost of the checks and the share that is the load-induced slowdown.
Scenario: Shares sum to 100
- WHEN The report holds the idle and loaded means of each step.
- THEN The report gives the check-cost share and the load share as percentages that sum to 100, with the gate-slot wait excluded.
Requirement: Slowest tests and files
The report SHALL list the 50 slowest tests with setup and call times, and the slowest test files, from pytest --durations=50.
Scenario: Slow test list names test_scan
- WHEN A person runs
uv run pytest --durations=50on the test step. - THEN The report lists 50 tests with setup and call times, names the slowest test files, and names
tests/commands/test_scan.pywith open failures test(scan): scan command tests reach real trivy and semgrep #4288 and fix(ci): scan tests reach the host scanner tools #4321.
Requirement: Ranked fixes with issues
The report SHALL hold a ranked list of fixes, and each fix SHALL name a new issue that states its acceptance criteria and links back to this issue.
Scenario: Each fix has an issue
- WHEN The report ranks the fixes by the time each saves.
- THEN Each fix names its new issue number, and the issue links back to chore(ci): measure the local check on an idle host and rank the fixes #4427.
Requirement: P0 trigger at 300 seconds
The report SHALL mark each step whose mean idle time is more than 300 s as a P0 trigger, and SHALL state that intake sets the priority label.
Scenario: Step over 300 seconds
- WHEN The mean idle time of a step is more than 300 s.
- THEN The report marks that step as a P0 trigger and names the 300 s threshold of AGENTS.md rule 5.
Requirement: Report linked from the router
The change SHALL link docs/ci-performance.md from README.md and docs/index.md, so that the documentation walk from AGENTS.md reaches it within two links.
Scenario: Two-link walk reaches the report
- WHEN
uv run pytest tests/invariants/test_agents_md.py -k within_two_linksruns on the change. - THEN The test passes and the walk from
AGENTS.mdreachesdocs/ci-performance.mdthroughREADME.md.
Existing Tool Considered
hyperfine (open, Apache-2.0, maintained; last commit 2026-10-12, fetched 2026-11-10 at https://github.com/sharkdp/hyperfine) times repeated runs and exports JSON, but it gives no per-step split of devops ci and no slow-test ranking. No timing code is needed for those: devops ci prints each step's wall time (src/devops_cli/commands/ci.py:554) and its test row already passes --durations=10 (src/devops_cli/commands/ci.py:643, src/devops_cli/config/constants.py:706), so pytest --durations=50 gives the 50 slowest tests.
Key questions
- Which tool measures the three runs of
devops ci?:devops ciprints the wall time of each step itself (src/devops_cli/commands/ci.py:554), and its CI cache records the sameduration_seconds(src/devops_cli/ci/cache.py:50), so the three runs need no custom timing code.hyperfine --runs 3adds repeated whole-run statistics and JSON export, but it has no per-step split. Read the per-step times from the threedevops ci --check --no-cacheoutputs. (best practice) [sources: src/devops_cli/commands/ci.py:554, src/devops_cli/ci/cache.py:50, https://github.com/sharkdp/hyperfine]- Chosen: devops ci output plus hyperfine.
devops ciprints and caches each step's seconds;hyperfinerepeats the whole run and exports JSON. - Rejected: GNU time. It measures one run and gives no per-step split, repeated statistics or JSON.
- Rejected: custom timing script. It repeats what
devops cialready prints and caches, and adds code to keep.
- Chosen: devops ci output plus hyperfine.
- Where should the report live?: Add
docs/ci-performance.md, link it from the documentation list inREADME.mdand from the Primary Guides ofdocs/index.md.README.mdis one link fromAGENTS.md(AGENTS.md:29), so the new page is within two links and the invariant test passes (tests/invariants/test_agents_md.py:321). The issue then links the page. (best practice) [sources: tests/invariants/test_agents_md.py:321, AGENTS.md:29, README.md:52, docs/index.md:5]- Chosen: Committed report. It is durable, reviewable, and the two-link test and docs check can check it offline.
- Rejected: Issue body only. No offline test can check it, and refine needs a testable criterion.
- Rejected: Pull request description only. It is lost after merge and no offline test can check it.
- How should the change split load from check cost?: Compare the median idle time of each step with its loaded time from the same step, and report the idle check cost and the load-induced slowdown as shares of the loaded mean that sum to 100. The loaded times come from the
duration_secondsof the host's CI cache entries (src/devops_cli/ci/cache.py:50), as feat(ci): limit how many CPU-heavy gates run at once on one host #2336 read them. Record the gate-slot wait apart and exclude it:devops cistarts the step clock after the slot and records the wait asdevops_cli_ci_gate_slot_wait_seconds(CONTRIBUTING.md:77). (best practice) [sources: src/devops_cli/config/defaults.py:476, docs/adr/0014-required-checks-gate-the-merge-and-the-pre-push-hook-runs-the-fast-static-checks.md:21, src/devops_cli/ci/cache.py:50, openspec/changes/archive/2026-10-27-2336-ci-gate-slots/proposal.md:43, CONTRIBUTING.md:77, openspec/specs/ci-gate-admission/spec.md:95]- Chosen: Per-step median delta. It shows which step grows under load and which is slow when idle.
- Rejected: Whole-run ratio. It hides the step that causes the slowdown.
- Rejected: Synthetic CPU load. It does not reproduce the agents' pytest xdist load.
- What is the P0 threshold for a check?: AGENTS.md rule 5 sets P0 for a check that averages more than 5 minutes, or 300 s (
AGENTS.md:13).CONST_CI_TEST_BUDGET_SECONDSis 300.0 for the test step (src/devops_cli/config/constants.py:705), anddocs/TESTING.md:172says the budget measures the mean of theTests & Coveragecheck onmain, not one local run. [sources: AGENTS.md:13, src/devops_cli/config/constants.py:705, docs/TESTING.md:172] - Who sets the P0 priority?: Intake sets the priority label; an agent sets no priority (
AGENTS.md:23). The report marks each step whose mean idle time is over 300 s as a P0 trigger, and intake sets the priority of the issue. [sources: AGENTS.md:23] - How should the change list the slowest tests?: Run
uv run pytest --durations=50; the test row already passes--durations=10(src/devops_cli/commands/ci.py:643,src/devops_cli/config/constants.py:706), and--durationsprints the seconds of each test for setup, call and teardown (openspec/changes/archive/2026-10-27-2356-coverage-floor-and-test-cost/design.md:25). The repo's own per-test measurement used--durations=0 -n0(openspec/changes/archive/2026-10-24-2098-review-workspace-from-caller/proposal.md:48), which gives stable times without xdist. [sources: src/devops_cli/commands/ci.py:643, src/devops_cli/config/constants.py:706, docs/TESTING.md:189, openspec/changes/archive/2026-10-27-2356-coverage-floor-and-test-cost/design.md:25, openspec/changes/archive/2026-10-24-2098-review-workspace-from-caller/proposal.md:48] - Which
devops cisteps does the table hold?: The table holdslintandformatfor ruff,typecheckfor mypy, andtest,docsandopenspec, the names thatdevops ciprints (src/devops_cli/commands/ci.py:741,:759,:767,:733,:807,:868). The issue's "ruff" and "mypy" rows are these three checks. [sources: src/devops_cli/commands/ci.py:741, src/devops_cli/commands/ci.py:759, src/devops_cli/commands/ci.py:767, src/devops_cli/commands/ci.py:733, src/devops_cli/commands/ci.py:807, src/devops_cli/commands/ci.py:868] - Must the three runs bypass the cache?: Yes.
devops cireuses a cached verdict by default (--cacheisTrue,docs/commands/ci.md:15), so runs 2 and 3 of an unchanged tree would return in seconds. Runuv run devops ci --check --no-cachethree times, the form the required CI rows use (docs/SDLC.md:200,docs/adr/0014-required-checks-gate-the-merge-and-the-pre-push-hook-runs-the-fast-static-checks.md:31). (best practice) [sources: docs/commands/ci.md:15, docs/SDLC.md:200, docs/adr/0014-required-checks-gate-the-merge-and-the-pre-push-hook-runs-the-fast-static-checks.md:31]- Chosen:
--check --no-cache. It measures the checks and changes no file between runs; it is the form the required CI rows use. - Rejected: Default cached run. Runs 2 and 3 return a cached verdict in seconds, so the table would not hold the cost of the checks.
- Chosen:
- How does the issue get an idle host for the three runs?: A person provides a host with no other agent, or runs the three runs in a window when the shared host is quiet. No repository code can make the host idle: several agents run pytest with xdist on it (
src/devops_cli/config/defaults.py:476). Until then, the measurement waits. (a person decides)
Open questions
- How does the issue get an idle host for the three runs? (a person decides)
Fit
Fits in one pull request.
Suspected block
An idle host with no other agent for the three uv run devops ci --check --no-cache runs.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 10, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
choreprefix of the title gives the type.(ci)scope of the title gives the scope.The measurement supports the slow-check fixes but does not change user behavior by itself.The idle-host data and the ranked list guide the fixes for a check that exceeds 5 minutes.The work needs three runs on an idle host, and other agents keep the shared host busy.Both items address the slow local check; item 4405 is the umbrella item, and the candidate measures each step on an idle host and ranks the fixes.devops-cli-service commentedon Nov 10, 2026
Refine cannot set this item to Ready at 1ca0133 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
dan-petty commentedon Nov 11, 2026
Closed as not planned: superseded by the CI audit of 2026-11-11
The audit measured the full suite with per-test coverage contexts, profiled the causes and ranked the fixes. Each fix has its own issue, in plan order:
The shared host is never idle, so the idle three-run table cannot be made. The CI runner times gate the merge, and the audit measured them.