@elaraai/east-codex-plugin 1.0.99 → 1.0.101

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 (37) hide show
  1. package/.build/mcp/server.js +3 -2
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/index.json +12207 -216
  4. package/package.json +1 -1
  5. package/skills/e3/SKILL.md +37 -809
  6. package/skills/e3/reference/browser.md +93 -0
  7. package/skills/e3/reference/cli.md +123 -0
  8. package/skills/e3/reference/from-code.md +48 -0
  9. package/skills/e3/reference/rack.md +139 -0
  10. package/skills/e3/reference/record-indexes.md +326 -0
  11. package/skills/e3/reference/record-migrations.md +63 -0
  12. package/skills/e3/reference/repository.md +25 -0
  13. package/skills/e3-ui/SKILL.md +273 -3623
  14. package/skills/e3-ui-cli/SKILL.md +1 -5
  15. package/skills/east/SKILL.md +31 -464
  16. package/skills/east/reference/beast2.md +71 -0
  17. package/skills/east/reference/cross-language-and-json-schema.md +87 -0
  18. package/skills/east/reference/queries.md +46 -0
  19. package/skills/east/reference/runners-and-ir.md +148 -0
  20. package/skills/east/reference/trees-and-recursion.md +56 -0
  21. package/skills/east/reference/values-in-typescript.md +62 -0
  22. package/skills/east-py/SKILL.md +29 -1652
  23. package/skills/east-py/reference/beast2.md +108 -0
  24. package/skills/east-py/reference/cli.md +51 -0
  25. package/skills/east-py/reference/columns-and-platform-functions.md +87 -0
  26. package/skills/east-py/reference/control-flow-and-queries.md +147 -0
  27. package/skills/east-py/reference/cross-language.md +70 -0
  28. package/skills/east-py/reference/ir-and-diagnostics.md +150 -0
  29. package/skills/east-py/reference/patterns.md +369 -0
  30. package/skills/east-py/reference/performance.md +70 -0
  31. package/skills/east-py/reference/value-methods.md +306 -0
  32. package/skills/east-py/reference/values-construction-and-json.md +88 -0
  33. package/skills/east-py/reference/writing-east-functions.md +275 -0
  34. package/skills/east-py-datascience/SKILL.md +12 -33
  35. package/skills/east-py-io/SKILL.md +1 -5
  36. package/skills/east-py-std/SKILL.md +1 -5
  37. package/skills/east-ui/SKILL.md +220 -1332
@@ -0,0 +1,306 @@
1
+ # The East value classes' methods
2
+
3
+ Every eager method of `EastArray`, `EastSet`, `EastDict`, `EastVector`, `EastMatrix`, `EastBlob` and `EastStruct` / `EastVariant` / `EastRef`, the container generators, the `East.<Type>` namespaces, and the DateTime format codes. For a worked example over values, search the index with `package: "east-values"`. Part of the `east-py` skill.
4
+
5
+ ## Contents
6
+
7
+ - EastArray — complete method surface
8
+ - EastSet — complete method surface
9
+ - EastDict — complete method surface
10
+ - EastVector — complete method surface
11
+ - EastMatrix — complete method surface
12
+ - EastBlob (a `bytes` subclass)
13
+ - EastStruct / EastVariant / EastRef
14
+ - Container generators (classmethods)
15
+ - East.<Type> namespaces — the builtins and the standard library
16
+ - DateTime format codes
17
+
18
+ ## EastArray — complete method surface
19
+
20
+ Eager; results are live east-c-backed values that chain. `arr[i]`, `len(arr)`, `for x in arr`
21
+ work via the sequence protocol. Callback methods accept a python body — the block first, then
22
+ the arguments the table lists, so `fn(el)` is written `lambda b, el: …` — (built into a native
23
+ function) or a precompiled `East.function(...)` (a value: it takes no block); anything East cannot
24
+ express raises with the binding named. Result types come from the build, so `out`/`element_type` is optional — pass it
25
+ to PIN a type (a widening map, an Option payload) and a contradicting precompiled function raises
26
+ at the call. `.element_type` is the logical element type.
27
+
28
+ | Group | Methods |
29
+ |-------|----------------------|
30
+ | Access | `get(i[, default_fn(i)])` (errors when out of bounds — `arr[i]` is the pythonic read; TS `get(index, onMissing?)`) · `at(i)` · `get_or_default(i, default)` · `try_get(i) -> some/none` · `has(i)` · `size()`/`length()` · `get_keys(indices: EastArray)` |
31
+ | Reorder (new array) | `sort(by=None, *, reverse=False)` (TS `sort`; `sorted` is the deprecated spelling) · `reverse()` (`reversed` deprecated) |
32
+ | Slice & combine | `slice(start, end)` · `concat(other)` · `copy()` |
33
+ | Per-element | `map(fn(el), out=None)` · `filter(pred(el))` · `filter_map(fn(el)->some/none, out=None)` · `for_each(fn(el)) -> None` — every element callback may also declare `(el, idx)` to receive the builtin's index |
34
+ | Reduce | `reduce(fn(acc, el), init)` (TS order; `fold(init, fn)` is the deprecated spelling) · `scan(fn(acc, el), init) -> Array` (running fold: one accumulator per element, seed not emitted, `scan(...)[n-1] == reduce(...)`) · `map_reduce(map_fn(el), reduce_fn(acc, m), out=None)` · `sum(fn=None)` · `mean(fn=None) -> float` (NaN when empty) · `maximum(by=None)` ❗empty · `minimum(by=None)` ❗empty (the ELEMENT — of `by(el)` when given — a tie keeps the first, like TS) · `every(pred=None) -> bool` · `some(pred=None) -> bool` (native short-circuit) |
35
+ | Group & index | `group_by(key(el)) -> Dict` · `group_reduce(key, init(gk), fold(acc, el)) -> Dict` · `group_size(key=None)` · `group_sum(key, fn=None)` · `group_mean(key, fn=None)` · `group_maximum/group_minimum(key, by=None)` (Dict of the ELEMENT per group, like TS — `group_find_maximum` is the index finder) · `group_every/group_some(key, pred)` · `group_find_all(key, value, by=None) -> Dict<K, Array<Integer>>` / `group_find_first(key, value, by=None) -> Dict<K, some/none>` (GLOBAL row indices; every group appears, so a group with no match maps to `[]` / `none`) · `group_find_maximum/group_find_minimum(key, by=None) -> Dict<K, Integer>` (the INDEX per group; a tie keeps the earliest) · `group_to_arrays(key, value=None)` · `group_to_sets(key, value=None)` · `group_to_dicts(key, key2, value=None, combine=None)` · `to_dict(key(el), value=None, combine=None) -> Dict` (duplicate key errors without `combine`) · `to_set(key=None) -> Set` · `unique() -> Set` |
36
+ | Search | `find_first(target, key=None) -> some/none` · `find_all(value, by=None) -> Array<Integer>` · `find_maximum/find_minimum(by=None) -> some(index)/none` · `find_sorted_first/last(target, key=None) -> int` · `find_sorted_range(target, key=None) -> {start,end}` · `first_map(fn(el)->some/none, out=None)` · `is_sorted(key=None) -> bool` |
37
+ | Flatten | `flat_map(fn(el)->arr, out=None)` (`flatten_to_array` deprecated) · `flatten_to_set(fn(el)->set, out=None)` · `flatten_to_dict(fn(el)->dict, combine=None)` (a duplicate key errors without `combine`) |
38
+ | Columnar | `to_columns(fields=None) -> dict` (numpy per numeric/bool column, `Option<Float>`→NaN, interned strings) · `EastArray.from_columns(element_type, columns)` *(static)* (C-side fill needs numpy columns — float64/int64/bool, `Option<Float>` as float64+NaN; python lists convert per cell) · `map_batches(fn(cols)->cols, out=None, batch_size=100_000)` |
39
+ | Convert | `to_tree(node, key(el[, i]), parent(el[, i])->some/none, build(el, i, children)) -> Array<node>` (flat parent-keyed rows → nested nodes of any depth, iterative — [Trees from flat rows](patterns.md#trees-from-flat-rows-and-recursion)) · `flatten_tree(children(el[, i])) -> Array<{path, node}>` (nested nodes back: every node with its path of indices, depth first, iterative) · `string_join(sep) -> str` (String arrays) · `to_vector() -> EastVector` (Float/Integer/Boolean elements, in order — east-c VectorFromArray; the expression method emits the same builtin) · `encode_csv(config=None, **options) -> EastBlob` (Array of structs; east-c ArrayEncodeCsv) |
40
+ | Mutate (in place, the TS names) | `push_last(item)` · `push_first(item)` · `append(array)` (ArrayAppend — a whole array, NOT one element) · `prepend(array)` · `pop_last()` · `pop_first()` · `update(i, item)` ❗bounds · `merge(i, value, update_fn(existing, incoming[, i]))` · `merge_all(array, merge_fn(existing, incoming[, i]))` · `clear()` · `sort_in_place(by=None)` · `reverse_in_place()` — plus the python protocol: `extend(iterable)` (bulk: one crossing; C-to-C for same-type East arrays, raw buffers for numpy) · `insert(i, item)` · `pop(i=-1)` · `remove(item)` · `count(value) -> int` · `index(value) -> int` |
41
+
42
+ ## EastSet — complete method surface
43
+
44
+ Mutable, unique, **East-sorted**. `.element_type` is the element type; iteration / `to_array` /
45
+ `reduce` visit in East order. Every callback takes the block first (`lambda b, el: …`); the
46
+ signatures below list the arguments after it. **`map` and `filter_map` return an `EastDict`** keyed by the element
47
+ (Set→Set is `to_set`).
48
+
49
+ | Group | Methods |
50
+ |-------|---------|
51
+ | Access | `len(s)` · `value in s` · `has(value)` · `for el in s` |
52
+ | Algebra (vs another set) | `union(other)` · `intersection(other)` · `difference(other)` · `symmetric_difference(other)` · `is_subset_of(other) -> bool` · `is_superset_of(other) -> bool` · `is_disjoint_from(other) -> bool` (the TS names; `intersect`/`diff`/`sym_diff`/`is_subset`/`is_disjoint` are deprecated spellings) |
53
+ | Per-element | `map(fn(el)) -> Dict` · `filter(pred(el))` · `filter_map(fn(el)->some/none, out=None) -> Dict` · `first_map(fn(el)->some/none, out=None)` · `to_set(fn(el), out=None)` · `to_array(key=None)` · `to_dict(key(el), value(el), combine=None)` (duplicate key errors without `combine`) · `to_tree(node, parent(el)->some/none, build(el, children)) -> Array<node>` (each element its own key) · `for_each(fn(el)) -> None` |
54
+ | Reduce | `reduce(fn(acc, el), init)` (TS order) · `scan(fn(acc, el), init) -> Array` (running fold in East order) · `map_reduce(fn(el), reduce(a,b))` (raises on empty) · `sum(fn=None)` · `mean(fn=None) -> float` · `every(pred=None)` · `some(pred=None)` (native short-circuit) |
55
+ | Group | `group_reduce(key(el), initial(gk), fold(acc, el)) -> Dict` · `group_size(key)` · `group_sum(key, fn=None)` · `group_mean(key, fn=None)` · `group_every/group_some(key, pred)` · `group_to_arrays/group_to_sets(key, value=None)` · `group_to_dicts(key, key2, value=None, combine=None)` · ⚠️ `group_fold(...)` is the DEPRECATED alias of `group_reduce` |
56
+ | Flatten | `flatten_to_array(fn(el)->arr, out=…)` (the TS Set name; `flat_map` is Array's and a deprecated spelling here) · `flatten_to_set(fn(el)->set, out=…)` · `flatten_to_dict(fn(el)->dict, combine=None)` (duplicate key errors without `combine`) |
57
+ | Mutate (in place) | `add(item)` · `insert(value)` (errors if present) · `try_insert(value) -> bool` (True if newly added) · `remove(item)` · `delete(value)` (errors if absent) · `try_delete(value) -> bool` · `discard(item)` · `union_in_place(other)` (adds all of `other`) · `clear()` · `copy()` |
58
+
59
+ ## EastDict — complete method surface
60
+
61
+ Mutable, **East-sorted by key**. `.key_type` / `.value_type`. **Every Dict callback takes
62
+ the builtin's own `(value, key)` order — the TypeScript order** (the block first, as always):
63
+ `fn(b, value)` when the key is not needed, `fn(b, value, key)` when it is — for `map`,
64
+ `filter`, `first_map`, `to_*`, `flatten_to_*`, `map_reduce`, the projections of
65
+ `every`/`some`/`sum`/`mean` and `group_*`'s key/value projections alike; a fold step
66
+ (`reduce`/`scan`/`group_reduce`) is `fn(b, acc, value[, key])`; collision `combine` is
67
+ `combine(existing, incoming, key)` — for `union`/`union_in_place`/`to_dict` a 2-arg
68
+ `combine(existing, incoming)` is also accepted (a 3-arg one still receives the key).
69
+ `union`/`union_in_place` require `other` to have the same key AND value type (a
70
+ mismatch is refused); `merge_all` needs only the same KEYS and is generic
71
+ in `other`'s values; `merge` takes a single differently-typed value.
72
+
73
+ | Group | Methods |
74
+ |-------|---------|
75
+ | Access | `d[k]` · `k in d` · `has(k)` · `len(d)`/`size()` · `get(k)` ❗missing · `get(k, default)` (a value) / `get(k, fn(k))` (TS `onMissing`) · `get_or_default(k, default)` · `try_get(k) -> some/none` · `keys() -> Set` (TS; east-c DictKeys — `keys_set` deprecated) · `values()`/`items()` (python views) |
76
+ | Combine | `union(other, combine=None) -> Dict` (NEW dict, both inputs untouched; a shared key errors without `combine`) · `union_in_place(other, combine=None) -> None` · `merge_all(other, merge(existing, incoming[, key]), default(key)) -> None` (fold `other` into self in place; `default` seeds absent keys; **generic in `other`'s value type** — only the KEYS must match) · `merge(key, value, update_fn(existing, incoming[, key]), initial_fn=None) -> None` (ONE key, in place; `value` may be a different type — TS `merge`; `merge_key` deprecated) · `get_keys(keys: Set, fill(k)) -> Dict` |
77
+ | Per-entry | `map(fn(value[, key]), out=None)` · `filter(pred(value[, key]))` · `filter_map(fn(value[, key])->some/none, out=None)` · `first_map(fn(value[, key])->some/none, out=None)` · `for_each(fn(value[, key])) -> None` |
78
+ | Reduce | `reduce(fn(acc, value[, key]), init)` (TS order) · `scan(fn(acc, value[, key]), init) -> Array` (running fold in key order) · `map_reduce(map_fn(value[, key]), reduce_fn(a, b), out=None)` (raises on empty) · `sum(fn(value[, key])=None)` · `mean(fn(value[, key])=None) -> float` · `every(pred(value[, key])=None) -> bool` · `some(pred(value[, key])=None) -> bool` (native short-circuit) |
79
+ | Group | `group_reduce(key_fn(value[, key]), init_fn(gk), fold_fn(acc, value[, key]), key_out=None, acc_out=None) -> Dict` · `group_size(key_fn)` · `group_sum(key_fn, fn=None)` · `group_mean(key_fn, fn=None)` · `group_every/group_some(key_fn, pred(value[, key]))` · `group_to_arrays/group_to_sets(key_fn, value_fn=None)` · `group_to_dicts(key_fn, key2_fn, value_fn=None, combine=None)` · ⚠️ `group_fold(...)` is the DEPRECATED alias of `group_reduce` |
80
+ | Flatten | `flatten_to_array(fn(value[, key])->arr, out=None)` (the TS Dict name; `flat_map` is Array's and a deprecated spelling here) · `flatten_to_set(fn(value[, key])->set, out=None)` · `flatten_to_dict(fn(value[, key])->dict, combine=None)` (a duplicate key errors without `combine`) |
81
+ | Convert | `keys() -> Set` · `to_array(fn(value[, key]), out=None)` · `to_set(fn(value[, key]), out=None)` · `to_dict(key_fn, value_fn=None, combine=None, key_out=None, value_out=None)` (the value itself when `value_fn` is omitted; a duplicate key errors without `combine`) · `to_tree(node, parent(value[, key])->some/none, build(value, key, children)) -> Array<node>` (each entry's key its key) · `flatten_tree(children(value[, key])) -> Array<{path, node}>` (nested nodes back: every node with its path of keys, depth first, iterative) · `copy()` |
82
+ | Mutate (in place) | `d[k]=v` · `del d[k]` · `insert(k, v)` (errors if present) · `get_or_insert(k, fn(k))` · `insert_or_update(k, v, combine(existing, incoming, k))` · `update(k, v)` (TS; the read-modify-write `update(k, fn(current))` is deprecated) · `swap(k, v) -> prev` · `delete(k)` · `try_delete(k) -> bool` (`update`/`swap`/`delete` error on a missing key) · `pop(k, *default)` · `clear()` |
83
+ | Bulk (in place) | `update_many(keys, values, combine(existing, incoming)=None)` — the whole batch crosses once; a pure/precompiled `combine` resolves collisions C-to-C (dicts as hot-loop accumulators) |
84
+
85
+ ## EastVector — complete method surface
86
+
87
+ Immutable 1-D numeric value: logical element type `Float`/`Integer`/`Boolean`,
88
+ backed by a contiguous NumPy buffer for zero-copy ML interop; `.element_type` is
89
+ fixed, while the storage `.dtype` may be any compatible width (f32, …). The
90
+ **arithmetic surface delegates to the east-c builtins** — reductions fold in
91
+ strict left-to-right index order and comparisons use East's total order (NaN
92
+ greatest, `-0.0 < 0.0`) — bit-identical across the TypeScript, C and python
93
+ runtimes, which numpy's reassociating reductions are not; free-form math goes via
94
+ `to_numpy()`/`to_torch()`. `set` and every transform return a NEW vector. Not
95
+ hashable, but a valid East Set/Dict key (ordered by value). Construct with the
96
+ `EastVector.*` classmethods ([Container generators](#container-generators-classmethods));
97
+ `from_numpy`/`from_torch` infer `element_type` from the dtype when omitted.
98
+ Structural access with an **expression** argument (inside a body) lifts the
99
+ vector as a constant and emits IR, like the eager collections.
100
+
101
+ | Group | Methods |
102
+ |-------|---------|
103
+ | Access | `get(i)` ❗bounds (promoted Python scalar) · `length() -> int` · `slice(start, end) -> EastVector` (half-open, contiguous copy) |
104
+ | Transform (returns new) | `set(i, v) -> EastVector` ❗bounds (original unchanged) · `concat(other) -> EastVector` (takes this vector's element type) |
105
+ | Arithmetic (east-c; Float/Integer elements) | `scale(alpha)` · `add_scaled(other, alpha)` (`self + alpha*other`) ❗len · `mul(other)` ❗len · `add_scalar(c)` · `abs()` · `clamp(lo, hi)` (East order) · `cum_sum()` (running sum, left to right) |
106
+ | Reduce (east-c; strict left-to-right order) | `sum()` (0 when empty) · `dot(other)` ❗len · `max()`/`min()` ❗empty (TS names; `maximum`/`minimum` deprecated) · `arg_max()`/`arg_min()` ❗empty (ties keep the first index; NaN is greatest) · `mean() -> float` (Integer widens per element; NaN when empty) |
107
+ | Masks & selection (east-c) | `eq(other)`/`lt(other)`/`gt(other)` ❗len `-> Vector<Boolean>` (East equality/order) · `mask.select(a, b)` ❗len (mask receiver) · `v.compress(mask)` ❗len · `mask.count_true() -> int` |
108
+ | Gather / scatter / search (east-c) | `gather(indices)` ❗bounds · `scatter_add(indices, src)` ❗len/bounds (duplicates accumulate in order) · `search_sorted(needles) -> Vector<Integer>` (leftmost insertion index; assumes sorted) |
109
+ | Sparse accumulators (east-c; `East.Vector.*`) | `sparse_axpy(ixA, vA, ixB, vB, alpha)` (union merge `vA + alpha*vB`; absent entries stay absent) ❗ascending/len · `sparse_from_pairs(ix, v)` (sorts + sums duplicates stably, in input order) ❗len · `sparse_filter_gt(ix, v, threshold)` ❗ascending/len — all return `Struct{ix: Vector<Integer>, v: Vector<T>}` with strictly ascending `ix`; every `ix`/`v` input takes a Vector OR an Array |
110
+ | Per-element (east-c; the native callback builtins) | `map(fn(el[, i]), out=None) -> EastVector` (VectorMap; Float/Integer/Boolean results) · `reduce(fn(acc, el[, i]), init)` (VectorFold, index order; `fold(init, fn)` is the deprecated spelling) — a body like every other callback, zero python per element |
111
+ | Convert | `to_array() -> EastArray` (promotes scalars; severs the zero-copy link) · `to_matrix(rows, cols) -> EastMatrix` (row-major reshape; `rows*cols == length`) |
112
+ | NumPy / torch | `to_numpy(dtype=None, copy=False) -> ndarray` (read-only view by default; a cast or `copy=True` is writeable) · `to_torch(dtype=None) -> torch.Tensor` (always a writeable copy) · `np.asarray(v)` via `__array__` · props `.dtype` (storage) / `.element_type` (logical) |
113
+
114
+ ## EastMatrix — complete method surface
115
+
116
+ Immutable 2-D row-major numeric value on a contiguous NumPy buffer, with the
117
+ `EastVector` contract: logical `.element_type` apart from storage `.dtype`, the
118
+ arithmetic surface in east-c with the strict reduction order, free-form math via
119
+ `to_numpy()`/`to_torch()`, NEW matrices from `set` and every transform, not
120
+ hashable but a valid Set/Dict key, the `EastMatrix.*` classmethods to construct,
121
+ and an expression argument lifting the matrix as a constant.
122
+
123
+ | Group | Methods |
124
+ |-------|---------|
125
+ | Access | `get(r, c)` ❗bounds (Python scalar) · `rows() -> int` · `cols() -> int` (TS names; `num_rows`/`num_cols` deprecated) |
126
+ | Transform (returns new) | `set(r, c, v) -> EastMatrix` ❗bounds (original unchanged) · `transpose() -> EastMatrix` (new cols×rows, contiguous) |
127
+ | Arithmetic (east-c; Float/Integer elements) | `scale(alpha)` · `add_scaled(other, alpha)` ❗dims · `mul_elementwise(other)` ❗dims (Hadamard) |
128
+ | Reduce (east-c; ascending index order) | `row_sums() -> EastVector` (ascending column order per row) · `col_sums() -> EastVector` (ascending row order per column) · `vec_mul(v) -> EastVector` ❗cols≠len (row-by-vector dot products) |
129
+ | Rows & cols | `get_row(r) -> EastVector` ❗bounds (contiguous copy) · `get_col(c) -> EastVector` ❗bounds (contiguous copy) |
130
+ | Per-row (east-c) / per-element (DEPRECATED) | `map_rows(fn(row: EastVector[, i]) -> EastVector, out=None)` (the native MatrixMapRows — a body like every callback) · `map_elements(fn(el), out=None)` runs a python callback per element; it warns and will go — use the arithmetic surface or `to_numpy()` |
131
+ | Convert | `to_vector() -> EastVector` (row-major flatten) · `to_array() -> EastArray` (`Array<Array<el>>`, one inner array per row) · `to_rows() -> EastArray` (`Array<Vector<el>>`, one `EastVector` per row) |
132
+ | NumPy / torch | `to_numpy(dtype=None, copy=False) -> ndarray` (2-D; read-only view by default) · `to_torch(dtype=None) -> torch.Tensor` (writeable copy) · `np.asarray(m)` via `__array__` · props `.dtype` / `.element_type` |
133
+
134
+ ## EastBlob (a `bytes` subclass)
135
+
136
+ `EastBlob(b"...")` constructs like `bytes` and carries the **full `bytes` API** plus East methods:
137
+
138
+ | Signature | Description |
139
+ |-----------|-------------|
140
+ | `size() -> int` | Byte length (== `len(blob)`) |
141
+ | `get_uint8(i) -> int` | Unsigned byte at `i` (0–255) |
142
+ | `.data -> bytes` | Raw payload |
143
+ | `decode_utf8() -> str` / `decode_utf16() -> str` | Text decode |
144
+ | `EastBlob.encode_beast2(value) -> EastBlob` *(static)* | Serialize an East value to BEAST2 (type inferred via `type_of`); `East.Blob.encode_beast(value, "v2")` is the builtin twin |
145
+ | `decode_beast(typ, version="v1") -> value` | The east-c BlobDecodeBeast / BlobDecodeBeast2 builtins (TS `decodeBeast`): `"v1"` is the original BEAST format, `"v2"` the beast2 family (any container version) |
146
+ | `decode_beast2(typ) -> value` | Decode BEAST2 as `typ` (the serialization-layer form) |
147
+ | `open_beast(typ) -> value` | The east-c BlobOpenBeast2 builtin (TS `openBeast`): an indexed beast2 `Array`/`Set`/`Dict` blob as a FROZEN paged proxy — the value a task's collection input opens as — whose `len`, keyed reads and iteration decode one segment; an index-less blob (what `encode_beast` writes) or a Ref-/function-bearing element shape decodes whole, frozen; mutation raises, `.copy()` gives a mutable value; a header of another type raises `cannot open a blob of type <wire> as <typ>` before any decode |
148
+ | `decode_csv(element_type, config=None, **options) -> EastArray` | Decode CSV rows into `Array<element_type>` (east-c decoder). Build `config` with `east.serialization.csv.csv_parse_config(...)`: by default **no field text is null** (empty field == empty string); opt in with `null_strings=[""]` (`none` for Option columns, error for required); `defaults={"qty": "0.0"}` gives per-column fallbacks for unparseable fields and constant-fill for absent columns; `skip_short_rows=True` drops ragged rows instead of erroring |
149
+
150
+ ## EastStruct / EastVariant / EastRef
151
+
152
+ - **`EastStruct`** — frozen record; read fields by name: `s["price"]` or as an
153
+ attribute, `s.price` (methods shadow same-named fields — item access always
154
+ works). Build/transform with `struct({...}, StructType)`.
155
+ - **`EastVariant`** — frozen tagged value; `.type` is the case name, `.value` the payload.
156
+ Build with `variant(case, value, T)` / `some` / `none`. Dispatch with the
157
+ `.match({case: handler}, default=None)` method (handlers are bodies, `handler(b, payload)`;
158
+ `default` is a `default(b)` body for the other cases — TS's partial match — or a plain
159
+ value; the module-level `match(v, cases, default)` is equivalent) or
160
+ `.match_tag(tag, handler, default)`. Also `get_tag()`, `has_tag(tag)`, and
161
+ `unwrap(tag="some", on_other=None)` ❗ValueError on a different case unless the
162
+ `on_other(b)` body answers — mirroring the TS variant expression surface, and the same
163
+ shapes build inside a body. An option reads with the **same accessors as the
164
+ expression surface** — `is_some()`, `is_none()`, `unwrap_or(default)` — so a
165
+ decoded option needs no `opt.type == "some"` branch.
166
+ - **`EastRef`** — mutable cell: `get()` · `update(value)` (TS `RefUpdate`; `set` is the
167
+ deprecated spelling, and the read-modify-write `update(fn(b, current))` is deprecated too —
168
+ write `ref.update(f(ref.get()))`) · `merge(patch, combine(b, current, patch))`. Inside a
169
+ body the expression twin is `East.ref(v)` with the same `get`/`update`/`merge`.
170
+
171
+ ## Container generators (classmethods)
172
+
173
+ Eager factories are **classmethods** on the container classes (snake_case); their dual-mode
174
+ twins — usable inside a body — live on the `East.Array`/`East.Set`/`East.Dict`/
175
+ `East.Vector`/`East.Matrix` namespaces (`East.Array.range`, `East.Vector.zeros(T, n)`,
176
+ `East.Matrix.from_rows(rows)`, …). The namespace `generate`s take the **TypeScript argument
177
+ order** — `East.Array.generate(size, T, fn)`, `East.Set.generate(size, T, fn, on_conflict=None)`,
178
+ `East.Dict.generate(size, K, V, key_fn, value_fn, on_conflict=None)` — and, like TypeScript, a
179
+ key generated twice is a runtime error `Duplicate key <k> in set/dict` unless an `on_conflict`
180
+ handler is given (the pre-TS python order still works with a DeprecationWarning). Do not confuse them with
181
+ `East.new_array`/`new_set`/`new_dict`, which are the CONTROL-FLOW constructors: a fresh
182
+ loop-local collection built per evaluation inside a function.
183
+
184
+ | Signature | Example |
185
+ |-----------|---------|
186
+ | `EastArray.range(start, end, step=1)` | `EastArray.range(0, 5, 2)` → `[0, 2, 4]` |
187
+ | `EastArray.linspace(start, end, count)` | `EastArray.linspace(0., 1., 3)` → `[0.0, 0.5, 1.0]` |
188
+ | `EastArray.generate(count, fn(b, i), element_type=None)` | `EastArray.generate(3, lambda b, i: i*i, IntegerType)` |
189
+ | `EastSet.generate(n, fn(b, i), element_type=None, on_conflict=None)` | `EastSet.generate(4, lambda b, i: East.Integer.remainder(i, 2), IntegerType, lambda b, k: None)` — a duplicate ERRORS without `on_conflict` (TS) |
190
+ | `EastDict.generate(n, key_fn(b, i), value_fn(b, i), combine(b, x, y, k), key_type, value_type)` | `EastDict.generate(3, lambda b, i: i, lambda b, i: i*10, lambda b, x, y, k: x + y, IntegerType, IntegerType)` — `combine=None` makes a duplicate key an error (TS) |
191
+ | `EastVector.zeros/ones(element_type, length)` · `fill(element_type, length, value)` · `from_array(element_type, items)` · `from_numpy(array, element_type=None)` · `from_torch(tensor, element_type=None)` | `EastVector.zeros(FloatType, 3)` |
192
+ | `EastMatrix.zeros/ones(element_type, rows, cols)` · `fill(…, value)` · `from_array/from_rows(element_type, rows)` · `from_numpy(array, element_type=None)` · `from_torch(tensor, element_type=None)` | `EastMatrix.from_array(FloatType, [[1.,2.],[3.,4.]])` |
193
+
194
+ ## East.<Type> namespaces — the builtins and the standard library
195
+
196
+ Scalars are plain Python, so their builtins are namespace functions — **complete** lists below.
197
+ Every one delegates to east-c, and every one is dual-mode: on plain values it runs now, on
198
+ expressions it emits IR. The `stdlib:` rows are the TypeScript standard library
199
+ (see [the stdlib](writing-east-functions.md#the-standard-library--the-typescript-easttype-functions)).
200
+
201
+ **`East.Float`** (f64)
202
+
203
+ | Signature | Notes |
204
+ |-----------|-------|
205
+ | `add(a,b)` · `subtract(a,b)` · `multiply(a,b)` · `divide(a,b)` · `remainder(a,b)` · `pow(base,exp)` | arithmetic |
206
+ | `negate(x)` · `abs(x)` · `sign(x)` · `sqrt(x)` · `exp(x)` · `log(x)` | unary / powers |
207
+ | `sin(x)` · `cos(x)` · `tan(x)` | trig |
208
+ | `to_integer(x) -> int` | raises on a non-integer float (e.g. `3.9`) |
209
+ | stdlib: `approx_equal(x, y, epsilon) -> bool` · `round_floor/round_ceil/round_half/round_trunc(x) -> int` | `round_half` ties away from zero |
210
+ | stdlib: `round_nearest/round_up/round_down/round_truncate(x, step)` · `round_to_decimals(x, decimals)` | step 0.0 returns `x`; NaN/±Infinity raise `Cannot round …` |
211
+ | stdlib: `print_fixed(x, decimals)` · `print_comma_seperated(x, decimals)` · `print_currency(x)` · `print_compact(x)` · `print_percentage(x, decimals)` | `"3.14"` · `"1,234.57"` · `"-$42.50"` · `"1.5M"` · `"12.34%"`; NaN/±Infinity raise `Cannot format …` |
212
+
213
+ **`East.Integer`** (i64)
214
+
215
+ | Signature | Notes |
216
+ |-----------|-------|
217
+ | `add(a,b)` · `subtract(a,b)` · `multiply(a,b)` · `divide(a,b)` · `remainder(a,b)` · `pow(base,exp)` | arithmetic (`divide` truncates) |
218
+ | `negate(x)` · `abs(x)` · `sign(x)` · `log(x, base)` | unary |
219
+ | `to_float(x) -> float` | widen to f64 |
220
+ | stdlib: `print_comma_seperated(x)` · `print_currency(x)` · `print_compact(x)` · `print_compact_si(x)` · `print_compact_computing(x)` · `print_ordinal(x)` · `print_percentage(x)` · `digit_count(x)` | `"1,234,567"` · `"$1,234"` · `"1.23M"` (K/M/B/T/Q) · `"1.23M"` (k/M/G/T/P) · `"1.17Mi"` (base 1024) · `"3rd"` · `"25%"` · `3` |
221
+ | stdlib: `round_nearest/round_up/round_down/round_truncate(x, step)` | step 0 returns `x`; `round_nearest(127, 10)` is `130` |
222
+
223
+ **`East.String`**
224
+
225
+ | Signature | Notes |
226
+ |-----------|-------|
227
+ | `concat(a, b)` · `repeat(s, n)` · `substring(s, start, end)` · `length(s) -> int` | build / measure |
228
+ | `upper_case(s)` · `lower_case(s)` · `trim(s)` · `trim_start(s)` · `trim_end(s)` | case / whitespace |
229
+ | `replace(s, find, replacement)` · `split(s, separator) -> Array<String>` | edit / tokenize |
230
+ | `contains(s, substring)` · `starts_with(s, prefix)` · `ends_with(s, suffix)` · `index_of(s, substring) -> int` | search (`-> bool`/`int`) |
231
+ | `regex_contains(s, pattern, flags="")` · `regex_index_of(s, pattern, flags="")` · `regex_replace(s, pattern, replacement, flags="")` | regex |
232
+ | `parse(typ, s)` ❗ · `print(typ, value) -> str` (the root `East.print(value[, typ])` is the same builtin, value first) | East **text** format; `parse` is a **strict whole-string** parser — trailing or leading junk raises (`"598-"`, `"$5"`, `"1.2.3"` all raise; in a body use `.try_parse(T)` for the optional form) |
233
+ | `parse_json(typ, s)` · `print_json(typ, value) -> str` / `print_json(value)` | East **JSON** (`Integer` encodes as a JSON *string*: `print_json(ArrayType(IntegerType), [1,2,3]) == '["1","2","3"]'`; an `Option` is `null` for `none` and the payload itself for `some` wherever the payload cannot be null — `print_json(OptionType(IntegerType), some(7)) == '"7"'` — and only `Option<Null>` / `Option<Option<T>>` keep the `{"type": …, "value": …}` object; a `DateTime` prints as `YYYY-MM-DDTHH:MM:SS.sss+00:00` and parses from any RFC 3339 date-time, as UTC); the one-argument form (TS `printJson(value)`) takes the value's own type |
234
+ | stdlib: `print_error(message, stack) -> str` | `"Error: <message>"` + one `[i] file line:column` per `{filename, line, column}` frame (TS `printError`) |
235
+
236
+ **`East.Blob`**
237
+
238
+ | Signature | Notes |
239
+ |-----------|-------|
240
+ | `encode_beast(value, version="v1", *, typ=None) -> EastBlob` | TS `East.Blob.encodeBeast`: `"v1"` the original BEAST format, `"v2"` the beast2 family; the type is the expression's declared type / `type_of(value)`, or `typ` to encode a plain value under a wider type |
241
+
242
+ **`East`** root: `East.str(*parts)` (TS `East.str` — the parts concatenated, non-String parts printed
243
+ in East text format: `East.str("n=", 5, "!")`), `East.print(value[, typ])` (TS `East.print` — the East
244
+ text format under the value's own type, or `typ`), `East.min(a, b)` / `East.max(a, b)` (`least`/`greatest`
245
+ under East's total order), `East.clamp(value, lo, hi)` and `East.jq(input, program, result_type)`
246
+ ([Queries](control-flow-and-queries.md#queries--eastjq)) — all dual-mode.
247
+
248
+ **`East.DateTime`** (see [DateTime format codes](#datetime-format-codes))
249
+
250
+ | Signature | Notes |
251
+ |-----------|-------|
252
+ | `from_components(year, month=1, day=1, hour=0, minute=0, second=0, millisecond=0)` | construct (TS defaults: the trailing components are the first instant). An out-of-range component NORMALISES into the next one, it never raises: `(2024, 2, 31)` is `2024-03-02`, `(2024, 13, 1)` is `2025-01-01`, `(2023, 2, 29)` is `2023-03-01`. Range-checking the inputs does not catch it (31 February is all in range) — build the date and check `dt.get_month() == month` |
253
+ | `from_epoch_milliseconds(millis)` · `to_epoch_milliseconds(dt) -> int` | epoch round-trip |
254
+ | `get_year/get_month/get_day_of_month/get_day_of_week(dt) -> int` | `get_day_of_week`: Monday == 1 |
255
+ | `get_hour/get_minute/get_second/get_millisecond(dt) -> int` | components |
256
+ | `add_milliseconds(dt, millis)` · `subtract_milliseconds(dt, millis)` · `duration_milliseconds(a, b) -> int` | the raw builtin (`subtract` negates the amount, TS `subtractMilliseconds`): `duration` returns **a − b** (the expression METHOD `a.duration_milliseconds(b)` is the TS method, `b − a`) |
257
+ | `add_/subtract_{seconds,minutes,hours,days,weeks}(dt, n)` | unit sugar over `add_milliseconds` (an int or float `n`; an expression `n` scales inside the body, a Float after scaling) |
258
+ | `duration_{seconds,minutes,hours,days,weeks}(a, b) -> float` | unit sugar over `duration_milliseconds` |
259
+ | `print_formatted(dt, fmt) -> str` · `parse_formatted(s, fmt) -> datetime` | Day.js-style tokens (TS names; `print_format`/`parse_format` are deprecated spellings) |
260
+ | stdlib: `round_down_/round_up_/round_nearest_{millisecond,second,minute,hour,day,week}(dt, step)` | `step` units of the name; weeks align to Mondays (the reference Monday 1969-12-29) |
261
+ | stdlib: `round_down_month(dt, step)` · `round_down_year(dt, step)` | the first instant of the `step`-aligned month / year |
262
+
263
+ **`East.Boolean`**
264
+
265
+ | Signature | Notes |
266
+ |-----------|-------|
267
+ | `not_(x)` · `bit_and(a, b)` · `bit_or(a, b)` · `bit_xor(a, b)` | the BooleanNot / BooleanAnd / BooleanOr / BooleanXor builtins under the TypeScript names (`not`, `bitAnd`, `bitOr`, `bitXor`; `and_`/`or_`/`xor` are deprecated spellings) — both operands are values here, so there is nothing to short-circuit; the expression twins are `.not_()`, `.bit_and`, `.bit_or`, `.bit_xor`, and the short-circuit `.and_(fn(b))`/`.or_(fn(b))` take bodies |
268
+
269
+ **`East`** comparisons (East total order; element type `T` first): `compare(T, a, b) -> int`,
270
+ `equal/not_equal/less/less_equal/greater/greater_equal(T, a, b) -> bool`, and `is_(T, a, b) -> bool` (East `Is`: identity for a mutable container, value otherwise).
271
+
272
+ **`East`** structural diff/patch (any East type `T`; a patch is a value of `PatchType(T)`; every
273
+ function takes `T` explicitly — a type sampled from one value cannot describe both sides of a
274
+ variant diff):
275
+
276
+ | Signature | Notes |
277
+ |-----------|-------|
278
+ | `diff(T, before, after) -> patch` | The patch turning `before` into `after` |
279
+ | `apply_patch(T, value, patch) -> value` | Apply; `apply_patch(T, v, diff(T, v, w)) == w` |
280
+ | `compose_patch(T, first, second) -> patch` | One patch equal to applying `first` then `second` |
281
+ | `invert_patch(T, patch) -> patch` | The undo: applying patch then its inverse round-trips |
282
+
283
+ ## DateTime format codes
284
+
285
+ `print_formatted(dt, fmt)` / `parse_formatted(s, fmt)` take a Day.js-style string; tokens match
286
+ greedily (longest-first), anything else is a literal, and `\` escapes the next char.
287
+ Examples for `2025-03-05 14:09:07.123` (a Wednesday):
288
+
289
+ | Code | Meaning | Ex | Code | Meaning | Ex |
290
+ |------|---------|----|------|---------|----|
291
+ | `YYYY` | 4-digit year | `2025` | `YY` | 2-digit year | `25` |
292
+ | `MMMM` | full month | `March` | `MMM` | short month | `Mar` |
293
+ | `MM` | month 01-12 | `03` | `M` | month 1-12 | `3` |
294
+ | `DD` | day 01-31 | `05` | `D` | day 1-31 | `5` |
295
+ | `dddd` | full weekday | `Wednesday` | `ddd` | short weekday | `Wed` |
296
+ | `dd` | min weekday | `We` | `HH` | hour 00-23 | `14` |
297
+ | `H` | hour 0-23 | `14` | `hh` | hour 01-12 | `02` |
298
+ | `h` | hour 1-12 | `2` | `mm` | minute 00-59 | `09` |
299
+ | `m` | minute 0-59 | `9` | `ss` | second 00-59 | `07` |
300
+ | `s` | second 0-59 | `7` | `SSS` | millisecond | `123` |
301
+ | `A` | AM/PM | `PM` | `a` | am/pm | `pm` |
302
+
303
+ ```python
304
+ East.DateTime.print_formatted(dt, "YYYY-MM-DD HH:mm:ss.SSS") # '2025-03-05 14:09:07.123'
305
+ East.DateTime.print_formatted(dt, "dddd, MMMM D, YYYY h:mm A") # 'Wednesday, March 5, 2025 2:09 PM'
306
+ ```
@@ -0,0 +1,88 @@
1
+ # Constructing and validating East values; JSON contracts
2
+
3
+ `array` / `struct` / `variant` / `coerce_to` / `assert_value_of`, and `json_schema_for` / `type_from_json_schema`. Part of the `east-py` skill.
4
+
5
+ ## Construction & validation (`from east import ...`)
6
+
7
+ | Signature | Description | Example |
8
+ |-----------|-------------|---------|
9
+ | **Ergonomic constructors** |
10
+ | `array(element_type, items, *, validate=True) -> EastArray` | Each item coerced/validated to `element_type` (dict→struct, int→Float, …); `validate=False` stores as-is | `array(LineItem, [{"name":"a","price":1}])` |
11
+ | `struct(fields: dict, typ: StructType\|None=None) -> EastStruct` | Reorders/coerces keys to `typ` (else infers from fields); dual-mode — a field holding an expression (at any depth) builds Struct IR instead | `struct({"price":1,"name":"a"}, LineItem)` |
12
+ | `variant(case: str, value, typ: VariantType\|None=None) -> EastVariant` | Tagged value; validates `value` against case `case` (matched **by name**); read back via `.type`/`.value`; dual-mode — an expression payload builds Variant IR, typed by `typ` or by context | `variant("named", "red", Color)` |
13
+ | `some(value) -> EastVariant` / `none` | Option `some`; `none` is a **constant**, not a function | `some(5)` / `none` |
14
+ | `match(v, cases: dict, default=None)` | Dispatch on `v.type`; the handler is a body, **always** called `handler(b, v.value)` — the `none` arm is `lambda b, v: …`, not `lambda: …`; `default` is a `default(b)` body for the cases without a handler (a plain value is returned as is) | `match(o, {"some": lambda b, x: x, "none": lambda b, v: -1})` |
15
+ | `east_ref(value) -> EastRef` | Make a mutable ref cell (same as `EastRef(value)`) | `east_ref(0)` |
16
+ | **Validation / coercion** — raise `EastTypeError` (`expected X, got Y (at $.path)`) |
17
+ | `coerce_to(value, typ, *, path="$") -> EastValue` | Canonicalize any Python value to a bridge-ready East value, type-driven; a 1-D numpy array fills `Array<Float/Integer/Boolean>` C-side in one bulk crossing (hand struct fields numpy columns directly) | `coerce_to({"qty": np_i64}, InputType)` |
18
+ | `assert_value_of(value, typ, *, path="$") -> value` ❗ | Validate; return value, or raise path-pinpointed `EastTypeError` on first mismatch | `assert_value_of(s, LineItem)` |
19
+ | `explain_value_of(value, typ) -> list[(path, reason)]` | Every mismatch; `[]` == conforms | `explain_value_of(s, LineItem)` |
20
+ | `is_value_of(value, typ) -> bool` | Boolean conformance check | `is_value_of(items, ArrayType(LineItem))` |
21
+ | `type_of(value) -> EastType` | Infer the East type of a value | `type_of(items)` |
22
+
23
+ Container constructors are also direct: `EastArray(elem, items=None)`, `EastSet(elem, items=None)`,
24
+ `EastDict(key, value, items=None)`, `EastVector(elem, data=None, length=0)`,
25
+ `EastMatrix(elem, data=None, rows=0, cols=0)`, `EastRef(value)`.
26
+
27
+ ## A JSON contract for a type — `json_schema_for` / `type_from_json_schema`
28
+
29
+ `East.String.print_json` writes **East JSON**, lossless and self-describing.
30
+ `json_schema_for(T)` emits the JSON Schema of exactly that encoding, so another
31
+ system can validate a payload before sending it; `type_from_json_schema` goes the
32
+ other way. Host-side functions, like `compare_for` — no expression, no IR:
33
+
34
+ ```python
35
+ import json
36
+ from pathlib import Path
37
+
38
+ from east import ArrayType, IntegerType, StringType, StructType
39
+ from east.serialization import json_schema_for, type_from_json_schema
40
+
41
+ Reading = StructType([("sensor", StringType), ("litres", IntegerType)])
42
+ Path("contract.schema.json").write_text(
43
+ json.dumps(json_schema_for(ArrayType(Reading), draft="draft-07"), indent=2))
44
+
45
+ T = type_from_json_schema(json.loads(Path("partner.schema.json").read_text()))
46
+ ```
47
+
48
+ | Signature | Notes |
49
+ |-----------|-------|
50
+ | `json_schema_for(typ, draft="2020-12") -> JsonSchema` | `draft`: `"2020-12"`, `"draft-07"` or `"openapi-3.0"`, as a consumer's validator pins. `Never`, `Function` and `AsyncFunction` raise `TypeError` naming what has no JSON form |
51
+ | `type_from_json_schema(schema) -> EastType` ❗ | Raises `JsonSchemaUnsupportedError` — its `.pointer` the RFC 6901 location, also in the message — on what East cannot express: `allOf`, `not`, `if`/`then`/`else`, `anyOf`, `patternProperties`, `prefixItems`, a union of more than one type, an open record, an optional property, an untagged `oneOf`, a non-local `$ref`, a cycle of definitions no single definition breaks |
52
+ | `EAST_JSON_PATTERNS` | The lexical forms of East JSON's scalars — `.integer` `.blob` `.float_specials` (TypeScript: `floatSpecials`) — so a reader enforces exactly what the schema describes. A DateTime has none: its form is `format: "date-time"` |
53
+
54
+ - **An `Option<T>` is `null` or `T`'s own encoding** wherever `T` can never
55
+ encode as `null`: `none` → `null`, `some(7)` → `"7"`, a struct field
56
+ `"note": null` or `"note": "x"` (an absent key is still an error). Only
57
+ `Option<Null>` and `Option<Option<T>>` keep the tagged `{"type": …, "value":
58
+ …}` object, which keeps `some(none)` apart from `none`; a recursive payload is
59
+ judged by what it wraps. The rule is a total function of the type, applied by
60
+ every codec and reader and by `json_schema_for` (a flat Option is `oneOf
61
+ [null, T]` annotated `x-east-type: "Option"`), and the tagged object under a
62
+ flat Option is refused by the payload's own decoder (`expected string, got
63
+ {"type":"none","value":null}`).
64
+ - **A `DateTime` is `format: "date-time"`**: every decoder, on every runtime,
65
+ reads any RFC 3339 date-time — `Z` or any offset (the instant is UTC), `t`/`z`
66
+ in either case, any fractional digits (past the millisecond dropped, never
67
+ rounded, so `isoformat()`'s microseconds read to the millisecond), a leap
68
+ second as the Unix time its fields add up to — in years 0001–9999, the range
69
+ every runtime holds. `print_json` writes UTC, three fractional digits, `+00:00`.
70
+ - **Other scalars are described as the encoder emits them**: an `Integer` is a
71
+ quoted i64 decimal, a `Blob` lowercase hex (`parse_json` also takes uppercase,
72
+ which the contract does not), so a producer that validates cannot send what a
73
+ strict reader rejects. Every pattern spells digits `[0-9]` — python's `\d`
74
+ matches any Unicode digit — so validators here and in JavaScript agree.
75
+ - **The document is deterministic and byte-identical to TypeScript's
76
+ `jsonSchemaFor`** (key order, `$defs` names in first-encounter order, variant
77
+ case order). Its `x-east-type` annotations make the inverse exact — `Set` vs
78
+ `Array`, `Dict` vs an array of pairs, a flat Option vs any other `oneOf`. A
79
+ foreign schema without them converts under a structural mapping that does not
80
+ promise to round-trip: `format: "date-time"` reads as a `DateTime` (any other
81
+ `format` is a `String`), and `nullable: true`, `["string", "null"]` and a
82
+ `oneOf` of null and one schema read as an Option.
83
+ - **Recursion binds one `recursive_type` per cycle group**: definitions that
84
+ reference each other convert when every cycle passes through one definition,
85
+ the binder; three that each reference the other two need two binders and are
86
+ refused, naming them.
87
+ - To READ a document larger than memory under this contract: `json_open` /
88
+ `json_next` in **east-py-std**.