@substrat-run/kernel 0.221.0 → 0.222.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.
- package/dist/app-environments.d.ts +123 -4
- package/dist/app-environments.d.ts.map +1 -1
- package/dist/app-environments.js +212 -6
- package/dist/app-environments.js.map +1 -1
- package/dist/broker-counts.d.ts +8 -30
- package/dist/broker-counts.d.ts.map +1 -1
- package/dist/broker-counts.js +41 -6
- package/dist/broker-counts.js.map +1 -1
- package/dist/broker-shadow.d.ts +3 -0
- package/dist/broker-shadow.d.ts.map +1 -1
- package/dist/broker-shadow.js +1 -0
- package/dist/broker-shadow.js.map +1 -1
- package/dist/broker-telemetry.d.ts +11 -0
- package/dist/broker-telemetry.d.ts.map +1 -1
- package/dist/broker-telemetry.js +5 -0
- package/dist/broker-telemetry.js.map +1 -1
- package/dist/carried-copy.d.ts.map +1 -1
- package/dist/carried-copy.js +3 -1
- package/dist/carried-copy.js.map +1 -1
- package/dist/credential-bound-fetch.d.ts +73 -0
- package/dist/credential-bound-fetch.d.ts.map +1 -0
- package/dist/credential-bound-fetch.js +241 -0
- package/dist/credential-bound-fetch.js.map +1 -0
- package/dist/delivery-broker.d.ts +24 -5
- package/dist/delivery-broker.d.ts.map +1 -1
- package/dist/delivery-broker.js +30 -7
- package/dist/delivery-broker.js.map +1 -1
- package/dist/delivery-contract.d.ts +29 -3
- package/dist/delivery-contract.d.ts.map +1 -1
- package/dist/delivery-contract.js +85 -1
- package/dist/delivery-contract.js.map +1 -1
- package/dist/dependent-erasure.d.ts +106 -0
- package/dist/dependent-erasure.d.ts.map +1 -0
- package/dist/dependent-erasure.js +150 -0
- package/dist/dependent-erasure.js.map +1 -0
- package/dist/directory-lake-keep.d.ts.map +1 -1
- package/dist/directory-lake-keep.js +7 -1
- package/dist/directory-lake-keep.js.map +1 -1
- package/dist/home-scope.d.ts +87 -0
- package/dist/home-scope.d.ts.map +1 -0
- package/dist/home-scope.js +110 -0
- package/dist/home-scope.js.map +1 -0
- package/dist/index.d.ts +12 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/module-operations.d.ts +9 -0
- package/dist/module-operations.d.ts.map +1 -1
- package/dist/module-operations.js +22 -0
- package/dist/module-operations.js.map +1 -1
- package/dist/owned-reaps.d.ts +73 -0
- package/dist/owned-reaps.d.ts.map +1 -0
- package/dist/owned-reaps.js +71 -0
- package/dist/owned-reaps.js.map +1 -0
- package/dist/platform-sweep.d.ts +14 -1
- package/dist/platform-sweep.d.ts.map +1 -1
- package/dist/platform-sweep.js +117 -59
- package/dist/platform-sweep.js.map +1 -1
- package/dist/relay-intents.d.ts +38 -0
- package/dist/relay-intents.d.ts.map +1 -0
- package/dist/relay-intents.js +45 -0
- package/dist/relay-intents.js.map +1 -0
- package/dist/release-within-major.d.ts +54 -2
- package/dist/release-within-major.d.ts.map +1 -1
- package/dist/release-within-major.js +80 -6
- package/dist/release-within-major.js.map +1 -1
- package/dist/scope-copy-ledger.d.ts +5 -0
- package/dist/scope-copy-ledger.d.ts.map +1 -1
- package/dist/scope-copy-ledger.js +8 -0
- package/dist/scope-copy-ledger.js.map +1 -1
- package/dist/scope-host.d.ts +98 -3
- package/dist/scope-host.d.ts.map +1 -1
- package/dist/scope-host.js.map +1 -1
- package/dist/scope-types.d.ts +15 -0
- package/dist/scope-types.d.ts.map +1 -1
- package/dist/scope-types.js +19 -0
- package/dist/scope-types.js.map +1 -1
- package/package.json +2 -2
|
@@ -20,10 +20,27 @@
|
|
|
20
20
|
* so a row from before reads as an environment with no script, which is what it is. The script is
|
|
21
21
|
* fixed for the environment's life: a serve that names another one is refused.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
* 6).
|
|
23
|
+
* **A named environment causes no outside effects unless a person gives it connections of its own**
|
|
24
|
+
* (#3530 step 6). The choice is one column on the row (`effects`, NULL read as `none`), and the one
|
|
25
|
+
* rule every connection door asks is `connectionReachIn`: an install reaches the tenant's connections
|
|
26
|
+
* and its own, the scope of an environment given connections of its own reaches its own alone, and
|
|
27
|
+
* every other scope that is not an install reaches none. It never inherits production's.
|
|
28
|
+
*
|
|
29
|
+
* **A serve into a named environment is judged by the two checkpoints against what it serves**
|
|
30
|
+
* (#3638, D-83's third position). The version it serves is its own script's, or before its first
|
|
31
|
+
* serve its preview's bound version (`environmentServedVersionIn`). A serve whose permission or
|
|
32
|
+
* migration digest differs from that version's is refused until it is acknowledged for this serve
|
|
33
|
+
* (`environmentCheckpointRefusal`), and the acknowledgement lands in this environment's serve
|
|
34
|
+
* record, so it never counts for another environment, and a promote's never counts here.
|
|
35
|
+
*
|
|
36
|
+
* **A broker per environment** (#3639): the scope of an environment given connections of its own hands
|
|
37
|
+
* its messages off to that environment's broker (`deliveryEnvironmentIn`), never production's, whose
|
|
38
|
+
* name does not change. Every other scope that is not an install hands off nothing.
|
|
39
|
+
*
|
|
40
|
+
* What is deliberately not here: edges between environments (D-83 step 5). A named environment's
|
|
41
|
+
* scope is a preview, so everything but its own connections and its own broker stays inert.
|
|
25
42
|
*/
|
|
26
|
-
import { type AppEnvironment, type EnvironmentServing, type ScopeId, type TenantId } from '@substrat-run/contracts';
|
|
43
|
+
import { type AppEnvironment, type ConnectionReach, type EnvironmentEffects, type EnvironmentServeAcknowledgement, type EnvironmentServing, type Scope, type ScopeId, type TenantId } from '@substrat-run/contracts';
|
|
27
44
|
import type { SwitchSql } from './system-switch.js';
|
|
28
45
|
/** Directory-owned, on both adapters. One row per named environment; production has none. */
|
|
29
46
|
export declare const APP_ENVIRONMENTS_DDL = "\n CREATE TABLE IF NOT EXISTS app_environments (\n tenant_id TEXT NOT NULL,\n vertical TEXT NOT NULL,\n name TEXT NOT NULL,\n created_at TEXT NOT NULL,\n created_by TEXT NOT NULL,\n PRIMARY KEY (tenant_id, vertical, name)\n );\n";
|
|
@@ -35,6 +52,12 @@ export declare const APP_ENVIRONMENTS_DDL = "\n CREATE TABLE IF NOT EXISTS app_
|
|
|
35
52
|
* its Durable Object migrations against, as `verticals.serving_*` are for production.
|
|
36
53
|
*/
|
|
37
54
|
export declare const APP_ENVIRONMENT_SERVING_COLUMNS: readonly ['serving_ref TEXT', 'serving_version_id TEXT', 'serving_do_classes TEXT', 'serving_migration_tag TEXT', 'serve_claim TEXT', 'serve_claimed_until TEXT'];
|
|
55
|
+
/**
|
|
56
|
+
* #3530 step 6: a named environment's choice of outside effects, ALTERed onto `app_environments` by
|
|
57
|
+
* both adapters (and copied into the K-68 objects' column list). NULL on every row from before it,
|
|
58
|
+
* which reads as `none`: the inert default every preview has.
|
|
59
|
+
*/
|
|
60
|
+
export declare const APP_ENVIRONMENT_EFFECTS_COLUMNS: readonly ['effects TEXT'];
|
|
38
61
|
/**
|
|
39
62
|
* SQL: joins `ae`, the environment whose own script the scope `s` is served from, to a read over
|
|
40
63
|
* `scopes s`. Null for every scope that is not on one: production's installs, a preview on its
|
|
@@ -81,6 +104,29 @@ export declare function removeEnvironmentIn(sql: SwitchSql, input: DefineEnviron
|
|
|
81
104
|
removed: boolean;
|
|
82
105
|
scopeId: ScopeId | null;
|
|
83
106
|
};
|
|
107
|
+
/** One side of an environment's checkpoints (#3638): a version and its two pushed digests. */
|
|
108
|
+
export interface CheckpointSide {
|
|
109
|
+
id: string;
|
|
110
|
+
permissionDigest: string;
|
|
111
|
+
migrationDigest: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The refusal of a serve into the named environment `name` that changes the permission surface or the
|
|
115
|
+
* migrations against `base`, the version the environment serves, and does not acknowledge it (#3638,
|
|
116
|
+
* D-83). Null when it may go on: nothing served yet (a first serve has nothing to diff, as a first
|
|
117
|
+
* promote has not), the same version again, the same digests, or each change acknowledged. Both
|
|
118
|
+
* checkpoints are named in one refusal, so one review answers them. `conflict`, as the promote's are;
|
|
119
|
+
* the problem document carries the environment and the base, which is what the review is read against.
|
|
120
|
+
*/
|
|
121
|
+
export declare function environmentCheckpointRefusal(name: string, base: CheckpointSide | null, incoming: CheckpointSide, acknowledge: EnvironmentServeAcknowledgement | undefined): Error | null;
|
|
122
|
+
/** A version's two pushed digests from the directory, or null for a version it does not hold. */
|
|
123
|
+
export declare function checkpointSideIn(sql: SwitchSql, versionId: string): CheckpointSide | null;
|
|
124
|
+
/**
|
|
125
|
+
* The version a named environment serves (#3638): what its own script runs, or before its first serve
|
|
126
|
+
* the version its preview is bound to. Null when it serves nothing: no such environment, or a preview
|
|
127
|
+
* that is gone or bound to no version.
|
|
128
|
+
*/
|
|
129
|
+
export declare function environmentServedVersionIn(sql: SwitchSql, input: DefineEnvironmentInput): string | null;
|
|
84
130
|
/**
|
|
85
131
|
* Record what an environment's own script now runs (#3530 step 4), written only after the upload
|
|
86
132
|
* landed, in the caller's one directory transaction with its admin row. A compare-and-set on
|
|
@@ -89,10 +135,17 @@ export declare function removeEnvironmentIn(sql: SwitchSql, input: DefineEnviron
|
|
|
89
135
|
* another record now. Refused: a name that is no environment (`not_found`); another script than the
|
|
90
136
|
* one the environment already serves from (`conflict`, since the data lives there); a class set
|
|
91
137
|
* that drops a class the script already has (`validation_failed`: a class's storage cannot go).
|
|
138
|
+
*
|
|
139
|
+
* #3638: refused too (`conflict`, `environmentCheckpointRefusal`) when `next` changes the permission
|
|
140
|
+
* surface or the migrations against the version the environment serves (`environmentServedVersionIn`)
|
|
141
|
+
* and `acknowledge` does not acknowledge it. The caller judges the same before it uploads anything;
|
|
142
|
+
* this is the record's own judgement, in the transaction that moves what the environment serves.
|
|
92
143
|
*/
|
|
93
144
|
export declare function setEnvironmentServingIn(sql: SwitchSql, input: DefineEnvironmentInput, next: EnvironmentServing, expected: EnvironmentServing | null,
|
|
94
145
|
/** The serve's claim (`claimEnvironmentServeIn`): the record lands only while it is still the one held. */
|
|
95
|
-
claim?: string
|
|
146
|
+
claim?: string,
|
|
147
|
+
/** #3638: what this serve acknowledges, in this environment. */
|
|
148
|
+
acknowledge?: EnvironmentServeAcknowledgement): {
|
|
96
149
|
moved: boolean;
|
|
97
150
|
before: EnvironmentServing | null;
|
|
98
151
|
scopeId: ScopeId | null;
|
|
@@ -110,4 +163,70 @@ export declare function claimEnvironmentServeIn(sql: SwitchSql, input: DefineEnv
|
|
|
110
163
|
}): boolean;
|
|
111
164
|
/** Give the serve lease back. Only `claim`'s own: a lapsed claim taken over since is left to its holder. */
|
|
112
165
|
export declare function releaseEnvironmentServeIn(sql: SwitchSql, input: DefineEnvironmentInput, claim: string): void;
|
|
166
|
+
/**
|
|
167
|
+
* Give a named environment connections of its own, or take that back (#3530 step 6), in the caller's
|
|
168
|
+
* one directory transaction with its admin row. Production's effects are not a choice, so naming it
|
|
169
|
+
* is `not_found` as every other door's is. `changed: false`, with nothing written, when the row
|
|
170
|
+
* already holds `effects`. Taking it back moves no connection: the environment's own stay where they
|
|
171
|
+
* are, and no door lets it use them until it is given them again.
|
|
172
|
+
*/
|
|
173
|
+
export declare function setEnvironmentEffectsIn(sql: SwitchSql, input: DefineEnvironmentInput, effects: EnvironmentEffects): {
|
|
174
|
+
changed: boolean;
|
|
175
|
+
before: EnvironmentEffects;
|
|
176
|
+
scopeId: ScopeId | null;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Which connections the scope's outside effects may go through (#3530 step 6): the one rule every
|
|
180
|
+
* connection door asks, decided here from the directory so a door cannot restate it wrongly.
|
|
181
|
+
*
|
|
182
|
+
* - `all`: an install (`isPrimaryScopeRow`), as today: the tenant's connections and its own.
|
|
183
|
+
* - `own`: the active, pinned preview that IS a named environment of its app (the scope that name
|
|
184
|
+
* resolves to, never another preview under the same slug), whose environment was given connections
|
|
185
|
+
* of its own. It reaches connections its own scope owns, and nothing else.
|
|
186
|
+
* - `none`: everything else, a scope that is not on record or is another tenant's included. A fork, a
|
|
187
|
+
* snapshot of an environment, an environment's preview while it is archived or expiring, and an
|
|
188
|
+
* environment nobody gave connections all read `none`, which is what they read before this rule.
|
|
189
|
+
*/
|
|
190
|
+
export declare function connectionReachIn(sql: SwitchSql, tenantId: TenantId | string, scopeId: ScopeId | string): ConnectionReach;
|
|
191
|
+
/**
|
|
192
|
+
* The environment whose broker the scope hands its messages to (D-83, #3639), or null when it hands
|
|
193
|
+
* off nothing. Decided by `connectionReachIn`'s one rule, so a scope sends through a broker exactly
|
|
194
|
+
* when it may cause outside effects at all:
|
|
195
|
+
*
|
|
196
|
+
* - an install (`all`) hands off to production's broker, `PRODUCTION_ENVIRONMENT`, as before;
|
|
197
|
+
* - the scope of a named environment given connections of its own (`own`) hands off to that
|
|
198
|
+
* environment's broker, never production's;
|
|
199
|
+
* - every other scope (a preview, a fork, a snapshot, an environment nobody gave connections, a scope
|
|
200
|
+
* not on record) hands off nothing, which is what it did before.
|
|
201
|
+
*/
|
|
202
|
+
export declare function deliveryEnvironmentIn(sql: SwitchSql, tenantId: TenantId | string, scopeId: ScopeId | string): string | null;
|
|
203
|
+
/**
|
|
204
|
+
* The environment a scope belongs to, whatever it may do now (#3639): production for an install, a
|
|
205
|
+
* named environment's name for a preview whose slug names one of the app's environments (archived,
|
|
206
|
+
* expiring or given no effects alike), null for any other scope. It is what a scope's broker is found
|
|
207
|
+
* by after the fact, by subject erasure for one: unlike `deliveryEnvironmentIn` it does not follow the
|
|
208
|
+
* environment's effects, so a broker that took messages stays reachable once its environment is taken
|
|
209
|
+
* back to none, and the answer is read from the directory, never from what a process remembers.
|
|
210
|
+
*/
|
|
211
|
+
export declare function environmentOfScopeIn(sql: SwitchSql, tenantId: TenantId | string, scopeId: ScopeId | string): string | null;
|
|
212
|
+
/**
|
|
213
|
+
* `deliveryEnvironmentIn`'s rule over a scope record and the directory's `connectionReach` for it, for
|
|
214
|
+
* a caller that holds those rather than the directory (the control plane's wake answer, #3639): an
|
|
215
|
+
* active install is production's, an active scope whose reach is `own` its environment's, every other
|
|
216
|
+
* scope none. `reach` is not read for an install, and a scope whose reach was not asked is none.
|
|
217
|
+
*/
|
|
218
|
+
export declare function deliveryEnvironmentOf(scope: Pick<Scope, 'vertical' | 'status' | 'kind' | 'forkedFrom' | 'slug'> | null | undefined, reach?: ConnectionReach): string | null;
|
|
219
|
+
/**
|
|
220
|
+
* The environment a preview's scope slug names, `previewScopeSlug`'s inverse: `staging` for
|
|
221
|
+
* `crm--staging` of `t-acme/crm`, or null for a slug that is not one of the app's previews.
|
|
222
|
+
*/
|
|
223
|
+
export declare function environmentOfPreviewSlug(vertical: string, slug: string | null | undefined): string | null;
|
|
224
|
+
/**
|
|
225
|
+
* Whether a scope whose reach is `reach` may make its effects through `connection` (#3530 step 6). An
|
|
226
|
+
* install uses the tenant's connections and its own; an environment given connections of its own uses
|
|
227
|
+
* its own alone; nothing else uses any. Another scope's own connection is never usable.
|
|
228
|
+
*/
|
|
229
|
+
export declare function connectionUsableBy(reach: ConnectionReach, scopeId: ScopeId | string, connection: {
|
|
230
|
+
ownerScopeId: string | null;
|
|
231
|
+
}): boolean;
|
|
113
232
|
//# sourceMappingURL=app-environments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-environments.d.ts","sourceRoot":"","sources":["../src/app-environments.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"app-environments.d.ts","sourceRoot":"","sources":["../src/app-environments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,+BAA+B,EACpC,KAAK,kBAAkB,EACvB,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,QAAQ,EACd,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,6FAA6F;AAC7F,eAAO,MAAM,oBAAoB,6PAShC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,YAC1C,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,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M,GAAG,IAAI,CAAA;CAAE,GAC1C,OAAO,CAIT"}
|
package/dist/app-environments.js
CHANGED
|
@@ -20,11 +20,28 @@
|
|
|
20
20
|
* so a row from before reads as an environment with no script, which is what it is. The script is
|
|
21
21
|
* fixed for the environment's life: a serve that names another one is refused.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
* 6).
|
|
23
|
+
* **A named environment causes no outside effects unless a person gives it connections of its own**
|
|
24
|
+
* (#3530 step 6). The choice is one column on the row (`effects`, NULL read as `none`), and the one
|
|
25
|
+
* rule every connection door asks is `connectionReachIn`: an install reaches the tenant's connections
|
|
26
|
+
* and its own, the scope of an environment given connections of its own reaches its own alone, and
|
|
27
|
+
* every other scope that is not an install reaches none. It never inherits production's.
|
|
28
|
+
*
|
|
29
|
+
* **A serve into a named environment is judged by the two checkpoints against what it serves**
|
|
30
|
+
* (#3638, D-83's third position). The version it serves is its own script's, or before its first
|
|
31
|
+
* serve its preview's bound version (`environmentServedVersionIn`). A serve whose permission or
|
|
32
|
+
* migration digest differs from that version's is refused until it is acknowledged for this serve
|
|
33
|
+
* (`environmentCheckpointRefusal`), and the acknowledgement lands in this environment's serve
|
|
34
|
+
* record, so it never counts for another environment, and a promote's never counts here.
|
|
35
|
+
*
|
|
36
|
+
* **A broker per environment** (#3639): the scope of an environment given connections of its own hands
|
|
37
|
+
* its messages off to that environment's broker (`deliveryEnvironmentIn`), never production's, whose
|
|
38
|
+
* name does not change. Every other scope that is not an install hands off nothing.
|
|
39
|
+
*
|
|
40
|
+
* What is deliberately not here: edges between environments (D-83 step 5). A named environment's
|
|
41
|
+
* scope is a preview, so everything but its own connections and its own broker stays inert.
|
|
25
42
|
*/
|
|
26
|
-
import { PRODUCTION_ENVIRONMENT, environmentName, substratError } from '@substrat-run/contracts';
|
|
27
|
-
import { isPrimaryScopeRow } from './scope-identity.js';
|
|
43
|
+
import { ENVIRONMENT_CHECKPOINT_REASON, PRODUCTION_ENVIRONMENT, environmentName, substratError, } from '@substrat-run/contracts';
|
|
44
|
+
import { isPrimaryScope, isPrimaryScopeRow } from './scope-identity.js';
|
|
28
45
|
/** Directory-owned, on both adapters. One row per named environment; production has none. */
|
|
29
46
|
export const APP_ENVIRONMENTS_DDL = `
|
|
30
47
|
CREATE TABLE IF NOT EXISTS app_environments (
|
|
@@ -54,6 +71,13 @@ export const APP_ENVIRONMENT_SERVING_COLUMNS = [
|
|
|
54
71
|
'serve_claim TEXT',
|
|
55
72
|
'serve_claimed_until TEXT',
|
|
56
73
|
];
|
|
74
|
+
/**
|
|
75
|
+
* #3530 step 6: a named environment's choice of outside effects, ALTERed onto `app_environments` by
|
|
76
|
+
* both adapters (and copied into the K-68 objects' column list). NULL on every row from before it,
|
|
77
|
+
* which reads as `none`: the inert default every preview has.
|
|
78
|
+
*/
|
|
79
|
+
export const APP_ENVIRONMENT_EFFECTS_COLUMNS = ['effects TEXT'];
|
|
80
|
+
const effectsOfColumn = (v) => (v === 'own-connections' ? 'own-connections' : 'none');
|
|
57
81
|
/**
|
|
58
82
|
* SQL: joins `ae`, the environment whose own script the scope `s` is served from, to a read over
|
|
59
83
|
* `scopes s`. Null for every scope that is not on one: production's installs, a preview on its
|
|
@@ -96,7 +120,7 @@ export function environmentsOf(sql, tenantId, vertical) {
|
|
|
96
120
|
scopeIds: scopes.filter((s) => isPrimaryScopeRow(s)).map((s) => s.scope_id),
|
|
97
121
|
createdAt: null, createdBy: null,
|
|
98
122
|
};
|
|
99
|
-
const rows = sql.all(`SELECT name, created_at, created_by, serving_ref, serving_version_id, serving_do_classes, serving_migration_tag
|
|
123
|
+
const rows = sql.all(`SELECT name, created_at, created_by, serving_ref, serving_version_id, serving_do_classes, serving_migration_tag, effects
|
|
100
124
|
FROM app_environments WHERE tenant_id = ? AND vertical = ? ORDER BY name`, tenantId, vertical);
|
|
101
125
|
return [
|
|
102
126
|
production,
|
|
@@ -107,6 +131,7 @@ export function environmentsOf(sql, tenantId, vertical) {
|
|
|
107
131
|
scopeIds: preview ? [preview.scope_id] : [],
|
|
108
132
|
createdAt: r.created_at, createdBy: r.created_by,
|
|
109
133
|
serving: servingOfRow(r),
|
|
134
|
+
effects: effectsOfColumn(r.effects),
|
|
110
135
|
};
|
|
111
136
|
}),
|
|
112
137
|
];
|
|
@@ -175,6 +200,53 @@ const rowServing = (sql, input) => {
|
|
|
175
200
|
FROM app_environments WHERE tenant_id = ? AND vertical = ? AND name = ?`, input.tenantId, input.vertical, input.name)[0];
|
|
176
201
|
return row ? servingOfRow(row) : null;
|
|
177
202
|
};
|
|
203
|
+
/**
|
|
204
|
+
* The refusal of a serve into the named environment `name` that changes the permission surface or the
|
|
205
|
+
* migrations against `base`, the version the environment serves, and does not acknowledge it (#3638,
|
|
206
|
+
* D-83). Null when it may go on: nothing served yet (a first serve has nothing to diff, as a first
|
|
207
|
+
* promote has not), the same version again, the same digests, or each change acknowledged. Both
|
|
208
|
+
* checkpoints are named in one refusal, so one review answers them. `conflict`, as the promote's are;
|
|
209
|
+
* the problem document carries the environment and the base, which is what the review is read against.
|
|
210
|
+
*/
|
|
211
|
+
export function environmentCheckpointRefusal(name, base, incoming, acknowledge) {
|
|
212
|
+
if (base === null || base.id === incoming.id)
|
|
213
|
+
return null;
|
|
214
|
+
const unacknowledged = [];
|
|
215
|
+
if (base.permissionDigest !== incoming.permissionDigest && !acknowledge?.permissionChange)
|
|
216
|
+
unacknowledged.push('permissions');
|
|
217
|
+
if (base.migrationDigest !== incoming.migrationDigest && !acknowledge?.migrationChange)
|
|
218
|
+
unacknowledged.push('migrations');
|
|
219
|
+
if (unacknowledged.length === 0)
|
|
220
|
+
return null;
|
|
221
|
+
const what = unacknowledged.map((c) => c === 'permissions'
|
|
222
|
+
? `changes the permission surface (${base.permissionDigest} → ${incoming.permissionDigest})`
|
|
223
|
+
: `changes migrations (${base.migrationDigest} → ${incoming.migrationDigest})`);
|
|
224
|
+
return substratError('conflict', `serving ${incoming.id} in the environment '${name}' ${what.join(' and ')} against the version it serves (${base.id}): ` +
|
|
225
|
+
'acknowledge it in this environment to serve. An acknowledgement given in another environment or on a promote to ' +
|
|
226
|
+
'production does not count here', { reason: ENVIRONMENT_CHECKPOINT_REASON, environment: name, base: base.id, checkpoints: unacknowledged });
|
|
227
|
+
}
|
|
228
|
+
/** A version's two pushed digests from the directory, or null for a version it does not hold. */
|
|
229
|
+
export function checkpointSideIn(sql, versionId) {
|
|
230
|
+
const row = sql.all('SELECT id, permission_digest, migration_digest FROM vertical_versions WHERE id = ?', versionId)[0];
|
|
231
|
+
return row ? { id: row.id, permissionDigest: row.permission_digest, migrationDigest: row.migration_digest } : null;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* The version a named environment serves (#3638): what its own script runs, or before its first serve
|
|
235
|
+
* the version its preview is bound to. Null when it serves nothing: no such environment, or a preview
|
|
236
|
+
* that is gone or bound to no version.
|
|
237
|
+
*/
|
|
238
|
+
export function environmentServedVersionIn(sql, input) {
|
|
239
|
+
if (input.name === PRODUCTION_ENVIRONMENT || !isEnvironmentTag(sql, input.tenantId, input.vertical, input.name))
|
|
240
|
+
return null;
|
|
241
|
+
const serving = rowServing(sql, input);
|
|
242
|
+
if (serving)
|
|
243
|
+
return serving.versionId;
|
|
244
|
+
const preview = previewOf(liveScopesOf(sql, input.tenantId, input.vertical), input.vertical, input.name);
|
|
245
|
+
if (!preview)
|
|
246
|
+
return null;
|
|
247
|
+
const row = sql.all('SELECT vertical_version_id FROM scopes WHERE scope_id = ?', preview.scope_id)[0];
|
|
248
|
+
return row?.vertical_version_id ?? null;
|
|
249
|
+
}
|
|
178
250
|
/**
|
|
179
251
|
* Record what an environment's own script now runs (#3530 step 4), written only after the upload
|
|
180
252
|
* landed, in the caller's one directory transaction with its admin row. A compare-and-set on
|
|
@@ -183,10 +255,17 @@ const rowServing = (sql, input) => {
|
|
|
183
255
|
* another record now. Refused: a name that is no environment (`not_found`); another script than the
|
|
184
256
|
* one the environment already serves from (`conflict`, since the data lives there); a class set
|
|
185
257
|
* that drops a class the script already has (`validation_failed`: a class's storage cannot go).
|
|
258
|
+
*
|
|
259
|
+
* #3638: refused too (`conflict`, `environmentCheckpointRefusal`) when `next` changes the permission
|
|
260
|
+
* surface or the migrations against the version the environment serves (`environmentServedVersionIn`)
|
|
261
|
+
* and `acknowledge` does not acknowledge it. The caller judges the same before it uploads anything;
|
|
262
|
+
* this is the record's own judgement, in the transaction that moves what the environment serves.
|
|
186
263
|
*/
|
|
187
264
|
export function setEnvironmentServingIn(sql, input, next, expected,
|
|
188
265
|
/** The serve's claim (`claimEnvironmentServeIn`): the record lands only while it is still the one held. */
|
|
189
|
-
claim
|
|
266
|
+
claim,
|
|
267
|
+
/** #3638: what this serve acknowledges, in this environment. */
|
|
268
|
+
acknowledge) {
|
|
190
269
|
const { tenantId, vertical, name } = input;
|
|
191
270
|
assertEnvironment(sql, input);
|
|
192
271
|
const before = rowServing(sql, input);
|
|
@@ -196,6 +275,13 @@ claim) {
|
|
|
196
275
|
return { moved: false, before, scopeId };
|
|
197
276
|
if (claim !== undefined && claimOf(sql, input)?.claim !== claim)
|
|
198
277
|
return { moved: false, before, scopeId };
|
|
278
|
+
const served = environmentServedVersionIn(sql, input);
|
|
279
|
+
const incoming = checkpointSideIn(sql, next.versionId);
|
|
280
|
+
if (served !== null && incoming !== null) {
|
|
281
|
+
const refusal = environmentCheckpointRefusal(name, checkpointSideIn(sql, served), incoming, acknowledge);
|
|
282
|
+
if (refusal)
|
|
283
|
+
throw refusal;
|
|
284
|
+
}
|
|
199
285
|
if (before && before.ref !== next.ref) {
|
|
200
286
|
throw substratError('conflict', `the environment '${name}' serves from the script '${before.ref}', where its data lives: it cannot move to '${next.ref}'`);
|
|
201
287
|
}
|
|
@@ -236,4 +322,124 @@ export function releaseEnvironmentServeIn(sql, input, claim) {
|
|
|
236
322
|
sql.run(`UPDATE app_environments SET serve_claim = NULL, serve_claimed_until = NULL
|
|
237
323
|
WHERE tenant_id = ? AND vertical = ? AND name = ? AND serve_claim = ?`, input.tenantId, input.vertical, input.name, claim);
|
|
238
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* Give a named environment connections of its own, or take that back (#3530 step 6), in the caller's
|
|
327
|
+
* one directory transaction with its admin row. Production's effects are not a choice, so naming it
|
|
328
|
+
* is `not_found` as every other door's is. `changed: false`, with nothing written, when the row
|
|
329
|
+
* already holds `effects`. Taking it back moves no connection: the environment's own stay where they
|
|
330
|
+
* are, and no door lets it use them until it is given them again.
|
|
331
|
+
*/
|
|
332
|
+
export function setEnvironmentEffectsIn(sql, input, effects) {
|
|
333
|
+
assertEnvironment(sql, input);
|
|
334
|
+
const { tenantId, vertical, name } = input;
|
|
335
|
+
const row = sql.all('SELECT effects FROM app_environments WHERE tenant_id = ? AND vertical = ? AND name = ?', tenantId, vertical, name)[0];
|
|
336
|
+
const before = effectsOfColumn(row?.effects);
|
|
337
|
+
const scopeId = previewOf(liveScopesOf(sql, tenantId, vertical), vertical, name)?.scope_id ?? null;
|
|
338
|
+
if (before === effects)
|
|
339
|
+
return { changed: false, before, scopeId };
|
|
340
|
+
sql.run('UPDATE app_environments SET effects = ? WHERE tenant_id = ? AND vertical = ? AND name = ?', effects === 'none' ? null : effects, tenantId, vertical, name);
|
|
341
|
+
return { changed: true, before, scopeId };
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Which connections the scope's outside effects may go through (#3530 step 6): the one rule every
|
|
345
|
+
* connection door asks, decided here from the directory so a door cannot restate it wrongly.
|
|
346
|
+
*
|
|
347
|
+
* - `all`: an install (`isPrimaryScopeRow`), as today: the tenant's connections and its own.
|
|
348
|
+
* - `own`: the active, pinned preview that IS a named environment of its app (the scope that name
|
|
349
|
+
* resolves to, never another preview under the same slug), whose environment was given connections
|
|
350
|
+
* of its own. It reaches connections its own scope owns, and nothing else.
|
|
351
|
+
* - `none`: everything else, a scope that is not on record or is another tenant's included. A fork, a
|
|
352
|
+
* snapshot of an environment, an environment's preview while it is archived or expiring, and an
|
|
353
|
+
* environment nobody gave connections all read `none`, which is what they read before this rule.
|
|
354
|
+
*/
|
|
355
|
+
export function connectionReachIn(sql, tenantId, scopeId) {
|
|
356
|
+
return environmentReachIn(sql, tenantId, scopeId).reach;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* The environment whose broker the scope hands its messages to (D-83, #3639), or null when it hands
|
|
360
|
+
* off nothing. Decided by `connectionReachIn`'s one rule, so a scope sends through a broker exactly
|
|
361
|
+
* when it may cause outside effects at all:
|
|
362
|
+
*
|
|
363
|
+
* - an install (`all`) hands off to production's broker, `PRODUCTION_ENVIRONMENT`, as before;
|
|
364
|
+
* - the scope of a named environment given connections of its own (`own`) hands off to that
|
|
365
|
+
* environment's broker, never production's;
|
|
366
|
+
* - every other scope (a preview, a fork, a snapshot, an environment nobody gave connections, a scope
|
|
367
|
+
* not on record) hands off nothing, which is what it did before.
|
|
368
|
+
*/
|
|
369
|
+
export function deliveryEnvironmentIn(sql, tenantId, scopeId) {
|
|
370
|
+
const { reach, environment } = environmentReachIn(sql, tenantId, scopeId);
|
|
371
|
+
return reach === 'all' ? PRODUCTION_ENVIRONMENT : reach === 'own' ? environment : null;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* The environment a scope belongs to, whatever it may do now (#3639): production for an install, a
|
|
375
|
+
* named environment's name for a preview whose slug names one of the app's environments (archived,
|
|
376
|
+
* expiring or given no effects alike), null for any other scope. It is what a scope's broker is found
|
|
377
|
+
* by after the fact, by subject erasure for one: unlike `deliveryEnvironmentIn` it does not follow the
|
|
378
|
+
* environment's effects, so a broker that took messages stays reachable once its environment is taken
|
|
379
|
+
* back to none, and the answer is read from the directory, never from what a process remembers.
|
|
380
|
+
*/
|
|
381
|
+
export function environmentOfScopeIn(sql, tenantId, scopeId) {
|
|
382
|
+
const row = sql.all('SELECT tenant_id, vertical, kind, slug, forked_from FROM scopes WHERE scope_id = ?', scopeId)[0];
|
|
383
|
+
if (!row || row.tenant_id !== tenantId)
|
|
384
|
+
return null;
|
|
385
|
+
if (isPrimaryScopeRow(row))
|
|
386
|
+
return PRODUCTION_ENVIRONMENT;
|
|
387
|
+
if (row.kind !== 'preview' || !row.vertical)
|
|
388
|
+
return null;
|
|
389
|
+
const name = environmentOfPreviewSlug(row.vertical, row.slug);
|
|
390
|
+
return name !== null && isEnvironmentTag(sql, tenantId, row.vertical, name) ? name : null;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* `deliveryEnvironmentIn`'s rule over a scope record and the directory's `connectionReach` for it, for
|
|
394
|
+
* a caller that holds those rather than the directory (the control plane's wake answer, #3639): an
|
|
395
|
+
* active install is production's, an active scope whose reach is `own` its environment's, every other
|
|
396
|
+
* scope none. `reach` is not read for an install, and a scope whose reach was not asked is none.
|
|
397
|
+
*/
|
|
398
|
+
export function deliveryEnvironmentOf(scope, reach) {
|
|
399
|
+
if (!scope?.vertical || scope.status !== 'active')
|
|
400
|
+
return null;
|
|
401
|
+
if (isPrimaryScope(scope))
|
|
402
|
+
return PRODUCTION_ENVIRONMENT;
|
|
403
|
+
return reach === 'own' ? environmentOfPreviewSlug(scope.vertical, scope.slug) : null;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* The environment a preview's scope slug names, `previewScopeSlug`'s inverse: `staging` for
|
|
407
|
+
* `crm--staging` of `t-acme/crm`, or null for a slug that is not one of the app's previews.
|
|
408
|
+
*/
|
|
409
|
+
export function environmentOfPreviewSlug(vertical, slug) {
|
|
410
|
+
const prefix = previewScopeSlug(vertical, '');
|
|
411
|
+
return slug && slug.startsWith(prefix) && slug.length > prefix.length ? slug.slice(prefix.length) : null;
|
|
412
|
+
}
|
|
413
|
+
/** `connectionReachIn`'s rule, with the environment an `own` scope is the scope of. */
|
|
414
|
+
function environmentReachIn(sql, tenantId, scopeId) {
|
|
415
|
+
const none = { reach: 'none', environment: null };
|
|
416
|
+
const row = sql.all('SELECT tenant_id, vertical, kind, slug, forked_from, status, expires_at FROM scopes WHERE scope_id = ?', scopeId)[0];
|
|
417
|
+
if (!row || row.tenant_id !== tenantId)
|
|
418
|
+
return none;
|
|
419
|
+
if (isPrimaryScopeRow(row))
|
|
420
|
+
return { reach: 'all', environment: PRODUCTION_ENVIRONMENT };
|
|
421
|
+
if (row.kind !== 'preview' || row.status !== 'active' || row.expires_at !== null || !row.vertical || !row.slug)
|
|
422
|
+
return none;
|
|
423
|
+
const name = environmentOfPreviewSlug(row.vertical, row.slug);
|
|
424
|
+
if (name === null)
|
|
425
|
+
return none;
|
|
426
|
+
const env = sql.all('SELECT effects FROM app_environments WHERE tenant_id = ? AND vertical = ? AND name = ?', tenantId, row.vertical, name)[0];
|
|
427
|
+
if (!env || effectsOfColumn(env.effects) !== 'own-connections')
|
|
428
|
+
return none;
|
|
429
|
+
return previewOf(liveScopesOf(sql, tenantId, row.vertical), row.vertical, name)?.scope_id === scopeId
|
|
430
|
+
? { reach: 'own', environment: name }
|
|
431
|
+
: none;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Whether a scope whose reach is `reach` may make its effects through `connection` (#3530 step 6). An
|
|
435
|
+
* install uses the tenant's connections and its own; an environment given connections of its own uses
|
|
436
|
+
* its own alone; nothing else uses any. Another scope's own connection is never usable.
|
|
437
|
+
*/
|
|
438
|
+
export function connectionUsableBy(reach, scopeId, connection) {
|
|
439
|
+
if (reach === 'none')
|
|
440
|
+
return false;
|
|
441
|
+
if (connection.ownerScopeId === scopeId)
|
|
442
|
+
return true;
|
|
443
|
+
return reach === 'all' && connection.ownerScopeId === null;
|
|
444
|
+
}
|
|
239
445
|
//# sourceMappingURL=app-environments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-environments.js","sourceRoot":"","sources":["../src/app-environments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,aAAa,EAA6E,MAAM,yBAAyB,CAAC;AAC5K,OAAO,EAAE,iBAAiB,EAA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kB,CAChC,KAAsB,EACtB,OAAyB,EACzB,UAA2C;IAE3C,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IACnC,IAAI,UAAU,CAAC,YAAY,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACrD,OAAO,KAAK,KAAK,KAAK,IAAI,UAAU,CAAC,YAAY,KAAK,IAAI,CAAC;AAC7D,CAAC"}
|
package/dist/broker-counts.d.ts
CHANGED
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* #3474 (rfc/broker-and-tenant-isolation.md §9.2, K-70): the delivery broker's EXACT counts, kept per
|
|
3
|
-
* UTC day in its own SQLite and shipped to the lake. Analytics Engine samples at volume, which is
|
|
4
|
-
* enough for trends and alarms (`broker-telemetry.ts`) and not for billing. These are counted in the
|
|
5
|
-
* same transaction as the decision they count, so a count is a fact about the store, never an
|
|
6
|
-
* estimate.
|
|
7
|
-
*
|
|
8
|
-
* **What is counted**, per (day, tenant, scope, channel, receiver, outcome): a message `received`
|
|
9
|
-
* (once, at its first acceptance; a duplicate handoff counts nothing; receiver `''`), and per
|
|
10
|
-
* receiver a delivery `delivered`, an attempt `retried` (a failure the broker will try again; a
|
|
11
|
-
* slow-down spends nothing and counts nothing), a delivery gone `dead`, a dead letter `resent` or
|
|
12
|
-
* `discarded` by a person, and one `expired` unresent. Never content: ids, the channel and the
|
|
13
|
-
* receiver's name.
|
|
14
|
-
*
|
|
15
|
-
* **Shipped, then bounded (K-70).** A row is shipped when its count moves past what the lake has: it
|
|
16
|
-
* carries its whole count, so the lake keeps a key's latest version (`BrokerLakeRow`, the directory's
|
|
17
|
-
* outbox shape, dataset `broker_count_days`). What was shipped is recorded as the count shipped, not
|
|
18
|
-
* as "shipped": a count that moved while the ship was in flight goes again. Shipping is at most
|
|
19
|
-
* every `BROKER_COUNT_SHIP_MS` (D-77's five minutes), from the broker's own alarm, so K-69 holds.
|
|
20
|
-
* A day is dropped once the lake has all of it and it is older than `BROKER_COUNT_KEEP_DAYS` (the
|
|
21
|
-
* current and the previous billing period, as the directory keeps meter days); a day never shipped,
|
|
22
|
-
* because no lake was ever bound, is dropped at `BROKER_COUNT_MAX_DAYS`, so an unbound broker is
|
|
23
|
-
* bounded too.
|
|
24
|
-
*
|
|
25
|
-
* Its table is step 5 of `broker-schema.ts`.
|
|
26
|
-
*/
|
|
27
1
|
import type { BrokerMessageKind, BrokerSql } from './delivery-broker.js';
|
|
28
2
|
/** What happened, as a count names it. */
|
|
29
3
|
export type BrokerCountOutcome = 'received' | 'delivered' | 'retried' | 'dead' | 'resent' | 'discarded' | 'expired';
|
|
@@ -87,7 +61,7 @@ export interface BrokerLakeRow {
|
|
|
87
61
|
kind: BrokerCountOutcome;
|
|
88
62
|
actor: null;
|
|
89
63
|
capturedAt: string;
|
|
90
|
-
/** The count, a JSON object text: `{ day, tenant_id, app, scope_id, channel, receiver, outcome, n }
|
|
64
|
+
/** The count, a JSON object text: `{ day, tenant_id, app, scope_id, channel, receiver, outcome, n }`, and a named environment's `environment` (#3639). */
|
|
91
65
|
row: string;
|
|
92
66
|
}
|
|
93
67
|
/**
|
|
@@ -98,11 +72,15 @@ export interface BrokerLakeRow {
|
|
|
98
72
|
export interface BrokerLakeSink {
|
|
99
73
|
ship(rows: BrokerLakeRow[]): Promise<void>;
|
|
100
74
|
}
|
|
101
|
-
/**
|
|
102
|
-
|
|
75
|
+
/**
|
|
76
|
+
* The lake rows for some counts of one app's broker. A named environment's broker (#3639) adds its
|
|
77
|
+
* environment to the key and the row; production's rows are what they were, byte for byte, so a key
|
|
78
|
+
* the lake already holds keeps its meaning.
|
|
79
|
+
*/
|
|
80
|
+
export declare function brokerLakeRows(rows: readonly BrokerCountDay[], app: string, capturedAt: string, environment?: string): BrokerLakeRow[];
|
|
103
81
|
/**
|
|
104
82
|
* Ship one batch of what the lake does not have, and mark it. A sink that throws marks nothing: the
|
|
105
83
|
* rows go again at the next ship. Returns how many rows went.
|
|
106
84
|
*/
|
|
107
|
-
export declare function shipBrokerCounts(sql: BrokerSql, sink: BrokerLakeSink, app: string, now: number): Promise<number>;
|
|
85
|
+
export declare function shipBrokerCounts(sql: BrokerSql, sink: BrokerLakeSink, app: string, now: number, environment?: string): Promise<number>;
|
|
108
86
|
//# sourceMappingURL=broker-counts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broker-counts.d.ts","sourceRoot":"","sources":["../src/broker-counts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"broker-counts.d.ts","sourceRoot":"","sources":["../src/broker-counts.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEzE,0CAA0C;AAC1C,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;AAEpH,eAAO,MAAM,qBAAqB,EAAE,SAAS,kBAAkB,EAAmF,CAAC;AAEnJ;;;GAGG;AACH,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAE1D,uFAAuF;AACvF,eAAO,MAAM,oBAAoB,QAAa,CAAC;AAC/C,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,+FAA+F;AAC/F,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,mEAAmE;AACnE,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,0FAA0F;AAC1F,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,CAAC,EAAE,MAAM,CAAC;CACX;AAED,8CAA8C;AAC9C,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,iCAAiC;IACjC,GA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