@bjornpagen/bumbledb 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/COOKBOOK.md +191 -92
  2. package/README.md +9 -7
  3. package/dist/closed.d.ts +30 -2
  4. package/dist/closed.d.ts.map +1 -1
  5. package/dist/closed.js +66 -20
  6. package/dist/closed.js.map +1 -1
  7. package/dist/db.d.ts +33 -6
  8. package/dist/db.d.ts.map +1 -1
  9. package/dist/db.js +89 -72
  10. package/dist/db.js.map +1 -1
  11. package/dist/exhume.d.ts.map +1 -1
  12. package/dist/exhume.js +1 -14
  13. package/dist/exhume.js.map +1 -1
  14. package/dist/face.d.ts +1 -1
  15. package/dist/face.d.ts.map +1 -1
  16. package/dist/face.js +2 -1
  17. package/dist/face.js.map +1 -1
  18. package/dist/fields.d.ts +18 -1
  19. package/dist/fields.d.ts.map +1 -1
  20. package/dist/fields.js +44 -16
  21. package/dist/fields.js.map +1 -1
  22. package/dist/index.d.ts +18 -10
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +13 -6
  25. package/dist/index.js.map +1 -1
  26. package/dist/law.d.ts +2 -1
  27. package/dist/law.d.ts.map +1 -1
  28. package/dist/law.js +15 -14
  29. package/dist/law.js.map +1 -1
  30. package/dist/lower.d.ts.map +1 -1
  31. package/dist/lower.js +1 -7
  32. package/dist/lower.js.map +1 -1
  33. package/dist/marshal.d.ts.map +1 -1
  34. package/dist/marshal.js +15 -27
  35. package/dist/marshal.js.map +1 -1
  36. package/dist/native.d.ts +21 -2
  37. package/dist/native.d.ts.map +1 -1
  38. package/dist/native.js +20 -3
  39. package/dist/native.js.map +1 -1
  40. package/dist/order.d.ts +36 -0
  41. package/dist/order.d.ts.map +1 -0
  42. package/dist/order.js +135 -0
  43. package/dist/order.js.map +1 -0
  44. package/dist/query/atom.d.ts +140 -206
  45. package/dist/query/atom.d.ts.map +1 -1
  46. package/dist/query/atom.js +33 -52
  47. package/dist/query/atom.js.map +1 -1
  48. package/dist/query/find.d.ts +116 -0
  49. package/dist/query/find.d.ts.map +1 -0
  50. package/dist/query/{select.js → find.js} +22 -22
  51. package/dist/query/find.js.map +1 -0
  52. package/dist/query/lower.d.ts +124 -162
  53. package/dist/query/lower.d.ts.map +1 -1
  54. package/dist/query/lower.js +462 -507
  55. package/dist/query/lower.js.map +1 -1
  56. package/dist/query/predicate.d.ts +22 -14
  57. package/dist/query/predicate.d.ts.map +1 -1
  58. package/dist/query/predicate.js +45 -20
  59. package/dist/query/predicate.js.map +1 -1
  60. package/dist/query/run.d.ts +3 -3
  61. package/dist/query/run.d.ts.map +1 -1
  62. package/dist/query/run.js +10 -11
  63. package/dist/query/run.js.map +1 -1
  64. package/dist/query/scope.d.ts +124 -83
  65. package/dist/query/scope.d.ts.map +1 -1
  66. package/dist/query/scope.js +77 -70
  67. package/dist/query/scope.js.map +1 -1
  68. package/dist/relation.d.ts +9 -22
  69. package/dist/relation.d.ts.map +1 -1
  70. package/dist/relation.js +9 -28
  71. package/dist/relation.js.map +1 -1
  72. package/dist/schema.d.ts.map +1 -1
  73. package/dist/schema.js +7 -31
  74. package/dist/schema.js.map +1 -1
  75. package/dist/statements.d.ts +5 -2
  76. package/dist/statements.d.ts.map +1 -1
  77. package/dist/statements.js +30 -35
  78. package/dist/statements.js.map +1 -1
  79. package/package.json +2 -5
  80. package/src/closed.ts +73 -28
  81. package/src/db.ts +126 -88
  82. package/src/exhume.ts +1 -15
  83. package/src/face.ts +4 -3
  84. package/src/fields.ts +58 -16
  85. package/src/index.ts +19 -13
  86. package/src/law.ts +15 -14
  87. package/src/lower.ts +2 -9
  88. package/src/marshal.ts +15 -31
  89. package/src/native.ts +22 -4
  90. package/src/order.ts +156 -0
  91. package/src/query/atom.ts +186 -276
  92. package/src/query/find.ts +212 -0
  93. package/src/query/lower.ts +614 -749
  94. package/src/query/predicate.ts +47 -20
  95. package/src/query/run.ts +11 -13
  96. package/src/query/scope.ts +165 -132
  97. package/src/relation.ts +9 -51
  98. package/src/schema.ts +7 -33
  99. package/src/statements.ts +33 -38
  100. package/dist/query/select.d.ts +0 -128
  101. package/dist/query/select.d.ts.map +0 -1
  102. package/dist/query/select.js.map +0 -1
  103. package/src/query/select.ts +0 -215
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.js","sourceRoot":"","sources":["../src/order.ts"],"names":[],"mappings":"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"}
@@ -1,68 +1,44 @@
1
1
  /**
2
- * Atoms and conditions, STRUCTURAL edition — the body vocabulary of a
3
- * rule, mirroring the engine IR variant for variant
2
+ * Atoms and conditions, REFERENCE-IDENTITY edition — the body vocabulary of
3
+ * a rule, mirroring the engine IR variant for variant
4
4
  * (`bumbledb/crates/bumbledb/src/ir.rs`, the bijection target;
5
5
  * `docs/architecture/20-query-ir.md` normative). A `match` binding record
6
- * binds fields to vars, params, ∈-set params, or bare structural literals
7
- * — a closed-reference field's literal is its handle NAME, and a plain
8
- * ARRAY of names there is membership, folded into the program (closed-only
9
- * by owner ruling; see {@link BindingInput})
6
+ * binds fields to VARIABLES (minted by {@link v}), params, ∈-set params, or
7
+ * bare structural literals — a closed-reference field's literal is its
8
+ * handle NAME, and a plain ARRAY of names there is membership
10
9
  * (unmentioned fields ARE the wildcard — no wildcard value exists);
11
10
  * `not(Rel, {...})` is negation-as-position (anti-join); `eq`/`ne` and the
12
- * order roster, `pointIn`/`covers` (both spellings of `ir::CmpOp::PointIn`,
11
+ * order roster, `pointIn` (the one spelling of `ir::CmpOp::PointIn`,
13
12
  * always lowered interval-left), `allen` (the 13-bit mask pair
14
13
  * comparison), and `and`/`or` (the input condition-tree grammar) complete
15
14
  * the roster. Nothing beyond the IR exists here — and the walls the engine
16
- * enforces at prepare are TYPES first: a var joins only domain-equal
17
- * fields (`JoinOk`, checked against the rule environment AND against the
18
- * binding record's own same-named siblings two first occurrences of one
19
- * name inside one record are a join too), an
20
- * interval-typed var under a non-`pointIn` comparison is unwritable, and a
21
- * negated atom's variables must be positively bound (env membership IS the
22
- * safety rule). Every condition value carries its operands raw the
23
- * runtime representation is the type-inference carrier, no phantoms.
15
+ * enforces at prepare are TYPES first: a variable joins only class-equal
16
+ * fields, judged at every binding position against the var's MINT slot
17
+ * ({@link MintSlotOf}); because {@link JoinOk} is an equality, that ALONE
18
+ * makes every cross-binding join transitively class-equal (the env/sibling
19
+ * checks the name-keyed edition needed are gone). An interval-typed var
20
+ * under a non-`pointIn` comparison is unwritable. BOUNDNESS (a negated
21
+ * atom's variables must be positively bound) is the one check types cannot
22
+ * carry object identity is invisible to TS so it is a construction-time
23
+ * wall only.
24
24
  *
25
25
  * This module also owns the plain runtime DATA a built rule is made of
26
26
  * (`RuleData`/`RecData` and friends): frozen values the lowering walks —
27
- * pure data, so lowering stays a pure, stable function of the query value.
27
+ * pure data (variable references included), so lowering stays a pure,
28
+ * stable function of the query value.
28
29
  */
29
- import type { AnyClosed } from "#closed.ts";
30
30
  import type { AnyField, ClosedIdField, ClosedRoster, Infer, IntervalValue } from "#fields.ts";
31
31
  import type { ClassLookup, ClassRecordOf, SchemaClasses } from "#law.ts";
32
- import type { ClassedField, Duration, EnvShape, JoinOk, MaskParam, Param, ParamValueAt, SetParam, ShapeOf, Var } from "#query/scope.ts";
33
- import type { AnyRelation, FieldsShape, RelationFields } from "#relation.ts";
32
+ import type { AnyVar, ClassedField, Duration, JoinOk, MaskParam, MatchFields, MatchOwner, MintSlotOf, Param, ParamValueAt, SetParam, ShapeOf } from "#query/scope.ts";
33
+ import type { FieldsShape } from "#relation.ts";
34
34
  /**
35
- * What a query atom matches over: an ordinary relation or a CLOSED
36
- * vocabulary (ψ query atoms the engine folds a resolvable closed atom
37
- * into a plan-constant member set at prepare, or joins the L1-resident
38
- * virtual image when the shape does not fold; the SDK never pre-folds and
39
- * never knows which — transparency is the contract).
40
- */
41
- type MatchOwner = AnyRelation | AnyClosed;
42
- /**
43
- * The matchable field block of an atom owner: a relation's declared
44
- * fields; a closed relation's SEALED shape — the synthetic `id` (the
45
- * value's OWN roster-carrying descriptor, at its precise type: the handle
46
- * union rides into ψ id bindings and joins exactly as it does on a
47
- * referencing column) first, then the declared payload columns read
48
- * through the typed `columns` carrier (the one source of payload typing —
49
- * no parallel column table exists). The runtime twin is `matchFieldsOf` in
50
- * `#query/lower.ts`; the id-first ordinal shift the two tiers share is
51
- * pinned by the lowering golden.
52
- */
53
- type MatchFields<R extends MatchOwner> = R extends AnyClosed ? {
54
- readonly id: R["id"];
55
- } & R["columns"] : R extends AnyRelation ? RelationFields<R> : never;
56
- /**
57
- * One atom-binding position as runtime data. `literalSet` is a membership
58
- * ARRAY at a closed-reference field, folded into the program: `name` is
59
- * the content-addressed registry key its dense `ParamId` is minted under
60
- * (the lowering rides the existing param-set term; the SDK itself supplies
61
- * the translated member set at every execute — never the host).
35
+ * One atom-binding position as runtime data. A variable rides BY REFERENCE
36
+ * (`ref`) object identity is the join. `literalSet` is a membership
37
+ * ARRAY at a closed-reference field, folded into the program.
62
38
  */
63
39
  type BindingTermData = {
64
40
  readonly kind: "var";
65
- readonly name: string;
41
+ readonly ref: AnyVar;
66
42
  } | {
67
43
  readonly kind: "param";
68
44
  readonly name: string;
@@ -91,10 +67,10 @@ interface AtomData {
91
67
  }
92
68
  /** One comparison operator name (mirrors `ir::CmpOp`). */
93
69
  type CmpKind = "eq" | "ne" | "lt" | "le" | "gt" | "ge" | "pointIn" | "allen";
94
- /** One comparison side as runtime data. */
70
+ /** One comparison side as runtime data (variables and the measure ride BY REFERENCE). */
95
71
  type CmpTermData = {
96
72
  readonly kind: "var";
97
- readonly name: string;
73
+ readonly ref: AnyVar;
98
74
  } | {
99
75
  readonly kind: "param";
100
76
  readonly name: string;
@@ -103,7 +79,7 @@ type CmpTermData = {
103
79
  readonly name: string;
104
80
  } | {
105
81
  readonly kind: "measure";
106
- readonly name: string;
82
+ readonly ref: AnyVar;
107
83
  } | {
108
84
  readonly kind: "literal";
109
85
  readonly value: unknown;
@@ -132,52 +108,59 @@ interface TreeData {
132
108
  }
133
109
  /** Any condition node as runtime data. */
134
110
  type CondData = CmpData | TreeData;
135
- /** One aggregate's runtime description (select vocabulary, over var NAMES). */
111
+ /** One aggregate's runtime description (find vocabulary, over variable REFERENCES). */
136
112
  type AggData = {
137
113
  readonly op: "count";
138
114
  } | {
139
115
  readonly op: "countDistinct";
140
- readonly over: string;
116
+ readonly over: AnyVar;
141
117
  } | {
142
118
  readonly op: "fold";
143
119
  readonly fold: "sum" | "min" | "max";
144
- readonly over: string | {
145
- readonly duration: string;
120
+ readonly over: AnyVar | {
121
+ readonly duration: AnyVar;
146
122
  };
147
123
  } | {
148
124
  readonly op: "arg";
149
125
  readonly direction: "argMax" | "argMin";
150
- readonly over: string;
151
- readonly key: string;
126
+ readonly over: AnyVar;
127
+ readonly key: AnyVar;
152
128
  } | {
153
129
  readonly op: "pack";
154
- readonly over: string;
130
+ readonly over: AnyVar;
155
131
  };
156
- /** One classified select entry as runtime data. */
157
- type SelectEntryData = {
132
+ /** One classified find entry as runtime data (variables and the measure ride BY REFERENCE). */
133
+ type FindEntryData = {
158
134
  readonly kind: "var";
159
- readonly over: string;
135
+ readonly over: AnyVar;
160
136
  } | {
161
137
  readonly kind: "measure";
162
- readonly over: string;
138
+ readonly over: AnyVar;
163
139
  } | {
164
140
  readonly kind: "aggregate";
165
141
  readonly agg: AggData;
166
142
  };
167
143
  /**
168
- * One answer column: its name (the row object key), its entry, and when
169
- * the column's value is a closed reference (a projected var or an
170
- * Arg-carried payload bound at a closed-referencing field) the roster the
171
- * decode lifts row ids back to handle NAMES through (the read half of the
172
- * marshal bijection; `undefined` on every bare column). The slice is
173
- * SDK-side marshaling data only: the wire `ProgramIr` never carries it.
144
+ * One answer column: its name (the row object key the find record's key,
145
+ * so renames are real and a duplicate column is unrepresentable), its entry,
146
+ * the classed mint SLOT its values flow from (a projected var or an
147
+ * Arg-carried payload; `undefined` for counts/folds/measures/pack, which
148
+ * derive numbers or intervals), and when that slot is a closed reference —
149
+ * the roster the decode lifts row ids back to handle NAMES through
150
+ * (`undefined` on every bare column). The slice is SDK-side marshaling data
151
+ * only: the wire `ProgramIr` never carries it.
174
152
  */
175
- interface SelectColumn {
153
+ interface FindColumn {
176
154
  readonly name: string;
177
- readonly entry: SelectEntryData;
155
+ readonly entry: FindEntryData;
178
156
  readonly closed: ClosedRoster | undefined;
157
+ readonly slot: ClassedField | undefined;
179
158
  }
180
- /** One body item of a rule, in written order. */
159
+ /**
160
+ * One body item of a rule, in written order. The idb join is a NAMED record
161
+ * over the rec's head keys (`key`) bound to local variables (`ref`) — the
162
+ * typed wall a record's unordered keys would otherwise lose.
163
+ */
181
164
  type RuleItem = {
182
165
  readonly kind: "atom";
183
166
  readonly atom: AtomData;
@@ -187,7 +170,10 @@ type RuleItem = {
187
170
  } | {
188
171
  readonly kind: "idb";
189
172
  readonly rec: RecData;
190
- readonly vars: readonly string[];
173
+ readonly bindings: ReadonlyArray<{
174
+ readonly key: string;
175
+ readonly ref: AnyVar;
176
+ }>;
191
177
  } | {
192
178
  readonly kind: "cond";
193
179
  readonly cond: CondData;
@@ -196,9 +182,7 @@ type RuleItem = {
196
182
  * One use of a parameter inside a rule, in written order: the census the
197
183
  * query-level registry folds (first use mints the dense `ParamId`, first
198
184
  * FIELD-ANCHORED use types the wire). `members` is present exactly on a
199
- * membership-array use (a literal set folded into the program): the handle
200
- * names the SDK itself translates and supplies at execute — the entry
201
- * never appears in the host's params object.
185
+ * membership-array use.
202
186
  */
203
187
  interface ParamUse {
204
188
  readonly name: string;
@@ -210,9 +194,7 @@ interface ParamUse {
210
194
  /** One complete rule as runtime data. */
211
195
  interface RuleData {
212
196
  readonly items: readonly RuleItem[];
213
- readonly select: readonly SelectColumn[];
214
- /** Variable name → the classed slot its FIRST positive binding carries (the runtime env — descriptor + class). */
215
- readonly varFields: Readonly<Record<string, ClassedField>>;
197
+ readonly finds: readonly FindColumn[];
216
198
  readonly paramUses: readonly ParamUse[];
217
199
  }
218
200
  /**
@@ -226,21 +208,13 @@ interface RecData {
226
208
  }
227
209
  /**
228
210
  * What a binding position of field `F` accepts: a bare structural literal
229
- * of the field's value type, a var/param/∈-set-param term — and, when the
230
- * field is interval-typed, a bare point literal (the IR's membership
231
- * typing rule: an element-typed term at an interval field is point
232
- * membership; an interval-typed term is value equality). A
233
- * CLOSED-reference field additionally takes a plain ARRAY of handle names
234
- * read as membership — `kind: ["Practice", "Review"]` (the drizzle law:
235
- * set membership is an array, never an operator). Arrays are CLOSED-ONLY
236
- * in this packet by owner ruling: ordinary u64/str membership already has
237
- * its spelling through `r.inSet` params; widening literal arrays to every
238
- * literal-capable kind is a separate future taste call — deliberately not
239
- * done here.
211
+ * of the field's value type, a variable/param/∈-set-param term — and, when
212
+ * the field is interval-typed, a bare point literal. A CLOSED-reference
213
+ * field additionally takes a plain ARRAY of handle names read as membership.
240
214
  */
241
215
  type BindingInput<F extends AnyField> = Infer<F> | (F extends ClosedIdField ? readonly Infer<F>[] : never) | (F extends {
242
216
  readonly kind: "interval";
243
- } ? bigint : never) | Var<string> | Param<string> | SetParam<string>;
217
+ } ? bigint : never) | AnyVar | Param<string> | SetParam<string>;
244
218
  /**
245
219
  * The `match`/`not` bindings record: per field, a term or literal of that
246
220
  * field's structural type; unmentioned fields are wildcards (absence IS
@@ -252,44 +226,22 @@ type MatchShape<F extends FieldsShape> = {
252
226
  /**
253
227
  * One field position of a bindings record as a classed slot: the declared
254
228
  * descriptor plus the slot's law-computed class, read off the relation's
255
- * class record (`CR` the schema class map's entry for the atom's
256
- * relation). The one shape every join judgment compares.
229
+ * class record (`CR`). The one shape a binding position's join judgment
230
+ * compares against.
257
231
  */
258
232
  type SlotAt<F extends FieldsShape, CR, K> = {
259
233
  readonly field: F[K & keyof F];
260
234
  readonly class: ClassLookup<CR, K>;
261
235
  };
262
236
  /**
263
- * The var binding's judgment against the incoming rule environment: a name
264
- * already bound must land on a class-equal slot (bare pairs only with bare).
265
- */
266
- type EnvJoinOk<Env extends EnvShape, F extends FieldsShape, CR, K, N extends string> = N extends keyof Env ? JoinOk<Env[N], SlotAt<F, CR, K>> : true;
267
- /**
268
- * The var binding's judgment against its OWN record's siblings: two
269
- * bindings of one var name inside a single bindings record are the same
270
- * join the environment check judges across atoms, so every same-named
271
- * sibling must be class-equal too. Without this arm two FIRST occurrences
272
- * of one name (a record the environment has not seen yet) would meet no
273
- * check at all — the intra-atom join would silently cross classes.
237
+ * The per-property join judgment of a bindings record: a VARIABLE binding
238
+ * must join its own MINT slot to the position slot (a cross-class reuse maps
239
+ * the property to `never`). Because {@link JoinOk} is an equality, judging
240
+ * every position against the mint slot makes all cross-binding joins
241
+ * mutually class-equal by transitivity — no env or sibling arm is needed.
274
242
  */
275
- type SiblingJoinOk<F extends FieldsShape, CR, B, K extends keyof B, N extends string> = false extends {
276
- [K2 in Exclude<keyof B & keyof F, K>]: B[K2] extends Var<N> ? JoinOk<SlotAt<F, CR, K2>, SlotAt<F, CR, K>> : true;
277
- }[Exclude<keyof B & keyof F, K>] ? false : true;
278
- /**
279
- * The per-property join judgment of a bindings record: a var binding must
280
- * be class-equal to the rule environment's binding of the name AND to
281
- * every same-named sibling of its own record (a cross-class reuse maps
282
- * the property to `never` — the compile error the old value brand carried,
283
- * now law-born off the schema type's class map).
284
- */
285
- type BindingOk<Env extends EnvShape, F extends FieldsShape, CR, B, K extends keyof B> = B[K] extends Var<infer N extends string> ? [EnvJoinOk<Env, F, CR, K, N>, SiblingJoinOk<F, CR, B, K, N>] extends [true, true] ? true : false : true;
286
- /** The validated bindings record (intersect with the inferred `B` — errors land on the offending property). */
287
- type CheckBindings<Env extends EnvShape, F extends FieldsShape, CR, B> = {
288
- readonly [K in keyof B]: K extends keyof F ? (BindingOk<Env, F, CR, B, K> extends true ? B[K] : never) : never;
289
- };
290
- /** The environment a bindings record contributes: var name → the bound slot (descriptor + class). */
291
- type BindEnv<F extends FieldsShape, CR, B> = {
292
- readonly [K in keyof B & keyof F as B[K] extends Var<infer N extends string> ? N : never]: SlotAt<F, CR, K>;
243
+ type CheckBindings<Classes extends SchemaClasses, F extends FieldsShape, CR, B> = {
244
+ readonly [K in keyof B]: K extends keyof F ? B[K] extends AnyVar ? JoinOk<MintSlotOf<Classes, B[K]>, SlotAt<F, CR, K>> extends true ? B[K] : never : B[K] : never;
293
245
  };
294
246
  /** The params-object fragments a bindings record contributes (one union member per param use). */
295
247
  type BindParams<F extends FieldsShape, B> = {
@@ -301,8 +253,8 @@ type BindParams<F extends FieldsShape, B> = {
301
253
  }[keyof B & keyof F];
302
254
  /**
303
255
  * One comparison VALUE: op plus its operands, raw — the runtime
304
- * representation carries the operand types, so `.where`'s environment
305
- * check and the params inference both read the value itself (no phantom).
256
+ * representation carries the operands (variable references included), so
257
+ * `.where`'s judgment and the params inference both read the value itself.
306
258
  * `mask` is populated exactly for `allen`.
307
259
  */
308
260
  interface Cmp<Op extends CmpKind, L, R, M = undefined> {
@@ -321,9 +273,9 @@ interface Tree<Ch extends readonly AnyTreeChild[]> {
321
273
  /**
322
274
  * One negated-atom VALUE — negation is a position in the rule (anti-join
323
275
  * over sets, no null trick): a binding satisfies it iff NO fact matches.
324
- * Its variables must be positively bound in the rule — environment
325
- * membership at `.where` IS the safety rule, a compile error before it is
326
- * the engine's refusal.
276
+ * Its variables must be positively bound in the rule — a construction-time
277
+ * wall (BOUNDNESS is invisible to the type tier), before the engine's own
278
+ * refusal.
327
279
  */
328
280
  interface NotAtom<R extends MatchOwner, B> {
329
281
  readonly cond: "not";
@@ -339,27 +291,27 @@ type AnyNotAtom = NotAtom<MatchOwner, unknown>;
339
291
  /** Any `.where` input: a comparison, a condition tree, or a negated atom. */
340
292
  type AnyCond = AnyCmp | Tree<readonly AnyTreeChild[]> | AnyNotAtom;
341
293
  /** What `eq`'s right side accepts (`ParamSet` is `Eq`-only — the IR's rule). */
342
- type EqRight = Var<string> | Param<string> | SetParam<string> | bigint | string | boolean | Uint8Array | IntervalValue;
294
+ type EqRight = AnyVar | Param<string> | SetParam<string> | bigint | string | boolean | Uint8Array | IntervalValue;
343
295
  /** What `ne`'s right side accepts. */
344
- type NeRight = Var<string> | Param<string> | bigint | string | boolean | Uint8Array | IntervalValue;
296
+ type NeRight = AnyVar | Param<string> | bigint | string | boolean | Uint8Array | IntervalValue;
345
297
  /** One side of an order comparison: orderable terms only (the IR's comparison rules). */
346
- type OrderSide = Var<string> | Param<string> | Duration<string> | bigint;
347
- /** The point side of `pointIn`/`covers`. */
348
- type PointSide = Var<string> | Param<string> | bigint;
349
- /** The interval side of `pointIn`/`covers`/`allen`. */
350
- type IntervalSide = Var<string> | Param<string> | IntervalValue;
298
+ type OrderSide = AnyVar | Param<string> | Duration | bigint;
299
+ /** The point side of `pointIn`. */
300
+ type PointSide = AnyVar | Param<string> | bigint;
301
+ /** The interval side of `pointIn`/`allen`. */
302
+ type IntervalSide = AnyVar | Param<string> | IntervalValue;
351
303
  /** Builds one comparison value. */
352
304
  declare function comparison<Op extends CmpKind, L, R, M>(op: Op, lhs: L, rhs: R, mask: M): Cmp<Op, L, R, M>;
353
305
  /**
354
306
  * The equality comparison (`ir::CmpOp::Eq`) — a bound variable against a
355
- * variable (var-to-var unification, domain-equal by the environment
356
- * check), a param (typed by the variable), an ∈-set param (`Eq`-only, the
357
- * IR's set rule), or a bare literal of the variable's own value type.
358
- * Prefer direct placement in `match` where punning applies.
307
+ * variable (var-to-var unification, class-equal by the join judgment), a
308
+ * param (typed by the variable), an ∈-set param (`Eq`-only), or a bare
309
+ * literal of the variable's own value type. Prefer direct placement in
310
+ * `match` where punning applies.
359
311
  */
360
- declare function eq<L extends Var<string>, const R extends EqRight>(left: L, right: R): Cmp<"eq", L, R>;
312
+ declare function eq<L extends AnyVar, const R extends EqRight>(left: L, right: R): Cmp<"eq", L, R>;
361
313
  /** Typed disequality (`ir::CmpOp::Ne`). "Not in set" has no operator — write a negated atom. */
362
- declare function ne<L extends Var<string>, const R extends NeRight>(left: L, right: R): Cmp<"ne", L, R>;
314
+ declare function ne<L extends AnyVar, const R extends NeRight>(left: L, right: R): Cmp<"ne", L, R>;
363
315
  /** Strict less-than (`ir::CmpOp::Lt`) — orderable sides only, never intervals/bytes/strings/bools. */
364
316
  declare function lt<const L extends OrderSide, const R extends OrderSide>(left: L, right: R): Cmp<"lt", L, R>;
365
317
  /** Less-or-equal (`ir::CmpOp::Le`). */
@@ -369,27 +321,23 @@ declare function gt<const L extends OrderSide, const R extends OrderSide>(left:
369
321
  /** Greater-or-equal (`ir::CmpOp::Ge`). */
370
322
  declare function ge<const L extends OrderSide, const R extends OrderSide>(left: L, right: R): Cmp<"ge", L, R>;
371
323
  /**
372
- * Point membership as a predicate (`ir::CmpOp::PointIn`), membership
324
+ * Point membership as a predicate (`ir::CmpOp::PointIn`) — THE one
373
325
  * spelling: `pointIn(t, w)` holds iff `w.start ≤ t < w.end`. The IR
374
326
  * orders the operands interval-left, point-right; the value stores them
375
- * that way whatever the surface spelling.
327
+ * that way whatever the surface argument order. Interval ⊇ interval is NOT
328
+ * this operator; that predicate is `allen(a, ALLEN.covers, b)`.
376
329
  */
377
330
  declare function pointIn<const P extends PointSide, const I extends IntervalSide>(point: P, interval: I): Cmp<"pointIn", I, P>;
378
331
  /**
379
- * Point membership, coverage spelling `covers(w, t)` is `pointIn(t, w)`
380
- * with the interval written first (the IR's own operand order; a literal
381
- * `span(...)` left operand is legal and tags by the point sibling's
382
- * element domain — the bug-hunt fix, now also a type-level guarantee).
383
- * Interval ⊇ interval is NOT this operator; that predicate is
384
- * `allen(a, ALLEN.covers, b)`.
332
+ * The 13-bit mask range: bits above the low 13 are unrepresentable in the
333
+ * engine's `AllenMask` (`bumbledb/crates/bumbledb/src/allen.rs`:
334
+ * `AllenMask::new` refuses them).
385
335
  */
386
- declare function covers<const I extends IntervalSide, const P extends PointSide>(interval: I, point: P): Cmp<"pointIn", I, P>;
336
+ declare const ALLEN_ALL_BITS: number;
387
337
  /**
388
338
  * The Allen coordinate system's named constants — the 13 basics in the
389
- * engine's palindromic bit order (bit i = basic i:
390
- * `bumbledb/crates/bumbledb/src/allen.rs`, a specified representation)
391
- * plus the workload composites, values identical to the engine's. Compose
392
- * with `|`: `ALLEN.before | ALLEN.meets`.
339
+ * engine's palindromic bit order plus the workload composites, values
340
+ * identical to the engine's. Compose with `|`: `ALLEN.before | ALLEN.meets`.
393
341
  */
394
342
  declare const ALLEN: Readonly<{
395
343
  before: number;
@@ -418,9 +366,7 @@ declare const ALLEN: Readonly<{
418
366
  * THE interval-pair comparison (`ir::CmpOp::Allen`): two interval terms of
419
367
  * one element type, satisfied iff the pair's classification is in the
420
368
  * 13-bit mask — a literal built from the `ALLEN` constants, or a mask
421
- * parameter (`r.maskParam`). Vacuous masks (empty/full) are the engine's
422
- * two distinct typed rejections; nothing is pre-judged here beyond the
423
- * representable bit range.
369
+ * parameter (`r.maskParam`).
424
370
  */
425
371
  declare function allen<const A extends IntervalSide, const M extends number | MaskParam<string>, const B extends IntervalSide>(left: A, mask: M, right: B): Cmp<"allen", A, B, M>;
426
372
  /**
@@ -433,70 +379,59 @@ declare function and<const C extends readonly AnyTreeChild[]>(...children: C): T
433
379
  /**
434
380
  * Disjunction node of the input condition grammar (`ConditionTree::Or`) —
435
381
  * the one place the surface admits a nested OR; validation distributes it
436
- * to DNF rules engine-side (OR is data or it is nothing). `Or([])` keeps
437
- * its algebraic reading (false: the rule denotes nothing).
382
+ * to DNF rules engine-side. `Or([])` keeps its algebraic reading (false).
438
383
  */
439
384
  declare function or<const C extends readonly AnyTreeChild[]>(...children: C): Tree<C>;
440
385
  /**
441
- * Negation — anti-join over sets: `not(Rel, { field: r.var("x"), ... })`
386
+ * Negation — anti-join over sets: `not(Rel, { field: someVar, ... })`
442
387
  * rejects every binding some matching fact extends. A negated atom binds
443
388
  * nothing, only rejects: every variable it names must be positively bound
444
- * in the rule, which `.where`'s environment check makes a COMPILE error
445
- * (the engine's safety refusal stands behind it). A CLOSED owner is legal
446
- * here too — the engine folds a resolvable negated closed atom to the
447
- * COMPLEMENT of its member set (domain-witness guarded), and the SDK's
448
- * negation rules apply to it unchanged.
389
+ * in the rule, a construction-time wall (the engine's safety refusal stands
390
+ * behind it). A CLOSED owner is legal here too.
449
391
  */
450
392
  declare function not<R extends MatchOwner, const B extends MatchShape<MatchFields<R>>>(relation: R, bindings: B): NotAtom<R, B>;
451
393
  /**
452
- * Whether a var name is bound in the environment at an orderable (u64/i64)
453
- * field. A CLOSED reference is excluded even though its kind is `u64`: a
454
- * vocabulary's declaration-id order is an accident, not semantics
455
- * (`docs/architecture/10-data-model.md` § orderability order on it is
456
- * refused exactly as the enum's ordinal order was), so every
457
- * order-comparison and fold position refuses closed-bound terms — this
458
- * judgment is the one gate they all read, and the construction-time
459
- * validations in `#query/lower.ts` are its runtime twin.
394
+ * Whether a variable's OWN field is orderable (u64/i64). A CLOSED reference
395
+ * is excluded even though its kind is `u64`: a vocabulary's declaration-id
396
+ * order is an accident, not semantics (`docs/architecture/10-data-model.md`
397
+ * § orderability), so every order-comparison and fold position refuses
398
+ * closed-bound terms this judgment is the one gate they all read, and the
399
+ * construction-time validations in `#query/lower.ts` are its runtime twin.
460
400
  */
461
- type OrderVarOk<Env extends EnvShape, N extends string> = N extends keyof Env ? Env[N]["field"] extends {
401
+ type OrderVarOk<V extends AnyVar> = V["field"] extends {
462
402
  readonly closed: ClosedRoster;
463
- } ? false : Env[N]["field"]["kind"] extends "u64" | "i64" ? true : false : false;
464
- /** Whether a var name is bound at an interval field. */
465
- type IntervalVarOk<Env extends EnvShape, N extends string> = N extends keyof Env ? Env[N]["field"]["kind"] extends "interval" ? true : false : false;
466
- /** One order-comparison side's judgment against the environment. */
467
- type OrderSideOk<Env extends EnvShape, T> = T extends Var<infer N extends string> ? OrderVarOk<Env, N> : T extends Duration<infer N extends string> ? IntervalVarOk<Env, N> : true;
403
+ } ? false : V["field"]["kind"] extends "u64" | "i64" ? true : false;
404
+ /** Whether a variable's OWN field is interval-typed. */
405
+ type IntervalVarOk<V extends AnyVar> = V["field"]["kind"] extends "interval" ? true : false;
406
+ /** One order-comparison side's judgment (off the term's own field). */
407
+ type OrderSideOk<T> = T extends AnyVar ? OrderVarOk<T> : T extends Duration<infer V extends AnyVar> ? IntervalVarOk<V> : true;
468
408
  /** One point side's judgment. */
469
- type PointSideOk<Env extends EnvShape, T> = T extends Var<infer N extends string> ? OrderVarOk<Env, N> : true;
409
+ type PointSideOk<T> = T extends AnyVar ? OrderVarOk<T> : true;
470
410
  /** One interval side's judgment. */
471
- type IntervalSideOk<Env extends EnvShape, T> = T extends Var<infer N extends string> ? IntervalVarOk<Env, N> : true;
472
- /** The `eq`/`ne` judgment: left var bound; right joins it (class-equal var, param, or an exact-type literal). */
473
- type EqOk<Env extends EnvShape, L, R> = L extends Var<infer N extends string> ? N extends keyof Env ? R extends Var<infer M extends string> ? M extends keyof Env ? JoinOk<Env[N], Env[M]> : false : R extends Param<string> | SetParam<string> ? true : [R] extends [Infer<Env[N]["field"]>] ? true : false : false : false;
474
- /** One negated-atom binding's judgment: a var must be positively bound (safety) AND class-equal. */
475
- type NotBindingOk<Env extends EnvShape, S extends ClassedField, T> = T extends Var<infer N extends string> ? (N extends keyof Env ? JoinOk<Env[N], S> : false) : true;
411
+ type IntervalSideOk<T> = T extends AnyVar ? IntervalVarOk<T> : true;
412
+ /** The `eq`/`ne` judgment: var-var joins by mint slot; var-literal is exact-typed by the var's own field. */
413
+ type EqOk<Classes extends SchemaClasses, L, R> = L extends AnyVar ? R extends AnyVar ? JoinOk<MintSlotOf<Classes, L>, MintSlotOf<Classes, R>> extends true ? true : false : R extends Param<string> | SetParam<string> ? true : [R] extends [Infer<L["field"]>] ? true : false : false;
414
+ /** One negated-atom binding's judgment: a variable must be class-equal (boundness is a runtime wall). */
415
+ type NotBindingOk<Classes extends SchemaClasses, S extends ClassedField, T> = T extends AnyVar ? JoinOk<MintSlotOf<Classes, T>, S> extends true ? true : false : true;
476
416
  /** The whole negated atom's judgment (`CR` — the negated relation's class record off the schema class map). */
477
- type NotOk<Env extends EnvShape, F extends FieldsShape, CR, B> = false extends {
478
- [K in keyof B]: NotBindingOk<Env, SlotAt<F, CR, K>, B[K]>;
417
+ type NotOk<Classes extends SchemaClasses, F extends FieldsShape, CR, B> = false extends {
418
+ [K in keyof B]: NotBindingOk<Classes, SlotAt<F, CR, K>, B[K]>;
479
419
  }[keyof B] ? false : true;
480
420
  /**
481
- * One condition's judgment against the rule environment the type-level
482
- * twin of the engine's comparison roster: class-equal joins (off the
483
- * schema type's class map), orderable order sides (an interval var under a
484
- * non-`pointIn` op is exactly here refused), kind-correct
485
- * `pointIn`/`covers`/`allen` sides, and negated-atom safety (the negated
486
- * relation's class record is resolved through `Classes` by its name). The
487
- * leading `[AnyTreeChild] extends [C]` arm is the recursion's base case:
488
- * at an UNRESOLVED constraint (the whole condition union — or a tree's
489
- * child union, which is the union itself) the judgment is vacuously true —
490
- * without it the constraint instantiation recurses into itself.
421
+ * One condition's judgment the type-level twin of the engine's comparison
422
+ * roster: class-equal joins (off the mint slots), orderable order sides (an
423
+ * interval var under a non-`pointIn` op is exactly here refused),
424
+ * kind-correct `pointIn`/`allen` sides, and negated-atom class safety. The
425
+ * leading `[AnyTreeChild] extends [C]` arm is the recursion's base case.
491
426
  */
492
- type CondOkBool<Env extends EnvShape, Classes extends SchemaClasses, C> = [AnyTreeChild] extends [C] ? true : C extends Cmp<infer Op, infer L, infer R, unknown> ? Op extends "eq" | "ne" ? EqOk<Env, L, R> : Op extends "lt" | "le" | "gt" | "ge" ? [OrderSideOk<Env, L>, OrderSideOk<Env, R>] extends [true, true] ? true : false : Op extends "pointIn" ? [IntervalSideOk<Env, L>, PointSideOk<Env, R>] extends [true, true] ? true : false : Op extends "allen" ? [IntervalSideOk<Env, L>, IntervalSideOk<Env, R>] extends [true, true] ? true : false : false : C extends Tree<infer Ch extends readonly AnyTreeChild[]> ? false extends CondOkBool<Env, Classes, Ch[number]> ? false : true : C extends NotAtom<infer R extends MatchOwner, infer B> ? NotOk<Env, MatchFields<R>, ClassRecordOf<Classes, R["name"]>, B> : false;
427
+ type CondOkBool<Classes extends SchemaClasses, C> = [AnyTreeChild] extends [C] ? true : C extends Cmp<infer Op, infer L, infer R, unknown> ? Op extends "eq" | "ne" ? EqOk<Classes, L, R> : Op extends "lt" | "le" | "gt" | "ge" ? [OrderSideOk<L>, OrderSideOk<R>] extends [true, true] ? true : false : Op extends "pointIn" ? [IntervalSideOk<L>, PointSideOk<R>] extends [true, true] ? true : false : Op extends "allen" ? [IntervalSideOk<L>, IntervalSideOk<R>] extends [true, true] ? true : false : false : C extends Tree<infer Ch extends readonly AnyTreeChild[]> ? false extends CondOkBool<Classes, Ch[number]> ? false : true : C extends NotAtom<infer R extends MatchOwner, infer B> ? NotOk<Classes, MatchFields<R>, ClassRecordOf<Classes, R["name"]>, B> : false;
493
428
  /** The validated `.where` argument (intersect with the inferred condition type). */
494
- type CheckCond<Env extends EnvShape, Classes extends SchemaClasses, C> = CondOkBool<Env, Classes, C> extends true ? C : never;
495
- /** The `eq`/`ne` params contribution: the param typed by the left variable's field. */
496
- type EqParams<Env extends EnvShape, L, R> = L extends Var<infer N extends string> ? R extends Param<infer P extends string> ? {
497
- readonly [Q in P]: Infer<Env[N & keyof Env]["field"]>;
429
+ type CheckCond<Classes extends SchemaClasses, C> = CondOkBool<Classes, C> extends true ? C : never;
430
+ /** The `eq`/`ne` params contribution: the param typed by the left variable's own field. */
431
+ type EqParams<L, R> = L extends AnyVar ? R extends Param<infer P extends string> ? {
432
+ readonly [Q in P]: Infer<L["field"]>;
498
433
  } : R extends SetParam<infer P extends string> ? {
499
- readonly [Q in P]: readonly Infer<Env[N & keyof Env]["field"]>[];
434
+ readonly [Q in P]: readonly Infer<L["field"]>[];
500
435
  } : never : never;
501
436
  /** An order side's params contribution (order params are always `bigint`). */
502
437
  type OrderSideParams<T> = T extends Param<infer P extends string> ? {
@@ -513,14 +448,13 @@ type MaskParams<M> = M extends MaskParam<infer P extends string> ? {
513
448
  /**
514
449
  * One condition's params-object fragments (a union; the rule builder folds
515
450
  * them into the inferred `Params` record) — every param typed by its use.
516
- * The leading arm is the same base case as {@link CondOkBool}'s: the
517
- * unresolved constraint contributes nothing.
451
+ * The leading arm is the same base case as {@link CondOkBool}'s.
518
452
  */
519
- type CondParams<Env extends EnvShape, C> = [AnyTreeChild] extends [C] ? never : C extends Cmp<infer Op, infer L, infer R, infer M> ? Op extends "eq" | "ne" ? EqParams<Env, L, R> : Op extends "lt" | "le" | "gt" | "ge" ? OrderSideParams<L> | OrderSideParams<R> : Op extends "pointIn" ? IntervalSideParams<L> | OrderSideParams<R> : Op extends "allen" ? IntervalSideParams<L> | IntervalSideParams<R> | MaskParams<M> : never : C extends Tree<infer Ch extends readonly AnyTreeChild[]> ? CondParams<Env, Ch[number]> : C extends NotAtom<infer R extends MatchOwner, infer B> ? BindParams<MatchFields<R>, B> : never;
453
+ type CondParams<C> = [AnyTreeChild] extends [C] ? never : C extends Cmp<infer Op, infer L, infer R, infer M> ? Op extends "eq" | "ne" ? EqParams<L, R> : Op extends "lt" | "le" | "gt" | "ge" ? OrderSideParams<L> | OrderSideParams<R> : Op extends "pointIn" ? IntervalSideParams<L> | OrderSideParams<R> : Op extends "allen" ? IntervalSideParams<L> | IntervalSideParams<R> | MaskParams<M> : never : C extends Tree<infer Ch extends readonly AnyTreeChild[]> ? CondParams<Ch[number]> : C extends NotAtom<infer R extends MatchOwner, infer B> ? BindParams<MatchFields<R>, B> : never;
520
454
  /** The flattened params record one bindings record contributes. */
521
455
  type BindParamsShape<F extends FieldsShape, B> = ShapeOf<BindParams<F, B>>;
522
456
  /** The flattened params record one condition contributes. */
523
- type CondParamsShape<Env extends EnvShape, C> = ShapeOf<CondParams<Env, C>>;
524
- export type { AggData, AnyCmp, AnyCond, AnyNotAtom, AnyTreeChild, AtomData, BindEnv, BindingEntry, BindingInput, BindingTermData, BindParams, BindParamsShape, CheckBindings, CheckCond, Cmp, CmpData, CmpKind, CmpTermData, CondData, CondOkBool, CondParams, CondParamsShape, IntervalSide, IntervalVarOk, MaskData, MatchFields, MatchOwner, MatchShape, NotAtom, OrderSide, OrderVarOk, ParamUse, PointSide, RecData, RuleData, RuleItem, SelectColumn, SelectEntryData, Tree, TreeData };
525
- export { ALLEN, allen, and, comparison, covers, eq, ge, gt, le, lt, ne, not, or, pointIn };
457
+ type CondParamsShape<C> = ShapeOf<CondParams<C>>;
458
+ export type { AggData, AnyCmp, AnyCond, AnyNotAtom, AnyTreeChild, AtomData, BindingEntry, BindingInput, BindingTermData, BindParams, BindParamsShape, CheckBindings, CheckCond, Cmp, CmpData, CmpKind, CmpTermData, CondData, CondOkBool, CondParams, CondParamsShape, FindColumn, FindEntryData, IntervalSide, IntervalVarOk, MaskData, MatchFields, MatchOwner, MatchShape, NotAtom, OrderSide, OrderVarOk, ParamUse, PointSide, RecData, RuleData, RuleItem, SlotAt, Tree, TreeData };
459
+ export { ALLEN, ALLEN_ALL_BITS, allen, and, comparison, eq, ge, gt, le, lt, ne, not, or, pointIn };
526
460
  //# sourceMappingURL=atom.d.ts.map