open-brainy/src
David Snelling 3a62445465 feat: visibility tier (public/internal/system) on nouns + verbs
Adds a reserved, top-level `visibility` field (mirrors the subtype rollout):
'public' (default, surfaced) | 'internal' (a consumer's app-internal data — hidden
from default find()/getRelations()/counts/stats, opt-in via includeInternal) |
'system' (Brainy plumbing, library-set only; the add()/relate() param narrows to
'public' | 'internal').

Fixes a real leak: the VFS root entity counted in getNounCount() and appeared in
find() (a fresh brain reported 1 entity). It is now visibility:'system' → excluded
from every user-facing surface (fresh brain reports 0).

- Reserved (STANDARD_ENTITY_FIELDS / STANDARD_VERB_FIELDS) — surfaced top-level on
  reads, never in the custom metadata bag; a 'public'/'internal' value smuggled
  through metadata is lifted to the field, 'system' dropped with a one-shot warning.
- Threaded through add/relate/update/updateRelation + their internal mirrors;
  stored only when not 'public' so the common case stays lean.
- Default exclusion in counts (baseStorage, isCountedVisibility), find()/getRelations()
  (hard candidate filter via excludeVisibility — keeps top-K/limit/offset correct),
  and rebuildCounts; includeInternal/includeSystem opt-ins.
- VFS root marked 'system'.

Same on-disk shape as the 8.0 line, so it carries forward unchanged. Backward-compatible:
absent === 'public', so all existing data stays counted + returned.

Tests: tests/unit/brainy/visibility.test.ts 17/17 (fresh-brain getNounCount()===0,
internal hidden + opt-in, verb symmetry, top-level surfacing, metadata-spoof rejection).
1522 unit green; count-synchronization integration green.
2026-06-19 16:40:35 -07:00
..
aggregation fix: internal subtype consistency + brain.audit() diagnostic + improved enforcement errors 2026-06-08 11:31:47 -07:00
api refactor: rename BackupData → PortableGraph (the type is interchange, not a backup) 2026-06-19 12:30:06 -07:00
cli refactor: rename BackupData → PortableGraph (the type is interchange, not a backup) 2026-06-19 12:30:06 -07:00
config fix: remove dead model config code for true zero-config 2025-12-18 10:31:02 -08:00
critical feat: replace transformers.js with direct ONNX WASM for Bun compatibility 2025-12-17 17:42:37 -08:00
data feat: Phase 3 - Unified Semantic Type Inference (Nouns + Verbs) 2025-10-16 10:59:26 -07:00
distributed feat(v4.0.0): Complete metadata/vector separation architecture with Azure support 2025-10-17 12:29:27 -07:00
embeddings fix: suppress misleading 'Using Q8 WASM' log when Cortex native is active 2026-03-22 14:53:48 -07:00
errors fix: find()/stats() correctness + Cortex compat (BR-FIND-WHERE-ZERO, BR-DEFENSIVE-INTERFACE) 2026-05-15 12:31:28 -07:00
graph feat: export provider contracts for the plugin surface brainy consumes 2026-05-27 14:45:40 -07:00
hnsw fix: mmap-vector backend capacity NaN at the provider FFI boundary 2026-06-10 09:29:54 -07:00
import fix: internal subtype consistency + brain.audit() diagnostic + improved enforcement errors 2026-06-08 11:31:47 -07:00
importers fix: internal subtype consistency + brain.audit() diagnostic + improved enforcement errors 2026-06-08 11:31:47 -07:00
indexes/columnStore feat: column-store JS↔native interchange — raw-blob unify (2.4.0 #4) 2026-05-28 10:37:47 -07:00
integrations fix: internal subtype consistency + brain.audit() diagnostic + improved enforcement errors 2026-06-08 11:31:47 -07:00
interfaces fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
mcp fix: internal subtype consistency + brain.audit() diagnostic + improved enforcement errors 2026-06-08 11:31:47 -07:00
migration feat: add migration system with error handling, validation, and enterprise hardening 2026-02-09 16:13:14 -08:00
neural fix: recalibrate find({ limit }) cap + two-tier enforcement + caller location 2026-06-08 12:49:43 -07:00
patterns 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
scripts feat: add node: protocol to all Node.js built-in imports for bundler compatibility 2025-09-17 14:20:21 -07:00
storage feat: visibility tier (public/internal/system) on nouns + verbs 2026-06-19 16:40:35 -07:00
streaming feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
transaction fix: vfs.rename() issues a metadata-only update + rollback of fresh adds removes them 2026-06-11 14:59:40 -07:00
triple fix: flush all native providers on shutdown to prevent data loss 2026-02-01 16:23:49 -08:00
types feat: visibility tier (public/internal/system) on nouns + verbs 2026-06-19 16:40:35 -07:00
universal fix: prevent fs adapter from throwing on import in browser 2025-09-17 16:22:02 -07:00
utils feat: visibility tier (public/internal/system) on nouns + verbs 2026-06-19 16:40:35 -07:00
versioning fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
vfs feat: visibility tier (public/internal/system) on nouns + verbs 2026-06-19 16:40:35 -07:00
brainy.ts feat: visibility tier (public/internal/system) on nouns + verbs 2026-06-19 16:40:35 -07:00
coreTypes.ts feat: visibility tier (public/internal/system) on nouns + verbs 2026-06-19 16:40:35 -07:00
index.ts refactor: rename BackupData → PortableGraph (the type is interchange, not a backup) 2026-06-19 12:30:06 -07:00
internals.ts feat(8.0): EntityIdMapper U32 ceiling + EntityIdSpaceExceeded error 2026-06-02 10:20:01 -07:00
pipeline.ts refactor: remove augmentation system and semantic type matching 2026-02-01 10:48:56 -08:00
plugin.ts feat(plugin): DiskAnnProvider contract + HNSWConfig.type/diskann knobs 2026-05-28 14:29:12 -07:00
setup.ts fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
unified.ts chore: enforce consistent coding style and semicolon removal 2025-09-29 09:50:59 -07:00
worker.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00