docs: rename the native provider to @soulcraft/cor across public docs and JSDoc

The 3.0 native engine ships as @soulcraft/cor (brainy 8.x <-> cor 3.x are a
version-matched pair); the old @soulcraft/cortex package stays on the 2.x/7.x
line. Public docs and .d.ts-visible comments now name the correct package.
Historical 2.x contract references (e.g. the 2.3.1 read-side fallback) keep
the old name deliberately.
This commit is contained in:
David Snelling 2026-07-02 15:11:41 -07:00
parent a3c2717ddb
commit bf4a333f9b
38 changed files with 104 additions and 104 deletions

View file

@ -635,13 +635,13 @@ export class Brainy<T = any> implements BrainyInterface<T> {
* Whether the active storage adapter (anywhere in its prototype chain)
* implements a given optional method.
*
* Storage-adapter plugins (e.g. `@soulcraft/cortex`'s `MmapFileSystemStorage
* Storage-adapter plugins (e.g. `@soulcraft/cor`'s `MmapFileSystemStorage
* extends FileSystemStorage`) inherit new methods Brainy adds to
* `FileSystemStorage` / `BaseStorage` automatically `typeof` walks the
* prototype chain, so there's no in-package version skew to worry about as
* long as the plugin's own dist resolves `@soulcraft/brainy` dynamically
* (which Cortex 2.2.x onward does see
* `node_modules/@soulcraft/cortex/dist/storage/mmapFileSystemStorage.js`).
* `node_modules/@soulcraft/cor/dist/storage/mmapFileSystemStorage.js`).
*
* This helper exists for the **build/install** failure modes the import
* resolution can't catch:
@ -776,7 +776,7 @@ export class Brainy<T = any> implements BrainyInterface<T> {
try {
// Auto-detect and activate plugins BEFORE storage setup
// so plugin-provided storage factories (e.g., filesystem override from cortex) are available
// so plugin-provided storage factories (e.g., filesystem override from cor) are available
await this.loadPlugins()
// 7.x → 8.0 layout migration, BEFORE storage setup: collapse a legacy
@ -793,7 +793,7 @@ export class Brainy<T = any> implements BrainyInterface<T> {
// Skipped in reader mode and on backends that don't support multi-process locking.
// Throws if another live writer holds the directory (unless force: true).
//
// Defensive call: older storage adapters (e.g. `@soulcraft/cortex@2.2.0`
// Defensive call: older storage adapters (e.g. `@soulcraft/cor@2.2.0`
// and earlier) bundle a pre-7.21 `BaseStorage` that doesn't define these
// methods. We feature-detect each one rather than fail boot.
if (this.config.mode !== 'reader') {
@ -900,7 +900,7 @@ export class Brainy<T = any> implements BrainyInterface<T> {
setMsgpackImplementation(msgpackProvider)
}
// Provider: sort:topK (e.g. cortex's native partial-sort / heap-select) — swaps the
// Provider: sort:topK (e.g. cor's native partial-sort / heap-select) — swaps the
// JS result-ranking used by find() to pick the top `offset + limit` rows. The provider
// returns indices into a scores array, ordered descending with stable ties, identical
// to the JS sortTopKIndicesJs. rankIndicesByScore validates the provider's output and
@ -927,7 +927,7 @@ export class Brainy<T = any> implements BrainyInterface<T> {
if (metadataFactory) {
this.metadataIndex = metadataFactory(this.storage)
} else {
// JS fallback — inject native EntityIdMapper if cortex provides one
// JS fallback — inject native EntityIdMapper if cor provides one
const entityIdMapperFactory = this.pluginRegistry.getProvider<(storage: StorageAdapter) => any>('entityIdMapper')
this.metadataIndex = new MetadataIndexManager(this.storage, {}, {
entityIdMapper: entityIdMapperFactory ? entityIdMapperFactory(this.storage) : undefined,
@ -9756,7 +9756,7 @@ export class Brainy<T = any> implements BrainyInterface<T> {
/**
* Assert that specific providers are supplied by a plugin (not using JS fallback).
*
* Call after init() in production to fail fast if a paid plugin (e.g. cortex)
* Call after init() in production to fail fast if a paid plugin (e.g. cor)
* isn't providing the expected acceleration. Throws if any listed key is using
* the default JavaScript implementation.
*
@ -9768,7 +9768,7 @@ export class Brainy<T = any> implements BrainyInterface<T> {
* const brain = new Brainy()
* await brain.init()
*
* // Fail fast if cortex isn't providing these
* // Fail fast if cor isn't providing these
* brain.requireProviders(['distance', 'embeddings', 'metadataIndex', 'graphIndex'])
* ```
*/
@ -13274,7 +13274,7 @@ export class Brainy<T = any> implements BrainyInterface<T> {
/**
* @description Wire the HNSW connections codec (2.4.0 #3). Activates when
* BOTH (a) the `graph:compression` provider is registered (cortex registers
* BOTH (a) the `graph:compression` provider is registered (cor registers
* `{ encode: encodeConnections, decode: decodeConnections }`), and (b) the
* metadata index exposes a stable idMapper. Failures are non-fatal: HNSW
* keeps working via the legacy JSON-array path.
@ -14024,7 +14024,7 @@ export class Brainy<T = any> implements BrainyInterface<T> {
* case under durable storage, where a brain reopens pre-populated would otherwise
* return `[]`. On first query we clear the aggregate's state and stream every stored
* noun back through it. Storage-agnostic: `getNouns()` works for in-memory, the
* filesystem adapter, and native (Cortex) storage alike. One-time per definition
* filesystem adapter, and native (Cor) storage alike. One-time per definition
* the rebuilt state is persisted on flush() and reloaded on the next session.
*/
private async backfillAggregateIfNeeded(name: string): Promise<void> {
@ -14074,7 +14074,7 @@ export class Brainy<T = any> implements BrainyInterface<T> {
await this.autoCompactHistory()
// Phase 1: Flush ALL components in parallel to persist buffered data
// This is critical when cortex native providers buffer data in Rust memory
// This is critical when cor native providers buffer data in Rust memory
await Promise.all([
// Flush HNSW dirty nodes (deferred persistence mode)
(async () => {