Skip to main content

Tracegate – local CI that only skips tests it has proven it can skip

Kagi Small Github
1 lis 2026, 00:42Tech
Oryginał
2 min read

Tracegate CI, a new continuous integration tool, reduces test execution by running only what code changes can affect, earning the right to skip the rest through measured evidence.

Tracegate CI represents a significant advancement in continuous integration by implementing a sophisticated system that records what each test actually touches during execution—including functions, modules, and repository files. This per-file footprint is written into a ledger, allowing tests whose footprint hasn't changed since their last successful run to reuse that verdict after meeting specific criteria.

The system operates on a principle of measured evidence before allowing test reuse. It begins with a 'shadow' phase where everything runs while logging what could have been skipped. A test lane only starts skipping tests after meeting an 'entry bar' of sufficient observations without misses. Random audits are conducted on a share of reusable verdicts, and any test predicted reusable that fails causes the lane to revert to running all tests until it re-earns the entry bar.

Production Implementation

Tracegate has been successfully implemented and runs in production within a private TypeScript monorepo containing approximately 2,700 backend and 1,000 frontend test files. The tool operates within a local merge gate that batches pull requests into merge trains and automatically bisects failing merge trains.

The development has progressed through multiple phases, with Phase 0 (deterministic core for Vitest + TypeScript), Phase 0.5 (broker implementation), Phase 0.6 (adaptive capacity management), Phase 1a (Red Reader for AI agent sessions), Phase 1b (escalation capabilities), Phase 2 (Conductor for ranking files), and Phase 3 (dependency changes) all completed. Additional features include a jobserver per lease and support for various build tools.

Unique Approach

Unlike many AI-in-CI products that attempt to fix or skip tests, Tracegate CI takes a different approach. The first model in the gate may only make testing stricter by reading every test the gate wants to dismiss as a flake and potentially escalating it to a real bug, never the reverse. Model decisions are cached by input hash, ensuring gates are replayable, and models run in shadow mode before making any decisions without tools or credentials.

Implementation Details

The tool requires Node.js ≥ 22, git, and supports Vitest 4.1 to 5.x or Jest 30. It's available as an npm package called 'tracegate-ci' and includes a Claude Code plugin. Installation involves running 'npm install --save-dev tracegate-ci' followed by 'npx tracegate init' to configure lanes. Each lane represents one Vitest project with specific source directories and configuration options.

Tracegate CI maintains strict safety measures: it cannot turn a red test into a green, failing files' footprints are dropped, moved trees are refused, and footprints older than 72 hours are never reused. The system also includes a Claude Code plugin that bundles an MCP server and subagents, with a PreToolUse hook that ensures all test runs queue through the broker on the same machine.

Z.ai
Article written by AI
Z.ai GLM-4.5-FlashFree
Free AI articles150 of 150
No limit after signing in with Telegram