Skip to content

Test Suite Overview

This page maps the full tests/ directory: what exists, what each test validates, and how to run everything.

Test Categories

CategoryLocationPurpose
Pre-build gatetests/pre-build.test.mjsOrchestrates release-critical checks before publish.
Axiomstests/axioms.test.tsVerifies invariants (stealth roots, hash-chain, LWW, pointers, operators).
Phasestests/phases.test.jsEnd-to-end fire tests for feature phases 0-8.
Build compatibilitytests/Builds/*Ensures CJS/ESM/UMD outputs behave correctly.
DSL contractstests/contracts/dsl.contract.test.mjsContract suite for selector/filter/broadcast/query behavior.
Benchmarkstests/Benchmarks/*Performance and complexity characterization.
Demostests/Demos/*, tests/sand.tsPractical usage walkthroughs and exploratory scripts.

Run Commands

CommandWhat It Runs
npm run test:prebuildBuild + Axioms + Phases + CJS/ESM/TS/UMD checks
npm run test:contractsDSL contract suite
npm run test:demosRuns the three practical walkthrough demos under tests/Demos/*
npm run test:tsType-check (tsc --noEmit)
npm run test:umdUMD runtime compatibility test
npm run test:phase3:exactExact vector-search correctness baseline
npm run test:phase3:ivfIVF sidecar smoke test
npm run bench:vector:corpusColumnar secret vector corpus write/read validation
npm run bench:phase3:exact-scaleExact vector-search scaling benchmark
npm run bench:phase3:ivf-vs-exactExact vs IVF comparison on the same corpus
npm run bench:phase3:ivf-tuningIVF tuning sweep (nlist, nprobe, candidate caps, dataset mode)

You can also run files directly:

bash
node tests/axioms.test.ts
node tests/phases.test.js
node tests/contracts/dsl.contract.test.mjs
node tests/Benchmarks/benchmark.11.secret-push-vs-pull.test.ts

Suggested CI Order

  1. npm run test:prebuild
  2. npm run test:contracts
  3. Optional nightly: selected benchmarks + regression gate
  4. Performance work: test:phase3:* and bench:phase3:* when changing vector search or secret chunk storage

Current Performance Story

  • Phase 1 proved batch-write viability and removed heavy journal retention from _memories.
  • Phase 2 closed bounded residency for the secret vector corpus by switching to chunked columnar envelopes with typed payloads.
  • Phase 3 closed realistic ANN search at 100k on a chunk-coherent corpus with IVF p95 = 3318.42ms, recall@10 = 1.000, and 18.40 chunks/query.
  • The hostile legacy_fragmented corpus remains in the suite as a documented worst-case profile rather than a hidden failure mode.