From 2c5e34748e2f1e02653143d888c0d78a7fbf532b Mon Sep 17 00:00:00 2001 From: David Snelling Date: Wed, 2 Sep 2026 11:47:05 -0700 Subject: [PATCH] test(gate): the coverage guard counts the perf lane's config as a gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tests/configs/vitest.perf.config.ts (npm run test:perf) is a real gate, not a manual-only slot, so inGate() now recognizes its include list (tests/performance/** plus the four named files) directly. The 7 files already correctly listed as perf move out of MANUAL_ONLY, which is now reserved for files no automated lane covers. That alone left the guard red: tests/vfs/vfs-search-path-scope.test.ts was a genuine new orphan (added this cycle, named without the .unit.test.ts suffix its siblings use) — it ran under the broad root gate but silently missed test:unit. Renamed to match the sibling convention in tests/vfs/, which puts it back in the unit gate. --- tests/unit/test-suite-coverage-guard.test.ts | 44 +++++++++++++------ ....ts => vfs-search-path-scope.unit.test.ts} | 2 +- 2 files changed, 32 insertions(+), 14 deletions(-) rename tests/vfs/{vfs-search-path-scope.test.ts => vfs-search-path-scope.unit.test.ts} (99%) diff --git a/tests/unit/test-suite-coverage-guard.test.ts b/tests/unit/test-suite-coverage-guard.test.ts index d4d268ac..f12b0587 100644 --- a/tests/unit/test-suite-coverage-guard.test.ts +++ b/tests/unit/test-suite-coverage-guard.test.ts @@ -4,7 +4,8 @@ * config (so it never runs and gives false coverage confidence — the exact drift * that left ~27 test files un-run before 8.0). Every `*.test.ts` must either match * a gate config (`tests/unit/**`, `tests/integration/**`, `*.unit.test.ts`, - * `*.integration.test.ts`) or be explicitly listed in MANUAL_ONLY below. + * `*.integration.test.ts`, or the perf lane's `tests/configs/vitest.perf.config.ts` + * — see PERF_LANE_FILES below) or be explicitly listed in MANUAL_ONLY below. */ import { describe, it, expect } from 'vitest' import { readdirSync } from 'node:fs' @@ -24,10 +25,12 @@ function allTestFiles(dir: string, out: string[] = []): string[] { } /** - * Test files INTENTIONALLY excluded from the unit/integration gate: benchmarks, - * scale/perf measurements, package-size checks, and real-model-load checks. They - * are run manually (slow / need real resources), not in CI. Every entry is a - * conscious decision — a NEW orphan not listed here fails the guard below. + * Test files INTENTIONALLY excluded from every automated gate — conformance + * suites invoked directly, and checks that need real resources (network, + * unusual scale) no CI lane provides. Wall-clock/scale benchmarks that DO + * run automatically belong to the perf lane (PERF_LANE_FILES / inGate + * below), not here. Every entry is a conscious decision — a NEW orphan not + * listed here fails the guard below. */ const MANUAL_ONLY = new Set([ // Conformance suites run as an explicit gate stage (both engines run them @@ -40,15 +43,11 @@ const MANUAL_ONLY = new Set([ // The sparse-store cut's shared operator rows (both engines run these): // explicit conformance-gate invocation, like its siblings. 'tests/conformance/sparse-store-cut.test.ts', - 'tests/api/performance-benchmarks.test.ts', + // NOT the perf lane: no wall-clock/scale assertion, so it does not belong + // in tests/configs/vitest.perf.config.ts's include list — genuinely run + // by hand only. 'tests/critical-neural-validation.test.ts', - 'tests/critical-performance-benchmark.test.ts', - 'tests/model-loading.test.ts', 'tests/package-size-breakdown.test.ts', - 'tests/package-size-limit.test.ts', - 'tests/performance/graph-scale-performance.test.ts', - 'tests/performance/triple-intelligence-scale.test.ts', - 'tests/performance/typeAware.bench.test.ts', // Cross-engine field-addressing conformance suite: pinned bit-for-bit against // the native accelerator's implementation of the SAME contract, and invoked // directly (`npx vitest run tests/conformance/namespace-law.test.ts`), never @@ -59,6 +58,21 @@ const MANUAL_ONLY = new Set([ 'tests/conformance/namespace-law.test.ts' ]) +/** + * The perf lane's own gate: `tests/configs/vitest.perf.config.ts`, run by + * `npm run test:perf`. Mirrors that config's `include` list — kept in sync + * by inspection, the same convention that config uses against the root + * gate's exclude list (see its own header comment). A file that runs here + * is GATED, not manual: it belongs in this set (or the `tests/performance/` + * prefix below), never in MANUAL_ONLY. + */ +const PERF_LANE_FILES = new Set([ + 'tests/critical-performance-benchmark.test.ts', + 'tests/api/performance-benchmarks.test.ts', + 'tests/package-size-limit.test.ts', + 'tests/model-loading.test.ts' +]) + function inGate(rel: string): boolean { return ( rel.startsWith('tests/unit/') || @@ -67,7 +81,11 @@ function inGate(rel: string): boolean { // ('tests/lifecycle/**/*.test.ts'; see tests/lifecycle/README.md). rel.startsWith('tests/lifecycle/') || rel.endsWith('.unit.test.ts') || - rel.endsWith('.integration.test.ts') + rel.endsWith('.integration.test.ts') || + // The perf lane (see PERF_LANE_FILES above) — mirrors + // tests/configs/vitest.perf.config.ts's `tests/performance/**` glob. + rel.startsWith('tests/performance/') || + PERF_LANE_FILES.has(rel) ) } diff --git a/tests/vfs/vfs-search-path-scope.test.ts b/tests/vfs/vfs-search-path-scope.unit.test.ts similarity index 99% rename from tests/vfs/vfs-search-path-scope.test.ts rename to tests/vfs/vfs-search-path-scope.unit.test.ts index fd5fa4d5..1f3f5333 100644 --- a/tests/vfs/vfs-search-path-scope.test.ts +++ b/tests/vfs/vfs-search-path-scope.unit.test.ts @@ -1,5 +1,5 @@ /** - * @module tests/vfs/vfs-search-path-scope + * @module tests/vfs/vfs-search-path-scope.unit * @description `vfs.search({ path })` scopes with a SERVED filter. * * The scope used to be emitted as `path: { $startsWith }` — an operator that is