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:
parent
a3c2717ddb
commit
bf4a333f9b
38 changed files with 104 additions and 104 deletions
|
|
@ -7,12 +7,12 @@
|
|||
* and is byte-for-byte identical to Rust's `str::cmp` (`as_bytes().cmp()`). This is:
|
||||
* - **deterministic** across environments (unlike `localeCompare`, whose default-locale
|
||||
* ordering varies by OS / Node / ICU build — unsafe for a persisted sorted index), and
|
||||
* - **cross-language consistent** with `@soulcraft/cortex`'s native column store and
|
||||
* - **cross-language consistent** with `@soulcraft/cor`'s native column store and
|
||||
* aggregation sort, so query results are identical with or without the native plugin.
|
||||
*
|
||||
* Use this instead of `String.localeCompare` and the `<`/`>` operators (which compare
|
||||
* UTF-16 code units and diverge from code-point order for supplementary-plane characters)
|
||||
* wherever ordering is persisted or must match the native engine. See cortex `docs/ADR-001`.
|
||||
* wherever ordering is persisted or must match the native engine. See cor `docs/ADR-001`.
|
||||
*/
|
||||
|
||||
const utf8 = new TextEncoder()
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import type { EntityIdMapperProvider } from '../plugin.js'
|
|||
* The largest entity int the JS fallback `EntityIdMapper` will allocate.
|
||||
* The metadata index's roaring bitmaps are 32-bit-keyed (`Roaring32`), so
|
||||
* allowing the JS counter past this point would silently corrupt every
|
||||
* downstream bitmap. The cortex 3.0 binary mapper supports a U64 IdSpace
|
||||
* downstream bitmap. The cor 3.0 binary mapper supports a U64 IdSpace
|
||||
* for brains above this ceiling — see the
|
||||
* [`EntityIdSpaceExceeded`](#EntityIdSpaceExceeded) message for the
|
||||
* migration pointer.
|
||||
|
|
@ -50,8 +50,8 @@ export const U32_ENTITY_ID_MAX = 0xffff_ffff
|
|||
/**
|
||||
* Thrown by the JS fallback `EntityIdMapper` when `nextId` would exceed
|
||||
* [`U32_ENTITY_ID_MAX`](#U32_ENTITY_ID_MAX). The JS path is the
|
||||
* cortex-free fallback; once a brain has more than ~4.29 B entities,
|
||||
* callers MUST install the cortex 3.0 `NativeBinaryEntityIdMapper` with
|
||||
* cor-free fallback; once a brain has more than ~4.29 B entities,
|
||||
* callers MUST install the cor 3.0 `NativeBinaryEntityIdMapper` with
|
||||
* `idSpace: 'u64'` (mmap-backed extendible-hash KV; persists the full
|
||||
* u64 range losslessly).
|
||||
*
|
||||
|
|
@ -96,7 +96,7 @@ export interface EntityIdMapperData {
|
|||
* Maps entity UUIDs to integer IDs for use with Roaring Bitmaps.
|
||||
*
|
||||
* Implements {@link EntityIdMapperProvider}: the surface a registered
|
||||
* `'entityIdMapper'` provider (e.g. Cortex's native mapper) must also satisfy.
|
||||
* `'entityIdMapper'` provider (e.g. Cor's native mapper) must also satisfy.
|
||||
*/
|
||||
export class EntityIdMapper implements EntityIdMapperProvider {
|
||||
private storage: StorageAdapter
|
||||
|
|
@ -162,7 +162,7 @@ export class EntityIdMapper implements EntityIdMapperProvider {
|
|||
* The JS fallback mapper caps at [`U32_ENTITY_ID_MAX`](#U32_ENTITY_ID_MAX)
|
||||
* to match the metadata index's Roaring32 bitmap width — once `nextId`
|
||||
* would exceed that, throws {@link EntityIdSpaceExceeded} so the caller
|
||||
* loudly migrates to cortex's binary mapper with `idSpace: 'u64'`
|
||||
* loudly migrates to cor's binary mapper with `idSpace: 'u64'`
|
||||
* rather than silently truncating entity ids.
|
||||
*/
|
||||
getOrAssign(uuid: string): number {
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ export interface MetadataIndexConfig {
|
|||
}
|
||||
|
||||
export interface MetadataIndexOptions {
|
||||
entityIdMapper?: EntityIdMapper // Optional pre-configured EntityIdMapper (e.g., native from cortex)
|
||||
entityIdMapper?: EntityIdMapper // Optional pre-configured EntityIdMapper (e.g., native from cor)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -107,7 +107,7 @@ interface FieldStats {
|
|||
/**
|
||||
* Implements {@link MetadataIndexProvider}: the metadata-index surface Brainy
|
||||
* calls on whatever the `'metadataIndex'` provider resolves to (its own
|
||||
* manager, or Cortex's native Rust engine).
|
||||
* manager, or Cor's native Rust engine).
|
||||
*/
|
||||
export class MetadataIndexManager implements MetadataIndexProvider {
|
||||
private storage: StorageAdapter
|
||||
|
|
@ -221,7 +221,7 @@ export class MetadataIndexManager implements MetadataIndexProvider {
|
|||
// Get global unified cache for coordinated memory management
|
||||
this.unifiedCache = getGlobalCache()
|
||||
|
||||
// Use injected EntityIdMapper (e.g., native from cortex) or create JS fallback
|
||||
// Use injected EntityIdMapper (e.g., native from cor) or create JS fallback
|
||||
this.idMapper = options.entityIdMapper ?? new EntityIdMapper({
|
||||
storage,
|
||||
storageKey: 'brainy:entityIdMapper'
|
||||
|
|
@ -2196,7 +2196,7 @@ export class MetadataIndexManager implements MetadataIndexProvider {
|
|||
if (b.value == null) return order === 'asc' ? -1 : 1
|
||||
if (a.value === b.value) return 0
|
||||
// Numbers compare numerically; everything else by code-point (UTF-8 byte) order.
|
||||
// This makes the JS fallback sort match cortex's native column store exactly
|
||||
// This makes the JS fallback sort match cor's native column store exactly
|
||||
// (numeric i64/f64 vs code-point strings) and stay deterministic across
|
||||
// environments, unlike the `<` operator's UTF-16 ordering for strings.
|
||||
let comparison: number
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* provider (DiskANN-style) has taken over the `'vector'` provider key.
|
||||
*
|
||||
* **Public contract** — locked in handoff thread BRAINY-8.0-RENAME-COORDINATION
|
||||
* § A.2 (cortex-confirmed 2026-06-09):
|
||||
* § A.2 (cor-confirmed 2026-06-09):
|
||||
* - `'fast'` — minimum-latency search, accepts lower recall
|
||||
* - `'balanced'` — Brainy 7.x defaults, the right pick for almost everyone
|
||||
* - `'accurate'` — maximum recall, accepts higher latency
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* **Knob mapping** — the JS HNSW preset values below match what Brainy 7.x
|
||||
* shipped as defaults for `'balanced'`. Native acceleration providers (e.g.
|
||||
* cortex's DiskANN wrapper) read the same `recall` value off the index
|
||||
* cor's DiskANN wrapper) read the same `recall` value off the index
|
||||
* config and translate it to their own internal knobs.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* This module exposes a swappable `sort:topK` seam:
|
||||
* - {@link rankIndicesByScore} returns the indices of `scores` ordered exactly as a
|
||||
* descending stable sort would order them, then truncated to `k`.
|
||||
* - {@link setSortTopKImplementation} lets a native plugin (e.g. cortex's Rust
|
||||
* - {@link setSortTopKImplementation} lets a native plugin (e.g. cor's Rust
|
||||
* partial-sort / heap-select) replace the JS implementation. The native provider
|
||||
* only has to return the same *index ordering* the JS path produces.
|
||||
*
|
||||
|
|
@ -147,7 +147,7 @@ export function reorderByIndices<T>(items: T[], order: number[]): T[] {
|
|||
}
|
||||
|
||||
/**
|
||||
* Replace the `sort:topK` implementation at runtime (e.g. cortex's native partial sort).
|
||||
* Replace the `sort:topK` implementation at runtime (e.g. cor's native partial sort).
|
||||
* Called by `brainy.ts` when a `sort:topK` provider is registered. Pass
|
||||
* {@link sortTopKIndicesJs} to restore the JS default.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ let _impl: typeof WasmRoaringBitmap32 = WasmRoaringBitmap32
|
|||
|
||||
/**
|
||||
* Replace the RoaringBitmap32 implementation at runtime.
|
||||
* Called by brainy.ts when a cortex 'roaring' provider is registered.
|
||||
* Called by brainy.ts when a cor 'roaring' provider is registered.
|
||||
*/
|
||||
export function setRoaringImplementation(impl: typeof WasmRoaringBitmap32) {
|
||||
_impl = impl
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ export interface UnifiedCacheConfig {
|
|||
*
|
||||
* Implements {@link CacheProvider}: the surface Brainy calls on whatever cache
|
||||
* is installed as the global cache (its own instance, or a registered
|
||||
* `'cache'` provider such as Cortex's native eviction engine).
|
||||
* `'cache'` provider such as Cor's native eviction engine).
|
||||
*/
|
||||
export class UnifiedCache implements CacheProvider {
|
||||
private cache = new Map<string, CacheItem>()
|
||||
|
|
@ -444,7 +444,7 @@ export class UnifiedCache implements CacheProvider {
|
|||
/**
|
||||
* Dynamically resize the cache maximum. If the new size is smaller than
|
||||
* the current usage, evicts lowest-value items until the cache fits within
|
||||
* the new budget. Used by Cortex's ResourceManager to rebalance cache vs
|
||||
* the new budget. Used by Cor's ResourceManager to rebalance cache vs
|
||||
* instance memory as brainy instances are created and evicted.
|
||||
*
|
||||
* @param newMaxSize - New maximum cache size in bytes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue