open-brainy/tests
David Snelling 65493ba2de
Some checks failed
Delta Gate / Delta gate — candidate vs control (push) Waiting to run
CI / Node 22 (push) Failing after 1m29s
CI / Bun (latest) (push) Has been cancelled
CI / Node 24 (push) Failing after 1m29s
CI / Integration + conformance (Node 22) (push) Failing after 1m30s
fix(vfs): a path-scoped search is a served range over the path, not a refused prefix match
`vfs.search({ path })` built its scope as `path: { $startsWith: path }`.
`$startsWith` is not in the filter vocabulary at all, and the `$`-less spelling
is REFUSED by the metadata index's served-operator law — an equality/range
posting index cannot evaluate a substring without reading every row, so it
refuses rather than answering an empty page. Every path-scoped VFS search threw
on this engine line; the two pins in tests/vfs/vfs.unit.test.ts that exercise it
have been red since the operator law landed.

The scope is now a half-open range over `metadata.path`:
`[dir + '/', dir + '0')`. Every descendant path begins with `dir + '/'`, and '0'
is the code point directly after '/', so membership in the range is EXACTLY
"carries that prefix" — and because the bounds differ at one ASCII position the
answer is identical under code-unit and code-point collation. Siblings fall out
correctly for the same reason: `/scope-sibling/x` sorts below the lower bound
and `/scope0` sits at the open upper bound. `recursive: false` narrows to the
directory's own identity instead — `parent`, an indexed equality. The root
adds no clause, because every VFS entity is under it.

`path` is the VFS's truth (write and rename maintain it; the `Contains` edges
are a projection of it), it is already indexed on every VFS entity, and
`explain()` reports the range as `column-store` — "O(log n) binary search +
roaring bitmap". So the scope narrows the search before it runs: no tree walk,
no migration, no backfill, and nothing fetched that the scope then discards.

Two other shapes were considered and rejected. A graph-scoped walk over
`Contains` reads the projection rather than the truth and costs O(subtree)
adjacency lookups per search, with the subtree's height as an unknown `depth`.
An indexed `ancestors: string[]` field cannot be implemented honestly today:
the index extractor skips arrays longer than ten elements, so a path more than
ten levels deep would silently drop out of every scoped search — and it needs
a backfill besides.

Pinned in tests/vfs/vfs-search-path-scope.test.ts (all eight red before this
change): descendants at three depths and never a sibling, including the
`/scope-sibling` and `/scope0` prefix traps; a trailing or doubled slash names
the same scope; the root scope equals the unscoped search; `recursive: false`
is the immediate children and refuses a missing directory by name; every
operator the search emits is ANSWERED by the index's own door rather than
refused; the id universe the index resolves for the search is already the
scope; and the range agrees with walking the tree.
2026-09-02 10:38:59 -07:00
..
api test(8.0): re-home orphaned test files into the gate + guard against recurrence 2026-06-29 11:47:18 -07:00
benchmarks perf(8.0): allocation-free distance loops (6x cosine) — evidence-revised Fork X 2026-07-01 10:55:04 -07:00
comprehensive test(8.0): re-home orphaned test files into the gate + guard against recurrence 2026-06-29 11:47:18 -07:00
configs ci(test): perf and scale benchmarks leave the correctness gate 2026-09-02 10:21:06 -07:00
conformance feat(query): the sparse-store cut — where on a never-carried field serves operator truth, never a refusal 2026-08-12 15:57:19 -07:00
fixtures feat(conformance): the golden-log fold oracle — encoder bytes and fold semantics pinned by content hash 2026-08-10 11:02:40 -07:00
helpers feat(log): log authority is the fleet default — adopt-at-open, oracle-gated; plus the power-cut throw-site cures and the loud torn-record contract 2026-08-11 08:37:38 -07:00
integration test(open): pin the pending-embed checkpoint — stuck id, crash matrix, torn fallback 2026-09-02 10:20:38 -07:00
integrations test(8.0): re-home orphaned test files into the gate + guard against recurrence 2026-06-29 11:47:18 -07:00
lifecycle fix(hnsw): skip unvectored rows on rebuild; refuse empty vectors in the index 2026-08-27 13:29:11 -07:00
performance chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
regression feat(namespace): NO SPECIAL NAMES + storage fidelity — the ruled completion of the field-addressing law 2026-08-03 16:59:32 -07:00
scripts refactor(8.0)!: remove distributed clustering subsystem — inert/orphaned, scale is single-process + native provider 2026-06-15 10:37:39 -07:00
transaction fix: transaction timeouts are a typed no-hot-retry contract; engine-side non-retry pinned; dead transaction path removed 2026-07-24 16:01:41 -07:00
unit fix(generations): a sealed segment may only declare the generations it holds 2026-08-31 10:47:08 -07:00
vfs fix(vfs): a path-scoped search is a served range over the path, not a refused prefix match 2026-09-02 10:38:59 -07:00
critical-neural-validation.test.ts chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
critical-performance-benchmark.test.ts chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
model-loading.test.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
package-size-breakdown.test.ts chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
package-size-limit.test.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
setup-integration.ts test(8.0): Tier-1 integration via deterministic embedder (suite runnable again) 2026-06-16 12:44:14 -07:00
setup-semantic.ts test(8.0): integration rot pass — 77→17 failures (parallel per-file hardening) 2026-06-17 13:11:41 -07:00
setup-unit.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
setup.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
type-utils.unit.test.ts test(8.0): re-home orphaned test files into the gate + guard against recurrence 2026-06-29 11:47:18 -07:00