@substrat-run/control-plane-api 0.177.0 → 0.178.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/api.d.ts +1 -0
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/api.js +221 -157
  4. package/dist/api.js.map +1 -1
  5. package/dist/backups.d.ts +30 -8
  6. package/dist/backups.d.ts.map +1 -1
  7. package/dist/directory-backup.d.ts +4 -0
  8. package/dist/directory-backup.d.ts.map +1 -1
  9. package/dist/directory-backup.js +60 -7
  10. package/dist/directory-backup.js.map +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/lake-gateway.d.ts +9 -0
  15. package/dist/lake-gateway.d.ts.map +1 -1
  16. package/dist/lake-gateway.js +18 -1
  17. package/dist/lake-gateway.js.map +1 -1
  18. package/dist/platform-entry.generated.d.ts +1 -1
  19. package/dist/platform-entry.generated.d.ts.map +1 -1
  20. package/dist/platform-entry.generated.js +2 -2
  21. package/dist/platform-entry.generated.js.map +1 -1
  22. package/dist/platform-scope-stores.d.ts +1 -1
  23. package/dist/platform-scope-stores.d.ts.map +1 -1
  24. package/dist/platform-scope-stores.js +13 -5
  25. package/dist/platform-scope-stores.js.map +1 -1
  26. package/dist/r2-backups.d.ts.map +1 -1
  27. package/dist/r2-backups.js +124 -21
  28. package/dist/r2-backups.js.map +1 -1
  29. package/dist/store-entry.d.ts.map +1 -1
  30. package/dist/store-entry.generated.d.ts +2 -7
  31. package/dist/store-entry.generated.d.ts.map +1 -1
  32. package/dist/store-entry.generated.js +5 -10
  33. package/dist/store-entry.generated.js.map +1 -1
  34. package/dist/store-entry.js +3 -2
  35. package/dist/store-entry.js.map +1 -1
  36. package/dist/store-releases.d.ts +18 -4
  37. package/dist/store-releases.d.ts.map +1 -1
  38. package/dist/store-releases.js +74 -11
  39. package/dist/store-releases.js.map +1 -1
  40. package/dist/store-script.d.ts +12 -2
  41. package/dist/store-script.d.ts.map +1 -1
  42. package/dist/store-script.js +47 -9
  43. package/dist/store-script.js.map +1 -1
  44. package/package.json +9 -9
package/dist/api.d.ts CHANGED
@@ -237,6 +237,7 @@ export interface ControlPlaneApiOptions {
237
237
  }): Promise<{
238
238
  scriptName: string;
239
239
  uploaded: boolean;
240
+ fixture?: Uint8Array;
240
241
  }>;
241
242
  callCanary: CanaryCall;
242
243
  /** The same script settings release read the ensurer uses; required for a guarded revoke. */
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,KAAK,kBAAkB,EAAoB,MAAM,yBAAyB,CAAC;AACjI,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAE9G,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAyBL,KAAK,qBAAqB,EAyF1B,CAAC,EAkBD,KAAK,cAAc,EAEnB,KAAK,uBAAuB,EAG7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAOV,UAAU,EACV,kBAAkB,EAGlB,wBAAwB,EACxB,oBAAoB,EAEpB,eAAe,EAKf,eAAe,EAKf,OAAO,EAMP,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAoB,oBAAoB,EAAE,SAAS,EAAc,UAAU,EAAE,eAAe,EAAkC,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAuClL,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9F,OAAO,EAAuK,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAChO,OAAO,EAEe,KAAK,QAAQ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,KAAK,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAqLjE;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEvF;AAwCD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAAE,SAAS,EAAE,IAAI,CAAA;CAAE,CAAC,CAs5WhG"}
package/dist/api.js CHANGED
@@ -75,7 +75,7 @@ import { wireSettingsRefusal, wireUploadFor } from './wire-upload.js';
75
75
  import { parseWireWalkCursor, runWireWalk, WIRE_WALK_LIMIT_DEFAULT, WIRE_WALK_LIMIT_MAX, WIRE_WALK_RELEASE_MAX, } from './wire-walk.js';
76
76
  import { wireKeyDropSince, wireReadinessReport, WIRE_READINESS_LIMIT_DEFAULT, WIRE_READINESS_LIMIT_MAX } from './wire-readiness.js';
77
77
  import { STORAGE_PAGE_DEFAULT, STORAGE_PAGE_MAX, readStoragePage } from './storage-meter.js';
78
- import { queryLakeEvents } from './lake-gateway.js';
78
+ import { queryLakeEvents, teamWindowRefusal } from './lake-gateway.js';
79
79
  import { LakeQueryError } from './r2-sql-engine.js';
80
80
  import { isCustomHostname, validateBindableHostname, } from './custom-hostnames.js';
81
81
  import { isSocialRelayVertical, reconcileScopeSocialRelay, relayHostnames, } from './social-relay.js';
@@ -780,6 +780,8 @@ const TENANT_ROUTES = [
780
780
  // grant (`tenantGrantableEntitlement`): the pin alone would let it grant itself any.
781
781
  { method: 'PUT', re: /\/tenants\/[^/]+\/entitlements\/[^/]+$/, pin: 'path' },
782
782
  { method: 'GET', re: /\/tenants\/[^/]+\/cross-vertical\/edges$/, pin: 'path' },
783
+ // #1334: the team's own lake events. The handler adds the window rule for this credential.
784
+ { method: 'GET', re: /\/tenants\/[^/]+\/lake\/events$/, pin: 'path' },
783
785
  // Findings (#1748): the tenant's inbox, its verdicts and its suppress rules. The dashboard
784
786
  // checks WHO inside the tenant may read or act (its findings permissions) before calling.
785
787
  { method: 'PUT', re: /\/tenants\/[^/]+\/findings\/[^/]+\/status$/, pin: 'path' },
@@ -1014,7 +1016,7 @@ export function createControlPlaneApi(options) {
1014
1016
  /** `substrat.wipe` on each declared store, before the scope's own bytes go. */
1015
1017
  const wipePlatformStores = async (c, scope) => (await platformStoresWipe(c, scope))();
1016
1018
  /**
1017
- * `substrat.export` on each store the lifecycle reaches, for a backup, a full pull or a fork.
1019
+ * A dump in pages (`substrat.export-page`) of each store the lifecycle reaches, for a backup, a full pull or a fork.
1018
1020
  *
1019
1021
  * A dump is only worth taking if it restores, and a restore imports only what the destination's
1020
1022
  * version declares (L8). So a binding only an earlier version declared (#2286) is left out of the
@@ -1299,6 +1301,9 @@ export function createControlPlaneApi(options) {
1299
1301
  { method: 'GET', re: /\/verticals\/[^/]+\/versions\/[^/]+\/model$/ },
1300
1302
  { method: 'GET', re: /\/verticals\/[^/]+\/versions\/[^/]+\/concept$/ },
1301
1303
  { method: 'GET', re: /\/verticals\/[^/]+\/versions\/[^/]+\/schedules$/ },
1304
+ // The scope-store drivers one vertical may use (#2813), so a push judges its stores as the
1305
+ // upload will. `?vertical=` required; the answer names no other vertical.
1306
+ { method: 'GET', re: /\/store-drivers$/ },
1302
1307
  { method: 'GET', re: /\/verticals\/[^/]+\/channels$/ },
1303
1308
  { method: 'GET', re: /\/verticals\/[^/]+\/channels\/[^/]+\/history$/ },
1304
1309
  { method: 'POST', re: /\/verticals\/[^/]+\/channels\/[^/]+\/promote$/ },
@@ -6012,9 +6017,10 @@ export function createControlPlaneApi(options) {
6012
6017
  // closed `.strict()` list with no tenant in it, and a row of any other tenant fails the
6013
6018
  // read whole. Envelope only — no payload until erasure reaches the lake.
6014
6019
  //
6015
- // Staff only, by default-deny: on neither BUILDER_ROUTES nor TENANT_ROUTES. A tenant's
6016
- // own credential reaching this is a separate decision, with a dashboard call site and a
6017
- // member permission in front of it.
6020
+ // Staff, and a team's own credential (TENANT_ROUTES, path-pinned). The dashboard checks
6021
+ // `dashboard:read-event-lake` before it calls. A team's read must name a window of at most
6022
+ // `LAKE_TEAM_WINDOW_DAYS` (`teamWindowRefusal`): nothing below the gateway prunes by tenant,
6023
+ // so the window is what bounds the scan. Builders stay refused (not in BUILDER_ROUTES).
6018
6024
  //
6019
6025
  // K-24: the access row is written AFTER the engine answers and BEFORE anything is
6020
6026
  // returned, and a failed write fails the request — rows whose disclosure went unrecorded
@@ -6035,6 +6041,11 @@ export function createControlPlaneApi(options) {
6035
6041
  issues: parsed.error.issues.map((i) => ({ path: i.path, message: i.message })),
6036
6042
  });
6037
6043
  }
6044
+ if (c.get('principal').kind === 'tenant') {
6045
+ const refusal = teamWindowRefusal(parsed.data, Date.now());
6046
+ if (refusal)
6047
+ return refuse(c, 'validation_failed', refusal);
6048
+ }
6038
6049
  let page;
6039
6050
  try {
6040
6051
  page = await queryLakeEvents(options.lakeQuery, tenantId, parsed.data);
@@ -7593,9 +7604,12 @@ export function createControlPlaneApi(options) {
7593
7604
  }
7594
7605
  // #2210: publishing records the version's store bindings for the whole vertical's lifecycle
7595
7606
  // (backup, wipe, erasure, the meter), so its store scripts are put in place first, as a push
7596
- // does: a driver with no approved release refuses here, and nothing is published.
7597
- await ensureScopeStoresOf(c.get('actor'), 'deploy', slug, scopeStores, async () => (await ownerOf(c.get('actor'), slug)) ?? null);
7598
- await c.var.admin.publishVersion(c.get('actor'), input);
7607
+ // does: a driver with no approved release refuses here, and nothing is published. The publish is
7608
+ // made under the push's shared hold (#2816), so a rollout walks this vertical or waits for it.
7609
+ await ensureScopeStoresOf(c.get('actor'), 'deploy', slug, scopeStores, async () => (await ownerOf(c.get('actor'), slug)) ?? null, async (renew) => {
7610
+ await renew();
7611
+ await c.var.admin.publishVersion(c.get('actor'), input);
7612
+ });
7599
7613
  const version = await c.var.admin.getVersion(c.get('actor'), input.id, slug);
7600
7614
  return c.json(version, 201);
7601
7615
  });
@@ -7892,10 +7906,16 @@ export function createControlPlaneApi(options) {
7892
7906
  * (#559), then rethrown, so the push or serve answers it and the vertical upload never runs.
7893
7907
  * The row carries the vertical's owner, so it shows in that tenant's failure view; the serve
7894
7908
  * path reads the owner only once something has failed.
7909
+ *
7910
+ * `then` runs after the uploads, still under the shared holds (#2816): a push or a publish passes
7911
+ * the step that records the version's store declarations, so a rollout either finds the vertical
7912
+ * in what it walks or is refused until that step is done. `renew` renews every hold, and refuses
7913
+ * (409) once one has lapsed; `then` calls it right before it records. A failure in `then` is not
7914
+ * recorded here: it is the caller's to answer.
7895
7915
  */
7896
- const ensureScopeStoresOf = async (actor, operation, slug, stores, owner) => {
7916
+ const ensureScopeStoresOf = async (actor, operation, slug, stores, owner, then = async () => undefined) => {
7897
7917
  if (stores.length === 0)
7898
- return;
7918
+ return then(async () => undefined);
7899
7919
  // D-67: a driver whose registration names its verticals serves those only, refused before any
7900
7920
  // hold is taken or anything is uploaded.
7901
7921
  for (const store of stores) {
@@ -7907,50 +7927,57 @@ export function createControlPlaneApi(options) {
7907
7927
  const holder = ulid();
7908
7928
  const drivers = [...new Set(stores.map((store) => store.driver))].sort();
7909
7929
  const held = [];
7930
+ const renewHolds = async (when) => {
7931
+ for (const each of held) {
7932
+ if (!(await host.admin.holdStoreDriver(actor, { driver: each, holder, mode: 'shared', ttlMs: PUSH_HOLD_TTL_MS, renew: true }))) {
7933
+ throw new ControlPlaneError(409, `${operation} refused: the hold on scope store driver '${each}' lapsed ${when}; try again`);
7934
+ }
7935
+ }
7936
+ };
7937
+ const renew = () => renewHolds('during the upload');
7910
7938
  try {
7911
- if (!options.ensureScopeStores) {
7912
- throw new ControlPlaneError(501, `${operation} refused: '${slug}' declares a scope store and this control plane uploads no store script`);
7913
- }
7914
- // A shared hold on each driver (#2300): a rollout holds it exclusively, and a rebuild that read
7915
- // a script's release before a rollout moved it would upload the old release back over it.
7916
- // Neither the refusal nor anything else here names another vertical: a push answers its own.
7917
- for (const driver of drivers) {
7918
- if (!(await host.admin.holdStoreDriver(actor, { driver, holder, mode: 'shared', ttlMs: PUSH_HOLD_TTL_MS }))) {
7919
- throw new ControlPlaneError(409, `${operation} refused: scope store driver '${driver}' is being rolled out; try again in a few minutes`);
7939
+ try {
7940
+ if (!options.ensureScopeStores) {
7941
+ throw new ControlPlaneError(501, `${operation} refused: '${slug}' declares a scope store and this control plane uploads no store script`);
7920
7942
  }
7921
- held.push(driver);
7922
- }
7923
- const loadRelease = options.storeReleases
7924
- ? storedReleaseLoader({ admin: host.admin, actor, bytes: options.storeReleases.bytes })
7925
- : async () => undefined;
7926
- // One driver at a time, each renewing every hold first: a push whose uploads outlast a hold
7927
- // stops (409) rather than upload after a rollout could have taken the driver.
7928
- for (const driver of drivers) {
7929
- for (const each of held) {
7930
- if (!(await host.admin.holdStoreDriver(actor, { driver: each, holder, mode: 'shared', ttlMs: PUSH_HOLD_TTL_MS, renew: true }))) {
7931
- throw new ControlPlaneError(409, `${operation} refused: the hold on scope store driver '${each}' lapsed during the upload; try again`);
7943
+ // A shared hold on each driver (#2300): a rollout holds it exclusively, and a rebuild that read
7944
+ // a script's release before a rollout moved it would upload the old release back over it.
7945
+ // Neither the refusal nor anything else here names another vertical: a push answers its own.
7946
+ for (const driver of drivers) {
7947
+ if (!(await host.admin.holdStoreDriver(actor, { driver, holder, mode: 'shared', ttlMs: PUSH_HOLD_TTL_MS }))) {
7948
+ throw new ControlPlaneError(409, `${operation} refused: scope store driver '${driver}' is being rolled out; try again in a few minutes`);
7932
7949
  }
7950
+ held.push(driver);
7951
+ }
7952
+ const loadRelease = options.storeReleases
7953
+ ? storedReleaseLoader({ admin: host.admin, actor, bytes: options.storeReleases.bytes })
7954
+ : async () => undefined;
7955
+ // One driver at a time, each renewing every hold first: a push whose uploads outlast a hold
7956
+ // stops (409) rather than upload after a rollout could have taken the driver.
7957
+ for (const driver of drivers) {
7958
+ await renew();
7959
+ const registration = (options.storeDrivers ?? STORE_DRIVERS).find((k) => k.driver === driver);
7960
+ if (!registration)
7961
+ throw new ControlPlaneError(403, `scope store driver '${driver}' is not registered`);
7962
+ // Read under the shared hold (D-65): a revoke takes the driver exclusively, so one written
7963
+ // before this read is seen, and none is written until this upload is done.
7964
+ const approvals = await readStoreDriverApprovals(host.admin, actor, registration);
7965
+ await options.ensureScopeStores({ vertical: slug, stores: stores.filter((store) => store.driver === driver), loadRelease, approvals });
7933
7966
  }
7934
- const registration = (options.storeDrivers ?? STORE_DRIVERS).find((k) => k.driver === driver);
7935
- if (!registration)
7936
- throw new ControlPlaneError(403, `scope store driver '${driver}' is not registered`);
7937
- // Read under the shared hold (D-65): a revoke takes the driver exclusively, so one written
7938
- // before this read is seen, and none is written until this upload is done.
7939
- const approvals = await readStoreDriverApprovals(host.admin, actor, registration);
7940
- await options.ensureScopeStores({ vertical: slug, stores: stores.filter((store) => store.driver === driver), loadRelease, approvals });
7941
7967
  }
7942
- }
7943
- catch (e) {
7944
- recordFailure({
7945
- actor,
7946
- operation: `${operation}.store-upload`,
7947
- stage: 'store-upload',
7948
- vertical: slug,
7949
- tenantId: await owner().catch(() => null),
7950
- status: e instanceof ControlPlaneError ? e.status : 502,
7951
- message: e instanceof Error ? e.message : String(e),
7952
- }, e);
7953
- throw e;
7968
+ catch (e) {
7969
+ recordFailure({
7970
+ actor,
7971
+ operation: `${operation}.store-upload`,
7972
+ stage: 'store-upload',
7973
+ vertical: slug,
7974
+ tenantId: await owner().catch(() => null),
7975
+ status: e instanceof ControlPlaneError ? e.status : 502,
7976
+ message: e instanceof Error ? e.message : String(e),
7977
+ }, e);
7978
+ throw e;
7979
+ }
7980
+ return await then(() => renewHolds('before the version was recorded'));
7954
7981
  }
7955
7982
  finally {
7956
7983
  for (const driver of held)
@@ -8907,117 +8934,128 @@ export function createControlPlaneApi(options) {
8907
8934
  const id = ulid();
8908
8935
  const deploymentRef = deploymentRefFor(slug, id);
8909
8936
  // #2210: the store scripts first, outside the vertical upload's try, so a store failure
8910
- // answers as itself and the vertical is not uploaded at all.
8911
- await ensureScopeStoresOf(c.get('actor'), 'deploy', slug, manifest.scopeStores, async () => ownerTenant ?? null);
8912
- let wire;
8913
- try {
8914
- wire = await deployVerticalScript(options.deployVertical, c.get('actor'), slug, deploymentRef, {
8915
- entry: manifest.entry,
8916
- compatibilityDate: manifest.compatibilityDate,
8917
- compatibilityFlags: manifest.compatibilityFlags,
8918
- modules,
8919
- doClasses: manifest.doClasses,
8920
- bindings: verticalUploadBindings({
8937
+ // answers as itself and the vertical is not uploaded at all. The upload, the registration and
8938
+ // the publish run under the store push's shared hold (#2816): a rollout that starts before the
8939
+ // version records its stores is refused, and one after walks this vertical.
8940
+ const deployVertical = options.deployVertical;
8941
+ const pushed = await ensureScopeStoresOf(c.get('actor'), 'deploy', slug, manifest.scopeStores, async () => ownerTenant ?? null, async (renew) => {
8942
+ let wire;
8943
+ try {
8944
+ wire = await deployVerticalScript(deployVertical, c.get('actor'), slug, deploymentRef, {
8945
+ entry: manifest.entry,
8946
+ compatibilityDate: manifest.compatibilityDate,
8947
+ compatibilityFlags: manifest.compatibilityFlags,
8948
+ modules,
8949
+ doClasses: manifest.doClasses,
8950
+ bindings: verticalUploadBindings({
8951
+ vertical: slug,
8952
+ manifest,
8953
+ drivers: options.storeDrivers,
8954
+ // #2349: the migrations this push declares, which are the ones the version stores.
8955
+ platformBindings: await migrationsDigestBindings(manifest.migrations ?? null),
8956
+ }),
8957
+ // #1242: the freshly minted version id — this archive script IS that version,
8958
+ // and a preview routed at it stamps the signals `version` dimension honestly.
8959
+ versionId: id,
8960
+ // #1902: the platform's scope sweeper, as decided above and recorded with the version.
8961
+ ...(sweeper.supply ? { supplySweeper: true } : {}),
8962
+ // #340: the verified bytes go up with the bundle. The manifest's routing config
8963
+ // rides along untouched — it decides what the RUNTIME does with paths, and carries
8964
+ // no reach, so there is nothing in it for the sandbox contract to refuse.
8965
+ ...(manifest.assets ? { assets: { ...manifest.assets, files: assets } } : {}),
8966
+ });
8967
+ }
8968
+ catch (e) {
8969
+ // The upload to the runtime failed. Surface the detail (the builder is
8970
+ // authenticated) rather than the anonymous 500 the generic handler would give, so a
8971
+ // push failure is diagnosable without reading worker logs. The version label is NOT
8972
+ // consumed here: registration/publish happen only AFTER a successful upload (below),
8973
+ // so a failed push leaves the same --version reusable (#307).
8974
+ //
8975
+ // Answer the upstream status honestly: a runtime 4xx is a bad-bundle rejection — the
8976
+ // builder's own script (e.g. a module-top-level throw → CF 10021), well-formed HTTP
8977
+ // but refused — so a 422, not a 502 that reads as a platform outage. A 5xx (or any
8978
+ // throw with no upstream status) is a platform failure and stays a 502.
8979
+ const detail = e instanceof Error ? e.message : String(e);
8980
+ const upstream = upstreamStatusOf(e);
8981
+ console.error('deploy.upload.failed', { slug, deploymentRef, detail, upstream });
8982
+ const rejected = upstream !== undefined && upstream >= 400 && upstream < 500;
8983
+ // Both outcomes land an ops-failure row (#559): the 502 is the platform's to
8984
+ // explain, and the 422 is what the builder-facing failure view (step 5) will
8985
+ // list — a red push should be explainable from a durable record either way.
8986
+ recordFailure({
8987
+ actor: c.get('actor'),
8988
+ operation: 'deploy.upload',
8989
+ stage: 'wfp-upload',
8921
8990
  vertical: slug,
8922
- manifest,
8923
- drivers: options.storeDrivers,
8924
- // #2349: the migrations this push declares, which are the ones the version stores.
8925
- platformBindings: await migrationsDigestBindings(manifest.migrations ?? null),
8926
- }),
8927
- // #1242: the freshly minted version id — this archive script IS that version,
8928
- // and a preview routed at it stamps the signals `version` dimension honestly.
8929
- versionId: id,
8930
- // #1902: the platform's scope sweeper, as decided above and recorded with the version.
8931
- ...(sweeper.supply ? { supplySweeper: true } : {}),
8932
- // #340: the verified bytes go up with the bundle. The manifest's routing config
8933
- // rides along untouched — it decides what the RUNTIME does with paths, and carries
8934
- // no reach, so there is nothing in it for the sandbox contract to refuse.
8935
- ...(manifest.assets ? { assets: { ...manifest.assets, files: assets } } : {}),
8991
+ tenantId: ownerTenant ?? null,
8992
+ status: rejected ? 422 : 502,
8993
+ message: detail,
8994
+ }, e);
8995
+ c.set('failureRecorded', true);
8996
+ return rejected
8997
+ ? refuseStatus(c, 422, 'deploy rejected', { detail })
8998
+ : refuseStatus(c, 502, 'deploy upload failed', { detail });
8999
+ }
9000
+ // Register-then-publish, both idempotent-ish below the seam: a first push of a
9001
+ // slug registers it; publishVersion lands the version pending with deploymentRef
9002
+ // (or admitted, for a PRIVATE vertical — the registry's self-admit rule). The owner
9003
+ // was resolved with the slug above: the builder's tenant, the pinned workspace, or
9004
+ // the preserved existing owner for an unpinned staff push. An upload that outlasted the
9005
+ // store hold refuses here (409) before the vertical or its version is registered, so the
9006
+ // label stays reusable; unlike a failed upload, it lands no ops-failure row.
9007
+ await renew();
9008
+ await c.var.admin.registerVertical(c.get('actor'), {
9009
+ slug,
9010
+ name: manifest.name ?? slug,
9011
+ source: 'cli',
9012
+ ownerTenant,
9013
+ // The vertical's declared config surface rides to the registry, so the dashboard
9014
+ // renders a settings form for a pushed vertical exactly like a builtin.
9015
+ ...(manifest.envSpec ? { envSpec: manifest.envSpec } : {}),
9016
+ // Registry-driven install metadata (marketplace-publish.md §3) — so the dashboard
9017
+ // installs a pushed vertical without a hardcoded catalog entry.
9018
+ ...(manifest.ownerGrants ? { ownerGrants: manifest.ownerGrants } : {}),
9019
+ ...(manifest.entitlements ? { entitlements: manifest.entitlements } : {}),
9020
+ ...(manifest.provides ? { provides: manifest.provides } : {}),
9021
+ ...(manifest.requires ? { requires: manifest.requires } : {}),
9022
+ // The declared vertical-defined connectors (vertical-connectors.md §7.2): what the dashboard's
9023
+ // door renders. The proxy never reads this copy; it reads the running version's manifest.
9024
+ ...(manifest.connectors ? { connectors: manifest.connectors } : {}),
9025
+ // The declared provisioner intent (#455) — a REQUEST the console reviews; the
9026
+ // tenant-provisioner grant itself is never touched by a push. Refreshes on every
9027
+ // re-push like the rest of the install spec, exactly because it grants nothing.
9028
+ ...(manifest.provisions ? { provisions: manifest.provisions } : {}),
9029
+ // The declared email-sender intent (#303) — a REQUEST the console reviews; the
9030
+ // `emailSender` grant itself is never touched by a push. Refreshes on every re-push
9031
+ // like the rest of the install spec, exactly because it grants nothing.
9032
+ ...(manifest.sendsEmail ? { sendsEmail: true } : {}),
9033
+ // Where the scope lifecycle is held (#1713): `'router'` keeps the vertical's scopes out of
9034
+ // the lifecycle delivery. Refreshes on every re-push like the rest of the install spec.
9035
+ ...(manifest.lifecycle ? { lifecycle: manifest.lifecycle } : {}),
9036
+ // The declared surfaces (K-26) ride like envSpec: registry metadata for the
9037
+ // hostname-binding picker, never behavior. Not part of any admission digest.
9038
+ ...(manifest.surfaces ? { surfaces: manifest.surfaces } : {}),
8936
9039
  });
8937
- }
8938
- catch (e) {
8939
- // The upload to the runtime failed. Surface the detail (the builder is
8940
- // authenticated) rather than the anonymous 500 the generic handler would give, so a
8941
- // push failure is diagnosable without reading worker logs. The version label is NOT
8942
- // consumed here: registration/publish happen only AFTER a successful upload (below),
8943
- // so a failed push leaves the same --version reusable (#307).
8944
- //
8945
- // Answer the upstream status honestly: a runtime 4xx is a bad-bundle rejection — the
8946
- // builder's own script (e.g. a module-top-level throw → CF 10021), well-formed HTTP
8947
- // but refused — so a 422, not a 502 that reads as a platform outage. A 5xx (or any
8948
- // throw with no upstream status) is a platform failure and stays a 502.
8949
- const detail = e instanceof Error ? e.message : String(e);
8950
- const upstream = upstreamStatusOf(e);
8951
- console.error('deploy.upload.failed', { slug, deploymentRef, detail, upstream });
8952
- const rejected = upstream !== undefined && upstream >= 400 && upstream < 500;
8953
- // Both outcomes land an ops-failure row (#559): the 502 is the platform's to
8954
- // explain, and the 422 is what the builder-facing failure view (step 5) will
8955
- // list — a red push should be explainable from a durable record either way.
8956
- recordFailure({
8957
- actor: c.get('actor'),
8958
- operation: 'deploy.upload',
8959
- stage: 'wfp-upload',
8960
- vertical: slug,
8961
- tenantId: ownerTenant ?? null,
8962
- status: rejected ? 422 : 502,
8963
- message: detail,
8964
- }, e);
8965
- c.set('failureRecorded', true);
8966
- return rejected
8967
- ? refuseStatus(c, 422, 'deploy rejected', { detail })
8968
- : refuseStatus(c, 502, 'deploy upload failed', { detail });
8969
- }
8970
- // Register-then-publish, both idempotent-ish below the seam: a first push of a
8971
- // slug registers it; publishVersion lands the version pending with deploymentRef
8972
- // (or admitted, for a PRIVATE vertical — the registry's self-admit rule). The owner
8973
- // was resolved with the slug above: the builder's tenant, the pinned workspace, or
8974
- // the preserved existing owner for an unpinned staff push.
8975
- await c.var.admin.registerVertical(c.get('actor'), {
8976
- slug,
8977
- name: manifest.name ?? slug,
8978
- source: 'cli',
8979
- ownerTenant,
8980
- // The vertical's declared config surface rides to the registry, so the dashboard
8981
- // renders a settings form for a pushed vertical exactly like a builtin.
8982
- ...(manifest.envSpec ? { envSpec: manifest.envSpec } : {}),
8983
- // Registry-driven install metadata (marketplace-publish.md §3) — so the dashboard
8984
- // installs a pushed vertical without a hardcoded catalog entry.
8985
- ...(manifest.ownerGrants ? { ownerGrants: manifest.ownerGrants } : {}),
8986
- ...(manifest.entitlements ? { entitlements: manifest.entitlements } : {}),
8987
- ...(manifest.provides ? { provides: manifest.provides } : {}),
8988
- ...(manifest.requires ? { requires: manifest.requires } : {}),
8989
- // The declared vertical-defined connectors (vertical-connectors.md §7.2): what the dashboard's
8990
- // door renders. The proxy never reads this copy; it reads the running version's manifest.
8991
- ...(manifest.connectors ? { connectors: manifest.connectors } : {}),
8992
- // The declared provisioner intent (#455) — a REQUEST the console reviews; the
8993
- // tenant-provisioner grant itself is never touched by a push. Refreshes on every
8994
- // re-push like the rest of the install spec, exactly because it grants nothing.
8995
- ...(manifest.provisions ? { provisions: manifest.provisions } : {}),
8996
- // The declared email-sender intent (#303) — a REQUEST the console reviews; the
8997
- // `emailSender` grant itself is never touched by a push. Refreshes on every re-push
8998
- // like the rest of the install spec, exactly because it grants nothing.
8999
- ...(manifest.sendsEmail ? { sendsEmail: true } : {}),
9000
- // Where the scope lifecycle is held (#1713): `'router'` keeps the vertical's scopes out of
9001
- // the lifecycle delivery. Refreshes on every re-push like the rest of the install spec.
9002
- ...(manifest.lifecycle ? { lifecycle: manifest.lifecycle } : {}),
9003
- // The declared surfaces (K-26) ride like envSpec: registry metadata for the
9004
- // hostname-binding picker, never behavior. Not part of any admission digest.
9005
- ...(manifest.surfaces ? { surfaces: manifest.surfaces } : {}),
9006
- });
9007
- await c.var.admin.publishVersion(c.get('actor'), {
9008
- id,
9009
- verticalSlug: slug,
9010
- version: manifest.version,
9011
- manifestDigest: manifest.digests.manifest,
9012
- permissionDigest: manifest.digests.permission,
9013
- migrationDigest: manifest.digests.migration,
9014
- deploymentRef,
9015
- ...(origin ? { origin } : {}),
9016
- // Retained for the serving upload (#286): the archive script keeps the module
9017
- // bytes, this keeps their shape (entry, compat, doClasses, bindings).
9018
- // #1902: with the sweeper decision the push made, which no later upload re-makes.
9019
- manifestJson: JSON.stringify({ ...manifest, platformSweeper: sweeper.supply }),
9040
+ await c.var.admin.publishVersion(c.get('actor'), {
9041
+ id,
9042
+ verticalSlug: slug,
9043
+ version: manifest.version,
9044
+ manifestDigest: manifest.digests.manifest,
9045
+ permissionDigest: manifest.digests.permission,
9046
+ migrationDigest: manifest.digests.migration,
9047
+ deploymentRef,
9048
+ ...(origin ? { origin } : {}),
9049
+ // Retained for the serving upload (#286): the archive script keeps the module
9050
+ // bytes, this keeps their shape (entry, compat, doClasses, bindings).
9051
+ // #1902: with the sweeper decision the push made, which no later upload re-makes.
9052
+ manifestJson: JSON.stringify({ ...manifest, platformSweeper: sweeper.supply }),
9053
+ });
9054
+ return { wire };
9020
9055
  });
9056
+ if (pushed instanceof Response)
9057
+ return pushed;
9058
+ const { wire } = pushed;
9021
9059
  await recordWireUpload(c.var.admin, c.get('actor'), id, wire);
9022
9060
  if (migrationsExtracted)
9023
9061
  await c.var.admin.recordMigrationsExtracted?.(c.get('actor'), slug, id, migrationsExtracted);
@@ -11530,6 +11568,32 @@ export function createControlPlaneApi(options) {
11530
11568
  const verticals = [...new Set([...declared.verticals.map((v) => v.vertical), ...declared.unreadable])].sort();
11531
11569
  return { fingerprint, ...storeRebuildStatus(walk, fingerprint, verticals, options.storeReleases?.settleMs), walk: walk ?? null };
11532
11570
  };
11571
+ // The scope-store registry a push is judged by, for ONE vertical (#2813): `?vertical=` is the slug the
11572
+ // push deploys as, required (bare, or already prefixed with the caller's own workspace). Every registration comes back, with `verticals` reduced to
11573
+ // `[vertical]` when it serves that vertical and `[]` when it does not (omitted when it serves
11574
+ // every one), so the CLI's own check can say "does not serve" and no other vertical's slug is
11575
+ // read. "Serves" is judged for the registry id the deploy forms (`<tenant>/<name>` for a builder
11576
+ // or a pinned staff push), the same one `ensureScopeStoresOf` judges. The staff-only
11577
+ // `/store-drivers/:driver` below is the driver's release state and stays as it was.
11578
+ app.get('/store-drivers', async (c) => {
11579
+ const parsed = verticalSlug.safeParse(c.req.query('vertical'));
11580
+ if (!parsed.success)
11581
+ return refuse(c, 'validation_failed', 'vertical is required: the slug the push deploys as');
11582
+ const vertical = parsed.data;
11583
+ const p = c.get('principal');
11584
+ const pin = c.req.header(TENANT_HEADER)?.trim();
11585
+ let id = effectiveSlug(p, vertical);
11586
+ if (p.kind !== 'builder' && pin) {
11587
+ // The pinned-staff branch of the deploy's own slug derivation (`POST /verticals/:slug/deploy`).
11588
+ const workspace = (await c.var.admin.listTenants(c.get('actor'))).find((t) => t.slug === pin || t.id === pin);
11589
+ if (!workspace)
11590
+ return refuse(c, 'not_found', `unknown workspace '${pin}'`);
11591
+ const bareOwner = await ownerOf(c.get('actor'), vertical);
11592
+ id = vertical.startsWith(`${workspace.slug}/`) || bareOwner === workspace.id ? vertical : `${workspace.slug}/${vertical}`;
11593
+ }
11594
+ const drivers = (options.storeDrivers ?? STORE_DRIVERS).map((d) => d.verticals ? { ...d, verticals: storeDriverServesVertical(d, id) ? [vertical] : [] } : d);
11595
+ return c.json({ drivers });
11596
+ });
11533
11597
  app.get('/store-drivers/:driver', async (c) => {
11534
11598
  await staffPerson(c, statusWords);
11535
11599
  const registration = registeredDriver(c.req.param('driver'));