@bjornpagen/bumbledb 0.6.0 → 0.8.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.
- package/COOKBOOK.md +150 -9
- package/README.md +18 -5
- package/dist/capacity.d.ts +310 -0
- package/dist/capacity.d.ts.map +1 -0
- package/dist/capacity.js +138 -0
- package/dist/capacity.js.map +1 -0
- package/dist/closed.d.ts +7 -5
- package/dist/closed.d.ts.map +1 -1
- package/dist/closed.js +4 -1
- package/dist/closed.js.map +1 -1
- package/dist/db.d.ts +115 -76
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +178 -122
- package/dist/db.js.map +1 -1
- package/dist/exhume.d.ts +22 -10
- package/dist/exhume.d.ts.map +1 -1
- package/dist/exhume.js +42 -9
- package/dist/exhume.js.map +1 -1
- package/dist/face.d.ts +11 -7
- package/dist/face.d.ts.map +1 -1
- package/dist/face.js.map +1 -1
- package/dist/fields.d.ts +38 -16
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +33 -8
- package/dist/fields.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/law.d.ts +3 -2
- package/dist/law.d.ts.map +1 -1
- package/dist/law.js +1 -1
- package/dist/law.js.map +1 -1
- package/dist/lower.d.ts +9 -9
- package/dist/lower.d.ts.map +1 -1
- package/dist/lower.js +20 -14
- package/dist/lower.js.map +1 -1
- package/dist/marshal.d.ts +17 -7
- package/dist/marshal.d.ts.map +1 -1
- package/dist/marshal.js +32 -10
- package/dist/marshal.js.map +1 -1
- package/dist/native.d.ts +66 -12
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js.map +1 -1
- package/dist/query/atom.d.ts +72 -7
- package/dist/query/atom.d.ts.map +1 -1
- package/dist/query/atom.js +12 -9
- package/dist/query/atom.js.map +1 -1
- package/dist/query/lower.d.ts +8 -0
- package/dist/query/lower.d.ts.map +1 -1
- package/dist/query/lower.js +80 -13
- package/dist/query/lower.js.map +1 -1
- package/dist/query/run.d.ts +5 -5
- package/dist/query/run.d.ts.map +1 -1
- package/dist/query/run.js +7 -12
- package/dist/query/run.js.map +1 -1
- package/dist/query/scope.d.ts +15 -5
- package/dist/query/scope.d.ts.map +1 -1
- package/dist/query/scope.js.map +1 -1
- package/dist/relation.d.ts.map +1 -1
- package/dist/relation.js +3 -1
- package/dist/relation.js.map +1 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +12 -2
- package/dist/schema.js.map +1 -1
- package/dist/spec.d.ts +95 -32
- package/dist/spec.d.ts.map +1 -1
- package/dist/spec.js +39 -7
- package/dist/spec.js.map +1 -1
- package/dist/statements.d.ts +62 -25
- package/dist/statements.d.ts.map +1 -1
- package/dist/statements.js +105 -22
- package/dist/statements.js.map +1 -1
- package/package.json +3 -3
- package/src/capacity.ts +454 -0
- package/src/closed.ts +13 -7
- package/src/db.ts +302 -184
- package/src/exhume.ts +48 -11
- package/src/face.ts +14 -6
- package/src/fields.ts +51 -15
- package/src/index.ts +20 -9
- package/src/law.ts +3 -2
- package/src/lower.ts +20 -14
- package/src/marshal.ts +38 -13
- package/src/native.ts +65 -11
- package/src/query/atom.ts +119 -15
- package/src/query/lower.ts +117 -15
- package/src/query/run.ts +7 -12
- package/src/query/scope.ts +15 -6
- package/src/relation.ts +3 -1
- package/src/schema.ts +14 -2
- package/src/spec.ts +112 -34
- package/src/statements.ts +188 -38
- package/dist/count.d.ts +0 -102
- package/dist/count.d.ts.map +0 -1
- package/dist/count.js +0 -115
- package/dist/count.js.map +0 -1
- package/src/count.ts +0 -211
package/dist/capacity.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capacity-law mints — the window, weight, and dependent-bound vocabulary
|
|
3
|
+
* the one `capacity()` statement constructor consumes
|
|
4
|
+
* (`docs/architecture/70-api.md` § the canonical-utterance law, restated
|
|
5
|
+
* around the aggregate form). `within()` is the ONE window spelling —
|
|
6
|
+
* `within(n)` exact (`within(0n)` IS the exclusion's one spelling),
|
|
7
|
+
* `within(lo, hi)` range (`within(0n, hi)` the canonical ceiling),
|
|
8
|
+
* `within(lo, "*")` floor — `weigh()` names the measure on the SOURCE row
|
|
9
|
+
* (`weigh("watts")` a u64 field, `weigh(duration("booked"))` an interval's
|
|
10
|
+
* measure), and `ref()`/`duration()` read a dependent bound from the
|
|
11
|
+
* TARGET row (hi slot only — ruled 2026-07-24, C6). The ban table is
|
|
12
|
+
* enforced REPRESENTATIONALLY in two tiers, split per-aggregate where
|
|
13
|
+
* weight-sensitive (design § 6: a ban is canonical-utterance policing when
|
|
14
|
+
* it is weight-independent, semantic deduplication when it is not):
|
|
15
|
+
*
|
|
16
|
+
* - **The type tier**: a banned spelling written as a LITERAL does not
|
|
17
|
+
* compile — every negative bound, `within(n, n)`, `within(0n, 0n)`, and
|
|
18
|
+
* `within(0n, "*")` are type errors naming the canonical form. The
|
|
19
|
+
* weight-SENSITIVE row rides the `capacity()` overloads themselves:
|
|
20
|
+
* `within(1n, "*")` is banned on the unit overload only (`{1..*}` on the
|
|
21
|
+
* count instance is the bare containment respelled —
|
|
22
|
+
* `window_floor_containment`), and LEGAL on the weighted one ("positive
|
|
23
|
+
* total" is not an existence claim over rows).
|
|
24
|
+
* - **The construction tier**: a bound the type level cannot judge — a
|
|
25
|
+
* COMPUTED `bigint`, or an inverted `within(lo, hi)` order — is judged at
|
|
26
|
+
* construction with the same canonical-naming errors; and past both
|
|
27
|
+
* tiers the engine's own spec validation remains the law for a hostile
|
|
28
|
+
* FFI caller (the standing two-tier ban enforcement).
|
|
29
|
+
*
|
|
30
|
+
* The weight vocabulary is closed at the row (ruled 2026-07-24, ruling 6):
|
|
31
|
+
* a path weight (`weigh("model.watts")`) is a typed refusal at BOTH tiers
|
|
32
|
+
* whose diagnostic names the pinned-column idiom — the two-column
|
|
33
|
+
* containment IS the join, stated as a law. Bounds are `bigint` (u64
|
|
34
|
+
* crosses as bigint always, PRD-04's law); the witnessed measure comes
|
|
35
|
+
* back as `bigint` too (u128-wide engine accumulator, C3).
|
|
36
|
+
*/
|
|
37
|
+
import * as errors from "@superbuilders/errors";
|
|
38
|
+
/**
|
|
39
|
+
* The admission brand — a module-private symbol, deliberately unexported
|
|
40
|
+
* (the standing statement-mint pattern): `CapacityWindowSpec` and
|
|
41
|
+
* `WeightSpec` are public wire types, so without this brand every banned
|
|
42
|
+
* spelling in the ban table would be writable as a plain object literal.
|
|
43
|
+
* The symbol makes `within()` and `weigh()` the ONLY producers of the
|
|
44
|
+
* values `capacity()` accepts, which is what "the ban table is unwritable"
|
|
45
|
+
* means.
|
|
46
|
+
*/
|
|
47
|
+
const admitted = Symbol("bumbledb.capacity.admitted");
|
|
48
|
+
/** Narrows any value to an admitted capacity window through the module-private brand. */
|
|
49
|
+
function isCapacityWindow(value) {
|
|
50
|
+
return typeof value === "object" && value !== null && admitted in value && "window" in value;
|
|
51
|
+
}
|
|
52
|
+
/** Narrows any value to an admitted capacity weight through the module-private brand. */
|
|
53
|
+
function isCapacityWeight(value) {
|
|
54
|
+
return typeof value === "object" && value !== null && admitted in value && "weight" in value;
|
|
55
|
+
}
|
|
56
|
+
/** The unit weight — a case, not an absence (C4): the count instance's one wire spelling. */
|
|
57
|
+
const unitWeight = Object.freeze({ kind: "unit" });
|
|
58
|
+
/** The construction-tier twin of {@link PathBan}: a dotted name refuses naming the idiom. */
|
|
59
|
+
function assertRowLocal(field, role) {
|
|
60
|
+
if (field.includes(".")) {
|
|
61
|
+
throw errors.new(`${role} \`${field}\` walks a reference — the vocabulary is closed at the row (ruling 6): pin the column with a two-column containment (Source(ref, f) <= Catalog(id, f)) and name the local field`);
|
|
62
|
+
}
|
|
63
|
+
return field;
|
|
64
|
+
}
|
|
65
|
+
/** Stamps one admitted window spec as a frozen branded value. */
|
|
66
|
+
function admitWindow(window) {
|
|
67
|
+
const value = { window, [admitted]: true };
|
|
68
|
+
return Object.freeze(value);
|
|
69
|
+
}
|
|
70
|
+
/** One literal bound. */
|
|
71
|
+
function lit(value) {
|
|
72
|
+
return Object.freeze({ kind: "lit", value });
|
|
73
|
+
}
|
|
74
|
+
function within(lo, hi) {
|
|
75
|
+
if (lo < 0n) {
|
|
76
|
+
throw errors.new(`capacity bounds are u64: within(${lo}${hi === undefined ? "" : ", …"}) is out of domain`);
|
|
77
|
+
}
|
|
78
|
+
if (hi === undefined) {
|
|
79
|
+
return admitWindow({ kind: "exact", n: lit(lo) });
|
|
80
|
+
}
|
|
81
|
+
if (hi === "*") {
|
|
82
|
+
if (lo === 0n) {
|
|
83
|
+
throw errors.new("the `{0..*}` window is vacuous — it provably says nothing; delete the statement");
|
|
84
|
+
}
|
|
85
|
+
return admitWindow({ kind: "floor", lo: lit(lo) });
|
|
86
|
+
}
|
|
87
|
+
if (typeof hi === "bigint") {
|
|
88
|
+
if (hi < 0n) {
|
|
89
|
+
throw errors.new(`capacity bounds are u64: within(${lo}, ${hi}) is out of domain`);
|
|
90
|
+
}
|
|
91
|
+
if (hi < lo) {
|
|
92
|
+
throw errors.new(`the window \`{${lo}..${hi}}\` is inverted — no measure satisfies it; bounds are \`{lo..hi}\` with lo < hi (an exact measure is \`{n}\`: within(n))`);
|
|
93
|
+
}
|
|
94
|
+
if (lo === hi) {
|
|
95
|
+
if (lo === 0n) {
|
|
96
|
+
throw errors.new("`{0..0}` — the point window is written `{0}`: use within(0n)");
|
|
97
|
+
}
|
|
98
|
+
throw errors.new(`\`{${lo}..${lo}}\` — an exact measure is written \`{${lo}}\`: use within(${lo}n)`);
|
|
99
|
+
}
|
|
100
|
+
return admitWindow({ kind: "range", lo: lit(lo), hi: lit(hi) });
|
|
101
|
+
}
|
|
102
|
+
const field = assertRowLocal(hi.field, "dependent bound");
|
|
103
|
+
if (hi.kind === "durationField") {
|
|
104
|
+
return admitWindow({ kind: "range", lo: lit(lo), hi: Object.freeze({ kind: "durationField", field }) });
|
|
105
|
+
}
|
|
106
|
+
return admitWindow({ kind: "range", lo: lit(lo), hi: Object.freeze({ kind: "field", field }) });
|
|
107
|
+
}
|
|
108
|
+
/** Stamps one admitted weight spec as a frozen branded value. */
|
|
109
|
+
function admitWeight(weight) {
|
|
110
|
+
const value = { weight, [admitted]: true };
|
|
111
|
+
return Object.freeze(value);
|
|
112
|
+
}
|
|
113
|
+
function weigh(measure) {
|
|
114
|
+
if (typeof measure === "string") {
|
|
115
|
+
return admitWeight({ kind: "field", field: assertRowLocal(measure, "weight") });
|
|
116
|
+
}
|
|
117
|
+
return admitWeight({ kind: "durationField", field: assertRowLocal(measure.field, "weight") });
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* A dependent bound by name — `within(0n, ref("supply"))` reads each
|
|
121
|
+
* group's ceiling from the TARGET row's u64 field (bound names resolve
|
|
122
|
+
* against the target's FULL roster, C1 — the projection tuple stays the
|
|
123
|
+
* pure grouping key). Carries no value.
|
|
124
|
+
*/
|
|
125
|
+
function ref(field) {
|
|
126
|
+
return Object.freeze({ kind: "field", field: assertRowLocal(field, "dependent bound") });
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* `Duration(field)` — the interval-measure spelling, one mint for both
|
|
130
|
+
* slots: handed to `weigh()` it is the SOURCE row's interval measure;
|
|
131
|
+
* in `within()`'s hi slot it is the TARGET row's interval-measure bound
|
|
132
|
+
* (Duration weights pair with Duration-capable bounds — C18).
|
|
133
|
+
*/
|
|
134
|
+
function duration(field) {
|
|
135
|
+
return Object.freeze({ kind: "durationField", field: assertRowLocal(field, "Duration measure") });
|
|
136
|
+
}
|
|
137
|
+
export { duration, isCapacityWeight, isCapacityWindow, ref, unitWeight, weigh, within };
|
|
138
|
+
//# sourceMappingURL=capacity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capacity.js","sourceRoot":"","sources":["../src/capacity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OA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C9F,CAAC;AAED;;;;;GAKG;AACH,SAAS,GAAG,CAAyB,KAAqB;IACzD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAAE,CAAgB,CAAA;AACxG,CAAC;AAED;;;;;GAKG;AACH,SAAS,QAAQ,CAAyB,KAAqB;IAC9D,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,CAAC,KAAK,EAAE,kBAAkB,CAAC,EAAE,CAAmB,CAAA;AACpH,CAAC;AAGD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA"}
|
package/dist/closed.d.ts
CHANGED
|
@@ -98,12 +98,14 @@ interface ClosedCore<Name extends string, Handles extends string, Cols extends R
|
|
|
98
98
|
* The closed reference descriptor: `kind: Kind.id` in another relation's
|
|
99
99
|
* field block is the reference through which handle literals become
|
|
100
100
|
* legal in that relation's selections. Pure structure plus the PRECISE
|
|
101
|
-
* roster (`ClosedIdField<Handles>` — the handle union is the
|
|
102
|
-
* value type under `Infer
|
|
103
|
-
*
|
|
104
|
-
*
|
|
101
|
+
* roster (`ClosedIdField<Name, Handles>` — the handle union is the
|
|
102
|
+
* field's value type under `Infer`, and the name literal keeps two
|
|
103
|
+
* same-shaped vocabularies distinct at the type tier, matching the
|
|
104
|
+
* runtime's roster-identity judgment); the referencing field's domain is
|
|
105
|
+
* law-born: `schema()` computes it from the declared containment
|
|
106
|
+
* (`"Kind.id"`, the generator class).
|
|
105
107
|
*/
|
|
106
|
-
readonly id: ClosedIdField<Handles>;
|
|
108
|
+
readonly id: ClosedIdField<Name, Handles>;
|
|
107
109
|
readonly data: ClosedData;
|
|
108
110
|
/** Payload readback: handle to its declared column values, bare and structural. */
|
|
109
111
|
readonly axioms: Axioms<Handles, Cols>;
|
package/dist/closed.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closed.d.ts","sourceRoot":"","sources":["../src/closed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,EACN,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"closed.d.ts","sourceRoot":"","sources":["../src/closed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,EACN,KAAK,QAAQ,EAGb,KAAK,aAAa,EAElB,KAAK,KAAK,EAEV,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAoB,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAA;AAC3F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C;;;GAGG;AACH,KAAK,YAAY,GAAG,OAAO,CAAC,QAAQ,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAA;CAAE,CAAC,CAAA;AAE/D;;;;;;;;;GASG;AACH,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,KAAK,CAAA;CAAE,CAAA;AAE5E,mEAAmE;AACnE,UAAU,YAAY;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;CAC5B;AAED;;;;;GAKG;AACH,UAAU,SAAS;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAA;CACvC;AAED,+CAA+C;AAC/C,UAAU,UAAU;IACnB,QAAQ,CAAC,IAAI,EAAE,M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,EACZ,cAAc,EACd,CAAA;AACD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,CAAA"}
|
package/dist/closed.js
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* shape.
|
|
31
31
|
*/
|
|
32
32
|
import * as errors from "@superbuilders/errors";
|
|
33
|
-
import { assertDeclarationOrderKey, literalOf } from "#fields.ts";
|
|
33
|
+
import { assertDeclarationOrderKey, assertDeclarationRecord, literalOf } from "#fields.ts";
|
|
34
34
|
import { resolveSelection } from "#relation.ts";
|
|
35
35
|
/**
|
|
36
36
|
* THE relation-kind discriminant — the ONE spelling of "is this schema
|
|
@@ -160,9 +160,11 @@ function closedBare(name, handles) {
|
|
|
160
160
|
* axioms record's own keys.
|
|
161
161
|
*/
|
|
162
162
|
function closedPayload(name, columns, axioms) {
|
|
163
|
+
assertDeclarationRecord(`closed relation ${name} columns`, columns);
|
|
163
164
|
for (const columnName of Object.keys(columns)) {
|
|
164
165
|
assertDeclarationOrderKey(`closed relation ${name} column`, columnName);
|
|
165
166
|
}
|
|
167
|
+
assertDeclarationRecord(`closed relation ${name} axioms`, axioms);
|
|
166
168
|
const handles = Object.keys(axioms);
|
|
167
169
|
for (const handle of handles) {
|
|
168
170
|
assertDeclarationOrderKey(`closed relation ${name} handle`, handle);
|
|
@@ -192,6 +194,7 @@ function surfaceMinted(value, cols) {
|
|
|
192
194
|
* ψ-selection `where()`.
|
|
193
195
|
*/
|
|
194
196
|
function mintClosed(name, handles, columns, axioms) {
|
|
197
|
+
assertDeclarationOrderKey("closed relation", name);
|
|
195
198
|
if (handles.length === 0) {
|
|
196
199
|
throw errors.new(`closed relation ${name}: at least one handle is required (an empty vocabulary declares nothing)`);
|
|
197
200
|
}
|
package/dist/closed.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closed.js","sourceRoot":"","sources":["../src/closed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;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/F,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC;YACpB,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SAClE,CAAC,CAAA;IACH,CAAC;IACD,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,CAAA;IACvE,MAAM,KAAK,GACV,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC1E,IAAI,CAAC,aAAa,CAAsB,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;QACtD,MAAM,MAAM,CAAC,GAAG,CAAC,mBAAmB,IAAI,wCAAwC,CAAC,CAAA;IAClF,CAAC;IACD,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,OAAO,KAAK,CAAA;AACb,CAAC;AAiBD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,CAAA"}
|
package/dist/db.d.ts
CHANGED
|
@@ -5,16 +5,19 @@
|
|
|
5
5
|
* keyed to statements, read through scoped snapshots, and run the witnessed
|
|
6
6
|
* read-compute-write loop — all typed by the schema's relations record.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
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. `Db` values
|
|
11
|
+
* are CACHED per canonical path for the life of the process (a best-effort
|
|
12
|
+
* exit hook closes the cached environments; correctness never depends on it
|
|
13
|
+
* — the engine fsyncs every commit, so a process that dies without the hook
|
|
14
|
+
* loses nothing that was committed). Snapshots are scope-shaped both ways:
|
|
15
|
+
* `read(fn)` opens one before `fn` and closes it after unconditionally
|
|
16
|
+
* (the {@link ReadScope} handed to `fn` is invalidated the moment `fn`
|
|
17
|
+
* returns), and `using snap = db.read()` hands the caller the lifetime,
|
|
18
|
+
* released by the scope's own `Symbol.dispose` at scope exit. Prepared
|
|
19
|
+
* plans are plain values whose engine-side half is reclaimed by a GC
|
|
20
|
+
* finalizer — reclamation only, never correctness.
|
|
18
21
|
*
|
|
19
22
|
* PROCESS MODEL: one process, one exclusive-lock handle per store. The
|
|
20
23
|
* cached `Db` value owns the LMDB environment's exclusive lock until
|
|
@@ -31,12 +34,12 @@
|
|
|
31
34
|
*/
|
|
32
35
|
import type { Exhumed } from "#exhume.ts";
|
|
33
36
|
import { type KeyFact, type Minted } from "#marshal.ts";
|
|
34
|
-
import type { FactValue, Staleness, StatementKindTag } from "#native.ts";
|
|
37
|
+
import type { Explain, FactValue, Staleness, StatementKindTag } from "#native.ts";
|
|
35
38
|
import type { Query } from "#query/lower.ts";
|
|
36
39
|
import type { ParamsRecord } from "#query/scope.ts";
|
|
37
40
|
import type { AnyRelation, Fact, InsertFact } from "#relation.ts";
|
|
38
41
|
import type { Schema, SchemaRelations } from "#schema.ts";
|
|
39
|
-
import type
|
|
42
|
+
import { type KeyStatement, type Statement } from "#statements.ts";
|
|
40
43
|
/**
|
|
41
44
|
* The ordinary (writable, scannable) relations of a schema's record — the
|
|
42
45
|
* only values the runtime methods accept: closed relations lack the
|
|
@@ -76,8 +79,10 @@ interface OffendingFact<Rels extends SchemaRelations> {
|
|
|
76
79
|
* orientation (identical strings; the engine's `render.rs` renders each
|
|
77
80
|
* partner of a mirrored pair as the `==` spelling, never a bare `<=`
|
|
78
81
|
* direction). `direction` (`sourceUnsatisfied` | `targetRequired`) and
|
|
79
|
-
* `
|
|
80
|
-
* the engine VERBATIM
|
|
82
|
+
* `measure` are the containment/capacity form payloads, passed through
|
|
83
|
+
* from the engine VERBATIM (`measure` the capacity form's witnessed group
|
|
84
|
+
* total — u128-wide, crossing whole as bigint, C3) — `direction` is
|
|
85
|
+
* relative to the violated SLOT's
|
|
81
86
|
* own orientation, so for a `mirrors` statement it alone cannot say which
|
|
82
87
|
* side of the `==` was violated: the slot identity is carried by
|
|
83
88
|
* `orientation`, present exactly for `mirrors` slots — `written` is the
|
|
@@ -90,23 +95,43 @@ interface Violation<Rels extends SchemaRelations> {
|
|
|
90
95
|
readonly canonical: string;
|
|
91
96
|
readonly direction?: "sourceUnsatisfied" | "targetRequired";
|
|
92
97
|
readonly orientation?: "written" | "mirrored";
|
|
93
|
-
readonly
|
|
98
|
+
readonly measure?: bigint;
|
|
94
99
|
readonly facts: readonly OffendingFact<Rels>[];
|
|
95
100
|
}
|
|
96
101
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
102
|
+
* The abandoned arm of a write result (ruled 2026-07-23, R10): present in
|
|
103
|
+
* the type EXACTLY when the callback can abandon — the conditional
|
|
104
|
+
* distributes over `R`, so a callback with no `Abandon` arm contributes
|
|
105
|
+
* `never` and the arm vanishes from the sum. The outcome is in the type;
|
|
106
|
+
* a dead arm is never handled.
|
|
100
107
|
*/
|
|
101
|
-
type
|
|
108
|
+
type AbandonedArm<R> = R extends Abandon<infer P> ? {
|
|
109
|
+
readonly ok: false;
|
|
110
|
+
readonly abandoned: P;
|
|
111
|
+
} : never;
|
|
112
|
+
/**
|
|
113
|
+
* A write's domain outcome, one sum for BOTH verbs (ruled 2026-07-23,
|
|
114
|
+
* R10): the committed generation; the COMPLETE violation set (every
|
|
115
|
+
* violated statement cited once, per direction for a containment, in
|
|
116
|
+
* materialized statement order); or the callback's own abandon payload —
|
|
117
|
+
* commit-vs-abandon is in the type, so a caller's explicit decline to
|
|
118
|
+
* commit can never be silently discarded. Narrows on `.ok`, then (when the
|
|
119
|
+
* callback can abandon) on `"violations" in result`.
|
|
120
|
+
*/
|
|
121
|
+
type WriteResult<Rels extends SchemaRelations, R = void> = {
|
|
102
122
|
readonly ok: true;
|
|
103
123
|
readonly generation: bigint;
|
|
104
124
|
} | {
|
|
105
125
|
readonly ok: false;
|
|
106
126
|
readonly violations: readonly Violation<Rels>[];
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
|
|
127
|
+
} | AbandonedArm<R>;
|
|
128
|
+
/**
|
|
129
|
+
* The delta-building callback of a write: runs synchronously against the
|
|
130
|
+
* live transaction. Returning {@link abandon}`(payload)` rolls the
|
|
131
|
+
* transaction back (R10) — the result type carries the payload arm exactly
|
|
132
|
+
* then.
|
|
133
|
+
*/
|
|
134
|
+
type DeltaBuild<Rels extends SchemaRelations, R = void> = (tx: Tx<Rels>) => R;
|
|
110
135
|
/**
|
|
111
136
|
* The runtime discriminant of {@link Abandon} values — a property probe is
|
|
112
137
|
* how `writeWitnessed` distinguishes "abort without committing" from an
|
|
@@ -114,44 +139,24 @@ type DeltaBuild<Rels extends SchemaRelations> = (tx: Tx<Rels>) => void;
|
|
|
114
139
|
*/
|
|
115
140
|
declare const abandonMark: unique symbol;
|
|
116
141
|
/**
|
|
117
|
-
* The abandon sentinel {@link abandon} builds: returning one from a
|
|
118
|
-
* `writeWitnessed` callback
|
|
119
|
-
* commit is ever issued) and surfaces the payload as
|
|
120
|
-
* `{ ok: false, abandoned: payload }
|
|
142
|
+
* The abandon sentinel {@link abandon} builds: returning one from a `write`
|
|
143
|
+
* or `writeWitnessed` callback rolls the transaction back WITHOUT
|
|
144
|
+
* committing (no empty commit is ever issued) and surfaces the payload as
|
|
145
|
+
* `{ ok: false, abandoned: payload }` (ruled 2026-07-23, R10 — the
|
|
146
|
+
* sentinel's contract is unconditional, whichever write verb received it).
|
|
121
147
|
*/
|
|
122
148
|
interface Abandon<P> {
|
|
123
149
|
readonly [abandonMark]: true;
|
|
124
150
|
readonly payload: P;
|
|
125
151
|
}
|
|
126
152
|
/**
|
|
127
|
-
* Wraps a payload in the {@link Abandon} sentinel — the one way a
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
153
|
+
* Wraps a payload in the {@link Abandon} sentinel — the one way a write
|
|
154
|
+
* callback declines to commit: `return abandon(payload)` aborts the delta
|
|
155
|
+
* (nothing is committed, not even an empty commit) and the write resolves
|
|
156
|
+
* to `{ ok: false, abandoned: payload }`, from `write` and `writeWitnessed`
|
|
157
|
+
* alike (R10).
|
|
131
158
|
*/
|
|
132
159
|
declare function abandon<P>(payload: P): Abandon<P>;
|
|
133
|
-
/**
|
|
134
|
-
* The abandon payload type a `writeWitnessed` callback's return type
|
|
135
|
-
* implies: the payload of its `Abandon` arm, `never` when the callback can
|
|
136
|
-
* never abandon (the `abandoned` outcome is then statically unreachable).
|
|
137
|
-
*/
|
|
138
|
-
type AbandonedPayload<R> = R extends Abandon<infer P> ? P : never;
|
|
139
|
-
/**
|
|
140
|
-
* `writeWitnessed`'s domain outcome: the committed generation, the COMPLETE
|
|
141
|
-
* engine violation set (rejection-as-data, exactly {@link WriteResult}'s
|
|
142
|
-
* false arm), or the callback's own abandon payload. Narrows on `.ok`, then
|
|
143
|
-
* on `"violations" in result`.
|
|
144
|
-
*/
|
|
145
|
-
type WitnessedWriteResult<Rels extends SchemaRelations, R> = {
|
|
146
|
-
readonly ok: true;
|
|
147
|
-
readonly generation: bigint;
|
|
148
|
-
} | {
|
|
149
|
-
readonly ok: false;
|
|
150
|
-
readonly violations: readonly Violation<Rels>[];
|
|
151
|
-
} | {
|
|
152
|
-
readonly ok: false;
|
|
153
|
-
readonly abandoned: AbandonedPayload<R>;
|
|
154
|
-
};
|
|
155
160
|
/**
|
|
156
161
|
* One live write transaction: the submitted delta with the engine's
|
|
157
162
|
* FINAL-STATE point-read view (base + pending delta — the exact state the
|
|
@@ -163,10 +168,19 @@ interface Tx<Rels extends SchemaRelations> {
|
|
|
163
168
|
/**
|
|
164
169
|
* Records one insert. Omitted fresh fields are MINTED through the
|
|
165
170
|
* engine's alloc lane and returned as bare bigints; supplying them instead
|
|
166
|
-
* preserves identity (the resupply idiom). Returns
|
|
167
|
-
*
|
|
171
|
+
* preserves identity (the resupply idiom). Returns `{ changed, ...fresh }`
|
|
172
|
+
* (ruled 2026-07-23, R11): the engine's changed-state report — the Rust
|
|
173
|
+
* surface's `insert(&fact) -> bool` bijection `delete` always honored —
|
|
174
|
+
* beside the relation's fresh cells, minted or resupplied. The
|
|
175
|
+
* idempotent-replay lane reads the bit from the insert itself; no extra
|
|
176
|
+
* `contains` round trip exists. The flattened shape cannot carry a FRESH
|
|
177
|
+
* cell literally named `changed` beside the report, so admission refuses
|
|
178
|
+
* that one spelling ({@link refuseShadowedChanged}) — never a silent
|
|
179
|
+
* shadow here.
|
|
168
180
|
*/
|
|
169
|
-
insert<R extends MemberRelation<Rels>>(relation: R, fact: InsertFact<R>):
|
|
181
|
+
insert<R extends MemberRelation<Rels>>(relation: R, fact: InsertFact<R>): {
|
|
182
|
+
readonly changed: boolean;
|
|
183
|
+
} & Minted<R>;
|
|
170
184
|
/** Records one delete; `true` iff the final state changed. */
|
|
171
185
|
delete<R extends MemberRelation<Rels>>(relation: R, fact: Fact<R>): boolean;
|
|
172
186
|
/** Final-state membership of one complete fact. */
|
|
@@ -184,19 +198,20 @@ interface Tx<Rels extends SchemaRelations> {
|
|
|
184
198
|
get<R extends MemberRelation<Rels>, const P extends readonly string[]>(relation: R, keyStatement: KeyStatement<R, P>, key: DeclaredKeyFact<R, P>): Fact<R> | undefined;
|
|
185
199
|
}
|
|
186
200
|
/**
|
|
187
|
-
* The read view one `db.read(fn)` call scopes
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
201
|
+
* The read view one `db.read(fn)` call scopes — or one `using snap =
|
|
202
|
+
* db.read()` acquisition owns (ruled 2026-07-23, R12: lifetimes are
|
|
203
|
+
* disposables, never `close()`). The callback form invalidates the value
|
|
204
|
+
* when `fn` returns; the `using` form releases it at scope exit through
|
|
205
|
+
* `Symbol.dispose` — either way the release is deterministic and
|
|
206
|
+
* scope-shaped, every later verb call throws a typed used-after-scope
|
|
207
|
+
* error, and the underlying snapshot (with its LMDB reader slot) is
|
|
208
|
+
* already closed.
|
|
193
209
|
*/
|
|
194
|
-
interface ReadScope<Rels extends SchemaRelations> {
|
|
210
|
+
interface ReadScope<Rels extends SchemaRelations> extends Disposable {
|
|
195
211
|
/**
|
|
196
|
-
* The committed generation this scope witnessed —
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* open and the generation read.
|
|
212
|
+
* The committed generation this scope witnessed — carried by the
|
|
213
|
+
* snapshot open itself (one crossing, inside the snapshot's own
|
|
214
|
+
* transaction), so it is atomic with the snapshot by construction.
|
|
200
215
|
*/
|
|
201
216
|
readonly generation: bigint;
|
|
202
217
|
/** Full-relation export in row-id order, decoded to bare structural facts. */
|
|
@@ -221,6 +236,16 @@ interface ReadScope<Rels extends SchemaRelations> {
|
|
|
221
236
|
* execution spelling ({@link Prepared} carries no `execute`).
|
|
222
237
|
*/
|
|
223
238
|
execute<Row, Params extends ParamsRecord>(prepared: Prepared<Rels, Row, Params>, params: Params): Row[];
|
|
239
|
+
/**
|
|
240
|
+
* Plan introspection as data (ruled 2026-07-23, R13): runs the prepared
|
|
241
|
+
* query against this scope's snapshot with counting instrumentation
|
|
242
|
+
* (the engine's ANALYZE semantics) and returns the structured
|
|
243
|
+
* {@link Explain} report — plan sections and counters as plain values,
|
|
244
|
+
* so the host reads what the engine did with its query without a
|
|
245
|
+
* second toolchain. A diagnostic surface, EXPLICITLY UNFROZEN: the
|
|
246
|
+
* shape follows the plan representation wherever it goes.
|
|
247
|
+
*/
|
|
248
|
+
explain<Row, Params extends ParamsRecord>(prepared: Prepared<Rels, Row, Params>, params: Params): Explain;
|
|
224
249
|
}
|
|
225
250
|
/**
|
|
226
251
|
* The module-private inference slot of {@link Prepared}: an optional symbol
|
|
@@ -270,6 +295,14 @@ interface Db<Rels extends SchemaRelations> {
|
|
|
270
295
|
* when `fn` returns — a used-after-scope call throws a typed error.
|
|
271
296
|
*/
|
|
272
297
|
read<T>(fn: (snap: ReadScope<Rels>) => T): T;
|
|
298
|
+
/**
|
|
299
|
+
* The `using` acquisition (ruled 2026-07-23, R12): `using snap =
|
|
300
|
+
* db.read()` — the caller owns the scope's lifetime, and the scope's
|
|
301
|
+
* `Symbol.dispose` releases the snapshot deterministically at scope
|
|
302
|
+
* exit, in the language's own syntax. Lifetimes are disposables, never
|
|
303
|
+
* `close()`.
|
|
304
|
+
*/
|
|
305
|
+
read(): ReadScope<Rels>;
|
|
273
306
|
/** `db.scan(r)` === `db.read(snap => snap.scan(r))` — the symmetry rule. */
|
|
274
307
|
scan<R extends MemberRelation<Rels>>(relation: R): Fact<R>[];
|
|
275
308
|
/** `db.get(r, k)` === `db.read(snap => snap.get(r, k))` — the symmetry rule. */
|
|
@@ -280,12 +313,18 @@ interface Db<Rels extends SchemaRelations> {
|
|
|
280
313
|
contains<R extends MemberRelation<Rels>>(relation: R, fact: Fact<R>): boolean;
|
|
281
314
|
/** `db.execute(p, params)` === `db.read(snap => snap.execute(p, params))` — the symmetry rule. */
|
|
282
315
|
execute<Row, Params extends ParamsRecord>(prepared: Prepared<Rels, Row, Params>, params: Params): Row[];
|
|
316
|
+
/** `db.explain(p, params)` === `db.read(snap => snap.explain(p, params))` — the symmetry rule (R13). */
|
|
317
|
+
explain<Row, Params extends ParamsRecord>(prepared: Prepared<Rels, Row, Params>, params: Params): Explain;
|
|
283
318
|
/**
|
|
284
319
|
* One delta transaction: builds the delta synchronously through `fn`,
|
|
285
320
|
* commits, and returns the domain outcome. A throw from `fn` aborts
|
|
286
|
-
* the delta (LMDB untouched) and rethrows wrapped.
|
|
321
|
+
* the delta (LMDB untouched) and rethrows wrapped. `fn` may decline to
|
|
322
|
+
* commit by returning {@link abandon}`(payload)` (ruled 2026-07-23,
|
|
323
|
+
* R10): the transaction rolls back — nothing is committed, not even an
|
|
324
|
+
* empty commit — and the outcome is `{ ok: false, abandoned: payload }`,
|
|
325
|
+
* an arm the result type carries exactly when the callback can abandon.
|
|
287
326
|
*/
|
|
288
|
-
write(fn: DeltaBuild<Rels>): WriteResult<Rels>;
|
|
327
|
+
write<R = void>(fn: DeltaBuild<Rels, R>): WriteResult<Rels, R>;
|
|
289
328
|
/**
|
|
290
329
|
* The ONE witnessed-write form: snapshot → `fn` (premise reads via
|
|
291
330
|
* `snap`, delta via `tx`) → witnessed commit, which lands only if no
|
|
@@ -304,7 +343,7 @@ interface Db<Rels extends SchemaRelations> {
|
|
|
304
343
|
* `{ ok: false, abandoned: payload }` and NO commit (not even an empty
|
|
305
344
|
* one) is issued.
|
|
306
345
|
*/
|
|
307
|
-
writeWitnessed<R>(fn: (snap: ReadScope<Rels>, tx: Tx<Rels>) => R):
|
|
346
|
+
writeWitnessed<R>(fn: (snap: ReadScope<Rels>, tx: Tx<Rels>) => R): WriteResult<Rels, R>;
|
|
308
347
|
/**
|
|
309
348
|
* Prepares a query value built against THIS schema (identity is the
|
|
310
349
|
* membership rule): lowers it to the engine IR, pins the plan, and
|
|
@@ -376,15 +415,15 @@ declare const Db: Readonly<{
|
|
|
376
415
|
* one schema-independent read path (no theory, no fingerprint check; the
|
|
377
416
|
* store rebirth tool's entry). Lives beside `open`/`create` so the path
|
|
378
417
|
* law stays in one place: the same `node:path.resolve` canonicalization,
|
|
379
|
-
* applied here. The value is NOT cached and
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
* the descriptor).
|
|
418
|
+
* applied here. The value is NOT cached and is a DISPOSABLE lifetime
|
|
419
|
+
* (R12) — `using exhumed = await Db.exhume(path)` releases the engine
|
|
420
|
+
* handle and the store's exclusive lock at scope exit, so a same-path
|
|
421
|
+
* reopen never waits on GC. A store not yet adopted rejects with the
|
|
422
|
+
* typed `ErrExhumeNoDescriptor` (the remedy: one fingerprint-matching
|
|
423
|
+
* `Db.open` under the creating schema back-fills the descriptor).
|
|
385
424
|
*/
|
|
386
425
|
exhume(storePath: string): Promise<Exhumed>;
|
|
387
426
|
}>;
|
|
388
|
-
export type { Abandon, DeclaredKeyFact, DeltaBuild, MemberRelation, OffendingFact, Prepared, ReadScope, Tx, Violation,
|
|
427
|
+
export type { Abandon, AbandonedArm, DeclaredKeyFact, DeltaBuild, MemberRelation, OffendingFact, Prepared, ReadScope, Tx, Violation, WriteResult };
|
|
389
428
|
export { abandon, Db, ErrNewtypeMismatch, ErrWitnessedLivelock, WITNESSED_ATTEMPT_CAP };
|
|
390
429
|
//# 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
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAIzC,OAAO,EAKN,KAAK,OAAO,EAEZ,KAAK,MAAM,EAGX,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EAEX,OAAO,EACP,SAAS,EAIT,SAAS,EACT,gBAAgB,EAIhB,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,UAAU,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,KAAK,EAAa,MAAM,EAAkB,eAAe,EAAE,MAAM,YAAY,CAAA;AACpF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