@bjornpagen/bumbledb 0.14.0 → 0.17.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 (108) hide show
  1. package/COOKBOOK.md +58 -62
  2. package/README.md +82 -56
  3. package/dist/capacity.d.ts +24 -136
  4. package/dist/capacity.d.ts.map +1 -1
  5. package/dist/capacity.js +18 -40
  6. package/dist/capacity.js.map +1 -1
  7. package/dist/closed.d.ts +0 -156
  8. package/dist/closed.d.ts.map +1 -1
  9. package/dist/closed.js +0 -104
  10. package/dist/closed.js.map +1 -1
  11. package/dist/db.d.ts +93 -290
  12. package/dist/db.d.ts.map +1 -1
  13. package/dist/db.js +713 -556
  14. package/dist/db.js.map +1 -1
  15. package/dist/face.d.ts +0 -133
  16. package/dist/face.d.ts.map +1 -1
  17. package/dist/face.js +0 -33
  18. package/dist/face.js.map +1 -1
  19. package/dist/fields.d.ts +1 -145
  20. package/dist/fields.d.ts.map +1 -1
  21. package/dist/fields.js +2 -91
  22. package/dist/fields.js.map +1 -1
  23. package/dist/index.d.ts +13 -23
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +11 -20
  26. package/dist/index.js.map +1 -1
  27. package/dist/law.d.ts +111 -93
  28. package/dist/law.d.ts.map +1 -1
  29. package/dist/law.js +23 -27
  30. package/dist/law.js.map +1 -1
  31. package/dist/lower.d.ts +9 -35
  32. package/dist/lower.d.ts.map +1 -1
  33. package/dist/lower.js +8 -53
  34. package/dist/lower.js.map +1 -1
  35. package/dist/marshal.d.ts +0 -65
  36. package/dist/marshal.d.ts.map +1 -1
  37. package/dist/marshal.js +0 -72
  38. package/dist/marshal.js.map +1 -1
  39. package/dist/native.d.ts +97 -390
  40. package/dist/native.d.ts.map +1 -1
  41. package/dist/native.js +39 -61
  42. package/dist/native.js.map +1 -1
  43. package/dist/query/atom.d.ts +10 -276
  44. package/dist/query/atom.d.ts.map +1 -1
  45. package/dist/query/atom.js +1 -96
  46. package/dist/query/atom.js.map +1 -1
  47. package/dist/query/find.d.ts +10 -76
  48. package/dist/query/find.d.ts.map +1 -1
  49. package/dist/query/find.js +0 -30
  50. package/dist/query/find.js.map +1 -1
  51. package/dist/query/lower.d.ts +64 -146
  52. package/dist/query/lower.d.ts.map +1 -1
  53. package/dist/query/lower.js +19 -256
  54. package/dist/query/lower.js.map +1 -1
  55. package/dist/query/parse-ir.d.ts +0 -7
  56. package/dist/query/parse-ir.d.ts.map +1 -1
  57. package/dist/query/parse-ir.js +1 -13
  58. package/dist/query/parse-ir.js.map +1 -1
  59. package/dist/query/run.d.ts +0 -36
  60. package/dist/query/run.d.ts.map +1 -1
  61. package/dist/query/run.js +0 -44
  62. package/dist/query/run.js.map +1 -1
  63. package/dist/query/scope.d.ts +24 -180
  64. package/dist/query/scope.d.ts.map +1 -1
  65. package/dist/query/scope.js +2 -66
  66. package/dist/query/scope.js.map +1 -1
  67. package/dist/relation.d.ts +2 -50
  68. package/dist/relation.d.ts.map +1 -1
  69. package/dist/relation.js +2 -37
  70. package/dist/relation.js.map +1 -1
  71. package/dist/schema.d.ts +13 -63
  72. package/dist/schema.d.ts.map +1 -1
  73. package/dist/schema.js +118 -92
  74. package/dist/schema.js.map +1 -1
  75. package/dist/spec.d.ts +1 -140
  76. package/dist/spec.d.ts.map +1 -1
  77. package/dist/spec.js +1 -68
  78. package/dist/spec.js.map +1 -1
  79. package/dist/statements.d.ts +6 -137
  80. package/dist/statements.d.ts.map +1 -1
  81. package/dist/statements.js +16 -119
  82. package/dist/statements.js.map +1 -1
  83. package/package.json +3 -3
  84. package/src/capacity.ts +26 -140
  85. package/src/closed.ts +5 -206
  86. package/src/db.ts +997 -854
  87. package/src/face.ts +0 -142
  88. package/src/fields.ts +4 -172
  89. package/src/index.ts +32 -35
  90. package/src/law.ts +201 -129
  91. package/src/lower.ts +8 -53
  92. package/src/marshal.ts +1 -85
  93. package/src/native.ts +192 -413
  94. package/src/query/atom.ts +26 -313
  95. package/src/query/find.ts +24 -110
  96. package/src/query/lower.ts +132 -377
  97. package/src/query/parse-ir.ts +1 -14
  98. package/src/query/run.ts +0 -45
  99. package/src/query/scope.ts +25 -186
  100. package/src/relation.ts +2 -66
  101. package/src/schema.ts +143 -122
  102. package/src/spec.ts +1 -160
  103. package/src/statements.ts +22 -174
  104. package/dist/exhume.d.ts +0 -143
  105. package/dist/exhume.d.ts.map +0 -1
  106. package/dist/exhume.js +0 -166
  107. package/dist/exhume.js.map +0 -1
  108. 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,12 +22,12 @@
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
31
  import { type KeyFact } from "./marshal.js";
34
32
  import type { FactValue } from "./native.js";
35
33
  import type { Query } from "./query/lower.js";
@@ -37,24 +35,12 @@ import type { ParamsRecord } from "./query/scope.js";
37
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
- /**
41
- * The ordinary (writable, scannable) relations of a schema's record — the
42
- * only values the runtime methods accept: closed relations lack the
43
- * relation shape entirely, so passing one is a type error.
44
- */
45
38
  type MemberRelation<Rels extends SchemaRelations> = Extract<Rels[keyof Rels], AnyRelation>;
46
- /**
47
- * Facts consumed vs facts that changed the in-memory final-state view.
48
- * The length-1 report is `{ submitted: 1n, changed: 0n | 1n }`.
49
- */
50
39
  interface MutationReport {
51
40
  readonly submitted: bigint;
52
41
  readonly changed: bigint;
53
42
  }
54
- /**
55
- * Half-open fresh-id range from one `reserve`. Empty cannot yield a
56
- * minted id — `start` exists only on the nonempty arm.
57
- */
43
+ type CollectionWrite<R extends AnyRelation> = Iterable<Fact<R>>;
58
44
  type FreshRange = {
59
45
  readonly empty: true;
60
46
  readonly count: 0n;
@@ -68,98 +54,41 @@ type FreshRange = {
68
54
  at(index: bigint): bigint | undefined;
69
55
  [Symbol.iterator](): IterableIterator<bigint>;
70
56
  };
71
- /**
72
- * The key object of a key-statement-selected `get`: exactly the selected
73
- * `key()` statement's projection fields, each at the relation's own BARE
74
- * structural value type — the {@link KeyFact} rule generalized from the
75
- * primary key to ANY declared key statement.
76
- */
77
57
  type DeclaredKeyFact<R extends AnyRelation, Projection extends readonly string[]> = {
78
58
  readonly [K in Projection[number] & keyof Fact<R>]: Fact<R>[K];
79
59
  };
80
- /**
81
- * One offending fact of a violation: the cited relation's name (a member
82
- * of the schema's record) and the fact decoded to a named natural-value
83
- * object — partial exactly as the engine cites it. Closed-referencing
84
- * cells arrive as handle NAMES (the marshal bijection's read half), so the
85
- * record and the violation's `canonical` string — which the engine already
86
- * renders with handle names — agree on the one spelling.
87
- */
88
60
  interface OffendingFact<Rels extends SchemaRelations> {
89
61
  readonly relation: keyof Rels & string;
90
62
  readonly fact: Readonly<Record<string, FactValue>>;
91
63
  }
92
- /**
93
- * Shared body of every violation arm: the engine's canonical rendering and
94
- * the cited facts. `statement` is NOT here — its presence is the
95
- * discriminant. Implied auto-keys have no SDK spelling (`statement` is
96
- * the value `undefined`); every declared form carries the IDENTICAL
97
- * statement value the schema declared (consumers `===`-match it).
98
- */
99
64
  type ViolationBody<Rels extends SchemaRelations> = {
100
65
  readonly canonical: string;
101
66
  readonly facts: readonly OffendingFact<Rels>[];
102
67
  };
103
- /**
104
- * A functionality violation of an engine-materialized fresh-implied or
105
- * closed auto-key. These slots have no declared spelling (`schema()`
106
- * rejects an explicit duplicate); `statement` is present and `undefined`.
107
- */
108
68
  type ImpliedKeyViolation<Rels extends SchemaRelations> = ViolationBody<Rels> & {
109
69
  readonly kind: "functionality";
110
70
  readonly statement: undefined;
111
71
  };
112
- /**
113
- * A functionality violation of a declared `key()` statement. `statement`
114
- * is the IDENTICAL SDK value the schema declared.
115
- */
116
72
  type DeclaredKeyViolation<Rels extends SchemaRelations> = ViolationBody<Rels> & {
117
73
  readonly kind: "functionality";
118
74
  readonly statement: Statement;
119
75
  };
120
- /**
121
- * A containment violation of a declared `contained()` statement (no
122
- * `orientation` — that property exists exactly on {@link MirrorViolation}).
123
- */
124
76
  type ContainmentViolation<Rels extends SchemaRelations> = ViolationBody<Rels> & {
125
77
  readonly kind: "containment";
126
78
  readonly statement: Statement;
127
79
  readonly direction: "sourceUnsatisfied" | "targetRequired";
128
80
  };
129
- /**
130
- * A containment violation of one slot of a declared `mirrors()` statement.
131
- * BOTH materialized slots render as the one `==` utterance in the written
132
- * orientation (identical `canonical` strings; the engine's `render.rs`
133
- * never emits a bare `<=` for a mirrored pair). `direction` is relative
134
- * to the violated SLOT's own orientation, so it alone cannot say which
135
- * side of the `==` was violated: `written` is the `source <= target` slot
136
- * as the statement was spelled, `mirrored` the engine-materialized
137
- * `target <= source` partner.
138
- */
139
81
  type MirrorViolation<Rels extends SchemaRelations> = ViolationBody<Rels> & {
140
82
  readonly kind: "containment";
141
83
  readonly statement: Statement;
142
84
  readonly direction: "sourceUnsatisfied" | "targetRequired";
143
85
  readonly orientation: "written" | "mirrored";
144
86
  };
145
- /**
146
- * A capacity violation of a declared `capacity()` statement. `measure` is
147
- * the engine's witnessed group total — u128-wide, crossing whole as
148
- * bigint (C3: truncation is unrepresentable).
149
- */
150
87
  type CapacityViolation<Rels extends SchemaRelations> = ViolationBody<Rels> & {
151
88
  readonly kind: "capacity";
152
89
  readonly statement: Statement;
153
90
  readonly measure: bigint;
154
91
  };
155
- /**
156
- * One violated statement of a rejected commit, as a typed value. The
157
- * arms are a true discriminant: `statement === undefined` is exactly the
158
- * implied-auto-key arm; every declared form carries `Statement` (not
159
- * `Statement | undefined`, not an omit-optional). `canonical` is the
160
- * ENGINE's rendering. `direction` / `measure` pass through from the
161
- * engine VERBATIM.
162
- */
163
92
  type Violation<Rels extends SchemaRelations> = ImpliedKeyViolation<Rels> | DeclaredKeyViolation<Rels> | ContainmentViolation<Rels> | MirrorViolation<Rels> | CapacityViolation<Rels>;
164
93
  /**
165
94
  * The abandoned arm of a write result (ruled 2026-07-23, R10): present in
@@ -169,151 +98,75 @@ type Violation<Rels extends SchemaRelations> = ImpliedKeyViolation<Rels> | Decla
169
98
  * a dead arm is never handled.
170
99
  */
171
100
  type AbandonedArm<R> = R extends Abandon<infer P> ? {
172
- readonly ok: false;
101
+ readonly tag: "abandoned";
173
102
  readonly abandoned: P;
174
103
  } : never;
175
- /**
176
- * A write's domain outcome, one sum for BOTH verbs (ruled 2026-07-23,
177
- * R10): the committed generation; the COMPLETE violation set (every
178
- * violated statement cited once, per direction for a containment, in
179
- * materialized statement order); or the callback's own abandon payload —
180
- * commit-vs-abandon is in the type, so a caller's explicit decline to
181
- * commit can never be silently discarded. Narrows on `.ok`, then (when the
182
- * callback can abandon) on `"violations" in result`.
183
- */
184
- type WriteResult<Rels extends SchemaRelations, R = void> = {
185
- readonly ok: true;
104
+ type SyncResult<R> = R extends PromiseLike<unknown> ? never : R;
105
+ interface Committed<T> {
106
+ readonly value: T;
186
107
  readonly generation: bigint;
108
+ }
109
+ type Admission<Rels extends SchemaRelations, T> = {
110
+ readonly tag: "accepted";
111
+ readonly value: T;
112
+ } | {
113
+ readonly tag: "rejected";
114
+ readonly violations: readonly Violation<Rels>[];
115
+ };
116
+ type WriteOutcome<Rels extends SchemaRelations, R> = {
117
+ readonly tag: "accepted";
118
+ readonly value: Committed<Exclude<R, Abandon<unknown>>>;
187
119
  } | {
188
- readonly ok: false;
120
+ readonly tag: "rejected";
189
121
  readonly violations: readonly Violation<Rels>[];
190
122
  } | AbandonedArm<R>;
191
- /**
192
- * The delta-building callback of a write: runs synchronously against the
193
- * live transaction. Returning {@link abandon}`(payload)` rolls the
194
- * transaction back (R10) — the result type carries the payload arm exactly
195
- * then.
196
- */
197
- type DeltaBuild<Rels extends SchemaRelations, R = void> = (tx: Tx<Rels>) => R;
198
- /**
199
- * The runtime discriminant of {@link Abandon} values — a property probe is
200
- * how `write`/`writeFrom` distinguish "abort without committing" from an
201
- * ordinary callback result, never a guess about the host's own value shapes.
202
- */
123
+ type WriteFromOutcome<Rels extends SchemaRelations, R> = WriteOutcome<Rels, R> | {
124
+ readonly tag: "moved";
125
+ readonly witnessed: bigint;
126
+ readonly current: bigint;
127
+ };
128
+ type DeltaBuild<Rels extends SchemaRelations, R = void> = (tx: WriteTx<Rels>) => R;
203
129
  declare const abandonMark: unique symbol;
204
130
  /**
205
131
  * The abandon sentinel {@link abandon} builds: returning one from a `write`
206
132
  * or `writeFrom` callback rolls the transaction back WITHOUT
207
133
  * committing (no empty commit is ever issued) and surfaces the payload as
208
- * `{ ok: false, abandoned: payload }` (ruled 2026-07-23, R10 — the
134
+ * `{ tag: "abandoned", abandoned: payload }` (ruled 2026-07-23, R10 — the
209
135
  * sentinel's contract is unconditional, whichever write verb received it).
210
136
  */
211
137
  interface Abandon<P> {
212
138
  readonly [abandonMark]: true;
213
139
  readonly payload: P;
214
140
  }
215
- /**
216
- * Wraps a payload in the {@link Abandon} sentinel — the one way a write
217
- * callback declines to commit: `return abandon(payload)` aborts the delta
218
- * (nothing is committed, not even an empty commit) and the write resolves
219
- * to `{ ok: false, abandoned: payload }`, from `write` and `writeFrom`
220
- * alike (R10).
221
- */
222
141
  declare function abandon<P>(payload: P): Abandon<P>;
223
- /**
224
- * One live write transaction: the submitted delta with the engine's
225
- * FINAL-STATE point-read view (base + pending delta — the exact state the
226
- * commit judgment judges, so check-then-act is race-free by construction).
227
- * Spent when its owning `write`/`writeFrom` call resolves the attempt;
228
- * any later use throws.
229
- */
230
- interface Tx<Rels extends SchemaRelations> {
231
- /**
232
- * Records a collection of inserts. Singleton is `[fact]`. Empty is
233
- * lawful. Returns how many facts were consumed and how many changed
234
- * the in-memory final-state view. Every fact is complete — omitted
235
- * fresh cells are a type error; mint first with {@link Tx.reserve}.
236
- */
237
- insert<R extends MemberRelation<Rels>>(relation: R, facts: Iterable<Fact<R>>): MutationReport;
238
- /**
239
- * Records a collection of deletes. Singleton is `[fact]`. Returns
240
- * how many facts were consumed and how many changed the view.
241
- */
142
+ interface WriteTx<Rels extends SchemaRelations> {
143
+ insert<R extends MemberRelation<Rels>>(relation: R, facts: CollectionWrite<R>): MutationReport;
242
144
  delete<R extends MemberRelation<Rels>>(relation: R, facts: Iterable<Fact<R>>): MutationReport;
243
- /**
244
- * Mints `count` consecutive fresh values for a `.fresh` field.
245
- * `count === 0n` is empty and does not yield a start.
246
- */
247
145
  reserve<R extends MemberRelation<Rels>>(relation: R, field: FreshKeys<R> & string, count: bigint): FreshRange;
248
- /** Final-state membership of one complete fact. */
249
146
  contains<R extends MemberRelation<Rels>>(relation: R, fact: Fact<R>): boolean;
250
- /**
251
- * Final-state point lookup through the relation's primary key (the
252
- * {@link KeyFact} rule); `undefined` on a miss.
253
- */
254
147
  get<R extends MemberRelation<Rels>>(relation: R, key: KeyFact<R>): Fact<R> | undefined;
255
- /**
256
- * Final-state point lookup through a DECLARED `key()` statement of this
257
- * schema — the key object is typed by the statement's own projection;
258
- * `undefined` on a miss.
259
- */
260
148
  get<R extends MemberRelation<Rels>, const P extends readonly string[]>(relation: R, keyStatement: KeyStatement<R, P>, key: DeclaredKeyFact<R, P>): Fact<R> | undefined;
261
149
  }
262
- /**
263
- * The read view one `db.read(fn)` call scopes — or one `using snap =
264
- * db.read()` acquisition owns (ruled 2026-07-23, R12: lifetimes are
265
- * disposables, never `close()`). The callback form invalidates the value
266
- * when `fn` returns; the `using` form releases it at scope exit through
267
- * `Symbol.dispose` — either way the release is deterministic and
268
- * scope-shaped, every later verb call throws a typed used-after-scope
269
- * error, and the underlying snapshot (with its LMDB reader slot) is
270
- * already closed.
271
- */
272
- interface ReadScope<Rels extends SchemaRelations> extends Disposable {
273
- /**
274
- * The committed generation this scope witnessed — carried by the
275
- * snapshot open itself (one crossing, inside the snapshot's own
276
- * transaction), so it is atomic with the snapshot by construction.
277
- */
150
+ declare const witnessTypes: unique symbol;
151
+ interface Witness<Rels extends SchemaRelations> extends Disposable {
152
+ readonly [witnessTypes]?: Rels;
153
+ }
154
+ interface ReadInstance<Rels extends SchemaRelations> {
278
155
  readonly generation: bigint;
279
- /** Full-relation export in row-id order, decoded to bare structural facts. */
280
156
  scan<R extends MemberRelation<Rels>>(relation: R): Fact<R>[];
281
- /**
282
- * Committed-state point lookup through the relation's primary key
283
- * (the {@link KeyFact} rule); `undefined` on a miss.
284
- */
157
+ count<R extends MemberRelation<Rels>>(relation: R): bigint;
285
158
  get<R extends MemberRelation<Rels>>(relation: R, key: KeyFact<R>): Fact<R> | undefined;
286
- /**
287
- * Committed-state point lookup through a DECLARED `key()` statement of
288
- * this schema — the key object is typed by the statement's own
289
- * projection; `undefined` on a miss.
290
- */
291
159
  get<R extends MemberRelation<Rels>, const P extends readonly string[]>(relation: R, keyStatement: KeyStatement<R, P>, key: DeclaredKeyFact<R, P>): Fact<R> | undefined;
292
- /** Committed-state membership of one complete fact. */
293
160
  contains<R extends MemberRelation<Rels>>(relation: R, fact: Fact<R>): boolean;
294
- /**
295
- * Executes a prepared query against this scope's snapshot with the
296
- * typed params object; returns the answer SET as plain rows with
297
- * bare structural values (no order — the host sorts). This is the ONE
298
- * execution spelling ({@link Prepared} carries no `execute`).
299
- */
300
161
  execute<Row, Params extends ParamsRecord>(prepared: Prepared<Rels, Row, Params>, params: Params): Row[];
162
+ prepare<Row, Params extends ParamsRecord>(q: Query<Rels, Row, Params>): Prepared<Rels, Row, Params>;
301
163
  }
302
- /**
303
- * The module-private inference slot of {@link Prepared}: an optional symbol
304
- * property (never set at runtime) that keeps the prepared value's `Row` and
305
- * `Params` type arguments load-bearing, so `execute` infers the typed rows
306
- * and the typed params object from the value alone — the query module's
307
- * `inferred` pattern, local to this module. A type-level carrier only:
308
- * values stay bare, nothing is asserted.
309
- */
310
164
  declare const preparedTypes: unique symbol;
311
165
  /**
312
166
  * One prepared query as a plain VALUE: explicit visible compilation
313
167
  * (`db.prepare(q)` lowers, pins the plan, and surfaces every engine roster
314
168
  * refusal), no lifecycle. Execution happens ONLY through
315
- * `snap.execute(prepared, params)` / `db.execute(prepared, params)` — the
316
- * symmetry rule's one spelling. The engine-side plan is reclaimed by a GC
169
+ * `instance.execute(prepared, params)`. The engine-side plan is reclaimed by a GC
317
170
  * finalizer when this value becomes unreachable (reclamation only, never
318
171
  * correctness — an unreclaimed plan is idle memory, and process exit frees
319
172
  * everything).
@@ -325,60 +178,19 @@ interface Prepared<Rels extends SchemaRelations, Row, Params extends ParamsRecor
325
178
  readonly params: Params;
326
179
  };
327
180
  }
328
- /**
329
- * An open store. There is no close: read through `read`/the read sugar,
330
- * write through `write`/`writeFrom`, and let the process own the
331
- * environment's lifetime (the engine fsyncs every commit, so durability
332
- * never waits on a close). A second `open`/`create` of the same path
333
- * while this handle lives is the engine's `EnvironmentLocked`.
334
- */
335
181
  interface Db<Rels extends SchemaRelations> {
336
- /** The theory this store was opened with (fingerprint-verified by the engine). */
337
182
  readonly schema: Schema<Rels>;
338
- /**
339
- * One scoped snapshot read: opens an MVCC snapshot, runs `fn`
340
- * SYNCHRONOUSLY against it, and closes the snapshot unconditionally
341
- * before returning `fn`'s result. The {@link ReadScope} is invalidated
342
- * when `fn` returns — a used-after-scope call throws a typed error.
343
- */
344
- read<T>(fn: (snap: ReadScope<Rels>) => T): T;
345
- /**
346
- * The `using` acquisition (ruled 2026-07-23, R12): `using snap =
347
- * db.read()` — the caller owns the scope's lifetime, and the scope's
348
- * `Symbol.dispose` releases the snapshot deterministically at scope
349
- * exit, in the language's own syntax. Lifetimes are disposables, never
350
- * `close()`.
351
- */
352
- read(): ReadScope<Rels>;
353
- /** `db.scan(r)` === `db.read(snap => snap.scan(r))` — the symmetry rule. */
354
- scan<R extends MemberRelation<Rels>>(relation: R): Fact<R>[];
355
- /** `db.get(r, k)` === `db.read(snap => snap.get(r, k))` — the symmetry rule. */
356
- get<R extends MemberRelation<Rels>>(relation: R, key: KeyFact<R>): Fact<R> | undefined;
357
- /** `db.get(r, s, k)` === `db.read(snap => snap.get(r, s, k))` — the symmetry rule, keyed form. */
358
- get<R extends MemberRelation<Rels>, const P extends readonly string[]>(relation: R, keyStatement: KeyStatement<R, P>, key: DeclaredKeyFact<R, P>): Fact<R> | undefined;
359
- /** `db.contains(r, f)` === `db.read(snap => snap.contains(r, f))` — the symmetry rule. */
360
- contains<R extends MemberRelation<Rels>>(relation: R, fact: Fact<R>): boolean;
361
- /** `db.execute(p, params)` === `db.read(snap => snap.execute(p, params))` — the symmetry rule. */
362
- execute<Row, Params extends ParamsRecord>(prepared: Prepared<Rels, Row, Params>, params: Params): Row[];
183
+ read<R>(body: (instance: ReadInstance<Rels>, witness: Witness<Rels>) => SyncResult<R>): SyncResult<R>;
363
184
  /**
364
185
  * One delta transaction: builds the delta synchronously through `fn`,
365
186
  * commits, and returns the domain outcome. A throw from `fn` aborts
366
187
  * the delta (LMDB untouched) and rethrows wrapped. `fn` may decline to
367
- * commit by returning {@link abandon}`(payload)` (ruled 2026-07-23,
368
- * R10): the transaction rolls back — nothing is committed, not even an
369
- * empty commit — and the outcome is `{ ok: false, abandoned: payload }`,
370
- * an arm the result type carries exactly when the callback can abandon.
188
+ * commit by returning {@link abandon}`(payload)`: the transaction rolls
189
+ * back — nothing is committed, not even an empty commit — and the
190
+ * outcome is `{ tag: "abandoned", abandoned: payload }`.
371
191
  */
372
- write<R = void>(fn: DeltaBuild<Rels, R>): WriteResult<Rels, R>;
373
- /**
374
- * One-shot witnessed write from a live read snapshot: begins a
375
- * transaction that commits only if no state-changing commit landed
376
- * since `snap` was taken. Must run inside the read callback that owns
377
- * `snap`. A moved generation is the typed {@link ErrGenerationMoved}
378
- * — retry is host policy; this method never loops. `fn` may decline to
379
- * commit by returning {@link abandon}`(payload)`.
380
- */
381
- writeFrom<R>(snap: ReadScope<Rels>, fn: DeltaBuild<Rels, R>): WriteResult<Rels, R>;
192
+ write<R>(fn: (tx: WriteTx<Rels>) => SyncResult<R>): WriteOutcome<Rels, SyncResult<R>>;
193
+ writeFrom<R>(witness: Witness<Rels>, fn: (tx: WriteTx<Rels>) => SyncResult<R>): WriteFromOutcome<Rels, SyncResult<R>>;
382
194
  /**
383
195
  * Prepares a query value built against THIS schema (identity is the
384
196
  * membership rule): lowers it to the engine IR, pins the plan, and
@@ -388,59 +200,50 @@ interface Db<Rels extends SchemaRelations> {
388
200
  */
389
201
  prepare<Row, Params extends ParamsRecord>(q: Query<Rels, Row, Params>): Prepared<Rels, Row, Params>;
390
202
  }
391
- /**
392
- * The typed generation-moved refusal `writeFrom` throws when a
393
- * state-changing commit landed since the witness snapshot: retry is host
394
- * policy. Match with `errors.is`.
395
- */
396
- declare const ErrGenerationMoved: Error;
397
- /**
398
- * The engine twin of the schema-level class wall, as a matchable value
399
- * (`errors.is`): the shared lowering rejected a spec whose statement pairs
400
- * faces with disagreeing newtype labels — the faces of a dependency agree
401
- * on their newtype, or neither carries one. UNREACHABLE through the typed
402
- * builder (the SDK computes every label from the laws, so its lowered
403
- * specs cohere by construction); a raw spec handed to the bridge is the
404
- * one road here, and the runtime referee that proves the engine judges
405
- * what the types claim.
406
- */
203
+ declare const ErrAsyncCallback: Error;
204
+ declare const ErrSpentHandle: Error;
205
+ declare const ErrUseAfterScope: Error;
206
+ declare const ErrForeignPrepared: Error;
207
+ declare const ErrForeignWitness: Error;
407
208
  declare const ErrNewtypeMismatch: Error;
209
+ declare const ErrSchemaError: Error;
210
+ declare const ErrFingerprintMismatch: Error;
211
+ declare const ErrIrError: Error;
212
+ interface OwnedInstance<Rels extends SchemaRelations> extends Disposable {
213
+ prepare<Row, Params extends ParamsRecord>(q: Query<Rels, Row, Params>): Prepared<Rels, Row, Params>;
214
+ execute<Row, Params extends ParamsRecord>(prepared: Prepared<Rels, Row, Params>, params: Params): Row[];
215
+ scan<R extends MemberRelation<Rels>>(relation: R): Fact<R>[];
216
+ count<R extends MemberRelation<Rels>>(relation: R): bigint;
217
+ contains<R extends MemberRelation<Rels>>(relation: R, fact: Fact<R>): boolean;
218
+ get<R extends MemberRelation<Rels>>(relation: R, key: KeyFact<R>): Fact<R> | undefined;
219
+ get<R extends MemberRelation<Rels>, const P extends readonly string[]>(relation: R, keyStatement: KeyStatement<R, P>, key: DeclaredKeyFact<R, P>): Fact<R> | undefined;
220
+ }
221
+ interface InstanceBuilder<Rels extends SchemaRelations> extends Disposable {
222
+ load<R extends MemberRelation<Rels>>(relation: R, facts: CollectionWrite<R>): MutationReport;
223
+ delete<R extends MemberRelation<Rels>>(relation: R, facts: Iterable<Fact<R>>): MutationReport;
224
+ reserve<R extends MemberRelation<Rels>>(relation: R, field: FreshKeys<R> & string, count: bigint): FreshRange;
225
+ contains<R extends MemberRelation<Rels>>(relation: R, fact: Fact<R>): boolean;
226
+ get<R extends MemberRelation<Rels>>(relation: R, key: KeyFact<R>): Fact<R> | undefined;
227
+ get<R extends MemberRelation<Rels>, const P extends readonly string[]>(relation: R, keyStatement: KeyStatement<R, P>, key: DeclaredKeyFact<R, P>): Fact<R> | undefined;
228
+ admit(): Promise<Admission<Rels, OwnedInstance<Rels>>>;
229
+ }
230
+ declare const InstanceBuilder: Readonly<{
231
+ create<Rels extends SchemaRelations>(theory: Schema<Rels>): InstanceBuilder<Rels>;
232
+ }>;
408
233
  /**
409
234
  * The store lifecycle — `Db.create(path, schema)` / `Db.open(path, schema)`.
410
235
  * Create refuses an already-initialized directory; open verifies format
411
- * version, store kind, and the schema fingerprint. A second live handle
412
- * on the same path is the engine's `EnvironmentLocked`. There is no close
413
- * anywhere: the process owns the environment until GC/exit (durability is
414
- * the engine's per-commit fsync). One store kind exists: durable —
415
- * resume = reopen in a fresh process, or hold the `Db` this process opened.
236
+ * version and the schema fingerprint. A second live handle on the same
237
+ * path is the engine's `EnvironmentLocked`. There is no close anywhere:
238
+ * the process owns the environment until GC/exit (durability is the
239
+ * engine's per-commit fsync). Resume = reopen in a fresh process, or
240
+ * hold the `Db` this process opened.
416
241
  */
417
242
  declare const Db: Readonly<{
418
- /** Creates a fresh durable store at `path` from the schema. */
419
- create<Rels extends SchemaRelations>(path: string, theory: Schema<Rels>): Promise<Db<Rels>>;
420
- /**
421
- * Opens an existing durable store at `path` with the same theory.
422
- * A fingerprint-matching open also BACK-FILLS the store's persisted
423
- * schema descriptor when it is absent (self-describing stores, engine
424
- * 50-storage.md § the `_meta` block), so a legacy store becomes
425
- * exhumable after one ordinary open — adoption is automatic, never a
426
- * separate verb. A second open of a still-live path is
427
- * `EnvironmentLocked`.
428
- */
429
- open<Rels extends SchemaRelations>(path: string, theory: Schema<Rels>): Promise<Db<Rels>>;
430
- /**
431
- * Opens a store READ-ONLY from its own persisted descriptor — the SDK's
432
- * one schema-independent read path (no theory, no fingerprint check; the
433
- * store rebirth tool's entry). Lives beside `open`/`create` so the path
434
- * law stays in one place: the same `node:path.resolve` canonicalization,
435
- * applied here. The value is NOT cached and is a DISPOSABLE lifetime
436
- * (R12) — `using exhumed = await Db.exhume(path)` releases the engine
437
- * handle and the store's exclusive lock at scope exit, so a same-path
438
- * reopen never waits on GC. A store not yet adopted rejects with the
439
- * typed `ErrExhumeNoDescriptor` (the remedy: one fingerprint-matching
440
- * `Db.open` under the creating schema back-fills the descriptor).
441
- */
442
- exhume(storePath: string): Promise<Exhumed>;
243
+ create<Rels extends SchemaRelations>(storePath: string, theory: Schema<Rels>): Promise<Admission<Rels, Db<Rels>>>;
244
+ open<Rels extends SchemaRelations>(storePath: string, theory: Schema<Rels>): Promise<Db<Rels>>;
245
+ fromInstance<Rels extends SchemaRelations>(storePath: string, instance: OwnedInstance<Rels>): Promise<Db<Rels>>;
443
246
  }>;
444
- export type { Abandon, AbandonedArm, CapacityViolation, ContainmentViolation, DeclaredKeyFact, DeclaredKeyViolation, DeltaBuild, FreshRange, ImpliedKeyViolation, MemberRelation, MirrorViolation, MutationReport, OffendingFact, Prepared, ReadScope, Tx, Violation, WriteResult };
445
- export { abandon, Db, ErrGenerationMoved, ErrNewtypeMismatch };
247
+ export type { Abandon, AbandonedArm, Admission, CapacityViolation, Committed, ContainmentViolation, DeclaredKeyFact, DeclaredKeyViolation, DeltaBuild, FreshRange, ImpliedKeyViolation, MemberRelation, MirrorViolation, MutationReport, OffendingFact, OwnedInstance, Prepared, ReadInstance, SyncResult, Violation, Witness, WriteFromOutcome, WriteOutcome, WriteTx };
248
+ export { abandon, Db, ErrAsyncCallback, ErrFingerprintMismatch, ErrForeignPrepared, ErrForeignWitness, ErrIrError, ErrNewtypeMismatch, ErrSchemaError, ErrSpentHandle, ErrUseAfterScope, InstanceBuilder };
446
249
  //# 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,EAAkC,KAAK,OAAO,EAA6B,MAAM,aAAa,CAAA;AAErG,OAAO,KAAK,EAEX,SAAS,EAQT,MAAM,YAAY,CAAA;AAGnB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAG5C,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAa,MAAM,EAAkB,eAAe,EAAE,MAAM,YAAY,CAAA;AACpF,OAAO,EAAe,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/E;;;;GAIG;AACH,KAAK,cAAc,CAAC,IAAI,SAAS,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,WAAW,CAAC,CAAA;AAE1F;;;GAGG;AACH,UAAU,cAAc;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACxB;AAED;;;GAGG;AACH,KAAK,UAAU,GACZ;I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