SmartTest

ADR-0003: Local intelligence store

Context #

The symbol index, graph inputs, snapshots and run history must persist between runs. Installation must not require a compiler toolchain on any OS, and node:sqlite is not stable across every supported Node release (22.12+).

Decision #

Why not SQLite (yet) #

Measured on synthetic repos: rebuilding the graph from cached analyses takes about 1 ms at 50 modules, about 10 ms at 500 and about 70–120 ms at 2,000. A warm index load takes 5–120 ms. SQLite would add a native dependency or an experimental API with no measurable benefit at these sizes. We'll revisit when benchmarks on larger repositories show the JSON store becoming the bottleneck. The storage interface keeps that change local.

Consequences #

Amendment (1.0.0): persisted graph and index deltas #

At 10,000 modules, rebuilding the graph took 100–150 ms and rewriting the 34 MB index after a one-file edit took about 80 ms, on every warm run. Both are now incremental, and both stay caches that are rebuilt on any doubt:

Edit this page on GitHub