@substrat-run/control-plane-api 0.161.0 → 0.162.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.
@@ -45,7 +45,8 @@ export declare function platformCallScope(request: Request, body: ArrayBuffer |
45
45
  * dispatch stub from, so the envelope always names the script the call reaches. A signer that cannot
46
46
  * sign never fails the call: it goes with its legacy header and its whole body, and the line says
47
47
  * why, never a key. A streamed call is not signed and its body is not read: it goes exactly as
48
- * given, counted `skipped`, which is a decision, not a failure.
48
+ * given, counted `skipped` when its route is listed as unsigned by design, which is a decision, not a
49
+ * failure, and `failed` (`stream-unlisted`) when it is not.
49
50
  */
50
51
  export declare function platformSignedFetch(settings: PlatformWireSettings, aud: string, send: typeof fetch): typeof fetch;
51
52
  //# sourceMappingURL=platform-wire.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-wire.d.ts","sourceRoot":"","sources":["../src/platform-wire.ts"],"names":[],"mappings":"AAUA,uEAAuE;AACvE,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,mEAAmE;IACnE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,iGAAiG;IACjG,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAoBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CA6CxF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAY/H;AAmBD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,GAAG,OAAO,KAAK,CAejH"}
1
+ {"version":3,"file":"platform-wire.d.ts","sourceRoot":"","sources":["../src/platform-wire.ts"],"names":[],"mappings":"AAUA,uEAAuE;AACvE,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,mEAAmE;IACnE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,iGAAiG;IACjG,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAoBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CA6CxF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAY/H;AAmCD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,GAAG,OAAO,KAAK,CAgBjH"}
@@ -6,7 +6,7 @@
6
6
  * existed.
7
7
  */
8
8
  import { ULID_PATTERN } from '@substrat-run/contracts';
9
- import { wireSignerOf } from '@substrat-run/contracts/wire-signing';
9
+ import { wireSignerOf, wireUnsignedRouteOf } from '@substrat-run/contracts/wire-signing';
10
10
  /** Bodies that are bytes rather than JSON (a multipart attachment, an octet stream) name no scope. */
11
11
  const BYTES = /^(multipart\/|application\/octet-stream)/i;
12
12
  const QUOTE = 0x22;
@@ -135,6 +135,22 @@ function streamed(input, init) {
135
135
  return isStream(init.body);
136
136
  return input instanceof Request && input.body !== null;
137
137
  }
138
+ /**
139
+ * Whether a streamed call goes to a route listed as unsigned by design (`WIRE_UNSIGNED_ROUTES`), by
140
+ * the method and path it would send. Only such a call is a deliberate skip; a streamed call to any
141
+ * other route still goes as given, since it cannot be bound without being read, but is counted a
142
+ * failure (`stream-unlisted`), so a new streamed route shows in the counts until it is listed.
143
+ */
144
+ function listedStream(input, init) {
145
+ try {
146
+ const url = new URL(input instanceof Request ? input.url : String(input));
147
+ const method = init?.method ?? (input instanceof Request ? input.method : 'GET');
148
+ return wireUnsignedRouteOf(method, url.pathname) !== undefined;
149
+ }
150
+ catch {
151
+ return false;
152
+ }
153
+ }
138
154
  /**
139
155
  * The `fetch` a client for the deployment the dispatch namespace knows as `aud` is given: `send`
140
156
  * itself while the flag is off; on, `send` behind the signer, so every call, a retry included, is
@@ -142,7 +158,8 @@ function streamed(input, init) {
142
158
  * dispatch stub from, so the envelope always names the script the call reaches. A signer that cannot
143
159
  * sign never fails the call: it goes with its legacy header and its whole body, and the line says
144
160
  * why, never a key. A streamed call is not signed and its body is not read: it goes exactly as
145
- * given, counted `skipped`, which is a decision, not a failure.
161
+ * given, counted `skipped` when its route is listed as unsigned by design, which is a decision, not a
162
+ * failure, and `failed` (`stream-unlisted`) when it is not.
146
163
  */
147
164
  export function platformSignedFetch(settings, aud, send) {
148
165
  const signer = wireSignerOf(settings);
@@ -152,7 +169,10 @@ export function platformSignedFetch(settings, aud, send) {
152
169
  const count = (outcome, reason) => log(JSON.stringify({ substrat: 'wire-sign', issuer: 'platform', aud, outcome, ...(reason ? { reason } : {}) }));
153
170
  return (async (input, init) => {
154
171
  if (streamed(input, init)) {
155
- count('skipped', 'stream');
172
+ if (listedStream(input, init))
173
+ count('skipped', 'stream');
174
+ else
175
+ count('failed', 'stream-unlisted');
156
176
  return send(input, init);
157
177
  }
158
178
  const result = await signer(new Request(input, init), { iss: 'platform', kind: 'call', aud }, platformCallScope);
@@ -1 +1 @@
1
- {"version":3,"file":"platform-wire.js","sourceRoot":"","sources":["../src/platform-wire.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAuB,MAAM,sCAAsC,CAAC;AAYzF,sGAAsG;AACtG,MAAM,KAAK,GAAG,2CAA2C,CAAC;AAE1D,MAAM,KAAK,GAAG,IAAI,CAAC;AACnB,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,MAAM,KAAK,GAAG,IAAI,CAAC;AACnB,MAAM,KAAK,GAAG,IAAI,CAAC;AACnB,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3C,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AACrC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAChD,qGAAqG;AACrG,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,KAAK,GAAG;IACZ,CAAC,UAAU,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAClD,CAAC,SAAS,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;CACxC,CAAC;AAEX;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,WAAW,CAAC,KAAiB;IAC3C,MAAM,KAAK,GAA8C,EAAE,CAAC;IAC5D,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,IA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,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAClH,OAAO,CAAC,KAAK,EAAE,KAAwB,EAAE,IAAkB,EAAE,EAAE;QAC7D,IAAI,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;YAC1B,IAAI,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC;gBAAE,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;;gBACrD,KAAK,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;YACxC,OAAO,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC3B,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,iBAAiB,CAAC,CAAC;QACjH,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAiB,CAAC;AACrB,CAAC"}
@@ -0,0 +1,149 @@
1
+ /**
2
+ * The readiness report (RFC wire-signing §7, follow-on 4): what the fleet's capability records say
3
+ * about each rollout step, and what still blocks it. Three gates, each a list of blockers:
4
+ *
5
+ * - **`signed-only`**: what blocks moving an environment's down-channel from `dual` to `signed-only`.
6
+ * - **key drop**: what blocks dropping a public key from an issuer's list.
7
+ * - **credential withdrawal**: what blocks withdrawing the shared credential (step 7).
8
+ *
9
+ * It is **advisory**: it informs the person who flips a setting or drops a key, and nothing in the
10
+ * tooling enforces it yet (follow-on 7). It is **read-only** by construction: it reads the registry,
11
+ * the capability records and the fleet walk's admin rows, and calls nothing else. It never reads a
12
+ * script, never walks, and writes nothing; the record reads it makes leave their own access-log rows.
13
+ *
14
+ * **Unknown is never read as fact.** A script with no record, a record the walk holds (`walkHold`),
15
+ * and a record the walk could not verify (`withheld: 'unverified'`) are listed as unknown, and every
16
+ * gate treats unknown as blocking. A record is trusted as current only when it was written after the
17
+ * last confirming walk began (`wireConfirmation`); when that walk cannot be found whole in the admin
18
+ * log, confirmation is unknown, and every gate that needs it is blocked.
19
+ *
20
+ * Every reason is a fixed sentence, naming at most a setting or a vertical; never a key, a key id or
21
+ * a tenant.
22
+ */
23
+ import { type AdminLogEntry, type PlatformActorId, type WireAuthRecord } from '@substrat-run/contracts';
24
+ import type { HostAdmin } from '@substrat-run/kernel';
25
+ import { type WireUploadSettings } from './wire-upload.js';
26
+ import { type WireWalkCursor } from './wire-walk.js';
27
+ /** A report page covers this many scripts when it names no limit. */
28
+ export declare const WIRE_READINESS_LIMIT_DEFAULT = 25;
29
+ /** A report page covers at most this many scripts. */
30
+ export declare const WIRE_READINESS_LIMIT_MAX = 50;
31
+ /** The most walk rows the report reads to find the last confirming walk; a walk longer than that is unknown. */
32
+ export declare const WIRE_CONFIRM_ROWS_MAX = 200;
33
+ /** What every report says first. */
34
+ export declare const WIRE_READINESS_ADVISORY = "advisory: this report informs the person who flips the down-channel, drops a key or withdraws the shared credential; no tooling enforces it yet (follow-on 7)";
35
+ /** What every report says second: when its answer holds. */
36
+ export declare const WIRE_READINESS_AS_OF = "the answer is as of each record\u2019s recorded time, not live: run the confirming pass immediately before any flip or drop, and run the report after it";
37
+ export type WireGate = 'signed-only' | 'key-drop' | 'credential-withdrawal';
38
+ /** One thing that blocks a gate. */
39
+ export interface WireBlocker {
40
+ /**
41
+ * `standing`: by design, until a later step answers it. `settings`: the control plane's own wire
42
+ * settings. `confirmation`: the last confirming walk. `script`: one script, named.
43
+ */
44
+ readonly kind: 'standing' | 'settings' | 'confirmation' | 'script';
45
+ readonly deploymentRef?: string;
46
+ readonly vertical?: string;
47
+ readonly reason: string;
48
+ }
49
+ /** What the last confirming walk proves: when it began, or why it proves nothing. */
50
+ export type WireConfirmation = {
51
+ readonly status: 'confirmed';
52
+ readonly startedAt: string;
53
+ readonly passes: number;
54
+ } | {
55
+ readonly status: 'unknown';
56
+ readonly reason: string;
57
+ };
58
+ /** One script, as the records say. */
59
+ export interface WireReadinessScript {
60
+ readonly deploymentRef: string;
61
+ readonly vertical: string;
62
+ readonly versionId: string | null;
63
+ readonly kind: 'serving' | 'version';
64
+ /**
65
+ * `unknown`: no record, held by the walk, or unverified by it. `verifies`: its record says it carries
66
+ * the platform's entry and was given lists. `not-verifying`: its record says it verifies nothing
67
+ * (no entry, or no lists).
68
+ */
69
+ readonly status: 'unknown' | 'verifies' | 'not-verifying';
70
+ /** Its record's state, when it has a record. */
71
+ readonly state?: WireAuthRecord['state'];
72
+ /** Whether its record was written after the last confirming walk began; `null` when that is unknown. */
73
+ readonly confirmed: boolean | null;
74
+ }
75
+ /** The key a person asks to drop, and when the control plane's list stopped naming it. */
76
+ export interface WireKeyDrop {
77
+ readonly issuer: 'router' | 'platform';
78
+ readonly kid: string;
79
+ readonly since: string;
80
+ }
81
+ export interface WireReadinessReport {
82
+ readonly advisory: string;
83
+ readonly asOf: string;
84
+ readonly from: string | null;
85
+ /** Where the next page starts, `null` at the end of the fleet. A gate is clear only when every page, from the start, shows it clear. */
86
+ readonly next: string | null;
87
+ readonly confirmation: WireConfirmation;
88
+ /** The key drop asked about, echoed: its issuer and `since`. */
89
+ readonly keyDrop?: {
90
+ readonly issuer: WireKeyDrop['issuer'];
91
+ readonly since: string;
92
+ };
93
+ readonly scripts: readonly WireReadinessScript[];
94
+ readonly blockers: {
95
+ readonly signedOnly: readonly WireBlocker[];
96
+ readonly keyDrop?: readonly WireBlocker[];
97
+ readonly credentialWithdrawal: readonly WireBlocker[];
98
+ };
99
+ }
100
+ /** The fixed sentences, in one place, so every copy reads the same. */
101
+ export declare const WIRE_READINESS_REASONS: {
102
+ readonly counters: 'the cutover counters (no legacy acceptance, no dual-mismatch, no fault, no refusal outside client noise) are not read by this report yet, nor is a version whose default export has no fetch, which only the counters show';
103
+ readonly notSignedOnly: 'no environment is signed-only: every upload and every walk gives dual';
104
+ readonly upChannel: 'the up-channel removals (step 6) are not recorded per version, so no version is shown to make no up-call with the shared credential';
105
+ readonly perDeployment: 'no version carries per-deployment values for its legacy checks (Q10), so a version never rebuilt still needs the shared credential';
106
+ readonly rolloutNotFleet: 'WIRE_KEYS_ROLLOUT is not fleet: not every deployment is given key lists';
107
+ readonly noRecord: 'it has no capability record, so what it carries is unknown';
108
+ readonly held: 'the fleet walk holds it, so its record states what was last known, not what it runs: look at it, then release it or push it again';
109
+ readonly unverified: 'the fleet walk found it with no record and could not verify it, so what it carries is unknown';
110
+ readonly noEntry: 'it was uploaded without the platform entry, so it verifies nothing: it is ready once pushed again';
111
+ readonly noLists: 'it was given no key lists, so it is legacy-only';
112
+ readonly stale: 'it does not carry the key lists, audience and state the control plane gives now: walk the fleet';
113
+ readonly noRouterStandby: 'its router key list holds no standby key beside the key in use';
114
+ readonly noPlatformStandby: 'its platform key list holds no standby key beside the key in use';
115
+ readonly unconfirmed: 'its record was written before the last confirming walk began, so it is not trusted as current';
116
+ readonly confirmationUnknown: 'the last confirming walk is unknown, so no record is trusted as current';
117
+ readonly confirmedBeforeSince: 'the last confirming walk began before the key left the list, so it does not show the key gone';
118
+ readonly stillListed: 'the control plane still lists the key';
119
+ readonly listWouldEmpty: 'the key is the only one its issuer lists';
120
+ readonly stillTrusted: 'it still trusts the key';
121
+ readonly lacksKeyInUse: 'it does not carry every key its issuer lists now';
122
+ };
123
+ /**
124
+ * What the last confirming walk proves, from the walk's admin rows, newest first (at most
125
+ * `WIRE_CONFIRM_ROWS_MAX`, plus one more to tell a full read from a cut one). Fails closed: confirmed
126
+ * only when the newest APPLIED pass is a confirming one that reached the end of the fleet, and the
127
+ * applied passes before it, one after another with no other applied pass between, are confirming ones
128
+ * chained back to the start of the fleet (each pass's `from` the `next` of the pass before), none of
129
+ * them refused or ended in an error, each with its start time. Anything else is `unknown`, with why:
130
+ * no such walk, a gap in the chain, a refused or failed pass in it, a row it cannot read, or a chain
131
+ * that runs past the rows read.
132
+ */
133
+ export declare function wireConfirmation(rows: readonly Pick<AdminLogEntry, 'after'>[]): WireConfirmation;
134
+ /** `since` as a person gives it: an instant, not in the future. A fixed sentence when it is not. */
135
+ export declare function wireKeyDropSince(since: unknown, now: Date): string | {
136
+ readonly refused: string;
137
+ };
138
+ /** One page of the report. Reads only; never throws for one script, only for a directory read that fails. */
139
+ export declare function wireReadinessReport(deps: {
140
+ readonly admin: HostAdmin;
141
+ readonly actor: PlatformActorId;
142
+ readonly settings: WireUploadSettings | undefined;
143
+ }, input: {
144
+ readonly cursor: WireWalkCursor | null;
145
+ readonly from: string | null;
146
+ readonly limit: number;
147
+ readonly keyDrop?: WireKeyDrop;
148
+ }): Promise<WireReadinessReport>;
149
+ //# sourceMappingURL=wire-readiness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire-readiness.d.ts","sourceRoot":"","sources":["../src/wire-readiness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAc,KAAK,aAAa,EAA2B,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE7I,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAA2D,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACpH,OAAO,EAA6F,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhJ,qEAAqE;AACrE,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAC/C,sDAAsD;AACtD,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,gH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AA+F;aAC3G,OAAO,EAAE,mGAAmG;aAC5G,OAAO,EAAE,iDAAiD;aAC1D,KAAK,EAAE,iGAAiG;aACxG,eAAe,EAAE,gEAAgE;aACjF,iBAAiB,EAAE,kEAAkE;aACrF,WAAW,EAAE,+FAA+F;aAC5G,mBAAmB,EAAE,yEAAyE;aAC9F,oBAAoB,EAAE,+FAA+F;aACrH,WAAW,EAAE,uCAAuC;aACpD,cAAc,EAAE,0CAA0C;aAC1D,YAAY,EAAE,yBAAyB;aACvC,aAAa,EAAE,kDAAkD;CACzD,CAAC;AAeX;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,EAAE,GAAG,gBAAgB,CA0BhG;AAED,oGAAoG;AACpG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAMjG;AAeD,6GAA6G;AAC7G,wBAAsB,mBAAmB,CACvC,IAAI,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,CAAA;CAAE,EACvH,KAAK,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,GACtI,OAAO,CAAC,mBAAmB,CAAC,CAyG9B"}
@@ -0,0 +1,250 @@
1
+ /**
2
+ * The readiness report (RFC wire-signing §7, follow-on 4): what the fleet's capability records say
3
+ * about each rollout step, and what still blocks it. Three gates, each a list of blockers:
4
+ *
5
+ * - **`signed-only`**: what blocks moving an environment's down-channel from `dual` to `signed-only`.
6
+ * - **key drop**: what blocks dropping a public key from an issuer's list.
7
+ * - **credential withdrawal**: what blocks withdrawing the shared credential (step 7).
8
+ *
9
+ * It is **advisory**: it informs the person who flips a setting or drops a key, and nothing in the
10
+ * tooling enforces it yet (follow-on 7). It is **read-only** by construction: it reads the registry,
11
+ * the capability records and the fleet walk's admin rows, and calls nothing else. It never reads a
12
+ * script, never walks, and writes nothing; the record reads it makes leave their own access-log rows.
13
+ *
14
+ * **Unknown is never read as fact.** A script with no record, a record the walk holds (`walkHold`),
15
+ * and a record the walk could not verify (`withheld: 'unverified'`) are listed as unknown, and every
16
+ * gate treats unknown as blocking. A record is trusted as current only when it was written after the
17
+ * last confirming walk began (`wireConfirmation`); when that walk cannot be found whole in the admin
18
+ * log, confirmation is unknown, and every gate that needs it is blocked.
19
+ *
20
+ * Every reason is a fixed sentence, naming at most a setting or a vertical; never a key, a key id or
21
+ * a tenant.
22
+ */
23
+ import { instant, z } from '@substrat-run/contracts';
24
+ import { wireUploadSettings, WIRE_UNSIGNED_ROUTES } from '@substrat-run/contracts/wire-signing';
25
+ import { wireSettingsRefusal, wireKeysRolloutOf, wireUploadGiven } from './wire-upload.js';
26
+ import { carriesAlready, wireAuthRecordsOf, wireInventory, wireInventoryPass } from './wire-walk.js';
27
+ /** A report page covers this many scripts when it names no limit. */
28
+ export const WIRE_READINESS_LIMIT_DEFAULT = 25;
29
+ /** A report page covers at most this many scripts. */
30
+ export const WIRE_READINESS_LIMIT_MAX = 50;
31
+ /** The most walk rows the report reads to find the last confirming walk; a walk longer than that is unknown. */
32
+ export const WIRE_CONFIRM_ROWS_MAX = 200;
33
+ /** What every report says first. */
34
+ export const WIRE_READINESS_ADVISORY = 'advisory: this report informs the person who flips the down-channel, drops a key or withdraws the shared credential; no tooling enforces it yet (follow-on 7)';
35
+ /** What every report says second: when its answer holds. */
36
+ export const WIRE_READINESS_AS_OF = 'the answer is as of each record’s recorded time, not live: run the confirming pass immediately before any flip or drop, and run the report after it';
37
+ /** The fixed sentences, in one place, so every copy reads the same. */
38
+ export const WIRE_READINESS_REASONS = {
39
+ counters: 'the cutover counters (no legacy acceptance, no dual-mismatch, no fault, no refusal outside client noise) are not read by this report yet, nor is a version whose default export has no fetch, which only the counters show',
40
+ notSignedOnly: 'no environment is signed-only: every upload and every walk gives dual',
41
+ upChannel: 'the up-channel removals (step 6) are not recorded per version, so no version is shown to make no up-call with the shared credential',
42
+ perDeployment: 'no version carries per-deployment values for its legacy checks (Q10), so a version never rebuilt still needs the shared credential',
43
+ rolloutNotFleet: 'WIRE_KEYS_ROLLOUT is not fleet: not every deployment is given key lists',
44
+ noRecord: 'it has no capability record, so what it carries is unknown',
45
+ held: 'the fleet walk holds it, so its record states what was last known, not what it runs: look at it, then release it or push it again',
46
+ unverified: 'the fleet walk found it with no record and could not verify it, so what it carries is unknown',
47
+ noEntry: 'it was uploaded without the platform entry, so it verifies nothing: it is ready once pushed again',
48
+ noLists: 'it was given no key lists, so it is legacy-only',
49
+ stale: 'it does not carry the key lists, audience and state the control plane gives now: walk the fleet',
50
+ noRouterStandby: 'its router key list holds no standby key beside the key in use',
51
+ noPlatformStandby: 'its platform key list holds no standby key beside the key in use',
52
+ unconfirmed: 'its record was written before the last confirming walk began, so it is not trusted as current',
53
+ confirmationUnknown: 'the last confirming walk is unknown, so no record is trusted as current',
54
+ confirmedBeforeSince: 'the last confirming walk began before the key left the list, so it does not show the key gone',
55
+ stillListed: 'the control plane still lists the key',
56
+ listWouldEmpty: 'the key is the only one its issuer lists',
57
+ stillTrusted: 'it still trusts the key',
58
+ lacksKeyInUse: 'it does not carry every key its issuer lists now',
59
+ };
60
+ const R = WIRE_READINESS_REASONS;
61
+ /** The walk row's fields the report reads; any other shape is a row it cannot read. */
62
+ const walkRow = z.object({
63
+ apply: z.boolean(),
64
+ confirm: z.boolean(),
65
+ startedAt: instant.optional(),
66
+ from: z.string().nullable(),
67
+ next: z.string().nullable(),
68
+ error: z.string().optional(),
69
+ refused: z.string().optional(),
70
+ });
71
+ /**
72
+ * What the last confirming walk proves, from the walk's admin rows, newest first (at most
73
+ * `WIRE_CONFIRM_ROWS_MAX`, plus one more to tell a full read from a cut one). Fails closed: confirmed
74
+ * only when the newest APPLIED pass is a confirming one that reached the end of the fleet, and the
75
+ * applied passes before it, one after another with no other applied pass between, are confirming ones
76
+ * chained back to the start of the fleet (each pass's `from` the `next` of the pass before), none of
77
+ * them refused or ended in an error, each with its start time. Anything else is `unknown`, with why:
78
+ * no such walk, a gap in the chain, a refused or failed pass in it, a row it cannot read, or a chain
79
+ * that runs past the rows read.
80
+ */
81
+ export function wireConfirmation(rows) {
82
+ const unknown = (reason) => ({ status: 'unknown', reason });
83
+ const read = rows.slice(0, WIRE_CONFIRM_ROWS_MAX);
84
+ const parsed = [];
85
+ for (const row of read) {
86
+ const p = walkRow.safeParse(row.after);
87
+ if (!p.success)
88
+ return unknown('a fleet walk row could not be read');
89
+ parsed.push(p.data);
90
+ }
91
+ const applied = parsed.filter((p) => p.apply);
92
+ if (applied.length === 0) {
93
+ return unknown(rows.length > read.length ? 'no applied walk is among the rows read' : 'no applied confirming walk is recorded');
94
+ }
95
+ let expected = null;
96
+ for (let i = 0; i < applied.length; i++) {
97
+ const p = applied[i];
98
+ if (!p.confirm) {
99
+ return unknown(i === 0 ? 'the last applied walk was not a confirming one' : 'an applied walk that was not confirming ran inside the last confirming walk');
100
+ }
101
+ if (p.refused !== undefined || p.error !== undefined)
102
+ return unknown('a pass of the last confirming walk was refused or ended in an error');
103
+ if (p.next !== expected)
104
+ return unknown(i === 0 ? 'the last confirming walk did not reach the end of the fleet' : 'the last confirming walk has a gap between its passes');
105
+ if (p.startedAt === undefined)
106
+ return unknown('a pass of the last confirming walk does not record when it began');
107
+ if (p.from === null)
108
+ return { status: 'confirmed', startedAt: p.startedAt, passes: i + 1 };
109
+ expected = p.from;
110
+ }
111
+ return unknown(rows.length > read.length ? 'the last confirming walk runs past the rows read' : 'the last confirming walk does not reach back to the start of the fleet');
112
+ }
113
+ /** `since` as a person gives it: an instant, not in the future. A fixed sentence when it is not. */
114
+ export function wireKeyDropSince(since, now) {
115
+ if (since === undefined || since === null || since === '')
116
+ return { refused: 'a key drop names since: when the control plane’s list stopped naming the key' };
117
+ const parsed = instant.safeParse(since);
118
+ if (!parsed.success)
119
+ return { refused: 'since is an ISO 8601 instant' };
120
+ if (Date.parse(parsed.data) > now.getTime())
121
+ return { refused: 'since is not in the future' };
122
+ return parsed.data;
123
+ }
124
+ /** The key ids each issuer's list names now, or `null` when the lists do not load. */
125
+ async function listedKids(settings) {
126
+ try {
127
+ const given = await wireUploadSettings({ routerKeys: settings?.routerKeys ?? '', platformKeys: settings?.platformKeys ?? '', audience: 'wire-settings-check' });
128
+ return { router: given.routerKids, platform: given.platformKids };
129
+ }
130
+ catch {
131
+ return null;
132
+ }
133
+ }
134
+ const unknownReason = (record) => !record ? R.noRecord : record.record.walkHold !== undefined ? R.held : record.record.withheld === 'unverified' ? R.unverified : null;
135
+ /** One page of the report. Reads only; never throws for one script, only for a directory read that fails. */
136
+ export async function wireReadinessReport(deps, input) {
137
+ const { admin, actor, settings } = deps;
138
+ const rows = await admin.auditLog(actor, { action: 'walkWireAuth', order: 'desc', limit: WIRE_CONFIRM_ROWS_MAX + 1 });
139
+ const confirmation = wireConfirmation(rows);
140
+ const refused = await wireSettingsRefusal(settings);
141
+ const rollout = wireKeysRolloutOf(settings?.rollout);
142
+ const kids = await listedKids(settings);
143
+ const signedOnly = [
144
+ ...WIRE_UNSIGNED_ROUTES.map((r) => ({ kind: 'standing', reason: `${r.method} ${r.path}: ${r.reason}` })),
145
+ { kind: 'standing', reason: R.counters },
146
+ ];
147
+ const drop = input.keyDrop ? [] : undefined;
148
+ const settingsBlocker = refused ? { kind: 'settings', reason: `the control plane’s wire settings are refused (${refused.withheld}): ${refused.reason}` } : null;
149
+ if (settingsBlocker) {
150
+ signedOnly.push(settingsBlocker);
151
+ drop?.push(settingsBlocker);
152
+ }
153
+ else if ('refused' in rollout || rollout.kind !== 'fleet') {
154
+ // Only while the settings are usable: a refusal hides the rollout state, and is the fix to make first.
155
+ signedOnly.push({ kind: 'settings', reason: R.rolloutNotFleet });
156
+ }
157
+ if (confirmation.status === 'unknown') {
158
+ const blocker = { kind: 'confirmation', reason: `${R.confirmationUnknown}: ${confirmation.reason}` };
159
+ signedOnly.push(blocker);
160
+ drop?.push(blocker);
161
+ }
162
+ const keyDrop = input.keyDrop;
163
+ if (keyDrop && drop) {
164
+ const listed = kids?.[keyDrop.issuer] ?? null;
165
+ if (listed === null) {
166
+ if (!settingsBlocker)
167
+ drop.push({ kind: 'settings', reason: 'the control plane’s key lists do not load' });
168
+ }
169
+ else {
170
+ if (listed.includes(keyDrop.kid))
171
+ drop.push({ kind: 'settings', reason: R.stillListed });
172
+ if (listed.every((k) => k === keyDrop.kid))
173
+ drop.push({ kind: 'settings', reason: R.listWouldEmpty });
174
+ }
175
+ if (confirmation.status === 'confirmed' && Date.parse(confirmation.startedAt) < Date.parse(keyDrop.since)) {
176
+ drop.push({ kind: 'confirmation', reason: R.confirmedBeforeSince });
177
+ }
178
+ }
179
+ let records = null;
180
+ const recordOf = async (script) => {
181
+ if (records?.vertical !== script.vertical)
182
+ records = { vertical: script.vertical, held: await wireAuthRecordsOf(admin, actor, script.vertical) };
183
+ return records.held.get(script.deploymentRef);
184
+ };
185
+ const judge = async (script) => {
186
+ const stored = await recordOf(script);
187
+ const named = (reason) => ({ kind: 'script', deploymentRef: script.deploymentRef, vertical: script.vertical, reason });
188
+ const base = { deploymentRef: script.deploymentRef, vertical: script.vertical, versionId: script.versionId, kind: script.kind };
189
+ const unknown = unknownReason(stored);
190
+ if (unknown !== null || !stored) {
191
+ const blocker = named(unknown ?? R.noRecord);
192
+ signedOnly.push(blocker);
193
+ drop?.push(blocker);
194
+ return { ...base, status: 'unknown', ...(stored ? { state: stored.record.state } : {}), confirmed: null };
195
+ }
196
+ const record = stored.record;
197
+ const confirmed = confirmation.status === 'confirmed' ? Date.parse(stored.recordedAt) >= Date.parse(confirmation.startedAt) : null;
198
+ const verifies = record.envelope !== null && record.withheld === null;
199
+ if (record.envelope === null) {
200
+ signedOnly.push(named(R.noEntry));
201
+ }
202
+ else if (record.withheld !== null) {
203
+ signedOnly.push(named(`${R.noLists} (${record.withheld})`));
204
+ }
205
+ const given = await wireUploadGiven(settings, { vertical: script.vertical, deploymentRef: script.deploymentRef, entry: { envelope: record.envelope, entrySkipped: record.entrySkipped } });
206
+ if (verifies) {
207
+ if (!carriesAlready(record, given.record))
208
+ signedOnly.push(named(R.stale));
209
+ if (record.routerKids.length < 2)
210
+ signedOnly.push(named(R.noRouterStandby));
211
+ if (record.platformKids.length < 2)
212
+ signedOnly.push(named(R.noPlatformStandby));
213
+ }
214
+ if (confirmed === false) {
215
+ signedOnly.push(named(R.unconfirmed));
216
+ drop?.push(named(R.unconfirmed));
217
+ }
218
+ if (keyDrop && drop) {
219
+ const trusted = keyDrop.issuer === 'router' ? record.routerKids : record.platformKids;
220
+ if (trusted.includes(keyDrop.kid))
221
+ drop.push(named(R.stillTrusted));
222
+ const listed = kids?.[keyDrop.issuer];
223
+ if (trusted.length > 0 && listed && listed.some((k) => k !== keyDrop.kid && !trusted.includes(k)))
224
+ drop.push(named(R.lacksKeyInUse));
225
+ }
226
+ return { ...base, status: verifies ? 'verifies' : 'not-verifying', state: record.state, confirmed };
227
+ };
228
+ const scripts = [];
229
+ const next = await wireInventoryPass(wireInventory(admin, actor, input.cursor), input.limit, judge, scripts);
230
+ // Everything that blocks signed-only but its standing blockers blocks the withdrawal too: a script
231
+ // that does not carry and verify signed calls still needs the shared credential. Signed-only's
232
+ // standing blockers are covered by the withdrawal's own first one (no environment is signed-only).
233
+ const withdrawal = [
234
+ { kind: 'standing', reason: R.notSignedOnly },
235
+ { kind: 'standing', reason: R.upChannel },
236
+ { kind: 'standing', reason: R.perDeployment },
237
+ ...signedOnly.filter((b) => b.kind !== 'standing'),
238
+ ];
239
+ return {
240
+ advisory: WIRE_READINESS_ADVISORY,
241
+ asOf: WIRE_READINESS_AS_OF,
242
+ from: input.from,
243
+ next,
244
+ confirmation,
245
+ ...(keyDrop ? { keyDrop: { issuer: keyDrop.issuer, since: keyDrop.since } } : {}),
246
+ scripts,
247
+ blockers: { signedOnly, ...(drop ? { keyDrop: drop } : {}), credentialWithdrawal: withdrawal },
248
+ };
249
+ }
250
+ //# sourceMappingURL=wire-readiness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire-readiness.js","sourceRoot":"","sources":["../src/wire-readiness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,OAAO,EAAE,CAAC,EAA0F,MAAM,yBAAyB,CAAC;AAC7I,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAEhG,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,eAAe,EAA2B,MAAM,kBAAkB,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,iBAAiB,EAA6C,MAAM,gBAAgB,CAAC;AAEhJ,qEAAqE;AACrE,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAC/C,sDAAsD;AACtD,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAC3C,gHAAgH;AAChH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,oCAAoC;AACpC,MAAM,CAAC,MAAM,uBAAuB,GAClC,+JAA+J,CAAC;AAElK,4DAA4D;AAC5D,MAAM,CAAC,MAAM,oBAAoB,GAC/B,qJAAqJ,CAAC;AA+DxJ,uEAAuE;AACvE,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,QAAQ,EACN,4NAA4N;IAC9N,aAAa,EAAE,uEAAuE;IACtF,SAAS,EAAE,qIAAqI;IAChJ,aAA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CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAC7G,mGAAmG;IACnG,+FAA+F;IAC/F,mGAAmG;IACnG,MAAM,UAAU,GAAkB;QAChC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,aAAa,EAAE;QAC7C,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,SAAS,EAAE;QACzC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,aAAa,EAAE;QAC7C,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;KACnD,CAAC;IACF,OAAO;QACL,QAAQ,EAAE,uBAAuB;QACjC,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI;QACJ,YAAY;QACZ,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,OAAO;QACP,QAAQ,EAAE,EAAE,UAAU,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,oBAAoB,EAAE,UAAU,EAAE;KAC/F,CAAC;AACJ,CAAC"}
@@ -35,7 +35,7 @@
35
35
  * `wire-settings.ts`. Do not run the walk while a push or promote of the same vertical is in flight,
36
36
  * and end with a confirming pass.
37
37
  */
38
- import { type PlatformActorId } from '@substrat-run/contracts';
38
+ import { type DeploymentWireAuth, type PlatformActorId, type WireAuthRecord } from '@substrat-run/contracts';
39
39
  import type { HostAdmin } from '@substrat-run/kernel';
40
40
  import type { FetchVerticalModulesFn } from './deploy.js';
41
41
  import { type WireSettingsApi } from './wire-settings.js';
@@ -123,6 +123,27 @@ export interface WireWalkDeps {
123
123
  }) => void;
124
124
  readonly now?: () => Date;
125
125
  }
126
+ /** One script the registry names, as the walk and the readiness report reach it. */
127
+ export interface InventoryScript {
128
+ readonly vertical: string;
129
+ readonly deploymentRef: string;
130
+ readonly versionId: string | null;
131
+ readonly kind: 'serving' | 'version';
132
+ /** Where a pass that ends on this script answers the next one starts. */
133
+ readonly cursor: string;
134
+ }
135
+ /** Every capability record of one vertical's scripts, by script name, read a page at a time. */
136
+ export declare function wireAuthRecordsOf(admin: HostAdmin, actor: PlatformActorId, vertical: string): Promise<Map<string, DeploymentWireAuth>>;
137
+ /**
138
+ * Hand each script from `fleet` to `each` in order, at most `limit` of them, answering where the next pass starts:
139
+ * `null` when the last one handled was the fleet's last. Looks one ahead, so the pass that ends on the
140
+ * fleet's last script already answers `null`; a look that fails does not undo a pass that is done.
141
+ */
142
+ export declare function wireInventoryPass<T>(fleet: AsyncGenerator<InventoryScript>, limit: number, each: (script: InventoryScript) => Promise<T>, out: T[]): Promise<string | null>;
143
+ /** The registry's scripts in walk order, from `from` on: each vertical's serving script, then its versions' scripts. */
144
+ export declare function wireInventory(admin: HostAdmin, actor: PlatformActorId, from: WireWalkCursor | null): AsyncGenerator<InventoryScript>;
145
+ /** Whether a record already holds what a given record says, in what a script carries: the state, the audience and the key ids. */
146
+ export declare function carriesAlready(stored: WireAuthRecord, given: WireAuthRecord): boolean;
126
147
  /** Run one pass. Never throws for one script's failure; throws only for a directory read that fails. */
127
148
  export declare function runWireWalk(deps: WireWalkDeps, input: {
128
149
  readonly apply: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"wire-walk.d.ts","sourceRoot":"","sources":["../src/wire-walk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAS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