@bjornpagen/bumbledb 0.1.0 → 0.2.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 +1394 -0
  2. package/README.md +4 -0
  3. package/dist/closed.d.ts +60 -37
  4. package/dist/closed.d.ts.map +1 -1
  5. package/dist/closed.js +159 -40
  6. package/dist/closed.js.map +1 -1
  7. package/dist/count.d.ts +64 -17
  8. package/dist/count.d.ts.map +1 -1
  9. package/dist/count.js +37 -14
  10. package/dist/count.js.map +1 -1
  11. package/dist/db.d.ts +15 -7
  12. package/dist/db.d.ts.map +1 -1
  13. package/dist/db.js +13 -5
  14. package/dist/db.js.map +1 -1
  15. package/dist/exhume.d.ts +12 -11
  16. package/dist/exhume.d.ts.map +1 -1
  17. package/dist/exhume.js +7 -6
  18. package/dist/exhume.js.map +1 -1
  19. package/dist/face.d.ts +79 -19
  20. package/dist/face.d.ts.map +1 -1
  21. package/dist/face.js +14 -15
  22. package/dist/face.js.map +1 -1
  23. package/dist/fields.d.ts +158 -129
  24. package/dist/fields.d.ts.map +1 -1
  25. package/dist/fields.js +80 -81
  26. package/dist/fields.js.map +1 -1
  27. package/dist/index.d.ts +21 -21
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +13 -12
  30. package/dist/index.js.map +1 -1
  31. package/dist/lower.d.ts +6 -3
  32. package/dist/lower.d.ts.map +1 -1
  33. package/dist/lower.js +48 -17
  34. package/dist/lower.js.map +1 -1
  35. package/dist/marshal.d.ts +36 -21
  36. package/dist/marshal.d.ts.map +1 -1
  37. package/dist/marshal.js +41 -25
  38. package/dist/marshal.js.map +1 -1
  39. package/dist/native.js +2 -2
  40. package/dist/query/atom.d.ts +332 -174
  41. package/dist/query/atom.d.ts.map +1 -1
  42. package/dist/query/atom.js +72 -172
  43. package/dist/query/atom.js.map +1 -1
  44. package/dist/query/lower.d.ts +295 -107
  45. package/dist/query/lower.d.ts.map +1 -1
  46. package/dist/query/lower.js +860 -388
  47. package/dist/query/lower.js.map +1 -1
  48. package/dist/query/predicate.d.ts +69 -88
  49. package/dist/query/predicate.d.ts.map +1 -1
  50. package/dist/query/predicate.js +118 -72
  51. package/dist/query/predicate.js.map +1 -1
  52. package/dist/query/run.d.ts +19 -16
  53. package/dist/query/run.d.ts.map +1 -1
  54. package/dist/query/run.js +31 -24
  55. package/dist/query/run.js.map +1 -1
  56. package/dist/query/scope.d.ts +139 -123
  57. package/dist/query/scope.d.ts.map +1 -1
  58. package/dist/query/scope.js +71 -115
  59. package/dist/query/scope.js.map +1 -1
  60. package/dist/query/select.d.ts +102 -80
  61. package/dist/query/select.d.ts.map +1 -1
  62. package/dist/query/select.js +39 -34
  63. package/dist/query/select.js.map +1 -1
  64. package/dist/relation.d.ts +33 -36
  65. package/dist/relation.d.ts.map +1 -1
  66. package/dist/relation.js +15 -16
  67. package/dist/relation.js.map +1 -1
  68. package/dist/schema.d.ts.map +1 -1
  69. package/dist/schema.js +19 -8
  70. package/dist/schema.js.map +1 -1
  71. package/dist/spec.d.ts +6 -5
  72. package/dist/spec.d.ts.map +1 -1
  73. package/dist/spec.js.map +1 -1
  74. package/dist/statements.d.ts +56 -31
  75. package/dist/statements.d.ts.map +1 -1
  76. package/dist/statements.js +38 -13
  77. package/dist/statements.js.map +1 -1
  78. package/package.json +4 -3
  79. package/src/closed.ts +271 -93
  80. package/src/count.ts +112 -18
  81. package/src/db.ts +22 -12
  82. package/src/exhume.ts +12 -11
  83. package/src/face.ts +114 -22
  84. package/src/fields.ts +261 -217
  85. package/src/index.ts +50 -59
  86. package/src/lower.ts +62 -20
  87. package/src/marshal.ts +48 -30
  88. package/src/native.ts +2 -2
  89. package/src/query/atom.ts +480 -376
  90. package/src/query/lower.ts +1341 -542
  91. package/src/query/predicate.ts +198 -161
  92. package/src/query/run.ts +35 -25
  93. package/src/query/scope.ts +188 -218
  94. package/src/query/select.ts +168 -93
  95. package/src/relation.ts +38 -44
  96. package/src/schema.ts +22 -12
  97. package/src/spec.ts +6 -5
  98. package/src/statements.ts +69 -26
  99. package/dist/brand.d.ts +0 -59
  100. package/dist/brand.d.ts.map +0 -1
  101. package/dist/brand.js +0 -47
  102. package/dist/brand.js.map +0 -1
  103. package/src/brand.ts +0 -82
@@ -1,29 +1,32 @@
1
1
  /**
2
- * Prepared-query marshaling seams (PRD-08), the two rides every execution
3
- * takes — the typed params object down to the bridge's positional
4
- * `QueryParam[]` (declaration order = dense `ParamId`s, values tagged by
5
- * each param's declaring field), and answer rows (positional, head order)
6
- * back up to plain objects with branded values (the store is the proof
7
- * carrier: the engine computed the answer, so readback asserts the brand,
8
- * the same trust direction as fact readback in `#marshal.ts`). Answers are
9
- * SETS no order or limit exists anywhere; hosts sort. The `Prepared`
10
- * VALUE itself (no lifecycle, GC-reclaimed plan) lives in `#db.ts`.
2
+ * Prepared-query marshaling seams, the two rides every execution takes —
3
+ * the typed params object down to the bridge's positional `QueryParam[]`
4
+ * (registry order = dense `ParamId`s, values tagged by each param's
5
+ * ANCHORING use: the field position or comparison sibling that typed it,
6
+ * op-aware exactly as comparison literals tag), and answer rows
7
+ * (positional, head order) back up to plain objects of BARE structural
8
+ * values — the marshal boundary is pure both ways: the engine computed
9
+ * the answer under the prepared head, so a decoded row that carries every
10
+ * select column IS a row (the trusted read seam), and nothing is asserted
11
+ * on any value. Answers are SETS — no order or limit exists anywhere;
12
+ * hosts sort. The `Prepared` VALUE itself (no lifecycle, GC-reclaimed
13
+ * plan) lives in `#db.ts`.
11
14
  */
12
15
  import type { FactValue, QueryParam } from "#native.ts";
13
- import type { SelectColumn } from "#query/lower.ts";
16
+ import type { SelectColumn } from "#query/atom.ts";
14
17
  import type { ParamEntry } from "#query/scope.ts";
15
18
  /**
16
19
  * Marshals the typed params object to the bridge's positional arguments,
17
- * in param declaration order (= the lowering's dense `ParamId`s). A
18
- * missing entry is a typed error naming the param; values tag by the
19
- * declaring field's structural type; a set param takes a readonly array
20
- * (the empty set is legal and matches nothing — the engine's rule).
20
+ * in registry order (= the lowering's dense `ParamId`s). A missing entry
21
+ * is a typed error naming the param; values tag by the anchoring use's
22
+ * structural type; a set param takes a readonly array (the empty set is
23
+ * legal and matches nothing — the engine's rule).
21
24
  */
22
25
  declare function wireParams(entries: readonly ParamEntry[], supplied: Readonly<Record<string, unknown>>): QueryParam[];
23
26
  /**
24
27
  * Decodes positional answer rows (column order = the program's head order
25
- * = the select record's written order) to named, branded, frozen row
26
- * objects.
28
+ * = the select's written order) to named, frozen row objects of bare
29
+ * structural values.
27
30
  */
28
31
  declare function decodeAnswers<Row>(select: readonly SelectColumn[], rows: FactValue[][]): Row[];
29
32
  export { decodeAnswers, wireParams };
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/query/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAe,MAAM,YAAY,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAajD;;;;;;GAMG;AACH,iBAAS,UAAU,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,UAAU,EAAE,CA0B7G;AAiBD;;;;GAIG;AACH,iBAAS,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,GAAG,GAAG,EAAE,CAmBvF;AAED,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,CAAA"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/query/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAe,MAAM,YAAY,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAuBjD;;;;;;GAMG;AACH,iBAAS,UAAU,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,UAAU,EAAE,CAsB7G;AAkBD;;;;GAIG;AACH,iBAAS,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,GAAG,GAAG,EAAE,CAmBvF;AAED,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,CAAA"}
package/dist/query/run.js CHANGED
@@ -1,16 +1,19 @@
1
1
  /**
2
- * Prepared-query marshaling seams (PRD-08), the two rides every execution
3
- * takes — the typed params object down to the bridge's positional
4
- * `QueryParam[]` (declaration order = dense `ParamId`s, values tagged by
5
- * each param's declaring field), and answer rows (positional, head order)
6
- * back up to plain objects with branded values (the store is the proof
7
- * carrier: the engine computed the answer, so readback asserts the brand,
8
- * the same trust direction as fact readback in `#marshal.ts`). Answers are
9
- * SETS no order or limit exists anywhere; hosts sort. The `Prepared`
10
- * VALUE itself (no lifecycle, GC-reclaimed plan) lives in `#db.ts`.
2
+ * Prepared-query marshaling seams, the two rides every execution takes —
3
+ * the typed params object down to the bridge's positional `QueryParam[]`
4
+ * (registry order = dense `ParamId`s, values tagged by each param's
5
+ * ANCHORING use: the field position or comparison sibling that typed it,
6
+ * op-aware exactly as comparison literals tag), and answer rows
7
+ * (positional, head order) back up to plain objects of BARE structural
8
+ * values — the marshal boundary is pure both ways: the engine computed
9
+ * the answer under the prepared head, so a decoded row that carries every
10
+ * select column IS a row (the trusted read seam), and nothing is asserted
11
+ * on any value. Answers are SETS — no order or limit exists anywhere;
12
+ * hosts sort. The `Prepared` VALUE itself (no lifecycle, GC-reclaimed
13
+ * plan) lives in `#db.ts`.
11
14
  */
12
15
  import * as errors from "@superbuilders/errors";
13
- import { taggedLiteral } from "#query/lower.ts";
16
+ import { taggedCmpLiteral } from "#query/lower.ts";
14
17
  /** The 13-bit Allen mask ceiling (`bumbledb/crates/bumbledb/src/allen.rs`: bits above the low 13 are unrepresentable). */
15
18
  const ALLEN_ALL_BITS = (1 << 13) - 1;
16
19
  /** Tags one supplied mask-param value. */
@@ -20,12 +23,19 @@ function wireMask(name, value) {
20
23
  }
21
24
  return { kind: "allenMask", mask: value };
22
25
  }
26
+ /** Tags one supplied value-param cell by its anchoring use. */
27
+ function wireValue(entry, context, value) {
28
+ if (entry.anchor === undefined) {
29
+ throw errors.new(`param ${entry.name} has no field-anchored use — bind it in an atom or compare it against a bound variable`);
30
+ }
31
+ return taggedCmpLiteral(context, entry.anchor, value, entry.op);
32
+ }
23
33
  /**
24
34
  * Marshals the typed params object to the bridge's positional arguments,
25
- * in param declaration order (= the lowering's dense `ParamId`s). A
26
- * missing entry is a typed error naming the param; values tag by the
27
- * declaring field's structural type; a set param takes a readonly array
28
- * (the empty set is legal and matches nothing — the engine's rule).
35
+ * in registry order (= the lowering's dense `ParamId`s). A missing entry
36
+ * is a typed error naming the param; values tag by the anchoring use's
37
+ * structural type; a set param takes a readonly array (the empty set is
38
+ * legal and matches nothing — the engine's rule).
29
39
  */
30
40
  function wireParams(entries, supplied) {
31
41
  return entries.map(function wireOne(entry) {
@@ -36,29 +46,26 @@ function wireParams(entries, supplied) {
36
46
  if (entry.shape === "mask") {
37
47
  return wireMask(entry.name, value);
38
48
  }
39
- if (entry.data === undefined) {
40
- throw errors.new(`param ${entry.name}: registry entry carries no declaring field`);
41
- }
42
49
  if (entry.shape === "set") {
43
50
  if (!Array.isArray(value)) {
44
51
  throw errors.new(`param ${entry.name}: a set param binds a readonly array of values`);
45
52
  }
46
- const data = entry.data;
47
53
  return {
48
54
  kind: "set",
49
55
  values: value.map(function wireElement(element, index) {
50
- return taggedLiteral(`param ${entry.name}[${index}]`, data, element);
56
+ return wireValue(entry, `param ${entry.name}[${index}]`, element);
51
57
  })
52
58
  };
53
59
  }
54
- return taggedLiteral(`param ${entry.name}`, entry.data, value);
60
+ return wireValue(entry, `param ${entry.name}`, value);
55
61
  });
56
62
  }
57
63
  /**
58
64
  * The read-side trusted seam of answers: a decoded row carrying every
59
65
  * select column IS a `Row` — the engine computed it under the prepared
60
- * head, so the brands are asserted, not re-derived (the `#marshal.ts`
61
- * trust direction).
66
+ * head, and the values are BARE structural values, so nothing is asserted
67
+ * beyond presence (the store is the proof carrier; no brand exists to
68
+ * re-derive).
62
69
  */
63
70
  function isAnswerRow(select, decoded) {
64
71
  return select.every(function present(column) {
@@ -67,8 +74,8 @@ function isAnswerRow(select, decoded) {
67
74
  }
68
75
  /**
69
76
  * Decodes positional answer rows (column order = the program's head order
70
- * = the select record's written order) to named, branded, frozen row
71
- * objects.
77
+ * = the select's written order) to named, frozen row objects of bare
78
+ * structural values.
72
79
  */
73
80
  function decodeAnswers(select, rows) {
74
81
  return rows.map(function decodeRow(row) {
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/query/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAG/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,0HAA0H;AAC1H,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;AAEpC,0CAA0C;AAC1C,SAAS,QAAQ,CAAC,IAAY,EAAE,KAAc;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,cAAc,EAAE,CAAC;QAClG,MAAM,MAAM,CAAC,GAAG,CAAC,SAAS,IA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AI,CAAC,GAAG,CAAC,SAAS,SAAS,CAAC,GAAG;QACrC,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC;YAClC,MAAM,MAAM,CAAC,GAAG,CAAC,sBAAsB,GAAG,CAAC,MAAM,uBAAuB,MAAM,CAAC,MAAM,iBAAiB,CAAC,CAAA;QACxG,CAAC;QACD,MAAM,OAAO,GAA8B,EAAE,CAAA;QAC7C,MAAM,CAAC,OAAO,CAAC,SAAS,UAAU,CAAC,MAAM,EAAE,OAAO;YACjD,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,CAAA;YACzB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACxB,MAAM,MAAM,CAAC,GAAG,CAAC,qBAAqB,OAAO,KAAK,MAAM,CAAC,IAAI,aAAa,CAAC,CAAA;YAC5E,CAAC;YACD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;QAC5B,CAAC,CAAC,CAAA;QACF,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QACtB,IAAI,CAAC,WAAW,CAAM,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;YACxC,MAAM,MAAM,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAA;QACrE,CAAC;QACD,OAAO,OAAO,CAAA;IACf,CAAC,CAAC,CAAA;AACH,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,CAAA"}
@@ -1,87 +1,109 @@
1
1
  /**
2
- * Query scope terms (PRD-08): typed variables and parameters, declared
3
- * inside a `query()` scope callback so identity is lexical. A `Var` is
4
- * typed by the field it is declared from and joins are brand-equal by
5
- * construction (the nominal join discipline); var identity is OBJECT
6
- * identity two `$.var` calls are two variables even from the same field,
7
- * and no name-collision machinery exists. Params are query-global, carry a
8
- * mandatory literal name (the key of `execute`'s params object), and lower
9
- * to dense positional `ParamId`s in declaration order. This module also
10
- * owns the type-level params extraction: every atom and condition value
11
- * carries its contributed params object in a phantom, and the query's
12
- * `Params` type is the flattened intersection over the returned rules
13
- * inference rides the return value, never a mutable type accumulator.
2
+ * Query scope terms, STRUCTURAL edition: string-named variables and
3
+ * parameters as plain frozen values. A `Var` is a NAME it is typed by the
4
+ * field it first binds (structurally, off the schema type, through the rule
5
+ * builder's environment), reuse of the name within one rule IS the join,
6
+ * and a domain-mismatched reuse is a compile error (the structural analog
7
+ * of the old brand-equal join now domain-equal, no value brands
8
+ * anywhere). Params are query-global by name and typed BY USE: the field
9
+ * position or comparison sibling that anchors a param types it, the
10
+ * query's inferred `Params` object is exactly the params the rules use,
11
+ * and a param value that no rule uses simply never registers — the query
12
+ * executes under its own inferred type (the bug-hunt law). This module
13
+ * also owns the environment/typing utilities the whole surface shares:
14
+ * the env shape (var name → field descriptor), the domain-equality
15
+ * judgment, and the record-folding helpers `Params` and `Row` inference
16
+ * ride.
14
17
  */
15
- import { phantom } from "#brand.ts";
16
- import type { FieldData } from "#fields.ts";
17
- import type { PredicateData } from "#query/predicate.ts";
18
- import type { AnySchema } from "#schema.ts";
18
+ import type { AnyField, Infer } from "#fields.ts";
19
19
  /**
20
20
  * The runtime discriminant of query term values. Host literals (bigints,
21
- * strings, interval objects, `oneOf` sets) never carry it, so "is this
22
- * binding a term or a literal" is one property probe, never a guess.
21
+ * strings, interval objects) never carry it, so "is this position a term
22
+ * or a literal" is one property probe, never a guess.
23
23
  */
24
24
  declare const term: unique symbol;
25
25
  /**
26
- * A query variable, typed by the field it was declared from
27
- * (`$.var(Holder.fields.id)` `Var<Brand<bigint, "HolderId">>`). Usable in
28
- * any atom position whose field carries the same brand; a brand-mismatched
29
- * placement is a TYPE error. Identity is object identity.
26
+ * The carrier of a value's INFERRED types (a rule's row/params, a query's
27
+ * row/params, a rec's params). The property is never present at runtime —
28
+ * it exists so inference rides plain values without any brand on any
29
+ * field value.
30
30
  */
31
- interface Var<V> {
31
+ declare const inferred: unique symbol;
32
+ /**
33
+ * A query variable — a NAME. Its type comes from the field it first binds
34
+ * in the rule (the builder's environment); reusing the name joins, and a
35
+ * cross-domain reuse is a compile error. Identity is the name, strictly
36
+ * rule-scoped: the same name in two rules names two unrelated variables
37
+ * (exactly as the IR scopes `VarId`).
38
+ */
39
+ interface Var<Name extends string = string> {
32
40
  readonly [term]: "var";
33
- readonly relation: string;
34
- readonly field: string;
35
- readonly data: FieldData;
36
- readonly [phantom]?: V;
41
+ readonly name: Name;
37
42
  }
38
43
  /**
39
- * A scalar query parameter — `$.param("root", Holder.fields.id)`. The name
40
- * literal is the key of the typed params object `execute` takes; the value
41
- * is marshaled by the declaring field's structural type at bind.
44
+ * A scalar query parameter — `r.param("root")`. The name is the key of the
45
+ * typed params object `execute` takes; the type is the element type of the
46
+ * position that anchors it (a field binding, or the bound-variable side of
47
+ * a comparison).
42
48
  */
43
- interface Param<Name extends string, V> {
49
+ interface Param<Name extends string = string> {
44
50
  readonly [term]: "param";
45
51
  readonly name: Name;
46
- readonly relation: string;
47
- readonly field: string;
48
- readonly data: FieldData;
49
- readonly [phantom]?: V;
50
52
  }
51
53
  /**
52
- * A set-valued query parameter (the IR's `ParamSet` term): bound at
53
- * execution to an ARRAY of values of the declaring field's type; a binding
54
- * position matches iff the field value is in the set. Legal in atom
55
- * bindings (positive and negated) and as the right side of `is` — nowhere
56
- * else, exactly as the IR rules it.
54
+ * A set-valued query parameter (the IR's `ParamSet` term) `r.inSet("frontier")`:
55
+ * bound at execution to a readonly ARRAY of values of the anchoring field's
56
+ * type; a binding position matches iff the field value is in the set. Legal
57
+ * in atom bindings (positive and negated) and as the right side of `eq` —
58
+ * nowhere else, exactly as the IR rules it.
57
59
  */
58
- interface ParamSet<Name extends string, V> {
59
- readonly [term]: "paramSet";
60
+ interface SetParam<Name extends string = string> {
61
+ readonly [term]: "setParam";
60
62
  readonly name: Name;
61
- readonly relation: string;
62
- readonly field: string;
63
- readonly data: FieldData;
64
- readonly [phantom]?: V;
65
63
  }
66
64
  /**
67
- * An Allen-mask parameter (the IR's `MaskTerm::Param`): the temporal
68
- * relation as a bind-time argument one prepared query answers any of the
65
+ * An Allen-mask parameter (the IR's `MaskTerm::Param`) the temporal
66
+ * relation as a bind-time argument: one prepared query answers any of the
69
67
  * mask questions per execution. Bound to a 13-bit mask number built from
70
68
  * the `ALLEN` constants.
71
69
  */
72
- interface MaskParam<Name extends string> {
70
+ interface MaskParam<Name extends string = string> {
73
71
  readonly [term]: "maskParam";
74
72
  readonly name: Name;
75
73
  }
76
- /** Any query variable, whatever its brand. */
77
- type AnyVar = Var<unknown>;
78
- /** Any parameter term of the scope, whatever its name and brand. */
79
- type AnyParamTerm = Param<string, unknown> | ParamSet<string, unknown> | MaskParam<string>;
74
+ /**
75
+ * The measure of an interval-typed variable (`ir::Term::Measure`):
76
+ * `|[s, e)| = e s`, u64 legal as one side of an order comparison, as a
77
+ * select entry, and as the input of `sum`/`min`/`max`; every other position
78
+ * is unwritable, exactly as the IR rejects it typed. A ray has no finite
79
+ * measure — the engine's `MeasureOfRay` execution error; exclude rays first
80
+ * (`allen` against a bounded window).
81
+ */
82
+ interface Duration<Name extends string = string> {
83
+ readonly [term]: "duration";
84
+ readonly name: Name;
85
+ }
80
86
  /** Any scope term value. */
81
- type AnyTerm = AnyVar | AnyParamTerm;
82
- /** Narrows an unknown binding value to a scope term (vs a host literal). */
87
+ type AnyTerm = Var | Param | SetParam | MaskParam | Duration;
88
+ /** Narrows an unknown position value to a scope term (vs a host literal). */
83
89
  declare function isTerm(value: unknown): value is AnyTerm;
84
- /** A params object type — what `execute` takes and the phantoms carry. */
90
+ /** Builds one variable term. */
91
+ declare function makeVar<const Name extends string>(name: Name): Var<Name>;
92
+ /** Builds one scalar-parameter term. */
93
+ declare function makeParam<const Name extends string>(name: Name): Param<Name>;
94
+ /** Builds one set-parameter term. */
95
+ declare function makeSetParam<const Name extends string>(name: Name): SetParam<Name>;
96
+ /** Builds one Allen-mask-parameter term. */
97
+ declare function makeMaskParam<const Name extends string>(name: Name): MaskParam<Name>;
98
+ /** Builds one measure term over an interval-typed variable's name. */
99
+ declare function makeDuration<const Name extends string>(name: Name): Duration<Name>;
100
+ /**
101
+ * A rule's typing environment: variable name → the field descriptor it
102
+ * first bound. Purely a TYPE — the runtime twin is the rule's `varFields`
103
+ * record, and the two are built by the same walk.
104
+ */
105
+ type EnvShape = Record<string, AnyField>;
106
+ /** A params object type — what `execute` takes and inference carries. */
85
107
  type ParamsRecord = Readonly<Record<string, unknown>>;
86
108
  /** Flattens an intersection into one displayed object type (hover legibility). */
87
109
  type Flatten<T> = {
@@ -90,79 +112,73 @@ type Flatten<T> = {
90
112
  /** The standard union-to-intersection fold (distributes over `U`). */
91
113
  type UnionToIntersection<U> = (U extends unknown ? (member: U) => void : never) extends (member: infer I) => void ? I : never;
92
114
  /**
93
- * One term's contribution to the query's params object type: a `Param`
94
- * contributes its value type under its name, a `ParamSet` the readonly
95
- * array of it, a `MaskParam` a mask number; everything else contributes
96
- * nothing.
115
+ * Folds a union of per-position record fragments into one flattened record
116
+ * (the machinery both `Params` and `Row` inference ride).
97
117
  */
98
- type TermContribution<T> = T extends {
99
- readonly [term]: "param";
100
- readonly name: infer N extends string;
101
- readonly [phantom]?: infer V;
102
- } ? {
103
- readonly [K in N]: Exclude<V, undefined>;
104
- } : T extends {
105
- readonly [term]: "paramSet";
106
- readonly name: infer N extends string;
107
- readonly [phantom]?: infer V;
108
- } ? {
109
- readonly [K in N]: readonly Exclude<V, undefined>[];
110
- } : T extends {
111
- readonly [term]: "maskParam";
112
- readonly name: infer N extends string;
113
- } ? {
114
- readonly [K in N]: number;
115
- } : Record<never, never>;
118
+ type ShapeOf<U> = [U] extends [never] ? Record<never, never> : Flatten<UnionToIntersection<U>>;
119
+ /** Reads a field descriptor's domain label (S1: the label IS the domain check). */
120
+ type DomainOf<F extends AnyField> = F["domain"];
121
+ /** Reads a field descriptor's width label (`bytes<N>`, `interval<E, W>`); `undefined` when the kind carries none. */
122
+ type WidthOf<F extends AnyField> = F extends {
123
+ readonly width: infer W;
124
+ } ? W : undefined;
125
+ /** Reads an interval descriptor's element kind; `undefined` on scalar kinds. */
126
+ type ElementOf<F extends AnyField> = F extends {
127
+ readonly element: infer E;
128
+ } ? E : undefined;
116
129
  /**
117
- * Folds a union of per-term/per-item params objects into the one flattened
118
- * params record (the query's `Params` type).
130
+ * The structural join judgment: two field descriptors join iff kind,
131
+ * domain label, width label, and interval element all agree — the
132
+ * string-literal comparison of descriptor shapes that replaced the value
133
+ * brand (design ruling 3).
119
134
  */
120
- type ParamsShape<U> = [U] extends [never] ? Record<never, never> : Flatten<UnionToIntersection<U>>;
121
- /** Reads an atom's/condition's contributed params object off its phantom. */
122
- type ItemParams<T> = T extends {
123
- readonly [phantom]?: infer P;
124
- } ? Exclude<P, undefined> : Record<never, never>;
125
- /** One registered parameter: name, wire shape, and the declaring field. */
126
- interface ParamEntry {
127
- readonly name: string;
128
- readonly shape: "value" | "set" | "mask";
129
- readonly data: FieldData | undefined;
130
- }
135
+ type JoinOk<A extends AnyField, B extends AnyField> = [A["kind"], DomainOf<A>, WidthOf<A>, ElementOf<A>] extends [
136
+ B["kind"],
137
+ DomainOf<B>,
138
+ WidthOf<B>,
139
+ ElementOf<B>
140
+ ] ? [B["kind"], DomainOf<B>, WidthOf<B>, ElementOf<B>] extends [A["kind"], DomainOf<A>, WidthOf<A>, ElementOf<A>] ? true : false : false;
131
141
  /**
132
- * The mutable build-time registry one `query()` scope owns: declared vars
133
- * (membership polices cross-scope smuggling), params in declaration order
134
- * (= dense `ParamId`s), and declared predicates in declaration order
135
- * (= dense `PredId`s; the output predicate is appended by lowering).
142
+ * The runtime twin of {@link JoinOk}: two field descriptors join iff kind,
143
+ * domain label, width label, and interval element all agree — the same
144
+ * structural comparison the type tier makes, judged on the descriptor
145
+ * VALUES (S1 descriptors are honest at runtime). The rule builders throw
146
+ * through this on a domain-unequal variable reuse, so the wall holds for
147
+ * untyped callers too, not only where the compiler can see.
136
148
  */
137
- interface QueryRegistry {
138
- readonly theory: AnySchema;
139
- readonly vars: Set<AnyVar>;
140
- readonly params: ParamEntry[];
141
- readonly paramIndex: Map<AnyTerm, number>;
142
- readonly predicates: PredicateData[];
143
- }
144
- /** Creates one empty scope registry over the query's theory. */
145
- declare function createRegistry(theory: AnySchema): QueryRegistry;
149
+ declare function fieldJoins(a: AnyField, b: AnyField): boolean;
150
+ /**
151
+ * Renders one field descriptor for join-mismatch diagnostics — the schema
152
+ * grammar's own spelling (`u64 as HolderId`, `interval<i64, 7> as Window`).
153
+ */
154
+ declare function renderFieldKind(field: AnyField): string;
146
155
  /**
147
- * Resolves a field reference's runtime description through the schema —
148
- * the seam that types `$.var`/`$.param` declarations at runtime (the type
149
- * level already carries the brand; this recovers the structural type the
150
- * lowering and the param marshaler direct by).
156
+ * What a PARAM anchored at field `F` accepts at execution: the field's
157
+ * bare value type, exactly. At an interval field the engine resolves the
158
+ * bivalent anchor to the INTERVAL reading (value equality) the point
159
+ * reading of a param is spelled `pointIn(r.param(...), w)`, whose sibling
160
+ * anchors it element-typed.
151
161
  */
152
- declare function resolveFieldData(theory: AnySchema, relationName: string, fieldName: string): FieldData;
153
- /** A field reference's runtime half, as the scope factories consume it. */
154
- interface RefNames {
155
- readonly relation: string;
156
- readonly field: string;
162
+ type ParamValueAt<F extends AnyField> = Infer<F>;
163
+ /** Reads a value's inferred-types carrier (rules, queries, recs). */
164
+ type InferredOf<T> = T extends {
165
+ readonly [inferred]?: infer S;
166
+ } ? Exclude<S, undefined> : never;
167
+ /**
168
+ * One registered parameter of a query, as the wire marshal reads it: the
169
+ * name, the wire shape, the field descriptor (or the measure) that anchored
170
+ * it, and the comparison op the anchor came from (`"binding"` for atom
171
+ * positions) — the op keeps literal tagging op-aware at `pointIn`
172
+ * (the bug-hunt fix, preserved). `anchor` is `undefined` only on a query
173
+ * built but not yet anchored by any rule; lowering and the wire both refuse
174
+ * that state typed.
175
+ */
176
+ interface ParamEntry {
177
+ readonly name: string;
178
+ readonly shape: "value" | "set" | "mask";
179
+ readonly anchor: AnyField | "measure" | undefined;
180
+ readonly op: "binding" | "eq" | "ne" | "lt" | "le" | "gt" | "ge" | "pointIn" | "allen";
157
181
  }
158
- /** Declares one variable in the scope (the `$.var` implementation). */
159
- declare function scopeVar<V>(registry: QueryRegistry, ref: RefNames): Var<V>;
160
- /** Declares one scalar parameter (the `$.param` implementation). */
161
- declare function scopeParam<Name extends string, V>(registry: QueryRegistry, name: Name, ref: RefNames): Param<Name, V>;
162
- /** Declares one set parameter (the `$.paramSet` implementation). */
163
- declare function scopeParamSet<Name extends string, V>(registry: QueryRegistry, name: Name, ref: RefNames): ParamSet<Name, V>;
164
- /** Declares one Allen-mask parameter (the `$.allenParam` implementation). */
165
- declare function scopeAllenParam<Name extends string>(registry: QueryRegistry, name: Name): MaskParam<Name>;
166
- export type { AnyParamTerm, AnyTerm, AnyVar, Flatten, ItemParams, MaskParam, Param, ParamEntry, ParamSet, ParamsRecord, ParamsShape, QueryRegistry, TermContribution, UnionToIntersection, Var };
167
- export { createRegistry, isTerm, resolveFieldData, scopeAllenParam, scopeParam, scopeParamSet, scopeVar, term };
182
+ export type { AnyTerm, DomainOf, Duration, EnvShape, Flatten, InferredOf, JoinOk, MaskParam, Param, ParamEntry, ParamsRecord, ParamValueAt, SetParam, ShapeOf, UnionToIntersection, Var };
183
+ export { fieldJoins, inferred, isTerm, makeDuration, makeMaskParam, makeParam, makeSetParam, makeVar, renderFieldKind, term };
168
184
  //# sourceMappingURL=scope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/query/scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,YAA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