@bjornpagen/bumbledb 0.1.0 → 0.3.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 (112) hide show
  1. package/COOKBOOK.md +1450 -0
  2. package/README.md +69 -30
  3. package/dist/closed.d.ts +157 -38
  4. package/dist/closed.d.ts.map +1 -1
  5. package/dist/closed.js +232 -47
  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 +27 -8
  12. package/dist/db.d.ts.map +1 -1
  13. package/dist/db.js +33 -10
  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 +135 -30
  20. package/dist/face.d.ts.map +1 -1
  21. package/dist/face.js +44 -19
  22. package/dist/face.js.map +1 -1
  23. package/dist/fields.d.ts +130 -130
  24. package/dist/fields.d.ts.map +1 -1
  25. package/dist/fields.js +60 -94
  26. package/dist/fields.js.map +1 -1
  27. package/dist/index.d.ts +29 -24
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +19 -14
  30. package/dist/index.js.map +1 -1
  31. package/dist/law.d.ts +224 -0
  32. package/dist/law.d.ts.map +1 -0
  33. package/dist/law.js +224 -0
  34. package/dist/law.js.map +1 -0
  35. package/dist/lower.d.ts +17 -7
  36. package/dist/lower.d.ts.map +1 -1
  37. package/dist/lower.js +66 -24
  38. package/dist/lower.js.map +1 -1
  39. package/dist/marshal.d.ts +36 -21
  40. package/dist/marshal.d.ts.map +1 -1
  41. package/dist/marshal.js +41 -25
  42. package/dist/marshal.js.map +1 -1
  43. package/dist/native.d.ts +6 -2
  44. package/dist/native.d.ts.map +1 -1
  45. package/dist/native.js +2 -2
  46. package/dist/native.js.map +1 -1
  47. package/dist/query/atom.d.ts +370 -174
  48. package/dist/query/atom.d.ts.map +1 -1
  49. package/dist/query/atom.js +75 -172
  50. package/dist/query/atom.js.map +1 -1
  51. package/dist/query/lower.d.ts +312 -109
  52. package/dist/query/lower.d.ts.map +1 -1
  53. package/dist/query/lower.js +906 -387
  54. package/dist/query/lower.js.map +1 -1
  55. package/dist/query/predicate.d.ts +70 -88
  56. package/dist/query/predicate.d.ts.map +1 -1
  57. package/dist/query/predicate.js +118 -72
  58. package/dist/query/predicate.js.map +1 -1
  59. package/dist/query/run.d.ts +19 -16
  60. package/dist/query/run.d.ts.map +1 -1
  61. package/dist/query/run.js +31 -24
  62. package/dist/query/run.js.map +1 -1
  63. package/dist/query/scope.d.ts +178 -127
  64. package/dist/query/scope.d.ts.map +1 -1
  65. package/dist/query/scope.js +111 -108
  66. package/dist/query/scope.js.map +1 -1
  67. package/dist/query/select.d.ts +102 -80
  68. package/dist/query/select.d.ts.map +1 -1
  69. package/dist/query/select.js +39 -34
  70. package/dist/query/select.js.map +1 -1
  71. package/dist/relation.d.ts +48 -38
  72. package/dist/relation.d.ts.map +1 -1
  73. package/dist/relation.js +24 -19
  74. package/dist/relation.js.map +1 -1
  75. package/dist/schema.d.ts +41 -3
  76. package/dist/schema.d.ts.map +1 -1
  77. package/dist/schema.js +34 -9
  78. package/dist/schema.js.map +1 -1
  79. package/dist/spec.d.ts +7 -5
  80. package/dist/spec.d.ts.map +1 -1
  81. package/dist/spec.js.map +1 -1
  82. package/dist/statements.d.ts +91 -36
  83. package/dist/statements.d.ts.map +1 -1
  84. package/dist/statements.js +42 -12
  85. package/dist/statements.js.map +1 -1
  86. package/package.json +4 -3
  87. package/src/closed.ts +448 -95
  88. package/src/count.ts +112 -18
  89. package/src/db.ts +45 -17
  90. package/src/exhume.ts +12 -11
  91. package/src/face.ts +211 -41
  92. package/src/fields.ts +199 -234
  93. package/src/index.ts +78 -61
  94. package/src/law.ts +519 -0
  95. package/src/lower.ts +82 -27
  96. package/src/marshal.ts +48 -30
  97. package/src/native.ts +8 -4
  98. package/src/query/atom.ts +525 -374
  99. package/src/query/lower.ts +1469 -538
  100. package/src/query/predicate.ts +208 -161
  101. package/src/query/run.ts +35 -25
  102. package/src/query/scope.ts +264 -218
  103. package/src/query/select.ts +168 -93
  104. package/src/relation.ts +47 -47
  105. package/src/schema.ts +69 -18
  106. package/src/spec.ts +7 -5
  107. package/src/statements.ts +124 -41
  108. package/dist/brand.d.ts +0 -59
  109. package/dist/brand.d.ts.map +0 -1
  110. package/dist/brand.js +0 -47
  111. package/dist/brand.js.map +0 -1
  112. package/src/brand.ts +0 -82
package/dist/fields.d.ts CHANGED
@@ -1,134 +1,139 @@
1
1
  /**
2
- * Field type constructors — the value half of the `schema!` field grammar
3
- * (`docs/architecture/70-api.md`): `bool`, `u64`, `i64`, `str`, `bytes(n)`,
4
- * `interval(u64|i64[, width])`, each a plain frozen value carrying its
5
- * structural type at runtime and its host value type in a phantom generic.
6
- * Newtypes are DECLARATION-FIRST, one spelling only (owner ruling
7
- * 2026-07-16): `const AccountId = u64.newtype("AccountId")` declares the
8
- * brand ONCE as a value that IS the field, paired with
9
- * `type AccountId = Infer<typeof AccountId>` for signatures; every field
10
- * position references the declared value (`holder: HolderId`). The macro's
11
- * refusals are reproduced representationally: `.newtype` exists only where
12
- * Rust's `as` is legal (u64, i64, bytes, intervals — never bool/str),
13
- * `.fresh` exists only on declared u64 newtypes (the macro demands `as
14
- * NewType` on fresh fields), and no field-level constraint vocabulary of
15
- * any kind exists — `unique`/`fk` are unwritable, not rejected.
2
+ * Field descriptors — the value half of the `schema!` field grammar
3
+ * (`docs/architecture/70-api.md`), MINIMAL edition: `bool`, `u64`, `i64`,
4
+ * `str`, `bytes(n)`, `interval(u64|i64[, width])`, each a plain frozen value
5
+ * that IS its own descriptor type `{ kind, width?, element?, fresh? }` —
6
+ * honest at runtime and in the type alike. A field's VALUE type is its bare
7
+ * structural type (`u64` `bigint`, `str` → `string`, `bytes(n)`
8
+ * `Uint8Array`, intervals `{ start, end }`): no brands, no phantoms, no
9
+ * minting casts. A descriptor carries STRUCTURE ONLY domains are never
10
+ * declared anywhere (the owner ruling: THE LAWS TYPE THE COLUMNS): a
11
+ * field's domain is COMPUTED by `schema()` from the statement list, where
12
+ * the dependencies themselves induce the equivalence classes. The macro's
13
+ * refusals are reproduced representationally: `.fresh` exists only on u64,
14
+ * and no field-level constraint vocabulary of any kind exists —
15
+ * `unique`/`fk` are unwritable, not rejected.
16
16
  */
17
- import type { Brand, Interval, IntervalValue } from "#brand.ts";
18
- import { phantom } from "#brand.ts";
19
- import type { LiteralSpec, ValueTypeSpec } from "#spec.ts";
17
+ import type { LiteralSpec } from "#spec.ts";
18
+ /**
19
+ * A half-open interval `[start, end)` as a plain value object — the ONE
20
+ * interval value type, whatever the field's element type or width label.
21
+ * The ray is representable (`end` = the element type's MAX_END); widths
22
+ * and signedness are NOT modeled on the value — they are descriptor-type
23
+ * labels the engine judges at the typed write boundary. Interval fields
24
+ * derive no order (the Rust refusal, `docs/architecture/10-data-model.md`),
25
+ * so no comparators exist on the value type.
26
+ */
27
+ interface IntervalValue {
28
+ readonly start: bigint;
29
+ readonly end: bigint;
30
+ }
31
+ /**
32
+ * Constructs an interval literal — the `start..end` spelling. Half-open
33
+ * and nonempty by construction: `start >= end` is a typed construction
34
+ * error (parse, don't validate — the same invariant Rust's
35
+ * `Interval::new` enforces at the host boundary). The value is bare and
36
+ * structural: it is assignable to any interval field.
37
+ */
38
+ declare function span(start: bigint, end: bigint): IntervalValue;
20
39
  /**
21
40
  * A closed relation's roster as seen from a referencing field: the handle
22
- * namespace `where()` selections and ground axioms resolve bare handles
23
- * through (the macro's own rule: a handle is legal exactly on a field whose
24
- * newtype is a closed relation's handle newtype).
41
+ * namespace `where()` selections and ground axioms resolve bare handle ids
42
+ * through (the macro's own rule: a handle is legal exactly on a field that
43
+ * references a closed relation).
25
44
  */
26
45
  interface ClosedRoster {
27
46
  readonly name: string;
28
47
  readonly handles: readonly string[];
29
48
  }
49
+ /** The `bool` field descriptor: value type `boolean`. No `.fresh` (macro parity). */
50
+ interface BoolField {
51
+ readonly kind: "bool";
52
+ }
53
+ /** The `str` field descriptor: value type `string`. No `.fresh` (macro parity). */
54
+ interface StrField {
55
+ readonly kind: "str";
56
+ }
30
57
  /**
31
- * One field's runtime description: structural type, host newtype name, the
32
- * `fresh` mint mark (`minted` the property name `fresh` is taken by the
33
- * builder surface), and the closed-relation reference when the field is a
34
- * closed relation's id type.
58
+ * A `fresh`-marked u64 field descriptor — `id: u64.fresh`. The mark is a
59
+ * structural label (`fresh: true`) in the descriptor type AND on the
60
+ * runtime value; it implies the key `R(field) -> R`, which the ENGINE
61
+ * materializes (`SchemaDescriptor::materialized_statements`), and it makes
62
+ * the field a GENERATOR — `schema()` names its equivalence class by the
63
+ * declaration coordinate (`"Account.id"`). Terminal: no builder property
64
+ * survives the mark.
35
65
  */
36
- interface FieldData<Minted extends boolean = boolean> {
37
- readonly type: ValueTypeSpec;
38
- readonly newtype: string | undefined;
39
- readonly minted: Minted;
40
- readonly closed: ClosedRoster | undefined;
66
+ interface FreshU64Field {
67
+ readonly kind: "u64";
68
+ readonly fresh: true;
41
69
  }
42
70
  /**
43
- * The base shape every field value shares: runtime data plus the phantom
44
- * host value type `V` (never present at runtime).
71
+ * The `u64` field descriptor. `.fresh` marks the field as engine-minted
72
+ * the property doubles as the mark itself: on an unmarked descriptor it
73
+ * holds the marked descriptor, on a marked one it IS the literal `true`
74
+ * (one structural property, read either way).
45
75
  */
46
- interface Field<V> {
47
- readonly data: FieldData;
48
- readonly [phantom]?: V;
49
- }
50
- /** Extracts a field value's host value type from its phantom. */
51
- type FieldValue<F> = F extends Field<infer V> ? V : never;
52
- /** Any field value, whatever its host value type. */
53
- type AnyField = Field<unknown>;
54
- /** The `bool` field: host type `boolean`. No `.newtype`, no `.fresh` (macro parity). */
55
- interface BoolField extends Field<boolean> {
56
- readonly data: FieldData<false>;
76
+ interface U64Field {
77
+ readonly kind: "u64";
78
+ readonly fresh: FreshU64Field;
57
79
  }
58
- /** The `str` field: host type `string`. No `.newtype`, no `.fresh` (macro parity). */
59
- interface StrField extends Field<string> {
60
- readonly data: FieldData<false>;
80
+ /** The `i64` field descriptor. Terminal: `.fresh` is legal on u64 only. */
81
+ interface I64Field {
82
+ readonly kind: "i64";
61
83
  }
62
84
  /**
63
- * A `fresh`-marked u64 newtype field `id: AccountId.fresh` (Rust: `id:
64
- * u64 as AccountId, fresh`). Terminal: the mark implies the key
65
- * `R(field) -> R`, which the ENGINE materializes
66
- * (`SchemaDescriptor::materialized_statements`); `schema()` rejects an
67
- * explicit duplicate of it (macro parity).
85
+ * A `bytes<N>` field descriptor. The width is a descriptor-type label
86
+ * (load-bearing: the engine enforces it at the write boundary) and the
87
+ * value type is bare `Uint8Array`. No order is derived no comparators
88
+ * exist on the value type (the engine refuses order on bytes).
68
89
  */
69
- interface FreshU64Newtype<Name extends string> extends Field<Brand<bigint, Name>> {
70
- readonly data: FieldData<true>;
90
+ interface BytesField<Width extends number = number> {
91
+ readonly kind: "bytes";
92
+ readonly width: Width;
71
93
  }
72
94
  /**
73
- * A declared u64 newtype — `const AccountId = u64.newtype("AccountId")`
74
- * (Rust: `u64 as AccountId`). The value IS the field: relation blocks
75
- * reference it (`holder: HolderId`). `.fresh` marks it as minted; the
76
- * property exists ONLY here (the macro demands `as NewType` on fresh
77
- * fields, so bare-u64 fresh is unwritable).
95
+ * An interval field descriptor — `interval(i64)` general (rays
96
+ * representable), `interval(u64, w)` the fixed-width family. Element and
97
+ * width are descriptor-type labels; the value type is always the bare
98
+ * {@link IntervalValue}.
78
99
  */
79
- interface U64Newtype<Name extends string> extends Field<Brand<bigint, Name>> {
80
- readonly data: FieldData<false>;
81
- readonly fresh: FreshU64Newtype<Name>;
82
- }
83
- /** The bare `u64` field; `.newtype(name)` declares a branded u64 newtype. */
84
- interface U64Field extends Field<bigint> {
85
- readonly data: FieldData<false>;
86
- newtype<const Name extends string>(name: Name): U64Newtype<Name>;
87
- }
88
- /** A declared i64 newtype. Terminal: `fresh` is legal on u64 only. */
89
- interface I64Newtype<Name extends string> extends Field<Brand<bigint, Name>> {
90
- readonly data: FieldData<false>;
91
- }
92
- /** The bare `i64` field; `.newtype(name)` declares a branded i64 newtype. */
93
- interface I64Field extends Field<bigint> {
94
- readonly data: FieldData<false>;
95
- newtype<const Name extends string>(name: Name): I64Newtype<Name>;
96
- }
97
- /** A declared `bytes<N>` newtype (no order derived — no comparators exist). */
98
- interface BytesNewtype<Name extends string> extends Field<Brand<Uint8Array, Name>> {
99
- readonly data: FieldData<false>;
100
- }
101
- /** A `bytes<N>` field; `.newtype(name)` declares a branded bytes newtype. */
102
- interface BytesField extends Field<Uint8Array> {
103
- readonly data: FieldData<false>;
104
- newtype<const Name extends string>(name: Name): BytesNewtype<Name>;
105
- }
106
- /** A declared interval newtype — Rust: `interval<i64> as ActiveDuring`. */
107
- interface IntervalNewtype<Name extends string> extends Field<Interval<Name>> {
108
- readonly data: FieldData<false>;
109
- }
110
- /** An interval field; `.newtype(name)` brands the whole `{ start, end }` object. */
111
- interface IntervalField extends Field<IntervalValue> {
112
- readonly data: FieldData<false>;
113
- newtype<const Name extends string>(name: Name): IntervalNewtype<Name>;
100
+ interface IntervalField<Element extends "u64" | "i64" = "u64" | "i64", Width extends bigint | undefined = bigint | undefined> {
101
+ readonly kind: "interval";
102
+ readonly element: Element;
103
+ readonly width: Width;
114
104
  }
115
105
  /**
116
- * The branded value type of a declared newtype the type half of the
117
- * declaration-first pairing (owner ruling 2026-07-16): `const AccountId =
118
- * u64.newtype("AccountId")` + `type AccountId = Infer<typeof AccountId>`.
119
- * Reads the phantom, so it works on any field value (a closed relation's
120
- * `id` field infers its handle brand the same way).
106
+ * A closed relation's reference field descriptor (`Kind.id`)a u64
107
+ * descriptor carrying the closed linkage: the roster resolves bare handle
108
+ * ids in selections and ground axioms, and `schema()` names the id's
109
+ * generator class `"Kind.id"`. Terminal: no `.fresh` a vocabulary's rows
110
+ * are ground axioms, never minted.
121
111
  */
122
- type Infer<F extends AnyField> = F extends Field<infer V> ? V : never;
112
+ interface ClosedIdField {
113
+ readonly kind: "u64";
114
+ readonly closed: ClosedRoster;
115
+ }
116
+ /** Any field descriptor, whatever its kind or marks. */
117
+ type AnyField = BoolField | StrField | U64Field | FreshU64Field | I64Field | BytesField | IntervalField | ClosedIdField;
123
118
  /**
124
- * A closed relation's id field constructor (`Kind.id`) a u64 field
125
- * pre-branded with the closed relation's handle newtype, for use in other
126
- * relations' field blocks (`kind: Kind.id`). Terminal: its newtype IS the
127
- * closed relation, so `.newtype` and `.fresh` do not exist.
119
+ * The bare structural VALUE type of a field descriptorthe one total
120
+ * definition every fact, result row, and query term reads: `bool`
121
+ * `boolean`, `str` `string`, `u64`/`i64` `bigint`, `bytes<N>`
122
+ * `Uint8Array`, intervals {@link IntervalValue}.
128
123
  */
129
- interface ClosedIdField<Name extends string> extends Field<Brand<bigint, Name>> {
130
- readonly data: FieldData<false>;
131
- }
124
+ type Infer<F extends AnyField> = F extends {
125
+ readonly kind: "bool";
126
+ } ? boolean : F extends {
127
+ readonly kind: "str";
128
+ } ? string : F extends {
129
+ readonly kind: "u64";
130
+ } ? bigint : F extends {
131
+ readonly kind: "i64";
132
+ } ? bigint : F extends {
133
+ readonly kind: "bytes";
134
+ } ? Uint8Array : F extends {
135
+ readonly kind: "interval";
136
+ } ? IntervalValue : never;
132
137
  /**
133
138
  * Rejects a declaration name that JavaScript would re-order. Declaration
134
139
  * order = ordinal ids is the law relations, columns, and schemas all lean
@@ -140,48 +145,43 @@ interface ClosedIdField<Name extends string> extends Field<Brand<bigint, Name>>
140
145
  * error.
141
146
  */
142
147
  declare function assertDeclarationOrderKey(where: string, name: string): void;
143
- /**
144
- * Builds one frozen {@link FieldData}. Internal seam shared by the field
145
- * constructors here and by `closed()` (which mints {@link ClosedIdField}
146
- * values against its own roster).
147
- */
148
- declare function fieldData<Minted extends boolean>(type: ValueTypeSpec, newtype: string | undefined, minted: Minted, closed: ClosedRoster | undefined): FieldData<Minted>;
149
- /** The one `u64` field constructor value. */
148
+ /** The one `u64` constructor value. */
150
149
  declare const u64: U64Field;
151
- /** The one `i64` field constructor value. */
150
+ /** The one `i64` constructor value. */
152
151
  declare const i64: I64Field;
153
- /** The one `bool` field constructor value. */
152
+ /** The one `bool` constructor value. */
154
153
  declare const bool: BoolField;
155
- /** The one `str` field constructor value. */
154
+ /** The one `str` constructor value. */
156
155
  declare const str: StrField;
157
156
  /**
158
- * The `bytes<N>` field constructor. The width is mandatory and part of the
159
- * type; `len` is validated to 1..=64 here because the grammar pins that
160
- * range at declaration (`docs/architecture/70-api.md` § the `schema!`
161
- * grammar: N ∈ 1..=64 — bare `bytes` does not parse), the macro-expansion
162
- * boundary's analog being construction.
157
+ * The `bytes<N>` field constructor. The width is mandatory and a
158
+ * descriptor-type label; `width` is validated to 1..=64 here because the
159
+ * grammar pins that range at declaration (`docs/architecture/70-api.md`
160
+ * § the `schema!` grammar: N ∈ 1..=64 — bare `bytes` does not parse), the
161
+ * macro-expansion boundary's analog being construction.
163
162
  */
164
- declare function bytes(len: number): BytesField;
163
+ declare function bytes<const Width extends number>(width: Width): BytesField<Width>;
165
164
  /**
166
165
  * The interval field constructor — `interval(u64)` / `interval(i64)` for
167
166
  * the general type (rays representable), `interval(u64, w)` for the
168
- * fixed-width family whose width IS the type. The element is spelled with
169
- * the u64/i64 field constructor values themselves, never a string. `width
170
- * >= 1` is validated here because the grammar pins it at declaration
167
+ * fixed-width family whose width IS a descriptor-type label. The element is
168
+ * spelled with the u64/i64 constructor values themselves, never a string.
169
+ * `width >= 1` is validated here because the grammar pins it at declaration
171
170
  * (`docs/architecture/70-api.md`: w ≥ 1; `interval<u64, 0>` is an
172
171
  * expansion error naming the field).
173
172
  */
174
- declare function interval(element: U64Field | I64Field, width?: bigint): IntervalField;
173
+ declare function interval<Element extends U64Field | I64Field>(element: Element): IntervalField<Element["kind"], undefined>;
174
+ declare function interval<Element extends U64Field | I64Field, const Width extends bigint>(element: Element, width: Width): IntervalField<Element["kind"], Width>;
175
175
  /**
176
176
  * Lowers one host literal at its field position to the wire
177
177
  * {@link LiteralSpec} — the selection-literal machine ground axioms and
178
178
  * `where()` bindings both ride (one machine, same errors — the macro's own
179
179
  * rule). A value on a closed-reference field resolves to its handle NAME
180
- * (the id is re-verified against the roster: an out-of-roster id is a
180
+ * (the id is verified against the roster: an out-of-roster id is a
181
181
  * construction error); everything else lowers to a plain value tagged by
182
- * the field's structural type.
182
+ * the field's structural kind.
183
183
  */
184
- declare function literalOf(field: FieldData, value: unknown): LiteralSpec;
185
- export type { AnyField, BoolField, BytesField, BytesNewtype, ClosedIdField, ClosedRoster, Field, FieldData, FieldValue, FreshU64Newtype, I64Field, I64Newtype, Infer, IntervalField, IntervalNewtype, StrField, U64Field, U64Newtype };
186
- export { assertDeclarationOrderKey, bool, bytes, fieldData, i64, interval, literalOf, str, u64 };
184
+ declare function literalOf(field: AnyField, value: unknown): LiteralSpec;
185
+ export type { AnyField, BoolField, BytesField, ClosedIdField, ClosedRoster, FreshU64Field, I64Field, Infer, IntervalField, IntervalValue, StrField, U64Field };
186
+ export { assertDeclarationOrderKey, bool, bytes, i64, interval, literalOf, span, str, u64 };
187
187
  //# sourceMappingURL=fields.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAoD1D;;;;;GAKG;AACH,UAAU,YAAY;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,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AC,OAAO,SAAS,QAAQ,GAAG,QAAQ,EAAE,KAAK,CAAC,KAAK,SAAS,MAAM,EAChF,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACV,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAA;AAcxC;;;;;;;;GAQG;AACH,iBAAS,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,WAAW,CAsC/D;AAED,YAAY,EACX,QAAQ,EACR,SAAS,EACT,UAAU,EACV,aAAa,EACb,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,KAAK,EACL,aAAa,EACb,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,CAAA;AACD,OAAO,EAAE,yBAAyB,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA"}
package/dist/fields.js CHANGED
@@ -1,21 +1,33 @@
1
1
  /**
2
- * Field type constructors — the value half of the `schema!` field grammar
3
- * (`docs/architecture/70-api.md`): `bool`, `u64`, `i64`, `str`, `bytes(n)`,
4
- * `interval(u64|i64[, width])`, each a plain frozen value carrying its
5
- * structural type at runtime and its host value type in a phantom generic.
6
- * Newtypes are DECLARATION-FIRST, one spelling only (owner ruling
7
- * 2026-07-16): `const AccountId = u64.newtype("AccountId")` declares the
8
- * brand ONCE as a value that IS the field, paired with
9
- * `type AccountId = Infer<typeof AccountId>` for signatures; every field
10
- * position references the declared value (`holder: HolderId`). The macro's
11
- * refusals are reproduced representationally: `.newtype` exists only where
12
- * Rust's `as` is legal (u64, i64, bytes, intervals — never bool/str),
13
- * `.fresh` exists only on declared u64 newtypes (the macro demands `as
14
- * NewType` on fresh fields), and no field-level constraint vocabulary of
15
- * any kind exists — `unique`/`fk` are unwritable, not rejected.
2
+ * Field descriptors — the value half of the `schema!` field grammar
3
+ * (`docs/architecture/70-api.md`), MINIMAL edition: `bool`, `u64`, `i64`,
4
+ * `str`, `bytes(n)`, `interval(u64|i64[, width])`, each a plain frozen value
5
+ * that IS its own descriptor type `{ kind, width?, element?, fresh? }` —
6
+ * honest at runtime and in the type alike. A field's VALUE type is its bare
7
+ * structural type (`u64` `bigint`, `str` → `string`, `bytes(n)`
8
+ * `Uint8Array`, intervals `{ start, end }`): no brands, no phantoms, no
9
+ * minting casts. A descriptor carries STRUCTURE ONLY domains are never
10
+ * declared anywhere (the owner ruling: THE LAWS TYPE THE COLUMNS): a
11
+ * field's domain is COMPUTED by `schema()` from the statement list, where
12
+ * the dependencies themselves induce the equivalence classes. The macro's
13
+ * refusals are reproduced representationally: `.fresh` exists only on u64,
14
+ * and no field-level constraint vocabulary of any kind exists —
15
+ * `unique`/`fk` are unwritable, not rejected.
16
16
  */
17
17
  import * as errors from "@superbuilders/errors";
18
- import { phantom } from "#brand.ts";
18
+ /**
19
+ * Constructs an interval literal — the `start..end` spelling. Half-open
20
+ * and nonempty by construction: `start >= end` is a typed construction
21
+ * error (parse, don't validate — the same invariant Rust's
22
+ * `Interval::new` enforces at the host boundary). The value is bare and
23
+ * structural: it is assignable to any interval field.
24
+ */
25
+ function span(start, end) {
26
+ if (start >= end) {
27
+ throw errors.new(`interval is half-open and nonempty: start must be < end (got ${start}..${end})`);
28
+ }
29
+ return Object.freeze({ start, end });
30
+ }
19
31
  /**
20
32
  * The typed shape refusal of the selection-literal machine — reached only
21
33
  * through ill-typed input (the well-typed surfaces make it unrepresentable).
@@ -33,10 +45,10 @@ function isIntervalLiteral(value) {
33
45
  typeof value.end === "bigint");
34
46
  }
35
47
  /**
36
- * Resolves one closed-handle literal: the branded id (a bigint at runtime)
37
- * back to its handle NAME through the roster — an out-of-roster id is a
38
- * construction error, the belt the type level cannot provide against
39
- * forged brands.
48
+ * Resolves one closed-handle literal: the handle id (a bare bigint) back to
49
+ * its handle NAME through the roster — an out-of-roster id is a
50
+ * construction error, the belt the type level deliberately does not provide
51
+ * (structural values make any bigint spellable here; the roster judges).
40
52
  */
41
53
  function handleLiteral(closed, value) {
42
54
  if (typeof value !== "bigint") {
@@ -73,99 +85,53 @@ function assertDeclarationOrderKey(where, name) {
73
85
  throw errors.new(`${where}: name ${name} is an integer index — JavaScript object keys re-order integer indices, breaking the declaration-order law; use a non-numeric name`);
74
86
  }
75
87
  }
88
+ /** The one fresh-marked u64 descriptor (the `.fresh` property of the unmarked one). */
89
+ const freshU64 = Object.freeze({ kind: "u64", fresh: true });
90
+ /** The one `u64` constructor value. */
91
+ const u64 = Object.freeze({ kind: "u64", fresh: freshU64 });
92
+ /** The one `i64` constructor value. */
93
+ const i64 = Object.freeze({ kind: "i64" });
94
+ /** The one `bool` constructor value. */
95
+ const bool = Object.freeze({ kind: "bool" });
96
+ /** The one `str` constructor value. */
97
+ const str = Object.freeze({ kind: "str" });
76
98
  /**
77
- * Builds one frozen {@link FieldData}. Internal seam shared by the field
78
- * constructors here and by `closed()` (which mints {@link ClosedIdField}
79
- * values against its own roster).
99
+ * The `bytes<N>` field constructor. The width is mandatory and a
100
+ * descriptor-type label; `width` is validated to 1..=64 here because the
101
+ * grammar pins that range at declaration (`docs/architecture/70-api.md`
102
+ * § the `schema!` grammar: N ∈ 1..=64 — bare `bytes` does not parse), the
103
+ * macro-expansion boundary's analog being construction.
80
104
  */
81
- function fieldData(type, newtype, minted, closed) {
82
- return Object.freeze({ type: Object.freeze(type), newtype, minted, closed });
83
- }
84
- /** The one `u64` field constructor value. */
85
- const u64 = Object.freeze({
86
- data: fieldData({ kind: "u64" }, undefined, false, undefined),
87
- newtype(name) {
88
- const fresh = Object.freeze({
89
- data: fieldData({ kind: "u64" }, name, true, undefined)
90
- });
91
- return Object.freeze({
92
- data: fieldData({ kind: "u64" }, name, false, undefined),
93
- fresh
94
- });
95
- }
96
- });
97
- /** The one `i64` field constructor value. */
98
- const i64 = Object.freeze({
99
- data: fieldData({ kind: "i64" }, undefined, false, undefined),
100
- newtype(name) {
101
- return Object.freeze({ data: fieldData({ kind: "i64" }, name, false, undefined) });
105
+ function bytes(width) {
106
+ if (!Number.isInteger(width) || width < 1 || width > 64) {
107
+ throw errors.new(`bytes width must be an integer in 1..=64 (got ${width}) — docs/architecture/70-api.md pins the range at declaration`);
102
108
  }
103
- });
104
- /** The one `bool` field constructor value. */
105
- const bool = Object.freeze({
106
- data: fieldData({ kind: "bool" }, undefined, false, undefined)
107
- });
108
- /** The one `str` field constructor value. */
109
- const str = Object.freeze({
110
- data: fieldData({ kind: "string" }, undefined, false, undefined)
111
- });
112
- /**
113
- * The `bytes<N>` field constructor. The width is mandatory and part of the
114
- * type; `len` is validated to 1..=64 here because the grammar pins that
115
- * range at declaration (`docs/architecture/70-api.md` § the `schema!`
116
- * grammar: N ∈ 1..=64 — bare `bytes` does not parse), the macro-expansion
117
- * boundary's analog being construction.
118
- */
119
- function bytes(len) {
120
- if (!Number.isInteger(len) || len < 1 || len > 64) {
121
- throw errors.new(`bytes width must be an integer in 1..=64 (got ${len}) — docs/architecture/70-api.md pins the range at declaration`);
122
- }
123
- return Object.freeze({
124
- data: fieldData({ kind: "fixedBytes", len }, undefined, false, undefined),
125
- newtype(name) {
126
- return Object.freeze({ data: fieldData({ kind: "fixedBytes", len }, name, false, undefined) });
127
- }
128
- });
109
+ return Object.freeze({ kind: "bytes", width });
129
110
  }
130
- /**
131
- * The interval field constructor — `interval(u64)` / `interval(i64)` for
132
- * the general type (rays representable), `interval(u64, w)` for the
133
- * fixed-width family whose width IS the type. The element is spelled with
134
- * the u64/i64 field constructor values themselves, never a string. `width
135
- * >= 1` is validated here because the grammar pins it at declaration
136
- * (`docs/architecture/70-api.md`: w ≥ 1; `interval<u64, 0>` is an
137
- * expansion error naming the field).
138
- */
139
111
  function interval(element, width) {
140
- const elementKind = element.data.type.kind;
112
+ const elementKind = element.kind;
141
113
  if (elementKind !== "u64" && elementKind !== "i64") {
142
114
  throw errors.new(`interval element must be the u64 or i64 field constructor (got ${elementKind})`);
143
115
  }
144
116
  if (width !== undefined && width < 1n) {
145
117
  throw errors.new(`interval width must be >= 1 (got ${width}) — docs/architecture/70-api.md pins w >= 1 at declaration`);
146
118
  }
147
- const type = { kind: "interval", element: elementKind, width };
148
- return Object.freeze({
149
- data: fieldData(type, undefined, false, undefined),
150
- newtype(name) {
151
- return Object.freeze({ data: fieldData(type, name, false, undefined) });
152
- }
153
- });
119
+ return Object.freeze({ kind: "interval", element: elementKind, width });
154
120
  }
155
121
  /**
156
122
  * Lowers one host literal at its field position to the wire
157
123
  * {@link LiteralSpec} — the selection-literal machine ground axioms and
158
124
  * `where()` bindings both ride (one machine, same errors — the macro's own
159
125
  * rule). A value on a closed-reference field resolves to its handle NAME
160
- * (the id is re-verified against the roster: an out-of-roster id is a
126
+ * (the id is verified against the roster: an out-of-roster id is a
161
127
  * construction error); everything else lowers to a plain value tagged by
162
- * the field's structural type.
128
+ * the field's structural kind.
163
129
  */
164
130
  function literalOf(field, value) {
165
- if (field.closed !== undefined) {
131
+ if ("closed" in field) {
166
132
  return handleLiteral(field.closed, value);
167
133
  }
168
- switch (field.type.kind) {
134
+ switch (field.kind) {
169
135
  case "bool": {
170
136
  if (typeof value !== "boolean") {
171
137
  throw literalShapeError("boolean", value);
@@ -184,21 +150,21 @@ function literalOf(field, value) {
184
150
  }
185
151
  return { kind: "value", value: { kind: "i64", value } };
186
152
  }
187
- case "string": {
153
+ case "str": {
188
154
  if (typeof value !== "string") {
189
155
  throw literalShapeError("string", value);
190
156
  }
191
157
  return { kind: "value", value: { kind: "string", value } };
192
158
  }
193
- case "fixedBytes": {
159
+ case "bytes": {
194
160
  if (!(value instanceof Uint8Array)) {
195
161
  throw literalShapeError("Uint8Array", value);
196
162
  }
197
163
  return { kind: "value", value: { kind: "fixedBytes", value } };
198
164
  }
199
165
  case "interval":
200
- return intervalLiteral(field.type.element, value);
166
+ return intervalLiteral(field.element, value);
201
167
  }
202
168
  }
203
- export { assertDeclarationOrderKey, bool, bytes, fieldData, i64, interval, literalOf, str, u64 };
169
+ export { assertDeclarationOrderKey, bool, bytes, i64, interval, literalOf, span, str, u64 };
204
170
  //# sourceMappingURL=fields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGnC;;;GAGG;AACH,SAAS,iBAAiB,CAAC,QAAgB,EAAE,KAAc;IAC1D,OAAO,MAAM,CAAC,GAAG,CAAC,8CAA8C,QAAQ,SAAS,OAAO,KAAK,EAAE,CAAC,CAAA;AACjG,CAAC;AAED,yEAAyE;AACzE,SAAS,iBAAiB,CAAC,KAAc;IACxC,OAAO,CACN,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAO,IAAI,KAAK;QAChB,KAAK,IAAI,KAAK;QACd,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;QAC/B,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,CAC7B,CAAA;AACF,CAAC;AAED;;;;;GAKG;AACH,SAAS,aAAa,CAAC,MAAoB,EAAE,KAAc;IAC1D,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,iBAAiB,CAAC,KAAK,MAAM,CAAC,IAAI,qBAAqB,EAAE,KAAK,CAAC,CAAA;IACtE,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IAC5C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,MAAM,CAAC,GAAG,CACf,mBAAmB,MAAM,CAAC,IAAI,0BAA0B,KAAK,kBAAkB,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CACvG,CAAA;IACF,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,E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