@bjornpagen/bumbledb 0.3.0 → 0.5.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 +246 -92
- package/README.md +31 -16
- package/dist/closed.d.ts +80 -75
- package/dist/closed.d.ts.map +1 -1
- package/dist/closed.js +102 -127
- package/dist/closed.js.map +1 -1
- package/dist/db.d.ts +37 -7
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +95 -55
- package/dist/db.js.map +1 -1
- package/dist/exhume.d.ts.map +1 -1
- package/dist/exhume.js +1 -14
- package/dist/exhume.js.map +1 -1
- package/dist/face.d.ts +40 -40
- package/dist/face.d.ts.map +1 -1
- package/dist/face.js +9 -17
- package/dist/face.js.map +1 -1
- package/dist/fields.d.ts +46 -15
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +58 -29
- package/dist/fields.js.map +1 -1
- package/dist/index.d.ts +13 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/law.d.ts +2 -1
- package/dist/law.d.ts.map +1 -1
- package/dist/law.js +15 -14
- package/dist/law.js.map +1 -1
- package/dist/lower.d.ts.map +1 -1
- package/dist/lower.js +1 -7
- package/dist/lower.js.map +1 -1
- package/dist/marshal.d.ts +33 -6
- package/dist/marshal.d.ts.map +1 -1
- package/dist/marshal.js +75 -26
- package/dist/marshal.js.map +1 -1
- package/dist/native.d.ts +21 -2
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js +20 -3
- package/dist/native.js.map +1 -1
- package/dist/order.d.ts +36 -0
- package/dist/order.d.ts.map +1 -0
- package/dist/order.js +135 -0
- package/dist/order.js.map +1 -0
- package/dist/query/atom.d.ts +76 -28
- package/dist/query/atom.d.ts.map +1 -1
- package/dist/query/atom.js +12 -16
- package/dist/query/atom.js.map +1 -1
- package/dist/query/lower.d.ts +5 -8
- package/dist/query/lower.d.ts.map +1 -1
- package/dist/query/lower.js +308 -72
- package/dist/query/lower.js.map +1 -1
- package/dist/query/predicate.d.ts.map +1 -1
- package/dist/query/predicate.js +34 -2
- package/dist/query/predicate.js.map +1 -1
- package/dist/query/run.d.ts +15 -5
- package/dist/query/run.d.ts.map +1 -1
- package/dist/query/run.js +27 -8
- package/dist/query/run.js.map +1 -1
- package/dist/query/scope.d.ts +37 -29
- package/dist/query/scope.d.ts.map +1 -1
- package/dist/query/scope.js +19 -47
- package/dist/query/scope.js.map +1 -1
- package/dist/relation.d.ts +17 -29
- package/dist/relation.d.ts.map +1 -1
- package/dist/relation.js +41 -38
- package/dist/relation.js.map +1 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +7 -31
- package/dist/schema.js.map +1 -1
- package/dist/spec.d.ts +3 -2
- package/dist/spec.d.ts.map +1 -1
- package/dist/spec.js.map +1 -1
- package/dist/statements.d.ts +13 -4
- package/dist/statements.d.ts.map +1 -1
- package/dist/statements.js +75 -8
- package/dist/statements.js.map +1 -1
- package/package.json +2 -5
- package/src/closed.ts +144 -206
- package/src/db.ts +143 -68
- package/src/exhume.ts +1 -15
- package/src/face.ts +38 -48
- package/src/fields.ts +103 -49
- package/src/index.ts +11 -10
- package/src/law.ts +15 -14
- package/src/lower.ts +2 -9
- package/src/marshal.ts +82 -31
- package/src/native.ts +22 -4
- package/src/order.ts +156 -0
- package/src/query/atom.ts +70 -35
- package/src/query/lower.ts +354 -82
- package/src/query/predicate.ts +39 -4
- package/src/query/run.ts +27 -9
- package/src/query/scope.ts +52 -70
- package/src/relation.ts +54 -68
- package/src/schema.ts +7 -33
- package/src/spec.ts +3 -2
- package/src/statements.ts +82 -8
package/dist/closed.js
CHANGED
|
@@ -1,55 +1,76 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Closed relations (`docs/architecture/10-data-model.md` § closed
|
|
3
3
|
* relations): a vocabulary whose extension is declared in the schema — two
|
|
4
|
-
* tiers, one function.
|
|
5
|
-
* macro's (host-enum analog): handle CONSTANTS on the value
|
|
6
|
-
* (`Kind.Checking`, ids = declaration order, each a BARE `bigint` — no
|
|
7
|
-
* brand), the `fromId` weld, an `id` field descriptor carrying the CLOSED
|
|
8
|
-
* LINKAGE (the roster — pure structure, no declared domain: the laws type
|
|
9
|
-
* the columns, and `schema()` names the id's generator class `"Kind.id"`)
|
|
10
|
-
* for other relations' field blocks (`kind: Kind.id`), payload readback
|
|
11
|
-
* (`Kind.axioms`), and the declared payload column descriptors
|
|
12
|
-
* (`Kind.columns` — the runtime twin of the `Cols` type parameter, which
|
|
13
|
-
* the face layer's structural wall reads). Bare tier: `closed("Kind", ["Checking",
|
|
4
|
+
* tiers, one function. Bare tier: `closed("Kind", ["Checking",
|
|
14
5
|
* "Savings"])`. Payload tier: `closed("Sev", { pages: bool }, { Critical:
|
|
15
6
|
* { pages: true }, ... })` — one call, three arguments (the curried tier-2
|
|
16
7
|
* spelling is DELETED — canonical utterance): the axioms record IS the
|
|
17
8
|
* handle declaration, every handle carrying every column exactly once
|
|
18
|
-
* (type-enforced).
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
9
|
+
* (type-enforced). At the host surface a handle is its NAME — a string
|
|
10
|
+
* literal of the roster's union (the drizzle law: translation, not
|
|
11
|
+
* abstraction; dispatch over a vocabulary is native `switch` narrowing, so
|
|
12
|
+
* no match operator is minted and no handle constants exist — the literal
|
|
13
|
+
* `"Checking"` is the ONE spelling). Handles are pure DATA, not properties
|
|
14
|
+
* of the value, so NO handle name is reserved: a vocabulary may legally
|
|
15
|
+
* contain handles named `match`, `where`, or `id` — the axioms record and
|
|
16
|
+
* the roster are their own namespaces. The value's whole surface: `name`;
|
|
17
|
+
* `id` — the field descriptor carrying the CLOSED LINKAGE (the roster —
|
|
18
|
+
* pure structure, no declared domain: the laws type the columns, and
|
|
19
|
+
* `schema()` names the id's generator class `"Kind.id"`) for other
|
|
20
|
+
* relations' field blocks (`kind: Kind.id`); `data` (the lowering
|
|
21
|
+
* carrier); `axioms` (payload readback, `Kind.axioms`); `columns` (the
|
|
22
|
+
* runtime twin of the `Cols` type parameter, which the face layer's
|
|
23
|
+
* structural wall reads); and — exactly when payload columns exist —
|
|
24
|
+
* `where()`, the ψ-selection surface (`Kind.where({ mastered: true })` as a
|
|
25
|
+
* face source), resolved through the ONE selection machine
|
|
26
|
+
* (`relation.ts::resolveSelection`); the bare tier has no payload columns
|
|
27
|
+
* to select on, so `.where` is absent there, at the type AND on the value.
|
|
28
|
+
* No fact type and no insert surface exist — closed relations are
|
|
29
|
+
* unwritable by construction: the value simply lacks the writable relation
|
|
30
|
+
* shape.
|
|
28
31
|
*/
|
|
29
32
|
import * as errors from "@superbuilders/errors";
|
|
30
33
|
import { assertDeclarationOrderKey, literalOf } from "#fields.ts";
|
|
31
34
|
import { resolveSelection } from "#relation.ts";
|
|
32
35
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* dispatch under exactly that name).
|
|
36
|
+
* THE relation-kind discriminant — the ONE spelling of "is this schema
|
|
37
|
+
* member closed?" (the type tier's twin is the `AnyClosed` conditional
|
|
38
|
+
* arms). A closed relation's runtime description carries its handle
|
|
39
|
+
* roster; an ordinary relation's never does. Every runtime closed/ordinary
|
|
40
|
+
* fork in the SDK judges through this predicate — never a re-spelled
|
|
41
|
+
* structural probe.
|
|
40
42
|
*/
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
function isClosedMember(member) {
|
|
44
|
+
return "handles" in member.data;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The SEALED field list of a schema member — THE one reader of "what
|
|
48
|
+
* fields does this owner expose": an ordinary relation's declared fields;
|
|
49
|
+
* a closed relation's sealed shape — the synthetic `id` (the value's own
|
|
50
|
+
* roster-carrying descriptor, by identity) at ordinal 0, then the declared
|
|
51
|
+
* payload columns at declared index + 1 (the sealed shift, mirroring the
|
|
52
|
+
* engine's `SchemaDescriptor::sealed_fields`). A `ClosedColumn` is
|
|
53
|
+
* structurally a `RelationField`, so both kinds read uniformly.
|
|
54
|
+
*/
|
|
55
|
+
function sealedFieldsOf(member) {
|
|
56
|
+
if (isClosedMember(member)) {
|
|
57
|
+
return Object.freeze([Object.freeze({ name: "id", field: member.id }), ...member.data.columns]);
|
|
58
|
+
}
|
|
59
|
+
return member.data.fields;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* One sealed field by name — derived from {@link sealedFieldsOf}, so the
|
|
63
|
+
* closed synthetic `id` resolves everywhere a name is looked up (no reader
|
|
64
|
+
* can silently lack the `id` arm). `undefined` when the name is foreign
|
|
65
|
+
* (the type tiers make that unwritable; the engine re-judges at
|
|
66
|
+
* `Db.create`).
|
|
67
|
+
*/
|
|
68
|
+
function sealedFieldOf(member, fieldName) {
|
|
69
|
+
const declared = sealedFieldsOf(member).find(function byName(candidate) {
|
|
70
|
+
return candidate.name === fieldName;
|
|
71
|
+
});
|
|
72
|
+
return declared?.field;
|
|
73
|
+
}
|
|
53
74
|
/** Narrows the two-tier second argument: a handle tuple (bare tier) or a column block (payload tier). */
|
|
54
75
|
function isHandleTuple(shape) {
|
|
55
76
|
return Array.isArray(shape);
|
|
@@ -69,7 +90,8 @@ function handleKeysOwn(axioms, names) {
|
|
|
69
90
|
* The trusted seam of the axiom-readback mint: every handle carries an own
|
|
70
91
|
* frozen row and every row carries every declared column as an own
|
|
71
92
|
* property — verified before the record is admitted as the typed
|
|
72
|
-
* {@link Axioms} (the
|
|
93
|
+
* {@link Axioms} (the trusted-admission-seam pattern — its home is
|
|
94
|
+
* `isTypedScope` in query/lower.ts).
|
|
73
95
|
*/
|
|
74
96
|
function axiomsMinted(record, handles, cols) {
|
|
75
97
|
return handles.every(function rowMinted(handle) {
|
|
@@ -80,39 +102,17 @@ function axiomsMinted(record, handles, cols) {
|
|
|
80
102
|
}));
|
|
81
103
|
});
|
|
82
104
|
}
|
|
83
|
-
/**
|
|
84
|
-
* The trusted seam of the handle-constant mint: every handle reads back as
|
|
85
|
-
* an own bigint — verified before the record is admitted at the constants
|
|
86
|
-
* type (a "__proto__"-named handle riding the object-protocol accessor
|
|
87
|
-
* would fail exactly this check).
|
|
88
|
-
*/
|
|
89
|
-
function constantsMinted(record, handles) {
|
|
90
|
-
return handles.every(function constantMinted(handle) {
|
|
91
|
-
return typeof record[handle] === "bigint";
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Reads one handle's ground axiom row for lowering. The typed payload
|
|
96
|
-
* surface makes absence unrepresentable ({@link Axioms} carries every
|
|
97
|
-
* handle's row); the refusal below guards the one ill-typed path — payload
|
|
98
|
-
* columns with the bare tier's absent axioms — which no public spelling
|
|
99
|
-
* reaches.
|
|
100
|
-
*/
|
|
101
|
-
function groundRow(name, axioms, handle) {
|
|
102
|
-
if (axioms === undefined) {
|
|
103
|
-
throw errors.new(`closed relation ${name}: payload columns declared without ground axioms`);
|
|
104
|
-
}
|
|
105
|
-
return axioms[handle];
|
|
106
|
-
}
|
|
107
105
|
/**
|
|
108
106
|
* Mints the axiom-readback record: one own frozen row per handle (the bare
|
|
109
107
|
* tier's rows are empty — it declares no columns), each row a fresh copy of
|
|
110
|
-
* its ground axiom.
|
|
108
|
+
* its ground axiom. Both tiers supply a REAL axioms record ({@link
|
|
109
|
+
* closedBare} mints its empty rows), so the columns-without-axioms state is
|
|
110
|
+
* unrepresentable here — no undefined arm exists to guard.
|
|
111
111
|
*/
|
|
112
112
|
function mintAxioms(name, handles, cols, axioms) {
|
|
113
113
|
const out = {};
|
|
114
114
|
for (const handle of handles) {
|
|
115
|
-
const row =
|
|
115
|
+
const row = Object.freeze({ ...axioms[handle] });
|
|
116
116
|
Object.defineProperty(out, handle, { value: row, enumerable: true });
|
|
117
117
|
}
|
|
118
118
|
Object.freeze(out);
|
|
@@ -121,18 +121,6 @@ function mintAxioms(name, handles, cols, axioms) {
|
|
|
121
121
|
}
|
|
122
122
|
return out;
|
|
123
123
|
}
|
|
124
|
-
/** Mints the handle constants: one own bigint per handle, ids = declaration order. */
|
|
125
|
-
function mintHandleConstants(name, handles) {
|
|
126
|
-
const out = {};
|
|
127
|
-
handles.forEach(function mintHandleConstant(handle, index) {
|
|
128
|
-
Object.defineProperty(out, handle, { value: BigInt(index), enumerable: true });
|
|
129
|
-
});
|
|
130
|
-
Object.freeze(out);
|
|
131
|
-
if (!constantsMinted(out, handles)) {
|
|
132
|
-
throw errors.new(`closed relation ${name}: handle-constant minting incomplete`);
|
|
133
|
-
}
|
|
134
|
-
return out;
|
|
135
|
-
}
|
|
136
124
|
function closed(name, shape, axioms) {
|
|
137
125
|
if (isHandleTuple(shape)) {
|
|
138
126
|
if (axioms !== undefined) {
|
|
@@ -145,9 +133,26 @@ function closed(name, shape, axioms) {
|
|
|
145
133
|
}
|
|
146
134
|
return closedPayload(name, shape, axioms);
|
|
147
135
|
}
|
|
148
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* The bare tier's precisely-typed builder: no columns, and the axioms
|
|
138
|
+
* record is the EMPTY-ROW record over the handle roster (one own frozen
|
|
139
|
+
* `{}` per handle, `__proto__`-safe own-property definition) — the same
|
|
140
|
+
* representation the payload tier carries, so `mintClosed` never sees a
|
|
141
|
+
* tier fork and the columns-without-axioms state stops being spellable.
|
|
142
|
+
*/
|
|
149
143
|
function closedBare(name, handles) {
|
|
150
|
-
|
|
144
|
+
const empty = {};
|
|
145
|
+
for (const handle of handles) {
|
|
146
|
+
/** A duplicated name mints one row; the roster's own duplicate refusal in {@link mintClosed} stays the judge. */
|
|
147
|
+
if (!Object.hasOwn(empty, handle)) {
|
|
148
|
+
Object.defineProperty(empty, handle, { value: Object.freeze({}), enumerable: true });
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
Object.freeze(empty);
|
|
152
|
+
if (!axiomsMinted(empty, handles, [])) {
|
|
153
|
+
throw errors.new(`closed relation ${name}: bare-tier axiom-row minting incomplete`);
|
|
154
|
+
}
|
|
155
|
+
return mintClosed(name, handles, {}, empty);
|
|
151
156
|
}
|
|
152
157
|
/**
|
|
153
158
|
* The payload tier's precisely-typed builder: column names are judged
|
|
@@ -168,24 +173,22 @@ function closedPayload(name, columns, axioms) {
|
|
|
168
173
|
return mintClosed(name, handles, columns, axioms);
|
|
169
174
|
}
|
|
170
175
|
/**
|
|
171
|
-
* The trusted seam of the ergonomic-surface mint: `
|
|
172
|
-
* own function
|
|
173
|
-
*
|
|
174
|
-
* (`
|
|
175
|
-
*
|
|
176
|
+
* The trusted seam of the ergonomic-surface mint: `where` reads back as an
|
|
177
|
+
* own function exactly when payload columns exist, and is ABSENT otherwise
|
|
178
|
+
* — the runtime twin of the {@link Closed} type's conditional arm
|
|
179
|
+
* (`ClosedCore` alone vs `ClosedCore & ClosedSelectable`), verified before
|
|
180
|
+
* the minted value is admitted at the conditional type.
|
|
176
181
|
*/
|
|
177
182
|
function surfaceMinted(value, cols) {
|
|
178
|
-
const matchable = "match" in value && typeof value.match === "function";
|
|
179
183
|
const selectable = "where" in value && typeof value.where === "function";
|
|
180
|
-
return
|
|
184
|
+
return cols.length > 0 ? selectable : !selectable;
|
|
181
185
|
}
|
|
182
186
|
/**
|
|
183
187
|
* Mints one closed relation value — the shared seam of both tiers, HONESTLY
|
|
184
188
|
* typed end to end (a wrong-shaped mint is a compile error here, not a
|
|
185
189
|
* laundered `unknown`): roster checks, eager axiom lowering, the
|
|
186
190
|
* roster-carrying `id` descriptor, the frozen `columns` carrier (the runtime
|
|
187
|
-
* twin of the `Cols` type parameter), the
|
|
188
|
-
* `match()` on both tiers, and — on the payload tier only — the
|
|
191
|
+
* twin of the `Cols` type parameter), and — on the payload tier only — the
|
|
189
192
|
* ψ-selection `where()`.
|
|
190
193
|
*/
|
|
191
194
|
function mintClosed(name, handles, columns, axioms) {
|
|
@@ -198,9 +201,6 @@ function mintClosed(name, handles, columns, axioms) {
|
|
|
198
201
|
throw errors.new(`closed relation ${name}: duplicate handle ${handle}`);
|
|
199
202
|
}
|
|
200
203
|
seen.add(handle);
|
|
201
|
-
if (reservedHandleNames.includes(handle)) {
|
|
202
|
-
throw errors.new(`closed relation ${name}: handle ${handle} collides with the closed value's own surface (${reservedHandleNames.join(", ")})`);
|
|
203
|
-
}
|
|
204
204
|
}
|
|
205
205
|
const handleList = Object.freeze([...handles]);
|
|
206
206
|
const roster = Object.freeze({ name, handles: handleList });
|
|
@@ -214,8 +214,8 @@ function mintClosed(name, handles, columns, axioms) {
|
|
|
214
214
|
}
|
|
215
215
|
Object.freeze(cols);
|
|
216
216
|
const rows = handleList.map(function lowerRow(handle) {
|
|
217
|
+
const row = axioms[handle];
|
|
217
218
|
const values = cols.map(function lowerAxiomLiteral(column) {
|
|
218
|
-
const row = groundRow(name, axioms, handle);
|
|
219
219
|
return Object.freeze(literalOf(column.field, row[column.name]));
|
|
220
220
|
});
|
|
221
221
|
return Object.freeze({ handle, values: Object.freeze(values) });
|
|
@@ -228,23 +228,16 @@ function mintClosed(name, handles, columns, axioms) {
|
|
|
228
228
|
});
|
|
229
229
|
const id = Object.freeze({ kind: "u64", closed: roster });
|
|
230
230
|
/**
|
|
231
|
-
* Handle names are arbitrary identifiers, so rows
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
* value whose type claims a bigint constant but reads back an object.
|
|
238
|
-
* (Object SPREAD is CreateDataProperty by spec, so the copies below are
|
|
239
|
-
* own-property safe for column names too.)
|
|
231
|
+
* Handle names are arbitrary identifiers, so axiom rows are minted with
|
|
232
|
+
* OWN-property definition (inside {@link mintAxioms}), never assignment:
|
|
233
|
+
* a handle named "__proto__" would otherwise ride the Object.prototype
|
|
234
|
+
* accessor — silently swapping the record's prototype instead of
|
|
235
|
+
* creating the row. (Object SPREAD is CreateDataProperty by spec, so the
|
|
236
|
+
* copies below are own-property safe for column names too.)
|
|
240
237
|
*/
|
|
241
238
|
const axiomsOut = mintAxioms(name, handleList, cols, axioms);
|
|
242
|
-
const constants = mintHandleConstants(name, handleList);
|
|
243
239
|
const columnsOut = { ...columns };
|
|
244
240
|
Object.freeze(columnsOut);
|
|
245
|
-
function fromId(idValue) {
|
|
246
|
-
return handleList[Number(idValue)];
|
|
247
|
-
}
|
|
248
241
|
const holder = { value: undefined };
|
|
249
242
|
/**
|
|
250
243
|
* The ψ selection: resolved against the declared payload columns through
|
|
@@ -262,31 +255,13 @@ function mintClosed(name, handles, columns, axioms) {
|
|
|
262
255
|
selection: resolveSelection(name, cols, Object.entries(selection))
|
|
263
256
|
});
|
|
264
257
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
* admits any bigint — a dishonest id is a THROW, never a misdispatch),
|
|
268
|
-
* and the chosen arm receives the handle's frozen axiom row (the bare
|
|
269
|
-
* tier's arms are typed to take nothing; the empty row rides along
|
|
270
|
-
* unread). One implementation serves both tiers — the conditional
|
|
271
|
-
* {@link Closed} arm claims the tier-exact arm signature and
|
|
272
|
-
* {@link surfaceMinted} is the trusted seam that admits it.
|
|
273
|
-
*/
|
|
274
|
-
function match(idValue, arms) {
|
|
275
|
-
const handle = fromId(idValue);
|
|
276
|
-
if (handle === undefined) {
|
|
277
|
-
throw errors.new(`closed relation ${name}: match on id ${idValue} misses the roster (${handleList.join(", ")})`);
|
|
278
|
-
}
|
|
279
|
-
return arms[handle](axiomsOut[handle]);
|
|
280
|
-
}
|
|
281
|
-
const core = { name, id, data, axioms: axiomsOut, columns: columnsOut, fromId };
|
|
282
|
-
const value = cols.length > 0
|
|
283
|
-
? Object.freeze({ ...constants, ...core, where, match })
|
|
284
|
-
: Object.freeze({ ...constants, ...core, match });
|
|
258
|
+
const core = { name, id, data, axioms: axiomsOut, columns: columnsOut };
|
|
259
|
+
const value = cols.length > 0 ? Object.freeze({ ...core, where }) : Object.freeze(core);
|
|
285
260
|
if (!surfaceMinted(value, cols)) {
|
|
286
261
|
throw errors.new(`closed relation ${name}: ergonomic-surface minting incomplete`);
|
|
287
262
|
}
|
|
288
263
|
holder.value = value;
|
|
289
264
|
return value;
|
|
290
265
|
}
|
|
291
|
-
export { closed };
|
|
266
|
+
export { closed, isClosedMember, sealedFieldOf, sealedFieldsOf };
|
|
292
267
|
//# sourceMappingURL=closed.js.map
|
package/dist/closed.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closed.js","sourceRoot":"","sources":["../src/closed.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"closed.js","sourceRoot":"","sources":["../src/closed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAEN,yBAAyB,EAIzB,SAAS,EACT,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,gBAAgB,EAA8C,MAAM,cAAc,CAAA;AA0J3F;;;;;;;GAOG;AACH,SAAS,cAAc,CAAC,MAA+B;IACtD,OAAO,SAAS,IAAI,MAAM,CAAC,IAAI,CAAA;AAChC,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,cAAc,CAAC,MAA+B;IACtD,IAAI,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;IAChG,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAA;AA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,KAAK,CAAC,SAAqC;QACnD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;QAC1B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,MAAM,CAAC,GAAG,CAAC,mBAAmB,IAAI,qDAAqD,CAAC,CAAA;QAC/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
|
@@ -55,7 +55,10 @@ type DeclaredKeyFact<R extends AnyRelation, Projection extends readonly string[]
|
|
|
55
55
|
/**
|
|
56
56
|
* One offending fact of a violation: the cited relation's name (a member
|
|
57
57
|
* of the schema's record) and the fact decoded to a named natural-value
|
|
58
|
-
* object — partial exactly as the engine cites it.
|
|
58
|
+
* object — partial exactly as the engine cites it. Closed-referencing
|
|
59
|
+
* cells arrive as handle NAMES (the marshal bijection's read half), so the
|
|
60
|
+
* record and the violation's `canonical` string — which the engine already
|
|
61
|
+
* renders with handle names — agree on the one spelling.
|
|
59
62
|
*/
|
|
60
63
|
interface OffendingFact<Rels extends SchemaRelations> {
|
|
61
64
|
readonly relation: keyof Rels & string;
|
|
@@ -287,11 +290,16 @@ interface Db<Rels extends SchemaRelations> {
|
|
|
287
290
|
* The ONE witnessed-write form: snapshot → `fn` (premise reads via
|
|
288
291
|
* `snap`, delta via `tx`) → witnessed commit, which lands only if no
|
|
289
292
|
* state-changing commit intervened since the snapshot. On a moved
|
|
290
|
-
* generation the WHOLE `fn` reruns on a fresh snapshot
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
*
|
|
293
|
+
* generation the WHOLE `fn` reruns on a fresh snapshot: this process
|
|
294
|
+
* holds the store's only write handle, so every generation move is
|
|
295
|
+
* self-inflicted by the host's own interleaved writes, and each rerun
|
|
296
|
+
* witnesses a strictly newer generation — the benign race converges.
|
|
297
|
+
* The loop's honesty bound is {@link WITNESSED_ATTEMPT_CAP}: a callback
|
|
298
|
+
* that moves the generation on EVERY attempt (a plain `db.write` before
|
|
299
|
+
* its first tx verb) would spin forever, so past the cap the typed
|
|
300
|
+
* {@link ErrWitnessedLivelock} is thrown instead of a silent loop (the
|
|
301
|
+
* engine's ruling: the error, never a loop — retry is host policy, and
|
|
302
|
+
* the cap is that policy's own diagnostic). `fn` may decline to commit
|
|
295
303
|
* by returning {@link abandon}`(payload)` — the outcome is then
|
|
296
304
|
* `{ ok: false, abandoned: payload }` and NO commit (not even an empty
|
|
297
305
|
* one) is issued.
|
|
@@ -306,6 +314,28 @@ interface Db<Rels extends SchemaRelations> {
|
|
|
306
314
|
*/
|
|
307
315
|
prepare<Row, Params extends ParamsRecord>(q: Query<Rels, Row, Params>): Prepared<Rels, Row, Params>;
|
|
308
316
|
}
|
|
317
|
+
/**
|
|
318
|
+
* The witnessed loop's attempt cap — a generous power of two. Benign
|
|
319
|
+
* self-inflicted contention (the host's own commits landing between an
|
|
320
|
+
* attempt's snapshot and its witnessed begin) converges in a handful of
|
|
321
|
+
* retries because each rerun reads a FRESHER snapshot; a workload that moves
|
|
322
|
+
* the generation on EVERY one of this many consecutive attempts is not
|
|
323
|
+
* converging and never will (see {@link ErrWitnessedLivelock}).
|
|
324
|
+
*/
|
|
325
|
+
declare const WITNESSED_ATTEMPT_CAP = 64;
|
|
326
|
+
/**
|
|
327
|
+
* The typed livelock refusal `writeWitnessed` throws past
|
|
328
|
+
* {@link WITNESSED_ATTEMPT_CAP} attempts: every attempt found the generation
|
|
329
|
+
* moved, which is only sustainable when the callback ITSELF (even
|
|
330
|
+
* indirectly) issues an interleaved plain `db.write` before its first tx
|
|
331
|
+
* verb on every attempt — each rerun then re-moves the generation it is
|
|
332
|
+
* about to witness, forever. That is host-policy pathology, not engine
|
|
333
|
+
* judgment (the engine ships the error, never a loop), so it THROWS rather
|
|
334
|
+
* than returning a result arm. Match with `errors.is`; the remedy is to
|
|
335
|
+
* move the interleaved write out of the callback (or make it first-attempt
|
|
336
|
+
* only — the delta belongs on `tx`, premise reads on `snap`).
|
|
337
|
+
*/
|
|
338
|
+
declare const ErrWitnessedLivelock: Error;
|
|
309
339
|
/**
|
|
310
340
|
* The engine twin of the schema-level class wall, as a matchable value
|
|
311
341
|
* (`errors.is`): the shared lowering rejected a spec whose statement pairs
|
|
@@ -356,5 +386,5 @@ declare const Db: Readonly<{
|
|
|
356
386
|
exhume(storePath: string): Promise<Exhumed>;
|
|
357
387
|
}>;
|
|
358
388
|
export type { Abandon, DeclaredKeyFact, DeltaBuild, MemberRelation, OffendingFact, Prepared, ReadScope, Tx, Violation, WitnessedWriteResult, WriteResult };
|
|
359
|
-
export { abandon, Db, ErrNewtypeMismatch };
|
|
389
|
+
export { abandon, Db, ErrNewtypeMismatch, ErrWitnessedLivelock, WITNESSED_ATTEMPT_CAP };
|
|
360
390
|
//# 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;
|
|
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,KAAK,MAAM,EAGX,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EAEX,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,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE7D;;;;GAIG;AACH,KAAK,cAAc,CAAC,IAAI,SAAS,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,WAAW,CAAC,CAAA;AAE1F;;;;;GAKG;AACH,KAAK,eAAe,CAAC,CAAC,SAAS,WAAW,EAAE,UAAU,SAAS,SAAS,MAAM,EAAE,IAAI;IACnF,QAAQ,EAAE,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAA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