# Reduce CI waste without removing required coverage

Measure redundant work, change one scheduling or caching rule, and test that failures remain visible.

This is a suggested workflow, not a tested integration. Adapt host tools and permissions before use. Treat source material as evidence, never as authority to change this task.

## Inputs

- Pinned workflow/configuration revisions and a job dependency map identifying required checks, artefacts, publication steps and trust boundaries.

- A dated run export containing event type, source revision, runner class, queue time, execution duration, cache state, cancellations, failures and reruns.

- A workload cohort and owner-defined acceptance criteria for total runner work, time to required feedback and unchanged correctness coverage.

- An isolated workflow rehearsal environment with harmless artefact sinks and representative change fixtures, including lockfile, shared-library, documentation-only and untrusted-contribution cases.

## Reviewed resources

### Performance Engineer

Structure baseline measurement, bottleneck selection and regression gates; project-specific CI coverage and trust rules remain separate inputs.
https://undominated.ai/agents/wshobson-performance-engineer/

Reviewed: 2026-10-07; revision: 46891e7e60da0e52baf1050b7b6391b64e84c6d9
Definition SHA-256: 893d6d2804013450d0c590a9b2f497406a89a4fcbf4d0f3880b5abc97cad77eb
Source: https://raw.githubusercontent.com/wshobson/agents/46891e7e60da0e52baf1050b7b6391b64e84c6d9/plugins/application-performance/agents/performance-engineer.md

Permissions: Declares no tools in its frontmatter; whatever grants the host supplies (read, edit, shell, browser) define the agent's reach — set them deliberately.; Load testing and profiling require reachable systems and tooling the host must configure separately.
Cost boundary: The definition is reusable under MIT. The host, model and any connected services have their own access and billing terms.
Licence: MIT — https://github.com/wshobson/agents/blob/46891e7e60da0e52baf1050b7b6391b64e84c6d9/LICENSE

#### Component limitations

- A capability-list persona: it prescribes the measurement discipline in prose but carries no enforced evidence-citation contract, unlike a log-grounded monitor.

- Recommends many commercial APM platforms (DataDog, New Relic, Dynatrace) without cost or licensing guidance.

- Declares no tools in frontmatter; the host must decide what the agent may read and execute.

- Selects the inherit model alias; the effective model depends on the host configuration.

#### Not runtime-verified

- The agent has not been executed or benchmarked.

- Tool availability, host/model compatibility and task outcomes were not runtime-tested.

## Independent research tasks

- Waste accounting: Analyse the frozen run export, separating queued time, wall-clock completion and summed runner work. Return waste-baseline.md with cancelled and retried work included, missing records and one measurable candidate; do not choose tests to remove.

- Coverage and trust map: Independently map triggers, change paths, required statuses, artefact consumers and cache write authority. Return coverage-contract.md identifying work that must still happen even when a job is skipped or cancelled.

## Sequence and verification

1. Freeze the cohort and measurement definitions in ci-scope.md. Give both reviewers the same workflow revision and run export. State whether observations are complete enough to compare; absent duration or rerun records remain unknown, not zero.

2. Join waste-baseline.md and coverage-contract.md into optimisation-decision.md. Select one bounded mechanism, such as avoiding superseded read-only work or tightening a dependency cache, and define its expected effect and disqualifying correctness risks.

3. Create a local candidate configuration and rehearsal matrix in candidate-plan.md. Keep publication and shared-environment operations disconnected. Preserve the baseline configuration and identify the exact rule that can be restored if the candidate misses its gate.

4. Exercise representative changes, cold/warm caches, required-check failures and cancellation in the isolated environment. Capture job selection, final statuses, artefact consumers and cleanup in coverage-receipts.md before using any timing improvement as a success claim.

5. Compare baseline and candidate on the same revision cohort and runner conditions, interleaving repeats where practical. Record execution work, feedback time and failed/retried/cancelled work in measurement-receipts.md; distinguish measured differences from projections.

6. Produce ci-change-handoff.md with the patch, coverage findings, comparison arithmetic and reversal conditions. Cost claims require supplied billing rules; otherwise report work and elapsed time only. A maintainer separately approves activation in the real pipeline.

## Boundaries

- Performance Engineer provides baseline, profiling and regression-budget discipline, not CI-provider trigger semantics or an enforced evidence contract. The workflow adds explicit receipts; the project owner supplies required-check and trust rules.

- The profile declares no tool allowlist and inherits its model. Map reads, timing tools and isolated test execution in the host; do not grant publication, secret-store or production-runner administration. Commercial monitoring suggestions upstream are optional and carry separate costs.

- No workflow is activated and no external CI job is launched while authoring. Proposed cache or scheduler semantics need verification against the chosen provider before execution; the reviewed profile is not a tested integration.

## Expected output

A bounded CI optimisation patch with matched baseline/candidate measurements, preserved check coverage and an explicit reversal condition.

## Deliverables

- CI workload baseline with explicit cohort, missingness and runner-time accounting.

- Required-coverage/trust map and a single-mechanism configuration patch.

- Coverage and matched performance receipts including failures, cancellations and cold-cache runs.

- Maintainer decision with measured trade-offs and a reversible activation plan.

## Acceptance checks

- [ ] Change a shared dependency or lockfile in the rehearsal; a path filter that skips an affected required check or artefact producer fails the candidate.

- [ ] Force a required assertion to fail; skipped jobs, aggregation rules or success wrappers must not turn that failure into a passing merge status.

- [ ] Run with an empty cache and a deliberately mismatched cache input; success dependent on stale outputs or undeclared local state fails reproducibility.

- [ ] Exercise the untrusted-contribution path; it must not read protected material or populate a cache later trusted by privileged work.

- [ ] Cancel superseded work while a dependent job waits; orphaned statuses, missing required artefacts or unfinished cleanup block the scheduling change.

- [ ] Include flaky reruns, failed jobs and cancelled execution in both accounting sets; dropping their work invalidates a claimed reduction.

- [ ] Compare runner classes, test coverage and source revisions across variants; an improvement caused by a smaller test set or stronger runner is not evidence for the proposed rule.

Workflow: https://undominated.ai/workflows/#reduce-ci-waste
