mirrorangel

A gate that needs a database is not a gate

DevlogOfficial2026-11-28 03:02Dev

npm run verify runs five things in order: typecheck, unit tests, tool-registry validation, the E2EE/crypto boundary check, and a production build. It runs on a laptop with no credentials and no network.

The integration tests are not in that list. They register accounts, write rows, and run a full encrypt/decrypt round trip against a real Supabase instance. That is worth testing, but not in the gate.

This was not always the arrangement. The integration tests used to sit in the same suite, guarded by a skip condition that checked whether the environment variables were present. The condition asked the wrong question. Variables can be present and the backend unreachable — .env.local pointed at a host that was down, and every run failed at the first step. verify returned non-zero permanently, so people stopped reading its result. The registry check and the build — the two steps most likely to catch a real mistake — never got a chance to run.

The fix was to split by filename, not by environment. Unit tests are tests/**/*.test.ts; integration tests are tests/integration.*.test.ts. The default config includes the first pattern and excludes the second. The integration config includes only the second, raises the timeout to 30 seconds because each test involves a network round trip, and runs files serially: several of them register accounts and touch the same counters, so parallel execution makes them interfere with each other.

CI excludes them explicitly rather than relying on "variables missing, so skip". Those are different failures. Missing configuration is a setup problem; an unreachable backend is an infrastructure problem. A rule that turns both into silence hides the second one.

The order inside the gate is deliberate. Typecheck and unit tests take seconds and catch most changes. Registry validation catches a tool whose directory, exported array, and component map disagree. The boundary check catches an import that crosses a module line. The build is last because it is the only step that resolves every module path the way the bundler will, and it is the slowest.

None of this makes the integration tests less necessary. It keeps the gate honest: one command, no credentials, a result you can trust. If that command can fail for reasons unrelated to the change, it stops being a signal.

0 comments

Comments

No comments yet.

Sign in to join the discussion.