@bjornpagen/bumbledb 0.12.2 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/COOKBOOK.md +35 -21
  2. package/README.md +82 -55
  3. package/dist/db.d.ts +173 -130
  4. package/dist/db.d.ts.map +1 -1
  5. package/dist/db.js +782 -371
  6. package/dist/db.js.map +1 -1
  7. package/dist/index.d.ts +7 -13
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +4 -9
  10. package/dist/index.js.map +1 -1
  11. package/dist/marshal.d.ts +5 -27
  12. package/dist/marshal.d.ts.map +1 -1
  13. package/dist/marshal.js +4 -21
  14. package/dist/marshal.js.map +1 -1
  15. package/dist/native.d.ts +157 -168
  16. package/dist/native.d.ts.map +1 -1
  17. package/dist/native.js +46 -8
  18. package/dist/native.js.map +1 -1
  19. package/dist/query/find.d.ts +14 -9
  20. package/dist/query/find.d.ts.map +1 -1
  21. package/dist/query/find.js +2 -2
  22. package/dist/query/find.js.map +1 -1
  23. package/dist/query/lower.d.ts.map +1 -1
  24. package/dist/query/lower.js +5 -4
  25. package/dist/query/lower.js.map +1 -1
  26. package/dist/query/parse-ir.d.ts.map +1 -1
  27. package/dist/query/parse-ir.js +11 -9
  28. package/dist/query/parse-ir.js.map +1 -1
  29. package/dist/relation.d.ts +4 -25
  30. package/dist/relation.d.ts.map +1 -1
  31. package/dist/relation.js +3 -4
  32. package/dist/relation.js.map +1 -1
  33. package/package.json +3 -3
  34. package/src/db.ts +1151 -500
  35. package/src/index.ts +28 -24
  36. package/src/marshal.ts +5 -35
  37. package/src/native.ts +248 -175
  38. package/src/query/find.ts +19 -14
  39. package/src/query/lower.ts +7 -6
  40. package/src/query/parse-ir.ts +11 -9
  41. package/src/relation.ts +3 -28
  42. package/dist/exhume.d.ts +0 -143
  43. package/dist/exhume.d.ts.map +0 -1
  44. package/dist/exhume.js +0 -166
  45. package/dist/exhume.js.map +0 -1
  46. package/src/exhume.ts +0 -267
package/dist/db.d.ts CHANGED
@@ -2,18 +2,16 @@
2
2
  * `Db` — the living half of the SDK (PRD-07): open/create a store from a
3
3
  * `Schema`, write typed facts through delta transactions with race-free
4
4
  * final-state point reads, receive rejections as typed violation VALUES
5
- * keyed to statements, and read through scoped snapshots all typed by
6
- * the schema's relations record.
5
+ * keyed to statements, and read through a synchronous instance callback
6
+ * all typed by the schema's relations record.
7
7
  *
8
- * LIFETIMES ARE DISPOSABLES, never `close()` (ruled 2026-07-23, R12): no
9
- * value this module returns carries a close spelling release is
10
- * deterministic and scope-shaped in the language's own syntax. Snapshots
11
- * are scope-shaped both ways: `read(fn)` opens one before `fn` and closes
12
- * it after unconditionally (the {@link ReadScope} handed to `fn` is
13
- * invalidated the moment `fn` returns), and `using snap = db.read()` hands
14
- * the caller the lifetime, released by the scope's own `Symbol.dispose`
15
- * at scope exit. Prepared plans are plain values whose engine-side half
16
- * is reclaimed by a GC finalizer — reclamation only, never correctness.
8
+ * A store read is one callback: `db.read((instance, witness) => …)`. The
9
+ * instance is invalid the moment the callback returns; the witness is a
10
+ * cloneable token and may escape. There is no handle-shaped read and no
11
+ * `using snap = db.read()`. Builder, owned instance, and witness
12
+ * implement `Symbol.dispose`. Prepared plans are plain values whose
13
+ * engine-side half is reclaimed by a GC finalizer reclamation only,
14
+ * never correctness.
17
15
  *
18
16
  * PROCESS MODEL: one process, one exclusive-lock handle per store. The
19
17
  * `Db` value owns the LMDB environment's exclusive lock until process
@@ -24,17 +22,17 @@
24
22
  * policy.
25
23
  *
26
24
  * REJECTION IS DATA: a rejected commit is a domain outcome (it becomes the
27
- * LLM repair prompt downstream), returned as a {@link WriteResult} carrying
28
- * {@link Violation} values. Genuine failures I/O, used-after-scope,
29
- * marshal shape, a moved generation on {@link Db.writeFrom} throw
30
- * `@superbuilders/errors` wrapped errors instead.
25
+ * LLM repair prompt downstream), returned as a {@link WriteOutcome}
26
+ * carrying {@link Violation} values. A moved generation on
27
+ * {@link Db.writeFrom} is the `{ tag: "moved" }` arm, not an exception.
28
+ * Genuine failures — I/O, used-after-scope, spent handle, marshal shape —
29
+ * throw `@superbuilders/errors` wrapped errors instead.
31
30
  */
32
- import type { Exhumed } from "./exhume.js";
33
- import { type KeyFact, type Minted } from "./marshal.js";
31
+ import { type KeyFact } from "./marshal.js";
34
32
  import type { FactValue } from "./native.js";
35
33
  import type { Query } from "./query/lower.js";
36
34
  import type { ParamsRecord } from "./query/scope.js";
37
- import type { AnyRelation, Fact, InsertFact } from "./relation.js";
35
+ import type { AnyRelation, Fact, FreshKeys } from "./relation.js";
38
36
  import type { Schema, SchemaRelations } from "./schema.js";
39
37
  import { type KeyStatement, type Statement } from "./statements.js";
40
38
  /**
@@ -43,6 +41,40 @@ import { type KeyStatement, type Statement } from "./statements.js";
43
41
  * relation shape entirely, so passing one is a type error.
44
42
  */
45
43
  type MemberRelation<Rels extends SchemaRelations> = Extract<Rels[keyof Rels], AnyRelation>;
44
+ /**
45
+ * Facts consumed vs facts that changed the in-memory final-state view.
46
+ * The length-1 report is `{ submitted: 1n, changed: 0n | 1n }`.
47
+ */
48
+ interface MutationReport {
49
+ readonly submitted: bigint;
50
+ readonly changed: bigint;
51
+ }
52
+ /**
53
+ * Column-major collection write: one array per declared field, every
54
+ * column the same length. The second transport of `load` / `insert` —
55
+ * objects and columns are two ways to spell the same batch.
56
+ */
57
+ type ColumnBatch<R extends AnyRelation> = {
58
+ readonly [K in keyof Fact<R> & string]: readonly Fact<R>[K][];
59
+ };
60
+ type CollectionWrite<R extends AnyRelation> = Iterable<Fact<R>> | ColumnBatch<R>;
61
+ /**
62
+ * Half-open fresh-id range from one `reserve`. Empty cannot yield a
63
+ * minted id — `start` exists only on the nonempty arm.
64
+ */
65
+ type FreshRange = {
66
+ readonly empty: true;
67
+ readonly count: 0n;
68
+ at(index: bigint): undefined;
69
+ [Symbol.iterator](): IterableIterator<bigint>;
70
+ } | {
71
+ readonly empty: false;
72
+ readonly start: bigint;
73
+ readonly endExclusive: bigint;
74
+ readonly count: bigint;
75
+ at(index: bigint): bigint | undefined;
76
+ [Symbol.iterator](): IterableIterator<bigint>;
77
+ };
46
78
  /**
47
79
  * The key object of a key-statement-selected `get`: exactly the selected
48
80
  * `key()` statement's projection fields, each at the relation's own BARE
@@ -144,32 +176,45 @@ type Violation<Rels extends SchemaRelations> = ImpliedKeyViolation<Rels> | Decla
144
176
  * a dead arm is never handled.
145
177
  */
146
178
  type AbandonedArm<R> = R extends Abandon<infer P> ? {
147
- readonly ok: false;
179
+ readonly tag: "abandoned";
148
180
  readonly abandoned: P;
149
181
  } : never;
182
+ /** A callback return that is not Promise-like. TypeScript `never` is not a runtime boundary. */
183
+ type SyncResult<R> = R extends PromiseLike<unknown> ? never : R;
184
+ interface Committed<T> {
185
+ readonly value: T;
186
+ readonly generation: bigint;
187
+ }
188
+ type Admission<Rels extends SchemaRelations, T> = {
189
+ readonly tag: "accepted";
190
+ readonly value: T;
191
+ } | {
192
+ readonly tag: "rejected";
193
+ readonly violations: readonly Violation<Rels>[];
194
+ };
150
195
  /**
151
- * A write's domain outcome, one sum for BOTH verbs (ruled 2026-07-23,
152
- * R10): the committed generation; the COMPLETE violation set (every
153
- * violated statement cited once, per direction for a containment, in
154
- * materialized statement order); or the callback's own abandon payload —
155
- * commit-vs-abandon is in the type, so a caller's explicit decline to
156
- * commit can never be silently discarded. Narrows on `.ok`, then (when the
157
- * callback can abandon) on `"violations" in result`.
196
+ * A write's domain outcome. One discriminant: narrow on `tag`. The
197
+ * abandoned arm is present exactly when the callback can abandon.
158
198
  */
159
- type WriteResult<Rels extends SchemaRelations, R = void> = {
160
- readonly ok: true;
161
- readonly generation: bigint;
199
+ type WriteOutcome<Rels extends SchemaRelations, R> = {
200
+ readonly tag: "accepted";
201
+ readonly value: Committed<Exclude<R, Abandon<unknown>>>;
162
202
  } | {
163
- readonly ok: false;
203
+ readonly tag: "rejected";
164
204
  readonly violations: readonly Violation<Rels>[];
165
205
  } | AbandonedArm<R>;
206
+ type WriteFromOutcome<Rels extends SchemaRelations, R> = WriteOutcome<Rels, R> | {
207
+ readonly tag: "moved";
208
+ readonly witnessed: bigint;
209
+ readonly current: bigint;
210
+ };
166
211
  /**
167
212
  * The delta-building callback of a write: runs synchronously against the
168
213
  * live transaction. Returning {@link abandon}`(payload)` rolls the
169
214
  * transaction back (R10) — the result type carries the payload arm exactly
170
215
  * then.
171
216
  */
172
- type DeltaBuild<Rels extends SchemaRelations, R = void> = (tx: Tx<Rels>) => R;
217
+ type DeltaBuild<Rels extends SchemaRelations, R = void> = (tx: WriteTx<Rels>) => R;
173
218
  /**
174
219
  * The runtime discriminant of {@link Abandon} values — a property probe is
175
220
  * how `write`/`writeFrom` distinguish "abort without committing" from an
@@ -180,7 +225,7 @@ declare const abandonMark: unique symbol;
180
225
  * The abandon sentinel {@link abandon} builds: returning one from a `write`
181
226
  * or `writeFrom` callback rolls the transaction back WITHOUT
182
227
  * committing (no empty commit is ever issued) and surfaces the payload as
183
- * `{ ok: false, abandoned: payload }` (ruled 2026-07-23, R10 — the
228
+ * `{ tag: "abandoned", abandoned: payload }` (ruled 2026-07-23, R10 — the
184
229
  * sentinel's contract is unconditional, whichever write verb received it).
185
230
  */
186
231
  interface Abandon<P> {
@@ -191,7 +236,7 @@ interface Abandon<P> {
191
236
  * Wraps a payload in the {@link Abandon} sentinel — the one way a write
192
237
  * callback declines to commit: `return abandon(payload)` aborts the delta
193
238
  * (nothing is committed, not even an empty commit) and the write resolves
194
- * to `{ ok: false, abandoned: payload }`, from `write` and `writeFrom`
239
+ * to `{ tag: "abandoned", abandoned: payload }`, from `write` and `writeFrom`
195
240
  * alike (R10).
196
241
  */
197
242
  declare function abandon<P>(payload: P): Abandon<P>;
@@ -202,25 +247,24 @@ declare function abandon<P>(payload: P): Abandon<P>;
202
247
  * Spent when its owning `write`/`writeFrom` call resolves the attempt;
203
248
  * any later use throws.
204
249
  */
205
- interface Tx<Rels extends SchemaRelations> {
250
+ interface WriteTx<Rels extends SchemaRelations> {
206
251
  /**
207
- * Records one insert. Omitted fresh fields are MINTED through the
208
- * engine's alloc lane and returned as bare bigints; supplying them instead
209
- * preserves identity (the resupply idiom). Returns `{ changed, ...fresh }`
210
- * (ruled 2026-07-23, R11): the engine's changed-state report the Rust
211
- * surface's `insert(&fact) -> bool` bijection `delete` always honored —
212
- * beside the relation's fresh cells, minted or resupplied. The
213
- * idempotent-replay lane reads the bit from the insert itself; no extra
214
- * `contains` round trip exists. The flattened shape cannot carry a FRESH
215
- * cell literally named `changed` beside the report, so admission refuses
216
- * that one spelling ({@link refuseShadowedChanged}) — never a silent
217
- * shadow here.
252
+ * Records a collection of inserts. Singleton is `[fact]`. Empty is
253
+ * lawful. Returns how many facts were consumed and how many changed
254
+ * the in-memory final-state view. Every fact is complete — omitted
255
+ * fresh cells are a type error; mint first with {@link WriteTx.reserve}.
218
256
  */
219
- insert<R extends MemberRelation<Rels>>(relation: R, fact: InsertFact<R>): {
220
- readonly changed: boolean;
221
- } & Minted<R>;
222
- /** Records one delete; `true` iff the final state changed. */
223
- delete<R extends MemberRelation<Rels>>(relation: R, fact: Fact<R>): boolean;
257
+ insert<R extends MemberRelation<Rels>>(relation: R, facts: CollectionWrite<R>): MutationReport;
258
+ /**
259
+ * Records a collection of deletes. Singleton is `[fact]`. Returns
260
+ * how many facts were consumed and how many changed the view.
261
+ */
262
+ delete<R extends MemberRelation<Rels>>(relation: R, facts: Iterable<Fact<R>>): MutationReport;
263
+ /**
264
+ * Mints `count` consecutive fresh values for a `.fresh` field.
265
+ * `count === 0n` is empty and does not yield a start.
266
+ */
267
+ reserve<R extends MemberRelation<Rels>>(relation: R, field: FreshKeys<R> & string, count: bigint): FreshRange;
224
268
  /** Final-state membership of one complete fact. */
225
269
  contains<R extends MemberRelation<Rels>>(relation: R, fact: Fact<R>): boolean;
226
270
  /**
@@ -235,21 +279,24 @@ interface Tx<Rels extends SchemaRelations> {
235
279
  */
236
280
  get<R extends MemberRelation<Rels>, const P extends readonly string[]>(relation: R, keyStatement: KeyStatement<R, P>, key: DeclaredKeyFact<R, P>): Fact<R> | undefined;
237
281
  }
282
+ type Tx<Rels extends SchemaRelations> = WriteTx<Rels>;
283
+ declare const witnessTypes: unique symbol;
238
284
  /**
239
- * The read view one `db.read(fn)` call scopes — or one `using snap =
240
- * db.read()` acquisition owns (ruled 2026-07-23, R12: lifetimes are
241
- * disposables, never `close()`). The callback form invalidates the value
242
- * when `fn` returns; the `using` form releases it at scope exit through
243
- * `Symbol.dispose` — either way the release is deterministic and
244
- * scope-shaped, every later verb call throws a typed used-after-scope
245
- * error, and the underlying snapshot (with its LMDB reader slot) is
246
- * already closed.
285
+ * Cloneable generation evidence from one store read. May cross `await`.
286
+ * Disposal is idempotent; later use throws {@link ErrSpentHandle}.
247
287
  */
248
- interface ReadScope<Rels extends SchemaRelations> extends Disposable {
288
+ interface Witness<Rels extends SchemaRelations> extends Disposable {
289
+ readonly [witnessTypes]?: Rels;
290
+ }
291
+ /**
292
+ * The borrowed instance one `db.read((instance, witness) => …)` callback
293
+ * receives. Invalid the moment the callback returns. A stashed value
294
+ * throws {@link ErrUseAfterScope}. Not a handle: there is no `db.read()`.
295
+ */
296
+ interface ReadInstance<Rels extends SchemaRelations> {
249
297
  /**
250
- * The committed generation this scope witnessed — carried by the
251
- * snapshot open itself (one crossing, inside the snapshot's own
252
- * transaction), so it is atomic with the snapshot by construction.
298
+ * The committed generation this instance witnessed — read inside the
299
+ * lease's own transaction.
253
300
  */
254
301
  readonly generation: bigint;
255
302
  /** Full-relation export in row-id order, decoded to bare structural facts. */
@@ -268,12 +315,13 @@ interface ReadScope<Rels extends SchemaRelations> extends Disposable {
268
315
  /** Committed-state membership of one complete fact. */
269
316
  contains<R extends MemberRelation<Rels>>(relation: R, fact: Fact<R>): boolean;
270
317
  /**
271
- * Executes a prepared query against this scope's snapshot with the
272
- * typed params object; returns the answer SET as plain rows with
273
- * bare structural values (no order — the host sorts). This is the ONE
318
+ * Executes a prepared query against this instance with the typed
319
+ * params object; returns the answer SET as plain rows with bare
320
+ * structural values (no order — the host sorts). This is the ONE
274
321
  * execution spelling ({@link Prepared} carries no `execute`).
275
322
  */
276
323
  execute<Row, Params extends ParamsRecord>(prepared: Prepared<Rels, Row, Params>, params: Params): Row[];
324
+ prepare<Row, Params extends ParamsRecord>(q: Query<Rels, Row, Params>): Prepared<Rels, Row, Params>;
277
325
  }
278
326
  /**
279
327
  * The module-private inference slot of {@link Prepared}: an optional symbol
@@ -288,7 +336,7 @@ declare const preparedTypes: unique symbol;
288
336
  * One prepared query as a plain VALUE: explicit visible compilation
289
337
  * (`db.prepare(q)` lowers, pins the plan, and surfaces every engine roster
290
338
  * refusal), no lifecycle. Execution happens ONLY through
291
- * `snap.execute(prepared, params)` / `db.execute(prepared, params)` — the
339
+ * `instance.execute(prepared, params)` / `db.execute(prepared, params)` — the
292
340
  * symmetry rule's one spelling. The engine-side plan is reclaimed by a GC
293
341
  * finalizer when this value becomes unreachable (reclamation only, never
294
342
  * correctness — an unreclaimed plan is idle memory, and process exit frees
@@ -312,49 +360,38 @@ interface Db<Rels extends SchemaRelations> {
312
360
  /** The theory this store was opened with (fingerprint-verified by the engine). */
313
361
  readonly schema: Schema<Rels>;
314
362
  /**
315
- * One scoped snapshot read: opens an MVCC snapshot, runs `fn`
316
- * SYNCHRONOUSLY against it, and closes the snapshot unconditionally
317
- * before returning `fn`'s result. The {@link ReadScope} is invalidated
318
- * when `fn` returns a used-after-scope call throws a typed error.
363
+ * One store read: runs `body` SYNCHRONOUSLY inside the engine lease
364
+ * and returns its result. The {@link ReadInstance} is invalidated
365
+ * when `body` returns a stashed use throws {@link ErrUseAfterScope}.
366
+ * The {@link Witness} is a clone and may escape. A thenable return
367
+ * throws {@link ErrAsyncCallback}.
319
368
  */
320
- read<T>(fn: (snap: ReadScope<Rels>) => T): T;
321
- /**
322
- * The `using` acquisition (ruled 2026-07-23, R12): `using snap =
323
- * db.read()` — the caller owns the scope's lifetime, and the scope's
324
- * `Symbol.dispose` releases the snapshot deterministically at scope
325
- * exit, in the language's own syntax. Lifetimes are disposables, never
326
- * `close()`.
327
- */
328
- read(): ReadScope<Rels>;
329
- /** `db.scan(r)` === `db.read(snap => snap.scan(r))` — the symmetry rule. */
369
+ read<R>(body: (instance: ReadInstance<Rels>, witness: Witness<Rels>) => SyncResult<R>): SyncResult<R>;
370
+ /** `db.scan(r)` === `db.read(instance => instance.scan(r))` — the symmetry rule. */
330
371
  scan<R extends MemberRelation<Rels>>(relation: R): Fact<R>[];
331
- /** `db.get(r, k)` === `db.read(snap => snap.get(r, k))` — the symmetry rule. */
372
+ /** `db.get(r, k)` === `db.read(instance => instance.get(r, k))` — the symmetry rule. */
332
373
  get<R extends MemberRelation<Rels>>(relation: R, key: KeyFact<R>): Fact<R> | undefined;
333
- /** `db.get(r, s, k)` === `db.read(snap => snap.get(r, s, k))` — the symmetry rule, keyed form. */
374
+ /** `db.get(r, s, k)` === `db.read(instance => instance.get(r, s, k))` — the symmetry rule, keyed form. */
334
375
  get<R extends MemberRelation<Rels>, const P extends readonly string[]>(relation: R, keyStatement: KeyStatement<R, P>, key: DeclaredKeyFact<R, P>): Fact<R> | undefined;
335
- /** `db.contains(r, f)` === `db.read(snap => snap.contains(r, f))` — the symmetry rule. */
376
+ /** `db.contains(r, f)` === `db.read(instance => instance.contains(r, f))` — the symmetry rule. */
336
377
  contains<R extends MemberRelation<Rels>>(relation: R, fact: Fact<R>): boolean;
337
- /** `db.execute(p, params)` === `db.read(snap => snap.execute(p, params))` — the symmetry rule. */
378
+ /** `db.execute(p, params)` === `db.read(instance => instance.execute(p, params))` — the symmetry rule. */
338
379
  execute<Row, Params extends ParamsRecord>(prepared: Prepared<Rels, Row, Params>, params: Params): Row[];
339
380
  /**
340
381
  * One delta transaction: builds the delta synchronously through `fn`,
341
382
  * commits, and returns the domain outcome. A throw from `fn` aborts
342
383
  * the delta (LMDB untouched) and rethrows wrapped. `fn` may decline to
343
- * commit by returning {@link abandon}`(payload)` (ruled 2026-07-23,
344
- * R10): the transaction rolls back — nothing is committed, not even an
345
- * empty commit — and the outcome is `{ ok: false, abandoned: payload }`,
346
- * an arm the result type carries exactly when the callback can abandon.
384
+ * commit by returning {@link abandon}`(payload)`: the transaction rolls
385
+ * back — nothing is committed, not even an empty commit — and the
386
+ * outcome is `{ tag: "abandoned", abandoned: payload }`.
347
387
  */
348
- write<R = void>(fn: DeltaBuild<Rels, R>): WriteResult<Rels, R>;
388
+ write<R>(fn: (tx: WriteTx<Rels>) => SyncResult<R>): WriteOutcome<Rels, SyncResult<R>>;
349
389
  /**
350
- * One-shot witnessed write from a live read snapshot: begins a
351
- * transaction that commits only if no state-changing commit landed
352
- * since `snap` was taken. Must run inside the read callback that owns
353
- * `snap`. A moved generation is the typed {@link ErrGenerationMoved}
354
- * — retry is host policy; this method never loops. `fn` may decline to
355
- * commit by returning {@link abandon}`(payload)`.
390
+ * Witnessed write: commits only if no state-changing commit landed
391
+ * since `witness` was minted. A moved generation is
392
+ * `{ tag: "moved" }` retry is host policy; this method never loops.
356
393
  */
357
- writeFrom<R>(snap: ReadScope<Rels>, fn: DeltaBuild<Rels, R>): WriteResult<Rels, R>;
394
+ writeFrom<R>(witness: Witness<Rels>, fn: (tx: WriteTx<Rels>) => SyncResult<R>): WriteFromOutcome<Rels, SyncResult<R>>;
358
395
  /**
359
396
  * Prepares a query value built against THIS schema (identity is the
360
397
  * membership rule): lowers it to the engine IR, pins the plan, and
@@ -364,12 +401,11 @@ interface Db<Rels extends SchemaRelations> {
364
401
  */
365
402
  prepare<Row, Params extends ParamsRecord>(q: Query<Rels, Row, Params>): Prepared<Rels, Row, Params>;
366
403
  }
367
- /**
368
- * The typed generation-moved refusal `writeFrom` throws when a
369
- * state-changing commit landed since the witness snapshot: retry is host
370
- * policy. Match with `errors.is`.
371
- */
372
- declare const ErrGenerationMoved: Error;
404
+ declare const ErrAsyncCallback: Error;
405
+ declare const ErrSpentHandle: Error;
406
+ declare const ErrUseAfterScope: Error;
407
+ declare const ErrForeignPrepared: Error;
408
+ declare const ErrForeignWitness: Error;
373
409
  /**
374
410
  * The engine twin of the schema-level class wall, as a matchable value
375
411
  * (`errors.is`): the shared lowering rejected a spec whose statement pairs
@@ -381,42 +417,49 @@ declare const ErrGenerationMoved: Error;
381
417
  * what the types claim.
382
418
  */
383
419
  declare const ErrNewtypeMismatch: Error;
420
+ declare const ErrSchemaError: Error;
421
+ declare const ErrFingerprintMismatch: Error;
422
+ declare const ErrIrError: Error;
423
+ interface OwnedInstance<Rels extends SchemaRelations> extends Disposable {
424
+ prepare<Row, Params extends ParamsRecord>(q: Query<Rels, Row, Params>): Prepared<Rels, Row, Params>;
425
+ execute<Row, Params extends ParamsRecord>(prepared: Prepared<Rels, Row, Params>, params: Params): Row[];
426
+ scan<R extends MemberRelation<Rels>>(relation: R): Fact<R>[];
427
+ contains<R extends MemberRelation<Rels>>(relation: R, fact: Fact<R>): boolean;
428
+ get<R extends MemberRelation<Rels>>(relation: R, key: KeyFact<R>): Fact<R> | undefined;
429
+ get<R extends MemberRelation<Rels>, const P extends readonly string[]>(relation: R, keyStatement: KeyStatement<R, P>, key: DeclaredKeyFact<R, P>): Fact<R> | undefined;
430
+ }
431
+ interface InstanceBuilder<Rels extends SchemaRelations> extends Disposable {
432
+ load<R extends MemberRelation<Rels>>(relation: R, facts: CollectionWrite<R>): MutationReport;
433
+ delete<R extends MemberRelation<Rels>>(relation: R, facts: Iterable<Fact<R>>): MutationReport;
434
+ reserve<R extends MemberRelation<Rels>>(relation: R, field: FreshKeys<R> & string, count: bigint): FreshRange;
435
+ contains<R extends MemberRelation<Rels>>(relation: R, fact: Fact<R>): boolean;
436
+ get<R extends MemberRelation<Rels>>(relation: R, key: KeyFact<R>): Fact<R> | undefined;
437
+ get<R extends MemberRelation<Rels>, const P extends readonly string[]>(relation: R, keyStatement: KeyStatement<R, P>, key: DeclaredKeyFact<R, P>): Fact<R> | undefined;
438
+ admit(): Promise<Admission<Rels, OwnedInstance<Rels>>>;
439
+ }
440
+ declare const InstanceBuilder: Readonly<{
441
+ create<Rels extends SchemaRelations>(theory: Schema<Rels>): InstanceBuilder<Rels>;
442
+ }>;
384
443
  /**
385
444
  * The store lifecycle — `Db.create(path, schema)` / `Db.open(path, schema)`.
386
445
  * Create refuses an already-initialized directory; open verifies format
387
- * version, store kind, and the schema fingerprint. A second live handle
388
- * on the same path is the engine's `EnvironmentLocked`. There is no close
389
- * anywhere: the process owns the environment until GC/exit (durability is
390
- * the engine's per-commit fsync). One store kind exists: durable
391
- * resume = reopen in a fresh process, or hold the `Db` this process opened.
446
+ * version and the schema fingerprint. A second live handle on the same
447
+ * path is the engine's `EnvironmentLocked`. There is no close anywhere:
448
+ * the process owns the environment until GC/exit (durability is the
449
+ * engine's per-commit fsync). Resume = reopen in a fresh process, or
450
+ * hold the `Db` this process opened.
392
451
  */
393
452
  declare const Db: Readonly<{
394
453
  /** Creates a fresh durable store at `path` from the schema. */
395
- create<Rels extends SchemaRelations>(path: string, theory: Schema<Rels>): Promise<Db<Rels>>;
454
+ create<Rels extends SchemaRelations>(storePath: string, theory: Schema<Rels>): Promise<Admission<Rels, Db<Rels>>>;
396
455
  /**
397
456
  * Opens an existing durable store at `path` with the same theory.
398
- * A fingerprint-matching open also BACK-FILLS the store's persisted
399
- * schema descriptor when it is absent (self-describing stores, engine
400
- * 50-storage.md § the `_meta` block), so a legacy store becomes
401
- * exhumable after one ordinary open — adoption is automatic, never a
402
- * separate verb. A second open of a still-live path is
403
- * `EnvironmentLocked`.
404
- */
405
- open<Rels extends SchemaRelations>(path: string, theory: Schema<Rels>): Promise<Db<Rels>>;
406
- /**
407
- * Opens a store READ-ONLY from its own persisted descriptor — the SDK's
408
- * one schema-independent read path (no theory, no fingerprint check; the
409
- * store rebirth tool's entry). Lives beside `open`/`create` so the path
410
- * law stays in one place: the same `node:path.resolve` canonicalization,
411
- * applied here. The value is NOT cached and is a DISPOSABLE lifetime
412
- * (R12) — `using exhumed = await Db.exhume(path)` releases the engine
413
- * handle and the store's exclusive lock at scope exit, so a same-path
414
- * reopen never waits on GC. A store not yet adopted rejects with the
415
- * typed `ErrExhumeNoDescriptor` (the remedy: one fingerprint-matching
416
- * `Db.open` under the creating schema back-fills the descriptor).
457
+ * Format 8 open never back-fills a descriptor. A second open of a
458
+ * still-live path is `EnvironmentLocked`.
417
459
  */
418
- exhume(storePath: string): Promise<Exhumed>;
460
+ open<Rels extends SchemaRelations>(storePath: string, theory: Schema<Rels>): Promise<Db<Rels>>;
461
+ fromInstance<Rels extends SchemaRelations>(storePath: string, instance: OwnedInstance<Rels>): Promise<Db<Rels>>;
419
462
  }>;
420
- export type { Abandon, AbandonedArm, CapacityViolation, ContainmentViolation, DeclaredKeyFact, DeclaredKeyViolation, DeltaBuild, ImpliedKeyViolation, MemberRelation, MirrorViolation, OffendingFact, Prepared, ReadScope, Tx, Violation, WriteResult };
421
- export { abandon, Db, ErrGenerationMoved, ErrNewtypeMismatch };
463
+ export type { Abandon, AbandonedArm, Admission, CapacityViolation, ColumnBatch, Committed, ContainmentViolation, DeclaredKeyFact, DeclaredKeyViolation, DeltaBuild, FreshRange, ImpliedKeyViolation, MemberRelation, MirrorViolation, MutationReport, OffendingFact, OwnedInstance, Prepared, ReadInstance, SyncResult, Tx, Violation, Witness, WriteFromOutcome, WriteOutcome, WriteTx };
464
+ export { abandon, Db, ErrAsyncCallback, ErrForeignPrepared, ErrForeignWitness, ErrFingerprintMismatch, ErrIrError, ErrNewtypeMismatch, ErrSchemaError, ErrSpentHandle, ErrUseAfterScope, InstanceBuilder };
422
465
  //# sourceMappingURL=db.d.ts.map
package/dist/db.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAIzC,OAAO,EAKN,KAAK,OAAO,EAEZ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