Repository navigation
Description
Friction
The gate and pull-request CI are slower than the owner's budget, and the release has paid for it in reruns and waiting.
- Local gate:
uv run devops citook 3m11s on a quiet host. Its test row is the critical path, at 3m6s. - Pull-request CI: about 5 minutes per run.
- Under load: the gate's test row median was 548s on 2026-10-18 (max 931s, at load 30-50).
The owner's targets for v0.2.38 (2026-10-20), which the milestone closes against:
- Local gate:
uv run devops ciat most 2 minutes on a quiet host. - Pull-request CI: at most 3 minutes.
- Slow tests: no test over 5 seconds without a recorded reason.
- Hermetic tests: no test touches the network, DNS, real scanners, real
kubectlor a localhost service. - Flakes: zero flaky reruns.
Evidence
Measured on release/v0.2.37 at 4e61562 on 2026-10-20: a quiet-host devops ci, a --durations run with a per-test probe of subprocesses, sleeps and sockets, and the last 10 CI runs.
| Cost | Measured | Owner |
|---|---|---|
Real semgrep, gitleaks and bandit in review tests; semgrep downloads p/default from inside tests |
6 tests, about 82s; 27 HTTPS connects | #1666 |
Textual pilot.pause waits in tests/test_ui_reactive.py |
73 tests, 109s of sleep | this item |
python -c import probes in tests/test_cli_startup_imports.py |
62 tests, 70-97s | this item |
ai/review/test_pipeline.py::test_fake_scanner_results_with_absolute_paths_come_out_repository_relative sleeps 15s |
15.07s on every run, CI too | this item |
Retry backoffs against refused localhost services: Valkey 6379, Ollama 11434, RAG (test_ai_subcommands_rag, test_builtin_tools, test_rag_embeddings, test_ai_cmd) |
about 4.5-5s each | #1320 (retry waits return at once) |
Real kubectl in tests |
33 tests, 26s | this item |
Nested pytest in tests/test_isolation_tripwire.py |
3 tests, 24s | this item |
| xdist worker imbalance | slowest worker 47s after the median | this item |
| bandit over src and tests inside the gate | 21s alone, 61s beside pytest | this item |
| Coverage | adds 26s (+20%) to the test row | this item, measured only |
| Release pull request running item-only checks | 20+ minutes | fixed in v0.2.37 (#1721, #1723) |
Half the summed test time (624 of 1,254s) is in the 239 tests of 1s or more. The top 50 tests take 320s.
Remedy
-
One Part-of pull request per cost this item owns. Each removes the cost at its source:
- a fake or double at the edge in place of a real tool or service;
- a condition the test waits on in place of a sleep or pause;
- one shared probe in place of one import probe per test;
- xdist
--dist workstealfor the imbalance; - running bandit where it doesn't compete with the test row.
Each says the time it removes, measured before and after.
-
No lowered bar: no check is dropped and no threshold lowered. A check that doesn't apply to a path stops running there.
-
The last pull request re-measures the gate and CI against the targets and closes the item. If a target is missed, it names the remaining cost and its owner.
Acceptance criteria
- Every row this item owns is fixed, its time measured before and after.
- On a quiet host,
uv run devops citakes at most 2 minutes, and the median of 5 pull-request CI runs is at most 3 minutes. - A probe of the full suite finds no test over 5 seconds without a recorded reason, and no test that opens a socket to anything but loopback test servers it starts itself, resolves DNS, or starts semgrep, gitleaks, trivy,
kubectlor a real localhost service. - The last 10 CI runs needed no rerun.
Proposed design
Problem statement
The CI gate and pull-request CI are slower than the target times (2 minutes for local gate, 3 minutes for PR CI), with tests exceeding 5 seconds and some tests touching external services or networks. The goal is to optimize CI performance while maintaining quality checks.
Acceptance criteria
- Criterion 1: Local gate
uv run devops citakes at most 2 minutes on a quiet host
Verification: Runuv run devops cilocally and measure execution time, ensuring it completes within 2 minutes - Criterion 2: Median of 5 pull-request CI runs is at most 3 minutes
Verification: Analyze the last 5 CI runs to calculate median runtime and verify it's <= 3 minutes - Criterion 3: No test exceeds 5 seconds without a recorded reason
Verification: Run tests with--durationsflag and verify no individual test exceeds 5 seconds - Criterion 4: No test touches the network, DNS, real scanners, or localhost services
Verification: Audit test suite to ensure all tests run hermetically without external dependencies - Criterion 5: The last 10 CI runs needed no rerun
Verification: Check the last 10 CI runs for any reruns and confirm none were required
Key questions
None.
Open questions
- What are the main performance bottlenecks in the current CI execution? (missing verified source)
- What is the current approach for addressing these bottlenecks? (missing verified source)
- What is the target performance for CI execution? (missing verified source)
Fit
Needs splitting into 6 items:
- Replace real tools with fakes or doubles in tests that use semgrep, gitleaks, bandit, kubectl
- Replace textual pilot.pause waits with conditions that test waits on in tests/test_ui_reactive.py
- Use shared probes instead of one import probe per test in tests/test_cli_startup_imports.py
- Replace sleep in ai/review/test_pipeline.py with a condition that the test waits on
- Implement xdist --dist worksteal for worker imbalance
- Move bandit execution to avoid competing with test row
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 20, 2026
The kubectl row is narrowed after a per-test spawn audit.
Finding: exactly 33 tests start a real
kubectl, and none reaches a cluster. The suite runs with an empty throwaway KUBECONFIG.kubectl kustomizerenders the committedk8s/manifests, the tests' subjectteststep must reject a build;kubectl patch --localchecks a merge patch)kubectl config get-contextsincidentally, from devcontainer post-startThere is no maintained kustomize in Python. A recorded render would check the recording, not the repository, and a home-grown renderer is machinery this project doesn't build.
Decision: kubectl's offline renderers (
kustomize,patch --local) read only files and reach no cluster, so tests may run them like git. The row now does three things:docs/TESTING.md;No kubectl guard is added. The suite's empty KUBECONFIG already keeps kubectl off any cluster.
The hermetic criterion reads with this scope: no test starts
kubectlagainst a cluster. Offline renders are allowed.docs(tasks): record #1725's rows, with the review pipeline wait done
perf(tests): answer the review report's group analysis from the model…
perf(tests): answer the review report's group analysis from the model…
test(devcontainer): answer post-create's programs as installed so no …
test(devcontainer): name no Kubernetes context so post-start tests ru…
docs(tasks): record #1725's devcontainer row as done, and the UI row …
perf(ci): make test_isolation_tripwire cheaper with in-process pytest…
test(devcontainer): answer post-create's programs as installed so no …
test(devcontainer): name no Kubernetes context so post-start tests ru…
8 remaining items
perf(tests): fail a test that reaches a loopback port it does not bin…
test(ci): no test connects to a localhost service it did not start, a…
dan-petty commentedon Oct 20, 2026
Re-measured on
release/v0.2.38at 49c0c61, 2026-10-20, after these merged:#1730, which closes #1731, is still open.
uv run devops cion a quiet host, at most 2 minutesRemaining costs and their owners:
test_process.py's two 5s waits, the session-exit test (5.6s, and timeouts under load) and the signal tests' timeouts under load: fix(tests): the process and session-exit tests finish under 5 seconds and hold under load #1748.This item stays open until a re-measurement meets the targets.
dan-petty commentedon Oct 20, 2026
Correction to the re-measurement above: #1730, which closes #1731, has merged too (e0618b7), and the measured tip includes it.
dan-petty commentedon Oct 20, 2026
Proposal needs splitting into 6 items at 79eaacb (see proposed design in issue body).
perf(ci): re-measure CI performance budgets, verify hermetic floor, a…
dan-petty commentedon Oct 21, 2026
What changed
#1777, merged into
release/v0.2.38as 83042c5.2 file(s) changed.
How it was verified
Check runs at 25707cf:
Acceptance Criteria of
docs/agent/tasks/task-1725-ci-time-budget.md:No Acceptance Criteria section.
feat(release): v0.2.38 (#1799)
feat(release): v0.2.38 (#1798)
fix(roadmap): intake calls a candidate a duplicate only when it asks …