@wildo-ai/platform-config-lib 1.1.5 → 1.1.6

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 (138) hide show
  1. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +3 -2
  2. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  3. package/dist/esm/bootstrap/bootstrap.contracts.js +3 -2
  4. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  5. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +47 -0
  6. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  7. package/dist/esm/bootstrap/bootstrap.schemas.js +8 -0
  8. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  9. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +12 -1
  10. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  11. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +12 -0
  12. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  13. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +37 -0
  14. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -0
  15. package/dist/esm/bootstrap/platform-store-preconnect.js +43 -0
  16. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -0
  17. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  18. package/dist/esm/bootstrap/runtime-backing-service-access.js +8 -4
  19. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  20. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +36 -3
  21. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  22. package/dist/esm/bootstrap/runtime-topology.contracts.js +36 -13
  23. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  24. package/dist/esm/index.d.ts +1 -0
  25. package/dist/esm/index.d.ts.map +1 -1
  26. package/dist/esm/index.js +1 -0
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/lockfile/lockfile-io.d.ts +7 -1
  29. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  30. package/dist/esm/lockfile/lockfile-io.js +17 -3
  31. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  32. package/dist/esm/lockfile/materialize-infra-section.d.ts +27 -6
  33. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  34. package/dist/esm/lockfile/materialize-infra-section.js +23 -10
  35. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  36. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +455 -6
  37. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  38. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +27 -0
  39. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  40. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts +13 -0
  41. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -0
  42. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +56 -0
  43. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -0
  44. package/dist/esm/project-config/define-infra-env-config.d.ts +0 -27
  45. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  46. package/dist/esm/project-config/define-infra-env-config.js +0 -2
  47. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  48. package/dist/esm/project-config/define-saas-config.d.ts +52 -0
  49. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  50. package/dist/esm/project-config/define-saas-config.js +65 -15
  51. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  52. package/dist/esm/project-config/index.d.ts +3 -0
  53. package/dist/esm/project-config/index.d.ts.map +1 -1
  54. package/dist/esm/project-config/index.js +3 -0
  55. package/dist/esm/project-config/index.js.map +1 -1
  56. package/dist/esm/project-config/loader.d.ts +11 -0
  57. package/dist/esm/project-config/loader.d.ts.map +1 -1
  58. package/dist/esm/project-config/loader.js +34 -7
  59. package/dist/esm/project-config/loader.js.map +1 -1
  60. package/dist/esm/project-config/npm-version-range.d.ts +23 -0
  61. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -0
  62. package/dist/esm/project-config/npm-version-range.js +175 -0
  63. package/dist/esm/project-config/npm-version-range.js.map +1 -0
  64. package/dist/esm/project-config/provider-companion-discovery.d.ts +256 -30
  65. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  66. package/dist/esm/project-config/provider-companion-discovery.js +719 -40
  67. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  68. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +125 -2
  69. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  70. package/dist/esm/project-config/provider-runtime-artifacts.js +283 -66
  71. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  72. package/dist/esm/project-config/shared/backing-service-servability.d.ts +157 -0
  73. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -0
  74. package/dist/esm/project-config/shared/backing-service-servability.js +256 -0
  75. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -0
  76. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +62 -67
  77. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  78. package/dist/esm/project-config/shared/backing-services.schemas.js +71 -68
  79. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  80. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  81. package/dist/esm/project-config/shared/csp-emit.js +41 -2
  82. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  83. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +180 -4
  84. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  85. package/dist/esm/project-config/shared/infra-providers.schemas.js +40 -0
  86. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  87. package/dist/esm/project-config/static-asset-import-noop.d.ts +26 -0
  88. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -0
  89. package/dist/esm/project-config/static-asset-import-noop.js +49 -0
  90. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -0
  91. package/dist/esm/registry/companion-api.schemas.d.ts +0 -176
  92. package/dist/esm/registry/companion-api.schemas.d.ts.map +0 -1
  93. package/dist/esm/registry/companion-api.schemas.js.map +0 -1
  94. package/dist/esm/registry/index.d.ts +3 -1
  95. package/dist/esm/registry/index.d.ts.map +1 -1
  96. package/dist/esm/registry/index.js +3 -1
  97. package/dist/esm/registry/index.js.map +1 -1
  98. package/dist/esm/registry/local-checkout-source.d.ts +31 -0
  99. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -0
  100. package/dist/esm/registry/local-checkout-source.js +45 -0
  101. package/dist/esm/registry/local-checkout-source.js.map +1 -0
  102. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +174 -14
  103. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  104. package/dist/esm/registry/lockfile-modules-section.schemas.js +120 -11
  105. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  106. package/dist/esm/registry/module-artifact.schemas.d.ts +79 -0
  107. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  108. package/dist/esm/registry/module-artifact.schemas.js +36 -0
  109. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  110. package/dist/esm/registry/module-manifest.schemas.d.ts +393 -7
  111. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  112. package/dist/esm/registry/module-manifest.schemas.js +488 -40
  113. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  114. package/dist/esm/registry/module-search.schemas.d.ts +80 -0
  115. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -0
  116. package/dist/esm/registry/module-search.schemas.js +112 -0
  117. package/dist/esm/registry/module-search.schemas.js.map +1 -0
  118. package/dist/esm/registry/registry-config.schemas.d.ts +16 -0
  119. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  120. package/dist/esm/registry/registry-config.schemas.js +8 -0
  121. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  122. package/dist/esm/registry/registry-errors.d.ts +126 -2
  123. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  124. package/dist/esm/registry/registry-errors.js +183 -14
  125. package/dist/esm/registry/registry-errors.js.map +1 -1
  126. package/dist/esm/registry/registry-keys.schemas.d.ts +80 -0
  127. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -0
  128. package/dist/esm/registry/registry-keys.schemas.js +68 -0
  129. package/dist/esm/registry/registry-keys.schemas.js.map +1 -0
  130. package/dist/esm/registry/registry-section-schemas.constants.d.ts +25 -3
  131. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  132. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +13 -11
  133. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  134. package/dist/esm/workspace-scope/workspace-homes.schemas.js +2 -2
  135. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  136. package/package.json +7 -7
  137. package/dist/esm/registry/companion-api.schemas.js +0 -165
  138. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -49,8 +49,9 @@ export declare function buildAdminInitializeApplicationPath(appSlug: string): st
49
49
  /**
50
50
  * Path builders for application WITHDRAWAL (#1556).
51
51
  *
52
- * Deregistering removes an application's cron schedule and marks its row; it destroys nothing, which
53
- * is why the pair is a plain admin verb rather than a guarded one. Restoring clears the mark — the
52
+ * Deregistering removes an application's cron schedule, marks its row and REVOKES every credential
53
+ * minted for it (#1307); it destroys no data, which is why the pair is a plain admin verb rather than a
54
+ * guarded one. Restoring clears the mark and re-mints those credentials with their recorded values — the
54
55
  * schedule comes back from the application's own code at its next boot.
55
56
  *
56
57
  * Declared HERE, beside the other admin paths, so the CLI and the controller cannot pin the route
@@ -1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AG,SAAS,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,GAAG,SAAS,CAAC;IAC/D,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,+BAA+B,CAAC,GAAG,SAAS,CAAC;IACjF,SAAS,CAAC,EAAE,6BAA6B,GAAG,SAAS,CAAC;IACtD,sBAAsB,CAAC,EAAE,2BAA2B,GAAG,SAAS,CAAC;IACjE,iBAAiB,EAAE,4BAA4B,CAAC;IAChD,eAAe,CAAC,EAAE,0BAA0B,GAAG,SAAS,CAAC;IACzD,YAAY,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IAC3C,OAAO,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,SAAS,CAAC;IAC7D,cAAc,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAC9C,SAAS,CAAC,EAAE;QACV,UAAU,CAAC,EAAE,0BAA0B,GAAG,SAAS,CAAC;KACrD,GAAG,SAAS,CAAC;CACf,GAAG,+BAA+B,CAkElC"}
@@ -23,8 +23,9 @@ export function buildAdminInitializeApplicationPath(appSlug) {
23
23
  /**
24
24
  * Path builders for application WITHDRAWAL (#1556).
25
25
  *
26
- * Deregistering removes an application's cron schedule and marks its row; it destroys nothing, which
27
- * is why the pair is a plain admin verb rather than a guarded one. Restoring clears the mark — the
26
+ * Deregistering removes an application's cron schedule, marks its row and REVOKES every credential
27
+ * minted for it (#1307); it destroys no data, which is why the pair is a plain admin verb rather than a
28
+ * guarded one. Restoring clears the mark and re-mints those credentials with their recorded values — the
28
29
  * schedule comes back from the application's own code at its next boot.
29
30
  *
30
31
  * Declared HERE, beside the other admin paths, so the CLI and the controller cannot pin the route
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.contracts.js","sourceRoot":"","sources":["../../../../src/b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KAAK,CAAC,SAAS,IAAI,EAAE;QAChC,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,kBAAkB,EAAE,+BAA+B,CAAC;YAClD,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;YAC5C,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;YACpD,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;YAC1C,eAAe,EAAE,KAAK,CAAC,eAAe;SACvC,CAAC;QACF,cAAc,EAAE,KAAK,CAAC,SAAS,EAAE,UAAU;QAC3C,eAAe,EAAE,wBAAwB,CAAC,eAAe;QACzD,SAAS,EAAE,wBAAwB,CAAC,SAAS;QAC7C,kBAAkB,EAAE,wBAAwB,CAAC,kBAAkB;KAChE,CAAC;AACJ,CAAC","sourcesContent":["import { RuntimeEnvironment, type OrganizationTypesConfigSchema, type SystemsOfRecordConfigSchema } from '@wildo-ai/saas-models';\nimport type { z } from 'zod';\nimport type { ApplicationModules } from '../project-config/shared/application-modules.schemas';\nimport {\n getDeclaredApplicationModuleIds,\n getServiceBoundApplicationModuleIds,\n hasServiceBoundModuleWithSamlIntegration,\n} from '../project-config/shared/application-modules.utils';\nimport type { AppDataServices } from '../project-config/shared/data-services.schemas';\nimport { deriveAppDatabaseName } from '../project-config/shared/data-services.schemas';\nimport type {\n AppFrontendType,\n AppLibraryDefinition,\n AppServiceDefinition,\n RuntimeIsolation,\n} from '../project-config/shared/service-definitions.schemas';\nimport { resolveAppServiceIsolation } from '../project-config/shared/service-definitions.schemas';\nimport type {\n EngineCapabilityActivationInput,\n MinionPlatformAccessCarried,\n MinionResourceAccess,\n ProviderConfigurationsInput,\n SaasConfigProvidersBlockInput,\n} from '../project-config/define-saas-config';\nimport type { WildoWorkerConfig } from '../project-config/define-worker-config';\n\n/** What `wildo.saas.config.ts` authors for `organizationTypes`, before defaults are applied. */\ntype OrganizationTypesConfigInput = z.input<typeof OrganizationTypesConfigSchema>;\n/** What `wildo.saas.config.ts` authors for `systemsOfRecord`, before defaults are applied. */\ntype SystemsOfRecordConfigInput = z.input<typeof SystemsOfRecordConfigSchema>;\nimport {\n AdminAppManagedDeclarationSchema,\n AppBootstrapCredentialsResponseSchema,\n AppWorkerBootstrapResponseSchema,\n type AppBootstrapCredentialsResponse,\n type AppBootstrapFirstAdminSeed,\n type AdminAppManagedDeclaration,\n type AppWorkerBootstrapResponse,\n} from './bootstrap.schemas';\n\nexport interface BuildAppBootstrapCredentialsResponseInput {\n appSlug: string;\n environment: RuntimeEnvironment;\n applicationId: string;\n primarySecret: string;\n appsManagerUrl: string;\n}\n\ntype ManagedWorkerDeclaration = Pick<\n WildoWorkerConfig,\n 'name' | 'displayName' | 'description' | 'runtime' | 'http' | 'auth' | 'replicas' | 'resources' | 'dataAccess'\n>;\n\n/**\n * The service-row surface these normalizers actually read, derived from\n * {@link AppServiceDefinition} rather than restated structurally.\n *\n * Restating it by hand is what let `frontendType` widen to `string` and let\n * `isolation` disappear from the contract entirely: the normalizer forwards the\n * whole row to `resolveAppServiceIsolation`, so a row type that omits the\n * authored isolation block describes a normalizer that silently drops it, and a\n * `string` frontendType is a closed vocabulary (`AppFrontendType`) re-opened at\n * a boundary that only ever receives parsed config.\n */\ntype NormalizableAppServiceRow = Pick<\n AppServiceDefinition,\n 'path' | 'serviceName' | 'defaultPort' | 'frontendType' | 'isolation'\n>;\n\n/**\n * apps-manager control-plane bootstrap protocol details shared by CLI callers\n * and apps-manager producers.\n */\nexport const APPS_MANAGER_ADMIN_SECRET_HEADER = 'X-Admin-Secret';\nexport const APPS_MANAGER_API_PREFIX = '/api/v1';\n\n/**\n * The apps-manager application-config read path (prefix-qualified) — the route the executable JWT/config\n * initialization postcondition authenticates through. The canonical route for CLI callers — the\n * `ApplicationInitializationVerificationService` (the `wildo local init` postcondition) imports it here so it\n * never pins the route independently. `@wildo-ai/platform-e2e-runner` RE-EXPOSES this exact constant (as\n * `APPS_MANAGER_APPLICATION_CONFIG_PATH`) for the platform e2e scenarios that reach only its barrel — one\n * definition here, no duplicate literal.\n */\nexport const APPS_MANAGER_APPLICATION_CONFIG_PATH = `${APPS_MANAGER_API_PREFIX}/apps-to-manager/application-config`;\n\nexport function buildAdminInitializeApplicationPath(appSlug: string): string {\n return `/admin/apps/${encodeURIComponent(appSlug)}/initialize`;\n}\n\n/**\n * Path builders for application WITHDRAWAL (#1556).\n *\n * Deregistering removes an application's cron schedule and marks its row; it destroys nothing, which\n * is why the pair is a plain admin verb rather than a guarded one. Restoring clears the mark — the\n * schedule comes back from the application's own code at its next boot.\n *\n * Declared HERE, beside the other admin paths, so the CLI and the controller cannot pin the route\n * independently and drift.\n */\nexport function buildAdminDeregisterApplicationPath(appSlug: string): string {\n return `/admin/apps/${encodeURIComponent(appSlug)}/deregister`;\n}\n\nexport function buildAdminApplicationResiduePath(appSlug: string): string {\n return `/admin/apps/${encodeURIComponent(appSlug)}/residue`;\n}\n\nexport function buildAdminRestoreApplicationPath(appSlug: string): string {\n return `/admin/apps/${encodeURIComponent(appSlug)}/restore`;\n}\n\n/**\n * Path builder for the managed-declaration reapply endpoint.\n *\n * See `AdminAppReapplyDeclarationRequestSchema` (in `bootstrap.schemas.ts`)\n * for the full contract semantics — what it does and what it deliberately\n * does NOT touch.\n */\nexport function buildAdminReapplyDeclarationPath(appSlug: string): string {\n return `/admin/apps/${encodeURIComponent(appSlug)}/reapply-declaration`;\n}\n\n/**\n * Stable action identifier reserved for the managed-declaration reapply\n * endpoint. Callers (notably the CI/CD admin rights workstream — Step 8)\n * should use this constant when granting permissions instead of hard-coding\n * the string, so the wiring survives any future identifier rename.\n *\n * The full action-identifier enum lives downstream of this constant and\n * will be introduced when Step 8 lands the permission grid.\n */\nexport const APPS_REAPPLY_DECLARATION_ACTION_ID = 'apps.reapply-declaration';\n\n/**\n * Query parameter naming WHICH runtime principal's bootstrap credentials to\n * return (Step 1 / F11). Absent ⇒ the application backend, which is both the\n * historical behaviour and the correct default: every existing caller wants the\n * backend, and a caller that forgets to name a principal gets the one identity\n * that certainly exists rather than an error.\n *\n * A query parameter rather than a path segment because the principal key already\n * contains a `:` (`minion:marketingScrapper`), which reads badly in a path and\n * would need double-encoding through the router.\n */\nexport const APP_BOOTSTRAP_PRINCIPAL_QUERY_PARAM = 'principal';\n\nexport function buildAppBootstrapCredentialsPath(\n appSlug: string,\n environment: RuntimeEnvironment,\n /**\n * A rendered principal key from `buildRuntimePrincipalKey`. Omit for the\n * application backend.\n */\n principalKey?: string,\n): string {\n const base = `/admin/apps/${encodeURIComponent(appSlug)}/credentials/${environment}`;\n return principalKey\n ? `${base}?${APP_BOOTSTRAP_PRINCIPAL_QUERY_PARAM}=${encodeURIComponent(principalKey)}`\n : base;\n}\n\nexport function buildAppWorkerBootstrapPath(workerName: string): string {\n return `/apps-to-manager/workers/${encodeURIComponent(workerName)}/bootstrap`;\n}\n\n/**\n * Build and validate the shared bootstrap credentials response envelope.\n * This keeps the response contract identical across apps-manager producers and CLI consumers.\n */\nexport function buildAppBootstrapCredentialsResponse(\n input: BuildAppBootstrapCredentialsResponseInput,\n): AppBootstrapCredentialsResponse {\n return AppBootstrapCredentialsResponseSchema.parse({\n success: true,\n appSlug: input.appSlug,\n environment: input.environment,\n credentials: {\n APPLICATION_ID: input.applicationId,\n PLATFORM_APPLICATION_PRIMARY_SECRET: input.primarySecret,\n PLATFORM_APPS_MANAGER_URL: input.appsManagerUrl,\n APPLICATION_ENV: input.environment,\n APPLICATION_SLUG: input.appSlug,\n },\n });\n}\n\nexport function buildAppWorkerBootstrapResponse(input: {\n appSlug: string;\n workerName: string;\n worker: ManagedWorkerDeclaration;\n publicKey: string;\n rotatedPublicKeys?: Array<{ kid: string; publicKey: string; notAfter?: Date }> | undefined;\n}): AppWorkerBootstrapResponse {\n return AppWorkerBootstrapResponseSchema.parse({\n appSlug: input.appSlug,\n workerName: input.workerName,\n worker: input.worker,\n jwt: {\n publicKey: input.publicKey,\n rotatedPublicKeys: input.rotatedPublicKeys,\n },\n });\n}\n\nexport interface NormalizedSaasBackendServiceDescriptor {\n key: string;\n path: string;\n serviceName: string;\n defaultPort?: number | undefined;\n /**\n * Effective container isolation — the authored `services.<key>.isolation`\n * merged with the kind-correct defaults by `resolveAppServiceIsolation`.\n * Consumed by the k8s manifest renderer and the compose app lane, which must\n * never re-derive it. Only the authorable knobs; the security floor is emitted\n * unconditionally and is deliberately not representable here.\n */\n isolation: RuntimeIsolation;\n}\n\nexport interface NormalizedSaasFrontendServiceDescriptor {\n key: string;\n path: string;\n serviceName: string;\n defaultPort?: number | undefined;\n frontendType: AppFrontendType;\n /**\n * Effective container isolation — the authored `services.<key>.isolation`\n * merged with the kind-correct defaults by `resolveAppServiceIsolation`.\n * Consumed by the k8s manifest renderer and the compose app lane, which must\n * never re-derive it. Only the authorable knobs; the security floor is emitted\n * unconditionally and is deliberately not representable here.\n */\n isolation: RuntimeIsolation;\n}\n\nexport interface NormalizedSaasRuntimeDescriptor {\n appSlug: string;\n appDisplayName: string;\n appDatabaseName?: string | undefined;\n /**\n * Authored `wildo.saas.config.dataServices.redis.keyPrefix`. When defined,\n * threads downstream into the per-app `.env` as `REDIS_KEY_PREFIX` and\n * becomes the canonical app-level Redis key namespace consumed by\n * `RedisService` (Slice 3.6).\n */\n redisKeyPrefix?: string | undefined;\n /**\n * Authored `wildo.saas.config.dataServices.s3.bucketPrefix`. When defined,\n * threads downstream into the per-app `.env` as `STORAGE_BUCKET_PREFIX`\n * and is prepended to every application object key by\n * `WildoManagedStorageProvider` (Slice 3.6). The actual MinIO bucket name\n * remains infra-controlled.\n */\n storageBucketPrefix?: string | undefined;\n requiresJavaBackendBase: boolean;\n backendServices: NormalizedSaasBackendServiceDescriptor[];\n frontendServices: NormalizedSaasFrontendServiceDescriptor[];\n libraries: Record<string, AppLibraryDefinition>;\n specifications?: { path: string } | undefined;\n managedDeclaration: AdminAppManagedDeclaration;\n firstAdminSeed?: AppBootstrapFirstAdminSeed | undefined;\n declaredModules: NonNullable<ApplicationModules>;\n moduleIds: string[];\n moduleIdsByService: Record<string, string[]>;\n}\n\nexport interface NormalizedLocalServiceAddressingDescriptor {\n host?: string | undefined;\n port?: number | undefined;\n url?: string | undefined;\n}\n\nexport function normalizeSaasModuleBindings(input: {\n services: Record<string, { serviceName: string }>;\n modules?: ApplicationModules | undefined;\n}) {\n const declaredModules = input.modules ?? {};\n\n return {\n declaredModules,\n moduleIds: getDeclaredApplicationModuleIds(declaredModules),\n moduleIdsByService: Object.fromEntries(\n Object.keys(input.services).map((serviceKey) => [\n serviceKey,\n getServiceBoundApplicationModuleIds(declaredModules, serviceKey),\n ]),\n ),\n };\n}\n\nexport function buildAdminAppManagedDeclaration(input: {\n name: string;\n slug: string;\n displayName: string;\n description?: string | undefined;\n type: 'saas';\n services: Record<string, Pick<NormalizableAppServiceRow, 'serviceName' | 'frontendType'>>;\n minions?: Record<string, {\n resourceAccess?: MinionResourceAccess;\n platformAccess?: MinionPlatformAccessCarried;\n mode?: 'always-up' | 'cron';\n schedule?: string;\n }> | undefined;\n workers?: Record<string, ManagedWorkerDeclaration> | undefined;\n engineCapabilities?: Record<string, EngineCapabilityActivationInput> | undefined;\n providers?: SaasConfigProvidersBlockInput | undefined;\n providerConfigurations?: ProviderConfigurationsInput | undefined;\n organizationTypes: OrganizationTypesConfigInput;\n systemsOfRecord?: SystemsOfRecordConfigInput | undefined;\n}): AdminAppManagedDeclaration {\n return AdminAppManagedDeclarationSchema.parse({\n app: {\n name: input.name,\n slug: input.slug,\n displayName: input.displayName,\n description: input.description,\n type: input.type,\n },\n frontendServices: Object.values(input.services)\n .filter((service) => service.frontendType !== undefined)\n .map((service) => ({\n serviceName: service.serviceName,\n frontendType: service.frontendType,\n })),\n minions: Object.fromEntries(\n Object.entries(input.minions ?? {}).map(([minionName, declaration]) => [\n minionName,\n {\n ...(declaration.resourceAccess ? { resourceAccess: declaration.resourceAccess } : {}),\n // Forwarded only when authored, like every sibling here: an absent\n // axis must stay absent rather than becoming an explicit empty\n // declaration downstream.\n ...(declaration.platformAccess ? { platformAccess: declaration.platformAccess } : {}),\n // KD-12 — only forward `mode` + `schedule` when present so the\n // declaration stays minimal for legacy / always-up minions.\n ...(declaration.mode !== undefined ? { mode: declaration.mode } : {}),\n ...(declaration.schedule !== undefined ? { schedule: declaration.schedule } : {}),\n },\n ]),\n ),\n workers: input.workers ?? {},\n engineCapabilities: input.engineCapabilities,\n providers: input.providers,\n providerConfigurations: input.providerConfigurations,\n organizationTypes: input.organizationTypes,\n systemsOfRecord: input.systemsOfRecord,\n });\n}\n\nexport function normalizeSaasRuntimeDescriptor(input: {\n name: string;\n slug: string;\n displayName: string;\n description?: string | undefined;\n type: 'saas';\n services: Record<string, NormalizableAppServiceRow>;\n minions?: Record<string, {\n resourceAccess?: MinionResourceAccess;\n platformAccess?: MinionPlatformAccessCarried;\n mode?: 'always-up' | 'cron';\n schedule?: string;\n }> | undefined;\n workers?: Record<string, ManagedWorkerDeclaration> | undefined;\n engineCapabilities?: Record<string, EngineCapabilityActivationInput> | undefined;\n providers?: SaasConfigProvidersBlockInput | undefined;\n providerConfigurations?: ProviderConfigurationsInput | undefined;\n organizationTypes: OrganizationTypesConfigInput;\n systemsOfRecord?: SystemsOfRecordConfigInput | undefined;\n dataServices?: AppDataServices | undefined;\n modules?: ApplicationModules | undefined;\n libraries?: Record<string, AppLibraryDefinition> | undefined;\n specifications?: { path: string } | undefined;\n bootstrap?: {\n firstAdmin?: AppBootstrapFirstAdminSeed | undefined;\n } | undefined;\n}): NormalizedSaasRuntimeDescriptor {\n // `isolation` is resolved HERE — the single point where a service row is read\n // and classified as backend or frontend — because the correct default depends\n // on exactly that classification (Node as `wildo` vs nginx as `nginx`). Two\n // renderers consume the result; resolving it per-renderer instead is how the\n // same row ends up running as different users in the k8s and compose lanes.\n const backendServices = Object.entries(input.services)\n .filter(([, service]) => service.frontendType === undefined)\n .map(([key, service]) => ({\n key,\n path: service.path,\n serviceName: service.serviceName,\n defaultPort: service.defaultPort,\n isolation: resolveAppServiceIsolation(service),\n }));\n\n const frontendServices = Object.entries(input.services)\n .filter(([, service]) => service.frontendType !== undefined)\n .map(([key, service]) => ({\n key,\n path: service.path,\n serviceName: service.serviceName,\n defaultPort: service.defaultPort,\n frontendType: service.frontendType!,\n isolation: resolveAppServiceIsolation(service),\n }));\n const normalizedModuleBindings = normalizeSaasModuleBindings({\n services: input.services,\n modules: input.modules,\n });\n const backendServiceKeys = backendServices.map((service) => service.key);\n\n return {\n appSlug: input.slug,\n appDisplayName: input.displayName,\n appDatabaseName: deriveAppDatabaseName(input.dataServices),\n redisKeyPrefix: input.dataServices?.redis?.keyPrefix,\n storageBucketPrefix: input.dataServices?.s3?.bucketPrefix,\n requiresJavaBackendBase: hasServiceBoundModuleWithSamlIntegration(\n normalizedModuleBindings.declaredModules,\n backendServiceKeys,\n ),\n backendServices,\n frontendServices,\n libraries: input.libraries ?? {},\n specifications: input.specifications,\n managedDeclaration: buildAdminAppManagedDeclaration({\n name: input.name,\n slug: input.slug,\n displayName: input.displayName,\n description: input.description,\n type: input.type,\n services: input.services,\n minions: input.minions,\n workers: input.workers,\n engineCapabilities: input.engineCapabilities,\n providers: input.providers,\n providerConfigurations: input.providerConfigurations,\n organizationTypes: input.organizationTypes,\n systemsOfRecord: input.systemsOfRecord,\n }),\n firstAdminSeed: input.bootstrap?.firstAdmin,\n declaredModules: normalizedModuleBindings.declaredModules,\n moduleIds: normalizedModuleBindings.moduleIds,\n moduleIdsByService: normalizedModuleBindings.moduleIdsByService,\n };\n}\n"]}
1
+ {"version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,CACnB;QACD,eAAe;QACf,gBAAgB;QAChB,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,EAAE;QAChC,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,kBAAkB,EAAE,+BAA+B,CAAC;YAClD,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;YAC5C,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;YACpD,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;YAC1C,eAAe,EAAE,KAAK,CAAC,eAAe;SACvC,CAAC;QACF,cAAc,EAAE,KAAK,CAAC,SAAS,EAAE,UAAU;QAC3C,eAAe,EAAE,wBAAwB,CAAC,eAAe;QACzD,SAAS,EAAE,wBAAwB,CAAC,SAAS;QAC7C,kBAAkB,EAAE,wBAAwB,CAAC,kBAAkB;KAChE,CAAC;AACJ,CAAC","sourcesContent":["import { RuntimeEnvironment, type OrganizationTypesConfigSchema, type SystemsOfRecordConfigSchema } from '@wildo-ai/saas-models';\nimport type { z } from 'zod';\nimport type { ApplicationModules } from '../project-config/shared/application-modules.schemas';\nimport {\n getDeclaredApplicationModuleIds,\n getServiceBoundApplicationModuleIds,\n hasServiceBoundModuleWithSamlIntegration,\n} from '../project-config/shared/application-modules.utils';\nimport type { AppDataServices } from '../project-config/shared/data-services.schemas';\nimport { deriveAppDatabaseName } from '../project-config/shared/data-services.schemas';\nimport type {\n AppFrontendType,\n AppLibraryDefinition,\n AppServiceDefinition,\n RuntimeIsolation,\n} from '../project-config/shared/service-definitions.schemas';\nimport { resolveAppServiceIsolation } from '../project-config/shared/service-definitions.schemas';\nimport type {\n EngineCapabilityActivationInput,\n MinionPlatformAccessCarried,\n MinionResourceAccess,\n ProviderConfigurationsInput,\n SaasConfigProvidersBlockInput,\n} from '../project-config/define-saas-config';\nimport type { WildoWorkerConfig } from '../project-config/define-worker-config';\n\n/** What `wildo.saas.config.ts` authors for `organizationTypes`, before defaults are applied. */\ntype OrganizationTypesConfigInput = z.input<typeof OrganizationTypesConfigSchema>;\n/** What `wildo.saas.config.ts` authors for `systemsOfRecord`, before defaults are applied. */\ntype SystemsOfRecordConfigInput = z.input<typeof SystemsOfRecordConfigSchema>;\nimport {\n AdminAppManagedDeclarationSchema,\n AppBootstrapCredentialsResponseSchema,\n AppWorkerBootstrapResponseSchema,\n type AppBootstrapCredentialsResponse,\n type AppBootstrapFirstAdminSeed,\n type AdminAppManagedDeclaration,\n type AppWorkerBootstrapResponse,\n} from './bootstrap.schemas';\n\nexport interface BuildAppBootstrapCredentialsResponseInput {\n appSlug: string;\n environment: RuntimeEnvironment;\n applicationId: string;\n primarySecret: string;\n appsManagerUrl: string;\n}\n\ntype ManagedWorkerDeclaration = Pick<\n WildoWorkerConfig,\n 'name' | 'displayName' | 'description' | 'runtime' | 'http' | 'auth' | 'replicas' | 'resources' | 'dataAccess'\n>;\n\n/**\n * The service-row surface these normalizers actually read, derived from\n * {@link AppServiceDefinition} rather than restated structurally.\n *\n * Restating it by hand is what let `frontendType` widen to `string` and let\n * `isolation` disappear from the contract entirely: the normalizer forwards the\n * whole row to `resolveAppServiceIsolation`, so a row type that omits the\n * authored isolation block describes a normalizer that silently drops it, and a\n * `string` frontendType is a closed vocabulary (`AppFrontendType`) re-opened at\n * a boundary that only ever receives parsed config.\n */\ntype NormalizableAppServiceRow = Pick<\n AppServiceDefinition,\n 'path' | 'serviceName' | 'defaultPort' | 'frontendType' | 'isolation'\n>;\n\n/**\n * apps-manager control-plane bootstrap protocol details shared by CLI callers\n * and apps-manager producers.\n */\nexport const APPS_MANAGER_ADMIN_SECRET_HEADER = 'X-Admin-Secret';\nexport const APPS_MANAGER_API_PREFIX = '/api/v1';\n\n/**\n * The apps-manager application-config read path (prefix-qualified) — the route the executable JWT/config\n * initialization postcondition authenticates through. The canonical route for CLI callers — the\n * `ApplicationInitializationVerificationService` (the `wildo local init` postcondition) imports it here so it\n * never pins the route independently. `@wildo-ai/platform-e2e-runner` RE-EXPOSES this exact constant (as\n * `APPS_MANAGER_APPLICATION_CONFIG_PATH`) for the platform e2e scenarios that reach only its barrel — one\n * definition here, no duplicate literal.\n */\nexport const APPS_MANAGER_APPLICATION_CONFIG_PATH = `${APPS_MANAGER_API_PREFIX}/apps-to-manager/application-config`;\n\nexport function buildAdminInitializeApplicationPath(appSlug: string): string {\n return `/admin/apps/${encodeURIComponent(appSlug)}/initialize`;\n}\n\n/**\n * Path builders for application WITHDRAWAL (#1556).\n *\n * Deregistering removes an application's cron schedule, marks its row and REVOKES every credential\n * minted for it (#1307); it destroys no data, which is why the pair is a plain admin verb rather than a\n * guarded one. Restoring clears the mark and re-mints those credentials with their recorded values — the\n * schedule comes back from the application's own code at its next boot.\n *\n * Declared HERE, beside the other admin paths, so the CLI and the controller cannot pin the route\n * independently and drift.\n */\nexport function buildAdminDeregisterApplicationPath(appSlug: string): string {\n return `/admin/apps/${encodeURIComponent(appSlug)}/deregister`;\n}\n\nexport function buildAdminApplicationResiduePath(appSlug: string): string {\n return `/admin/apps/${encodeURIComponent(appSlug)}/residue`;\n}\n\nexport function buildAdminRestoreApplicationPath(appSlug: string): string {\n return `/admin/apps/${encodeURIComponent(appSlug)}/restore`;\n}\n\n/**\n * Path builder for the managed-declaration reapply endpoint.\n *\n * See `AdminAppReapplyDeclarationRequestSchema` (in `bootstrap.schemas.ts`)\n * for the full contract semantics — what it does and what it deliberately\n * does NOT touch.\n */\nexport function buildAdminReapplyDeclarationPath(appSlug: string): string {\n return `/admin/apps/${encodeURIComponent(appSlug)}/reapply-declaration`;\n}\n\n/**\n * Stable action identifier reserved for the managed-declaration reapply\n * endpoint. Callers (notably the CI/CD admin rights workstream — Step 8)\n * should use this constant when granting permissions instead of hard-coding\n * the string, so the wiring survives any future identifier rename.\n *\n * The full action-identifier enum lives downstream of this constant and\n * will be introduced when Step 8 lands the permission grid.\n */\nexport const APPS_REAPPLY_DECLARATION_ACTION_ID = 'apps.reapply-declaration';\n\n/**\n * Query parameter naming WHICH runtime principal's bootstrap credentials to\n * return (Step 1 / F11). Absent ⇒ the application backend, which is both the\n * historical behaviour and the correct default: every existing caller wants the\n * backend, and a caller that forgets to name a principal gets the one identity\n * that certainly exists rather than an error.\n *\n * A query parameter rather than a path segment because the principal key already\n * contains a `:` (`minion:marketingScrapper`), which reads badly in a path and\n * would need double-encoding through the router.\n */\nexport const APP_BOOTSTRAP_PRINCIPAL_QUERY_PARAM = 'principal';\n\nexport function buildAppBootstrapCredentialsPath(\n appSlug: string,\n environment: RuntimeEnvironment,\n /**\n * A rendered principal key from `buildRuntimePrincipalKey`. Omit for the\n * application backend.\n */\n principalKey?: string,\n): string {\n const base = `/admin/apps/${encodeURIComponent(appSlug)}/credentials/${environment}`;\n return principalKey\n ? `${base}?${APP_BOOTSTRAP_PRINCIPAL_QUERY_PARAM}=${encodeURIComponent(principalKey)}`\n : base;\n}\n\nexport function buildAppWorkerBootstrapPath(workerName: string): string {\n return `/apps-to-manager/workers/${encodeURIComponent(workerName)}/bootstrap`;\n}\n\n/**\n * Build and validate the shared bootstrap credentials response envelope.\n * This keeps the response contract identical across apps-manager producers and CLI consumers.\n */\nexport function buildAppBootstrapCredentialsResponse(\n input: BuildAppBootstrapCredentialsResponseInput,\n): AppBootstrapCredentialsResponse {\n return AppBootstrapCredentialsResponseSchema.parse({\n success: true,\n appSlug: input.appSlug,\n environment: input.environment,\n credentials: {\n APPLICATION_ID: input.applicationId,\n PLATFORM_APPLICATION_PRIMARY_SECRET: input.primarySecret,\n PLATFORM_APPS_MANAGER_URL: input.appsManagerUrl,\n APPLICATION_ENV: input.environment,\n APPLICATION_SLUG: input.appSlug,\n },\n });\n}\n\nexport function buildAppWorkerBootstrapResponse(input: {\n appSlug: string;\n workerName: string;\n worker: ManagedWorkerDeclaration;\n publicKey: string;\n rotatedPublicKeys?: Array<{ kid: string; publicKey: string; notAfter?: Date }> | undefined;\n}): AppWorkerBootstrapResponse {\n return AppWorkerBootstrapResponseSchema.parse({\n appSlug: input.appSlug,\n workerName: input.workerName,\n worker: input.worker,\n jwt: {\n publicKey: input.publicKey,\n rotatedPublicKeys: input.rotatedPublicKeys,\n },\n });\n}\n\nexport interface NormalizedSaasBackendServiceDescriptor {\n key: string;\n path: string;\n serviceName: string;\n defaultPort?: number | undefined;\n /**\n * Effective container isolation — the authored `services.<key>.isolation`\n * merged with the kind-correct defaults by `resolveAppServiceIsolation`.\n * Consumed by the k8s manifest renderer and the compose app lane, which must\n * never re-derive it. Only the authorable knobs; the security floor is emitted\n * unconditionally and is deliberately not representable here.\n */\n isolation: RuntimeIsolation;\n}\n\nexport interface NormalizedSaasFrontendServiceDescriptor {\n key: string;\n path: string;\n serviceName: string;\n defaultPort?: number | undefined;\n frontendType: AppFrontendType;\n /**\n * Effective container isolation — the authored `services.<key>.isolation`\n * merged with the kind-correct defaults by `resolveAppServiceIsolation`.\n * Consumed by the k8s manifest renderer and the compose app lane, which must\n * never re-derive it. Only the authorable knobs; the security floor is emitted\n * unconditionally and is deliberately not representable here.\n */\n isolation: RuntimeIsolation;\n}\n\nexport interface NormalizedSaasRuntimeDescriptor {\n appSlug: string;\n appDisplayName: string;\n appDatabaseName?: string | undefined;\n /**\n * Authored `wildo.saas.config.dataServices.redis.keyPrefix`. When defined,\n * threads downstream into the per-app `.env` as `REDIS_KEY_PREFIX` and\n * becomes the canonical app-level Redis key namespace consumed by\n * `RedisService` (Slice 3.6).\n */\n redisKeyPrefix?: string | undefined;\n /**\n * Authored `wildo.saas.config.dataServices.s3.bucketPrefix`. When defined,\n * threads downstream into the per-app `.env` as `STORAGE_BUCKET_PREFIX`\n * and is prepended to every application object key by\n * `WildoManagedStorageProvider` (Slice 3.6). The actual MinIO bucket name\n * remains infra-controlled.\n */\n storageBucketPrefix?: string | undefined;\n requiresJavaBackendBase: boolean;\n backendServices: NormalizedSaasBackendServiceDescriptor[];\n frontendServices: NormalizedSaasFrontendServiceDescriptor[];\n libraries: Record<string, AppLibraryDefinition>;\n specifications?: { path: string } | undefined;\n managedDeclaration: AdminAppManagedDeclaration;\n firstAdminSeed?: AppBootstrapFirstAdminSeed | undefined;\n declaredModules: NonNullable<ApplicationModules>;\n moduleIds: string[];\n moduleIdsByService: Record<string, string[]>;\n}\n\nexport interface NormalizedLocalServiceAddressingDescriptor {\n host?: string | undefined;\n port?: number | undefined;\n url?: string | undefined;\n}\n\nexport function normalizeSaasModuleBindings(input: {\n services: Record<string, { serviceName: string }>;\n modules?: ApplicationModules | undefined;\n}) {\n const declaredModules = input.modules ?? {};\n\n return {\n declaredModules,\n moduleIds: getDeclaredApplicationModuleIds(declaredModules),\n moduleIdsByService: Object.fromEntries(\n Object.keys(input.services).map((serviceKey) => [\n serviceKey,\n getServiceBoundApplicationModuleIds(declaredModules, serviceKey),\n ]),\n ),\n };\n}\n\nexport function buildAdminAppManagedDeclaration(input: {\n name: string;\n slug: string;\n displayName: string;\n description?: string | undefined;\n type: 'saas';\n services: Record<string, Pick<NormalizableAppServiceRow, 'serviceName' | 'frontendType'>>;\n minions?: Record<string, {\n resourceAccess?: MinionResourceAccess;\n platformAccess?: MinionPlatformAccessCarried;\n mode?: 'always-up' | 'cron';\n schedule?: string;\n }> | undefined;\n workers?: Record<string, ManagedWorkerDeclaration> | undefined;\n engineCapabilities?: Record<string, EngineCapabilityActivationInput> | undefined;\n providers?: SaasConfigProvidersBlockInput | undefined;\n providerConfigurations?: ProviderConfigurationsInput | undefined;\n organizationTypes: OrganizationTypesConfigInput;\n systemsOfRecord?: SystemsOfRecordConfigInput | undefined;\n}): AdminAppManagedDeclaration {\n return AdminAppManagedDeclarationSchema.parse({\n app: {\n name: input.name,\n slug: input.slug,\n displayName: input.displayName,\n description: input.description,\n type: input.type,\n },\n frontendServices: Object.values(input.services)\n .filter((service) => service.frontendType !== undefined)\n .map((service) => ({\n serviceName: service.serviceName,\n frontendType: service.frontendType,\n })),\n minions: Object.fromEntries(\n Object.entries(input.minions ?? {}).map(([minionName, declaration]) => [\n minionName,\n {\n ...(declaration.resourceAccess ? { resourceAccess: declaration.resourceAccess } : {}),\n // Forwarded only when authored, like every sibling here: an absent\n // axis must stay absent rather than becoming an explicit empty\n // declaration downstream.\n ...(declaration.platformAccess ? { platformAccess: declaration.platformAccess } : {}),\n // KD-12 — only forward `mode` + `schedule` when present so the\n // declaration stays minimal for legacy / always-up minions.\n ...(declaration.mode !== undefined ? { mode: declaration.mode } : {}),\n ...(declaration.schedule !== undefined ? { schedule: declaration.schedule } : {}),\n },\n ]),\n ),\n workers: input.workers ?? {},\n engineCapabilities: input.engineCapabilities,\n providers: input.providers,\n providerConfigurations: input.providerConfigurations,\n organizationTypes: input.organizationTypes,\n systemsOfRecord: input.systemsOfRecord,\n });\n}\n\nexport function normalizeSaasRuntimeDescriptor(input: {\n name: string;\n slug: string;\n displayName: string;\n description?: string | undefined;\n type: 'saas';\n services: Record<string, NormalizableAppServiceRow>;\n minions?: Record<string, {\n resourceAccess?: MinionResourceAccess;\n platformAccess?: MinionPlatformAccessCarried;\n mode?: 'always-up' | 'cron';\n schedule?: string;\n }> | undefined;\n workers?: Record<string, ManagedWorkerDeclaration> | undefined;\n engineCapabilities?: Record<string, EngineCapabilityActivationInput> | undefined;\n providers?: SaasConfigProvidersBlockInput | undefined;\n providerConfigurations?: ProviderConfigurationsInput | undefined;\n organizationTypes: OrganizationTypesConfigInput;\n systemsOfRecord?: SystemsOfRecordConfigInput | undefined;\n dataServices?: AppDataServices | undefined;\n modules?: ApplicationModules | undefined;\n libraries?: Record<string, AppLibraryDefinition> | undefined;\n specifications?: { path: string } | undefined;\n bootstrap?: {\n firstAdmin?: AppBootstrapFirstAdminSeed | undefined;\n } | undefined;\n}): NormalizedSaasRuntimeDescriptor {\n // `isolation` is resolved HERE — the single point where a service row is read\n // and classified as backend or frontend — because the correct default depends\n // on exactly that classification (Node as `wildo` vs nginx as `nginx`). Two\n // renderers consume the result; resolving it per-renderer instead is how the\n // same row ends up running as different users in the k8s and compose lanes.\n const backendServices = Object.entries(input.services)\n .filter(([, service]) => service.frontendType === undefined)\n .map(([key, service]) => ({\n key,\n path: service.path,\n serviceName: service.serviceName,\n defaultPort: service.defaultPort,\n isolation: resolveAppServiceIsolation(service),\n }));\n\n const frontendServices = Object.entries(input.services)\n .filter(([, service]) => service.frontendType !== undefined)\n .map(([key, service]) => ({\n key,\n path: service.path,\n serviceName: service.serviceName,\n defaultPort: service.defaultPort,\n frontendType: service.frontendType!,\n isolation: resolveAppServiceIsolation(service),\n }));\n const normalizedModuleBindings = normalizeSaasModuleBindings({\n services: input.services,\n modules: input.modules,\n });\n const backendServiceKeys = backendServices.map((service) => service.key);\n\n return {\n appSlug: input.slug,\n appDisplayName: input.displayName,\n appDatabaseName: deriveAppDatabaseName(input.dataServices),\n redisKeyPrefix: input.dataServices?.redis?.keyPrefix,\n storageBucketPrefix: input.dataServices?.s3?.bucketPrefix,\n requiresJavaBackendBase: hasServiceBoundModuleWithSamlIntegration(\n normalizedModuleBindings.declaredModules,\n backendServiceKeys,\n ),\n backendServices,\n frontendServices,\n libraries: input.libraries ?? {},\n specifications: input.specifications,\n managedDeclaration: buildAdminAppManagedDeclaration({\n name: input.name,\n slug: input.slug,\n displayName: input.displayName,\n description: input.description,\n type: input.type,\n services: input.services,\n minions: input.minions,\n workers: input.workers,\n engineCapabilities: input.engineCapabilities,\n providers: input.providers,\n providerConfigurations: input.providerConfigurations,\n organizationTypes: input.organizationTypes,\n systemsOfRecord: input.systemsOfRecord,\n }),\n firstAdminSeed: input.bootstrap?.firstAdmin,\n declaredModules: normalizedModuleBindings.declaredModules,\n moduleIds: normalizedModuleBindings.moduleIds,\n moduleIdsByService: normalizedModuleBindings.moduleIdsByService,\n };\n}\n"]}
@@ -4,6 +4,8 @@ import { type EngineCapabilityActivations, type MinionPlatformAccessCarried, typ
4
4
  import { AppFrontendType } from '../project-config/shared/service-definitions.schemas';
5
5
  import { WildoAuthConfigSchema } from '../project-config/shared/auth.schemas';
6
6
  import { DatabaseEngine } from '../project-config/shared/environment.schemas';
7
+ import { BackingServiceKind } from '../project-config/shared/backing-services.schemas';
8
+ import type { BackingServiceProviderSelection } from '../project-config/shared/backing-service-servability';
7
9
  /**
8
10
  * Shared bootstrap execution mode.
9
11
  * The workflow semantics stay the same; only the executor differs.
@@ -426,7 +428,52 @@ export interface ApplicationBackingServiceAddressing {
426
428
  rabbitmqVhost?: string;
427
429
  /** The object-storage bucket the application backend reads and writes. Always known: it has a projected default. */
428
430
  objectStorageBucket: string;
431
+ /**
432
+ * Which provider serves each backing service the application's environment DECLARES (#1692). See
433
+ * {@link ApplicationBackingServiceProviderDeclarations}.
434
+ */
435
+ declaredProviders?: ApplicationBackingServiceProviderDeclarations;
429
436
  }
437
+ /**
438
+ * The `(source, provider)` pair each backing-service kind declares in the environment an application registers
439
+ * in — its `backingServices` block, reduced to the half that decides WHICH SERVER serves it (#1692).
440
+ *
441
+ * ## Why apps-manager has to be told
442
+ *
443
+ * apps-manager mints every backing-service credential an application receives. It used to choose the provider
444
+ * from its OWN environment — MongoDB Atlas when an Atlas API key happened to be configured, self-hosted
445
+ * otherwise — and minted Redis and RabbitMQ on the platform's own servers unconditionally. So an application
446
+ * declaring `redis: { source: MANAGED }` got no Valkey workload (the generators honour `source`) and a Redis
447
+ * ACL user on the PLATFORM's Redis: a credential for a server it never connects to. The catalogue of provider
448
+ * modules could not change that either, because nothing selected a module from what the application declared.
449
+ * This is the same "apps-manager read its own env instead of being told" defect as the vhost and bucket above.
450
+ *
451
+ * ## Why the DECLARATION travels, not the resolved `InfraProvider`
452
+ *
453
+ * apps-manager resolves each entry with the SAME `resolveInfraProvider` the lockfile's infra section uses, so
454
+ * the provider it dispatches on and the provider the lockfile records are one function's answer. Sending the
455
+ * resolved provider instead would make a declaration that resolves to NOTHING — `redis: { source: MANAGED }`
456
+ * has no `InfraProvider` member — indistinguishable from a kind that is not declared, and "not declared" keeps
457
+ * the old behaviour, which is exactly the platform-server mint this contract exists to end. Carrying the pair
458
+ * keeps "declared, unservable" representable so apps-manager can REFUSE it, naming what was declared.
459
+ *
460
+ * ## The meanings of absence
461
+ *
462
+ * - The whole map absent (a CLI predating #1692, or the platform's own application registered by INIT mode):
463
+ * every kind keeps its previous behaviour.
464
+ * - One kind absent from a sent map (the environment does not declare it): that kind alone keeps its previous
465
+ * behaviour — self-hosted on the platform's own server, and for MongoDB Atlas-when-configured.
466
+ *
467
+ * ## A declaration is environment-wide; a mint is per application
468
+ *
469
+ * `backingServices` describes the environment, including stores only the PLATFORM uses (a self-hosted MongoDB
470
+ * beside a PostgreSQL application, say). So apps-manager checks admin credentials only for the kinds it mints
471
+ * for THIS application; a declared kind the application does not consume is checked only against the
472
+ * catalogue, which the CLI has already done offline (#1693).
473
+ */
474
+ export type ApplicationBackingServiceProviderDeclarations = Partial<Record<BackingServiceKind, BackingServiceProviderSelection>>;
475
+ /** Keyed by {@link BackingServiceKind}, total over it, each entry optional — see the type above. */
476
+ export declare const ApplicationBackingServiceProviderDeclarationsSchema: z.ZodType<ApplicationBackingServiceProviderDeclarations>;
430
477
  export declare const ApplicationBackingServiceAddressingSchema: z.ZodType<ApplicationBackingServiceAddressing>;
431
478
  export interface AdminAppInitializeRequest {
432
479
  name?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.schemas.d.ts","sourceRoot":"","sources":["../../../../src/bootstrap/bootstrap.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mCAAmC,EAExC,KAAK,sBAAsB,EAE3B,KAAK,uBAAuB,EAE5B,KAAK,qBAAqB,EAC1B,kBAAkB,EACnB,MAAM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MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AACpG,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC"}
@@ -5,6 +5,7 @@ import { AppFrontendType, DataAccessSchema, ResourceLimitsSchema, WorkerRuntimeS
5
5
  import { WorkerAuthSchema, WorkerHttpSchema, } from '../project-config/define-worker-config.js';
6
6
  import { WildoAuthConfigSchema } from '../project-config/shared/auth.schemas.js';
7
7
  import { DatabaseEngine } from '../project-config/shared/environment.schemas.js';
8
+ import { BackingServiceKind, BackingServiceSource } from '../project-config/shared/backing-services.schemas.js';
8
9
  /**
9
10
  * Shared bootstrap execution mode.
10
11
  * The workflow semantics stay the same; only the executor differs.
@@ -354,9 +355,16 @@ export const AppWorkerBootstrapResponseSchema = z.object({
354
355
  rotatedPublicKeys: z.array(AppBootstrapRotatedPublicKeyEntrySchema).optional(),
355
356
  }),
356
357
  });
358
+ const BackingServiceProviderSelectionSchema = z.object({
359
+ source: z.enum(BackingServiceSource),
360
+ provider: z.string().min(1).optional(),
361
+ }).strict();
362
+ /** Keyed by {@link BackingServiceKind}, total over it, each entry optional — see the type above. */
363
+ export const ApplicationBackingServiceProviderDeclarationsSchema = z.object(Object.fromEntries(Object.values(BackingServiceKind).map((kind) => [kind, BackingServiceProviderSelectionSchema.optional()]))).strict();
357
364
  export const ApplicationBackingServiceAddressingSchema = z.object({
358
365
  rabbitmqVhost: z.string().min(1).optional(),
359
366
  objectStorageBucket: z.string().min(1),
367
+ declaredProviders: ApplicationBackingServiceProviderDeclarationsSchema.optional(),
360
368
  }).strict();
361
369
  /**
362
370
  * Shared admin request payload for a single app initialization.
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.schemas.js","sourceRoot":"","sources":["../../../../src/bootstrap/bootstrap.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0CAA0C,EAE1C,4BAA4B,EAE5B,6BAA6B,EAE7B,2BAA2B,EAE3B,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iCAAiC,EACjC,iCAAiC,EACjC,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,GAM/B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAE9E;;;GAGG;AACH,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,wCAAe,CAAA;IACf,0CAAiB,CAAA;AACnB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,8DAA2C,CAAA;IAC3C,4DAAyC,CAAA;IACzC,8EAA2D,CAAA;IAC3D,4EAAyD,CAAA;IACzD,8DAA2C,CAAA;AAC7C,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,mCAAmC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC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AC,CAAC,MAAM,CAAC;QACpB,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE;QAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAC5B,CAAC;IACF;;;;;;;OAOG;IACH,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,QAAQ,EAAE;CACjE,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,CAAC,YAAY,CAAC;IACpE,kBAAkB,EAAE,gCAAgC;IACpD,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAiD,CAAC;AAEnD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/D,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC;;;;;;;;OAQG;IACH,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC","sourcesContent":["import {\n AppConfiguration_Shared_AppIdentity_Schema,\n type AppConfiguration_Shared_AppIdentity,\n FrontendServicesConfigSchema,\n type FrontendServicesConfig,\n OrganizationTypesConfigSchema,\n type OrganizationTypesConfig,\n SystemsOfRecordConfigSchema,\n type SystemsOfRecordConfig,\n RuntimeEnvironment,\n} from '@wildo-ai/saas-models';\nimport { z } from 'zod';\nimport {\n EngineCapabilityActivationsSchema,\n MinionPlatformAccessCarriedSchema,\n MinionResourceAccessSchema,\n ProviderConfigurationsSchema,\n SaasConfigProvidersBlockSchema,\n type EngineCapabilityActivations,\n type MinionPlatformAccessCarried,\n type MinionResourceAccess,\n type ProviderConfigurations,\n type SaasConfigProvidersBlock,\n} from '../project-config/define-saas-config';\nimport {\n AppFrontendType,\n DataAccessSchema,\n ResourceLimitsSchema,\n WorkerRuntimeSchema,\n} from '../project-config/shared/service-definitions.schemas';\nimport {\n WorkerAuthSchema,\n WorkerHttpSchema,\n} from '../project-config/define-worker-config';\nimport { WildoAuthConfigSchema } from '../project-config/shared/auth.schemas';\nimport { DatabaseEngine } from '../project-config/shared/environment.schemas';\n\n/**\n * Shared bootstrap execution mode.\n * The workflow semantics stay the same; only the executor differs.\n */\nexport enum BootstrapExecutorKind {\n LOCAL = 'local',\n REMOTE = 'remote',\n}\n\n/**\n * Shared bootstrap step identifiers.\n * These represent semantic workflow stages, not package-specific implementation details.\n */\nexport enum BootstrapStepId {\n INITIALIZE_PLATFORM = 'initialize-platform',\n ENSURE_APPLICATION = 'ensure-application',\n FETCH_BOOTSTRAP_CREDENTIALS = 'fetch-bootstrap-credentials',\n GENERATE_RUNTIME_ARTIFACTS = 'generate-runtime-artifacts',\n START_LOCAL_RUNTIME = 'start-local-runtime',\n}\n\n/**\n * Minimum bootstrap credentials required for an application backend to authenticate\n * with apps-manager and fetch its full runtime configuration.\n */\nexport const AppBootstrapCredentialsSchema = z.object({\n APPLICATION_ID: z.string().min(1),\n PLATFORM_APPLICATION_PRIMARY_SECRET: z.string().min(1),\n PLATFORM_APPS_MANAGER_URL: z.url(),\n APPLICATION_ENV: z.enum(RuntimeEnvironment),\n /**\n * The application's slug, carried beside the other identity keys because it becomes an env var on\n * every application runtime exactly as they do (#1177).\n *\n * It rides HERE rather than being threaded through each env builder's argument list because every\n * builder that needs it already receives this object — and because the envelope around it already\n * carries `appSlug`, so apps-manager has nothing new to look up.\n */\n APPLICATION_SLUG: z.string().min(1),\n});\n\n/**\n * Shared response envelope returned by apps-manager when bootstrap credentials are requested.\n * Both apps-manager and CLI should rely on this same contract.\n * `environment` / `APPLICATION_ENV` describe runtime semantics for the\n * bootstrapped application process, not the project-level remote environment id.\n */\nexport const AppBootstrapCredentialsResponseSchema = z.object({\n success: z.literal(true),\n appSlug: z.string().min(1),\n environment: z.enum(RuntimeEnvironment),\n credentials: AppBootstrapCredentialsSchema,\n});\n\nexport interface AdminAppManagedDeclaration {\n app: {\n name: string;\n slug: string;\n displayName: string;\n description?: string;\n type: 'saas';\n };\n frontendServices: Array<{\n serviceName: string;\n frontendType: AppFrontendType;\n }>;\n minions: Record<string, {\n resourceAccess?: MinionResourceAccess;\n /** R4/R5 — what this minion may read about ITSELF at the platform level. Absent ⇒ nothing. */\n platformAccess?: MinionPlatformAccessCarried;\n /** KD-12 — `'cron'` minions paired with a `schedule` produce MINION_TICK CronJob records. */\n mode?: 'always-up' | 'cron';\n schedule?: string;\n }>;\n workers: Record<string, {\n name: string;\n displayName: string;\n description?: string;\n runtime: {\n type: string;\n language: string;\n };\n http: {\n port: number;\n healthPath: string;\n readyPath: string;\n metricsPath?: string;\n };\n auth: 'wildo-jwt';\n replicas: number;\n resources?: {\n cpu?: string;\n memory?: string;\n };\n dataAccess?: {\n database?: 'read-only' | 'read-write' | 'none';\n cache?: boolean;\n queue?: 'consumer' | 'producer' | 'both' | 'none';\n };\n }>;\n engineCapabilities: EngineCapabilityActivations;\n providers: SaasConfigProvidersBlock;\n providerConfigurations: ProviderConfigurations;\n /** AUTHORITATIVE bucket — see `AdminAppManagedDeclarationSchema`. Required, at least one. */\n organizationTypes: OrganizationTypesConfig;\n /**\n * AUTHORITATIVE bucket — the application's declared systems of record (#1055). OPTIONAL, unlike its\n * sibling above: an application that reads nothing out of another system declares none.\n */\n systemsOfRecord?: SystemsOfRecordConfig;\n}\n\n/**\n * The managed minion inventory as it travels the apps-manager wire — the ONE runtime source for\n * that block, in both directions.\n *\n * ## Why this is exported rather than module-private\n *\n * It is reached at three places in this file (`AdminAppManagedDeclarationSchema` for the CLI's\n * declaration, `AppBootstrapConfigMetadataResponseSchema` for what a backend fetches at boot), and\n * — since 2026-09-09 — by the application backend's configuration loader in\n * `@wildo-ai/saas-backend-lib`, which used to re-declare the block by hand.\n *\n * That hand copy is the reason this export exists, and the cost is measured rather than\n * hypothetical. A consumer-side copy of a wire block is parsed with Zod's strip-unknown semantics,\n * so a field added HERE and not mirrored THERE does not fail — it is silently deleted from the\n * payload on the way in. It happened twice: `mode` / `schedule` (the KD-12 cron-tick path, which\n * left every scheduled minion's MINION_TICK CronJob registration dead in production while the wire\n * carried the data correctly) and then `platformAccess`, added the same way and stripped the same\n * way. Neither surfaced as an error anywhere.\n *\n * Exporting the block costs nothing: `@wildo-ai/platform-config-lib`'s root index already\n * re-exports this module, and the engine already imports that root, so no consumer's module graph\n * changes — only the number of hand-maintained copies of this shape does.\n *\n * The engine keeps its OWN `AppConfiguration_MinionsSchema` (a `strictObject` typed against a named\n * interface, for the TS7056 serialization-ceiling reason documented there) and does NOT collapse\n * onto this one. The two are held in step by a mechanical field-parity pin in\n * `engine/saas-backend-lib/src/config/__tests__/managed-runtime-inventory-parity.backend.test.ts`,\n * so the remaining duplication cannot drift in silence the way this one did.\n */\nexport const AdminAppManagedMinionsSchema = z.record(\n z.string().min(1),\n z.object({\n resourceAccess: MinionResourceAccessSchema.optional(),\n /**\n * R4/R5 platform-access axis. Independent of `resourceAccess` (D12) — a\n * minion may hold either, both, or neither. apps-manager reads this to\n * decide whether to mint a principal-scoped attestation at all, and\n * `buildOwnCronRecordFilter` reads it to decide whether the minion has any\n * subject to query WITH, so a field dropped here confers nothing no matter\n * what the author wrote.\n */\n platformAccess: MinionPlatformAccessCarriedSchema.optional(),\n /**\n * KD-12 cron-tick path. When `mode === 'cron'` and `schedule` is\n * provided, the backend-api's `cron-job-sync.backend.service.ts`\n * registers a `MINION_TICK` CronJob record on\n * `platform-crontabs-batches-manager` so the per-minion queue\n * (`wildo.queue.{appId}.minion-tick.{minionName}`) actually fires\n * on schedule.\n */\n mode: z.enum(['always-up', 'cron']).optional(),\n schedule: z.string().min(1).optional(),\n }),\n).default({});\n\n/**\n * The managed worker inventory as it travels the apps-manager wire. Exported for the same reason as\n * `AdminAppManagedMinionsSchema` above, and held in step with the engine's\n * `AppConfiguration_WorkersSchema` by the same parity pin — read that JSDoc before changing either.\n */\nexport const AdminAppManagedWorkersSchema = z.record(\n z.string().min(1),\n z.object({\n name: z.string().min(1),\n displayName: z.string().min(1),\n description: z.string().optional(),\n runtime: WorkerRuntimeSchema,\n http: WorkerHttpSchema,\n auth: WorkerAuthSchema,\n replicas: z.number().int().positive(),\n resources: ResourceLimitsSchema.optional(),\n dataAccess: DataAccessSchema.optional(),\n }),\n).default({});\n\n/**\n * Admin-side projection of `wildo.saas.config.ts` carried from the CLI to\n * apps-manager at app initialization / re-apply time.\n *\n * Cross-bucket trust asymmetry (Slice 3 closeout):\n * Fields in this schema fall into TWO TRUST BUCKETS that the apps-manager\n * treats differently:\n *\n * 1. AUTHORITATIVE bucket (always honored, write-through):\n * - `app.name` / `app.slug` / `app.displayName` / `app.description`\n * — `appIdentity` core (F-53 swap: `app.name` is the canonical\n * identifier, `app.displayName` is the UI label only).\n * - `frontendServices` — frontend service registry (consumed by\n * `_merge_WildoApplicationConfig` to materialise endpoints).\n * - `minions` — minion runtime inventory, currently carrying the\n * per-minion `resourceAccess` authority whitelist used by\n * `start-minion-application`.\n * - `workers` — worker runtime inventory persisted by apps-manager so\n * the control-plane can validate worker identity and serve the\n * worker bootstrap contract without re-reading authored files.\n * - `engineCapabilities`, `providers`, and `providerConfigurations`\n * — the provider runtime graph and its non-secret settings.\n * - `organizationTypes` — the tenancy model (#1032, 2026-09-14). It\n * joined this bucket rather than staying backend-authored because\n * apps-manager SEEDS the first administrator's organization and must\n * derive that organization's type from these declarations; the\n * backend cannot publish what the platform needs before the backend\n * exists. Write-through like its siblings: the stored config is\n * replaced by the declaration on every init and re-apply.\n * - `systemsOfRecord` — the named instances of the systems this\n * application reads its own business rows out of (#1055). It is in\n * this bucket because the environment-variable names carrying each\n * instance's address and secrets are DERIVED from the declaration,\n * and the platform and the CLI derive them too — so the declaration,\n * not a backend-authored copy, has to be what travels.\n *\n * 2. POLICY bucket (governed by override semantics):\n * - currently empty for provider registration. Capability activation\n * is authored as `engineCapabilities`, while provider routing is\n * materialized into `providers`.\n *\n * What is intentionally NOT here (out of bucket):\n * - JWT TTLs (`accessTokenExpirationMinutes`/`refreshTokenExpirationDays`)\n * travel via the SIBLING field `serviceAuth` on the request envelope\n * (see `AdminAppInitializeRequestSchema.serviceAuth`), NOT here.\n * This separation reflects that JWT TTLs are infra-environment policy\n * sourced from `wildo.infra.<env>.config.ts`, while\n * `managedDeclaration` projects the application-level\n * `wildo.saas.config.ts`.\n * - `dataServices.*` (Redis key prefix, S3 bucket prefix, etc.) — these\n * flow through `PlatformEnvConfigJson` env wiring, not the admin\n * declaration. The declaration carries application-level semantics\n * only.\n *\n * If you ADD a field, decide explicitly which bucket it belongs to and\n * document it in the merge service's JSDoc — silently widening the\n * declaration without consumer-side handling is the documented failure\n * mode this comment exists to prevent.\n */\nexport const AdminAppManagedDeclarationSchema = z.object({\n app: z.object({\n name: z.string().min(1),\n slug: z.string().min(1),\n displayName: z.string().min(1),\n description: z.string().optional(),\n type: z.literal('saas'),\n }),\n frontendServices: z.array(z.object({\n serviceName: z.string().min(1),\n frontendType: z.enum(AppFrontendType),\n })).default([]),\n minions: AdminAppManagedMinionsSchema,\n workers: AdminAppManagedWorkersSchema,\n engineCapabilities: EngineCapabilityActivationsSchema,\n providers: SaasConfigProvidersBlockSchema,\n providerConfigurations: ProviderConfigurationsSchema,\n organizationTypes: OrganizationTypesConfigSchema,\n systemsOfRecord: SystemsOfRecordConfigSchema.optional(),\n}) as z.ZodType<AdminAppManagedDeclaration>;\n\n/**\n * WHEN an application's OWN database gets its bootstrap rows, relative to the schema those rows need.\n *\n * ## The circularity this vocabulary exists to break\n *\n * On MongoDB, seeding an application's database needed no schema — a collection springs into being on\n * first write — so provisioning could create the database and its first rows in one uninterrupted\n * step. PostgreSQL removed that luxury and exposed a genuine cycle that had always been latent:\n *\n * - apps-manager seeds the application's database during provisioning;\n * - those rows need tables, which come from the application's OWN `migrations/` directory;\n * - those migrations are applied by the application backend at boot\n * (`applyStartupPostgresMigrations`, the production door);\n * - and the backend cannot boot until it is seeded, because its execution-context creator requires\n * exactly one APPLICATION row.\n *\n * Nothing inside that circle can break it. apps-manager cannot read the application's migration files\n * — in production they ship inside the application's own image — and the backend cannot supply the\n * seed, which is authored in `wildo.saas.config.ts`. Only the DEPLOY TOOLING holds both, which is why\n * this is a two-phase contract rather than a retry, a tolerance, or a longer timeout.\n *\n * Observed 2026-08-23 on the first PostgreSQL install: provisioning aborted with\n * `relation \"applications\" does not exist`, and `wildo local dev` failed. The same order holds on\n * every lane, so per-application PostgreSQL provisioning had never completed anywhere.\n *\n * ## Why a request field rather than an inferred tolerance\n *\n * Making apps-manager silently skip seeding when the schema happens to be absent would be a\n * fail-open: provisioning would report success having left the application unbootable, and the caller\n * would have no way to tell a deferred seed from a completed one. The caller states its intent, and\n * the response states what happened — see {@link AppDatabaseSeedingOutcome}.\n */\nexport enum AppDatabaseSeedingPhase {\n /**\n * Seed now. The default, and the ONLY behaviour any pre-2026-08-23 caller can produce, so every\n * MongoDB lane and every older CLI is unchanged.\n */\n REQUIRED = 'REQUIRED',\n /**\n * Provision infrastructure and platform records, but do NOT seed the application's own database —\n * the caller is about to create its schema and will then re-invoke with {@link REQUIRED}.\n */\n DEFERRED = 'DEFERRED',\n}\n\n/**\n * What provisioning actually DID about the application's own bootstrap rows.\n *\n * Reported so a caller can never mistake a deferred seed for a completed one. The CLI treats\n * {@link DEFERRED} as expected on its first phase and FATAL on its second — an application that is\n * still unseeded after its migrations have been applied is a defect, not a state to tolerate.\n */\nexport enum AppDatabaseSeedingOutcome {\n /** Bootstrap rows exist in the application's own database. */\n SEEDED = 'SEEDED',\n /** Skipped because the caller asked for {@link AppDatabaseSeedingPhase.DEFERRED}. */\n DEFERRED = 'DEFERRED',\n /**\n * Skipped because the application has no resolved persistence target. Distinct from\n * {@link DEFERRED}: nothing the caller does next will seed it — the target itself is missing.\n */\n NO_PERSISTENCE_TARGET = 'NO_PERSISTENCE_TARGET',\n}\n\nexport const AppBootstrapFirstAdminSeedSchema = z.object({\n userTypes: z.array(z.string().min(1)).min(1),\n});\n\nconst AppBootstrapRotatedPublicKeyEntrySchema = z.object({\n kid: z.string().min(1),\n publicKey: z.string().min(1),\n /** Last observation/token instant this retired key may authenticate. */\n notAfter: z.coerce.date().optional(),\n});\n\nexport interface AppBootstrapConfigMetadataResponse {\n appSlug: string;\n appIdentity?: AppConfiguration_Shared_AppIdentity;\n frontendServices?: FrontendServicesConfig;\n minions?: Record<string, {\n resourceAccess?: MinionResourceAccess;\n /** R4/R5 — what this minion may read about ITSELF at the platform level. Absent ⇒ nothing. */\n platformAccess?: MinionPlatformAccessCarried;\n /** KD-12 — `'cron'` minions paired with a `schedule` produce MINION_TICK CronJob records. */\n mode?: 'always-up' | 'cron';\n schedule?: string;\n }>;\n workers?: Record<string, {\n name: string;\n displayName: string;\n description?: string;\n runtime: {\n type: string;\n language: string;\n };\n http: {\n port: number;\n healthPath: string;\n readyPath: string;\n metricsPath?: string;\n };\n auth: 'wildo-jwt';\n replicas: number;\n resources?: {\n cpu?: string;\n memory?: string;\n };\n dataAccess?: {\n database?: 'read-only' | 'read-write' | 'none';\n cache?: boolean;\n queue?: 'consumer' | 'producer' | 'both' | 'none';\n };\n }>;\n engineCapabilities?: EngineCapabilityActivations;\n providers?: SaasConfigProvidersBlock;\n /** The application's organization types, as its declaration stored them (#1032). See the schema field. */\n organizationTypes?: OrganizationTypesConfig;\n /** The application's systems of record, as its declaration stored them (#1055). See the schema field. */\n systemsOfRecord?: SystemsOfRecordConfig;\n email?: {\n isTransactionalWildoManaged: boolean;\n isMarketingWildoManaged: boolean;\n };\n providerConfigurations: ProviderConfigurations;\n jwt?: {\n publicKey: Record<string, string>;\n rotatedPublicKeys?: Record<string, Array<z.infer<typeof AppBootstrapRotatedPublicKeyEntrySchema>>>;\n accessTokenExpirationMinutes: number;\n refreshTokenExpirationDays: number;\n };\n}\n\nexport const AppBootstrapConfigMetadataResponseSchema = z.object({\n appSlug: z.string().min(1),\n appIdentity: AppConfiguration_Shared_AppIdentity_Schema.optional(),\n frontendServices: FrontendServicesConfigSchema.optional(),\n minions: AdminAppManagedMinionsSchema.optional(),\n workers: AdminAppManagedWorkersSchema.optional(),\n engineCapabilities: EngineCapabilityActivationsSchema.optional(),\n providers: SaasConfigProvidersBlockSchema.optional(),\n /**\n * The application's organization types (#1032). A running backend refuses to start without them, and this\n * response is the only road from the stored declaration to the backend — so a section missing HERE is not\n * rejected, it is deleted between apps-manager and the application, and the backend refuses a configuration\n * whose stored document is correct. That is what happened the first time the refusal met a real stack.\n * Optional on the wire because a stored document written before the declaration carried it still answers.\n */\n organizationTypes: OrganizationTypesConfigSchema.optional(),\n /**\n * The application's systems of record (#1055). Declared HERE for the same reason as its sibling\n * above, and it is the reason worth repeating: every schema on this road is a plain `z.object`, so a\n * section missing here is not rejected — it is DELETED between apps-manager and the application, and\n * the backend then boots believing the application declares none.\n */\n systemsOfRecord: SystemsOfRecordConfigSchema.optional(),\n email: z.object({\n isTransactionalWildoManaged: z.boolean(),\n isMarketingWildoManaged: z.boolean(),\n }).optional(),\n providerConfigurations: ProviderConfigurationsSchema,\n jwt: z.object({\n publicKey: z.record(z.string(), z.string()),\n rotatedPublicKeys: z.record(\n z.string(),\n z.array(AppBootstrapRotatedPublicKeyEntrySchema),\n ).optional(),\n /**\n * Operator-authored JWT TTLs (Slice 3.3 hardening, F-24 / closeout).\n *\n * Sourced from `Wildo_Application_Config.jwt.{accessTokenExpirationMinutes,\n * refreshTokenExpirationDays}` (which itself was seeded from\n * `serviceAuth` in `wildo.infra.<env>.config.ts` at apps-manager init\n * time, falling back to `WildoAuthConfigSchema` defaults of 15 min /\n * 30 days when omitted \\u2014 access-token default tightened from 60\n * \\u2192 15 in Auth-hardening Slice A Step 5 on 2026-04-13; see the\n * file-level JSDoc on `auth.schemas.ts` for the threat-model rationale).\n * The application backend MUST consume these values at sign time\n * (`AuthTokenIssuerBackendService.issueAccessToken`,\n * `JwtBackendService.createRefreshToken`) instead of falling back to\n * developer-authored constants in `saas-config.backend.ts`.\n *\n * REQUIRED on the response (Slice 3 closeout): `_getDefault_WildoApplicationConfig`\n * always seeds these via `WildoAuthConfigSchema.parse(serviceAuth ?? {})`\n * (15 min / 30 days defaults), so any persisted\n * `Wildo_Application_Config.jwt` block has both fields populated.\n * Marking them required here lets the consumer\n * (`app-configuration-loader.backend.service.ts`) drop the\n * `accessTokenExpirationMinutes !== undefined ? ... : {}` defensive\n * spread and treat them as guaranteed values.\n */\n accessTokenExpirationMinutes: z.number().int().positive(),\n refreshTokenExpirationDays: z.number().int().positive(),\n }).optional(),\n}) as z.ZodType<AppBootstrapConfigMetadataResponse>;\n\nexport interface AppWorkerBootstrapResponse {\n appSlug: string;\n workerName: string;\n worker: z.infer<typeof AdminAppManagedWorkersSchema>[string];\n jwt: {\n publicKey: string;\n rotatedPublicKeys?: Array<z.infer<typeof AppBootstrapRotatedPublicKeyEntrySchema>>;\n };\n}\n\nexport const AppWorkerBootstrapResponseSchema = z.object({\n appSlug: z.string().min(1),\n workerName: z.string().min(1),\n worker: z.object({\n name: z.string().min(1),\n displayName: z.string().min(1),\n description: z.string().optional(),\n runtime: WorkerRuntimeSchema,\n http: WorkerHttpSchema,\n auth: WorkerAuthSchema,\n replicas: z.number().int().positive(),\n resources: ResourceLimitsSchema.optional(),\n dataAccess: DataAccessSchema.optional(),\n }),\n jwt: z.object({\n publicKey: z.string().min(1),\n rotatedPublicKeys: z.array(AppBootstrapRotatedPublicKeyEntrySchema).optional(),\n }),\n}) as z.ZodType<AppWorkerBootstrapResponse>;\n\ntype WildoAuthConfig = z.infer<typeof WildoAuthConfigSchema>;\n\n/**\n * Where ONE application's broker and object storage live, as its environment authored them (#1107).\n *\n * ## Why apps-manager has to be TOLD\n *\n * Both values are authored per application — `backingServices.rabbitmq.vhost` and\n * `backingServices.s3.bucket` in `wildo.infra.<env>.config.ts` — and the CLI writes them into that\n * application's own backend env. apps-manager, which provisions the vhost grant and issues the storage\n * credential, used to read them from its OWN process env instead. That env is generated from whichever\n * application last ran a full `wildo local init`, so every other application registered on the same\n * platform (`wildo local init --register-only`) had its broker principal granted on the owner's vhost\n * and its storage credential confined to the owner's bucket, while its backend connected to its own:\n * a vhost that did not exist and a bucket nobody had created.\n *\n * ## The same projection as the application's env, by construction\n *\n * The CLI derives this with the one function that also writes `RABBITMQ_VHOST` / `STORAGE_BUCKET` into\n * the application backend env, so the value apps-manager provisions and the value the backend connects\n * with cannot be two spellings of one fact.\n *\n * ## Absence is refused, never substituted\n *\n * apps-manager refuses to provision a vhost grant or issue a storage credential for an application whose\n * addressing it was never told, naming the remedy (register the application again). Substituting its own\n * env would be this defect with a warning attached. Every `wildo local dev` start registers the\n * application before its backends spawn, so a recorded addressing is always in place by the time a backend\n * asks. `rabbitmqVhost` absent inside a sent object is different: the application authored no vhost and\n * uses the broker's default vhost `/`.\n */\nexport interface ApplicationBackingServiceAddressing {\n /** The authored broker virtual host. Absent means the default vhost `/`. */\n rabbitmqVhost?: string;\n /** The object-storage bucket the application backend reads and writes. Always known: it has a projected default. */\n objectStorageBucket: string;\n}\n\nexport const ApplicationBackingServiceAddressingSchema = z.object({\n rabbitmqVhost: z.string().min(1).optional(),\n objectStorageBucket: z.string().min(1),\n}).strict() as z.ZodType<ApplicationBackingServiceAddressing>;\n\nexport interface AdminAppInitializeRequest {\n name?: string;\n appDatabaseName?: string;\n override?: boolean;\n userEmail: string;\n userFirstName: string;\n userLastName: string;\n userPassword?: string;\n /**\n * The SECOND administrator (#575), when the deployment states one.\n *\n * `applicationAccessGrants.approve` is gated on `APP_ADMIN_SUPER_ADMIN` and refuses an approver\n * equal to the requester, with no auto-approval branch — so an application seeded with ONE\n * super-administrator cannot read any application-wide surface at all. Provisioning is where the\n * second one has to come from; nothing later mints it.\n *\n * ALL FOUR OR NONE. A partial set is an operator mistake rather than a request to fall back, and\n * the same reading `init.command.ts` already applies to partial `--admin-*` flags. Enforced by\n * `assertApproverIdentityIsWholeOrAbsent` at every door that reads one.\n */\n approverEmail?: string;\n approverFirstName?: string;\n approverLastName?: string;\n approverPassword?: string;\n managedDeclaration: AdminAppManagedDeclaration;\n /**\n * The application's own persistence engine — see the field's JSDoc on the schema below for why it\n * exists at all.\n *\n * ⚠️ This interface and that schema are TWO declarations of ONE contract, joined by the\n * `as z.ZodType<AdminAppInitializeRequest>` cast. The cast means a field added to only the schema\n * type-checks perfectly while being invisible to every CONSUMER — which is exactly what happened on\n * 2026-08-19: apps-manager's controller could not read `applicationDatabase` off a parsed request\n * though the schema accepted it. Add to BOTH, always.\n */\n applicationDatabase?: { engine: DatabaseEngine; databaseName?: string };\n firstAdminSeed?: AppBootstrapFirstAdminSeed;\n /**\n * WHEN to seed this application's own database. Absent means\n * {@link AppDatabaseSeedingPhase.REQUIRED} — see that enum for why the phase is stated rather\n * than inferred.\n */\n appDatabaseSeeding?: AppDatabaseSeedingPhase;\n serviceAuth?: WildoAuthConfig;\n /** See {@link ApplicationBackingServiceAddressing}. Interface AND schema, always. */\n backingServiceAddressing?: ApplicationBackingServiceAddressing;\n}\n\n/**\n * Shared admin request payload for a single app initialization.\n *\n * This describes the control-plane contract, independently of whether the\n * caller is the CLI or a future CI/CD executor.\n *\n * Required-by-contract fields:\n * - `managedDeclaration` — the projection of `wildo.saas.config.ts` that\n * seeds frontend services, capability policy, and external providers.\n * Omitting it would silently half-bootstrap an app, so the admin HTTP\n * boundary rejects requests without it.\n * - `userEmail` / `userFirstName` / `userLastName` — admin identity for\n * the seeded super-admin user. The previous implementation defaulted\n * these to a developer's personal identity, silently bypassing the\n * downstream `validateInitializationOptions` validation; that bypass\n * is now closed at the contract boundary.\n *\n * Optional-by-design fields:\n * - `userPassword` — the service auto-generates a secure password when\n * omitted (intentional one-shot bootstrap affordance).\n * - `name` / `appDatabaseName` / `override` / `firstAdminSeed` — caller\n * overrides; sensible defaults exist downstream.\n */\nexport const AdminAppInitializeRequestSchema = z.object({\n name: z.string().min(1).optional(),\n appDatabaseName: z.string().min(1).optional(),\n override: z.boolean().optional(),\n userEmail: z.email(),\n userFirstName: z.string().min(1),\n userLastName: z.string().min(1),\n userPassword: z.string().min(1).optional(),\n /**\n * The SECOND administrator (#575). Declared on BOTH the interface above and this schema — the\n * `as z.ZodType<AdminAppInitializeRequest>` cast means a field added to only one of them\n * type-checks perfectly and is invisible to every consumer, which is exactly what happened to\n * `applicationDatabase` on 2026-08-19.\n */\n approverEmail: z.email().optional(),\n approverFirstName: z.string().min(1).optional(),\n approverLastName: z.string().min(1).optional(),\n approverPassword: z.string().min(1).optional(),\n managedDeclaration: AdminAppManagedDeclarationSchema,\n /**\n * Which store this application's own resources persist to — mirrored from the authored\n * `applicationDatabase` in `wildo.infra.<env>.config.ts`, and carried under the SAME name so the\n * value is traceable end to end by one word.\n *\n * ## Why this field had to be added\n *\n * apps-manager already held the entire per-application PostgreSQL path: `mintAppCredentials`\n * provisioning the database, role and password, plus the `defaultAdapter` and `resourceIdFormat`\n * branches of the stored application config. All three were gated on\n * `WildoApplicationInitOptions.usePostgreSQL`, and on 2026-08-19 a repo-wide search found that flag\n * had FOUR mentions in the whole codebase — one declaration and three reads, in a single file.\n * **Nothing ever set it.**\n *\n * So the capability had no door. `backingServices.postgresql` had been authored for some time and\n * no application role ever appeared in `pg_roles`, because the declaration had no path to the\n * provisioner. This field is that path.\n *\n * OPTIONAL on the wire, and absence means POSTGRESQL — resolved by `resolveApplicationDatabaseEngine`\n * on the receiving side (#1571), the same answer the CLI gives. The current CLI always sends the\n * resolved engine; absence reaches apps-manager only from an older CLI or another door.\n */\n applicationDatabase: z.object({\n engine: z.enum(DatabaseEngine),\n /**\n * The AUTHORED database name, from `backingServices.postgresql.database`.\n *\n * Sent because two sources were naming this database and disagreeing: the provisioner derives\n * `wildo_<sanitized-slug>` while `env-vars-builder` emits the authored name as\n * `POSTGRESQL_DATABASE`. On 2026-08-19 that produced `wildo_wonder_todos` (owned by the app role)\n * beside `wonder-todos-db` (what the backend was told to connect to) — both empty, so the\n * application would have opened a database it did not own while its grants landed elsewhere.\n *\n * The authored value wins: it is the git-borne declaration, it is what the env already carries,\n * and the provisioner has always accepted an override — the caller simply never passed one.\n */\n databaseName: z.string().min(1).optional(),\n }).optional(),\n firstAdminSeed: AppBootstrapFirstAdminSeedSchema.optional(),\n /**\n * WHEN to seed this application's own database — see {@link AppDatabaseSeedingPhase}.\n *\n * OPTIONAL, and absence means `REQUIRED`, so a CLI that predates the two-phase contract keeps\n * exactly the single-phase behaviour every MongoDB application already has.\n */\n appDatabaseSeeding: z.enum(AppDatabaseSeedingPhase).optional(),\n /**\n * Authored `serviceAuth` projection from `wildo.infra.<env>.config.ts`,\n * threaded by the CLI so apps-manager can seed\n * `Wildo_Application_Config.jwt.{accessTokenExpirationMinutes,\n * refreshTokenExpirationDays}` from the operator's policy instead of a\n * hardcoded constant. When omitted (older CLI, or infra file that does\n * not author `serviceAuth`), apps-manager applies the\n * `WildoAuthConfigSchema` defaults (15 min / 30 days as of Auth-hardening\n * Slice A Step 5 on 2026-04-13; pre-Slice-A the access-token default\n * was 60 min) at init time via `WildoAuthConfigSchema.parse({})`.\n */\n serviceAuth: WildoAuthConfigSchema.optional(),\n /**\n * The application's authored broker vhost and storage bucket — see\n * {@link ApplicationBackingServiceAddressing} for why apps-manager must be told rather than read\n * them from its own env, and for the two meanings of absence.\n */\n backingServiceAddressing: ApplicationBackingServiceAddressingSchema.optional(),\n}) as z.ZodType<AdminAppInitializeRequest>;\n\nexport interface AdminAppInitializeTarget {\n slug: string;\n name?: string;\n appDatabaseName?: string;\n managedDeclaration: AdminAppManagedDeclaration;\n /**\n * The application's own persistence engine — identical semantics to\n * {@link AdminAppInitializeRequest.applicationDatabase}, per target.\n *\n * Added 2026-08-27. The batch envelope had no way to express it, so\n * `POST /admin/apps/initialize` could only ever register applications as MongoDB — the single-app\n * endpoint carried the selection and its batch sibling silently dropped it. One invariant, two\n * call sites, applied at one (`.claude/rules/invariant-call-site-enumeration.md`).\n *\n * ⚠️ Interface AND schema, always — the `as z.ZodType<AdminAppInitializeTarget>` cast below makes\n * a schema-only addition type-check while staying invisible to every consumer.\n */\n applicationDatabase?: { engine: DatabaseEngine; databaseName?: string };\n firstAdminSeed?: AppBootstrapFirstAdminSeed;\n serviceAuth?: WildoAuthConfig;\n /**\n * Per target, unlike `serviceAuth`'s shared-by-convention value: each application authors its own\n * vhost and bucket, so a batch-level field would reintroduce the one-owner defect it exists to fix.\n */\n backingServiceAddressing?: ApplicationBackingServiceAddressing;\n}\n\n/**\n * Per-target payload inside a batch admin initialization request.\n *\n * `managedDeclaration` is required for the same contract reason as in\n * `AdminAppInitializeRequestSchema`. Admin identity lives at the batch\n * envelope level (one admin user across all targets), not per target.\n */\nexport const AdminAppInitializeTargetSchema = z.object({\n slug: z.string().min(1),\n name: z.string().min(1).optional(),\n appDatabaseName: z.string().min(1).optional(),\n managedDeclaration: AdminAppManagedDeclarationSchema,\n /**\n * Per-target application persistence selection. Same shape and same meaning as\n * {@link AdminAppInitializeRequestSchema}'s field of this name — read that one for why the\n * selection must be authored rather than inferred from which backing services are declared.\n */\n applicationDatabase: z.object({\n engine: z.enum(DatabaseEngine),\n databaseName: z.string().min(1).optional(),\n }).optional(),\n firstAdminSeed: AppBootstrapFirstAdminSeedSchema.optional(),\n /**\n * Per-target `serviceAuth` projection. Today every target in a batch\n * shares the same infra-authored `serviceAuth` (one infra file per env),\n * but the field is per-target rather than batch-level so a future\n * targeted override (e.g. preview-app with a longer access TTL) can land\n * without breaking the contract. See\n * {@link AdminAppInitializeRequestSchema.serviceAuth} for full semantics.\n */\n serviceAuth: WildoAuthConfigSchema.optional(),\n /** Per-target addressing — see {@link AdminAppInitializeTarget.backingServiceAddressing}. */\n backingServiceAddressing: ApplicationBackingServiceAddressingSchema.optional(),\n}) as z.ZodType<AdminAppInitializeTarget>;\n\n/**\n * Whether a stated approver identity is WHOLE, ABSENT, or a half-filled mistake (#575).\n *\n * A named vocabulary because the three answers have three different remedies, and two of them are\n * easy to conflate: ABSENT is legitimate everywhere (a deployment provisioned before the approver\n * contract existed states nothing, and every boot re-runs INIT), while PARTIAL is an operator\n * mistake that must be named at the door where it was made.\n */\nexport enum ApproverIdentityCompleteness {\n /** All three identity fields present. Provisioning seeds a second administrator. */\n WHOLE = 'whole',\n /** None present. Provisioning proceeds with ONE administrator and says so. */\n ABSENT = 'absent',\n /** Some present. Refused — see {@link classifyApproverIdentity}. */\n PARTIAL = 'partial',\n}\n\nexport type ApproverIdentityClassification =\n | { completeness: ApproverIdentityCompleteness.WHOLE; email: string; firstName: string; lastName: string }\n | { completeness: ApproverIdentityCompleteness.ABSENT }\n | { completeness: ApproverIdentityCompleteness.PARTIAL; missing: string[] };\n\n/**\n * ONE definition of \"all four or none\" for the second administrator, shared by every door that\n * reads one (#575).\n *\n * ## Why it classifies rather than throws\n *\n * The callers owe different answers. An HTTP door refuses with a VALIDATION error naming the missing\n * fields, because an operator is present and the mistake is theirs. The INIT boot path cannot refuse\n * at all — a platform provisioned before this existed states nothing, and INIT runs on every boot, so\n * refusing there would make it unbootable with a remedy that needs the process that just refused\n * (`continuity-drift-and-cas-basis.md` Rule 3). Returning the classification lets each site apply the\n * response it owes rather than inheriting one.\n *\n * ## Why `password` is not part of the test\n *\n * It is GENERATED when omitted, exactly as `userPassword` is for the primary administrator. Requiring\n * it would make the only stated-identity door harder to use than the one it mirrors, for no gain: a\n * generated password is reset through the ordinary flow.\n */\nexport function classifyApproverIdentity(input: {\n email?: string | undefined;\n firstName?: string | undefined;\n lastName?: string | undefined;\n}): ApproverIdentityClassification {\n const present = (value: string | undefined): boolean => typeof value === 'string' && value.trim().length > 0;\n const stated = [\n ['email', input.email],\n ['firstName', input.firstName],\n ['lastName', input.lastName],\n ] as const;\n\n const missing = stated.filter(([, value]) => !present(value)).map(([field]) => field);\n if (missing.length === stated.length) return { completeness: ApproverIdentityCompleteness.ABSENT };\n if (missing.length > 0) return { completeness: ApproverIdentityCompleteness.PARTIAL, missing };\n return {\n completeness: ApproverIdentityCompleteness.WHOLE,\n email: input.email as string,\n firstName: input.firstName as string,\n lastName: input.lastName as string,\n };\n}\n\nexport interface AdminAppsInitializeBatchRequest {\n override?: boolean;\n userEmail: string;\n userFirstName: string;\n userLastName: string;\n userPassword?: string;\n /**\n * The SECOND administrator (#575), envelope-level like the primary identity and for the same\n * reason: the seeded administrators are shared across every target.\n *\n * Carried on the BATCH door as well as the single one because they are two hand-written copies of\n * one contract — the shape `invariant-call-site-enumeration.md` #23 records. A batch that\n * provisioned one administrator while the single door provisioned two would leave whichever\n * applications went through it unable to approve their own application-wide reads.\n */\n approverEmail?: string;\n approverFirstName?: string;\n approverLastName?: string;\n approverPassword?: string;\n targets: AdminAppInitializeTarget[];\n}\n\n/**\n * Batch admin initialization envelope. Admin identity is required at the\n * envelope level (the seeded admin user is shared across all targets).\n */\nexport const AdminAppsInitializeBatchRequestSchema = z.object({\n override: z.boolean().optional(),\n userEmail: z.email(),\n userFirstName: z.string().min(1),\n userLastName: z.string().min(1),\n userPassword: z.string().min(1).optional(),\n approverEmail: z.email().optional(),\n approverFirstName: z.string().min(1).optional(),\n approverLastName: z.string().min(1).optional(),\n approverPassword: z.string().min(1).optional(),\n targets: z.array(AdminAppInitializeTargetSchema).min(1),\n}) as z.ZodType<AdminAppsInitializeBatchRequest>;\n\nexport interface AdminAppReapplyDeclarationRequest {\n managedDeclaration: AdminAppManagedDeclaration;\n /**\n * Report what a reapply WOULD change and write nothing (issue #97).\n *\n * This is the comparison primitive behind every \"is the stored config still what the\n * application declares?\" question — the init postcondition and the `wildo local doctor`\n * drift check both ask it this way rather than each re-implementing an authored-vs-stored\n * differ. One comparison, one place it can be wrong.\n *\n * Optional and defaulting to a real reapply, so an existing caller keeps its behaviour: a flag\n * that silently turned writes into no-ops would be a far worse failure than the invisibility it\n * exists to cure.\n */\n dryRun?: boolean;\n}\n\n/**\n * Shared success response for a single app initialization request.\n */\nexport const AdminAppInitializeResponseSchema = z.object({\n success: z.literal(true),\n application: z.object({\n name: z.string().min(1),\n slug: z.string().min(1),\n }),\n credentials: z.object({\n email: z.email(),\n password: z.string().min(1),\n }),\n /**\n * What provisioning did about the application's own bootstrap rows — see\n * {@link AppDatabaseSeedingOutcome}.\n *\n * OPTIONAL so a CLI can still parse a response from an apps-manager that predates the two-phase\n * contract. A caller that DEPENDS on the two-phase flow must treat absence as \"unknown\" and say\n * so, never as `SEEDED`.\n */\n appDatabaseSeeding: z.enum(AppDatabaseSeedingOutcome).optional(),\n});\n\n/**\n * Shared admin request payload for reapplying the `wildo.saas.config.ts`\n * declaration projection (`AdminAppManagedDeclaration`) onto an\n * already-initialized application.\n *\n * Contract semantics — what this endpoint owns:\n * - Re-source the declaration-managed slices of `Wildo_Application_Config`\n * from the new declaration: `appIdentity` display fields,\n * `frontendServices` seed, `engineCapabilities`, `providers`, and\n * `providerConfigurations`.\n * - Return a `updatedFields` diff so the caller can surface what changed.\n *\n * Contract semantics — what this endpoint deliberately does NOT touch:\n * - Credentials (DB users, JWT private keys, session secrets, admin\n * passwords). Those live in `Wildo_Application_Secrets` and are owned\n * by initialize / rotate flows.\n * - Database / infrastructure provisioning. Those are owned by\n * `/admin/apps/:appSlug/initialize` and the platform-init flow.\n * - K8s endpoints. Those are owned by\n * `/admin/apps/:appSlug/refresh` (config refresh) and the deploy flow.\n * - First-admin seeding (`firstAdminSeed`). User/role seeding happens\n * at init time only. Reapplying the declaration is a config-drift\n * operation; silently changing seeded role grants would be a\n * security regression. Callers wanting to change admin user types\n * must use a dedicated admin-management endpoint (not this one).\n *\n * Stable action identifier: `apps.reapply-declaration` (see\n * {@link APPS_REAPPLY_DECLARATION_ACTION_ID} in `bootstrap.contracts.ts`).\n * The CI/CD admin rights workstream (Step 8) reuses this identifier in\n * its permission grid so this endpoint can be granted independently\n * from the broader `apps.initialize` action.\n */\nexport const AdminAppReapplyDeclarationRequestSchema = z.strictObject({\n managedDeclaration: AdminAppManagedDeclarationSchema,\n dryRun: z.boolean().optional(),\n}) as z.ZodType<AdminAppReapplyDeclarationRequest>;\n\n/**\n * Shared success response for a managed-declaration reapply request.\n *\n * `updatedFields` lists the dot-paths of the declaration-projection\n * slices that actually changed (e.g. `appIdentity.displayName`,\n * `frontendServices`, `engineCapabilities`, `providers`).\n * An empty list means the stored config already matched the new\n * declaration — the operation is idempotent.\n *\n * When `dryRun` is `true` the same list describes what WOULD change; nothing\n * was written. An empty `updatedFields` under `dryRun` is therefore a positive\n * coherence proof: the stored config matches the declaration right now.\n */\nexport const AdminAppReapplyDeclarationResponseSchema = z.object({\n success: z.literal(true),\n appSlug: z.string().min(1),\n updatedFields: z.array(z.string()),\n appliedAt: z.string().datetime(),\n /**\n * Whether this response describes a PREVIEW or an APPLIED change.\n *\n * REQUIRED rather than optional, and echoed from the request rather than assumed by the\n * caller: `updatedFields` reads identically in both modes, so `['providerConfigurations']`\n * means two opposite things depending on this flag. A caller that cannot tell them apart may\n * report \"reapplied\" for a run that changed nothing on the server. Issue #97 is what a\n * silently implicit answer to \"did this actually take?\" costs.\n */\n dryRun: z.boolean(),\n});\n\nexport type AppBootstrapCredentials = z.infer<typeof AppBootstrapCredentialsSchema>;\nexport type AppBootstrapCredentialsResponse = z.infer<typeof AppBootstrapCredentialsResponseSchema>;\nexport type AppBootstrapFirstAdminSeed = z.infer<typeof AppBootstrapFirstAdminSeedSchema>;\nexport type AdminAppInitializeResponse = z.infer<typeof AdminAppInitializeResponseSchema>;\nexport type AdminAppReapplyDeclarationResponse = z.infer<typeof AdminAppReapplyDeclarationResponseSchema>;\n"]}
1
+ {"version":3,"file":"bootstrap.schemas.js","sourceRoot":"","sources":["../../../../src/bootstrap/bootstrap.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0CAA0C,EAE1C,4BAA4B,EAE5B,6BAA6B,E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IAClC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC;;;;;;;;OAQG;IACH,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC","sourcesContent":["import {\n AppConfiguration_Shared_AppIdentity_Schema,\n type AppConfiguration_Shared_AppIdentity,\n FrontendServicesConfigSchema,\n type FrontendServicesConfig,\n OrganizationTypesConfigSchema,\n type OrganizationTypesConfig,\n SystemsOfRecordConfigSchema,\n type SystemsOfRecordConfig,\n RuntimeEnvironment,\n} from '@wildo-ai/saas-models';\nimport { z } from 'zod';\nimport {\n EngineCapabilityActivationsSchema,\n MinionPlatformAccessCarriedSchema,\n MinionResourceAccessSchema,\n ProviderConfigurationsSchema,\n SaasConfigProvidersBlockSchema,\n type EngineCapabilityActivations,\n type MinionPlatformAccessCarried,\n type MinionResourceAccess,\n type ProviderConfigurations,\n type SaasConfigProvidersBlock,\n} from '../project-config/define-saas-config';\nimport {\n AppFrontendType,\n DataAccessSchema,\n ResourceLimitsSchema,\n WorkerRuntimeSchema,\n} from '../project-config/shared/service-definitions.schemas';\nimport {\n WorkerAuthSchema,\n WorkerHttpSchema,\n} from '../project-config/define-worker-config';\nimport { WildoAuthConfigSchema } from '../project-config/shared/auth.schemas';\nimport { DatabaseEngine } from '../project-config/shared/environment.schemas';\nimport { BackingServiceKind, BackingServiceSource } from '../project-config/shared/backing-services.schemas';\nimport type { BackingServiceProviderSelection } from '../project-config/shared/backing-service-servability';\n\n/**\n * Shared bootstrap execution mode.\n * The workflow semantics stay the same; only the executor differs.\n */\nexport enum BootstrapExecutorKind {\n LOCAL = 'local',\n REMOTE = 'remote',\n}\n\n/**\n * Shared bootstrap step identifiers.\n * These represent semantic workflow stages, not package-specific implementation details.\n */\nexport enum BootstrapStepId {\n INITIALIZE_PLATFORM = 'initialize-platform',\n ENSURE_APPLICATION = 'ensure-application',\n FETCH_BOOTSTRAP_CREDENTIALS = 'fetch-bootstrap-credentials',\n GENERATE_RUNTIME_ARTIFACTS = 'generate-runtime-artifacts',\n START_LOCAL_RUNTIME = 'start-local-runtime',\n}\n\n/**\n * Minimum bootstrap credentials required for an application backend to authenticate\n * with apps-manager and fetch its full runtime configuration.\n */\nexport const AppBootstrapCredentialsSchema = z.object({\n APPLICATION_ID: z.string().min(1),\n PLATFORM_APPLICATION_PRIMARY_SECRET: z.string().min(1),\n PLATFORM_APPS_MANAGER_URL: z.url(),\n APPLICATION_ENV: z.enum(RuntimeEnvironment),\n /**\n * The application's slug, carried beside the other identity keys because it becomes an env var on\n * every application runtime exactly as they do (#1177).\n *\n * It rides HERE rather than being threaded through each env builder's argument list because every\n * builder that needs it already receives this object — and because the envelope around it already\n * carries `appSlug`, so apps-manager has nothing new to look up.\n */\n APPLICATION_SLUG: z.string().min(1),\n});\n\n/**\n * Shared response envelope returned by apps-manager when bootstrap credentials are requested.\n * Both apps-manager and CLI should rely on this same contract.\n * `environment` / `APPLICATION_ENV` describe runtime semantics for the\n * bootstrapped application process, not the project-level remote environment id.\n */\nexport const AppBootstrapCredentialsResponseSchema = z.object({\n success: z.literal(true),\n appSlug: z.string().min(1),\n environment: z.enum(RuntimeEnvironment),\n credentials: AppBootstrapCredentialsSchema,\n});\n\nexport interface AdminAppManagedDeclaration {\n app: {\n name: string;\n slug: string;\n displayName: string;\n description?: string;\n type: 'saas';\n };\n frontendServices: Array<{\n serviceName: string;\n frontendType: AppFrontendType;\n }>;\n minions: Record<string, {\n resourceAccess?: MinionResourceAccess;\n /** R4/R5 — what this minion may read about ITSELF at the platform level. Absent ⇒ nothing. */\n platformAccess?: MinionPlatformAccessCarried;\n /** KD-12 — `'cron'` minions paired with a `schedule` produce MINION_TICK CronJob records. */\n mode?: 'always-up' | 'cron';\n schedule?: string;\n }>;\n workers: Record<string, {\n name: string;\n displayName: string;\n description?: string;\n runtime: {\n type: string;\n language: string;\n };\n http: {\n port: number;\n healthPath: string;\n readyPath: string;\n metricsPath?: string;\n };\n auth: 'wildo-jwt';\n replicas: number;\n resources?: {\n cpu?: string;\n memory?: string;\n };\n dataAccess?: {\n database?: 'read-only' | 'read-write' | 'none';\n cache?: boolean;\n queue?: 'consumer' | 'producer' | 'both' | 'none';\n };\n }>;\n engineCapabilities: EngineCapabilityActivations;\n providers: SaasConfigProvidersBlock;\n providerConfigurations: ProviderConfigurations;\n /** AUTHORITATIVE bucket — see `AdminAppManagedDeclarationSchema`. Required, at least one. */\n organizationTypes: OrganizationTypesConfig;\n /**\n * AUTHORITATIVE bucket — the application's declared systems of record (#1055). OPTIONAL, unlike its\n * sibling above: an application that reads nothing out of another system declares none.\n */\n systemsOfRecord?: SystemsOfRecordConfig;\n}\n\n/**\n * The managed minion inventory as it travels the apps-manager wire — the ONE runtime source for\n * that block, in both directions.\n *\n * ## Why this is exported rather than module-private\n *\n * It is reached at three places in this file (`AdminAppManagedDeclarationSchema` for the CLI's\n * declaration, `AppBootstrapConfigMetadataResponseSchema` for what a backend fetches at boot), and\n * — since 2026-09-09 — by the application backend's configuration loader in\n * `@wildo-ai/saas-backend-lib`, which used to re-declare the block by hand.\n *\n * That hand copy is the reason this export exists, and the cost is measured rather than\n * hypothetical. A consumer-side copy of a wire block is parsed with Zod's strip-unknown semantics,\n * so a field added HERE and not mirrored THERE does not fail — it is silently deleted from the\n * payload on the way in. It happened twice: `mode` / `schedule` (the KD-12 cron-tick path, which\n * left every scheduled minion's MINION_TICK CronJob registration dead in production while the wire\n * carried the data correctly) and then `platformAccess`, added the same way and stripped the same\n * way. Neither surfaced as an error anywhere.\n *\n * Exporting the block costs nothing: `@wildo-ai/platform-config-lib`'s root index already\n * re-exports this module, and the engine already imports that root, so no consumer's module graph\n * changes — only the number of hand-maintained copies of this shape does.\n *\n * The engine keeps its OWN `AppConfiguration_MinionsSchema` (a `strictObject` typed against a named\n * interface, for the TS7056 serialization-ceiling reason documented there) and does NOT collapse\n * onto this one. The two are held in step by a mechanical field-parity pin in\n * `engine/saas-backend-lib/src/config/__tests__/managed-runtime-inventory-parity.backend.test.ts`,\n * so the remaining duplication cannot drift in silence the way this one did.\n */\nexport const AdminAppManagedMinionsSchema = z.record(\n z.string().min(1),\n z.object({\n resourceAccess: MinionResourceAccessSchema.optional(),\n /**\n * R4/R5 platform-access axis. Independent of `resourceAccess` (D12) — a\n * minion may hold either, both, or neither. apps-manager reads this to\n * decide whether to mint a principal-scoped attestation at all, and\n * `buildOwnCronRecordFilter` reads it to decide whether the minion has any\n * subject to query WITH, so a field dropped here confers nothing no matter\n * what the author wrote.\n */\n platformAccess: MinionPlatformAccessCarriedSchema.optional(),\n /**\n * KD-12 cron-tick path. When `mode === 'cron'` and `schedule` is\n * provided, the backend-api's `cron-job-sync.backend.service.ts`\n * registers a `MINION_TICK` CronJob record on\n * `platform-crontabs-batches-manager` so the per-minion queue\n * (`wildo.queue.{appId}.minion-tick.{minionName}`) actually fires\n * on schedule.\n */\n mode: z.enum(['always-up', 'cron']).optional(),\n schedule: z.string().min(1).optional(),\n }),\n).default({});\n\n/**\n * The managed worker inventory as it travels the apps-manager wire. Exported for the same reason as\n * `AdminAppManagedMinionsSchema` above, and held in step with the engine's\n * `AppConfiguration_WorkersSchema` by the same parity pin — read that JSDoc before changing either.\n */\nexport const AdminAppManagedWorkersSchema = z.record(\n z.string().min(1),\n z.object({\n name: z.string().min(1),\n displayName: z.string().min(1),\n description: z.string().optional(),\n runtime: WorkerRuntimeSchema,\n http: WorkerHttpSchema,\n auth: WorkerAuthSchema,\n replicas: z.number().int().positive(),\n resources: ResourceLimitsSchema.optional(),\n dataAccess: DataAccessSchema.optional(),\n }),\n).default({});\n\n/**\n * Admin-side projection of `wildo.saas.config.ts` carried from the CLI to\n * apps-manager at app initialization / re-apply time.\n *\n * Cross-bucket trust asymmetry (Slice 3 closeout):\n * Fields in this schema fall into TWO TRUST BUCKETS that the apps-manager\n * treats differently:\n *\n * 1. AUTHORITATIVE bucket (always honored, write-through):\n * - `app.name` / `app.slug` / `app.displayName` / `app.description`\n * — `appIdentity` core (F-53 swap: `app.name` is the canonical\n * identifier, `app.displayName` is the UI label only).\n * - `frontendServices` — frontend service registry (consumed by\n * `_merge_WildoApplicationConfig` to materialise endpoints).\n * - `minions` — minion runtime inventory, currently carrying the\n * per-minion `resourceAccess` authority whitelist used by\n * `start-minion-application`.\n * - `workers` — worker runtime inventory persisted by apps-manager so\n * the control-plane can validate worker identity and serve the\n * worker bootstrap contract without re-reading authored files.\n * - `engineCapabilities`, `providers`, and `providerConfigurations`\n * — the provider runtime graph and its non-secret settings.\n * - `organizationTypes` — the tenancy model (#1032, 2026-09-14). It\n * joined this bucket rather than staying backend-authored because\n * apps-manager SEEDS the first administrator's organization and must\n * derive that organization's type from these declarations; the\n * backend cannot publish what the platform needs before the backend\n * exists. Write-through like its siblings: the stored config is\n * replaced by the declaration on every init and re-apply.\n * - `systemsOfRecord` — the named instances of the systems this\n * application reads its own business rows out of (#1055). It is in\n * this bucket because the environment-variable names carrying each\n * instance's address and secrets are DERIVED from the declaration,\n * and the platform and the CLI derive them too — so the declaration,\n * not a backend-authored copy, has to be what travels.\n *\n * 2. POLICY bucket (governed by override semantics):\n * - currently empty for provider registration. Capability activation\n * is authored as `engineCapabilities`, while provider routing is\n * materialized into `providers`.\n *\n * What is intentionally NOT here (out of bucket):\n * - JWT TTLs (`accessTokenExpirationMinutes`/`refreshTokenExpirationDays`)\n * travel via the SIBLING field `serviceAuth` on the request envelope\n * (see `AdminAppInitializeRequestSchema.serviceAuth`), NOT here.\n * This separation reflects that JWT TTLs are infra-environment policy\n * sourced from `wildo.infra.<env>.config.ts`, while\n * `managedDeclaration` projects the application-level\n * `wildo.saas.config.ts`.\n * - `dataServices.*` (Redis key prefix, S3 bucket prefix, etc.) — these\n * flow through `PlatformEnvConfigJson` env wiring, not the admin\n * declaration. The declaration carries application-level semantics\n * only.\n *\n * If you ADD a field, decide explicitly which bucket it belongs to and\n * document it in the merge service's JSDoc — silently widening the\n * declaration without consumer-side handling is the documented failure\n * mode this comment exists to prevent.\n */\nexport const AdminAppManagedDeclarationSchema = z.object({\n app: z.object({\n name: z.string().min(1),\n slug: z.string().min(1),\n displayName: z.string().min(1),\n description: z.string().optional(),\n type: z.literal('saas'),\n }),\n frontendServices: z.array(z.object({\n serviceName: z.string().min(1),\n frontendType: z.enum(AppFrontendType),\n })).default([]),\n minions: AdminAppManagedMinionsSchema,\n workers: AdminAppManagedWorkersSchema,\n engineCapabilities: EngineCapabilityActivationsSchema,\n providers: SaasConfigProvidersBlockSchema,\n providerConfigurations: ProviderConfigurationsSchema,\n organizationTypes: OrganizationTypesConfigSchema,\n systemsOfRecord: SystemsOfRecordConfigSchema.optional(),\n}) as z.ZodType<AdminAppManagedDeclaration>;\n\n/**\n * WHEN an application's OWN database gets its bootstrap rows, relative to the schema those rows need.\n *\n * ## The circularity this vocabulary exists to break\n *\n * On MongoDB, seeding an application's database needed no schema — a collection springs into being on\n * first write — so provisioning could create the database and its first rows in one uninterrupted\n * step. PostgreSQL removed that luxury and exposed a genuine cycle that had always been latent:\n *\n * - apps-manager seeds the application's database during provisioning;\n * - those rows need tables, which come from the application's OWN `migrations/` directory;\n * - those migrations are applied by the application backend at boot\n * (`applyStartupPostgresMigrations`, the production door);\n * - and the backend cannot boot until it is seeded, because its execution-context creator requires\n * exactly one APPLICATION row.\n *\n * Nothing inside that circle can break it. apps-manager cannot read the application's migration files\n * — in production they ship inside the application's own image — and the backend cannot supply the\n * seed, which is authored in `wildo.saas.config.ts`. Only the DEPLOY TOOLING holds both, which is why\n * this is a two-phase contract rather than a retry, a tolerance, or a longer timeout.\n *\n * Observed 2026-08-23 on the first PostgreSQL install: provisioning aborted with\n * `relation \"applications\" does not exist`, and `wildo local dev` failed. The same order holds on\n * every lane, so per-application PostgreSQL provisioning had never completed anywhere.\n *\n * ## Why a request field rather than an inferred tolerance\n *\n * Making apps-manager silently skip seeding when the schema happens to be absent would be a\n * fail-open: provisioning would report success having left the application unbootable, and the caller\n * would have no way to tell a deferred seed from a completed one. The caller states its intent, and\n * the response states what happened — see {@link AppDatabaseSeedingOutcome}.\n */\nexport enum AppDatabaseSeedingPhase {\n /**\n * Seed now. The default, and the ONLY behaviour any pre-2026-08-23 caller can produce, so every\n * MongoDB lane and every older CLI is unchanged.\n */\n REQUIRED = 'REQUIRED',\n /**\n * Provision infrastructure and platform records, but do NOT seed the application's own database —\n * the caller is about to create its schema and will then re-invoke with {@link REQUIRED}.\n */\n DEFERRED = 'DEFERRED',\n}\n\n/**\n * What provisioning actually DID about the application's own bootstrap rows.\n *\n * Reported so a caller can never mistake a deferred seed for a completed one. The CLI treats\n * {@link DEFERRED} as expected on its first phase and FATAL on its second — an application that is\n * still unseeded after its migrations have been applied is a defect, not a state to tolerate.\n */\nexport enum AppDatabaseSeedingOutcome {\n /** Bootstrap rows exist in the application's own database. */\n SEEDED = 'SEEDED',\n /** Skipped because the caller asked for {@link AppDatabaseSeedingPhase.DEFERRED}. */\n DEFERRED = 'DEFERRED',\n /**\n * Skipped because the application has no resolved persistence target. Distinct from\n * {@link DEFERRED}: nothing the caller does next will seed it — the target itself is missing.\n */\n NO_PERSISTENCE_TARGET = 'NO_PERSISTENCE_TARGET',\n}\n\nexport const AppBootstrapFirstAdminSeedSchema = z.object({\n userTypes: z.array(z.string().min(1)).min(1),\n});\n\nconst AppBootstrapRotatedPublicKeyEntrySchema = z.object({\n kid: z.string().min(1),\n publicKey: z.string().min(1),\n /** Last observation/token instant this retired key may authenticate. */\n notAfter: z.coerce.date().optional(),\n});\n\nexport interface AppBootstrapConfigMetadataResponse {\n appSlug: string;\n appIdentity?: AppConfiguration_Shared_AppIdentity;\n frontendServices?: FrontendServicesConfig;\n minions?: Record<string, {\n resourceAccess?: MinionResourceAccess;\n /** R4/R5 — what this minion may read about ITSELF at the platform level. Absent ⇒ nothing. */\n platformAccess?: MinionPlatformAccessCarried;\n /** KD-12 — `'cron'` minions paired with a `schedule` produce MINION_TICK CronJob records. */\n mode?: 'always-up' | 'cron';\n schedule?: string;\n }>;\n workers?: Record<string, {\n name: string;\n displayName: string;\n description?: string;\n runtime: {\n type: string;\n language: string;\n };\n http: {\n port: number;\n healthPath: string;\n readyPath: string;\n metricsPath?: string;\n };\n auth: 'wildo-jwt';\n replicas: number;\n resources?: {\n cpu?: string;\n memory?: string;\n };\n dataAccess?: {\n database?: 'read-only' | 'read-write' | 'none';\n cache?: boolean;\n queue?: 'consumer' | 'producer' | 'both' | 'none';\n };\n }>;\n engineCapabilities?: EngineCapabilityActivations;\n providers?: SaasConfigProvidersBlock;\n /** The application's organization types, as its declaration stored them (#1032). See the schema field. */\n organizationTypes?: OrganizationTypesConfig;\n /** The application's systems of record, as its declaration stored them (#1055). See the schema field. */\n systemsOfRecord?: SystemsOfRecordConfig;\n email?: {\n isTransactionalWildoManaged: boolean;\n isMarketingWildoManaged: boolean;\n };\n providerConfigurations: ProviderConfigurations;\n jwt?: {\n publicKey: Record<string, string>;\n rotatedPublicKeys?: Record<string, Array<z.infer<typeof AppBootstrapRotatedPublicKeyEntrySchema>>>;\n accessTokenExpirationMinutes: number;\n refreshTokenExpirationDays: number;\n };\n}\n\nexport const AppBootstrapConfigMetadataResponseSchema = z.object({\n appSlug: z.string().min(1),\n appIdentity: AppConfiguration_Shared_AppIdentity_Schema.optional(),\n frontendServices: FrontendServicesConfigSchema.optional(),\n minions: AdminAppManagedMinionsSchema.optional(),\n workers: AdminAppManagedWorkersSchema.optional(),\n engineCapabilities: EngineCapabilityActivationsSchema.optional(),\n providers: SaasConfigProvidersBlockSchema.optional(),\n /**\n * The application's organization types (#1032). A running backend refuses to start without them, and this\n * response is the only road from the stored declaration to the backend — so a section missing HERE is not\n * rejected, it is deleted between apps-manager and the application, and the backend refuses a configuration\n * whose stored document is correct. That is what happened the first time the refusal met a real stack.\n * Optional on the wire because a stored document written before the declaration carried it still answers.\n */\n organizationTypes: OrganizationTypesConfigSchema.optional(),\n /**\n * The application's systems of record (#1055). Declared HERE for the same reason as its sibling\n * above, and it is the reason worth repeating: every schema on this road is a plain `z.object`, so a\n * section missing here is not rejected — it is DELETED between apps-manager and the application, and\n * the backend then boots believing the application declares none.\n */\n systemsOfRecord: SystemsOfRecordConfigSchema.optional(),\n email: z.object({\n isTransactionalWildoManaged: z.boolean(),\n isMarketingWildoManaged: z.boolean(),\n }).optional(),\n providerConfigurations: ProviderConfigurationsSchema,\n jwt: z.object({\n publicKey: z.record(z.string(), z.string()),\n rotatedPublicKeys: z.record(\n z.string(),\n z.array(AppBootstrapRotatedPublicKeyEntrySchema),\n ).optional(),\n /**\n * Operator-authored JWT TTLs (Slice 3.3 hardening, F-24 / closeout).\n *\n * Sourced from `Wildo_Application_Config.jwt.{accessTokenExpirationMinutes,\n * refreshTokenExpirationDays}` (which itself was seeded from\n * `serviceAuth` in `wildo.infra.<env>.config.ts` at apps-manager init\n * time, falling back to `WildoAuthConfigSchema` defaults of 15 min /\n * 30 days when omitted \\u2014 access-token default tightened from 60\n * \\u2192 15 in Auth-hardening Slice A Step 5 on 2026-04-13; see the\n * file-level JSDoc on `auth.schemas.ts` for the threat-model rationale).\n * The application backend MUST consume these values at sign time\n * (`AuthTokenIssuerBackendService.issueAccessToken`,\n * `JwtBackendService.createRefreshToken`) instead of falling back to\n * developer-authored constants in `saas-config.backend.ts`.\n *\n * REQUIRED on the response (Slice 3 closeout): `_getDefault_WildoApplicationConfig`\n * always seeds these via `WildoAuthConfigSchema.parse(serviceAuth ?? {})`\n * (15 min / 30 days defaults), so any persisted\n * `Wildo_Application_Config.jwt` block has both fields populated.\n * Marking them required here lets the consumer\n * (`app-configuration-loader.backend.service.ts`) drop the\n * `accessTokenExpirationMinutes !== undefined ? ... : {}` defensive\n * spread and treat them as guaranteed values.\n */\n accessTokenExpirationMinutes: z.number().int().positive(),\n refreshTokenExpirationDays: z.number().int().positive(),\n }).optional(),\n}) as z.ZodType<AppBootstrapConfigMetadataResponse>;\n\nexport interface AppWorkerBootstrapResponse {\n appSlug: string;\n workerName: string;\n worker: z.infer<typeof AdminAppManagedWorkersSchema>[string];\n jwt: {\n publicKey: string;\n rotatedPublicKeys?: Array<z.infer<typeof AppBootstrapRotatedPublicKeyEntrySchema>>;\n };\n}\n\nexport const AppWorkerBootstrapResponseSchema = z.object({\n appSlug: z.string().min(1),\n workerName: z.string().min(1),\n worker: z.object({\n name: z.string().min(1),\n displayName: z.string().min(1),\n description: z.string().optional(),\n runtime: WorkerRuntimeSchema,\n http: WorkerHttpSchema,\n auth: WorkerAuthSchema,\n replicas: z.number().int().positive(),\n resources: ResourceLimitsSchema.optional(),\n dataAccess: DataAccessSchema.optional(),\n }),\n jwt: z.object({\n publicKey: z.string().min(1),\n rotatedPublicKeys: z.array(AppBootstrapRotatedPublicKeyEntrySchema).optional(),\n }),\n}) as z.ZodType<AppWorkerBootstrapResponse>;\n\ntype WildoAuthConfig = z.infer<typeof WildoAuthConfigSchema>;\n\n/**\n * Where ONE application's broker and object storage live, as its environment authored them (#1107).\n *\n * ## Why apps-manager has to be TOLD\n *\n * Both values are authored per application — `backingServices.rabbitmq.vhost` and\n * `backingServices.s3.bucket` in `wildo.infra.<env>.config.ts` — and the CLI writes them into that\n * application's own backend env. apps-manager, which provisions the vhost grant and issues the storage\n * credential, used to read them from its OWN process env instead. That env is generated from whichever\n * application last ran a full `wildo local init`, so every other application registered on the same\n * platform (`wildo local init --register-only`) had its broker principal granted on the owner's vhost\n * and its storage credential confined to the owner's bucket, while its backend connected to its own:\n * a vhost that did not exist and a bucket nobody had created.\n *\n * ## The same projection as the application's env, by construction\n *\n * The CLI derives this with the one function that also writes `RABBITMQ_VHOST` / `STORAGE_BUCKET` into\n * the application backend env, so the value apps-manager provisions and the value the backend connects\n * with cannot be two spellings of one fact.\n *\n * ## Absence is refused, never substituted\n *\n * apps-manager refuses to provision a vhost grant or issue a storage credential for an application whose\n * addressing it was never told, naming the remedy (register the application again). Substituting its own\n * env would be this defect with a warning attached. Every `wildo local dev` start registers the\n * application before its backends spawn, so a recorded addressing is always in place by the time a backend\n * asks. `rabbitmqVhost` absent inside a sent object is different: the application authored no vhost and\n * uses the broker's default vhost `/`.\n */\nexport interface ApplicationBackingServiceAddressing {\n /** The authored broker virtual host. Absent means the default vhost `/`. */\n rabbitmqVhost?: string;\n /** The object-storage bucket the application backend reads and writes. Always known: it has a projected default. */\n objectStorageBucket: string;\n /**\n * Which provider serves each backing service the application's environment DECLARES (#1692). See\n * {@link ApplicationBackingServiceProviderDeclarations}.\n */\n declaredProviders?: ApplicationBackingServiceProviderDeclarations;\n}\n\n/**\n * The `(source, provider)` pair each backing-service kind declares in the environment an application registers\n * in — its `backingServices` block, reduced to the half that decides WHICH SERVER serves it (#1692).\n *\n * ## Why apps-manager has to be told\n *\n * apps-manager mints every backing-service credential an application receives. It used to choose the provider\n * from its OWN environment — MongoDB Atlas when an Atlas API key happened to be configured, self-hosted\n * otherwise — and minted Redis and RabbitMQ on the platform's own servers unconditionally. So an application\n * declaring `redis: { source: MANAGED }` got no Valkey workload (the generators honour `source`) and a Redis\n * ACL user on the PLATFORM's Redis: a credential for a server it never connects to. The catalogue of provider\n * modules could not change that either, because nothing selected a module from what the application declared.\n * This is the same \"apps-manager read its own env instead of being told\" defect as the vhost and bucket above.\n *\n * ## Why the DECLARATION travels, not the resolved `InfraProvider`\n *\n * apps-manager resolves each entry with the SAME `resolveInfraProvider` the lockfile's infra section uses, so\n * the provider it dispatches on and the provider the lockfile records are one function's answer. Sending the\n * resolved provider instead would make a declaration that resolves to NOTHING — `redis: { source: MANAGED }`\n * has no `InfraProvider` member — indistinguishable from a kind that is not declared, and \"not declared\" keeps\n * the old behaviour, which is exactly the platform-server mint this contract exists to end. Carrying the pair\n * keeps \"declared, unservable\" representable so apps-manager can REFUSE it, naming what was declared.\n *\n * ## The meanings of absence\n *\n * - The whole map absent (a CLI predating #1692, or the platform's own application registered by INIT mode):\n * every kind keeps its previous behaviour.\n * - One kind absent from a sent map (the environment does not declare it): that kind alone keeps its previous\n * behaviour — self-hosted on the platform's own server, and for MongoDB Atlas-when-configured.\n *\n * ## A declaration is environment-wide; a mint is per application\n *\n * `backingServices` describes the environment, including stores only the PLATFORM uses (a self-hosted MongoDB\n * beside a PostgreSQL application, say). So apps-manager checks admin credentials only for the kinds it mints\n * for THIS application; a declared kind the application does not consume is checked only against the\n * catalogue, which the CLI has already done offline (#1693).\n */\nexport type ApplicationBackingServiceProviderDeclarations = Partial<Record<BackingServiceKind, BackingServiceProviderSelection>>;\n\nconst BackingServiceProviderSelectionSchema = z.object({\n source: z.enum(BackingServiceSource),\n provider: z.string().min(1).optional(),\n}).strict();\n\n/** Keyed by {@link BackingServiceKind}, total over it, each entry optional — see the type above. */\nexport const ApplicationBackingServiceProviderDeclarationsSchema = z.object(\n Object.fromEntries(\n Object.values(BackingServiceKind).map((kind) => [kind, BackingServiceProviderSelectionSchema.optional()]),\n ) as Record<BackingServiceKind, z.ZodOptional<typeof BackingServiceProviderSelectionSchema>>,\n).strict() as z.ZodType<ApplicationBackingServiceProviderDeclarations>;\n\nexport const ApplicationBackingServiceAddressingSchema = z.object({\n rabbitmqVhost: z.string().min(1).optional(),\n objectStorageBucket: z.string().min(1),\n declaredProviders: ApplicationBackingServiceProviderDeclarationsSchema.optional(),\n}).strict() as z.ZodType<ApplicationBackingServiceAddressing>;\n\nexport interface AdminAppInitializeRequest {\n name?: string;\n appDatabaseName?: string;\n override?: boolean;\n userEmail: string;\n userFirstName: string;\n userLastName: string;\n userPassword?: string;\n /**\n * The SECOND administrator (#575), when the deployment states one.\n *\n * `applicationAccessGrants.approve` is gated on `APP_ADMIN_SUPER_ADMIN` and refuses an approver\n * equal to the requester, with no auto-approval branch — so an application seeded with ONE\n * super-administrator cannot read any application-wide surface at all. Provisioning is where the\n * second one has to come from; nothing later mints it.\n *\n * ALL FOUR OR NONE. A partial set is an operator mistake rather than a request to fall back, and\n * the same reading `init.command.ts` already applies to partial `--admin-*` flags. Enforced by\n * `assertApproverIdentityIsWholeOrAbsent` at every door that reads one.\n */\n approverEmail?: string;\n approverFirstName?: string;\n approverLastName?: string;\n approverPassword?: string;\n managedDeclaration: AdminAppManagedDeclaration;\n /**\n * The application's own persistence engine — see the field's JSDoc on the schema below for why it\n * exists at all.\n *\n * ⚠️ This interface and that schema are TWO declarations of ONE contract, joined by the\n * `as z.ZodType<AdminAppInitializeRequest>` cast. The cast means a field added to only the schema\n * type-checks perfectly while being invisible to every CONSUMER — which is exactly what happened on\n * 2026-08-19: apps-manager's controller could not read `applicationDatabase` off a parsed request\n * though the schema accepted it. Add to BOTH, always.\n */\n applicationDatabase?: { engine: DatabaseEngine; databaseName?: string };\n firstAdminSeed?: AppBootstrapFirstAdminSeed;\n /**\n * WHEN to seed this application's own database. Absent means\n * {@link AppDatabaseSeedingPhase.REQUIRED} — see that enum for why the phase is stated rather\n * than inferred.\n */\n appDatabaseSeeding?: AppDatabaseSeedingPhase;\n serviceAuth?: WildoAuthConfig;\n /** See {@link ApplicationBackingServiceAddressing}. Interface AND schema, always. */\n backingServiceAddressing?: ApplicationBackingServiceAddressing;\n}\n\n/**\n * Shared admin request payload for a single app initialization.\n *\n * This describes the control-plane contract, independently of whether the\n * caller is the CLI or a future CI/CD executor.\n *\n * Required-by-contract fields:\n * - `managedDeclaration` — the projection of `wildo.saas.config.ts` that\n * seeds frontend services, capability policy, and external providers.\n * Omitting it would silently half-bootstrap an app, so the admin HTTP\n * boundary rejects requests without it.\n * - `userEmail` / `userFirstName` / `userLastName` — admin identity for\n * the seeded super-admin user. The previous implementation defaulted\n * these to a developer's personal identity, silently bypassing the\n * downstream `validateInitializationOptions` validation; that bypass\n * is now closed at the contract boundary.\n *\n * Optional-by-design fields:\n * - `userPassword` — the service auto-generates a secure password when\n * omitted (intentional one-shot bootstrap affordance).\n * - `name` / `appDatabaseName` / `override` / `firstAdminSeed` — caller\n * overrides; sensible defaults exist downstream.\n */\nexport const AdminAppInitializeRequestSchema = z.object({\n name: z.string().min(1).optional(),\n appDatabaseName: z.string().min(1).optional(),\n override: z.boolean().optional(),\n userEmail: z.email(),\n userFirstName: z.string().min(1),\n userLastName: z.string().min(1),\n userPassword: z.string().min(1).optional(),\n /**\n * The SECOND administrator (#575). Declared on BOTH the interface above and this schema — the\n * `as z.ZodType<AdminAppInitializeRequest>` cast means a field added to only one of them\n * type-checks perfectly and is invisible to every consumer, which is exactly what happened to\n * `applicationDatabase` on 2026-08-19.\n */\n approverEmail: z.email().optional(),\n approverFirstName: z.string().min(1).optional(),\n approverLastName: z.string().min(1).optional(),\n approverPassword: z.string().min(1).optional(),\n managedDeclaration: AdminAppManagedDeclarationSchema,\n /**\n * Which store this application's own resources persist to — mirrored from the authored\n * `applicationDatabase` in `wildo.infra.<env>.config.ts`, and carried under the SAME name so the\n * value is traceable end to end by one word.\n *\n * ## Why this field had to be added\n *\n * apps-manager already held the entire per-application PostgreSQL path: `mintAppCredentials`\n * provisioning the database, role and password, plus the `defaultAdapter` and `resourceIdFormat`\n * branches of the stored application config. All three were gated on\n * `WildoApplicationInitOptions.usePostgreSQL`, and on 2026-08-19 a repo-wide search found that flag\n * had FOUR mentions in the whole codebase — one declaration and three reads, in a single file.\n * **Nothing ever set it.**\n *\n * So the capability had no door. `backingServices.postgresql` had been authored for some time and\n * no application role ever appeared in `pg_roles`, because the declaration had no path to the\n * provisioner. This field is that path.\n *\n * OPTIONAL on the wire, and absence means POSTGRESQL — resolved by `resolveApplicationDatabaseEngine`\n * on the receiving side (#1571), the same answer the CLI gives. The current CLI always sends the\n * resolved engine; absence reaches apps-manager only from an older CLI or another door.\n */\n applicationDatabase: z.object({\n engine: z.enum(DatabaseEngine),\n /**\n * The AUTHORED database name, from `backingServices.postgresql.database`.\n *\n * Sent because two sources were naming this database and disagreeing: the provisioner derives\n * `wildo_<sanitized-slug>` while `env-vars-builder` emits the authored name as\n * `POSTGRESQL_DATABASE`. On 2026-08-19 that produced `wildo_wonder_todos` (owned by the app role)\n * beside `wonder-todos-db` (what the backend was told to connect to) — both empty, so the\n * application would have opened a database it did not own while its grants landed elsewhere.\n *\n * The authored value wins: it is the git-borne declaration, it is what the env already carries,\n * and the provisioner has always accepted an override — the caller simply never passed one.\n */\n databaseName: z.string().min(1).optional(),\n }).optional(),\n firstAdminSeed: AppBootstrapFirstAdminSeedSchema.optional(),\n /**\n * WHEN to seed this application's own database — see {@link AppDatabaseSeedingPhase}.\n *\n * OPTIONAL, and absence means `REQUIRED`, so a CLI that predates the two-phase contract keeps\n * exactly the single-phase behaviour every MongoDB application already has.\n */\n appDatabaseSeeding: z.enum(AppDatabaseSeedingPhase).optional(),\n /**\n * Authored `serviceAuth` projection from `wildo.infra.<env>.config.ts`,\n * threaded by the CLI so apps-manager can seed\n * `Wildo_Application_Config.jwt.{accessTokenExpirationMinutes,\n * refreshTokenExpirationDays}` from the operator's policy instead of a\n * hardcoded constant. When omitted (older CLI, or infra file that does\n * not author `serviceAuth`), apps-manager applies the\n * `WildoAuthConfigSchema` defaults (15 min / 30 days as of Auth-hardening\n * Slice A Step 5 on 2026-04-13; pre-Slice-A the access-token default\n * was 60 min) at init time via `WildoAuthConfigSchema.parse({})`.\n */\n serviceAuth: WildoAuthConfigSchema.optional(),\n /**\n * The application's authored broker vhost and storage bucket — see\n * {@link ApplicationBackingServiceAddressing} for why apps-manager must be told rather than read\n * them from its own env, and for the two meanings of absence.\n */\n backingServiceAddressing: ApplicationBackingServiceAddressingSchema.optional(),\n}) as z.ZodType<AdminAppInitializeRequest>;\n\nexport interface AdminAppInitializeTarget {\n slug: string;\n name?: string;\n appDatabaseName?: string;\n managedDeclaration: AdminAppManagedDeclaration;\n /**\n * The application's own persistence engine — identical semantics to\n * {@link AdminAppInitializeRequest.applicationDatabase}, per target.\n *\n * Added 2026-08-27. The batch envelope had no way to express it, so\n * `POST /admin/apps/initialize` could only ever register applications as MongoDB — the single-app\n * endpoint carried the selection and its batch sibling silently dropped it. One invariant, two\n * call sites, applied at one (`.claude/rules/invariant-call-site-enumeration.md`).\n *\n * ⚠️ Interface AND schema, always — the `as z.ZodType<AdminAppInitializeTarget>` cast below makes\n * a schema-only addition type-check while staying invisible to every consumer.\n */\n applicationDatabase?: { engine: DatabaseEngine; databaseName?: string };\n firstAdminSeed?: AppBootstrapFirstAdminSeed;\n serviceAuth?: WildoAuthConfig;\n /**\n * Per target, unlike `serviceAuth`'s shared-by-convention value: each application authors its own\n * vhost and bucket, so a batch-level field would reintroduce the one-owner defect it exists to fix.\n */\n backingServiceAddressing?: ApplicationBackingServiceAddressing;\n}\n\n/**\n * Per-target payload inside a batch admin initialization request.\n *\n * `managedDeclaration` is required for the same contract reason as in\n * `AdminAppInitializeRequestSchema`. Admin identity lives at the batch\n * envelope level (one admin user across all targets), not per target.\n */\nexport const AdminAppInitializeTargetSchema = z.object({\n slug: z.string().min(1),\n name: z.string().min(1).optional(),\n appDatabaseName: z.string().min(1).optional(),\n managedDeclaration: AdminAppManagedDeclarationSchema,\n /**\n * Per-target application persistence selection. Same shape and same meaning as\n * {@link AdminAppInitializeRequestSchema}'s field of this name — read that one for why the\n * selection must be authored rather than inferred from which backing services are declared.\n */\n applicationDatabase: z.object({\n engine: z.enum(DatabaseEngine),\n databaseName: z.string().min(1).optional(),\n }).optional(),\n firstAdminSeed: AppBootstrapFirstAdminSeedSchema.optional(),\n /**\n * Per-target `serviceAuth` projection. Today every target in a batch\n * shares the same infra-authored `serviceAuth` (one infra file per env),\n * but the field is per-target rather than batch-level so a future\n * targeted override (e.g. preview-app with a longer access TTL) can land\n * without breaking the contract. See\n * {@link AdminAppInitializeRequestSchema.serviceAuth} for full semantics.\n */\n serviceAuth: WildoAuthConfigSchema.optional(),\n /** Per-target addressing — see {@link AdminAppInitializeTarget.backingServiceAddressing}. */\n backingServiceAddressing: ApplicationBackingServiceAddressingSchema.optional(),\n}) as z.ZodType<AdminAppInitializeTarget>;\n\n/**\n * Whether a stated approver identity is WHOLE, ABSENT, or a half-filled mistake (#575).\n *\n * A named vocabulary because the three answers have three different remedies, and two of them are\n * easy to conflate: ABSENT is legitimate everywhere (a deployment provisioned before the approver\n * contract existed states nothing, and every boot re-runs INIT), while PARTIAL is an operator\n * mistake that must be named at the door where it was made.\n */\nexport enum ApproverIdentityCompleteness {\n /** All three identity fields present. Provisioning seeds a second administrator. */\n WHOLE = 'whole',\n /** None present. Provisioning proceeds with ONE administrator and says so. */\n ABSENT = 'absent',\n /** Some present. Refused — see {@link classifyApproverIdentity}. */\n PARTIAL = 'partial',\n}\n\nexport type ApproverIdentityClassification =\n | { completeness: ApproverIdentityCompleteness.WHOLE; email: string; firstName: string; lastName: string }\n | { completeness: ApproverIdentityCompleteness.ABSENT }\n | { completeness: ApproverIdentityCompleteness.PARTIAL; missing: string[] };\n\n/**\n * ONE definition of \"all four or none\" for the second administrator, shared by every door that\n * reads one (#575).\n *\n * ## Why it classifies rather than throws\n *\n * The callers owe different answers. An HTTP door refuses with a VALIDATION error naming the missing\n * fields, because an operator is present and the mistake is theirs. The INIT boot path cannot refuse\n * at all — a platform provisioned before this existed states nothing, and INIT runs on every boot, so\n * refusing there would make it unbootable with a remedy that needs the process that just refused\n * (`continuity-drift-and-cas-basis.md` Rule 3). Returning the classification lets each site apply the\n * response it owes rather than inheriting one.\n *\n * ## Why `password` is not part of the test\n *\n * It is GENERATED when omitted, exactly as `userPassword` is for the primary administrator. Requiring\n * it would make the only stated-identity door harder to use than the one it mirrors, for no gain: a\n * generated password is reset through the ordinary flow.\n */\nexport function classifyApproverIdentity(input: {\n email?: string | undefined;\n firstName?: string | undefined;\n lastName?: string | undefined;\n}): ApproverIdentityClassification {\n const present = (value: string | undefined): boolean => typeof value === 'string' && value.trim().length > 0;\n const stated = [\n ['email', input.email],\n ['firstName', input.firstName],\n ['lastName', input.lastName],\n ] as const;\n\n const missing = stated.filter(([, value]) => !present(value)).map(([field]) => field);\n if (missing.length === stated.length) return { completeness: ApproverIdentityCompleteness.ABSENT };\n if (missing.length > 0) return { completeness: ApproverIdentityCompleteness.PARTIAL, missing };\n return {\n completeness: ApproverIdentityCompleteness.WHOLE,\n email: input.email as string,\n firstName: input.firstName as string,\n lastName: input.lastName as string,\n };\n}\n\nexport interface AdminAppsInitializeBatchRequest {\n override?: boolean;\n userEmail: string;\n userFirstName: string;\n userLastName: string;\n userPassword?: string;\n /**\n * The SECOND administrator (#575), envelope-level like the primary identity and for the same\n * reason: the seeded administrators are shared across every target.\n *\n * Carried on the BATCH door as well as the single one because they are two hand-written copies of\n * one contract — the shape `invariant-call-site-enumeration.md` #23 records. A batch that\n * provisioned one administrator while the single door provisioned two would leave whichever\n * applications went through it unable to approve their own application-wide reads.\n */\n approverEmail?: string;\n approverFirstName?: string;\n approverLastName?: string;\n approverPassword?: string;\n targets: AdminAppInitializeTarget[];\n}\n\n/**\n * Batch admin initialization envelope. Admin identity is required at the\n * envelope level (the seeded admin user is shared across all targets).\n */\nexport const AdminAppsInitializeBatchRequestSchema = z.object({\n override: z.boolean().optional(),\n userEmail: z.email(),\n userFirstName: z.string().min(1),\n userLastName: z.string().min(1),\n userPassword: z.string().min(1).optional(),\n approverEmail: z.email().optional(),\n approverFirstName: z.string().min(1).optional(),\n approverLastName: z.string().min(1).optional(),\n approverPassword: z.string().min(1).optional(),\n targets: z.array(AdminAppInitializeTargetSchema).min(1),\n}) as z.ZodType<AdminAppsInitializeBatchRequest>;\n\nexport interface AdminAppReapplyDeclarationRequest {\n managedDeclaration: AdminAppManagedDeclaration;\n /**\n * Report what a reapply WOULD change and write nothing (issue #97).\n *\n * This is the comparison primitive behind every \"is the stored config still what the\n * application declares?\" question — the init postcondition and the `wildo local doctor`\n * drift check both ask it this way rather than each re-implementing an authored-vs-stored\n * differ. One comparison, one place it can be wrong.\n *\n * Optional and defaulting to a real reapply, so an existing caller keeps its behaviour: a flag\n * that silently turned writes into no-ops would be a far worse failure than the invisibility it\n * exists to cure.\n */\n dryRun?: boolean;\n}\n\n/**\n * Shared success response for a single app initialization request.\n */\nexport const AdminAppInitializeResponseSchema = z.object({\n success: z.literal(true),\n application: z.object({\n name: z.string().min(1),\n slug: z.string().min(1),\n }),\n credentials: z.object({\n email: z.email(),\n password: z.string().min(1),\n }),\n /**\n * What provisioning did about the application's own bootstrap rows — see\n * {@link AppDatabaseSeedingOutcome}.\n *\n * OPTIONAL so a CLI can still parse a response from an apps-manager that predates the two-phase\n * contract. A caller that DEPENDS on the two-phase flow must treat absence as \"unknown\" and say\n * so, never as `SEEDED`.\n */\n appDatabaseSeeding: z.enum(AppDatabaseSeedingOutcome).optional(),\n});\n\n/**\n * Shared admin request payload for reapplying the `wildo.saas.config.ts`\n * declaration projection (`AdminAppManagedDeclaration`) onto an\n * already-initialized application.\n *\n * Contract semantics — what this endpoint owns:\n * - Re-source the declaration-managed slices of `Wildo_Application_Config`\n * from the new declaration: `appIdentity` display fields,\n * `frontendServices` seed, `engineCapabilities`, `providers`, and\n * `providerConfigurations`.\n * - Return a `updatedFields` diff so the caller can surface what changed.\n *\n * Contract semantics — what this endpoint deliberately does NOT touch:\n * - Credentials (DB users, JWT private keys, session secrets, admin\n * passwords). Those live in `Wildo_Application_Secrets` and are owned\n * by initialize / rotate flows.\n * - Database / infrastructure provisioning. Those are owned by\n * `/admin/apps/:appSlug/initialize` and the platform-init flow.\n * - K8s endpoints. Those are owned by\n * `/admin/apps/:appSlug/refresh` (config refresh) and the deploy flow.\n * - First-admin seeding (`firstAdminSeed`). User/role seeding happens\n * at init time only. Reapplying the declaration is a config-drift\n * operation; silently changing seeded role grants would be a\n * security regression. Callers wanting to change admin user types\n * must use a dedicated admin-management endpoint (not this one).\n *\n * Stable action identifier: `apps.reapply-declaration` (see\n * {@link APPS_REAPPLY_DECLARATION_ACTION_ID} in `bootstrap.contracts.ts`).\n * The CI/CD admin rights workstream (Step 8) reuses this identifier in\n * its permission grid so this endpoint can be granted independently\n * from the broader `apps.initialize` action.\n */\nexport const AdminAppReapplyDeclarationRequestSchema = z.strictObject({\n managedDeclaration: AdminAppManagedDeclarationSchema,\n dryRun: z.boolean().optional(),\n}) as z.ZodType<AdminAppReapplyDeclarationRequest>;\n\n/**\n * Shared success response for a managed-declaration reapply request.\n *\n * `updatedFields` lists the dot-paths of the declaration-projection\n * slices that actually changed (e.g. `appIdentity.displayName`,\n * `frontendServices`, `engineCapabilities`, `providers`).\n * An empty list means the stored config already matched the new\n * declaration — the operation is idempotent.\n *\n * When `dryRun` is `true` the same list describes what WOULD change; nothing\n * was written. An empty `updatedFields` under `dryRun` is therefore a positive\n * coherence proof: the stored config matches the declaration right now.\n */\nexport const AdminAppReapplyDeclarationResponseSchema = z.object({\n success: z.literal(true),\n appSlug: z.string().min(1),\n updatedFields: z.array(z.string()),\n appliedAt: z.string().datetime(),\n /**\n * Whether this response describes a PREVIEW or an APPLIED change.\n *\n * REQUIRED rather than optional, and echoed from the request rather than assumed by the\n * caller: `updatedFields` reads identically in both modes, so `['providerConfigurations']`\n * means two opposite things depending on this flag. A caller that cannot tell them apart may\n * report \"reapplied\" for a run that changed nothing on the server. Issue #97 is what a\n * silently implicit answer to \"did this actually take?\" costs.\n */\n dryRun: z.boolean(),\n});\n\nexport type AppBootstrapCredentials = z.infer<typeof AppBootstrapCredentialsSchema>;\nexport type AppBootstrapCredentialsResponse = z.infer<typeof AppBootstrapCredentialsResponseSchema>;\nexport type AppBootstrapFirstAdminSeed = z.infer<typeof AppBootstrapFirstAdminSeedSchema>;\nexport type AdminAppInitializeResponse = z.infer<typeof AdminAppInitializeResponseSchema>;\nexport type AdminAppReapplyDeclarationResponse = z.infer<typeof AdminAppReapplyDeclarationResponseSchema>;\n"]}