@substrat-run/cli 0.44.0 → 0.45.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/cli.js +116 -40
- package/dist/cli.js.map +1 -1
- package/dist/data-loss-check.d.ts +70 -0
- package/dist/data-loss-check.d.ts.map +1 -0
- package/dist/data-loss-check.js +260 -0
- package/dist/data-loss-check.js.map +1 -0
- package/dist/data-loss-replay-child.d.ts +27 -0
- package/dist/data-loss-replay-child.d.ts.map +1 -0
- package/dist/data-loss-replay-child.js +71 -0
- package/dist/data-loss-replay-child.js.map +1 -0
- package/dist/promote.d.ts +16 -1
- package/dist/promote.d.ts.map +1 -1
- package/dist/promote.js +87 -11
- package/dist/promote.js.map +1 -1
- package/dist/push.d.ts +32 -6
- package/dist/push.d.ts.map +1 -1
- package/dist/push.js +94 -32
- package/dist/push.js.map +1 -1
- package/dist/scope.d.ts +23 -2
- package/dist/scope.d.ts.map +1 -1
- package/dist/scope.js +63 -7
- package/dist/scope.js.map +1 -1
- package/dist/store-driver.d.ts +59 -0
- package/dist/store-driver.d.ts.map +1 -0
- package/dist/{store-kind.js → store-driver.js} +58 -22
- package/dist/store-driver.js.map +1 -0
- package/package.json +4 -4
- package/dist/store-kind.d.ts +0 -46
- package/dist/store-kind.d.ts.map +0 -1
- package/dist/store-kind.js.map +0 -1
package/dist/promote.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promote.js","sourceRoot":"","sources":["../src/promote.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"promote.js","sourceRoot":"","sources":["../src/promote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,SAAS,EACT,UAAU,EACV,yBAAyB,GAK1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,iBAAiB,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,CAAC,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,OAAO,IAAI,CAAC,KAAK,0CAA0C,CAAC,CAAC;IACvI,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/push.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type DeclaredMigration, type AssetEntry, type AssetsNeed, type DeclaredBinding, type DeclaredOperationOutput, type IngressModel, type EnvVarSpec, type PermissionRegistry, type PermissionsInput, type RuntimeNeeds, type VersionOrigin, type DeployManifest } from '@substrat-run/contracts';
|
|
2
|
+
import { type DataLossCheck, type ReplayInputs } from './data-loss-check.js';
|
|
2
3
|
import { type ScheduleRef } from './schedule-sweeper.js';
|
|
3
4
|
/**
|
|
4
5
|
* Derive the vertical's permission registry (D-39/D-41) from its declared TypeScript surface —
|
|
@@ -54,13 +55,16 @@ export type ModuleMigrationsFn = (registration: PermissionsInput['modules'][numb
|
|
|
54
55
|
* `migrations` beside the manifest.
|
|
55
56
|
*
|
|
56
57
|
* Through `moduleMigrations`, the kernel's own list, because a host also applies migrations
|
|
57
|
-
* nobody authored: the indexes a module's `searchables` and `lists` declare
|
|
58
|
-
* runs real schema SQL. Without the
|
|
59
|
-
*
|
|
60
|
-
*
|
|
58
|
+
* nobody authored: the indexes a module's `searchables` and `lists` declare, and the archive and
|
|
59
|
+
* trash columns its `entityStates` declare. Changing those runs real schema SQL. Without the
|
|
60
|
+
* function (a vertical on a kernel older than it, or none resolvable) a module declaring any of
|
|
61
|
+
* them cannot be carried completely, so the field is left off rather than carried short; one
|
|
62
|
+
* declaring none has only its authored set.
|
|
63
|
+
*
|
|
64
|
+
* Each migration's declared `moves` and `discards` (#2322) are carried beside its SQL.
|
|
61
65
|
*
|
|
62
66
|
* `migrations` is undefined (and `omitted` says why) when the set is over the manifest's caps,
|
|
63
|
-
*
|
|
67
|
+
* incomplete as above, or declares something the manifest cannot carry. The field is then left off, which the promote dialog reads as "SQL
|
|
64
68
|
* not available" and still asks for the acknowledgement: metadata must never fail a push.
|
|
65
69
|
* `digestMigrations` retains the complete SQL set even when the manifest omits it, so the
|
|
66
70
|
* promotion gate still sees a change. Without a kernel, `unresolvedIndexes` records the
|
|
@@ -74,8 +78,19 @@ export declare function flattenDeclaredMigrations(permissions: PermissionsInput,
|
|
|
74
78
|
moduleId: string;
|
|
75
79
|
searchables: unknown[];
|
|
76
80
|
lists: unknown[];
|
|
81
|
+
entityStates?: unknown[];
|
|
77
82
|
}[];
|
|
78
83
|
};
|
|
84
|
+
/**
|
|
85
|
+
* The promotion gate covers store classes and every SQL migration the host would apply, with
|
|
86
|
+
* what each declares (#2322): `migrationDigestOf`, the one function the control plane also
|
|
87
|
+
* derives the digest with (#2339). It re-derives it from the migrations this push carries and
|
|
88
|
+
* refuses the push when the two disagree, so it must hash exactly what is sent. The complete set
|
|
89
|
+
* is hashed even when the manifest leaves it out: the control plane then cannot check the digest,
|
|
90
|
+
* stores one that equals no other version's, and every promote of the version asks for the
|
|
91
|
+
* migration acknowledgement.
|
|
92
|
+
*/
|
|
93
|
+
export declare function migrationDigest(doClasses: string[], declared: ReturnType<typeof flattenDeclaredMigrations>): Promise<string>;
|
|
79
94
|
/**
|
|
80
95
|
* The manifest as it is sent: without `migrations` when carrying them would take the whole
|
|
81
96
|
* serialized manifest past {@link DEPLOY_MANIFEST_BYTES_SAFE} (#1677). The control plane keeps
|
|
@@ -112,6 +127,8 @@ export interface DeclaredSurface {
|
|
|
112
127
|
/** True when any module declares an attachment target (#1995): the push then declares the
|
|
113
128
|
* platform's attachment blob store itself — see `withAttachmentBlobStore`. */
|
|
114
129
|
readonly declaresAttachments: boolean;
|
|
130
|
+
/** What the data-loss check replays (#2321) — see `checkMigrationDataLoss`. */
|
|
131
|
+
readonly replay: ReplayInputs;
|
|
115
132
|
}
|
|
116
133
|
export declare function deriveDeclaredSurface(dir: string): Promise<DeclaredSurface>;
|
|
117
134
|
/** The declared permission surface alone — `deriveDeclaredSurface` for the callers that
|
|
@@ -169,7 +186,10 @@ export interface PermissionSurface {
|
|
|
169
186
|
* an entry that cannot be imported outside the vertical's runtime. The CLI's top-level handler
|
|
170
187
|
* turns each into a non-zero exit, which is what makes this usable as a gate.
|
|
171
188
|
*/
|
|
172
|
-
export declare function checkPermissionSurface(dir: string
|
|
189
|
+
export declare function checkPermissionSurface(dir: string, dataLoss?: {
|
|
190
|
+
readonly require?: boolean;
|
|
191
|
+
readonly log?: (message: string) => void;
|
|
192
|
+
}): Promise<PermissionSurface>;
|
|
173
193
|
/**
|
|
174
194
|
* Render a checked surface for a human reading CI output: every key with the module(s) that
|
|
175
195
|
* declare it and its description, every role with the keys it holds, every entity-grant shape,
|
|
@@ -447,6 +467,11 @@ export interface PushOptions {
|
|
|
447
467
|
* self-announcing way past it.
|
|
448
468
|
*/
|
|
449
469
|
skipLint?: boolean;
|
|
470
|
+
/**
|
|
471
|
+
* Refuse a push whose data-loss check (#2321) was skipped or incomplete — the CLI's
|
|
472
|
+
* --require-data-loss-check. A refusal by the fence itself refuses every push regardless.
|
|
473
|
+
*/
|
|
474
|
+
requireDataLossCheck?: boolean;
|
|
450
475
|
/**
|
|
451
476
|
* The receipt from a check the caller already ran on THIS directory (#955) — the CLI's
|
|
452
477
|
* pre-flight, which gates before the registry round-trip so a violation never costs a
|
|
@@ -529,6 +554,7 @@ export declare function push(opts: PushOptions): Promise<{
|
|
|
529
554
|
deploymentRef: string;
|
|
530
555
|
verticalSlug: string;
|
|
531
556
|
warnings?: string[];
|
|
557
|
+
dataLoss: DataLossCheck;
|
|
532
558
|
}>;
|
|
533
559
|
/**
|
|
534
560
|
* POST the assembled bundle to `/verticals/<slug>/deploy` and read the control plane's answer.
|
package/dist/push.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAOA,OAAO,
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wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAkC1D;AAED;;;;;;;GAOG;AACH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAEjC,KAAK,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAC7E,MAAM,CAeR;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAiBvE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,EAAE,GAAG,SAAS,CAyC5F;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAO3D;AAUD;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAC/B,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,OAAO,CAAC,MAAM,CAAC,CAajB;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CAwBjB"}
|
package/dist/push.js
CHANGED
|
@@ -5,9 +5,10 @@ import { join, basename, extname, relative, resolve } from 'node:path';
|
|
|
5
5
|
import { pathToFileURL } from 'node:url';
|
|
6
6
|
import { webcrypto } from 'node:crypto';
|
|
7
7
|
import { build } from 'esbuild';
|
|
8
|
-
import { DECLARED_OUTPUT_FIELDS_MAX, ASSET_PART_PREFIX, assetHash, assetsNeed, ATTACHMENT_BLOB_BINDING, buildPermissionRegistry, declaresAttachmentTargets, DECLARED_MIGRATIONS_MAX, DECLARED_MIGRATIONS_SQL_BYTES_MAX, DEPLOY_MANIFEST_BYTES_SAFE, deployManifest, emittedModel, sqlBytes, utf8Length, envVarSpec, runtimeNeeds, RUNTIME_BASELINE, PLATFORM_FEATURES_HEADER, PLATFORM_FEATURE_SCOPE_SWEEPER, assertDeclaredScopeStores, storeNamesOfBindings, manifestStoresOf, } from '@substrat-run/contracts';
|
|
8
|
+
import { migrationDigestOf, DECLARED_OUTPUT_FIELDS_MAX, ASSET_PART_PREFIX, assetHash, assetsNeed, ATTACHMENT_BLOB_BINDING, buildPermissionRegistry, declaresAttachmentTargets, DECLARED_MIGRATIONS_MAX, DECLARED_MIGRATIONS_SQL_BYTES_MAX, DEPLOY_MANIFEST_BYTES_SAFE, deployManifest, emittedModel, declaredMigrationDeclarations, sqlBytes, utf8Length, envVarSpec, runtimeNeeds, RUNTIME_BASELINE, PLATFORM_FEATURES_HEADER, PLATFORM_FEATURE_SCOPE_SWEEPER, assertDeclaredScopeStores, storeNamesOfBindings, manifestStoresOf, } from '@substrat-run/contracts';
|
|
9
9
|
import { lint, loadConfig as loadBoundaryLintConfig, resolvePackages, declaredEngines, formatViolations, maskSource, } from '@substrat-run/boundary-lint';
|
|
10
10
|
import { walkPages } from '@substrat-run/control-plane-client';
|
|
11
|
+
import { checkMigrationDataLoss } from './data-loss-check.js';
|
|
11
12
|
import { parseJsonBody } from './http.js';
|
|
12
13
|
import { planeFor } from './plane.js';
|
|
13
14
|
import { failureMessage } from './problem.js';
|
|
@@ -28,11 +29,8 @@ function pushOrigin() {
|
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
31
|
async function sha256(bytes) {
|
|
31
|
-
return (await fullSha256(bytes)).slice(0, 32);
|
|
32
|
-
}
|
|
33
|
-
async function fullSha256(bytes) {
|
|
34
32
|
const digest = await webcrypto.subtle.digest('SHA-256', bytes);
|
|
35
|
-
return Buffer.from(digest).toString('hex');
|
|
33
|
+
return Buffer.from(digest).toString('hex').slice(0, 32);
|
|
36
34
|
}
|
|
37
35
|
/** Deterministic JSON: object keys sorted recursively, array order preserved. Makes the
|
|
38
36
|
* permission digest a pure function of registry CONTENT — independent of the artifact's
|
|
@@ -127,38 +125,60 @@ export function flattenDeclaredFreshness(permissions) {
|
|
|
127
125
|
* `migrations` beside the manifest.
|
|
128
126
|
*
|
|
129
127
|
* Through `moduleMigrations`, the kernel's own list, because a host also applies migrations
|
|
130
|
-
* nobody authored: the indexes a module's `searchables` and `lists` declare
|
|
131
|
-
* runs real schema SQL. Without the
|
|
132
|
-
*
|
|
133
|
-
*
|
|
128
|
+
* nobody authored: the indexes a module's `searchables` and `lists` declare, and the archive and
|
|
129
|
+
* trash columns its `entityStates` declare. Changing those runs real schema SQL. Without the
|
|
130
|
+
* function (a vertical on a kernel older than it, or none resolvable) a module declaring any of
|
|
131
|
+
* them cannot be carried completely, so the field is left off rather than carried short; one
|
|
132
|
+
* declaring none has only its authored set.
|
|
133
|
+
*
|
|
134
|
+
* Each migration's declared `moves` and `discards` (#2322) are carried beside its SQL.
|
|
134
135
|
*
|
|
135
136
|
* `migrations` is undefined (and `omitted` says why) when the set is over the manifest's caps,
|
|
136
|
-
*
|
|
137
|
+
* incomplete as above, or declares something the manifest cannot carry. The field is then left off, which the promote dialog reads as "SQL
|
|
137
138
|
* not available" and still asks for the acknowledgement: metadata must never fail a push.
|
|
138
139
|
* `digestMigrations` retains the complete SQL set even when the manifest omits it, so the
|
|
139
140
|
* promotion gate still sees a change. Without a kernel, `unresolvedIndexes` records the
|
|
140
141
|
* declarations whose derived SQL cannot be computed by this CLI.
|
|
141
142
|
*/
|
|
142
143
|
export function flattenDeclaredMigrations(permissions, moduleMigrations) {
|
|
143
|
-
|
|
144
|
+
// #2349: `entityStates` derive migrations too (the archive and trash columns), so a module
|
|
145
|
+
// declaring only them cannot be carried complete without the kernel either.
|
|
146
|
+
const derives = (m) => (m.manifest.searchables?.length ?? 0) > 0 ||
|
|
147
|
+
(m.manifest.lists?.length ?? 0) > 0 ||
|
|
148
|
+
(m.manifest.entityStates?.length ?? 0) > 0;
|
|
144
149
|
const migrations = permissions.modules.flatMap((m) => (moduleMigrations ? moduleMigrations(m) : (m.migrations ?? [])).map((s) => ({
|
|
145
150
|
moduleId: m.manifest.id,
|
|
146
151
|
version: s.version,
|
|
147
152
|
sql: s.sql,
|
|
153
|
+
// #2322: the data losses the migration declares (`SqlMigration.moves` / `discards`, #115),
|
|
154
|
+
// copied as written. An empty record is the fence's "none", so it is left off — which is
|
|
155
|
+
// also what keeps a declaration-free migration's digest entry what it was before.
|
|
156
|
+
...declarationsOf('moves', s.moves),
|
|
157
|
+
...declarationsOf('discards', s.discards),
|
|
148
158
|
})));
|
|
149
159
|
const unresolvedIndexes = !moduleMigrations
|
|
150
160
|
? permissions.modules.filter(derives).map((m) => ({
|
|
151
161
|
moduleId: m.manifest.id,
|
|
152
162
|
searchables: m.manifest.searchables ?? [],
|
|
153
163
|
lists: m.manifest.lists ?? [],
|
|
164
|
+
// Only when declared, so a module declaring none keeps the entry (and the digest) it had.
|
|
165
|
+
...((m.manifest.entityStates?.length ?? 0) > 0 ? { entityStates: m.manifest.entityStates } : {}),
|
|
154
166
|
}))
|
|
155
167
|
: [];
|
|
156
168
|
if (unresolvedIndexes.length > 0) {
|
|
157
169
|
return {
|
|
158
170
|
digestMigrations: migrations,
|
|
159
171
|
unresolvedIndexes,
|
|
160
|
-
omitted: "a module declares searchables or
|
|
161
|
-
'to derive their
|
|
172
|
+
omitted: "a module declares searchables, lists or entityStates, and the vertical's @substrat-run/kernel has no " +
|
|
173
|
+
'moduleMigrations to derive their migrations with (upgrade the kernel)',
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
const malformed = migrations.find((m) => !declaredMigrationDeclarations.safeParse(m).success);
|
|
177
|
+
if (malformed) {
|
|
178
|
+
return {
|
|
179
|
+
digestMigrations: migrations,
|
|
180
|
+
omitted: `${malformed.moduleId} ${malformed.version} declares moves or discards this push cannot carry ` +
|
|
181
|
+
'(each a non-empty { table or table.column: string } record within the bounds, every discard with a reason)',
|
|
162
182
|
};
|
|
163
183
|
}
|
|
164
184
|
if (migrations.length > DECLARED_MIGRATIONS_MAX) {
|
|
@@ -176,20 +196,41 @@ export function flattenDeclaredMigrations(permissions, moduleMigrations) {
|
|
|
176
196
|
}
|
|
177
197
|
return { migrations, digestMigrations: migrations };
|
|
178
198
|
}
|
|
179
|
-
/**
|
|
180
|
-
*
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
199
|
+
/**
|
|
200
|
+
* A migration's `moves` or `discards`, as the spread of a `DeclaredMigration`: absent when the
|
|
201
|
+
* migration declares none (undefined, or an empty record). Anything else is carried as written,
|
|
202
|
+
* and `declaredMigrationDeclarations` decides whether the manifest can carry it.
|
|
203
|
+
*/
|
|
204
|
+
function declarationsOf(key, value) {
|
|
205
|
+
if (value === undefined || value === null)
|
|
206
|
+
return {};
|
|
207
|
+
if (typeof value === 'object' && !Array.isArray(value) && Object.keys(value).length === 0)
|
|
208
|
+
return {};
|
|
209
|
+
return { [key]: value };
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* The promotion gate covers store classes and every SQL migration the host would apply, with
|
|
213
|
+
* what each declares (#2322): `migrationDigestOf`, the one function the control plane also
|
|
214
|
+
* derives the digest with (#2339). It re-derives it from the migrations this push carries and
|
|
215
|
+
* refuses the push when the two disagree, so it must hash exactly what is sent. The complete set
|
|
216
|
+
* is hashed even when the manifest leaves it out: the control plane then cannot check the digest,
|
|
217
|
+
* stores one that equals no other version's, and every promote of the version asks for the
|
|
218
|
+
* migration acknowledgement.
|
|
219
|
+
*/
|
|
220
|
+
export async function migrationDigest(doClasses, declared) {
|
|
221
|
+
return migrationDigestOf({
|
|
188
222
|
doClasses,
|
|
189
|
-
|
|
223
|
+
migrations: declared.digestMigrations,
|
|
190
224
|
...(declared.unresolvedIndexes ? { unresolvedIndexes: declared.unresolvedIndexes } : {}),
|
|
191
|
-
})
|
|
225
|
+
});
|
|
192
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* What a version whose manifest leaves its SQL out means at promote (#2339): the platform derives
|
|
229
|
+
* the migration digest from the migrations it stores, so it holds none to compare, and every
|
|
230
|
+
* promote to or over the version asks for the migration acknowledgement.
|
|
231
|
+
*/
|
|
232
|
+
const UNCARRIED_PROMOTE = 'the platform cannot compare its migrations, so every promote to or over it asks for the migration ' +
|
|
233
|
+
'acknowledgement, and the review says the SQL is not available.';
|
|
193
234
|
/**
|
|
194
235
|
* The manifest as it is sent: without `migrations` when carrying them would take the whole
|
|
195
236
|
* serialized manifest past {@link DEPLOY_MANIFEST_BYTES_SAFE} (#1677). The control plane keeps
|
|
@@ -205,7 +246,7 @@ export function boundManifest(manifest, warn = console.warn) {
|
|
|
205
246
|
if (bytes <= DEPLOY_MANIFEST_BYTES_SAFE)
|
|
206
247
|
return manifest;
|
|
207
248
|
warn(`⚠ the SQL migrations are not carried in this version's manifest (the manifest would be ${bytes} bytes, over the ` +
|
|
208
|
-
`${DEPLOY_MANIFEST_BYTES_SAFE} the platform stores) —
|
|
249
|
+
`${DEPLOY_MANIFEST_BYTES_SAFE} the platform stores) — ${UNCARRIED_PROMOTE}`);
|
|
209
250
|
const { migrations: _omitted, ...rest } = manifest;
|
|
210
251
|
return rest;
|
|
211
252
|
}
|
|
@@ -244,7 +285,12 @@ export async function deriveDeclaredSurface(dir) {
|
|
|
244
285
|
// strips a leading `./`, so spelling the dir `./demos/…` would not have saved it.
|
|
245
286
|
stdin: {
|
|
246
287
|
contents: `export * from ${JSON.stringify(resolve(entryPath))};\n` +
|
|
247
|
-
`export const __substratKernel = await import('@substrat-run/kernel').catch(() => null);\n
|
|
288
|
+
`export const __substratKernel = await import('@substrat-run/kernel').catch(() => null);\n` +
|
|
289
|
+
// The spine the data-loss replay builds first (#2321), from the vertical's own
|
|
290
|
+
// adapter-sqlite — imported only when a replay runs, since it loads a native driver.
|
|
291
|
+
`export const __substratSpine = () => import('@substrat-run/adapter-sqlite').then((m) => m.SCOPE_SPINE_DDL, () => undefined);\n` +
|
|
292
|
+
// Where that kernel resolves, for the replay's own process to import (#2321).
|
|
293
|
+
`export const __substratKernelUrl = (() => { try { return import.meta.resolve('@substrat-run/kernel'); } catch { return null; } })();\n`,
|
|
248
294
|
resolveDir: resolve(dir),
|
|
249
295
|
sourcefile: 'substrat-surface.mjs',
|
|
250
296
|
loader: 'js',
|
|
@@ -304,6 +350,15 @@ export async function deriveDeclaredSurface(dir) {
|
|
|
304
350
|
migrations: flattenDeclaredMigrations(mod.permissions, typeof mod.__substratKernel?.moduleMigrations === 'function'
|
|
305
351
|
? mod.__substratKernel.moduleMigrations
|
|
306
352
|
: undefined),
|
|
353
|
+
replay: {
|
|
354
|
+
kernel: mod.__substratKernel ?? null,
|
|
355
|
+
kernelUrl: typeof mod.__substratKernelUrl === 'string' ? mod.__substratKernelUrl : null,
|
|
356
|
+
modules: mod.permissions.modules,
|
|
357
|
+
spineDdl: async () => {
|
|
358
|
+
const ddl = await mod.__substratSpine?.();
|
|
359
|
+
return typeof ddl === 'string' ? ddl : undefined;
|
|
360
|
+
},
|
|
361
|
+
},
|
|
307
362
|
};
|
|
308
363
|
}
|
|
309
364
|
finally {
|
|
@@ -388,8 +443,11 @@ export async function permissionDigest(registry) {
|
|
|
388
443
|
* an entry that cannot be imported outside the vertical's runtime. The CLI's top-level handler
|
|
389
444
|
* turns each into a non-zero exit, which is what makes this usable as a gate.
|
|
390
445
|
*/
|
|
391
|
-
export async function checkPermissionSurface(dir) {
|
|
392
|
-
const { registry, envSpec: derived, schedules } = await deriveDeclaredSurface(dir);
|
|
446
|
+
export async function checkPermissionSurface(dir, dataLoss = {}) {
|
|
447
|
+
const { registry, envSpec: derived, schedules, replay } = await deriveDeclaredSurface(dir);
|
|
448
|
+
// The data-loss replay (#2321) a push makes, so `--check` is still the whole local gate. Its
|
|
449
|
+
// narration goes where the caller's other notes go (stderr under `--json`).
|
|
450
|
+
await checkMigrationDataLoss(replay, { require: dataLoss.require, log: dataLoss.log });
|
|
393
451
|
// The envSpec drift check (#1206) runs here too, so `--check` in CI refuses exactly what a
|
|
394
452
|
// push would. The duplicate-copy note is push-time chatter, not part of the check artifact.
|
|
395
453
|
const envSpec = resolveDeclaredEnvSpec(derived, readVerticalMeta(dir).envSpec, () => { });
|
|
@@ -1171,7 +1229,11 @@ export async function push(opts) {
|
|
|
1171
1229
|
// below. Throws if the vertical declares no surface: absence is never a silent empty registry.
|
|
1172
1230
|
// The same import reads the entry's `envSpec` export (#1206); when it exists it is the copy
|
|
1173
1231
|
// that ships, and a drifted package.json duplicate refuses the push.
|
|
1174
|
-
const { registry, envSpec: derivedEnvSpec, schedules, freshness, declaredEvents, declaredEventsTruncated, migrations, declaresAttachments, } = await deriveDeclaredSurface(opts.dir);
|
|
1232
|
+
const { registry, envSpec: derivedEnvSpec, schedules, freshness, declaredEvents, declaredEventsTruncated, migrations, declaresAttachments, replay, } = await deriveDeclaredSurface(opts.dir);
|
|
1233
|
+
// #2321: the vertical's migrations, replayed against a populated in-memory scope through its own
|
|
1234
|
+
// kernel's data-loss fence — before anything is uploaded, so a migration that would close every
|
|
1235
|
+
// populated scope at promote is refused here instead. Throws on a refusal.
|
|
1236
|
+
const dataLoss = await checkMigrationDataLoss(replay, { require: opts.requireDataLossCheck });
|
|
1175
1237
|
// #1995: attachment bytes need a per-tenant bucket, and no vertical should have to remember
|
|
1176
1238
|
// to ask for one — a module declaring an attachment target IS the request.
|
|
1177
1239
|
const stores = manifestStoresOf(needs, declaresAttachments);
|
|
@@ -1199,8 +1261,7 @@ export async function push(opts) {
|
|
|
1199
1261
|
await assertPlaneSuppliesSweeper(opts, opts.allowUnsweptSchedules);
|
|
1200
1262
|
}
|
|
1201
1263
|
if (migrations.omitted) {
|
|
1202
|
-
console.warn(`⚠ the SQL migrations are not carried in this version's manifest (${migrations.omitted}) — `
|
|
1203
|
-
'a promote of it will say the SQL is not available.');
|
|
1264
|
+
console.warn(`⚠ the SQL migrations are not carried in this version's manifest (${migrations.omitted}) — ${UNCARRIED_PROMOTE}`);
|
|
1204
1265
|
}
|
|
1205
1266
|
const envSpec = resolveDeclaredEnvSpec(derivedEnvSpec, opts.envSpec);
|
|
1206
1267
|
// The emitted entity model (#1214), read from the checked-in `model.json` beside
|
|
@@ -1348,7 +1409,8 @@ export async function push(opts) {
|
|
|
1348
1409
|
const part = `${ASSET_PART_PREFIX}${a.entry.path}`;
|
|
1349
1410
|
form.set(part, new Blob([a.content], { type: a.entry.contentType }), part);
|
|
1350
1411
|
}
|
|
1351
|
-
|
|
1412
|
+
const uploaded = await uploadVersion(opts, form, `${entry} (+${modules.length - 1} modules${assets.length ? `, ${assets.length} assets` : ''})`);
|
|
1413
|
+
return { ...uploaded, dataLoss };
|
|
1352
1414
|
}
|
|
1353
1415
|
/**
|
|
1354
1416
|
* POST the assembled bundle to `/verticals/<slug>/deploy` and read the control plane's answer.
|