@substrat-run/contracts 0.148.0 → 0.149.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/attachments.d.ts +31 -1
  2. package/dist/attachments.d.ts.map +1 -1
  3. package/dist/attachments.js +31 -1
  4. package/dist/attachments.js.map +1 -1
  5. package/dist/connections.d.ts +5 -6
  6. package/dist/connections.d.ts.map +1 -1
  7. package/dist/connections.js +11 -2
  8. package/dist/connections.js.map +1 -1
  9. package/dist/control-plane.d.ts +40 -1
  10. package/dist/control-plane.d.ts.map +1 -1
  11. package/dist/control-plane.js +40 -6
  12. package/dist/control-plane.js.map +1 -1
  13. package/dist/deploy.d.ts +105 -35
  14. package/dist/deploy.d.ts.map +1 -1
  15. package/dist/deploy.js +165 -43
  16. package/dist/deploy.js.map +1 -1
  17. package/dist/errors.d.ts +1 -0
  18. package/dist/errors.d.ts.map +1 -1
  19. package/dist/errors.js +6 -1
  20. package/dist/errors.js.map +1 -1
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +1 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/introspection.d.ts +12 -3
  26. package/dist/introspection.d.ts.map +1 -1
  27. package/dist/introspection.js +10 -2
  28. package/dist/introspection.js.map +1 -1
  29. package/dist/invocation-record.d.ts +17 -0
  30. package/dist/invocation-record.d.ts.map +1 -1
  31. package/dist/invocation-record.js +20 -0
  32. package/dist/invocation-record.js.map +1 -1
  33. package/dist/migration-diff.d.ts +48 -7
  34. package/dist/migration-diff.d.ts.map +1 -1
  35. package/dist/migration-diff.js +61 -17
  36. package/dist/migration-diff.js.map +1 -1
  37. package/dist/registry.d.ts +48 -0
  38. package/dist/registry.d.ts.map +1 -1
  39. package/dist/registry.js +74 -0
  40. package/dist/registry.js.map +1 -1
  41. package/dist/review-text.d.ts +49 -0
  42. package/dist/review-text.d.ts.map +1 -0
  43. package/dist/review-text.js +87 -0
  44. package/dist/review-text.js.map +1 -0
  45. package/dist/routing.d.ts +1 -1
  46. package/dist/routing.js +2 -2
  47. package/dist/routing.js.map +1 -1
  48. package/dist/scope-store-envelope.d.ts +28 -8
  49. package/dist/scope-store-envelope.d.ts.map +1 -1
  50. package/dist/scope-store-envelope.js +75 -27
  51. package/dist/scope-store-envelope.js.map +1 -1
  52. package/dist/scope-store-transport.js +1 -1
  53. package/dist/scope-store-transport.js.map +1 -1
  54. package/dist/script-names.d.ts +12 -12
  55. package/dist/script-names.d.ts.map +1 -1
  56. package/dist/script-names.js +18 -18
  57. package/dist/script-names.js.map +1 -1
  58. package/dist/sql-tokens.d.ts +7 -0
  59. package/dist/sql-tokens.d.ts.map +1 -1
  60. package/dist/sql-tokens.js +2 -2
  61. package/dist/sql-tokens.js.map +1 -1
  62. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;;;GAUG;AAEH,yFAAyF;AACzF,eAAO,MAAM,cAAc;;;;EAAoC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6HnB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;iBAK/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAchC,CAAC;AAGH,MAAM,MAAM,qBAAqB,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AAO,MAAM,sBAAsB;aACjC,KAAK,EAAE,sBAAsB;aAC7B,OAAO,EAAE,wBAAwB;CACzB,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAC;AAEvG;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,mBAAmB,GAAG,SAAS,CAEpF;AAgBD;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;;;;;kBAA8E,CAAC;AACjH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,qBAAqB;aAChC,KAAK,EAAE,qBAAqB;aAC5B,OAAO,EAAE,uBAAuB;CACxB,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAEpG,mGAAmG;AACnG,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAElF"}
package/dist/registry.js CHANGED
@@ -350,6 +350,28 @@ export const promotionAcknowledgement = z.object({
350
350
  * also trips: this one is about OTHER apps' deployed code, and the refusal lists them.
351
351
  */
352
352
  exportBreak: z.boolean().optional(),
353
+ /**
354
+ * #2333: the review these acknowledgements were given against. A promote review is computed
355
+ * from the version being promoted over the channel's CURRENT version, and a concurrent promote
356
+ * between showing it and acknowledging it changes that base — so a bare flag would acknowledge
357
+ * a diff that is no longer the one applied. The binding names what was shown, as the
358
+ * migrations read answered it (`/versions/:id/migrations?base=` → `review`): the base version
359
+ * (null for a first promote) and the digest of the stored rows that review was computed from.
360
+ *
361
+ * The host recomputes the digest from its own stored rows and refuses (`precondition_failed`,
362
+ * reason `promote_review_stale`) when the channel no longer points at `base` or the digest
363
+ * differs. The sent digest is only ever compared, never read as the diff. A consumed
364
+ * `migrationChange` without a binding is refused too (`promote_review_unbound`); a
365
+ * permission-only acknowledgement without one is still honoured, so an older client keeps
366
+ * promoting wherever no migration — and so no declared data loss — is involved.
367
+ */
368
+ review: z
369
+ .object({
370
+ base: z.string().min(1).nullable(),
371
+ digest: z.string().regex(/^[0-9a-f]{64}$/),
372
+ })
373
+ .strict()
374
+ .optional(),
353
375
  });
354
376
  /**
355
377
  * #1756: what a scope bind may acknowledge. Only `exportBreak` — a bind has no digest
@@ -358,4 +380,56 @@ export const promotionAcknowledgement = z.object({
358
380
  * Strict, so a caller that sends `permissionChange` here learns it means nothing on a bind.
359
381
  */
360
382
  export const bindAcknowledgement = promotionAcknowledgement.pick({ exportBreak: true }).strict();
383
+ /**
384
+ * #2333: the `reason` on the promote gate's two refusals of a review binding (both
385
+ * `precondition_failed`): `stale`, the binding's base or digest no longer holds, and `unbound`, a
386
+ * migration acknowledgement sent without one. A client answers either by reading the review again.
387
+ */
388
+ export const PROMOTE_REVIEW_REASONS = {
389
+ stale: 'promote_review_stale',
390
+ unbound: 'promote_review_unbound',
391
+ };
392
+ /**
393
+ * Which review refusal a problem body is, read from its `reason`, or undefined for any other
394
+ * answer. Takes the body as text (a transport's raw body) or already parsed.
395
+ */
396
+ export function promoteReviewReasonIn(body) {
397
+ return reasonIn(body, PROMOTE_REVIEW_REASONS);
398
+ }
399
+ /** A problem body's `reason`, when it is one of `reasons`. Text (a transport's raw body) or parsed. */
400
+ function reasonIn(body, reasons) {
401
+ let parsed = body;
402
+ if (typeof body === 'string') {
403
+ try {
404
+ parsed = JSON.parse(body);
405
+ }
406
+ catch {
407
+ return undefined;
408
+ }
409
+ }
410
+ const reason = parsed?.reason;
411
+ return reason === reasons.stale || reason === reasons.unbound ? reason : undefined;
412
+ }
413
+ /**
414
+ * #2347: what a scope rebind across lineages may acknowledge. `exportBreak` as a bind, and
415
+ * `review`: the rebind review its `ackMigrations` answers (`GET …/scopes/:id/rebind-review`),
416
+ * computed from the target lineage's serving version over the scope's bound version. Same shape
417
+ * and same rule as a promote's: the host refuses a binding whose base is no longer the scope's
418
+ * bound version, or whose digest the stored rows of both sides no longer give
419
+ * (`rebind_review_stale`), and an `ackMigrations` sent without one where the digests differ
420
+ * (`rebind_review_unbound`).
421
+ */
422
+ export const rebindAcknowledgement = promotionAcknowledgement.pick({ exportBreak: true, review: true }).strict();
423
+ /**
424
+ * #2347: the `reason` on a rebind's two refusals of its review binding (both
425
+ * `precondition_failed`), named apart from the promote's so a client knows which review to read again.
426
+ */
427
+ export const REBIND_REVIEW_REASONS = {
428
+ stale: 'rebind_review_stale',
429
+ unbound: 'rebind_review_unbound',
430
+ };
431
+ /** Which rebind review refusal a problem body is, as `promoteReviewReasonIn` reads a promote's. */
432
+ export function rebindReviewReasonIn(body) {
433
+ return reasonIn(body, REBIND_REVIEW_REASONS);
434
+ }
361
435
  //# sourceMappingURL=registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAEnF;;;;;;;;;;GAUG;AAEH,yFAAyF;AACzF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAGhE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE,YAAY,EAAE,iFAAiF;IACrG,IAAI,EAAE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xB,CAAC;AAGX,mGAAmG;AACnG,MAAM,UAAU,oBAAoB,CAAC,IAAa;IAChD,OAAO,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Text a vertical's author wrote, as a person reviewing it is shown it (#2322): a discard's
3
+ * reason, a declared table or column, a migration's id and its SQL. The promote review shows it
4
+ * in a terminal (`substrat promote`), the dashboard and the console, and in each the author's
5
+ * text must read as what is stored, no more and no less.
6
+ *
7
+ * Shared by every surface, so one rule decides what a reviewer sees, and by the push boundary
8
+ * and the kernel's data-loss fence, so a reason they accept is one a review can show.
9
+ */
10
+ /**
11
+ * Author-written text with every invisible or acting character replaced by a visible
12
+ * `<U+XXXX>`, so it cannot reorder, hide or forge what a reviewer reads, nor drive a terminal.
13
+ * Newlines and tabs are kept. Everything else is verbatim; each surface still escapes for its
14
+ * own medium (React's text node, the CLI's quoting).
15
+ */
16
+ export declare function reviewText(text: string): string;
17
+ /**
18
+ * Author-written text for a position that is ONE line — an id, a table or column name — where a
19
+ * kept newline or tab would forge another line: {@link reviewText}, with those made visible too.
20
+ */
21
+ export declare function reviewLine(text: string): string;
22
+ /**
23
+ * A migration's SQL as a review shows it: {@link reviewText} after a CRLF line ending is read as
24
+ * the line break it is, so SQL saved with Windows line endings does not end every line with a
25
+ * mark. A lone CR still shows, since it returns to the line's start without breaking it.
26
+ */
27
+ export declare function reviewSql(sql: string): string;
28
+ /**
29
+ * Whether a reason says nothing a reviewer could read: empty once whitespace and every
30
+ * invisible character are removed. The push boundary (`declaredMigration`) and the kernel's
31
+ * data-loss fence both refuse a discard whose reason is blank by this one rule.
32
+ */
33
+ export declare function blankReason(text: string): boolean;
34
+ /** How much of a discard's reason a review shows before it asks to be expanded: characters… */
35
+ export declare const REVIEW_TEXT_SHOWN_MAX = 280;
36
+ /** …and lines, whichever comes first, so a reason of many short lines is bounded in height too. */
37
+ export declare const REVIEW_TEXT_SHOWN_LINES = 6;
38
+ /**
39
+ * A reason as a review first shows it: {@link reviewText}, cut at
40
+ * {@link REVIEW_TEXT_SHOWN_MAX} characters (never inside a surrogate pair) or
41
+ * {@link REVIEW_TEXT_SHOWN_LINES} lines, whichever comes first, with `clipped` set, so a long
42
+ * reason cannot push the rest of the review out of sight. The full text is shown on request.
43
+ */
44
+ export declare function clipReviewText(text: string): {
45
+ full: string;
46
+ shown: string;
47
+ clipped: boolean;
48
+ };
49
+ //# sourceMappingURL=review-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-text.d.ts","sourceRoot":"","sources":["../src/review-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAyBH;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,+FAA+F;AAC/F,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,mGAAmG;AACnG,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAa9F"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Text a vertical's author wrote, as a person reviewing it is shown it (#2322): a discard's
3
+ * reason, a declared table or column, a migration's id and its SQL. The promote review shows it
4
+ * in a terminal (`substrat promote`), the dashboard and the console, and in each the author's
5
+ * text must read as what is stored, no more and no less.
6
+ *
7
+ * Shared by every surface, so one rule decides what a reviewer sees, and by the push boundary
8
+ * and the kernel's data-loss fence, so a reason they accept is one a review can show.
9
+ */
10
+ /**
11
+ * Every character a reviewer cannot see, or that acts instead of printing:
12
+ * - `\p{Cc}`: the C0 controls (ESC, CR, BEL, backspace…), DEL and the C1 controls (U+0080–U+009F,
13
+ * CSI U+009B among them), which a terminal may act on;
14
+ * - `\p{Cf}`: the format characters — the bidirectional embeddings, overrides, isolates and marks
15
+ * (U+202A–U+202E, U+2066–U+2069, U+200E, U+200F, U+061C), which reorder what is read, and the
16
+ * zero-width ones (U+200B–U+200D, U+2060, U+FEFF, the soft hyphen…), which hide;
17
+ * - U+2028 and U+2029, the line and paragraph separators, which break a line without being one;
18
+ * - the letters that render as nothing: the Hangul fillers (U+115F, U+1160, U+3164, U+FFA0), the
19
+ * Khmer inherent vowels (U+17B4, U+17B5) and the blank Braille pattern (U+2800), which are not
20
+ * format characters but read exactly like one.
21
+ */
22
+ const INVISIBLE = /[\p{Cc}\p{Cf}\u2028\u2029\u115F\u1160\u17B4\u17B5\u2800\u3164\uFFA0]/gu;
23
+ /**
24
+ * The two layout characters kept as they are: a newline (the CLI prints SQL line by line and a
25
+ * quoted reason escapes it; the web shows it as a line break, bounded by {@link clipReviewText})
26
+ * and a tab, which only moves to the next column.
27
+ */
28
+ const LAYOUT = new Set(['\n', '\t']);
29
+ const codePoint = (c) => `<U+${c.codePointAt(0).toString(16).toUpperCase().padStart(4, '0')}>`;
30
+ /**
31
+ * Author-written text with every invisible or acting character replaced by a visible
32
+ * `<U+XXXX>`, so it cannot reorder, hide or forge what a reviewer reads, nor drive a terminal.
33
+ * Newlines and tabs are kept. Everything else is verbatim; each surface still escapes for its
34
+ * own medium (React's text node, the CLI's quoting).
35
+ */
36
+ export function reviewText(text) {
37
+ return text.replace(INVISIBLE, (c) => (LAYOUT.has(c) ? c : codePoint(c)));
38
+ }
39
+ /**
40
+ * Author-written text for a position that is ONE line — an id, a table or column name — where a
41
+ * kept newline or tab would forge another line: {@link reviewText}, with those made visible too.
42
+ */
43
+ export function reviewLine(text) {
44
+ return text.replace(INVISIBLE, codePoint);
45
+ }
46
+ /**
47
+ * A migration's SQL as a review shows it: {@link reviewText} after a CRLF line ending is read as
48
+ * the line break it is, so SQL saved with Windows line endings does not end every line with a
49
+ * mark. A lone CR still shows, since it returns to the line's start without breaking it.
50
+ */
51
+ export function reviewSql(sql) {
52
+ return reviewText(sql.replace(/\r\n/g, '\n'));
53
+ }
54
+ /**
55
+ * Whether a reason says nothing a reviewer could read: empty once whitespace and every
56
+ * invisible character are removed. The push boundary (`declaredMigration`) and the kernel's
57
+ * data-loss fence both refuse a discard whose reason is blank by this one rule.
58
+ */
59
+ export function blankReason(text) {
60
+ return text.replace(INVISIBLE, '').replace(/\s/gu, '') === '';
61
+ }
62
+ /** How much of a discard's reason a review shows before it asks to be expanded: characters… */
63
+ export const REVIEW_TEXT_SHOWN_MAX = 280;
64
+ /** …and lines, whichever comes first, so a reason of many short lines is bounded in height too. */
65
+ export const REVIEW_TEXT_SHOWN_LINES = 6;
66
+ /**
67
+ * A reason as a review first shows it: {@link reviewText}, cut at
68
+ * {@link REVIEW_TEXT_SHOWN_MAX} characters (never inside a surrogate pair) or
69
+ * {@link REVIEW_TEXT_SHOWN_LINES} lines, whichever comes first, with `clipped` set, so a long
70
+ * reason cannot push the rest of the review out of sight. The full text is shown on request.
71
+ */
72
+ export function clipReviewText(text) {
73
+ const full = reviewText(text);
74
+ const chars = Array.from(full);
75
+ let end = Math.min(chars.length, REVIEW_TEXT_SHOWN_MAX);
76
+ let lines = 1;
77
+ for (let i = 0; i < end; i++) {
78
+ if (chars[i] === '\n' && ++lines > REVIEW_TEXT_SHOWN_LINES) {
79
+ end = i;
80
+ break;
81
+ }
82
+ }
83
+ if (end === chars.length)
84
+ return { full, shown: full, clipped: false };
85
+ return { full, shown: chars.slice(0, end).join(''), clipped: true };
86
+ }
87
+ //# sourceMappingURL=review-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-text.js","sourceR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AAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IACxD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,EAAE,KAAK,GAAG,uBAAuB,EAAE,CAAC;YAC3D,GAAG,GAAG,CAAC,CAAC;YACR,MAAM;QACR,CAAC;IACH,CAAC;IACD,IAAI,GAAG,KAAK,KAAK,CAAC,MAAM;QAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACvE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACtE,CAAC"}
package/dist/routing.d.ts CHANGED
@@ -188,7 +188,7 @@ export declare const routeTarget: z.ZodObject<{
188
188
  calls: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
189
189
  scopeStores: z.ZodDefault<z.ZodArray<z.ZodObject<{
190
190
  binding: z.ZodString;
191
- kind: z.ZodString;
191
+ driver: z.ZodString;
192
192
  }, z.core.$strip>>>;
193
193
  primary: z.ZodDefault<z.ZodBoolean>;
194
194
  hostnames: z.ZodDefault<z.ZodArray<z.ZodString>>;
package/dist/routing.js CHANGED
@@ -199,12 +199,12 @@ export const routeTarget = z.object({
199
199
  */
200
200
  calls: z.array(verticalSlug).nullable().default(null),
201
201
  /**
202
- * Scope stores the dispatched version declares (#2207): `{ binding, kind }` from
202
+ * Scope stores the dispatched version declares (#2207): `{ binding, driver }` from
203
203
  * the same manifest. The router hands the list to egress, which is what a store
204
204
  * call is judged against. Defaulted to `[]`, so a resolver that predates the
205
205
  * field parses, and a store call is refused until a version declares one.
206
206
  */
207
- scopeStores: z.array(z.object({ binding: z.string(), kind: z.string() })).default([]),
207
+ scopeStores: z.array(z.object({ binding: z.string(), driver: z.string() })).default([]),
208
208
  /**
209
209
  * Whether the scope is the real install (`isPrimaryScope`, #2005) — false for a fork, a
210
210
  * snapshot or a preview of either kind. The router hands it to the egress worker, which
@@ -1 +1 @@
1
- {"version":3,"file":"routing.js","sourceRoot":"","sources":["../src/routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEpE;;;;;;GAMG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;CACjC,CAAC,CAAC;AAGH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAA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link SCOPE_STORE_ENVELOPE_WINDOW_SECONDS} on either side of the verifier's clock. A
24
24
  * store does not remember nonces (RFC Q2): an envelope replayed inside the window, at the
25
25
  * same script and object with the same body, is accepted again. The reserved operations are
26
- * idempotent, and a kind operation's retry safety is the vertical's.
26
+ * idempotent, and a driver operation's retry safety is the vertical's.
27
27
  *
28
28
  * The script line is an opaque string compared for equality: the signer builds it, the
29
29
  * verifier is told its own. Nothing here parses it.
@@ -38,7 +38,7 @@ export declare const SCOPE_STORE_ENVELOPE_HEADER = "x-substrat-store-envelope";
38
38
  export declare const SCOPE_STORE_SIGNATURE_HEADER = "x-substrat-store-signature";
39
39
  /**
40
40
  * The operations only the platform may send to a scope store (#2207). A vertical's
41
- * stub refuses every one of them. A kind's registration has to answer all of them,
41
+ * stub refuses every one of them. A driver's registration has to answer all of them,
42
42
  * `substrat.erase` included, before a hosted deploy may store tenant data.
43
43
  */
44
44
  export declare const RESERVED_STORE_OPERATIONS: readonly ['substrat.export', 'substrat.import', 'substrat.size', 'substrat.wipe', 'substrat.erase'];
@@ -73,12 +73,19 @@ export declare function scopeStoreEnvelopeFresh(iat: number, nowSeconds: number,
73
73
  * never matches it.
74
74
  */
75
75
  export declare function scopeStoreKeyId(publicKey: string): Promise<string>;
76
+ /** What is wrong with one configured public key, as a code a tool can switch on. */
77
+ export type ScopeStorePublicKeyProblem = 'empty' | 'length' | 'small-order' | 'non-canonical';
78
+ /**
79
+ * Why a store refuses one configured public key, or undefined when it accepts it: empty, not
80
+ * 32 bytes of base64url, a small-order point, or not in canonical base64url (its unused trailing
81
+ * bits set, so two spellings would name one key).
82
+ */
83
+ export declare function scopeStorePublicKeyProblem(key: string): ScopeStorePublicKeyProblem | undefined;
76
84
  /**
77
85
  * A store's public keys for one audience, as configured: raw Ed25519 keys, base64url,
78
- * separated by commas (whitespace around each is ignored). Throws on an empty list, a key
79
- * that is not 32 bytes, a small-order point, a key not in canonical base64url (its unused trailing bits set, so
80
- * two spellings would name one key), or the same key twice. Rotation is: add the new key,
81
- * switch the signer, then drop the old key.
86
+ * separated by commas (whitespace around each is ignored). Throws on an empty list, any key
87
+ * {@link scopeStorePublicKeyProblem} refuses, or the same key twice. Rotation is: add the new
88
+ * key, switch the signer, then drop the old key.
82
89
  */
83
90
  export declare function parseScopeStorePublicKeys(text: string): readonly string[];
84
91
  /**
@@ -100,9 +107,22 @@ export declare function generateScopeStoreKeyPair(): Promise<{
100
107
  readonly publicKey: string;
101
108
  readonly kid: string;
102
109
  }>;
110
+ /**
111
+ * The raw public key and key id a PKCS8 Ed25519 private key (base64url) signs under, derived the
112
+ * way {@link issueScopeStoreEnvelope} derives them. Throws {@link ScopeStoreKeyError} when the key
113
+ * is unusable, whose message never carries the key.
114
+ */
115
+ export declare function scopeStoreSignerPublicKey(pkcs8: string): Promise<{
116
+ readonly publicKey: string;
117
+ readonly kid: string;
118
+ }>;
119
+ /** Why a signing key cannot be used. */
120
+ export type ScopeStoreKeyProblem = 'encoding' | 'not-pkcs8-v1' | 'not-ed25519' | 'no-public-half' | 'small-order';
103
121
  /** A signing key that is present but cannot be used. Its message never carries the key. */
104
122
  export declare class ScopeStoreKeyError extends Error {
123
+ readonly reason: ScopeStoreKeyProblem;
105
124
  readonly name = "ScopeStoreKeyError";
125
+ constructor(message: string, reason: ScopeStoreKeyProblem);
106
126
  }
107
127
  /**
108
128
  * Whether `signature` is the Ed25519 signature of `canonical` under the raw public key.
@@ -146,14 +166,14 @@ export type ScopeStoreCallVerdict = {
146
166
  readonly refusal: ScopeStoreRefusal;
147
167
  };
148
168
  /**
149
- * Every envelope check a store makes on a call before the kind's class runs (RFC §10.3
169
+ * Every envelope check a store makes on a call before the driver's class runs (RFC §10.3
150
170
  * checks 1–4, L4, L5), in one place, so a store entry carries no copy. The object binding
151
171
  * (check 5: the object's id is `idFromName` of the signed name) is the entry's, because it
152
172
  * needs the object's id; so is reading the configured keys and script name.
153
173
  *
154
174
  * `script` is the store script's own name, compared with the signed line for equality.
155
175
  * The body must be JSON naming the signed operation as `operation` and the signed object
156
- * as `objectName`, so the signed name is the one the kind is asked about.
176
+ * as `objectName`, so the signed name is the one the driver is asked about.
157
177
  */
158
178
  export declare function verifyScopeStoreCall(input: {
159
179
  readonly envelope: string | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"scope-store-envelope.d.ts","sourceRoot":"","sources":["../src/scope-store-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,eAAO,MAAM,mCAAmC,KAAK,CAAC;AACtD,oEAAoE;AACpE,eAAO,MAAM,2BAA2B,8BAA8B,CAAC;AACvE,2DAA2D;AAC3D,eAAO,MAAM,4BAA4B,+BAA+B,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,YACpC,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,gBAAgB,CACR,CAAC;AACX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhF,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,CAAC,GAAG,EAAE,kBAAkB,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAcD,mDAAmD;AACnD,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,MAAM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C;IAAC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAEhE;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE;IAChD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA6CjC"}
@@ -23,7 +23,7 @@
23
23
  * {@link SCOPE_STORE_ENVELOPE_WINDOW_SECONDS} on either side of the verifier's clock. A
24
24
  * store does not remember nonces (RFC Q2): an envelope replayed inside the window, at the
25
25
  * same script and object with the same body, is accepted again. The reserved operations are
26
- * idempotent, and a kind operation's retry safety is the vertical's.
26
+ * idempotent, and a driver operation's retry safety is the vertical's.
27
27
  *
28
28
  * The script line is an opaque string compared for equality: the signer builds it, the
29
29
  * verifier is told its own. Nothing here parses it.
@@ -38,7 +38,7 @@ export const SCOPE_STORE_ENVELOPE_HEADER = 'x-substrat-store-envelope';
38
38
  export const SCOPE_STORE_SIGNATURE_HEADER = 'x-substrat-store-signature';
39
39
  /**
40
40
  * The operations only the platform may send to a scope store (#2207). A vertical's
41
- * stub refuses every one of them. A kind's registration has to answer all of them,
41
+ * stub refuses every one of them. A driver's registration has to answer all of them,
42
42
  * `substrat.erase` included, before a hosted deploy may store tenant data.
43
43
  */
44
44
  export const RESERVED_STORE_OPERATIONS = [
@@ -196,28 +196,45 @@ export async function scopeStoreKeyId(publicKey) {
196
196
  const hash = await crypto.subtle.digest('SHA-256', copyBytes(bytes));
197
197
  return bytesToBase64Url(new Uint8Array(hash).slice(0, 8));
198
198
  }
199
+ /**
200
+ * Why a store refuses one configured public key, or undefined when it accepts it: empty, not
201
+ * 32 bytes of base64url, a small-order point, or not in canonical base64url (its unused trailing
202
+ * bits set, so two spellings would name one key).
203
+ */
204
+ export function scopeStorePublicKeyProblem(key) {
205
+ if (key.length === 0)
206
+ return 'empty';
207
+ const bytes = base64UrlToBytes(key);
208
+ if (bytes?.length !== 32)
209
+ return 'length';
210
+ if (isSmallOrderKey(bytes))
211
+ return 'small-order';
212
+ // Canonical means the bytes re-encode to the same text, so equal text is equal bytes.
213
+ if (bytesToBase64Url(bytes) !== key)
214
+ return 'non-canonical';
215
+ return undefined;
216
+ }
217
+ const PUBLIC_KEY_PROBLEM = {
218
+ empty: 'a store public key list is empty or has an empty entry',
219
+ length: 'a store public key is not 32 bytes of base64url',
220
+ 'small-order': 'a store public key is a small-order point',
221
+ 'non-canonical': 'a store public key is not canonical base64url',
222
+ };
199
223
  /**
200
224
  * A store's public keys for one audience, as configured: raw Ed25519 keys, base64url,
201
- * separated by commas (whitespace around each is ignored). Throws on an empty list, a key
202
- * that is not 32 bytes, a small-order point, a key not in canonical base64url (its unused trailing bits set, so
203
- * two spellings would name one key), or the same key twice. Rotation is: add the new key,
204
- * switch the signer, then drop the old key.
225
+ * separated by commas (whitespace around each is ignored). Throws on an empty list, any key
226
+ * {@link scopeStorePublicKeyProblem} refuses, or the same key twice. Rotation is: add the new
227
+ * key, switch the signer, then drop the old key.
205
228
  */
206
229
  export function parseScopeStorePublicKeys(text) {
207
230
  const keys = text.split(',').map((key) => key.trim());
208
- if (keys.length === 0 || keys.some((key) => key.length === 0)) {
209
- throw new Error('a store public key list is empty or has an empty entry');
210
- }
231
+ if (keys.some((key) => key.length === 0))
232
+ throw new Error(PUBLIC_KEY_PROBLEM.empty);
211
233
  const seen = new Set();
212
234
  for (const key of keys) {
213
- const bytes = base64UrlToBytes(key);
214
- if (bytes?.length !== 32)
215
- throw new Error('a store public key is not 32 bytes of base64url');
216
- if (isSmallOrderKey(bytes))
217
- throw new Error('a store public key is a small-order point');
218
- // Canonical means the bytes re-encode to the same text, so equal text is equal bytes.
219
- if (bytesToBase64Url(bytes) !== key)
220
- throw new Error('a store public key is not canonical base64url');
235
+ const problem = scopeStorePublicKeyProblem(key);
236
+ if (problem)
237
+ throw new Error(PUBLIC_KEY_PROBLEM[problem]);
221
238
  if (seen.has(key))
222
239
  throw new Error('a store public key is listed twice');
223
240
  seen.add(key);
@@ -248,28 +265,59 @@ export async function generateScopeStoreKeyPair() {
248
265
  const publicKey = bytesToBase64Url(new Uint8Array((await crypto.subtle.exportKey('raw', pair.publicKey))));
249
266
  return { privateKey, publicKey, kid: await scopeStoreKeyId(publicKey) };
250
267
  }
251
- /** Import a PKCS8 Ed25519 private key (base64url) and derive its key id from its public half. */
268
+ /**
269
+ * The DER prefix of an Ed25519 PKCS8 v1 private key (RFC 8410 §7): SEQUENCE, version 0, the
270
+ * Ed25519 algorithm identifier, then a 34-byte OCTET STRING wrapping the 32-byte seed. With the
271
+ * seed it is exactly 48 bytes, the form WebCrypto exports and `generateScopeStoreKeyPair` writes.
272
+ */
273
+ const PKCS8_V1_ED25519_PREFIX = [0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x04, 0x22, 0x04, 0x20];
274
+ /**
275
+ * Import a PKCS8 Ed25519 private key (base64url) and derive its key id from its public half.
276
+ * Only the canonical 48-byte v1 form is accepted: a DER parser may tolerate trailing bytes or
277
+ * another encoding of the same seed, and whether it does differs between runtimes, so a key a
278
+ * tool accepts here could otherwise be one the deployed signer refuses.
279
+ */
252
280
  async function signingKey(pkcs8) {
253
281
  const bytes = base64UrlToBytes(pkcs8);
254
282
  if (!bytes)
255
- throw new ScopeStoreKeyError('the store signing key is not base64url');
256
- let jwk;
283
+ throw new ScopeStoreKeyError('the store signing key is not base64url', 'encoding');
284
+ if (bytes.length !== 48 || PKCS8_V1_ED25519_PREFIX.some((byte, i) => bytes[i] !== byte)) {
285
+ throw new ScopeStoreKeyError('the store signing key is not a 48-byte Ed25519 PKCS8 v1 key', 'not-pkcs8-v1');
286
+ }
257
287
  let key;
288
+ let x;
258
289
  try {
259
290
  // Extractable only so its public half (`x`) can be read for the key id; it never leaves here.
260
291
  key = await crypto.subtle.importKey('pkcs8', copyBytes(bytes), { name: 'Ed25519' }, true, ['sign']);
261
- jwk = (await crypto.subtle.exportKey('jwk', key));
292
+ x = (await crypto.subtle.exportKey('jwk', key)).x;
262
293
  }
263
294
  catch {
264
- throw new ScopeStoreKeyError('the store signing key is not an Ed25519 PKCS8 key');
295
+ throw new ScopeStoreKeyError('the store signing key is not an Ed25519 PKCS8 key', 'not-ed25519');
265
296
  }
266
- if (typeof jwk.x !== 'string')
267
- throw new ScopeStoreKeyError('the store signing key has no public half');
268
- return { key, kid: await scopeStoreKeyId(jwk.x) };
297
+ if (typeof x !== 'string')
298
+ throw new ScopeStoreKeyError('the store signing key has no public half', 'no-public-half');
299
+ // The only key a JWK export can name that scopeStoreKeyId refuses is a small-order point.
300
+ if (scopeStorePublicKeyProblem(x))
301
+ throw new ScopeStoreKeyError('the store signing key is a small-order point', 'small-order');
302
+ return { key, publicKey: x, kid: await scopeStoreKeyId(x) };
303
+ }
304
+ /**
305
+ * The raw public key and key id a PKCS8 Ed25519 private key (base64url) signs under, derived the
306
+ * way {@link issueScopeStoreEnvelope} derives them. Throws {@link ScopeStoreKeyError} when the key
307
+ * is unusable, whose message never carries the key.
308
+ */
309
+ export async function scopeStoreSignerPublicKey(pkcs8) {
310
+ const { publicKey, kid } = await signingKey(pkcs8);
311
+ return { publicKey, kid };
269
312
  }
270
313
  /** A signing key that is present but cannot be used. Its message never carries the key. */
271
314
  export class ScopeStoreKeyError extends Error {
315
+ reason;
272
316
  name = 'ScopeStoreKeyError';
317
+ constructor(message, reason) {
318
+ super(message);
319
+ this.reason = reason;
320
+ }
273
321
  }
274
322
  /**
275
323
  * Whether `signature` is the Ed25519 signature of `canonical` under the raw public key.
@@ -318,14 +366,14 @@ export async function issueScopeStoreEnvelope(input) {
318
366
  };
319
367
  }
320
368
  /**
321
- * Every envelope check a store makes on a call before the kind's class runs (RFC §10.3
369
+ * Every envelope check a store makes on a call before the driver's class runs (RFC §10.3
322
370
  * checks 1–4, L4, L5), in one place, so a store entry carries no copy. The object binding
323
371
  * (check 5: the object's id is `idFromName` of the signed name) is the entry's, because it
324
372
  * needs the object's id; so is reading the configured keys and script name.
325
373
  *
326
374
  * `script` is the store script's own name, compared with the signed line for equality.
327
375
  * The body must be JSON naming the signed operation as `operation` and the signed object
328
- * as `objectName`, so the signed name is the one the kind is asked about.
376
+ * as `objectName`, so the signed name is the one the driver is asked about.
329
377
  */
330
378
  export async function verifyScopeStoreCall(input) {
331
379
  const refuse = (refusal) => ({ ok: false, refusal });