@bjornpagen/bumbledb 0.15.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.
- package/COOKBOOK.md +33 -49
- package/README.md +3 -3
- package/dist/capacity.d.ts +24 -136
- package/dist/capacity.d.ts.map +1 -1
- package/dist/capacity.js +18 -40
- package/dist/capacity.js.map +1 -1
- package/dist/closed.d.ts +0 -156
- package/dist/closed.d.ts.map +1 -1
- package/dist/closed.js +0 -104
- package/dist/closed.js.map +1 -1
- package/dist/db.d.ts +7 -223
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +147 -396
- package/dist/db.js.map +1 -1
- package/dist/face.d.ts +0 -133
- package/dist/face.d.ts.map +1 -1
- package/dist/face.js +0 -33
- package/dist/face.js.map +1 -1
- package/dist/fields.d.ts +1 -145
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +2 -91
- package/dist/fields.js.map +1 -1
- package/dist/index.d.ts +11 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -13
- package/dist/index.js.map +1 -1
- package/dist/law.d.ts +111 -93
- package/dist/law.d.ts.map +1 -1
- package/dist/law.js +23 -27
- package/dist/law.js.map +1 -1
- package/dist/lower.d.ts +9 -35
- package/dist/lower.d.ts.map +1 -1
- package/dist/lower.js +8 -53
- package/dist/lower.js.map +1 -1
- package/dist/marshal.d.ts +0 -65
- package/dist/marshal.d.ts.map +1 -1
- package/dist/marshal.js +0 -72
- package/dist/marshal.js.map +1 -1
- package/dist/native.d.ts +25 -290
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js +6 -66
- package/dist/native.js.map +1 -1
- package/dist/query/atom.d.ts +10 -276
- package/dist/query/atom.d.ts.map +1 -1
- package/dist/query/atom.js +1 -96
- package/dist/query/atom.js.map +1 -1
- package/dist/query/find.d.ts +10 -76
- package/dist/query/find.d.ts.map +1 -1
- package/dist/query/find.js +0 -30
- package/dist/query/find.js.map +1 -1
- package/dist/query/lower.d.ts +64 -146
- package/dist/query/lower.d.ts.map +1 -1
- package/dist/query/lower.js +19 -256
- package/dist/query/lower.js.map +1 -1
- package/dist/query/parse-ir.d.ts +0 -7
- package/dist/query/parse-ir.d.ts.map +1 -1
- package/dist/query/parse-ir.js +1 -13
- package/dist/query/parse-ir.js.map +1 -1
- package/dist/query/run.d.ts +0 -36
- package/dist/query/run.d.ts.map +1 -1
- package/dist/query/run.js +0 -44
- package/dist/query/run.js.map +1 -1
- package/dist/query/scope.d.ts +24 -180
- package/dist/query/scope.d.ts.map +1 -1
- package/dist/query/scope.js +2 -66
- package/dist/query/scope.js.map +1 -1
- package/dist/relation.d.ts +2 -50
- package/dist/relation.d.ts.map +1 -1
- package/dist/relation.js +2 -37
- package/dist/relation.js.map +1 -1
- package/dist/schema.d.ts +13 -63
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +118 -92
- package/dist/schema.js.map +1 -1
- package/dist/spec.d.ts +1 -140
- package/dist/spec.d.ts.map +1 -1
- package/dist/spec.js +1 -68
- package/dist/spec.js.map +1 -1
- package/dist/statements.d.ts +6 -137
- package/dist/statements.d.ts.map +1 -1
- package/dist/statements.js +16 -119
- package/dist/statements.js.map +1 -1
- package/package.json +2 -2
- package/src/capacity.ts +26 -140
- package/src/closed.ts +5 -206
- package/src/db.ts +203 -692
- package/src/face.ts +0 -142
- package/src/fields.ts +4 -172
- package/src/index.ts +9 -15
- package/src/law.ts +201 -129
- package/src/lower.ts +8 -53
- package/src/marshal.ts +1 -85
- package/src/native.ts +47 -323
- package/src/query/atom.ts +26 -313
- package/src/query/find.ts +24 -110
- package/src/query/lower.ts +132 -377
- package/src/query/parse-ir.ts +1 -14
- package/src/query/run.ts +0 -45
- package/src/query/scope.ts +25 -186
- package/src/relation.ts +2 -66
- package/src/schema.ts +143 -122
- package/src/spec.ts +1 -160
- package/src/statements.ts +22 -174
package/dist/capacity.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Capacity-law mints — the window, weight, and dependent-bound vocabulary
|
|
3
|
-
* the one `capacity
|
|
4
|
-
*
|
|
5
|
-
* around the aggregate form). `within
|
|
3
|
+
* the one `capacity` statement constructor consumes
|
|
4
|
+
* § the canonical-utterance law, restated
|
|
5
|
+
* around the aggregate form). `within` is the ONE window spelling —
|
|
6
6
|
* `within(n)` exact (`within(0n)` IS the exclusion's one spelling),
|
|
7
7
|
* `within(lo, hi)` range (`within(0n, hi)` the canonical ceiling),
|
|
8
|
-
* `within(lo, "*")` floor — `weigh
|
|
8
|
+
* `within(lo, "*")` floor — `weigh` names the measure on the SOURCE row
|
|
9
9
|
* (`weigh("watts")` a u64 field, `weigh(duration("booked"))` an interval's
|
|
10
|
-
* measure), and `ref
|
|
10
|
+
* measure), and `ref`/`duration` read a dependent bound from the
|
|
11
11
|
* TARGET row (hi slot only — ruled 2026-07-24, C6). The ban table is
|
|
12
12
|
* enforced REPRESENTATIONALLY in two tiers, split per-aggregate where
|
|
13
13
|
* weight-sensitive (design § 6: a ban is canonical-utterance policing when
|
|
14
14
|
* it is weight-independent, semantic deduplication when it is not):
|
|
15
15
|
*
|
|
16
16
|
* - **The type tier**: a banned spelling written as a LITERAL does not
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
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
24
|
* - **The construction tier**: a bound the type level cannot judge — a
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
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
29
|
*
|
|
30
30
|
* The weight vocabulary is closed at the row (ruled 2026-07-24, ruling 6):
|
|
31
31
|
* a path weight (`weigh("model.watts")`) is a typed refusal at BOTH tiers
|
|
@@ -35,39 +35,24 @@
|
|
|
35
35
|
* back as `bigint` too (u128-wide engine accumulator, C3).
|
|
36
36
|
*/
|
|
37
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
38
|
const admitted = Symbol("bumbledb.capacity.admitted");
|
|
48
|
-
/** Narrows any value to an admitted capacity window through the module-private brand. */
|
|
49
39
|
function isCapacityWindow(value) {
|
|
50
40
|
return typeof value === "object" && value !== null && admitted in value && "window" in value;
|
|
51
41
|
}
|
|
52
|
-
/** Narrows any value to an admitted capacity weight through the module-private brand. */
|
|
53
42
|
function isCapacityWeight(value) {
|
|
54
43
|
return typeof value === "object" && value !== null && admitted in value && "weight" in value;
|
|
55
44
|
}
|
|
56
|
-
/** The unit weight — a case, not an absence (C4): the count instance's one wire spelling. */
|
|
57
45
|
const unitWeight = Object.freeze({ kind: "unit" });
|
|
58
|
-
/** The construction-tier twin of {@link PathBan}: a dotted name refuses naming the idiom. */
|
|
59
46
|
function assertRowLocal(field, role) {
|
|
60
47
|
if (field.includes(".")) {
|
|
61
48
|
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
49
|
}
|
|
63
50
|
return field;
|
|
64
51
|
}
|
|
65
|
-
/** Stamps one admitted window spec as a frozen branded value. */
|
|
66
52
|
function admitWindow(window) {
|
|
67
53
|
const value = { window, [admitted]: true };
|
|
68
54
|
return Object.freeze(value);
|
|
69
55
|
}
|
|
70
|
-
/** One literal bound. */
|
|
71
56
|
function lit(value) {
|
|
72
57
|
return Object.freeze({ kind: "lit", value });
|
|
73
58
|
}
|
|
@@ -105,7 +90,6 @@ function within(lo, hi) {
|
|
|
105
90
|
}
|
|
106
91
|
return admitWindow({ kind: "range", lo: lit(lo), hi: Object.freeze({ kind: "field", field }) });
|
|
107
92
|
}
|
|
108
|
-
/** Stamps one admitted weight spec as a frozen branded value. */
|
|
109
93
|
function admitWeight(weight) {
|
|
110
94
|
const value = { weight, [admitted]: true };
|
|
111
95
|
return Object.freeze(value);
|
|
@@ -116,19 +100,13 @@ function weigh(measure) {
|
|
|
116
100
|
}
|
|
117
101
|
return admitWeight({ kind: "durationField", field: assertRowLocal(measure.field, "weight") });
|
|
118
102
|
}
|
|
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
103
|
function ref(field) {
|
|
126
104
|
return Object.freeze({ kind: "field", field: assertRowLocal(field, "dependent bound") });
|
|
127
105
|
}
|
|
128
106
|
/**
|
|
129
107
|
* `Duration(field)` — the interval-measure spelling, one mint for both
|
|
130
|
-
* slots: handed to `weigh
|
|
131
|
-
* in `within
|
|
108
|
+
* slots: handed to `weigh` it is the SOURCE row's interval measure;
|
|
109
|
+
* in `within`'s hi slot it is the TARGET row's interval-measure bound
|
|
132
110
|
* (Duration weights pair with Duration-capable bounds — C18).
|
|
133
111
|
*/
|
|
134
112
|
function duration(field) {
|
package/dist/capacity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capacity.js","sourceRoot":"","sources":["../src/capacity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAI/C
|
|
1
|
+
{"version":3,"file":"capacity.js","sourceRoot":"","sources":["../src/capacity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAI/C,MAAM,QAAQ,GAAkB,MAAM,CAAC,4BAA4B,CAAC,CAAA;AAsBpE,SAAS,gBAAgB,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,QAAQ,IAAI,KAAK,IAAI,QAAQ,IAAI,KAAK,CAAA;AAC7F,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,QAAQ,IAAI,KAAK,IAAI,QAAQ,IAAI,KAAK,CAAA;AAC7F,CAAC;AA6JD,MAAM,UAAU,GAAe,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;AAE9D,SAAS,cAAc,CAAC,KAAa,EAAE,IAAY;IAClD,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,MAAM,CAAC,GAAG,CACf,GAAG,IAAI,MAAM,KAAK,iLAAiL,CACnM,CAAA;IACF,CAAC;IACD,OAAO,KAAK,CAAA;AACb,CAAC;AAED,SAAS,WAAW,CAA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SAAS,KAAK,CAAC,OAA6B;IAC3C,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAA;IAChF,CAAC;IACD,OAAO,WAAW,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAA;AAC9F,CAAC;AAED,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;AAYD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA"}
|
package/dist/closed.d.ts
CHANGED
|
@@ -1,174 +1,55 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Closed relations (`docs/architecture/10-data-model.md` § closed
|
|
3
|
-
* relations): a vocabulary whose extension is declared in the schema — two
|
|
4
|
-
* tiers, one function. Bare tier: `closed("Kind", ["Checking",
|
|
5
|
-
* "Savings"])`. Payload tier: `closed("Sev", { pages: bool }, { Critical:
|
|
6
|
-
* { pages: true }, ... })` — one call, three arguments (the curried tier-2
|
|
7
|
-
* spelling is DELETED — canonical utterance): the axioms record IS the
|
|
8
|
-
* handle declaration, every handle carrying every column exactly once
|
|
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.
|
|
31
|
-
*/
|
|
32
1
|
import { type AnyField, type ClosedIdField, type Infer } from "./fields.js";
|
|
33
2
|
import type { AnyRelation, RelationField } from "./relation.js";
|
|
34
3
|
import { type SelectionBinding, type SelectionInput } from "./relation.js";
|
|
35
4
|
import type { LiteralSpec } from "./spec.js";
|
|
36
|
-
/**
|
|
37
|
-
* A payload column of a closed relation: any field descriptor except a
|
|
38
|
-
* fresh-marked one (a vocabulary's rows are ground axioms, never minted).
|
|
39
|
-
*/
|
|
40
5
|
type PayloadField = Exclude<AnyField, {
|
|
41
6
|
readonly fresh: true;
|
|
42
7
|
}>;
|
|
43
|
-
/**
|
|
44
|
-
* A declared payload column BLOCK: name → descriptor, with `id`
|
|
45
|
-
* unspellable — the sealed shape mints the synthetic `id` itself (ordinal
|
|
46
|
-
* 0 of the matchable fields), so a declared column named `id` would be
|
|
47
|
-
* shadowed by the synthetic slot everywhere the shape resolves by name
|
|
48
|
-
* (`sealedFieldsOf`, the projected face, `spec.rs`'s resolver). The wall is
|
|
49
|
-
* typed here and judged again at construction in {@link mintClosed} — the
|
|
50
|
-
* runtime twin for untyped callers, warmer and earlier than the engine's
|
|
51
|
-
* `DuplicateFieldName` at `Db.create`.
|
|
52
|
-
*/
|
|
53
8
|
type PayloadColumns = Record<string, PayloadField> & {
|
|
54
9
|
readonly id?: never;
|
|
55
10
|
};
|
|
56
|
-
/** One declared payload column: name plus its field descriptor. */
|
|
57
11
|
interface ClosedColumn {
|
|
58
12
|
readonly name: string;
|
|
59
13
|
readonly field: PayloadField;
|
|
60
14
|
}
|
|
61
|
-
/**
|
|
62
|
-
* One ground axiom, already lowered: the handle plus one wire literal per
|
|
63
|
-
* declared column in column-declaration order (row id = index). Lowered
|
|
64
|
-
* EAGERLY at construction so axiom literals ride the same selection-literal
|
|
65
|
-
* machine as `where()` bindings, with the same errors (the macro's rule).
|
|
66
|
-
*/
|
|
67
15
|
interface ClosedRow {
|
|
68
16
|
readonly handle: string;
|
|
69
17
|
readonly values: readonly LiteralSpec[];
|
|
70
18
|
}
|
|
71
|
-
/** A closed relation's runtime description. */
|
|
72
19
|
interface ClosedData {
|
|
73
20
|
readonly name: string;
|
|
74
21
|
readonly handles: readonly string[];
|
|
75
22
|
readonly columns: readonly ClosedColumn[];
|
|
76
23
|
readonly rows: readonly ClosedRow[];
|
|
77
24
|
}
|
|
78
|
-
/** One axiom row as the host writes and reads it: column name to bare structural value. */
|
|
79
25
|
type AxiomRow<Cols extends Record<string, PayloadField>> = {
|
|
80
26
|
readonly [C in keyof Cols]: Infer<Cols[C]>;
|
|
81
27
|
};
|
|
82
|
-
/**
|
|
83
|
-
* The whole axiom record: every handle exactly once, every column exactly
|
|
84
|
-
* once per row — a missing or extra column is a TYPE error (each row is
|
|
85
|
-
* contextually checked against the declared columns), and the handle set
|
|
86
|
-
* IS the record's key set.
|
|
87
|
-
*/
|
|
88
28
|
type Axioms<Handles extends string, Cols extends Record<string, PayloadField>> = {
|
|
89
29
|
readonly [H in Handles]: AxiomRow<Cols>;
|
|
90
30
|
};
|
|
91
|
-
/**
|
|
92
|
-
* The named surface of a closed relation value, minus the handle constants
|
|
93
|
-
* (which {@link Closed} intersects in).
|
|
94
|
-
*/
|
|
95
31
|
interface ClosedCore<Name extends string, Handles extends string, Cols extends Record<string, PayloadField>> {
|
|
96
32
|
readonly name: Name;
|
|
97
|
-
/**
|
|
98
|
-
* The closed reference descriptor: `kind: Kind.id` in another relation's
|
|
99
|
-
* field block is the reference through which handle literals become
|
|
100
|
-
* legal in that relation's selections. Pure structure plus the PRECISE
|
|
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).
|
|
107
|
-
*/
|
|
108
33
|
readonly id: ClosedIdField<Name, Handles>;
|
|
109
34
|
readonly data: ClosedData;
|
|
110
|
-
/** Payload readback: handle to its declared column values, bare and structural. */
|
|
111
35
|
readonly axioms: Axioms<Handles, Cols>;
|
|
112
|
-
/**
|
|
113
|
-
* The declared payload columns, name → field descriptor — an HONEST
|
|
114
|
-
* frozen runtime record (the descriptors themselves, by identity), and
|
|
115
|
-
* the typed carrier a projected payload column's structural shape is
|
|
116
|
-
* recovered through off the schema type (the face layer's
|
|
117
|
-
* `ProjectedShape` reads it; `data.columns` carries the same
|
|
118
|
-
* descriptors in declaration order for the lowering).
|
|
119
|
-
*/
|
|
120
36
|
readonly columns: Cols;
|
|
121
37
|
}
|
|
122
|
-
/**
|
|
123
|
-
* The `where()` argument of a closed relation: EXACTLY the relation
|
|
124
|
-
* surface's {@link SelectionInput}, over the declared payload columns — the
|
|
125
|
-
* ONE selection vocabulary, so a spelling change there (H3's membership
|
|
126
|
-
* arrays) flows through with no local change here. The synthetic `id` is
|
|
127
|
-
* deliberately unspellable ({@link PayloadColumns} refuses an `id` column):
|
|
128
|
-
* an id selection is spelled only as handle literals on the REFERENCING
|
|
129
|
-
* side (the canonical-utterance law).
|
|
130
|
-
*/
|
|
131
38
|
type ClosedSelectionInput<Cols extends Record<string, PayloadField>> = SelectionInput<Cols>;
|
|
132
|
-
/**
|
|
133
|
-
* A closed relation with a ψ selection applied — what `on()` consumes as a
|
|
134
|
-
* σ-carrying closed source (`on(Kind.where({ mastered: true }), "id")`).
|
|
135
|
-
* Deliberately the SAME discriminant shape as the ordinary `Selected`
|
|
136
|
-
* (`relation`/`selection` — `face.ts::faceParts` splits both by `"relation"
|
|
137
|
-
* in source`), and structurally UNMISTAKABLE for one: an `AnyClosed` lacks
|
|
138
|
-
* the relation shape (no `fields` record, no `RelationData`).
|
|
139
|
-
*/
|
|
140
39
|
interface SelectedClosed<Name extends string, Handles extends string, Cols extends Record<string, PayloadField>> {
|
|
141
40
|
readonly relation: Closed<Name, Handles, Cols>;
|
|
142
41
|
readonly selection: readonly SelectionBinding[];
|
|
143
42
|
}
|
|
144
|
-
/** Any ψ-selected closed relation value. */
|
|
145
43
|
interface AnySelectedClosed {
|
|
146
44
|
readonly relation: AnyClosed;
|
|
147
45
|
readonly selection: readonly SelectionBinding[];
|
|
148
46
|
}
|
|
149
|
-
/**
|
|
150
|
-
* The ψ-selection surface of a payload-tier closed value. The selection is
|
|
151
|
-
* resolved EAGERLY against the declared columns and lowered as-is — the SDK
|
|
152
|
-
* never pre-folds ψ into an id set: pass-through lowering is what the macro
|
|
153
|
-
* does, and the ENGINE folds against the sealed extension at validate
|
|
154
|
-
* (`compile_member_set`).
|
|
155
|
-
*/
|
|
156
47
|
interface ClosedSelectable<Name extends string, Handles extends string, Cols extends Record<string, PayloadField>> {
|
|
157
48
|
where(selection: ClosedSelectionInput<Cols>): SelectedClosed<Name, Handles, Cols>;
|
|
158
49
|
}
|
|
159
|
-
/**
|
|
160
|
-
* A closed relation value: the core surface plus — exactly when payload
|
|
161
|
-
* columns exist — `where()` (the bare tier has nothing to select on, so
|
|
162
|
-
* the method is ABSENT there, not merely uncallable). NOTHING else:
|
|
163
|
-
* handles are data on the roster, never properties of the value (the
|
|
164
|
-
* handle constants, the match operator, and the id-to-handle weld died
|
|
165
|
-
* with the bigint era — dispatch is native `switch` narrowing over the
|
|
166
|
-
* handle union).
|
|
167
|
-
*/
|
|
168
50
|
type Closed<Name extends string, Handles extends string, Cols extends Record<string, PayloadField>> = [
|
|
169
51
|
keyof Cols
|
|
170
52
|
] extends [never] ? ClosedCore<Name, Handles, Cols> : ClosedCore<Name, Handles, Cols> & ClosedSelectable<Name, Handles, Cols>;
|
|
171
|
-
/** Any closed relation value, whatever its roster and columns. */
|
|
172
53
|
interface AnyClosed {
|
|
173
54
|
readonly name: string;
|
|
174
55
|
readonly id: ClosedIdField;
|
|
@@ -176,47 +57,10 @@ interface AnyClosed {
|
|
|
176
57
|
readonly axioms: Readonly<Record<string, object>>;
|
|
177
58
|
readonly columns: Readonly<Record<string, PayloadField>>;
|
|
178
59
|
}
|
|
179
|
-
/**
|
|
180
|
-
* THE relation-kind discriminant — the ONE spelling of "is this schema
|
|
181
|
-
* member closed?" (the type tier's twin is the `AnyClosed` conditional
|
|
182
|
-
* arms). A closed relation's runtime description carries its handle
|
|
183
|
-
* roster; an ordinary relation's never does. Every runtime closed/ordinary
|
|
184
|
-
* fork in the SDK judges through this predicate — never a re-spelled
|
|
185
|
-
* structural probe.
|
|
186
|
-
*/
|
|
187
60
|
declare function isClosedMember(member: AnyRelation | AnyClosed): member is AnyClosed;
|
|
188
|
-
/**
|
|
189
|
-
* The SEALED field list of a schema member — THE one reader of "what
|
|
190
|
-
* fields does this owner expose": an ordinary relation's declared fields;
|
|
191
|
-
* a closed relation's sealed shape — the synthetic `id` (the value's own
|
|
192
|
-
* roster-carrying descriptor, by identity) at ordinal 0, then the declared
|
|
193
|
-
* payload columns at declared index + 1 (the sealed shift, mirroring the
|
|
194
|
-
* engine's `SchemaDescriptor::sealed_fields`). A `ClosedColumn` is
|
|
195
|
-
* structurally a `RelationField`, so both kinds read uniformly.
|
|
196
|
-
*/
|
|
197
61
|
declare function sealedFieldsOf(member: AnyRelation | AnyClosed): readonly RelationField[];
|
|
198
|
-
/**
|
|
199
|
-
* One sealed field by name — derived from {@link sealedFieldsOf}, so the
|
|
200
|
-
* closed synthetic `id` resolves everywhere a name is looked up (no reader
|
|
201
|
-
* can silently lack the `id` arm). `undefined` when the name is foreign
|
|
202
|
-
* (the type tiers make that unwritable; the engine re-judges at
|
|
203
|
-
* `Db.create`).
|
|
204
|
-
*/
|
|
205
62
|
declare function sealedFieldOf(member: AnyRelation | AnyClosed, fieldName: string): AnyField | undefined;
|
|
206
|
-
/** Bare tier: `closed("Kind", ["Checking", "Savings"])` — handles only. */
|
|
207
63
|
declare function closed<const Name extends string, const Handles extends readonly [string, ...string[]]>(name: Name, handles: Handles): Closed<Name, Handles[number], Record<never, never>>;
|
|
208
|
-
/**
|
|
209
|
-
* Payload tier: declared columns AND ground axioms, one call — `closed(
|
|
210
|
-
* "Grade", { mastered: bool }, { DirectPass: { mastered: true }, Failed:
|
|
211
|
-
* { mastered: false } })`. The curried tier-2 spelling is DELETED
|
|
212
|
-
* (canonical utterance): `Cols` infers from the column block, the handle
|
|
213
|
-
* set from the axioms record's keys (reverse mapped-type inference), and
|
|
214
|
-
* every row is contextually checked against the declared columns — a
|
|
215
|
-
* wrong-typed value errors ON its property. The axioms record's keys ARE
|
|
216
|
-
* the handles (declaration order = key order, integer-index names
|
|
217
|
-
* rejected); every row carries every column exactly once (type-enforced by
|
|
218
|
-
* {@link Axioms}).
|
|
219
|
-
*/
|
|
220
64
|
declare function closed<const Name extends string, const Cols extends PayloadColumns, Handles extends string>(name: Name, columns: Cols, axioms: Axioms<Handles, Cols>): Closed<Name, Handles, Cols>;
|
|
221
65
|
export type { AnyClosed, AnySelectedClosed, AxiomRow, Axioms, Closed, ClosedColumn, ClosedCore, ClosedData, ClosedRow, ClosedSelectable, ClosedSelectionInput, PayloadField, SelectedClosed };
|
|
222
66
|
export { closed, isClosedMember, sealedFieldOf, sealedFieldsOf };
|
package/dist/closed.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closed.d.ts","sourceRoot":"","sources":["../src/closed.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"closed.d.ts","sourceRoot":"","sources":["../src/closed.ts"],"names":[],"mappings":"AACA,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,KAAK,YAAY,GAAG,OAAO,CAAC,QAAQ,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAA;CAAE,CAAC,CAAA;AAE/D,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,KAAK,CAAA;CAAE,CAAA;AAE5E,UAAU,YAAY;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;CAC5B;AAED,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-1,77 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Closed relations (`docs/architecture/10-data-model.md` § closed
|
|
3
|
-
* relations): a vocabulary whose extension is declared in the schema — two
|
|
4
|
-
* tiers, one function. Bare tier: `closed("Kind", ["Checking",
|
|
5
|
-
* "Savings"])`. Payload tier: `closed("Sev", { pages: bool }, { Critical:
|
|
6
|
-
* { pages: true }, ... })` — one call, three arguments (the curried tier-2
|
|
7
|
-
* spelling is DELETED — canonical utterance): the axioms record IS the
|
|
8
|
-
* handle declaration, every handle carrying every column exactly once
|
|
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.
|
|
31
|
-
*/
|
|
32
1
|
import * as errors from "@superbuilders/errors";
|
|
33
2
|
import { assertDeclarationOrderKey, assertDeclarationRecord, literalOf } from "#fields.ts";
|
|
34
3
|
import { resolveSelection } from "#relation.ts";
|
|
35
|
-
/**
|
|
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.
|
|
42
|
-
*/
|
|
43
4
|
function isClosedMember(member) {
|
|
44
5
|
return "handles" in member.data;
|
|
45
6
|
}
|
|
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
7
|
function sealedFieldsOf(member) {
|
|
56
8
|
if (isClosedMember(member)) {
|
|
57
9
|
return Object.freeze([Object.freeze({ name: "id", field: member.id }), ...member.data.columns]);
|
|
58
10
|
}
|
|
59
11
|
return member.data.fields;
|
|
60
12
|
}
|
|
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
13
|
function sealedFieldOf(member, fieldName) {
|
|
69
14
|
const declared = sealedFieldsOf(member).find(function byName(candidate) {
|
|
70
15
|
return candidate.name === fieldName;
|
|
71
16
|
});
|
|
72
17
|
return declared?.field;
|
|
73
18
|
}
|
|
74
|
-
/** Narrows the two-tier second argument: a handle tuple (bare tier) or a column block (payload tier). */
|
|
75
19
|
function isHandleTuple(shape) {
|
|
76
20
|
return Array.isArray(shape);
|
|
77
21
|
}
|
|
@@ -102,13 +46,6 @@ function axiomsMinted(record, handles, cols) {
|
|
|
102
46
|
}));
|
|
103
47
|
});
|
|
104
48
|
}
|
|
105
|
-
/**
|
|
106
|
-
* Mints the axiom-readback record: one own frozen row per handle (the bare
|
|
107
|
-
* tier's rows are empty — it declares no columns), each row a fresh copy of
|
|
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
|
-
*/
|
|
112
49
|
function mintAxioms(name, handles, cols, axioms) {
|
|
113
50
|
const out = {};
|
|
114
51
|
for (const handle of handles) {
|
|
@@ -133,13 +70,6 @@ function closed(name, shape, axioms) {
|
|
|
133
70
|
}
|
|
134
71
|
return closedPayload(name, shape, axioms);
|
|
135
72
|
}
|
|
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
|
-
*/
|
|
143
73
|
function closedBare(name, handles) {
|
|
144
74
|
const empty = {};
|
|
145
75
|
for (const handle of handles) {
|
|
@@ -154,11 +84,6 @@ function closedBare(name, handles) {
|
|
|
154
84
|
}
|
|
155
85
|
return mintClosed(name, handles, {}, empty);
|
|
156
86
|
}
|
|
157
|
-
/**
|
|
158
|
-
* The payload tier's precisely-typed builder: column names are judged
|
|
159
|
-
* first (the macro-expansion analog), then the handle set is read off the
|
|
160
|
-
* axioms record's own keys.
|
|
161
|
-
*/
|
|
162
87
|
function closedPayload(name, columns, axioms) {
|
|
163
88
|
assertDeclarationRecord(`closed relation ${name} columns`, columns);
|
|
164
89
|
for (const columnName of Object.keys(columns)) {
|
|
@@ -174,25 +99,10 @@ function closedPayload(name, columns, axioms) {
|
|
|
174
99
|
}
|
|
175
100
|
return mintClosed(name, handles, columns, axioms);
|
|
176
101
|
}
|
|
177
|
-
/**
|
|
178
|
-
* The trusted seam of the ergonomic-surface mint: `where` reads back as an
|
|
179
|
-
* own function exactly when payload columns exist, and is ABSENT otherwise
|
|
180
|
-
* — the runtime twin of the {@link Closed} type's conditional arm
|
|
181
|
-
* (`ClosedCore` alone vs `ClosedCore & ClosedSelectable`), verified before
|
|
182
|
-
* the minted value is admitted at the conditional type.
|
|
183
|
-
*/
|
|
184
102
|
function surfaceMinted(value, cols) {
|
|
185
103
|
const selectable = "where" in value && typeof value.where === "function";
|
|
186
104
|
return cols.length > 0 ? selectable : !selectable;
|
|
187
105
|
}
|
|
188
|
-
/**
|
|
189
|
-
* Mints one closed relation value — the shared seam of both tiers, HONESTLY
|
|
190
|
-
* typed end to end (a wrong-shaped mint is a compile error here, not a
|
|
191
|
-
* laundered `unknown`): roster checks, eager axiom lowering, the
|
|
192
|
-
* roster-carrying `id` descriptor, the frozen `columns` carrier (the runtime
|
|
193
|
-
* twin of the `Cols` type parameter), and — on the payload tier only — the
|
|
194
|
-
* ψ-selection `where()`.
|
|
195
|
-
*/
|
|
196
106
|
function mintClosed(name, handles, columns, axioms) {
|
|
197
107
|
assertDeclarationOrderKey("closed relation", name);
|
|
198
108
|
if (handles.length === 0) {
|
|
@@ -230,24 +140,10 @@ function mintClosed(name, handles, columns, axioms) {
|
|
|
230
140
|
rows: Object.freeze(rows)
|
|
231
141
|
});
|
|
232
142
|
const id = Object.freeze({ kind: "u64", closed: roster });
|
|
233
|
-
/**
|
|
234
|
-
* Handle names are arbitrary identifiers, so axiom rows are minted with
|
|
235
|
-
* OWN-property definition (inside {@link mintAxioms}), never assignment:
|
|
236
|
-
* a handle named "__proto__" would otherwise ride the Object.prototype
|
|
237
|
-
* accessor — silently swapping the record's prototype instead of
|
|
238
|
-
* creating the row. (Object SPREAD is CreateDataProperty by spec, so the
|
|
239
|
-
* copies below are own-property safe for column names too.)
|
|
240
|
-
*/
|
|
241
143
|
const axiomsOut = mintAxioms(name, handleList, cols, axioms);
|
|
242
144
|
const columnsOut = { ...columns };
|
|
243
145
|
Object.freeze(columnsOut);
|
|
244
146
|
const holder = { value: undefined };
|
|
245
|
-
/**
|
|
246
|
-
* The ψ selection: resolved against the declared payload columns through
|
|
247
|
-
* the ONE selection machine (`relation.ts::resolveSelection` — a
|
|
248
|
-
* `ClosedColumn` is structurally a `RelationField`), never pre-folded
|
|
249
|
-
* into an id set (the engine folds at validate).
|
|
250
|
-
*/
|
|
251
147
|
function where(selection) {
|
|
252
148
|
const owner = holder.value;
|
|
253
149
|
if (owner === undefined) {
|
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,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAEN,yBAAyB,EACzB,uBAAuB,EAIvB,SAAS,EACT,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,gBAAgB,EAA8C,MAAM,cAAc,CAAA;AAuE3F,SAAS,cAAc,CAAC,MAA+B;IACtD,OAAO,SAAS,IAAI,MAAM,CAAC,IAAI,CAAA;AAChC,CAAC;AAED,SAAS,cAAc,CAAC,MAA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