@scriptc/compiler 0.0.6 → 0.0.7
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/dist/backend/emission/emitter.js +7 -0
- package/dist/backend/emission/emitter.js.map +1 -1
- package/dist/backend/llvm/emitter.js +11 -2
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/diagnostics/diagnostic.d.ts +6 -0
- package/dist/diagnostics/diagnostic.js +16 -0
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/frontend/lib-contract.d.ts +96 -0
- package/dist/frontend/lib-contract.js +291 -0
- package/dist/frontend/lib-contract.js.map +1 -0
- package/dist/frontend/lowering/lower-exprs.js +19 -4
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.js +9 -1
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.js +60 -1
- package/dist/index.js.map +1 -1
- package/dist/ir/nodes.d.ts +20 -0
- package/dist/ir/nodes.js +68 -0
- package/dist/ir/nodes.js.map +1 -1
- package/dist/library/profile.d.ts +36 -0
- package/dist/library/profile.js +105 -3
- package/dist/library/profile.js.map +1 -1
- package/dist/library/sidecar-validate.d.ts +4 -0
- package/dist/library/sidecar-validate.js +506 -0
- package/dist/library/sidecar-validate.js.map +1 -0
- package/dist/library/sidecar.d.ts +191 -0
- package/dist/library/sidecar.js +568 -0
- package/dist/library/sidecar.js.map +1 -0
- package/dist/library/wyhash.d.ts +12 -0
- package/dist/library/wyhash.js +116 -0
- package/dist/library/wyhash.js.map +1 -0
- package/package.json +2 -2
- package/surface-manifest.json +1 -1
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
/* The ask-2 contract sidecar emitter: projects the entry module's typed
|
|
2
|
+
* contract into the profile-supplied schema (format 1) — a single JSON
|
|
3
|
+
* document beside the archive carrying the version/identity spine, the
|
|
4
|
+
* type table, the model/msg designations, helper signatures, shape flags,
|
|
5
|
+
* channels, the ABI attestation, and the determinism attestations.
|
|
6
|
+
*
|
|
7
|
+
* The sidecar is the CONTRACT, not the program: no source spans, no
|
|
8
|
+
* bodies, no IR, no environment or machine data, no absolute paths, no
|
|
9
|
+
* timestamps. Emission is deterministic — top-level keys in the schema's
|
|
10
|
+
* §1 order, every array order semantic (declaration order where the
|
|
11
|
+
* schema says declaration, profile canonical order for abi.exports), so
|
|
12
|
+
* re-running the identical invocation reproduces a byte-identical file.
|
|
13
|
+
*
|
|
14
|
+
* Declaration order is read from the SYNTAX TREE (frontend/lib-contract.ts)
|
|
15
|
+
* — never from checker property enumeration, which hands back internal or
|
|
16
|
+
* sorted order (the ratified record-field-order ruling: the IR's sorted
|
|
17
|
+
* canonicalization is storage; AST order is the contract).
|
|
18
|
+
*
|
|
19
|
+
* Not-yet facts emit the schema's stated absent forms, never invented
|
|
20
|
+
* values: `integer_slots` is `[]` with every numeric slot spelled `f64`
|
|
21
|
+
* (the pre-ask-4 sequencing the schema names valid — the empty list is
|
|
22
|
+
* itself an attestation), and `deterministic` is computed from the module
|
|
23
|
+
* graph (ir/nodes.ts's conservative ambient-surface scan), never
|
|
24
|
+
* defaulted. */
|
|
25
|
+
import { Buffer } from "node:buffer";
|
|
26
|
+
import { readFileSync } from "node:fs";
|
|
27
|
+
import { dirname, isAbsolute, join, relative, sep } from "node:path";
|
|
28
|
+
import { fileURLToPath } from "node:url";
|
|
29
|
+
import { libSidecarDiag } from "../diagnostics/diagnostic.js";
|
|
30
|
+
import { BUILD_ID_SEED, hex16, lengthPrefixedStream, SOURCE_HASH_SEED, wyhash64 } from "./wyhash.js";
|
|
31
|
+
/** The sidecar schema's format this emitter writes. */
|
|
32
|
+
export const SIDECAR_FORMAT = 1;
|
|
33
|
+
/* ── identity hashing (schema §2 + the "module-graph" source contract) ─── */
|
|
34
|
+
let releaseVersion = null;
|
|
35
|
+
/** The compiler's exact release identifier — the published package
|
|
36
|
+
* version, read once from the compiler package's own package.json (this
|
|
37
|
+
* module lives two levels below the package root in src/ and dist/
|
|
38
|
+
* alike). build_id input 1 and the sidecar's `compiler_version`. */
|
|
39
|
+
export function compilerReleaseVersion() {
|
|
40
|
+
if (releaseVersion === null) {
|
|
41
|
+
const pkgPath = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "package.json");
|
|
42
|
+
releaseVersion = JSON.parse(readFileSync(pkgPath, "utf8")).version;
|
|
43
|
+
}
|
|
44
|
+
return releaseVersion;
|
|
45
|
+
}
|
|
46
|
+
/** One path under the sidecar's canonical rules: compilation-root-relative
|
|
47
|
+
* POSIX, or `profile:`-namespaced when the file sits outside the root
|
|
48
|
+
* (never absolute, no `.`/`..` segments). */
|
|
49
|
+
export function canonicalPath(rootDir, file) {
|
|
50
|
+
const rel = relative(rootDir, file);
|
|
51
|
+
if (rel === "" || rel.startsWith("..") || isAbsolute(rel)) {
|
|
52
|
+
return `profile:${file.split(/[\\/]/).pop()}`;
|
|
53
|
+
}
|
|
54
|
+
return sep === "/" ? rel : rel.split(sep).join("/");
|
|
55
|
+
}
|
|
56
|
+
/** Canonicalize + sort the module graph for hashing: root-relative POSIX
|
|
57
|
+
* paths, ascending by plain bytewise comparison of the path strings. A
|
|
58
|
+
* module outside the compilation root (the profile file's directory)
|
|
59
|
+
* cannot spell a canonical relative path, so it rides the `profile:`
|
|
60
|
+
* namespace under its basename — deterministic and absolute-path-free. */
|
|
61
|
+
export function canonicalModuleGraph(rootDir, sources) {
|
|
62
|
+
const enc = new TextEncoder();
|
|
63
|
+
const entries = [];
|
|
64
|
+
for (const [file, text] of sources) {
|
|
65
|
+
entries.push({ canonical: canonicalPath(rootDir, file), bytes: enc.encode(text) });
|
|
66
|
+
}
|
|
67
|
+
entries.sort((a, b) => {
|
|
68
|
+
const c = Buffer.compare(Buffer.from(a.canonical, "utf8"), Buffer.from(b.canonical, "utf8"));
|
|
69
|
+
return c !== 0 ? c : Buffer.compare(a.bytes, b.bytes);
|
|
70
|
+
});
|
|
71
|
+
return entries;
|
|
72
|
+
}
|
|
73
|
+
/** build_id (schema §2: compiler version, profile bytes, sorted module
|
|
74
|
+
* graph — every input length-prefixed) and source_hash (the
|
|
75
|
+
* "module-graph" contract: the sorted module graph alone, so the value is
|
|
76
|
+
* stable across compiler releases). Both 16 lowercase hex digits. */
|
|
77
|
+
export function libraryIdentityHashes(compilerVersion, profileBytes, modules) {
|
|
78
|
+
const enc = new TextEncoder();
|
|
79
|
+
const graphChunks = [];
|
|
80
|
+
for (const m of modules) {
|
|
81
|
+
graphChunks.push(enc.encode(m.canonical), m.bytes);
|
|
82
|
+
}
|
|
83
|
+
const buildChunks = [enc.encode(compilerVersion), profileBytes, ...graphChunks];
|
|
84
|
+
return {
|
|
85
|
+
buildId: hex16(wyhash64(lengthPrefixedStream(buildChunks), BUILD_ID_SEED)),
|
|
86
|
+
sourceHash: hex16(wyhash64(lengthPrefixedStream(graphChunks), SOURCE_HASH_SEED)),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/** The profile's canonical `abi.exports` suffix order: the identity
|
|
90
|
+
* getters first (abi_version, then build_id), the mode-provided entries
|
|
91
|
+
* (sink registration, init, collect, reset — declared ones only), then
|
|
92
|
+
* the export map in profile order. Suffix = symbol minus prefix. */
|
|
93
|
+
export function abiExportSuffixes(profile) {
|
|
94
|
+
const strip = (sym) => sym.slice(profile.prefix.length);
|
|
95
|
+
const out = [];
|
|
96
|
+
if (profile.sidecar !== null) {
|
|
97
|
+
out.push(strip(profile.sidecar.abiVersionSymbol), strip(profile.sidecar.buildIdSymbol));
|
|
98
|
+
}
|
|
99
|
+
out.push(strip(profile.sinkRegisterSymbol), strip(profile.initSymbol));
|
|
100
|
+
if (profile.collectSymbol !== null)
|
|
101
|
+
out.push(strip(profile.collectSymbol));
|
|
102
|
+
if (profile.resultResetSymbol !== null)
|
|
103
|
+
out.push(strip(profile.resultResetSymbol));
|
|
104
|
+
for (const e of profile.exports)
|
|
105
|
+
out.push(strip(e.symbol));
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
function classify(decl, index) {
|
|
109
|
+
const s = decl.shape;
|
|
110
|
+
if (s.k === "unsupported")
|
|
111
|
+
return { c: "unsupported", why: s.text, decl, index };
|
|
112
|
+
if (s.k === "object") {
|
|
113
|
+
return { c: "struct", storage: decl.form === "interface" ? "node" : "value", fields: s.fields, decl, index };
|
|
114
|
+
}
|
|
115
|
+
if (decl.form === "alias" && s.k === "stringLit")
|
|
116
|
+
return { c: "enum", members: [s.text], decl, index };
|
|
117
|
+
if (decl.form === "alias" && s.k === "union") {
|
|
118
|
+
if (s.parts.every((p) => p.k === "stringLit")) {
|
|
119
|
+
return { c: "enum", members: s.parts.map((p) => p.text), decl, index };
|
|
120
|
+
}
|
|
121
|
+
const arms = [];
|
|
122
|
+
for (const p of s.parts) {
|
|
123
|
+
if (p.k !== "object") {
|
|
124
|
+
return { c: "unsupported", why: "a union mixing non-object constituents (a tagged union's arms are object literals with a string-literal 'kind')", decl, index };
|
|
125
|
+
}
|
|
126
|
+
const kindField = p.fields.find((f) => f.name === "kind");
|
|
127
|
+
if (kindField === undefined || kindField.shape.k !== "stringLit" || kindField.optional) {
|
|
128
|
+
return { c: "unsupported", why: "a union constituent without a non-optional string-literal 'kind' discriminant", decl, index };
|
|
129
|
+
}
|
|
130
|
+
arms.push({ name: kindField.shape.text, fields: p.fields.filter((f) => f.name !== "kind"), loc: kindField.loc });
|
|
131
|
+
}
|
|
132
|
+
return { c: "tagged", arms, decl, index };
|
|
133
|
+
}
|
|
134
|
+
return { c: "unsupported", why: `a shape outside the sidecar's vocabulary (${s.k})`, decl, index };
|
|
135
|
+
}
|
|
136
|
+
class SidecarError extends Error {
|
|
137
|
+
detail;
|
|
138
|
+
loc;
|
|
139
|
+
constructor(detail, loc) {
|
|
140
|
+
super(detail);
|
|
141
|
+
this.detail = detail;
|
|
142
|
+
this.loc = loc;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
class Projector {
|
|
146
|
+
facts;
|
|
147
|
+
config;
|
|
148
|
+
entryLoc;
|
|
149
|
+
byName = new Map();
|
|
150
|
+
table = new Map();
|
|
151
|
+
inProgress = new Set();
|
|
152
|
+
synthCounter = 0;
|
|
153
|
+
constructor(facts, config, entryLoc) {
|
|
154
|
+
this.facts = facts;
|
|
155
|
+
this.config = config;
|
|
156
|
+
this.entryLoc = entryLoc;
|
|
157
|
+
facts.types.forEach((decl, index) => {
|
|
158
|
+
if (this.byName.has(decl.name)) {
|
|
159
|
+
throw new SidecarError(`the entry module declares '${decl.name}' twice — the type table has one namespace`, decl.loc);
|
|
160
|
+
}
|
|
161
|
+
this.byName.set(decl.name, classify(decl, index));
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
lookup(name, loc) {
|
|
165
|
+
const c = this.byName.get(name);
|
|
166
|
+
if (c === undefined) {
|
|
167
|
+
throw new SidecarError(`'${name}' is not an exported type declaration of the entry module`, loc);
|
|
168
|
+
}
|
|
169
|
+
if (c.c === "unsupported") {
|
|
170
|
+
throw new SidecarError(`'${name}' cannot join the type table: it is ${c.why}`, c.decl.loc);
|
|
171
|
+
}
|
|
172
|
+
return c;
|
|
173
|
+
}
|
|
174
|
+
/** Project a syntactic field to a TypeRef, tabling every named type it
|
|
175
|
+
* references. `container`/`member` seed synthesized names. */
|
|
176
|
+
fieldRef(field, container) {
|
|
177
|
+
const inner = this.shapeRef(field.shape, container, field.name, field.loc);
|
|
178
|
+
if (field.optional) {
|
|
179
|
+
if (inner.kind === "optional")
|
|
180
|
+
return inner;
|
|
181
|
+
return { kind: "optional", inner };
|
|
182
|
+
}
|
|
183
|
+
return inner;
|
|
184
|
+
}
|
|
185
|
+
shapeRef(shape, container, member, loc) {
|
|
186
|
+
switch (shape.k) {
|
|
187
|
+
case "bool":
|
|
188
|
+
return { kind: "bool" };
|
|
189
|
+
case "number":
|
|
190
|
+
// Every numeric slot spells f64 until ask-4 integer inference
|
|
191
|
+
// lands (the schema's stated pre-inference sequencing).
|
|
192
|
+
return { kind: "f64" };
|
|
193
|
+
case "text":
|
|
194
|
+
case "bytes":
|
|
195
|
+
return { kind: "bytes" };
|
|
196
|
+
case "array":
|
|
197
|
+
return { kind: "slice", elem: this.shapeRef(shape.elem, container, member, loc) };
|
|
198
|
+
case "union": {
|
|
199
|
+
const present = shape.parts.filter((p) => p.k !== "absent");
|
|
200
|
+
const absents = shape.parts.length - present.length;
|
|
201
|
+
if (absents > 0 && present.length === 1) {
|
|
202
|
+
const inner = this.shapeRef(present[0], container, member, loc);
|
|
203
|
+
return inner.kind === "optional" ? inner : { kind: "optional", inner };
|
|
204
|
+
}
|
|
205
|
+
throw new SidecarError(`'${container}.${member}' is an inline union — declare it as a named kind-tagged union (or a string-literal-union enum) and reference it by name`, loc);
|
|
206
|
+
}
|
|
207
|
+
case "ref": {
|
|
208
|
+
const c = this.lookup(shape.name, loc);
|
|
209
|
+
if (c.c === "struct") {
|
|
210
|
+
this.tableNamed(shape.name, loc);
|
|
211
|
+
return { kind: c.storage, name: shape.name };
|
|
212
|
+
}
|
|
213
|
+
if (c.c === "enum") {
|
|
214
|
+
this.tableNamed(shape.name, loc);
|
|
215
|
+
return { kind: "enum", name: shape.name };
|
|
216
|
+
}
|
|
217
|
+
if (shape.name === this.config.msg) {
|
|
218
|
+
throw new SidecarError(`'${container}.${member}' references the designated msg union '${shape.name}' — the msg union is the dispatch surface, not a table type`, loc);
|
|
219
|
+
}
|
|
220
|
+
this.tableNamed(shape.name, loc);
|
|
221
|
+
return { kind: "union", name: shape.name };
|
|
222
|
+
}
|
|
223
|
+
case "object":
|
|
224
|
+
return { kind: "value", name: this.tableSynthesized(container, member, shape.fields, loc) };
|
|
225
|
+
case "stringLit":
|
|
226
|
+
throw new SidecarError(`'${container}.${member}' is a bare string-literal type — declare a named string-literal union and reference it as an enum`, loc);
|
|
227
|
+
case "void":
|
|
228
|
+
throw new SidecarError(`'${container}.${member}' is void — void exists only as a bare union arm's payload`, loc);
|
|
229
|
+
case "absent":
|
|
230
|
+
throw new SidecarError(`'${container}.${member}' is null/undefined alone — pair it with a value type for an optional slot`, loc);
|
|
231
|
+
case "tuple":
|
|
232
|
+
throw new SidecarError(`'${container}.${member}' is a tuple — the sidecar vocabulary has slices and named records, not positional tuples`, loc);
|
|
233
|
+
case "unsupported":
|
|
234
|
+
throw new SidecarError(`'${container}.${member}' has no sidecar projection: ${shape.text}`, loc);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/** Ensure a declared type's table entry exists (recursively projecting
|
|
238
|
+
* what it references). Cycles refuse: recursive contract types cannot
|
|
239
|
+
* encode (schema rule V5). */
|
|
240
|
+
tableNamed(name, loc) {
|
|
241
|
+
if (this.table.has(name))
|
|
242
|
+
return;
|
|
243
|
+
if (name === this.config.msg) {
|
|
244
|
+
throw new SidecarError(`the designated msg union '${name}' cannot join the type table`, loc);
|
|
245
|
+
}
|
|
246
|
+
if (this.inProgress.has(name)) {
|
|
247
|
+
throw new SidecarError(`the contract type graph is cyclic through '${name}' — recursive contract types cannot encode`, loc);
|
|
248
|
+
}
|
|
249
|
+
const c = this.lookup(name, loc);
|
|
250
|
+
this.inProgress.add(name);
|
|
251
|
+
try {
|
|
252
|
+
if (c.c === "enum") {
|
|
253
|
+
const seen = new Set();
|
|
254
|
+
for (const m of c.members) {
|
|
255
|
+
if (seen.has(m))
|
|
256
|
+
throw new SidecarError(`enum '${name}' repeats member '${m}'`, c.decl.loc);
|
|
257
|
+
seen.add(m);
|
|
258
|
+
}
|
|
259
|
+
this.table.set(name, { kind: "enum", entry: { name, members: c.members }, anchor: c.index, sub: -1 });
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (c.c === "struct") {
|
|
263
|
+
const entry = { name, fields: [] };
|
|
264
|
+
// Insert before projecting fields? No: cycle detection rides
|
|
265
|
+
// inProgress; the entry lands complete.
|
|
266
|
+
const seen = new Set();
|
|
267
|
+
for (const f of c.fields) {
|
|
268
|
+
if (seen.has(f.name))
|
|
269
|
+
throw new SidecarError(`record '${name}' repeats field '${f.name}'`, f.loc);
|
|
270
|
+
seen.add(f.name);
|
|
271
|
+
entry.fields.push({ name: f.name, type: this.fieldRef(f, name) });
|
|
272
|
+
}
|
|
273
|
+
this.table.set(name, { kind: "struct", entry, anchor: c.index, sub: -1 });
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
// A named tagged union (never the msg union — fenced above).
|
|
277
|
+
const entry = { name, arms: [] };
|
|
278
|
+
const seen = new Set();
|
|
279
|
+
for (const arm of c.arms) {
|
|
280
|
+
if (seen.has(arm.name))
|
|
281
|
+
throw new SidecarError(`union '${name}' repeats arm '${arm.name}'`, arm.loc);
|
|
282
|
+
seen.add(arm.name);
|
|
283
|
+
entry.arms.push({ name: arm.name, payload: this.armPayloadRef(name, arm) });
|
|
284
|
+
}
|
|
285
|
+
this.table.set(name, { kind: "union", entry, anchor: c.index, sub: -1 });
|
|
286
|
+
}
|
|
287
|
+
finally {
|
|
288
|
+
this.inProgress.delete(name);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/** A named union arm's payload TypeRef: void for bare arms, the single
|
|
292
|
+
* payload field's type, or a synthesized by-value record for
|
|
293
|
+
* multi-field inline payloads. */
|
|
294
|
+
armPayloadRef(unionName, arm) {
|
|
295
|
+
if (arm.fields.length === 0)
|
|
296
|
+
return { kind: "void" };
|
|
297
|
+
if (arm.fields.length === 1)
|
|
298
|
+
return this.fieldRef(arm.fields[0], unionName);
|
|
299
|
+
return { kind: "value", name: this.tableSynthesized(unionName, arm.name, arm.fields, arm.loc) };
|
|
300
|
+
}
|
|
301
|
+
/** Table an anonymous inline record under the schema's synthesized-name
|
|
302
|
+
* contract: `<Container>_<member>`, deterministic and stable across
|
|
303
|
+
* identical re-compiles, unique in the one namespace. */
|
|
304
|
+
tableSynthesized(container, member, fields, loc) {
|
|
305
|
+
const name = `${container}_${member}`;
|
|
306
|
+
const existing = this.table.get(name);
|
|
307
|
+
if (existing !== undefined)
|
|
308
|
+
return name; // the same inline decl, revisited
|
|
309
|
+
if (this.byName.has(name)) {
|
|
310
|
+
throw new SidecarError(`the inline record at '${container}.${member}' needs the synthesized name '${name}', which a declared type already uses — rename one`, loc);
|
|
311
|
+
}
|
|
312
|
+
const entry = { name, synthesized: true, fields: [] };
|
|
313
|
+
const anchor = this.byName.get(container)?.index ?? this.facts.types.length;
|
|
314
|
+
const sub = this.synthCounter++;
|
|
315
|
+
this.table.set(name, { kind: "struct", entry, anchor, sub });
|
|
316
|
+
const seen = new Set();
|
|
317
|
+
for (const f of fields) {
|
|
318
|
+
if (seen.has(f.name))
|
|
319
|
+
throw new SidecarError(`the inline record at '${container}.${member}' repeats field '${f.name}'`, f.loc);
|
|
320
|
+
seen.add(f.name);
|
|
321
|
+
entry.fields.push({ name: f.name, type: this.fieldRef(f, name) });
|
|
322
|
+
}
|
|
323
|
+
return name;
|
|
324
|
+
}
|
|
325
|
+
/** A msg arm's payload descriptor (§5's five families). */
|
|
326
|
+
msgDescriptor(msgName, arm) {
|
|
327
|
+
const fields = arm.fields;
|
|
328
|
+
if (fields.length === 0)
|
|
329
|
+
return { kind: "void" };
|
|
330
|
+
if (fields.length === 2) {
|
|
331
|
+
const [first, second] = [fields[0], fields[1]];
|
|
332
|
+
// Family 4 covers exactly the number-first two-field record; a
|
|
333
|
+
// bytes-first spelling takes the record family instead
|
|
334
|
+
// (declaration order is semantic everywhere — the clarified rule).
|
|
335
|
+
if (!first.optional &&
|
|
336
|
+
!second.optional &&
|
|
337
|
+
first.shape.k === "number" &&
|
|
338
|
+
(second.shape.k === "text" || second.shape.k === "bytes")) {
|
|
339
|
+
return { kind: "number_bytes", number_field: first.name, number_class: "f64", bytes_field: second.name };
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
if (fields.length === 1 && !fields[0].optional) {
|
|
343
|
+
const ref = this.fieldRef(fields[0], msgName);
|
|
344
|
+
switch (ref.kind) {
|
|
345
|
+
case "bytes":
|
|
346
|
+
return { kind: "bytes" };
|
|
347
|
+
case "f64":
|
|
348
|
+
case "i64":
|
|
349
|
+
return { kind: "number", class: ref.kind };
|
|
350
|
+
case "node":
|
|
351
|
+
case "value":
|
|
352
|
+
return { kind: "record", name: ref.name };
|
|
353
|
+
case "union":
|
|
354
|
+
return { kind: "union", name: ref.name };
|
|
355
|
+
case "enum":
|
|
356
|
+
return { kind: "enum", name: ref.name };
|
|
357
|
+
case "void":
|
|
358
|
+
return { kind: "void" };
|
|
359
|
+
default:
|
|
360
|
+
return { kind: "scalar", type: ref };
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
// Everything else — bytes-first pairs, three-plus fields, optional
|
|
364
|
+
// payload fields — tables a synthesized record (family 5).
|
|
365
|
+
return { kind: "record", name: this.tableSynthesized(msgName, arm.name, fields, arm.loc) };
|
|
366
|
+
}
|
|
367
|
+
/** The finished type table, each array in declaration order (synthesized
|
|
368
|
+
* entries anchor at their containing declaration). */
|
|
369
|
+
finishedTable() {
|
|
370
|
+
const ordered = [...this.table.values()].sort((a, b) => a.anchor - b.anchor || a.sub - b.sub);
|
|
371
|
+
return {
|
|
372
|
+
structs: ordered.filter((e) => e.kind === "struct").map((e) => e.entry),
|
|
373
|
+
enums: ordered.filter((e) => e.kind === "enum").map((e) => e.entry),
|
|
374
|
+
unions: ordered.filter((e) => e.kind === "union").map((e) => e.entry),
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
/** Whether a helper's result rides the transient result arena (anything
|
|
379
|
+
* materialized: buffers, slices, records, optionals) rather than a plain
|
|
380
|
+
* scalar return. */
|
|
381
|
+
function helperArena(returns) {
|
|
382
|
+
return returns.kind !== "bool" && returns.kind !== "f64" && returns.kind !== "i64" && returns.kind !== "enum";
|
|
383
|
+
}
|
|
384
|
+
export function buildSidecar(input) {
|
|
385
|
+
const { profile, facts } = input;
|
|
386
|
+
const config = profile.sidecar;
|
|
387
|
+
const entryLoc = { file: profile.entry, start: 0, end: 0 };
|
|
388
|
+
const diagnostics = [];
|
|
389
|
+
for (const m of facts.malformedConsts) {
|
|
390
|
+
diagnostics.push(libSidecarDiag(`exported const '${m.name}' ${m.detail}`, m.loc));
|
|
391
|
+
}
|
|
392
|
+
if (diagnostics.length > 0)
|
|
393
|
+
return { ok: false, diagnostics };
|
|
394
|
+
try {
|
|
395
|
+
const projector = new Projector(facts, config, entryLoc);
|
|
396
|
+
// The model: the designated root state type, a record in the table.
|
|
397
|
+
const modelClass = projector.lookup(config.model, entryLoc);
|
|
398
|
+
if (modelClass.c !== "struct") {
|
|
399
|
+
throw new SidecarError(`the profile designates model '${config.model}', which is not a record type`, modelClass.decl.loc);
|
|
400
|
+
}
|
|
401
|
+
projector.tableNamed(config.model, entryLoc);
|
|
402
|
+
const modelFieldNames = new Set(modelClass.fields.map((f) => f.name));
|
|
403
|
+
// The msg union: declaration-order arms, positional wire tags, at
|
|
404
|
+
// most 256 arms (tags ride a u8).
|
|
405
|
+
const msgClass = projector.lookup(config.msg, entryLoc);
|
|
406
|
+
if (msgClass.c !== "tagged") {
|
|
407
|
+
throw new SidecarError(`the profile designates msg '${config.msg}', which is not a kind-tagged union of object literals`, msgClass.decl.loc);
|
|
408
|
+
}
|
|
409
|
+
if (msgClass.arms.length > 256) {
|
|
410
|
+
throw new SidecarError(`msg union '${config.msg}' declares ${msgClass.arms.length} arms — wire tags ride a u8, so at most 256 are permitted`, msgClass.decl.loc);
|
|
411
|
+
}
|
|
412
|
+
const seenArms = new Set();
|
|
413
|
+
const msgArms = [];
|
|
414
|
+
for (const arm of msgClass.arms) {
|
|
415
|
+
if (seenArms.has(arm.name))
|
|
416
|
+
throw new SidecarError(`msg union '${config.msg}' repeats arm '${arm.name}'`, arm.loc);
|
|
417
|
+
seenArms.add(arm.name);
|
|
418
|
+
msgArms.push({ name: arm.name, payload: projector.msgDescriptor(config.msg, arm) });
|
|
419
|
+
}
|
|
420
|
+
const armByName = new Map(msgArms.map((a) => [a.name, a.payload]));
|
|
421
|
+
// Helpers: exported functions taking the model first, in declaration
|
|
422
|
+
// order (the array index is the ABI call index), minus the designated
|
|
423
|
+
// init/update/subscriptions entries.
|
|
424
|
+
const designated = new Set([config.initExport, config.updateExport, config.subscriptionsExport]);
|
|
425
|
+
const helpers = [];
|
|
426
|
+
for (const fn of facts.functions) {
|
|
427
|
+
if (designated.has(fn.name))
|
|
428
|
+
continue;
|
|
429
|
+
const first = fn.params[0];
|
|
430
|
+
if (first === undefined || first.shape === null || first.shape.k !== "ref" || first.shape.name !== config.model)
|
|
431
|
+
continue;
|
|
432
|
+
if (fn.generic) {
|
|
433
|
+
throw new SidecarError(`helper '${fn.name}' is generic — a contract helper needs one concrete signature`, fn.loc);
|
|
434
|
+
}
|
|
435
|
+
const params = [];
|
|
436
|
+
fn.params.slice(1).forEach((p, i) => {
|
|
437
|
+
if (p.shape === null) {
|
|
438
|
+
throw new SidecarError(`helper '${fn.name}' parameter ${i + 2} ('${p.name}') has no type annotation`, fn.loc);
|
|
439
|
+
}
|
|
440
|
+
params.push(projector.shapeRef(p.shape, `helpers_${fn.name}`, p.name, fn.loc));
|
|
441
|
+
});
|
|
442
|
+
if (fn.returns === null) {
|
|
443
|
+
throw new SidecarError(`helper '${fn.name}' has no return type annotation`, fn.loc);
|
|
444
|
+
}
|
|
445
|
+
if (fn.returns.k === "void") {
|
|
446
|
+
throw new SidecarError(`helper '${fn.name}' returns void — a contract helper returns a value the host can read`, fn.loc);
|
|
447
|
+
}
|
|
448
|
+
// Helper-return synthesized names are two-part like everything else:
|
|
449
|
+
// container 'helpers', member the helper's name — `helpers_<name>`,
|
|
450
|
+
// never a '_return' suffix (the ratified spelling).
|
|
451
|
+
const returns = projector.shapeRef(fn.returns, "helpers", fn.name, fn.loc);
|
|
452
|
+
if (helpers.some((h) => h.name === fn.name)) {
|
|
453
|
+
throw new SidecarError(`helper '${fn.name}' is declared twice`, fn.loc);
|
|
454
|
+
}
|
|
455
|
+
helpers.push({ name: fn.name, params, returns, arena: helperArena(returns) });
|
|
456
|
+
}
|
|
457
|
+
const helperNames = new Set(helpers.map((h) => h.name));
|
|
458
|
+
// Shape flags from the designated entries' declared signatures.
|
|
459
|
+
const returnsCmd = (which, exportName) => {
|
|
460
|
+
const fn = facts.functions.find((f) => f.name === exportName);
|
|
461
|
+
if (fn === undefined) {
|
|
462
|
+
throw new SidecarError(`the profile designates ${which} export '${exportName}', but the entry module exports no function by that name`, entryLoc);
|
|
463
|
+
}
|
|
464
|
+
const r = fn.returns;
|
|
465
|
+
if (r !== null && r.k === "ref" && r.name === config.model)
|
|
466
|
+
return false;
|
|
467
|
+
if (r !== null && r.k === "tuple" && r.elems.length === 2 && r.elems[0].k === "ref" && r.elems[0].name === config.model) {
|
|
468
|
+
return true;
|
|
469
|
+
}
|
|
470
|
+
throw new SidecarError(`${which} export '${exportName}' must declare its return as '${config.model}' (bare state) or a two-element tuple '[${config.model}, ...]' (state plus an effect value)`, fn.loc);
|
|
471
|
+
};
|
|
472
|
+
const initReturnsCmd = returnsCmd("init", config.initExport);
|
|
473
|
+
const updateReturnsCmd = returnsCmd("update", config.updateExport);
|
|
474
|
+
const hasSubscriptions = facts.functions.some((f) => f.name === config.subscriptionsExport);
|
|
475
|
+
// Unbound lists: model fields or helper entries (helpers are bindable
|
|
476
|
+
// surface — the clarified rule) on the model side, arm names on the
|
|
477
|
+
// msg side. Absent consts mean "the program declares none".
|
|
478
|
+
const modelUnbound = facts.modelUnbound?.value ?? [];
|
|
479
|
+
for (const name of modelUnbound) {
|
|
480
|
+
if (!modelFieldNames.has(name) && !helperNames.has(name)) {
|
|
481
|
+
throw new SidecarError(`modelUnbound names '${name}', which is neither a field of '${config.model}' nor a helper entry`, facts.modelUnbound.loc);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
const msgUnbound = facts.msgUnbound?.value ?? [];
|
|
485
|
+
for (const name of msgUnbound) {
|
|
486
|
+
if (!armByName.has(name)) {
|
|
487
|
+
throw new SidecarError(`msgUnbound names '${name}', which is not an arm of '${config.msg}'`, facts.msgUnbound.loc);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
// Channels: the four function channels answer export presence by
|
|
491
|
+
// suffix; the two host-constructed channels and the env map ride the
|
|
492
|
+
// exported-const conventions and must target conforming arms.
|
|
493
|
+
const exports = abiExportSuffixes(profile);
|
|
494
|
+
const exportSet = new Set(exports);
|
|
495
|
+
const namedChannel = (constName) => {
|
|
496
|
+
const c = facts[constName];
|
|
497
|
+
if (c === null)
|
|
498
|
+
return null;
|
|
499
|
+
const payload = armByName.get(c.value);
|
|
500
|
+
if (payload === undefined) {
|
|
501
|
+
throw new SidecarError(`${constName} names '${c.value}', which is not an arm of '${config.msg}'`, c.loc);
|
|
502
|
+
}
|
|
503
|
+
if (payload.kind !== "record" && payload.kind !== "union" && payload.kind !== "enum" && payload.kind !== "scalar") {
|
|
504
|
+
throw new SidecarError(`${constName} names arm '${c.value}', whose payload descriptor is '${payload.kind}' — a host-constructed channel arm needs a named-type-family payload`, c.loc);
|
|
505
|
+
}
|
|
506
|
+
return c.value;
|
|
507
|
+
};
|
|
508
|
+
const envMsgs = facts.envMsgs?.value ?? [];
|
|
509
|
+
const seenEnv = new Set();
|
|
510
|
+
for (const e of envMsgs) {
|
|
511
|
+
if (seenEnv.has(e.env)) {
|
|
512
|
+
throw new SidecarError(`envMsgs repeats environment variable '${e.env}'`, facts.envMsgs.loc);
|
|
513
|
+
}
|
|
514
|
+
seenEnv.add(e.env);
|
|
515
|
+
const payload = armByName.get(e.msg);
|
|
516
|
+
if (payload === undefined) {
|
|
517
|
+
throw new SidecarError(`envMsgs targets '${e.msg}', which is not an arm of '${config.msg}'`, facts.envMsgs.loc);
|
|
518
|
+
}
|
|
519
|
+
if (payload.kind !== "bytes") {
|
|
520
|
+
throw new SidecarError(`envMsgs targets arm '${e.msg}', whose payload descriptor is '${payload.kind}' — the host delivers an environment value as bytes`, facts.envMsgs.loc);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
const doc = {
|
|
524
|
+
format: SIDECAR_FORMAT,
|
|
525
|
+
wire_version: config.wireVersion,
|
|
526
|
+
abi_version: config.abiVersion,
|
|
527
|
+
compiler_version: input.compilerVersion,
|
|
528
|
+
entry: input.entry,
|
|
529
|
+
source_hash: input.sourceHash,
|
|
530
|
+
build_id: input.buildId,
|
|
531
|
+
types: projector.finishedTable(),
|
|
532
|
+
model: config.model,
|
|
533
|
+
model_helpers: helpers,
|
|
534
|
+
model_unbound: modelUnbound,
|
|
535
|
+
msg: { name: config.msg, arms: msgArms, unbound: msgUnbound },
|
|
536
|
+
init_returns_cmd: initReturnsCmd,
|
|
537
|
+
update_returns_cmd: updateReturnsCmd,
|
|
538
|
+
has_subscriptions: hasSubscriptions,
|
|
539
|
+
channels: {
|
|
540
|
+
command_msg: exportSet.has("command_msg"),
|
|
541
|
+
frame_msg: exportSet.has("frame_msg"),
|
|
542
|
+
key_msg: exportSet.has("key_msg"),
|
|
543
|
+
pinch_msg: exportSet.has("pinch_msg"),
|
|
544
|
+
appearance_msg: namedChannel("appearanceMsg"),
|
|
545
|
+
chrome_msg: namedChannel("chromeMsg"),
|
|
546
|
+
env_msgs: envMsgs,
|
|
547
|
+
},
|
|
548
|
+
abi: { prefix: profile.prefix, exports, snapshot_format: config.snapshotFormat },
|
|
549
|
+
// The pre-ask-4 absent form the schema names valid: every numeric
|
|
550
|
+
// slot above spelled f64, and the empty list is itself the
|
|
551
|
+
// attestation that no slot was integer-classed.
|
|
552
|
+
integer_slots: [],
|
|
553
|
+
deterministic: input.deterministic,
|
|
554
|
+
// Structural in library mode: the SC4005 gate refused any graph
|
|
555
|
+
// reaching async/timer/event-loop surface before emission, so a
|
|
556
|
+
// sidecar exists only for async_free graphs.
|
|
557
|
+
async_free: true,
|
|
558
|
+
};
|
|
559
|
+
return { ok: true, doc, json: JSON.stringify(doc, null, 2) + "\n" };
|
|
560
|
+
}
|
|
561
|
+
catch (e) {
|
|
562
|
+
if (e instanceof SidecarError) {
|
|
563
|
+
return { ok: false, diagnostics: [libSidecarDiag(e.detail, e.loc)] };
|
|
564
|
+
}
|
|
565
|
+
throw e;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
//# sourceMappingURL=sidecar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidecar.js","sourceRoot":"","sources":["../../src/library/sidecar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;gBAuBgB;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAAsB,MAAM,8BAA8B,CAAC;AAIlF,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAErG,uDAAuD;AACvD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAiFhC,8EAA8E;AAE9E,IAAI,cAAc,GAAkB,IAAI,CAAC;AAEzC;;;oEAGoE;AACpE,MAAM,UAAU,sBAAsB;IACpC,IAAI,cAAc,KAAK,IAAI,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QAC1F,cAAc,GAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAyB,CAAC,OAAO,CAAC;IAC9F,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;6CAE6C;AAC7C,MAAM,UAAU,aAAa,CAAC,OAAe,EAAE,IAAY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C;YAC9B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QACvE,CAAC;QACD,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** wyhash final_version_3 of `data` under `seed` — a u64. */
|
|
2
|
+
export declare function wyhash64(data: Uint8Array, seed: bigint): bigint;
|
|
3
|
+
/** Frame variable-length inputs unambiguously: each chunk is prefixed by
|
|
4
|
+
* its u64 little-endian byte count. */
|
|
5
|
+
export declare function lengthPrefixedStream(chunks: readonly Uint8Array[]): Uint8Array;
|
|
6
|
+
/** A u64 as the schema's hash encoding: exactly 16 lowercase hex digits. */
|
|
7
|
+
export declare function hex16(v: bigint): string;
|
|
8
|
+
/** The `build_id` seed of the schema's worked definition. */
|
|
9
|
+
export declare const BUILD_ID_SEED = 2971475200n;
|
|
10
|
+
/** The "module-graph" source-hash contract's seed (profile-selectable
|
|
11
|
+
* contract; scriptc v1 implements exactly this one). */
|
|
12
|
+
export declare const SOURCE_HASH_SEED = 3235798765n;
|