brainy/src
David Snelling 21d02d3bae fix(8.0): stats() per-type counts no longer inflate with HNSW re-saves
nounCountsByType (read by stats().entitiesByType / counts.byTypeEnum) was
incremented in saveNoun_internal(), which runs on every noun write — including
the HNSW index re-saving a node whenever its neighbor links change. So per-type
counts grew with graph connectivity instead of entity count (an internal report
saw 8 documents read as 44). Moved the increment into saveNounMetadata_internal(),
gated on isNew + visibility, exactly parallel to the authoritative total; the
visibility-flip path adjusts it in lockstep too.

Tests: tests/unit/storage/stats-count-accuracy.test.ts (30 dense-type entities ->
exactly 30 across stats/counts/getNounCount) + de-theatricalized the >=2 assertion
in brainy-core.unit.test.ts to exact equality. Build green; 1455 unit green.

Part of the 8.0 readiness audit Phase 1; cold-reopen count rehydration is still WIP.
2026-06-17 17:07:58 -07:00
..
aggregation fix(8.0): distinctCount aggregates distinct values of any type + edge-case regression tests 2026-06-17 12:03:06 -07:00
cli chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
db feat(8.0): validateBackup() dry-run + includeContent blob round-trip test + clone test 2026-06-17 11:44:29 -07:00
embeddings test(8.0): Tier-1 integration via deterministic embedder (suite runnable again) 2026-06-16 12:44:14 -07:00
errors chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
graph feat(8.0): thread commit generation through the graph-write provider contract 2026-06-16 09:42:35 -07:00
hnsw feat(8.0): zero-config finalize + cut JS quantization (config.vector = recall + persistMode) 2026-06-15 10:08:51 -07:00
import chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
importers chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
indexes/columnStore chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
integrations chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
mcp chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
migration feat(8.0)!: delete fork/branch/commit/history/versions — superseded by the Db API 2026-06-10 15:22:47 -07:00
neural fix(8.0): neural.clusters()/similarity must request vectors from get() 2026-06-16 13:13:07 -07:00
patterns chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
storage fix(8.0): stats() per-type counts no longer inflate with HNSW re-saves 2026-06-17 17:07:58 -07:00
streaming chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
transaction feat(8.0): thread commit generation through the graph-write provider contract 2026-06-16 09:42:35 -07:00
triple chore(8.0): Phase A + B — purge all @deprecated APIs + cacheManager dead branches 2026-06-09 15:33:56 -07:00
types feat(8.0): visibility field (public/internal/system) on nouns + verbs 2026-06-16 15:20:26 -07:00
universal chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00
utils fix(8.0): real bugs surfaced by integration hardening — where-intersect, related() offset, relate() updatedAt 2026-06-17 13:19:54 -07:00
vfs feat(8.0): visibility field (public/internal/system) on nouns + verbs 2026-06-16 15:20:26 -07:00
brainy.ts fix(8.0): real bugs surfaced by integration hardening — where-intersect, related() offset, relate() updatedAt 2026-06-17 13:19:54 -07:00
coreTypes.ts feat(8.0): visibility field (public/internal/system) on nouns + verbs 2026-06-16 15:20:26 -07:00
index.ts feat(8.0): validateBackup() dry-run + includeContent blob round-trip test + clone test 2026-06-17 11:44:29 -07:00
internals.ts feat(8.0): EntityIdMapper U32 ceiling + EntityIdSpaceExceeded error 2026-06-02 10:20:01 -07:00
plugin.ts feat(8.0): thread commit generation through the graph-write provider contract 2026-06-16 09:42:35 -07:00
setup.ts chore(8.0): collapse dead defensive guards + redundant polyfills 2026-06-09 16:46:16 -07:00
unified.ts chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase 2026-06-11 14:51:00 -07:00