fix: user metadata named 'level' is a real field everywhere — the engine-internal node layer no longer shadows it in sort/filter/aggregation, and the indexing views stop stamping a phantom 0 into its column; index epoch 2 rebuilds existing brains at first open

Also completes the v8.10.2 write-granularity law for the transact() plan
path: a metadata-only batch update never rewrites the vector-bearing noun
record (planUpdate staged the unconditional save the update() fix removed).
Seven pins in tests/integration/level-field-shadow.test.ts including the
reporting consumer's exact repro rows; orderBy JSDoc documents the ordering
contract and the announced field-addressing law.
This commit is contained in:
David Snelling 2026-08-03 11:57:32 -07:00
parent 099579f716
commit 958a085926
8 changed files with 259 additions and 17 deletions

View file

@ -215,7 +215,6 @@ describe('resolveEntityField helper', () => {
'id',
'vector',
'connections',
'level',
'type',
'confidence',
'weight',
@ -228,5 +227,9 @@ describe('resolveEntityField helper', () => {
for (const field of expected) {
expect(STANDARD_ENTITY_FIELDS.has(field)).toBe(true)
}
// `level` is deliberately NOT resolvable: it is HNSW plumbing, and listing
// it here shadowed user metadata named `level` in every by-name read
// (the reserved-name shadow bug). Plumbing stays out of the resolver.
expect(STANDARD_ENTITY_FIELDS.has('level')).toBe(false)
})
})