Skip to content

Speeding Up the Verification Loop in AI-Native Development Without Sacrificing Coverage

Drawing on six PRs that overhauled a toolchain and CI for parallel AI agents, this article explains how the verification loop was sped up without cutting test coverage or environment isolation, what the measurements showed, why costs fell even on 8-core runners, and which measures were rejected.

In a development setup where AI agents write code in parallel, the verification loop can be sped up without cutting test coverage or the isolation of execution environments. Between November 24 and 25, 2026, the aios repository went through a toolchain overhaul and CI improvements across a total of six PRs. Measurements taken in that repository on November 24–25, 2026 show total local verification time dropping from 32.5 seconds to 4.5 seconds, roughly 7.2x faster, and the full main verification run covering all targets shrinking from about 6 minutes to 2 minutes 2 seconds (122 seconds), roughly a third. In the same aios measurements, the total wait for a typical feature PR went from 3m21s–3m42s to 1m16s, about 2.8x faster, and despite the move to 8-core runners, the usage-based cost per feature PR fell 25%, from $0.048 (8 minutes × $0.006) to $0.036.

In AI-native development, the speed and reliability of the verification loop cap throughput

When multiple AI agents develop in parallel, the speed and reliability of the automated verification feedback loop directly set the upper limit on development throughput. In human-centered development, the time humans spent writing code was the bottleneck, so even in aios, a 32.5-second local lint and roughly 6 minutes of CI used to cause few visible problems. In AI-native development, however, multiple AI agents implement in parallel in separate git worktrees (a Git feature that lets you create multiple working directories from the same repository) and drive everything from PR creation to automerge. There, what governs the whole process is not how fast code gets written but how long it takes for verification results to come back and how accurate those verdicts are.

Isometric 3D illustration of multiple AI robots coding at individual screens around a central green checkmark surrounded by circular workflow arrows
A fast, reliable verification loop running as AI agents develop in parallel

Automated verification is also essential for getting agents to follow conventions. Notes written in prompts or AGENTS.md fade as context grows and sessions change. The operating principles of aios hold that if rules are encoded into type checks, lint, AST checks (convention checks that parse source code as a syntax tree), and startup contract tests (tests that confirm the app meets its preconditions and can start), and the error messages explain "why this is wrong" and "how to fix it," AI agents will follow the rules 100% of the time and correct themselves autonomously.

aios provides a suite of checks called check:code that enforces even design and UI conventions in CI. Specifically, it automatically verifies import boundaries between browser and server code, bans new uses of the any type, bans raw colors, border radii, and font specifications outside the theme tokens, and detects unused files, exports, and dependencies. On top of that, CI includes browser screen checks that capture every app's actual screens in headless Chrome and confirm that each screen has at most one primary button and at most one h1 heading, that panels are not nested, and that the sidebar has no more than six items.

Heavy upfront investment is fine, but no ongoing downsides

This verification-loop speedup followed one guiding criterion for investment decisions: upfront investment can be heavy, but measures that leave ongoing downsides are not pursued. Heavy initial effort for implementation or refactoring is not a problem because AI agents can write the code. Measures that bring continuing downsides once in operation, on the other hand, were not adopted.

Under this principle, three measures were set aside: PR-diff-based test selection using the import graph, zero-downtime revision switching on Cloud Run, and splitting the financial and engram sidecars into independent Cloud Run services. The reasons are explained in a later section, together with the cost structure.

Moving to a native-generation toolchain made local verification 7.2x faster

In the first stage, the JavaScript-based toolchain was replaced with native-generation tools written in Rust and Go, making local verification about 7.2x faster. Measurements in aios on November 24–25, 2026 show the combined local verification time — the app/ build, check:code, type-aware oxlint, and the oxfmt formatting check — falling from 32.5 seconds to 4.5 seconds. Excluding the build, it came to 3.1 seconds.

First, the lint stack moved from ESLint plus typescript-eslint to oxlint (1.95.0) and tsgolint (7.0.2008) from Oxc (a Rust-based toolset for JavaScript and TypeScript). The migration preserves type-aware checks such as no-floating-promises (a rule that detects unhandled Promises). A regression test that deliberately rejects a non-awaited Promise was also added, so that a mistake in the overrides configuration cannot let checks silently pass. For type checking, TypeScript 5.9 was upgraded to TypeScript 7.0.2 (tsc), the Go-based native compiler, and experimental.useTypeScriptCli: true was enabled on the Next.js side in engram as well.

The custom code-convention checker, check-code.mjs, was also ported from the TypeScript Compiler API to the Rust-based oxc-parser (0.160.0). The surrounding infrastructure was updated at the same time: the build tool moved from Vite 7 to Vite 8.3.8, which is based on Rolldown (a Rust-based bundler); unused-code detection moved from Knip 5 to Knip 6.48; and the formatting check moved from the Prettier CLI to oxfmt (0.80.0). Making the execution layer native while keeping the scope of type-aware and convention checks intact brought local verification wait times down to a few seconds.

Horizontal bar chart showing local verification dropping from 32.5 seconds before to 4.5 seconds after, or 3.1 seconds excluding build
Total local verification time (before and after)

Parallelizing without breaking isolation by eliminating only redundant startups of heavy processes

In the second stage, browser checks and Linux checks were sped up with a design that eliminates only the cost of repeatedly starting heavy processes, while keeping anything stateful separated during parallel execution. Unit tests were standardized on a shared helper that launches a Chromium process only once per test file and creates an independent BrowserContext (the unit that isolates sessions and storage) for each test. Dummy frame generation in the recording tests was switched from launching Chrome twice to producing a JPEG with ffmpeg in 15 milliseconds, and the 4.5-second fixed wait in polling tests was eliminated with a test-only interval override. In aios measurements on November 24–25, 2026, the entire unit test suite completes in 18.5–20 seconds.

For the 12 browser screen checks that run on main (run-browser-checks.mjs), merging the app servers and temporary databases into a single process causes in-memory state and temporary databases to interfere with each other, making the checks flaky. So each script's server and temporary database stay in separate processes, fully isolated, and connect six at a time over WebSocket (chromium.connect) to a single headless Chrome launched with Playwright's chromium.launchServer(). Removing only the cost of repeatedly starting Chrome brought the risk of state contamination to zero, and in aios measurements on November 24–25, 2026, the browser screen check step on main alone went from about 3m30s (212 seconds) to 36 seconds, roughly 5.8x faster.

For the production-image permission checks for the financial sidecar (check-linux.sh), instead of coordinating locks within a single PostgreSQL instance, the work was split into three tracks running in parallel: two independent, disposable PostgreSQL 17 containers and a check that does not connect to a database. In aios measurements on November 24–25, 2026, the Linux checks within main's verify-financial — which performs the production Docker build and PostgreSQL 17 restricted-permission checks — dropped from 64 seconds to 39 seconds. verify-financial as a whole went from 3m33s (213 seconds) to 1m01s (61 seconds), about 3.5x faster (of which the Docker build went from 40 seconds to 11 seconds, a figure that also includes the effect of the NVMe BuildKit cache and other measures covered in section 5).

Architecture diagram showing isolated per-script app servers and temporary databases connecting six at a time over WebSocket to one shared headless Chrome process
Browser screen check architecture: servers and temporary databases are isolated per check, and only headless Chrome is shared

Speedups from CI infrastructure, caching, and prebuilt containers, and measured results

In the third stage, environment setup and build wait times were cut by revamping the CI runners, restoring caches directly, and introducing prebuilt containers. The runners moved from GitHub's standard 2-vCPU runners to Blacksmith, using 8-vCPU, 4-vCPU, or 2-vCPU runners depending on load, and node --test parallelism was raised to --test-concurrency=6. Running npm ci from the ~/.npm cache every time was also dropped; instead, a shared action restores the node_modules directory itself directly from Blacksmith's fast same-rack cache, keyed on the hash of package-lock.json, eliminating npm ci and the rebuilding of native add-ons such as pg-native on cache hits. Google Chrome, FFmpeg, LibreOffice, Poppler, ReportLab, Noto CJK Japanese fonts, and Node 24.22.1, which used to be installed via apt-get on every run, are now baked into prebuilt images on ghcr.io (aios-ci-app:1 and aios-ci-financial:1). The migration revealed that because the locale of plain ubuntu:24.04 was POSIX (ASCII), the download filenames of Japanese PDFs got garbled into "download"; this was fixed at the root by setting LANG=C.UTF-8 and LC_ALL=C.UTF-8 in both the container definition and the runtime environment.

The cache for verifying and building production images was switched from GitHub remote storage (type=gha) to Blacksmith's persistent NVMe BuildKit cache (useblacksmith/setup-docker-builder). The R&D experiments image, which had been built serially on every production release, was split into its own job, and the build is skipped entirely when rd/ has not changed. The git checkout in the changes job was also slimmed down to fetch-depth: 2 for PRs and merges to main.

In PR-side measurements in aios on November 24–25, 2026, verify-app-browser (build, types, code rules, lint, and formatting) dropped from 2m27s to 14–18 seconds (about 8.2–10.5x), and verify-app-test (PostgreSQL 17 integration tests and 639 unit tests) dropped from 3m18s to 37–46 seconds (about 4.3–5.3x, with the tests themselves taking about 18.5 seconds). verify-engram-unit, which runs the full test suite against both SQLite and PostgreSQL 17, went from 2m40s to 21–30 seconds (about 5.3–7.6x), and verify-financial-unit, the financial unit tests, went from 3m01s to about 26 seconds on a cache hit (about 7.0x). The total wait for a typical feature PR shrank from 3m21s–3m42s to 1m16s (about 2.8x).

In main-side measurements in aios over the same November 24–25, 2026 period, verify-rd-image (Docker build and startup check) went from 1m12s to 19 seconds (about 3.8x), and verify-engram (production Docker build and startup contract checks) went from 2m20s to 31 seconds (about 4.5x). verify-financial, broken down in section 4, went from 3m33s to 1m01s (about 3.5x). verify-app-browser as a whole, which includes the browser screen check step from section 4 (212 seconds down to 36 seconds), went from 5m05s–5m41s to about 58 seconds on a cache hit (1m29s measured including 24 seconds for the initial cache save), and the full main verification run covering all targets went from about 6 minutes to 2m02s (122 seconds, about 3x).

Grouped bar chart comparing PR verification job durations before, between 147 and 222 seconds, and after, between 18 and 76 seconds
Duration of each PR-side job (before and after; upper bound shown for ranges)

A cost structure where moving to 8 cores actually lowered usage costs, and the measures that were not adopted

Even after moving to 8-core runners, as long as each job finishes in under 60 seconds, the usage-based cost per feature PR is 25% lower than before. According to the published pricing, both GitHub's standard Linux 2-vCPU runners and Blacksmith Linux x64 runners are billed per job, rounded up to the nearest minute. Per-minute rates are $0.006 for GitHub standard Linux 2-vCPU, and $0.004 for 2 vCPU, $0.008 for 4 vCPU, and $0.016 for 8 vCPU on Blacksmith Linux x64; 8 vCPU is about 2.67x the price of GitHub's 2 vCPU. However, thanks to the combined effect of the move to Oxc and the node_modules cache, both the PR's verify-app-browser (18 seconds) and verify-app-test (46 seconds) now fit under 60 seconds and finish within the 1-minute minimum billing unit. As a result, based on aios measurements from November 24–25, 2026, the usage-based cost per feature PR dropped 25%, from $0.048 (8 minutes × $0.006) before the changes to $0.036 after, the sum of one 2-vCPU minute ($0.004) and two 8-vCPU minutes ($0.016 each).

Costs fell for other verification jobs as well. Calculated from the published pricing and the measurements, the usage-based cost of post-merge verification on main fell 14%, from $0.042 (7 minutes × $0.006) to $0.036. For the sidecar unit tests, engram fell 56% from $0.018 to $0.008, and financial fell 67% from $0.024 to $0.008. Based on actual usage of 736 ci-cd.yml runs over the past 30 days, compute costs for aios alone come to roughly $30 per month. Even on an actual-payment basis that accounts for the GitHub Free organization's free allowance (2,000 minutes per month), the additional cost stays at about $0–$15 per month (a few dozen yen per day), while CI wait times were cut to about a third.

Following the principle from section 2 — initial implementation and refactoring effort is not a problem because AI agents can write the code, but measures that leave ongoing downsides once in operation are not adopted — three measures were passed over. First, PR-diff-based test selection using the import graph: since the full unit test suite already finishes in 18.5–20 seconds, shaving off 15 seconds is not worth taking on the risk of PRs slipping through with dependency changes that static analysis can't see, such as SQL schemas or HTTP paths (that is, the risk of breaking main). Second, zero-downtime revision switching on Cloud Run: it is precisely because the current design stops for about a minute during deployment to swap versions that breaking changes such as column changes can ship safely in a single PR. Zero-downtime switching assumes old and new versions run simultaneously, which would impose a permanent development constraint of splitting every schema change across multiple PRs. Third, splitting the sidecars (financial and engram) into independent Cloud Run services: the current setup, communicating over 127.0.0.1 within a single instance, has zero latency and the always-on cost of only one machine, whereas splitting them would keep increasing the fixed monthly always-on cost in proportion to the number of services, so it was not adopted.

Bar chart comparing per-run compute cost before and after across feature PRs, main runs, engram, and financial, showing lower cost in every category
Usage-based cost per verification run (before and after)

Speedups that preserve coverage and isolation are the foundation of AI-native development

In AI-native development, where multiple AI agents implement in parallel, the speed and reliability of the automated verification loop directly set the upper limit on development throughput. The six PRs carried out in aios on November 24–25, 2026 overhauled the toolchain, parallelized work while preserving isolation, and improved the CI infrastructure, all without cutting test coverage or the isolation of execution environments. Local verification went from 32.5 seconds to 4.5 seconds (about 7.2x), the total wait for a typical feature PR went from 3m21s–3m42s to 1m16s (about 2.8x), the full main verification run covering all targets went from about 6 minutes to 2m02s (about 3x), and the usage-based cost per feature PR fell 25%. Raising the execution efficiency of the foundation, rather than taking shortcuts that create ongoing operational constraints, is the key to running an autonomous development cycle reliably.

Read next

All insights