Selective Test Execution Without Dropping CI Verdict Integrity
Selection can cut CI time only if doubt triggers more testing.
Sponsored by Graphide

Selective testing can preserve the same CI verdict only when exclusions rest on reachability evidence and uncertainty triggers more testing, never less. This is fail-closed selection. A trustworthy implementation must also reject incomplete execution as a pass and bind its verdict to the code, tests, and environment that produced it.
Why the CI verdict is a binary contract, not a coverage score
Teams want feedback sooner, but they still need a pass or fail they can trust at the merge gate. Selective execution changes which tests run while preserving the meaning of their results. If a test fails, the job must still fail. More importantly, the selector must not exclude a test that would expose a regression simply because its relationship to the change is hard to establish.
A CI verdict differs in this way from a coverage score or risk estimate. A score can show confidence without showing that the tests that matter passed. The merge gate cannot make that substitution. Fail-closed selection keeps that contract by running more tests when evidence is missing, so doubt does not give permission to merge.
Why CI feedback loops have become untenable for teams running agents
Coding agents such as Claude Code, Codex, and Cursor produce pull requests at a pace that human reviewers and slow pipelines were not designed to absorb. Verification becomes the bottleneck when code production outpaces it. The workload grows without a corresponding increase in trust. As code is generated faster, independent testing matters more, even as running the full suite each time gets harder to keep up.
OWASP has warned that agents may delete tests, weaken assertions, over-mock dependencies, or assert faulty behavior to make CI green. The agent that wrote a change cannot serve as its independent verifier. A tokentimer-core issue shows how much work it takes to run the tests, with roughly 136 integration-test files that need a Docker Compose environment for every PR. Repeating that work for every change creates pressure to narrow execution.
Graphide CI offers one approach by running existing GitHub Actions jobs on its runners with warm caches, splitting long test steps only where a check shows every result stays the same. The verdict stays the same, and a failing test still fails the job. Selective execution addresses the remaining workload only if its exclusions preserve that contract.
What a selector must model to avoid silently dropping coverage
Path matching cannot show everything a change affects because the tests that matter depend on dependencies, which naming conventions do not fully capture. The tokentimer-core issue identifies cross-cutting surfaces including authentication, workspace authorization, database helpers, migrations, configuration, workers, and shared services. A test can depend on any of these without sharing a file-name pattern. The selector must traverse those relationships.
A sound baseline therefore includes changed files, the affected dependency graph, API and data contracts, runtime and configuration edges, migration edges, and trustworthy per-test coverage mappings. Coverage has a specific evidentiary role here. It shows that a test reaches code, but an absent observation does not prove that the test is irrelevant to a change. Treating those statements as the same lets tests be left out without notice because the measurements are incomplete.
Some changes also invalidate the map itself. Radius PR #10 runs the full suite for deleted and renamed files because losing a node breaks dependency mapping. Build configuration and shared test fixtures also call for a full-suite fallback because the graph cannot be assumed to stay the same. The same PR removed LLM-based pruning from the verdict path because a model cannot arbitrate its own correctness and its reasoning cannot be audited.
What false-negative selection looks like in production
Radius documented the consequence in a scenario where a change broke checkout. Its selector chose only a weak name-matched test and published a LOW-risk safe verdict of 90/100 with a check conclusion of “success”. The full suite found one failing test. Naming conventions had substituted for graph traversal, leaving transitive regressions with zero selected tests while the system claimed maximum time saved.
The two selection errors have different consequences. A false positive costs more by running tests that are not needed, while a false negative can let broken code reach production with no warning. Radius also documented crashes on common inputs while its check still completed as “success”. In that case, the check no longer distinguished evidence about the code from failure of the verification machinery.
A HiQS-Labs repository issue requires evidence to bind exact code identities, policy revisions, suite selection, environment, results, and the rollback boundary. A plaintext verdict attached to a PR number cannot provide that binding. Even tree equality is not enough there because fixture suites check Git history and commit identity.
The fail-closed rules that keep the verdict honest under selective execution
When coverage is missing, mappings are stale, or the dependency graph is incomplete, run the affected tests conservatively. For high-risk changes to shared fixtures, build configuration, migrations, authentication, or deleted and renamed files, fall back to the full suite.
Execution status needs an equally strict rule. Failed, canceled, skipped, partial, and advisory results must never become PASS. A missing runner, timeout, or interruption is an error. Radius codifies this distinction through three verdicts, namely verified, failed, and insufficient_evidence. Its state is verified only when selected tests have reached every executable changed file and have finished and passed, while any selected test that fails makes it failed and everything else makes it insufficient_evidence.
Policy ownership must be just as explicit. The repository issue requires one authoritative executable owner, without competing tier tables, suite lists, exception rules, or reuse rules in documentation. When a mapping or baseline is stale, it must cause a failure or a clear warning, never let work be skipped in silence. These requirements keep the executable gate from drifting away from the rules people believe it enforces.
The gate’s own tests also need a null-implementation proof. evekhm agentic-sdlc issue #405 and associated PRs show why. The Argus review found that existence checks and substring assertions could be satisfied by a commented-out file, allowing the suite to pass while the entire D4–D7 implementation was absent.
Shadow mode and staged rollout as the bridge from full suite to selective execution
tokentimer-core issue #299 plans to start safely with shadow mode, trying out the selector while all integration tests still run. That preserves the full-suite verdict while exposing differences between proposed selection and observed failures. Past full-suite failures offer another way to check, and if the selection misses a failure that matters, it is rejected and the full suite runs again.
The repository issue describes a similarly ordered rollout. It starts by codifying current behavior without changing coverage, then inventories consumers and verifies policy parity. Only after a separately reviewed and approved bounded fold does it consider selective execution in a narrow area. The sequence separates policy cleanup from coverage reduction so that both do not change beneath the gate at once.
The j-wanger/nana-pi pattern adds assurance through distinct execution tiers. It uses path rules for document-only pushes, impact-based selection on pull requests, and the full suite on main after each land. That last run is the safety net. It catches the regression after landing before it propagates further.
What the Microsoft Aspire rollout audit shows about selector accuracy in practice
Microsoft Aspire issue #19787 tracked an audit with a set scope after PR #19688 turned on selective PR test execution. At the reported checkpoint, the audit had reviewed 42 of 50 eligible runs, with 30 selecting a subset and 12 selecting ALL. It reported no false positives or false negatives at that checkpoint. Those figures describe an audit still in progress at that point.
The exceptions are especially instructive for fail-closed behavior. Benchmark projects outside the dependency graph were reported as unattributed and fell back to ALL. The audit also investigated safe over-selection in renamed-file handling. That error made more tests run and kept tests that might matter from being hidden, as the fail-closed rule requires when the mapping is in doubt.
The audit made selection behavior observable over time. Its structure included a bounded run count, automated recording, a named investigator, Ankit Jain, and public follow-up issues for defects. Checks for selection drift went on separately after the audit with a set scope ended. Together, these practices provide stronger evidence than a one-time green result because they expose both missed coverage and unnecessary execution during rollout.
What evidence should bind a CI verdict to its execution?
The repository issue defines a receipt that binds exact base and candidate SHA, ordered member heads, landed SHA, artifact and verifier version, and runner mode. It also requires OS and architecture, dependency lockfile hashes, the complete selected suite list, per-test results, a telemetry digest, and the rollback boundary. These fields identify what was tested and under which conditions. They prevent a verdict from floating free of the execution that supports it.
The same issue requires policy and routing revisions, source and test revisions, suite-selection revisions, and runtime, toolchain, and dependency environment details. Evidence expires when its relevant inputs change. Member, base, code, consumer, fixture, routing, test-definition, or environment changes invalidate affected evidence, so a receipt cannot be reused merely because the source tree looks equivalent. Git history and commit identity remain inputs when fixture suites inspect them.
The residue-cli PR offers a smaller example of honest recording. It records the implementation SHA, Rust version, OS, architecture, commands, and actual results. Explicitly marking tests that did not run as unrun is the minimum distinction a receipt must preserve before more elaborate provenance can be useful.
Radius adds the selection decision to that record. Its PR stores the changed-file-to-test mapping with the report and reuses it when CI results are ingested, replacing fabricated impact values at ingestion. That preserves the evidence behind the blast-radius decision for later inspection. A record of which tests passed cannot by itself show why other tests were left out.
Where Graphide CI fits
The same principles apply to the infrastructure that executes existing jobs. With Graphide CI, teams keep their GitHub Actions jobs while the runners change, and every test the job runs today still runs: Graphide CI does not select tests. Its speed-ups come from warm caches, sized machines and, only where a check shows every result stays the same, split test steps, so a team that later adds selective execution can judge the selector on its own, against full runs on the same runners.
Conservative selection still has an execution cost. Warm caches cut the setup cost that a full-suite fallback would otherwise pay on a cold runner, while parallel execution keeps additional tests from increasing wall-clock time proportionally. Whether a subset or the full suite runs, a failing test fails the job.
Graphide’s run documentation describes the evidence visible with each result: which tests ran, their failures and errors, and job logs and timings. It also records a job failure that occurs before tests run or outside the tests.
Graphide review serves a separate purpose from the CI gate. It shows changed behavior and findings, and says for each how it is known, including when it could not be verified. It does not block merging on its own. Either product works without the other.


