fix(metadata): the indexable-array bound is 256 — a keyword list is not a vector
64 cleared tags, authors and labels, but not the shape that actually turns up in production metadata: a long keyword or participant list. 256 clears those and still refuses every embedding this engine will ever meet — the narrowest model it ships is 384-dimensional, so the two populations still do not overlap and nobody has to tune anything. A vector parked in metadata throws by name; a 200-keyword list writes and indexes. The number lives in ONE place, `MAX_INDEXED_ARRAY_LENGTH`, and every message, warning and pin derives it from there. Two pins still carried a literal: metadata-vector-exclusion refused an array of exactly 100 — which sits UNDER the new bound, so the case would have asserted a refusal that no longer happens — and the array-bound suite named "all 64 elements" in a title and picked its middle element as a hardcoded 't31'. Both derive from the constant now, so the pins follow it wherever it goes rather than silently inverting the next time it moves.
This commit is contained in:
parent
a2820e81af
commit
e435da787d
3 changed files with 19 additions and 11 deletions
|
|
@ -161,7 +161,8 @@ describe('Metadata Vector Exclusion Fix', () => {
|
|||
// silence at a bound of 10 — the field simply vanished from the index and
|
||||
// the row dropped out of every `where` on it, indistinguishably from "no
|
||||
// row matches". The bound is now MAX_INDEXED_ARRAY_LENGTH and it REFUSES.
|
||||
const largeArray = Array.from({ length: 100 }, (_, i) => `item${i}`)
|
||||
const overTheBound = MAX_INDEXED_ARRAY_LENGTH + 1
|
||||
const largeArray = Array.from({ length: overTheBound }, (_, i) => `item${i}`)
|
||||
|
||||
const err = await brainy
|
||||
.add({
|
||||
|
|
@ -176,7 +177,7 @@ describe('Metadata Vector Exclusion Fix', () => {
|
|||
|
||||
expect(err).toBeInstanceOf(MetadataArrayTooLargeError)
|
||||
expect(err.field).toBe('items')
|
||||
expect(err.length).toBe(100)
|
||||
expect(err.length).toBe(overTheBound)
|
||||
expect(err.limit).toBe(MAX_INDEXED_ARRAY_LENGTH)
|
||||
|
||||
// Nothing was indexed from the refused write — no 'items' field, and above
|
||||
|
|
|
|||
Reference in a new issue