@calcit/procs 0.13.14 → 0.13.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.yarn/install-state.gz +0 -0
- package/RFCs/07-26-agent-machine-protocol-rfc.md +113 -35
- package/RFCs/07-28-persistent-tree-cursor-rfc.md +22 -4
- package/RFCs/08-05-systematic-nil-reduction-rfc.md +2 -2
- package/RFCs/08-14-architecture-scaffold-rfc.md +534 -0
- package/RFCs/08-14-todo-placeholder-rfc.md +177 -0
- package/RFCs/README.md +3 -1
- package/editing-history/20260814-1412-architecture-scaffold-rfc-and-cursor-envelope.md +46 -0
- package/editing-history/20260814-1640-architecture-scaffold-review-fixes.md +21 -0
- package/editing-history/20260814-1700-fix-bare-empty-map-js-codegen.md +10 -0
- package/editing-history/20260814-1710-map-codegen-callee-context.md +9 -0
- package/editing-history/20260814-1720-option-membership-method-guidance.md +11 -0
- package/editing-history/20260814-1746-pr-352-review-fix.md +8 -0
- package/editing-history/20260814-1858-map-wrapped-data-definitions.md +11 -0
- package/editing-history/20260814-1910-assert-type-struct-narrowing.md +6 -0
- package/editing-history/20260814-1937-assert-type-direct-definitions.md +5 -0
- package/editing-history/20260814-1945-applied-qualified-type-references.md +5 -0
- package/editing-history/20260815-0043-pr-352-assert-type-nominal-guard.md +12 -0
- package/history/202608131607-runtime-map-decoder.md +13 -0
- package/history/202608131625-core-decode-map-as-metadata.md +12 -0
- package/history/202608131650-release-0.13.15.md +10 -0
- package/lib/calcit.procs.d.mts +6 -1
- package/lib/calcit.procs.mjs +133 -0
- package/lib/package.json +1 -1
- package/notes/202608132206-repo-sync.md +3 -0
- package/notes/repos.md +177 -0
- package/package.json +1 -1
- package/ts-src/calcit.procs.mts +132 -1
package/notes/repos.md
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Calcit project repositories
|
|
2
|
+
|
|
3
|
+
This inventory covers the repositories found under the configured local organization directories. The upgrade pass should fetch `origin/main`, inspect open PRs, and use the PR branch when one exists. Projects whose `deps.cirru` already declares Calcit `0.13.15` are skipped.
|
|
4
|
+
|
|
5
|
+
## b-conf
|
|
6
|
+
|
|
7
|
+
- `b-conf/conf-dates`
|
|
8
|
+
- `b-conf/hestory`
|
|
9
|
+
|
|
10
|
+
## calcit-lang
|
|
11
|
+
|
|
12
|
+
- `calcit-lang/algebra`
|
|
13
|
+
- `calcit-lang/apis`
|
|
14
|
+
- `calcit-lang/bisection-key`
|
|
15
|
+
- `calcit-lang/calcit-json`
|
|
16
|
+
- `calcit-lang/calcit-lang.org`
|
|
17
|
+
- `calcit-lang/clipboard`
|
|
18
|
+
- `calcit-lang/code-viewer`
|
|
19
|
+
- `calcit-lang/command`
|
|
20
|
+
- `calcit-lang/convert-edn`
|
|
21
|
+
- `calcit-lang/corokia`
|
|
22
|
+
- `calcit-lang/docs-workflow`
|
|
23
|
+
- `calcit-lang/dylib-workflow`
|
|
24
|
+
- `calcit-lang/editor`
|
|
25
|
+
- `calcit-lang/error-viewer`
|
|
26
|
+
- `calcit-lang/explain-ternary-tree`
|
|
27
|
+
- `calcit-lang/explore-quaternary`
|
|
28
|
+
- `calcit-lang/fetch`
|
|
29
|
+
- `calcit-lang/ffi-calx`
|
|
30
|
+
- `calcit-lang/fswatch`
|
|
31
|
+
- `calcit-lang/gen-code`
|
|
32
|
+
- `calcit-lang/geometric`
|
|
33
|
+
- `calcit-lang/graphviz`
|
|
34
|
+
- `calcit-lang/guidebook`
|
|
35
|
+
- `calcit-lang/http`
|
|
36
|
+
- `calcit-lang/http-workflow`
|
|
37
|
+
- `calcit-lang/ir-viewer`
|
|
38
|
+
- `calcit-lang/jiuzhang-lang`
|
|
39
|
+
- `calcit-lang/lilac`
|
|
40
|
+
- `calcit-lang/lilac-guidebook`
|
|
41
|
+
- `calcit-lang/lilac-parser`
|
|
42
|
+
- `calcit-lang/memof`
|
|
43
|
+
- `calcit-lang/migrate-calcit-class-record`
|
|
44
|
+
- `calcit-lang/minimal-calcit`
|
|
45
|
+
- `calcit-lang/paint`
|
|
46
|
+
- `calcit-lang/phoenix-script`
|
|
47
|
+
- `calcit-lang/quaternion`
|
|
48
|
+
- `calcit-lang/reacher`
|
|
49
|
+
- `calcit-lang/recollect`
|
|
50
|
+
- `calcit-lang/regex`
|
|
51
|
+
- `calcit-lang/repos-rank`
|
|
52
|
+
- `calcit-lang/respo-calcit-workflow`
|
|
53
|
+
- `calcit-lang/skir`
|
|
54
|
+
- `calcit-lang/std`
|
|
55
|
+
- `calcit-lang/std-old`
|
|
56
|
+
- `calcit-lang/stir-template`
|
|
57
|
+
- `calcit-lang/test`
|
|
58
|
+
- `calcit-lang/wasi-calcit/examples`
|
|
59
|
+
- `calcit-lang/wasm-play`
|
|
60
|
+
- `calcit-lang/wasmtime`
|
|
61
|
+
- `calcit-lang/workflow`
|
|
62
|
+
- `calcit-lang/wss`
|
|
63
|
+
|
|
64
|
+
## cirru
|
|
65
|
+
|
|
66
|
+
- `cirru/calcit-editor`
|
|
67
|
+
- `cirru/cirru.org`
|
|
68
|
+
- `cirru/data-former`
|
|
69
|
+
- `cirru/hovenia-editor`
|
|
70
|
+
- `cirru/hv-tree-layout`
|
|
71
|
+
- `cirru/jiuzhang-lang`
|
|
72
|
+
- `cirru/respo-cirru-editor`
|
|
73
|
+
- `cirru/text.cirru.org`
|
|
74
|
+
- `cirru/theme`
|
|
75
|
+
- `cirru/writer.clj`
|
|
76
|
+
|
|
77
|
+
## cumulo
|
|
78
|
+
|
|
79
|
+
- `cumulo/calcium-workflow`
|
|
80
|
+
- `cumulo/cumulo-phlox-workflow`
|
|
81
|
+
- `cumulo/cumulo-util.calcit`
|
|
82
|
+
- `cumulo/cumulo.org`
|
|
83
|
+
- `cumulo/display-latency`
|
|
84
|
+
- `cumulo/reel`
|
|
85
|
+
|
|
86
|
+
## memkits
|
|
87
|
+
|
|
88
|
+
- `memkits/alcea-scribble`
|
|
89
|
+
- `memkits/bullet-train`
|
|
90
|
+
- `memkits/calc-dsl`
|
|
91
|
+
- `memkits/color-pad`
|
|
92
|
+
- `memkits/cyan-red`
|
|
93
|
+
- `memkits/diary-viewer`
|
|
94
|
+
- `memkits/diffview`
|
|
95
|
+
- `memkits/edn-grid`
|
|
96
|
+
- `memkits/edn-tree-viewer`
|
|
97
|
+
- `memkits/garcinia-blocks`
|
|
98
|
+
- `memkits/genai.calcit`
|
|
99
|
+
- `memkits/geometry-book`
|
|
100
|
+
- `memkits/hn-reader`
|
|
101
|
+
- `memkits/in-time`
|
|
102
|
+
- `memkits/life-patterns`
|
|
103
|
+
- `memkits/lutea-reader`
|
|
104
|
+
- `memkits/manuscript`
|
|
105
|
+
- `memkits/markdown-editor`
|
|
106
|
+
- `memkits/memkits.org`
|
|
107
|
+
- `memkits/pick-name`
|
|
108
|
+
- `memkits/poecilia-paint`
|
|
109
|
+
- `memkits/poet-grab`
|
|
110
|
+
- `memkits/proto-shuangpin`
|
|
111
|
+
- `memkits/pudica-schedule`
|
|
112
|
+
- `memkits/pudica-schedule-viewer`
|
|
113
|
+
- `memkits/random-lives`
|
|
114
|
+
- `memkits/sedum-slide`
|
|
115
|
+
- `memkits/sky-chat`
|
|
116
|
+
- `memkits/tco-redirect`
|
|
117
|
+
- `memkits/timegrass-viewer`
|
|
118
|
+
- `memkits/toadflax`
|
|
119
|
+
- `memkits/unfolding-leaf`
|
|
120
|
+
- `memkits/wanderlist`
|
|
121
|
+
|
|
122
|
+
## mvc-works
|
|
123
|
+
|
|
124
|
+
- `mvc-works/edn-formatter`
|
|
125
|
+
- `mvc-works/fuzzy-filter`
|
|
126
|
+
- `mvc-works/lilac-parser`
|
|
127
|
+
- `mvc-works/pointed-prompt`
|
|
128
|
+
- `mvc-works/text-diff`
|
|
129
|
+
- `mvc-works/ws-edn.calcit`
|
|
130
|
+
|
|
131
|
+
## respo
|
|
132
|
+
|
|
133
|
+
- `respo/alerts`
|
|
134
|
+
- `respo/example`
|
|
135
|
+
- `respo/feather`
|
|
136
|
+
- `respo/form.calcit`
|
|
137
|
+
- `respo/guidebook`
|
|
138
|
+
- `respo/markdown`
|
|
139
|
+
- `respo/markup`
|
|
140
|
+
- `respo/message`
|
|
141
|
+
- `respo/reel`
|
|
142
|
+
- `respo/respo`
|
|
143
|
+
- `respo/respo-mvc.org`
|
|
144
|
+
- `respo/router`
|
|
145
|
+
- `respo/ui`
|
|
146
|
+
- `respo/value`
|
|
147
|
+
|
|
148
|
+
## tiye
|
|
149
|
+
|
|
150
|
+
- `tiye/leaf-reading`
|
|
151
|
+
- `tiye/neu-tab`
|
|
152
|
+
- `tiye/tiye.me`
|
|
153
|
+
|
|
154
|
+
## webgpu-art
|
|
155
|
+
|
|
156
|
+
- `webgpu-art/lagopus`
|
|
157
|
+
- `webgpu-art/lagopus-workflow`
|
|
158
|
+
- `webgpu-art/lutra-crafts`
|
|
159
|
+
- `webgpu-art/protea`
|
|
160
|
+
- `webgpu-art/soluble`
|
|
161
|
+
- `webgpu-art/syntax-cards`
|
|
162
|
+
- `webgpu-art/wallpapers`
|
|
163
|
+
- `webgpu-art/webgpu.art`
|
|
164
|
+
|
|
165
|
+
## worktools
|
|
166
|
+
|
|
167
|
+
- `worktools/camera-try`
|
|
168
|
+
- `worktools/color-finder`
|
|
169
|
+
- `worktools/color-ring`
|
|
170
|
+
- `worktools/fontawesome-finder`
|
|
171
|
+
- `worktools/mudder`
|
|
172
|
+
- `worktools/qrcode-shelf`
|
|
173
|
+
- `worktools/qrcode-toy-expo`
|
|
174
|
+
- `worktools/rebase-hell`
|
|
175
|
+
- `worktools/serve-json`
|
|
176
|
+
- `worktools/snippet-splitter`
|
|
177
|
+
- `worktools/walnut-log`
|
package/package.json
CHANGED
package/ts-src/calcit.procs.mts
CHANGED
|
@@ -1676,9 +1676,10 @@ export let parse_cirru_edn = (code: string, options: CalcitValue) => {
|
|
|
1676
1676
|
};
|
|
1677
1677
|
|
|
1678
1678
|
type DataShapeNode =
|
|
1679
|
-
| { kind: "unit" | "bool" | "number" | "string" | "symbol" | "tag" | "buffer" | "cirru-quote" }
|
|
1679
|
+
| { kind: "unit" | "bool" | "number" | "string" | "symbol" | "tag" | "buffer" | "cirru-quote" | "dynamic" }
|
|
1680
1680
|
| { kind: "optional" | "list" | "set" | "ref"; inner: number }
|
|
1681
1681
|
| { kind: "map"; key: number; value: number }
|
|
1682
|
+
| { kind: "map-option"; nominal: CalcitEnumDef; inner: number }
|
|
1682
1683
|
| { kind: "struct"; nominal: CalcitStructDef; fields: Array<[string, number]> }
|
|
1683
1684
|
| { kind: "enum"; nominal: CalcitEnumDef; variants: Array<{ tag: string; payload: number[] }> };
|
|
1684
1685
|
|
|
@@ -1883,6 +1884,136 @@ export let parse_cirru_edn_as = (code: string, graph: DataShapeGraph): CalcitVal
|
|
|
1883
1884
|
return decode_typed_edn_node(graph, graph.root, input, "$", 0) as CalcitValue;
|
|
1884
1885
|
};
|
|
1885
1886
|
|
|
1887
|
+
const map_decode_error = (path: string, message: string): never => {
|
|
1888
|
+
throw new Error(`decode-map-as failed at ${path}: ${message}`);
|
|
1889
|
+
};
|
|
1890
|
+
|
|
1891
|
+
const decode_runtime_map_node = (graph: DataShapeGraph, nodeId: number, input: any, path: string, depth: number): any => {
|
|
1892
|
+
if (depth > 1024) map_decode_error(path, "decode nesting exceeds 1024");
|
|
1893
|
+
const node = graph.nodes[nodeId];
|
|
1894
|
+
if (node == null) map_decode_error(path, `invalid data shape node #${nodeId}`);
|
|
1895
|
+
|
|
1896
|
+
switch (node.kind) {
|
|
1897
|
+
case "dynamic":
|
|
1898
|
+
return input;
|
|
1899
|
+
case "map-option": {
|
|
1900
|
+
if (
|
|
1901
|
+
input instanceof CalcitEnumValue &&
|
|
1902
|
+
(input.enumPrototype === node.nominal || input.enumPrototype?.name() === node.nominal.name())
|
|
1903
|
+
) {
|
|
1904
|
+
const tag: CalcitValue = input.tag;
|
|
1905
|
+
if (!(tag instanceof CalcitTag)) map_decode_error(path, "Option variant is not a tag");
|
|
1906
|
+
const tag_name = (tag as CalcitTag).value;
|
|
1907
|
+
if (tag_name === "none" && input.extra.length === 0) return input;
|
|
1908
|
+
if (tag_name === "some" && input.extra.length === 1) {
|
|
1909
|
+
return new CalcitEnumValue(tag as CalcitTag, [decode_runtime_map_node(graph, node.inner, input.extra[0], path, depth + 1)], node.nominal);
|
|
1910
|
+
}
|
|
1911
|
+
return map_decode_error(path, "invalid Option value");
|
|
1912
|
+
}
|
|
1913
|
+
return new CalcitEnumValue(newTag("some"), [decode_runtime_map_node(graph, node.inner, input, path, depth + 1)], node.nominal);
|
|
1914
|
+
}
|
|
1915
|
+
case "struct": {
|
|
1916
|
+
if (!(input instanceof CalcitMap || input instanceof CalcitSliceMap)) {
|
|
1917
|
+
return map_decode_error(path, `expected map for struct :${node.nominal.name.value}, got ${typed_edn_kind(input)}`);
|
|
1918
|
+
}
|
|
1919
|
+
const entries = new Map<string, any>();
|
|
1920
|
+
input.pairs().forEach(([key, value]) => {
|
|
1921
|
+
const name = key instanceof CalcitTag ? key.value : typeof key === "string" ? key : null;
|
|
1922
|
+
if (name == null) map_decode_error(path, "struct map keys must be tags or strings");
|
|
1923
|
+
if (!node.fields.some(([field]) => field === name)) {
|
|
1924
|
+
map_decode_error(path, `struct :${node.nominal.name.value} has unknown field :${name}`);
|
|
1925
|
+
}
|
|
1926
|
+
if (entries.has(name)) map_decode_error(path, `struct :${node.nominal.name.value} has duplicate field :${name}`);
|
|
1927
|
+
entries.set(name, value);
|
|
1928
|
+
});
|
|
1929
|
+
const decoded = new Map<string, any>();
|
|
1930
|
+
node.fields.forEach(([field, child]) => {
|
|
1931
|
+
if (entries.has(field)) {
|
|
1932
|
+
decoded.set(field, decode_runtime_map_node(graph, child, entries.get(field), `${path}.${field}`, depth + 1));
|
|
1933
|
+
} else {
|
|
1934
|
+
const fieldNode = graph.nodes[child];
|
|
1935
|
+
if (fieldNode?.kind === "map-option") {
|
|
1936
|
+
decoded.set(field, new CalcitEnumValue(newTag("none"), [], fieldNode.nominal));
|
|
1937
|
+
} else {
|
|
1938
|
+
map_decode_error(path, `struct :${node.nominal.name.value} is missing required field :${field}`);
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
});
|
|
1942
|
+
const values = node.nominal.fields.map((field) => decoded.get(field.value));
|
|
1943
|
+
return new CalcitStructValue(node.nominal.name, node.nominal.fields, values, node.nominal);
|
|
1944
|
+
}
|
|
1945
|
+
case "list": {
|
|
1946
|
+
if (!(input instanceof CalcitList || input instanceof CalcitSliceList)) {
|
|
1947
|
+
return map_decode_error(path, `expected list, got ${typed_edn_kind(input)}`);
|
|
1948
|
+
}
|
|
1949
|
+
return new CalcitSliceList(Array.from(input.items()).map((value, idx) => decode_runtime_map_node(graph, node.inner, value, `${path}[${idx}]`, depth + 1)));
|
|
1950
|
+
}
|
|
1951
|
+
case "set": {
|
|
1952
|
+
if (!(input instanceof CalcitSet || input instanceof TypedEdnSetView)) {
|
|
1953
|
+
return map_decode_error(path, `expected set, got ${typed_edn_kind(input)}`);
|
|
1954
|
+
}
|
|
1955
|
+
const values: any[] = [];
|
|
1956
|
+
const source = input instanceof TypedEdnSetView ? input.items : input.values();
|
|
1957
|
+
source.forEach((value) => {
|
|
1958
|
+
const decoded = decode_runtime_map_node(graph, node.inner, value, `${path}.item`, depth + 1);
|
|
1959
|
+
if (values.some((item) => _$n__$e_(item, decoded))) map_decode_error(path, "duplicate decoded set value");
|
|
1960
|
+
values.push(decoded);
|
|
1961
|
+
});
|
|
1962
|
+
return new CalcitSet(values);
|
|
1963
|
+
}
|
|
1964
|
+
case "map": {
|
|
1965
|
+
if (!(input instanceof CalcitMap || input instanceof CalcitSliceMap)) {
|
|
1966
|
+
return map_decode_error(path, `expected map, got ${typed_edn_kind(input)}`);
|
|
1967
|
+
}
|
|
1968
|
+
const entries: any[] = [];
|
|
1969
|
+
input.pairs().forEach(([key, value]) => {
|
|
1970
|
+
const decodedKey = decode_runtime_map_node(graph, node.key, key, `${path}.key`, depth + 1);
|
|
1971
|
+
if (entries.some(([existing]) => _$n__$e_(existing, decodedKey))) map_decode_error(path, "duplicate decoded map key");
|
|
1972
|
+
entries.push([decodedKey, decode_runtime_map_node(graph, node.value, value, `${path}.value`, depth + 1)]);
|
|
1973
|
+
});
|
|
1974
|
+
return new CalcitSliceMap(entries.flat());
|
|
1975
|
+
}
|
|
1976
|
+
case "optional":
|
|
1977
|
+
return input == null ? null : decode_runtime_map_node(graph, node.inner, input, path, depth + 1);
|
|
1978
|
+
case "ref":
|
|
1979
|
+
if (!(input instanceof CalcitRef)) return map_decode_error(path, `expected atom, got ${typed_edn_kind(input)}`);
|
|
1980
|
+
return atom(decode_runtime_map_node(graph, node.inner, input.value, `${path}.value`, depth + 1));
|
|
1981
|
+
case "enum": {
|
|
1982
|
+
if (!(input instanceof CalcitEnumValue) || input.enumPrototype == null) {
|
|
1983
|
+
return map_decode_error(path, `expected enum :${node.nominal.name()}, got ${typed_edn_kind(input)}`);
|
|
1984
|
+
}
|
|
1985
|
+
const actualEnumName = enum_prototype_name(input.enumPrototype);
|
|
1986
|
+
if (actualEnumName !== node.nominal.name()) {
|
|
1987
|
+
return map_decode_error(path, `expected enum :${node.nominal.name()}, got enum :${actualEnumName}`);
|
|
1988
|
+
}
|
|
1989
|
+
if (!(input.tag instanceof CalcitTag)) return map_decode_error(path, `enum :${node.nominal.name()} variant must be a tag`);
|
|
1990
|
+
const inputTag = input.tag as CalcitTag;
|
|
1991
|
+
const variant = node.variants.find((candidate) => candidate.tag === inputTag.value);
|
|
1992
|
+
if (variant == null) return map_decode_error(path, `enum :${node.nominal.name()} has no variant :${inputTag.value}`);
|
|
1993
|
+
if (variant.payload.length !== input.extra.length) {
|
|
1994
|
+
return map_decode_error(
|
|
1995
|
+
path,
|
|
1996
|
+
`enum :${node.nominal.name()} variant :${variant.tag} expects ${variant.payload.length} payload(s), got ${input.extra.length}`
|
|
1997
|
+
);
|
|
1998
|
+
}
|
|
1999
|
+
const values = variant.payload.map((payloadNode, idx) =>
|
|
2000
|
+
decode_runtime_map_node(graph, payloadNode, input.extra[idx], `${path}.payload[${idx}]`, depth + 1)
|
|
2001
|
+
);
|
|
2002
|
+
return new CalcitEnumValue(newTag(variant.tag), values, node.nominal);
|
|
2003
|
+
}
|
|
2004
|
+
default:
|
|
2005
|
+
return decode_typed_edn_node(graph, nodeId, input, path, depth);
|
|
2006
|
+
}
|
|
2007
|
+
};
|
|
2008
|
+
|
|
2009
|
+
export let decode_map_as = (value: CalcitValue, graph: DataShapeGraph): CalcitValue => {
|
|
2010
|
+
if (graph.version !== 1) throw new Error(`decode-map-as expected data shape ABI version 1, got ${graph.version}`);
|
|
2011
|
+
if (typeof graph.fingerprint !== "string" || graph.fingerprint.length === 0) {
|
|
2012
|
+
throw new Error("decode-map-as expected a non-empty data shape fingerprint");
|
|
2013
|
+
}
|
|
2014
|
+
return decode_runtime_map_node(graph, graph.root, value, "$", 0) as CalcitValue;
|
|
2015
|
+
};
|
|
2016
|
+
|
|
1886
2017
|
const json_to_calcit = (value: any): CalcitValue => {
|
|
1887
2018
|
if (value == null) return null;
|
|
1888
2019
|
if (typeof value === "string") return value;
|