test(8.0): asOf() error-path spot-checks + find() triple-composition correctness + scale-bench harness
- db-mvcc proof 9: asOf(-1|1.5|future) → RangeError, bad snapshot path → descriptive error, use-after-release() throws on get/find/related (Y.15 error-path coverage). - find-triple-composition: proves vector ∩ metadata ∩ graph returns exactly the entity satisfying all three and excludes those failing any one (decoys, wrong category). - find-composition-scale.js: parameterized latency harness (vector/metadata/graph/ vector+metadata/triple) with non-empty asserts; precomputed vectors, no model load.
This commit is contained in:
parent
f12ca68b82
commit
af96064655
3 changed files with 273 additions and 0 deletions
|
|
@ -1155,4 +1155,33 @@ describe('8.0 Db API — generational MVCC', () => {
|
|||
await second.release()
|
||||
await third.release()
|
||||
})
|
||||
|
||||
// ==========================================================================
|
||||
// 9. asOf() / released-Db error paths (Y.15 spot-checks)
|
||||
// ==========================================================================
|
||||
it('proof 9 — asOf() rejects out-of-range targets and a released Db throws on every read', async () => {
|
||||
const brain = await openMemoryBrain()
|
||||
await (
|
||||
await brain.transact([
|
||||
{ op: 'add', id: uid('asof-err'), type: NounType.Document, data: 'x', metadata: { v: 1 } }
|
||||
])
|
||||
).release()
|
||||
const current = brain.generation()
|
||||
|
||||
// Negative, non-integer, and future generations are honest RangeErrors —
|
||||
// never a silent clamp to a neighbouring generation.
|
||||
await expect(brain.asOf(-1)).rejects.toThrow(RangeError)
|
||||
await expect(brain.asOf(1.5)).rejects.toThrow(RangeError)
|
||||
await expect(brain.asOf(current + 999)).rejects.toThrow(RangeError)
|
||||
|
||||
// A string that is not a snapshot directory is a descriptive error, not a crash.
|
||||
await expect(brain.asOf('/no/such/snapshot/dir')).rejects.toThrow(/not a snapshot directory/)
|
||||
|
||||
// Use-after-release is rejected on every read method, naming the released generation.
|
||||
const db = brain.now()
|
||||
await db.release()
|
||||
await expect(db.get(uid('asof-err'))).rejects.toThrow(/released Db/)
|
||||
await expect(db.find({ where: { v: 1 } })).rejects.toThrow(/released Db/)
|
||||
await expect(db.related(uid('asof-err'))).rejects.toThrow(/released Db/)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue