@wildo-ai/platform-config-lib 1.1.7 → 1.1.8

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 (183) hide show
  1. package/dist/esm/_unimplemented/index.d.ts.map +1 -1
  2. package/dist/esm/_unimplemented/index.js.map +1 -1
  3. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
  4. package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
  5. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +1 -1
  6. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -1
  7. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  8. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  9. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  10. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  11. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  12. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  13. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  14. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  15. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  16. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  17. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  18. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  19. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
  20. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
  21. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  22. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  23. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  24. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  25. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  26. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  27. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
  28. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  29. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  30. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  31. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  32. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  33. package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
  34. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  35. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  36. package/dist/esm/config-authoring.entry.js.map +1 -1
  37. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  38. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  39. package/dist/esm/index.d.ts.map +1 -1
  40. package/dist/esm/index.js.map +1 -1
  41. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  42. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  43. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  44. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  45. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  46. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  47. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  48. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  49. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  50. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  51. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
  52. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
  53. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  54. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  55. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  56. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  57. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  58. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  59. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  60. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  61. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  62. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  63. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  64. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  65. package/dist/esm/project-config/index.d.ts.map +1 -1
  66. package/dist/esm/project-config/index.js.map +1 -1
  67. package/dist/esm/project-config/loader.d.ts.map +1 -1
  68. package/dist/esm/project-config/loader.js.map +1 -1
  69. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  70. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  71. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
  72. package/dist/esm/project-config/npm-version-range.js.map +1 -1
  73. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
  74. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  75. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  76. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  77. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  78. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  79. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  80. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  81. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  82. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  83. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  84. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  85. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  86. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  87. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
  88. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
  89. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  90. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  91. package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -1
  92. package/dist/esm/project-config/shared/cdn.example.js.map +1 -1
  93. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  94. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  95. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  96. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  97. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  98. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  99. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  100. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  101. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  102. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  103. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  104. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  105. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  106. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  107. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  108. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  109. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
  110. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  111. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  112. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  113. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  114. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  115. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  116. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  117. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  118. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  119. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  120. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  121. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  122. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  123. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  124. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  125. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -1
  126. package/dist/esm/project-config/shared/schema-version.schemas.js.map +1 -1
  127. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  128. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  129. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  130. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  131. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
  132. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
  133. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  134. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  135. package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
  136. package/dist/esm/registry/digest.schemas.js.map +1 -1
  137. package/dist/esm/registry/index.d.ts.map +1 -1
  138. package/dist/esm/registry/index.js.map +1 -1
  139. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
  140. package/dist/esm/registry/local-checkout-source.js.map +1 -1
  141. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  142. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  143. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  144. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  145. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  146. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  147. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
  148. package/dist/esm/registry/module-search.schemas.js.map +1 -1
  149. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  150. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  151. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  152. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  153. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  154. package/dist/esm/registry/registry-errors.js.map +1 -1
  155. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
  156. package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
  157. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  158. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  159. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  160. package/dist/esm/release/framework-release.constants.js.map +1 -1
  161. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  162. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  163. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  164. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  165. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  166. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  167. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  168. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  169. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  170. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  171. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
  172. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  173. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  174. package/dist/esm/workspace-scope/index.js.map +1 -1
  175. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  176. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  177. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  178. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  179. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  180. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  181. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  182. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  183. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"application-creation-verification.schemas.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/application-creation-verification.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,eAAO,MAAM,2CAA2C;IACtD,0EAA0E;;IAU1E,iFAAiF;;kBAEjF,CAAC;AAEH,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAC"}
1
+ {"version":3,"file":"application-creation-verification.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/application-creation-verification.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,eAAO,MAAM,2CAA2C;IACtD,0EAA0E;;IAU1E,iFAAiF;;kBAEjF,CAAC;AAEH,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"application-creation-verification.schemas.js","sourceRoot":"","sources":["../../../../src/project-config/shared/application-creation-verification.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC,CAAC,YAAY,CAAC;IACxE,0EAA0E;IAC1E,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACzE,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,4BAA4B,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;YAC7F,OAAO,CAAC,QAAQ,CAAC;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,iGAAiG;aAC3G,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC;IACF,iFAAiF;IACjF,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACnC,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * Local operator posture for application-creation workflow verification.\n *\n * This is authored in `wildo.infra.local.config.ts`. It is never read directly\n * by the verification command: config sync first snapshots it into generated\n * `config.json`, then projects it into the ephemeral app-root `.env` consumed\n * by the operator command. Keeping this block local-only prevents a developer\n * diagnostic path or console preference from becoming deployment policy.\n */\nexport const ApplicationCreationVerificationConfigSchema = z.strictObject({\n /** App-root-relative destination for persistent verification evidence. */\n evidenceDirectory: z.string().trim().min(1).superRefine((value, context) => {\n const pathSegments = value.split(/[\\\\/]/u);\n if (/^(?:[A-Za-z]:[\\\\/]|[\\\\/])/u.test(value) || pathSegments.includes('..') || value === '.') {\n context.addIssue({\n code: 'custom',\n message: 'applicationCreationVerification.evidenceDirectory must be an app-root-relative descendant path.',\n });\n }\n }),\n /** Suppress successful child/receipt presentation without weakening evidence. */\n silent: z.boolean().default(false),\n});\n\nexport type ApplicationCreationVerificationConfig = z.infer<typeof ApplicationCreationVerificationConfigSchema>;\n"]}
1
+ {"version":3,"file":"application-creation-verification.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/application-creation-verification.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC,CAAC,YAAY,CAAC;IACxE,0EAA0E;IAC1E,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACzE,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,4BAA4B,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;YAC7F,OAAO,CAAC,QAAQ,CAAC;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,iGAAiG;aAC3G,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC;IACF,iFAAiF;IACjF,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACnC,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * Local operator posture for application-creation workflow verification.\n *\n * This is authored in `wildo.infra.local.config.ts`. It is never read directly\n * by the verification command: config sync first snapshots it into generated\n * `config.json`, then projects it into the ephemeral app-root `.env` consumed\n * by the operator command. Keeping this block local-only prevents a developer\n * diagnostic path or console preference from becoming deployment policy.\n */\nexport const ApplicationCreationVerificationConfigSchema = z.strictObject({\n /** App-root-relative destination for persistent verification evidence. */\n evidenceDirectory: z.string().trim().min(1).superRefine((value, context) => {\n const pathSegments = value.split(/[\\\\/]/u);\n if (/^(?:[A-Za-z]:[\\\\/]|[\\\\/])/u.test(value) || pathSegments.includes('..') || value === '.') {\n context.addIssue({\n code: 'custom',\n message: 'applicationCreationVerification.evidenceDirectory must be an app-root-relative descendant path.',\n });\n }\n }),\n /** Suppress successful child/receipt presentation without weakening evidence. */\n silent: z.boolean().default(false),\n});\n\nexport type ApplicationCreationVerificationConfig = z.infer<typeof ApplicationCreationVerificationConfigSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"application-modules.schemas.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/application-modules.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,8BAA8B;;;iBAOzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,wBAAwB;;;mBAGzB,CAAC;AACb,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,iEAAiE"}
1
+ {"version":3,"file":"application-modules.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/application-modules.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,8BAA8B;;;iBAOzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,wBAAwB;;;mBAGzB,CAAC;AACb,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,iEAAiE"}
@@ -1 +1 @@
1
- {"version":3,"file":"application-modules.schemas.js","sourceRoot":"","sources":["../../../../src/project-config/shared/application-modules.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3C;;;OAGG;IACH,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC9C,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EACjB,8BAA8B,CAC/B,CAAC,QAAQ,EAAE,CAAC;AAEb,iEAAiE","sourcesContent":["import { z } from 'zod';\n\n/**\n * @wildo_source:part:start platform.config.application-modules facet:layer:platform facet:family:bootstrap\n *\n * SaaS root `modules` map: each module id binds to the service keys it consumes (`ApplicationModulesSchema`).\n */\nexport const ApplicationModuleBindingSchema = z.object({\n services: z.array(z.string().min(1)).min(1),\n /**\n * When true, at least one backend workload for this module requires the\n * Java-enabled framework backend base image (for example SAML/XSD flows).\n */\n haveSamlIntegration: z.boolean().optional(),\n});\nexport type ApplicationModuleBinding = z.infer<typeof ApplicationModuleBindingSchema>;\n\nexport const ApplicationModulesSchema = z.record(\n z.string().min(1),\n ApplicationModuleBindingSchema,\n).optional();\nexport type ApplicationModules = z.infer<typeof ApplicationModulesSchema>;\n/** @wildo_source:part:end platform.config.application-modules */\n"]}
1
+ {"version":3,"file":"application-modules.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/application-modules.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3C;;;OAGG;IACH,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC9C,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EACjB,8BAA8B,CAC/B,CAAC,QAAQ,EAAE,CAAC;AAEb,iEAAiE","sourcesContent":["import { z } from 'zod';\n\n/**\n * @wildo_source:part:start platform.config.application-modules facet:layer:platform facet:family:bootstrap\n *\n * SaaS root `modules` map: each module id binds to the service keys it consumes (`ApplicationModulesSchema`).\n */\nexport const ApplicationModuleBindingSchema = z.object({\n services: z.array(z.string().min(1)).min(1),\n /**\n * When true, at least one backend workload for this module requires the\n * Java-enabled framework backend base image (for example SAML/XSD flows).\n */\n haveSamlIntegration: z.boolean().optional(),\n});\nexport type ApplicationModuleBinding = z.infer<typeof ApplicationModuleBindingSchema>;\n\nexport const ApplicationModulesSchema = z.record(\n z.string().min(1),\n ApplicationModuleBindingSchema,\n).optional();\nexport type ApplicationModules = z.infer<typeof ApplicationModulesSchema>;\n/** @wildo_source:part:end platform.config.application-modules */\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"application-modules.utils.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/application-modules.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AA4BxE,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,kBAAkB,GAAG,SAAS,GACtC,MAAM,EAAE,CAEV;AAED,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,GACjB,MAAM,EAAE,CAEV;AAED,wBAAgB,wCAAwC,CACtD,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,GAC7B,OAAO,CAOT;AAED,wBAAgB,iCAAiC,CAAC,CAAC,EACjD,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EACtC,aAAa,EAAE,MAAM,GACpB,CAAC,EAAE,CAML;AAED,wBAAgB,qCAAqC,CAAC,CAAC,EACrD,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,EAClB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EACtC,aAAa,SAA4B,GACxC,CAAC,EAAE,CAML"}
1
+ {"version":3,"file":"application-modules.utils.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/application-modules.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AA4BxE,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,kBAAkB,GAAG,SAAS,GACtC,MAAM,EAAE,CAEV;AAED,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,GACjB,MAAM,EAAE,CAEV;AAED,wBAAgB,wCAAwC,CACtD,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,GAC7B,OAAO,CAOT;AAED,wBAAgB,iCAAiC,CAAC,CAAC,EACjD,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EACtC,aAAa,EAAE,MAAM,GACpB,CAAC,EAAE,CAML;AAED,wBAAgB,qCAAqC,CAAC,CAAC,EACrD,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,EAClB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EACtC,aAAa,SAA4B,GACxC,CAAC,EAAE,CAML"}
@@ -1 +1 @@
1
- {"version":3,"file":"application-modules.utils.js","sourceRoot":"","sources":["../../../../src/project-config/shared/application-modules.utils.ts"],"names":[],"mappings":"AAEA,SAAS,gBAAgB,CACvB,OAAuC,EACvC,SAA6C;IAE7C,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;SACjC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SACpD,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,sBAAsB,CAC7B,SAAmB,EACnB,mBAAsC,EACtC,aAAqB;IAErB,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,mBAAmB,CAAC,CAAC,CAAC;IAE5F,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,wBAAwB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,aAAa,GAAG;YACzF,wEAAwE,CACzE,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,mBAAmB,CAAC,QAAQ,CA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Modules } from './application-modules.schemas';\n\nfunction resolveModuleIds(\n modules: ApplicationModules | undefined,\n predicate: (serviceKeys: string[]) => boolean,\n): string[] {\n return Object.entries(modules ?? {})\n .filter(([, binding]) => predicate(binding.services))\n .map(([moduleId]) => moduleId);\n}\n\nfunction pickApplicationModules<T>(\n moduleIds: string[],\n declaredModulesById: Record<string, T>,\n consumerLabel: string,\n): T[] {\n const missingModuleIds = moduleIds.filter((moduleId) => !(moduleId in declaredModulesById));\n\n if (missingModuleIds.length > 0) {\n throw new Error(\n `Application modules [${missingModuleIds.join(', ')}] are declared for ${consumerLabel} ` +\n 'in wildo.saas.config.ts but no matching implementation was registered.',\n );\n }\n\n return moduleIds.map((moduleId) => declaredModulesById[moduleId]!);\n}\n\nexport function getDeclaredApplicationModuleIds(\n modules: ApplicationModules | undefined,\n): string[] {\n return resolveModuleIds(modules, () => true);\n}\n\nexport function getServiceBoundApplicationModuleIds(\n modules: ApplicationModules | undefined,\n serviceKey: string,\n): string[] {\n return resolveModuleIds(modules, (serviceKeys) => serviceKeys.includes(serviceKey));\n}\n\nexport function hasServiceBoundModuleWithSamlIntegration(\n modules: ApplicationModules | undefined,\n serviceKeys: string | string[],\n): boolean {\n const serviceKeySet = new Set(Array.isArray(serviceKeys) ? serviceKeys : [serviceKeys]);\n\n return Object.values(modules ?? {}).some(\n (binding) => binding.haveSamlIntegration === true &&\n binding.services.some((serviceKey) => serviceKeySet.has(serviceKey)),\n );\n}\n\nexport function resolveDeclaredApplicationModules<T>(\n modules: ApplicationModules | undefined,\n declaredModulesById: Record<string, T>,\n consumerLabel: string,\n): T[] {\n return pickApplicationModules(\n getDeclaredApplicationModuleIds(modules),\n declaredModulesById,\n consumerLabel,\n );\n}\n\nexport function resolveServiceBoundApplicationModules<T>(\n modules: ApplicationModules | undefined,\n serviceKey: string,\n declaredModulesById: Record<string, T>,\n consumerLabel = `service \"${serviceKey}\"`,\n): T[] {\n return pickApplicationModules(\n getServiceBoundApplicationModuleIds(modules, serviceKey),\n declaredModulesById,\n consumerLabel,\n );\n}\n"]}
1
+ {"version":3,"file":"application-modules.utils.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/application-modules.utils.ts"],"names":[],"mappings":"AAEA,SAAS,gBAAgB,CACvB,OAAuC,EACvC,SAA6C;IAE7C,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;SACjC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SACpD,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,sBAAsB,CAC7B,SAAmB,EACnB,mBAAsC,EACtC,aAAqB;IAErB,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,mBAAmB,CAAC,CAAC,CAAC;IAE5F,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,wBAAwB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,aAAa,GAAG;YACzF,wEAAwE,CACzE,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,mBAAmB,CAAC,QAAQ,CAAE,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,+BAA+B,CAC7C,OAAuC;IAEvC,OAAO,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,mCAAmC,CACjD,OAAuC,EACvC,UAAkB;IAElB,OAAO,gBAAgB,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;AACtF,CAAC;AAED,MAAM,UAAU,wCAAwC,CACtD,OAAuC,EACvC,WAA8B;IAE9B,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;IAExF,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,CACtC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,mBAAmB,KAAK,IAAI;QAC/C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CACvE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,OAAuC,EACvC,mBAAsC,EACtC,aAAqB;IAErB,OAAO,sBAAsB,CAC3B,+BAA+B,CAAC,OAAO,CAAC,EACxC,mBAAmB,EACnB,aAAa,CACd,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qCAAqC,CACnD,OAAuC,EACvC,UAAkB,EAClB,mBAAsC,EACtC,aAAa,GAAG,YAAY,UAAU,GAAG;IAEzC,OAAO,sBAAsB,CAC3B,mCAAmC,CAAC,OAAO,EAAE,UAAU,CAAC,EACxD,mBAAmB,EACnB,aAAa,CACd,CAAC;AACJ,CAAC","sourcesContent":["import type { ApplicationModules } from './application-modules.schemas';\n\nfunction resolveModuleIds(\n modules: ApplicationModules | undefined,\n predicate: (serviceKeys: string[]) => boolean,\n): string[] {\n return Object.entries(modules ?? {})\n .filter(([, binding]) => predicate(binding.services))\n .map(([moduleId]) => moduleId);\n}\n\nfunction pickApplicationModules<T>(\n moduleIds: string[],\n declaredModulesById: Record<string, T>,\n consumerLabel: string,\n): T[] {\n const missingModuleIds = moduleIds.filter((moduleId) => !(moduleId in declaredModulesById));\n\n if (missingModuleIds.length > 0) {\n throw new Error(\n `Application modules [${missingModuleIds.join(', ')}] are declared for ${consumerLabel} ` +\n 'in wildo.saas.config.ts but no matching implementation was registered.',\n );\n }\n\n return moduleIds.map((moduleId) => declaredModulesById[moduleId]!);\n}\n\nexport function getDeclaredApplicationModuleIds(\n modules: ApplicationModules | undefined,\n): string[] {\n return resolveModuleIds(modules, () => true);\n}\n\nexport function getServiceBoundApplicationModuleIds(\n modules: ApplicationModules | undefined,\n serviceKey: string,\n): string[] {\n return resolveModuleIds(modules, (serviceKeys) => serviceKeys.includes(serviceKey));\n}\n\nexport function hasServiceBoundModuleWithSamlIntegration(\n modules: ApplicationModules | undefined,\n serviceKeys: string | string[],\n): boolean {\n const serviceKeySet = new Set(Array.isArray(serviceKeys) ? serviceKeys : [serviceKeys]);\n\n return Object.values(modules ?? {}).some(\n (binding) => binding.haveSamlIntegration === true &&\n binding.services.some((serviceKey) => serviceKeySet.has(serviceKey)),\n );\n}\n\nexport function resolveDeclaredApplicationModules<T>(\n modules: ApplicationModules | undefined,\n declaredModulesById: Record<string, T>,\n consumerLabel: string,\n): T[] {\n return pickApplicationModules(\n getDeclaredApplicationModuleIds(modules),\n declaredModulesById,\n consumerLabel,\n );\n}\n\nexport function resolveServiceBoundApplicationModules<T>(\n modules: ApplicationModules | undefined,\n serviceKey: string,\n declaredModulesById: Record<string, T>,\n consumerLabel = `service \"${serviceKey}\"`,\n): T[] {\n return pickApplicationModules(\n getServiceBoundApplicationModuleIds(modules, serviceKey),\n declaredModulesById,\n consumerLabel,\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"auth.schemas.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/auth.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;IAChC;;;;;;;;;OASG;;IAEH;;;;;;OAMG;;kBAEH,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"auth.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/auth.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;IAChC;;;;;;;;;OASG;;IAEH;;;;;;OAMG;;kBAEH,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"auth.schemas.js","sourceRoot":"","sources":["../../../../src/project-config/shared/auth.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,YAAY,CAAC;IAClD;;;;;;;;;OASG;IACH,4BAA4B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACrE;;;;;;OAMG;IACH,0BAA0B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CACpE,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * Authored JWT TTL policy block for `wildo.infra.<env>.config.ts`.\n *\n * Source-of-truth contract (Slice 3.3, F-24):\n * - `accessTokenExpirationMinutes` and `refreshTokenExpirationDays` are\n * threaded by the CLI through the apps-manager init endpoint\n * (`AdminAppInitializeRequest.serviceAuth`) into\n * `Wildo_Application_Config.jwt.{accessTokenExpirationMinutes,\n * refreshTokenExpirationDays}`. The runtime backend reads them at\n * token-sign time (`auth-token-issuer.backend.service.ts`,\n * `jwt.backend.service.ts`).\n * - First registration uses the schema defaults when `serviceAuth` is absent. Ordinary\n * re-registration preserves the stored policy when the whole block is omitted. A present\n * block resolves omitted members through these defaults and reconciles both lifetimes.\n *\n * Default tightening (Auth-hardening Slice A Step 5, 2026-04-13):\n * - `accessTokenExpirationMinutes` default was lowered from 60 \\u2192 15 in\n * conjunction with the cookie migration (Slice A Steps 2 + 3). With the\n * refresh token now confined to an `HttpOnly` cookie, an XSS bug only\n * exposes the SHORT-lived access token; the smaller the access-token\n * window, the smaller the residual XSS-stolen-token blast radius.\n * Operator overrides via `serviceAuth.accessTokenExpirationMinutes` in\n * `wildo.infra.<env>.config.ts` are untouched \\u2014 author a value to\n * deviate from the framework recommendation. The refresh-token TTL\n * (`refreshTokenExpirationDays`) is unchanged at 30 days because the\n * cookie-confined refresh token does not benefit from an additional\n * TTL squeeze (rotation + JTI blacklist + reuse detection already bound\n * the steal window per use).\n *\n * Algorithm selection is intentionally NOT authored here: the application\n * JWT signing path (`jwt.backend.service.ts`) selects per the per-service\n * key convention, and the apps-manager response-signer pins ES256 for the\n * config-handshake envelope (anti-replay, see F-55 JSDoc on\n * `platform-services-to-manager.apps-manager.platform.controller.ts`).\n * Authoring an algorithm here would add a knob with no honest consumer.\n *\n * Publication lifecycle:\n * - The CLI forwards `env.serviceAuth` through the admin initialization request. Existing\n * applications reconcile an explicitly supplied policy even when no other settings changed;\n * no broad initialization override is required for a token-lifetime-only change.\n * - Ordinary initialization with an omitted block preserves existing lifetimes, including\n * incidental public-key/database repairs. Explicit `override:true` retains its wider reset\n * semantics: absent `serviceAuth` resets lifetimes to the schema defaults below.\n * - Applications retrieve the persisted policy at startup. Running processes do not receive\n * live policy updates, and existing tokens retain the expiration already encoded in them.\n *\n * Pinned by `managed-token-policy-convergence.apps-manager.platform.test.ts` and the lifecycle\n * default derivation tests; the former exercises persistence and the bootstrap consumer offline.\n */\n/**\n * `z.strictObject` (Zod 4) is intentional: any unknown key (e.g. a\n * re-introduced `jwtAlgorithm`, or a typo'd `accessTokenExpirationMinute`)\n * must surface as a parse error instead of being silently stripped. This\n * is the framework-mindset enforcement of the \"no honest consumer => no\n * authored knob\" rule documented in the file-level JSDoc above.\n */\nexport const WildoAuthConfigSchema = z.strictObject({\n /**\n * Access-token TTL in minutes. Authored value > schema default (15).\n * Threaded into `Wildo_Application_Config.jwt.accessTokenExpiration\n * Minutes` at apps-manager init time; consumed at token-sign time by\n * `AuthTokenIssuerBackendService.issueAccessToken`.\n *\n * Default = 15 (Auth-hardening Slice A Step 5, 2026-04-13). Pre-Slice-A\n * the default was 60 \\u2014 the file-level JSDoc above documents the\n * threat-model rationale for the tightening.\n */\n accessTokenExpirationMinutes: z.number().int().positive().default(15),\n /**\n * Refresh-token TTL in days. Authored value > schema default (30).\n * Threaded into `Wildo_Application_Config.jwt.refreshTokenExpiration\n * Days` at apps-manager init time; consumed at token-sign time by\n * `JwtBackendService.createRefreshToken` and at session-bookkeeping\n * time by `AuthTokenIssuerBackendService.invalidateAllTokensForUser`.\n */\n refreshTokenExpirationDays: z.number().int().positive().default(30),\n});\nexport type WildoAuthConfig = z.infer<typeof WildoAuthConfigSchema>;\nexport type WildoAuthConfigInput = z.input<typeof WildoAuthConfigSchema>;\n"]}
1
+ {"version":3,"file":"auth.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/auth.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,YAAY,CAAC;IAClD;;;;;;;;;OASG;IACH,4BAA4B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACrE;;;;;;OAMG;IACH,0BAA0B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CACpE,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * Authored JWT TTL policy block for `wildo.infra.<env>.config.ts`.\n *\n * Source-of-truth contract (Slice 3.3, F-24):\n * - `accessTokenExpirationMinutes` and `refreshTokenExpirationDays` are\n * threaded by the CLI through the apps-manager init endpoint\n * (`AdminAppInitializeRequest.serviceAuth`) into\n * `Wildo_Application_Config.jwt.{accessTokenExpirationMinutes,\n * refreshTokenExpirationDays}`. The runtime backend reads them at\n * token-sign time (`auth-token-issuer.backend.service.ts`,\n * `jwt.backend.service.ts`).\n * - First registration uses the schema defaults when `serviceAuth` is absent. Ordinary\n * re-registration preserves the stored policy when the whole block is omitted. A present\n * block resolves omitted members through these defaults and reconciles both lifetimes.\n *\n * Default tightening (Auth-hardening Slice A Step 5, 2026-04-13):\n * - `accessTokenExpirationMinutes` default was lowered from 60 \\u2192 15 in\n * conjunction with the cookie migration (Slice A Steps 2 + 3). With the\n * refresh token now confined to an `HttpOnly` cookie, an XSS bug only\n * exposes the SHORT-lived access token; the smaller the access-token\n * window, the smaller the residual XSS-stolen-token blast radius.\n * Operator overrides via `serviceAuth.accessTokenExpirationMinutes` in\n * `wildo.infra.<env>.config.ts` are untouched \\u2014 author a value to\n * deviate from the framework recommendation. The refresh-token TTL\n * (`refreshTokenExpirationDays`) is unchanged at 30 days because the\n * cookie-confined refresh token does not benefit from an additional\n * TTL squeeze (rotation + JTI blacklist + reuse detection already bound\n * the steal window per use).\n *\n * Algorithm selection is intentionally NOT authored here: the application\n * JWT signing path (`jwt.backend.service.ts`) selects per the per-service\n * key convention, and the apps-manager response-signer pins ES256 for the\n * config-handshake envelope (anti-replay, see F-55 JSDoc on\n * `platform-services-to-manager.apps-manager.platform.controller.ts`).\n * Authoring an algorithm here would add a knob with no honest consumer.\n *\n * Publication lifecycle:\n * - The CLI forwards `env.serviceAuth` through the admin initialization request. Existing\n * applications reconcile an explicitly supplied policy even when no other settings changed;\n * no broad initialization override is required for a token-lifetime-only change.\n * - Ordinary initialization with an omitted block preserves existing lifetimes, including\n * incidental public-key/database repairs. Explicit `override:true` retains its wider reset\n * semantics: absent `serviceAuth` resets lifetimes to the schema defaults below.\n * - Applications retrieve the persisted policy at startup. Running processes do not receive\n * live policy updates, and existing tokens retain the expiration already encoded in them.\n *\n * Pinned by `managed-token-policy-convergence.apps-manager.platform.test.ts` and the lifecycle\n * default derivation tests; the former exercises persistence and the bootstrap consumer offline.\n */\n/**\n * `z.strictObject` (Zod 4) is intentional: any unknown key (e.g. a\n * re-introduced `jwtAlgorithm`, or a typo'd `accessTokenExpirationMinute`)\n * must surface as a parse error instead of being silently stripped. This\n * is the framework-mindset enforcement of the \"no honest consumer => no\n * authored knob\" rule documented in the file-level JSDoc above.\n */\nexport const WildoAuthConfigSchema = z.strictObject({\n /**\n * Access-token TTL in minutes. Authored value > schema default (15).\n * Threaded into `Wildo_Application_Config.jwt.accessTokenExpiration\n * Minutes` at apps-manager init time; consumed at token-sign time by\n * `AuthTokenIssuerBackendService.issueAccessToken`.\n *\n * Default = 15 (Auth-hardening Slice A Step 5, 2026-04-13). Pre-Slice-A\n * the default was 60 \\u2014 the file-level JSDoc above documents the\n * threat-model rationale for the tightening.\n */\n accessTokenExpirationMinutes: z.number().int().positive().default(15),\n /**\n * Refresh-token TTL in days. Authored value > schema default (30).\n * Threaded into `Wildo_Application_Config.jwt.refreshTokenExpiration\n * Days` at apps-manager init time; consumed at token-sign time by\n * `JwtBackendService.createRefreshToken` and at session-bookkeeping\n * time by `AuthTokenIssuerBackendService.invalidateAllTokensForUser`.\n */\n refreshTokenExpirationDays: z.number().int().positive().default(30),\n});\nexport type WildoAuthConfig = z.infer<typeof WildoAuthConfigSchema>;\nexport type WildoAuthConfigInput = z.input<typeof WildoAuthConfigSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"backing-service-servability.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/backing-service-servability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EAEpB,KAAK,wBAAwB,EAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,0CAA0C;AAC1C,oBAAY,8BAA8B;IACxC,4FAA4F;IAC5F,WAAW,gBAAgB;IAC3B;;;OAGG;IACH,iBAAiB,sBAAsB;IACvC;;;;;;;;;OASG;IACH,oBAAoB,yBAAyB;CAC9C;AAED,yFAAyF;AACzF,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,oBAAoB,CAAC;IAC7B,qGAAqG;IACrG,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,0EAA0E;AAC1E,MAAM,WAAW,iCAAkC,SAAQ,+BAA+B;IACxF,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,iCAAiC,CAAC,CAiBpH,CAAC;AAEF,4FAA4F;AAC5F,MAAM,WAAW,mCAAmC;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,+BAA+B,CAAC;IAC1C,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,EAAE,aAAa,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,wBAAwB,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IAChG,iBAAiB,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CAC/C,GAAG,IAAI,CAOP"}
1
+ {"version":3,"file":"backing-service-servability.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/backing-service-servability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EAEpB,KAAK,wBAAwB,EAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,0CAA0C;AAC1C,oBAAY,8BAA8B;IACxC,4FAA4F;IAC5F,WAAW,gBAAgB;IAC3B;;;OAGG;IACH,iBAAiB,sBAAsB;IACvC;;;;;;;;;OASG;IACH,oBAAoB,yBAAyB;CAC9C;AAED,yFAAyF;AACzF,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,oBAAoB,CAAC;IAC7B,qGAAqG;IACrG,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,0EAA0E;AAC1E,MAAM,WAAW,iCAAkC,SAAQ,+BAA+B;IACxF,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,iCAAiC,CAAC,CAiBpH,CAAC;AAEF,4FAA4F;AAC5F,MAAM,WAAW,mCAAmC;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,+BAA+B,CAAC;IAC1C,MAAM,EAAE,8BAA8B,CAAC;IACvC,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,aAAa,CAAC;IACjC,gGAAgG;IAChG,o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AC,CAAC;IAChG,iBAAiB,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CAC/C,GAAG,IAAI,CAOP"}
@@ -1 +1 @@
1
- {"version":3,"file":"backing-service-servability.js","sourceRoot":"","sources":["../../../../src/project-config/shared/backing-service-servability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GAErB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,0CAA0C;AAC1C,MAAM,CAAN,IAAY,8BAmBX;AAnBD,WAAY,8BAA8B;IACxC,4FAA4F;IAC5F,6DAA2B,CAAA;IAC3B;;;OAGG;IACH,yEAAuC,CAAA;IACvC;;;;;;;;;OASG;IACH,+EAA6C,CAAA;AAC/C,CAAC,EAnBW,8BAA8B,KAA9B,8BAA8B,QAmBzC;AAcD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAuE;IACvH,CAAC,aAAa,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,IAAI,EAAE;IACrG,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE;IAC5H,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,oBAAoB,CAAC,IAAI,EAAE;IACzG,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAAE,EAAE,IAAI,EAAE,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,oBAAoB,CAAC,OAAO,EAAE;IAC/G,CAAC,aAAa,CAAC,gBAAgB,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OAAO,CAAC,OAAO,sBAAsB,OAAO,CAAC,IAAI,IAAI,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,GAAG,KAAK,OAAO,GAAG,CAAC;AACtI,CAAC;AAED,yFAAyF;AACzF,MAAM,OAAO,wCAAyC,SAAQ,KAAK;IACxD,QAAQ,CAAqD;IAEtE,YAAY,QAA4D;QACtE,KAAK,CACH,kGAAkG;cAChG,mDAAmD;cACnD,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,2CAA2C,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CACtG,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,0CAA0C,CAAC;QACvD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED,oFAAoF;AACpF,MAAM,UAAU,wCAAwC,CAAC,KAGxD;IACC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,wCAAwC,CAAC;QACpF,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,eAAe,EAAE,GAAG,CAAC,eAAe;QACpC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;KAC3C,CAAC,CAAC,CAAC;IACJ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,wCAAwC,CAAC,QAAQ,CAAC,CAAC;AACxF,CAAC","sourcesContent":["import {\n BackingServiceKind,\n BackingServiceSource,\n resolveInfraProvider,\n type BackingServicesEnvConfig,\n} from './backing-services.schemas';\nimport { InfraProvider } from './infra-providers.schemas';\n\n/**\n * Is a `backingServices` declaration one the platform can actually SERVE?\n *\n * ## The defect this closes (#1693)\n *\n * A declaration used to be accepted when it merely parsed. Two classes of parseable declaration serve\n * nothing, and both passed `wildo config sync` and `wildo lock check` in silence:\n *\n * 1. **It resolves to no provider** — `redis: { source: MANAGED }`, a managed MongoDB brand other\n * than `'atlas'`. The lockfile materializer skipped the kind without a word.\n * 2. **It resolves to a provider no module can serve** — the seven managed PostgreSQL entries have no\n * module, and `AWS_S3` has one whose credential broker does not exist yet (#14). The materializer\n * fell back to hashing the authored entry, so the lockfile recorded a selection nothing executes.\n *\n * Neither \"provisions nothing\". The generators honour `source`, so a MANAGED cache gets no\n * self-hosted workload — while apps-manager, which named its modules and was never told the\n * declaration, minted the application's credential on the PLATFORM's own server. The application\n * received a credential for a server it never connects to. Since #1692 apps-manager is told, dispatches\n * on the declared provider and refuses one it cannot serve\n * ({@link findBackingServiceDeclarationsThePlatformCannotServe}); this offline check stops the same\n * declarations before they reach it.\n *\n * ## Why the servable set is an INPUT here, not computed here\n *\n * Servability is a property of the provider-module CATALOGUE (`@wildo-ai/platform-infra-providers`),\n * and that package depends on this one — never the reverse. So the catalogue derives the set\n * (`collectServableInfraProviders()`) and every caller hands it in. The check itself lives here, once,\n * so `wildo config validate`, `wildo config sync` and `wildo lock check` cannot disagree about which\n * declarations they refuse: the two lockfile projections reach it through `materializeInfraSection`,\n * which REQUIRES the set, and `config validate` calls {@link findUnservableBackingServiceDeclarations}\n * directly.\n *\n * ## No opt-out, deliberately\n *\n * An earlier design offered `acceptUnresolved: true`. It was dropped: it makes a known-broken\n * configuration representable, which is exactly a setting that looks like a control and does\n * nothing. A kind becomes declarable as `MANAGED` in the same change that adds the module serving it.\n */\n\n/** Why a declaration cannot be served. */\nexport enum BackingServiceUnservableReason {\n /** The `(kind, source, provider)` tuple names no `InfraProvider` catalogue entry at all. */\n NO_PROVIDER = 'no-provider',\n /**\n * It names a catalogue entry, but no provider module serves that entry — either none exists, or the\n * one that exists declares `unservableReason`.\n */\n NO_SERVING_MODULE = 'no-serving-module',\n /**\n * A module serves the entry, but THIS platform holds no administrative credentials for it — an Atlas\n * declaration on a platform with no Atlas API key, a self-hosted PostgreSQL declaration on a platform with\n * no PostgreSQL admin (#1692).\n *\n * Only apps-manager can know this: which admin clients a platform holds is platform configuration, and one\n * platform hosts many applications. The offline checks (`config validate` / `config sync` / `lock check`)\n * never produce it. apps-manager refuses the registration rather than minting on another provider — a\n * substitution would hand the application a credential for a server it does not connect to.\n */\n NOT_HELD_BY_PLATFORM = 'not-held-by-platform',\n}\n\n/** The authored half of a backing-service entry that decides which provider it names. */\nexport interface BackingServiceProviderSelection {\n source: BackingServiceSource;\n /** The brand, when the kind distinguishes several. See `resolveInfraProvider` for the vocabulary. */\n provider?: string;\n}\n\n/** The simplest authored declaration that selects one catalogue entry. */\nexport interface InfraProviderCanonicalDeclaration extends BackingServiceProviderSelection {\n kind: BackingServiceKind;\n}\n\n/**\n * For every `InfraProvider`, the SIMPLEST declaration that selects it — the inverse of\n * `resolveInfraProvider`, used to tell an author what they may write instead.\n *\n * Total over `InfraProvider` (a `Record`), so a provider added to the catalogue is a compile error\n * here until someone states how it is declared. That the inverse is truthful is pinned by a test that\n * resolves every row back through `resolveInfraProvider`; it is never trusted by construction.\n */\nexport const INFRA_PROVIDER_CANONICAL_DECLARATIONS: Readonly<Record<InfraProvider, InfraProviderCanonicalDeclaration>> = {\n [InfraProvider.MONGODB_SELF]: { kind: BackingServiceKind.MONGODB, source: BackingServiceSource.SELF },\n [InfraProvider.MONGODB_ATLAS]: { kind: BackingServiceKind.MONGODB, source: BackingServiceSource.MANAGED, provider: 'atlas' },\n [InfraProvider.POSTGRES_SELF]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.SELF },\n [InfraProvider.POSTGRES_MANAGED]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED },\n [InfraProvider.POSTGRES_AWS_RDS]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'aws-rds' },\n [InfraProvider.POSTGRES_GCP_CLOUD_SQL]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'gcp-cloud-sql' },\n [InfraProvider.POSTGRES_AZURE_DATABASE]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'azure-database' },\n [InfraProvider.POSTGRES_SUPABASE]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'supabase' },\n [InfraProvider.POSTGRES_NEON]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'neon' },\n [InfraProvider.POSTGRES_RENDER]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'render' },\n [InfraProvider.REDIS_SELF]: { kind: BackingServiceKind.REDIS, source: BackingServiceSource.SELF },\n [InfraProvider.RABBITMQ_SELF]: { kind: BackingServiceKind.RABBITMQ, source: BackingServiceSource.SELF },\n [InfraProvider.MINIO_SELF]: { kind: BackingServiceKind.S3, source: BackingServiceSource.SELF },\n [InfraProvider.AWS_S3]: { kind: BackingServiceKind.S3, source: BackingServiceSource.MANAGED },\n [InfraProvider.CLAMAV_SELF]: { kind: BackingServiceKind.CLAMAV, source: BackingServiceSource.SELF },\n [InfraProvider.IMMUDB_SELF]: { kind: BackingServiceKind.IMMUDB, source: BackingServiceSource.SELF },\n};\n\n/** One declaration the platform cannot serve, with everything the refusal message needs. */\nexport interface UnservableBackingServiceDeclaration {\n envName: string;\n kind: BackingServiceKind;\n declared: BackingServiceProviderSelection;\n reason: BackingServiceUnservableReason;\n /** The catalogue entry it names, when it names one (`NO_SERVING_MODULE`). */\n resolvedProvider?: InfraProvider;\n /** The simplest servable declarations for the same kind — what the author may write instead. */\n servableAlternatives: ReadonlyArray<BackingServiceProviderSelection>;\n}\n\n/**\n * The servable declarations for one kind, one per servable provider, in catalogue order.\n *\n * Empty when nothing can serve the kind — then the only servable choice is not to declare it.\n */\nexport function servableBackingServiceDeclarations(\n kind: BackingServiceKind,\n servableProviders: ReadonlySet<InfraProvider>,\n): ReadonlyArray<BackingServiceProviderSelection> {\n const alternatives: BackingServiceProviderSelection[] = [];\n for (const provider of Object.values(InfraProvider)) {\n if (!servableProviders.has(provider)) continue;\n const declaration = INFRA_PROVIDER_CANONICAL_DECLARATIONS[provider];\n if (declaration.kind !== kind) continue;\n alternatives.push({\n source: declaration.source,\n ...(declaration.provider === undefined ? {} : { provider: declaration.provider }),\n });\n }\n return alternatives;\n}\n\n/**\n * Every declaration in one environment that the platform cannot serve. Empty means every declared\n * kind resolves to a provider in `servableProviders`.\n *\n * Pure. `servableProviders` comes from `collectServableInfraProviders()` in\n * `@wildo-ai/platform-infra-providers`; see the file header for why it is an input.\n */\nexport function findUnservableBackingServiceDeclarations(input: {\n envName: string;\n backingServices: BackingServicesEnvConfig | undefined;\n servableProviders: ReadonlySet<InfraProvider>;\n}): UnservableBackingServiceDeclaration[] {\n const findings: UnservableBackingServiceDeclaration[] = [];\n if (!input.backingServices) return findings;\n\n for (const kind of Object.values(BackingServiceKind)) {\n const entry = input.backingServices[kind];\n if (!entry) continue;\n const finding = classifyBackingServiceDeclaration({\n envName: input.envName,\n kind,\n declared: entry,\n servableProviders: input.servableProviders,\n });\n if (finding) findings.push(finding);\n }\n return findings;\n}\n\n/**\n * One kind's declaration against a servable set: `undefined` when it resolves to a provider in the set,\n * otherwise the finding. The single place the resolve-then-check rule lives, so the offline checks above and\n * apps-manager's registration check below cannot disagree about what a declaration names.\n */\nfunction classifyBackingServiceDeclaration(input: {\n envName: string;\n kind: BackingServiceKind;\n declared: BackingServiceProviderSelection;\n servableProviders: ReadonlySet<InfraProvider>;\n}): UnservableBackingServiceDeclaration | undefined {\n const declared: BackingServiceProviderSelection = {\n source: input.declared.source,\n ...(input.declared.provider === undefined ? {} : { provider: input.declared.provider }),\n };\n const resolvedProvider = resolveInfraProvider(input.kind, declared.source, declared.provider);\n if (resolvedProvider !== undefined && input.servableProviders.has(resolvedProvider)) return undefined;\n return {\n envName: input.envName,\n kind: input.kind,\n declared,\n reason: resolvedProvider === undefined\n ? BackingServiceUnservableReason.NO_PROVIDER\n : BackingServiceUnservableReason.NO_SERVING_MODULE,\n ...(resolvedProvider === undefined ? {} : { resolvedProvider }),\n servableAlternatives: servableBackingServiceDeclarations(input.kind, input.servableProviders),\n };\n}\n\n/**\n * The declarations an application REGISTERS with that THIS platform cannot serve — apps-manager's half of\n * the servability check (#1692; the offline half is {@link findUnservableBackingServiceDeclarations}, #1693).\n *\n * Two sets, because they answer different questions:\n *\n * - `catalogueServableProviders` — what the provider-module catalogue can serve at all\n * (`collectServableInfraProviders()`). Every DECLARED kind is checked against it: a declaration the\n * catalogue refuses is refused here too, even if an older CLI let it through.\n * - `platformServableProviders` — the subset this platform holds what it needs for (an admin client for a\n * provider apps-manager mints on, nothing for one it does not). Checked only for `mintedKinds`, the kinds\n * apps-manager mints a credential on for THIS application: an environment's declaration also names stores\n * only the platform uses, and refusing an application over an admin client it would never use would be a\n * refusal with nothing behind it.\n *\n * A catalogue finding keeps its catalogue reason; a provider the catalogue serves and this platform does not\n * is {@link BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM}. Alternatives are always what THIS platform\n * can serve, because that is what the author can actually switch to here.\n *\n * Pure; apps-manager supplies both sets. An absent `declaredProviders` yields nothing — the previous\n * behaviour for every kind (see `ApplicationBackingServiceProviderDeclarations`).\n */\nexport function findBackingServiceDeclarationsThePlatformCannotServe(input: {\n envName: string;\n declaredProviders: Partial<Record<BackingServiceKind, BackingServiceProviderSelection>> | undefined;\n mintedKinds: ReadonlySet<BackingServiceKind>;\n catalogueServableProviders: ReadonlySet<InfraProvider>;\n platformServableProviders: ReadonlySet<InfraProvider>;\n}): UnservableBackingServiceDeclaration[] {\n const findings: UnservableBackingServiceDeclaration[] = [];\n if (!input.declaredProviders) return findings;\n const platformServable = new Set(\n [...input.platformServableProviders].filter((provider) => input.catalogueServableProviders.has(provider)),\n );\n\n for (const kind of Object.values(BackingServiceKind)) {\n const declared = input.declaredProviders[kind];\n if (!declared) continue;\n const catalogueFinding = classifyBackingServiceDeclaration({\n envName: input.envName,\n kind,\n declared,\n servableProviders: input.catalogueServableProviders,\n });\n if (catalogueFinding) {\n findings.push({ ...catalogueFinding, servableAlternatives: servableBackingServiceDeclarations(kind, platformServable) });\n continue;\n }\n if (!input.mintedKinds.has(kind)) continue;\n const platformFinding = classifyBackingServiceDeclaration({ envName: input.envName, kind, declared, servableProviders: platformServable });\n if (platformFinding) findings.push({ ...platformFinding, reason: BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM });\n }\n return findings;\n}\n\nfunction describeUnservableReason(finding: UnservableBackingServiceDeclaration): string {\n switch (finding.reason) {\n case BackingServiceUnservableReason.NO_PROVIDER:\n return 'names no infrastructure provider';\n case BackingServiceUnservableReason.NO_SERVING_MODULE:\n return `names provider '${finding.resolvedProvider}', which no provider module can serve yet`;\n case BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM:\n return `names provider '${finding.resolvedProvider}', for which this platform holds no administrative credentials, `\n + 'so apps-manager cannot mint on it (which admin clients a platform holds is platform configuration)';\n }\n}\n\nfunction renderSelection(selection: BackingServiceProviderSelection): string {\n return selection.provider === undefined\n ? `{ source: '${selection.source}' }`\n : `{ source: '${selection.source}', provider: '${selection.provider}' }`;\n}\n\n/**\n * One line per finding: the environment, the kind, what was declared, why it cannot be served, and\n * the declarations that ARE servable for that kind. Shared by every caller so the wording is one.\n */\nexport function describeUnservableBackingServiceDeclaration(finding: UnservableBackingServiceDeclaration): string {\n const why = describeUnservableReason(finding);\n const instead = finding.servableAlternatives.length === 0\n ? 'nothing can serve this kind today, so do not declare it'\n : `servable declarations for '${finding.kind}': ${finding.servableAlternatives.map(renderSelection).join(' | ')}`;\n return `environment '${finding.envName}': backingServices.${finding.kind} ${renderSelection(finding.declared)} ${why}; ${instead}.`;\n}\n\n/** Thrown when a declaration the platform cannot serve reaches a lockfile projection. */\nexport class UnservableBackingServiceDeclarationError extends Error {\n readonly findings: ReadonlyArray<UnservableBackingServiceDeclaration>;\n\n constructor(findings: ReadonlyArray<UnservableBackingServiceDeclaration>) {\n super(\n 'These backing-service declarations cannot be served, so the platform would hand the application '\n + 'a credential for a server it never connects to:\\n'\n + findings.map((finding) => ` - ${describeUnservableBackingServiceDeclaration(finding)}`).join('\\n'),\n );\n this.name = 'UnservableBackingServiceDeclarationError';\n this.findings = findings;\n }\n}\n\n/** Refuse, naming every unservable declaration across every environment at once. */\nexport function assertBackingServiceDeclarationsServable(input: {\n envs: ReadonlyArray<{ envName: string; backingServices: BackingServicesEnvConfig | undefined }>;\n servableProviders: ReadonlySet<InfraProvider>;\n}): void {\n const findings = input.envs.flatMap((env) => findUnservableBackingServiceDeclarations({\n envName: env.envName,\n backingServices: env.backingServices,\n servableProviders: input.servableProviders,\n }));\n if (findings.length > 0) throw new UnservableBackingServiceDeclarationError(findings);\n}\n"]}
1
+ {"version":3,"file":"backing-service-servability.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/backing-service-servability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GAErB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,0CAA0C;AAC1C,MAAM,CAAN,IAAY,8BAmBX;AAnBD,WAAY,8BAA8B;IACxC,4FAA4F;IAC5F,6DAA2B,CAAA;IAC3B;;;OAGG;IACH,yEAAuC,CAAA;IACvC;;;;;;;;;OASG;IACH,+EAA6C,CAAA;AAC/C,CAAC,EAnBW,8BAA8B,KAA9B,8BAA8B,QAmBzC;AAcD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAuE;IACvH,CAAC,aAAa,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,IAAI,EAAE;IACrG,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,OAA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AC;AACxF,CAAC","sourcesContent":["import {\n BackingServiceKind,\n BackingServiceSource,\n resolveInfraProvider,\n type BackingServicesEnvConfig,\n} from './backing-services.schemas';\nimport { InfraProvider } from './infra-providers.schemas';\n\n/**\n * Is a `backingServices` declaration one the platform can actually SERVE?\n *\n * ## The defect this closes (#1693)\n *\n * A declaration used to be accepted when it merely parsed. Two classes of parseable declaration serve\n * nothing, and both passed `wildo config sync` and `wildo lock check` in silence:\n *\n * 1. **It resolves to no provider** — `redis: { source: MANAGED }`, a managed MongoDB brand other\n * than `'atlas'`. The lockfile materializer skipped the kind without a word.\n * 2. **It resolves to a provider no module can serve** — the seven managed PostgreSQL entries have no\n * module, and `AWS_S3` has one whose credential broker does not exist yet (#14). The materializer\n * fell back to hashing the authored entry, so the lockfile recorded a selection nothing executes.\n *\n * Neither \"provisions nothing\". The generators honour `source`, so a MANAGED cache gets no\n * self-hosted workload — while apps-manager, which named its modules and was never told the\n * declaration, minted the application's credential on the PLATFORM's own server. The application\n * received a credential for a server it never connects to. Since #1692 apps-manager is told, dispatches\n * on the declared provider and refuses one it cannot serve\n * ({@link findBackingServiceDeclarationsThePlatformCannotServe}); this offline check stops the same\n * declarations before they reach it.\n *\n * ## Why the servable set is an INPUT here, not computed here\n *\n * Servability is a property of the provider-module CATALOGUE (`@wildo-ai/platform-infra-providers`),\n * and that package depends on this one — never the reverse. So the catalogue derives the set\n * (`collectServableInfraProviders()`) and every caller hands it in. The check itself lives here, once,\n * so `wildo config validate`, `wildo config sync` and `wildo lock check` cannot disagree about which\n * declarations they refuse: the two lockfile projections reach it through `materializeInfraSection`,\n * which REQUIRES the set, and `config validate` calls {@link findUnservableBackingServiceDeclarations}\n * directly.\n *\n * ## No opt-out, deliberately\n *\n * An earlier design offered `acceptUnresolved: true`. It was dropped: it makes a known-broken\n * configuration representable, which is exactly a setting that looks like a control and does\n * nothing. A kind becomes declarable as `MANAGED` in the same change that adds the module serving it.\n */\n\n/** Why a declaration cannot be served. */\nexport enum BackingServiceUnservableReason {\n /** The `(kind, source, provider)` tuple names no `InfraProvider` catalogue entry at all. */\n NO_PROVIDER = 'no-provider',\n /**\n * It names a catalogue entry, but no provider module serves that entry — either none exists, or the\n * one that exists declares `unservableReason`.\n */\n NO_SERVING_MODULE = 'no-serving-module',\n /**\n * A module serves the entry, but THIS platform holds no administrative credentials for it — an Atlas\n * declaration on a platform with no Atlas API key, a self-hosted PostgreSQL declaration on a platform with\n * no PostgreSQL admin (#1692).\n *\n * Only apps-manager can know this: which admin clients a platform holds is platform configuration, and one\n * platform hosts many applications. The offline checks (`config validate` / `config sync` / `lock check`)\n * never produce it. apps-manager refuses the registration rather than minting on another provider — a\n * substitution would hand the application a credential for a server it does not connect to.\n */\n NOT_HELD_BY_PLATFORM = 'not-held-by-platform',\n}\n\n/** The authored half of a backing-service entry that decides which provider it names. */\nexport interface BackingServiceProviderSelection {\n source: BackingServiceSource;\n /** The brand, when the kind distinguishes several. See `resolveInfraProvider` for the vocabulary. */\n provider?: string;\n}\n\n/** The simplest authored declaration that selects one catalogue entry. */\nexport interface InfraProviderCanonicalDeclaration extends BackingServiceProviderSelection {\n kind: BackingServiceKind;\n}\n\n/**\n * For every `InfraProvider`, the SIMPLEST declaration that selects it — the inverse of\n * `resolveInfraProvider`, used to tell an author what they may write instead.\n *\n * Total over `InfraProvider` (a `Record`), so a provider added to the catalogue is a compile error\n * here until someone states how it is declared. That the inverse is truthful is pinned by a test that\n * resolves every row back through `resolveInfraProvider`; it is never trusted by construction.\n */\nexport const INFRA_PROVIDER_CANONICAL_DECLARATIONS: Readonly<Record<InfraProvider, InfraProviderCanonicalDeclaration>> = {\n [InfraProvider.MONGODB_SELF]: { kind: BackingServiceKind.MONGODB, source: BackingServiceSource.SELF },\n [InfraProvider.MONGODB_ATLAS]: { kind: BackingServiceKind.MONGODB, source: BackingServiceSource.MANAGED, provider: 'atlas' },\n [InfraProvider.POSTGRES_SELF]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.SELF },\n [InfraProvider.POSTGRES_MANAGED]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED },\n [InfraProvider.POSTGRES_AWS_RDS]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'aws-rds' },\n [InfraProvider.POSTGRES_GCP_CLOUD_SQL]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'gcp-cloud-sql' },\n [InfraProvider.POSTGRES_AZURE_DATABASE]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'azure-database' },\n [InfraProvider.POSTGRES_SUPABASE]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'supabase' },\n [InfraProvider.POSTGRES_NEON]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'neon' },\n [InfraProvider.POSTGRES_RENDER]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'render' },\n [InfraProvider.REDIS_SELF]: { kind: BackingServiceKind.REDIS, source: BackingServiceSource.SELF },\n [InfraProvider.RABBITMQ_SELF]: { kind: BackingServiceKind.RABBITMQ, source: BackingServiceSource.SELF },\n [InfraProvider.MINIO_SELF]: { kind: BackingServiceKind.S3, source: BackingServiceSource.SELF },\n [InfraProvider.AWS_S3]: { kind: BackingServiceKind.S3, source: BackingServiceSource.MANAGED },\n [InfraProvider.CLAMAV_SELF]: { kind: BackingServiceKind.CLAMAV, source: BackingServiceSource.SELF },\n [InfraProvider.IMMUDB_SELF]: { kind: BackingServiceKind.IMMUDB, source: BackingServiceSource.SELF },\n};\n\n/** One declaration the platform cannot serve, with everything the refusal message needs. */\nexport interface UnservableBackingServiceDeclaration {\n envName: string;\n kind: BackingServiceKind;\n declared: BackingServiceProviderSelection;\n reason: BackingServiceUnservableReason;\n /** The catalogue entry it names, when it names one (`NO_SERVING_MODULE`). */\n resolvedProvider?: InfraProvider;\n /** The simplest servable declarations for the same kind — what the author may write instead. */\n servableAlternatives: ReadonlyArray<BackingServiceProviderSelection>;\n}\n\n/**\n * The servable declarations for one kind, one per servable provider, in catalogue order.\n *\n * Empty when nothing can serve the kind — then the only servable choice is not to declare it.\n */\nexport function servableBackingServiceDeclarations(\n kind: BackingServiceKind,\n servableProviders: ReadonlySet<InfraProvider>,\n): ReadonlyArray<BackingServiceProviderSelection> {\n const alternatives: BackingServiceProviderSelection[] = [];\n for (const provider of Object.values(InfraProvider)) {\n if (!servableProviders.has(provider)) continue;\n const declaration = INFRA_PROVIDER_CANONICAL_DECLARATIONS[provider];\n if (declaration.kind !== kind) continue;\n alternatives.push({\n source: declaration.source,\n ...(declaration.provider === undefined ? {} : { provider: declaration.provider }),\n });\n }\n return alternatives;\n}\n\n/**\n * Every declaration in one environment that the platform cannot serve. Empty means every declared\n * kind resolves to a provider in `servableProviders`.\n *\n * Pure. `servableProviders` comes from `collectServableInfraProviders()` in\n * `@wildo-ai/platform-infra-providers`; see the file header for why it is an input.\n */\nexport function findUnservableBackingServiceDeclarations(input: {\n envName: string;\n backingServices: BackingServicesEnvConfig | undefined;\n servableProviders: ReadonlySet<InfraProvider>;\n}): UnservableBackingServiceDeclaration[] {\n const findings: UnservableBackingServiceDeclaration[] = [];\n if (!input.backingServices) return findings;\n\n for (const kind of Object.values(BackingServiceKind)) {\n const entry = input.backingServices[kind];\n if (!entry) continue;\n const finding = classifyBackingServiceDeclaration({\n envName: input.envName,\n kind,\n declared: entry,\n servableProviders: input.servableProviders,\n });\n if (finding) findings.push(finding);\n }\n return findings;\n}\n\n/**\n * One kind's declaration against a servable set: `undefined` when it resolves to a provider in the set,\n * otherwise the finding. The single place the resolve-then-check rule lives, so the offline checks above and\n * apps-manager's registration check below cannot disagree about what a declaration names.\n */\nfunction classifyBackingServiceDeclaration(input: {\n envName: string;\n kind: BackingServiceKind;\n declared: BackingServiceProviderSelection;\n servableProviders: ReadonlySet<InfraProvider>;\n}): UnservableBackingServiceDeclaration | undefined {\n const declared: BackingServiceProviderSelection = {\n source: input.declared.source,\n ...(input.declared.provider === undefined ? {} : { provider: input.declared.provider }),\n };\n const resolvedProvider = resolveInfraProvider(input.kind, declared.source, declared.provider);\n if (resolvedProvider !== undefined && input.servableProviders.has(resolvedProvider)) return undefined;\n return {\n envName: input.envName,\n kind: input.kind,\n declared,\n reason: resolvedProvider === undefined\n ? BackingServiceUnservableReason.NO_PROVIDER\n : BackingServiceUnservableReason.NO_SERVING_MODULE,\n ...(resolvedProvider === undefined ? {} : { resolvedProvider }),\n servableAlternatives: servableBackingServiceDeclarations(input.kind, input.servableProviders),\n };\n}\n\n/**\n * The declarations an application REGISTERS with that THIS platform cannot serve — apps-manager's half of\n * the servability check (#1692; the offline half is {@link findUnservableBackingServiceDeclarations}, #1693).\n *\n * Two sets, because they answer different questions:\n *\n * - `catalogueServableProviders` — what the provider-module catalogue can serve at all\n * (`collectServableInfraProviders()`). Every DECLARED kind is checked against it: a declaration the\n * catalogue refuses is refused here too, even if an older CLI let it through.\n * - `platformServableProviders` — the subset this platform holds what it needs for (an admin client for a\n * provider apps-manager mints on, nothing for one it does not). Checked only for `mintedKinds`, the kinds\n * apps-manager mints a credential on for THIS application: an environment's declaration also names stores\n * only the platform uses, and refusing an application over an admin client it would never use would be a\n * refusal with nothing behind it.\n *\n * A catalogue finding keeps its catalogue reason; a provider the catalogue serves and this platform does not\n * is {@link BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM}. Alternatives are always what THIS platform\n * can serve, because that is what the author can actually switch to here.\n *\n * Pure; apps-manager supplies both sets. An absent `declaredProviders` yields nothing — the previous\n * behaviour for every kind (see `ApplicationBackingServiceProviderDeclarations`).\n */\nexport function findBackingServiceDeclarationsThePlatformCannotServe(input: {\n envName: string;\n declaredProviders: Partial<Record<BackingServiceKind, BackingServiceProviderSelection>> | undefined;\n mintedKinds: ReadonlySet<BackingServiceKind>;\n catalogueServableProviders: ReadonlySet<InfraProvider>;\n platformServableProviders: ReadonlySet<InfraProvider>;\n}): UnservableBackingServiceDeclaration[] {\n const findings: UnservableBackingServiceDeclaration[] = [];\n if (!input.declaredProviders) return findings;\n const platformServable = new Set(\n [...input.platformServableProviders].filter((provider) => input.catalogueServableProviders.has(provider)),\n );\n\n for (const kind of Object.values(BackingServiceKind)) {\n const declared = input.declaredProviders[kind];\n if (!declared) continue;\n const catalogueFinding = classifyBackingServiceDeclaration({\n envName: input.envName,\n kind,\n declared,\n servableProviders: input.catalogueServableProviders,\n });\n if (catalogueFinding) {\n findings.push({ ...catalogueFinding, servableAlternatives: servableBackingServiceDeclarations(kind, platformServable) });\n continue;\n }\n if (!input.mintedKinds.has(kind)) continue;\n const platformFinding = classifyBackingServiceDeclaration({ envName: input.envName, kind, declared, servableProviders: platformServable });\n if (platformFinding) findings.push({ ...platformFinding, reason: BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM });\n }\n return findings;\n}\n\nfunction describeUnservableReason(finding: UnservableBackingServiceDeclaration): string {\n switch (finding.reason) {\n case BackingServiceUnservableReason.NO_PROVIDER:\n return 'names no infrastructure provider';\n case BackingServiceUnservableReason.NO_SERVING_MODULE:\n return `names provider '${finding.resolvedProvider}', which no provider module can serve yet`;\n case BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM:\n return `names provider '${finding.resolvedProvider}', for which this platform holds no administrative credentials, `\n + 'so apps-manager cannot mint on it (which admin clients a platform holds is platform configuration)';\n }\n}\n\nfunction renderSelection(selection: BackingServiceProviderSelection): string {\n return selection.provider === undefined\n ? `{ source: '${selection.source}' }`\n : `{ source: '${selection.source}', provider: '${selection.provider}' }`;\n}\n\n/**\n * One line per finding: the environment, the kind, what was declared, why it cannot be served, and\n * the declarations that ARE servable for that kind. Shared by every caller so the wording is one.\n */\nexport function describeUnservableBackingServiceDeclaration(finding: UnservableBackingServiceDeclaration): string {\n const why = describeUnservableReason(finding);\n const instead = finding.servableAlternatives.length === 0\n ? 'nothing can serve this kind today, so do not declare it'\n : `servable declarations for '${finding.kind}': ${finding.servableAlternatives.map(renderSelection).join(' | ')}`;\n return `environment '${finding.envName}': backingServices.${finding.kind} ${renderSelection(finding.declared)} ${why}; ${instead}.`;\n}\n\n/** Thrown when a declaration the platform cannot serve reaches a lockfile projection. */\nexport class UnservableBackingServiceDeclarationError extends Error {\n readonly findings: ReadonlyArray<UnservableBackingServiceDeclaration>;\n\n constructor(findings: ReadonlyArray<UnservableBackingServiceDeclaration>) {\n super(\n 'These backing-service declarations cannot be served, so the platform would hand the application '\n + 'a credential for a server it never connects to:\\n'\n + findings.map((finding) => ` - ${describeUnservableBackingServiceDeclaration(finding)}`).join('\\n'),\n );\n this.name = 'UnservableBackingServiceDeclarationError';\n this.findings = findings;\n }\n}\n\n/** Refuse, naming every unservable declaration across every environment at once. */\nexport function assertBackingServiceDeclarationsServable(input: {\n envs: ReadonlyArray<{ envName: string; backingServices: BackingServicesEnvConfig | undefined }>;\n servableProviders: ReadonlySet<InfraProvider>;\n}): void {\n const findings = input.envs.flatMap((env) => findUnservableBackingServiceDeclarations({\n envName: env.envName,\n backingServices: env.backingServices,\n servableProviders: input.servableProviders,\n }));\n if (findings.length > 0) throw new UnservableBackingServiceDeclarationError(findings);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"backing-services.schemas.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/backing-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,eAAe,EACf,aAAa,EACd,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,kBAAkB;IAC5B,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,EAAE,OAAO;IACT,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB;;;;OAIG;IACH,MAAM,WAAW;CAQlB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IAC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;AAEzB;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,8DAA8D;AAe9D,2HAA2H;AAC3H;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC,EAAE,MAAM,CAAC,kBAAkB,EAAE,eAAe,CAQ3F,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,CAAC,EAAE,MAAM,GAChB,aAAa,GAAG,SAAS,CA6D3B;AACD,uEAAuE"}
1
+ {"version":3,"file":"backing-services.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/backing-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,eAAe,EACf,aAAa,EACd,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,kBAAkB;IAC5B,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,EAAE,OAAO;IACT,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB;;;;OAIG;IACH,MAAM,WAAW;CAQlB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAuDD;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB;;;;;;kBAE3B,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,C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KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,8DAA8D;AAe9D,2HAA2H;AAC3H;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC,EAAE,MAAM,CAAC,kBAAkB,EAAE,eAAe,CAQ3F,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,CAAC,EAAE,MAAM,GAChB,aAAa,GAAG,SAAS,CA6D3B;AACD,uEAAuE"}
@@ -1 +1 @@
1
- {"version":3,"file":"backing-services.schemas.js","sourceRoot":"","sources":["../../../../src/project-config/shared/backing-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,eAAe,EACf,aAAa,GACd,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAN,IAAY,kBAoBX;AApBD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,qCAAe,CAAA;IACf,2CAAqB,CAAA;IACrB,+BAAS,CAAA;IACT,+CAAyB,CAAA;IACzB,uCAAiB,CAAA;IACjB;;;;OAIG;IACH,uCAAiB,CAAA;IACjB;;;;;;OAMG;AACL,CAAC,EApBW,kBAAkB,KAAlB,kBAAkB,QAoB7B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,qCAAa,CAAA;IACb,2CAAmB,CAAA;AACrB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB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;YACxB,qDAAqD;YACrD,8DAA8D;YAC9D,8DAA8D;YAC9D,8DAA8D;YAC9D,+BAA+B;YAC/B,IAAI,QAAQ,KAAK,OAAO;gBAAE,OAAO,aAAa,CAAC,UAAU,CAAC;YAC1D,IAAI,QAAQ,KAAK,KAAK;gBAAE,OAAO,aAAa,CAAC,MAAM,CAAC;YACpD,2DAA2D;YAC3D,2DAA2D;YAC3D,IAAI,MAAM,KAAK,oBAAoB,CAAC,IAAI;gBAAE,OAAO,aAAa,CAAC,UAAU,CAAC;YAC1E,IAAI,MAAM,KAAK,oBAAoB,CAAC,OAAO;gBAAE,OAAO,aAAa,CAAC,MAAM,CAAC;YACzE,OAAO,SAAS,CAAC;QACnB,KAAK,kBAAkB,CAAC,MAAM;YAC5B,IAAI,MAAM,KAAK,oBAAoB,CAAC,IAAI;gBAAE,OAAO,aAAa,CAAC,WAAW,CAAC;YAC3E,OAAO,SAAS,CAAC;QACnB,KAAK,kBAAkB,CAAC,MAAM;YAC5B,IAAI,MAAM,KAAK,oBAAoB,CAAC,IAAI;gBAAE,OAAO,aAAa,CAAC,WAAW,CAAC;YAC3E,wEAAwE;YACxE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AACD,uEAAuE","sourcesContent":["import { z } from 'zod';\nimport {\n InfraCapability,\n InfraProvider,\n} from './infra-providers.schemas';\n\n/**\n * The backing-service authoring surface of `wildo.infra.<env>.config.ts`.\n *\n * Import from `@wildo-ai/platform-config-lib`. Everything below is what an\n * environment file may declare under `backingServices: { ... }` — the closed kind\n * vocabulary, the hosting-model axis, and the per-kind entry shape. The\n * `InfraCapability` / `InfraProvider` projections further down this file are\n * planner-internal and deliberately outside the anchor: an app author never writes\n * them.\n *\n * Declare a kind ONLY when the environment actually runs it — keys are optional so a\n * flattened app declaration stays truthful about what it enables. Omitting a kind an\n * enabled engine capability depends on is the classic silent-degradation bug: e.g.\n * `COMPLIANCE_AUDIT_TRAIL` without `immudb` leaves the tamper-evident audit store\n * unbacked, which `wildo config sync` reports as a warning per environment.\n *\n * @wildo_source:part:start platform.config.backing-services facet:layer:platform facet:family:infra\n */\nexport enum BackingServiceKind {\n MONGODB = 'mongodb',\n REDIS = 'redis',\n RABBITMQ = 'rabbitmq',\n S3 = 's3',\n POSTGRESQL = 'postgresql',\n CLAMAV = 'clamav',\n /**\n * immudb — an immutable, cryptographically-verifiable database used as a\n * tamper-evident audit-log store (fills the `AUDIT_LOG_STORAGE` capability).\n * A stateful DB: a data volume in dev, self-hosted or immudb Vault in prod.\n */\n IMMUDB = 'immudb',\n /*\n * `backup` was WITHDRAWN 2026-09-26 (#1693), on the #476 precedent that withdrew\n * `metrics-telemetry`: it was declarable, resolved to no provider, rendered no workload, and\n * nothing anywhere read it — a field an author could fill in that did nothing. Backup itself is\n * designed in #8, which decides what an environment declares for it. Do not re-add a kind here\n * before something can serve it: `wildo config sync` refuses a declaration no provider serves.\n */\n}\n\n/**\n * Hosting model of a backing service instance — the orthogonal axis to\n * the **brand** (which is captured by the per-kind `provider` field).\n *\n * - `self`: self-hosted (Docker/K8s container managed by the platform,\n * or operator-managed on-prem). Brands here are open-source\n * software names (e.g. MinIO for S3, vanilla Postgres / MongoDB).\n * - `managed`: external vendor-managed service. Brands here are\n * vendor names (e.g. `'atlas'` for MongoDB Atlas, `'aws-rds'` for\n * AWS RDS, `'supabase'` for Supabase Postgres, `'aws'` for AWS S3).\n *\n * **Slice 4.B.0 reshape (2026-05-07)**: the `ATLAS` value was removed.\n * Pre-reshape `source: ATLAS` becomes `source: MANAGED, provider:\n * 'atlas'`. The reshape generalizes from \"Mongo + S3 are the only\n * brand-aware kinds\" to \"every kind can be brand-aware when the\n * managed market has multiple vendors\" — Postgres in particular\n * (RDS / GCP Cloud SQL / Supabase / Neon / Render / Azure).\n */\nexport enum BackingServiceSource {\n SELF = 'self',\n MANAGED = 'managed',\n}\n\n/**\n * Common fields every backing-service entry shares.\n *\n * Per-kind extensions add the fields that are SEMANTICALLY meaningful\n * for that kind only. Slice 3 closeout (M-4 + L-5): the previous shared\n * `BackingServiceEnvConfigSchema` collapsed `database` into a\n * `union(int, string)` and put `name` only on Mongo; both compromised\n * the framework-mindset rule that \"every field must carry its semantic\n * weight\". The split below means a typo like `redis: { database:\n * 'staging' }` (string on a kind that needs an integer DB index) is\n * rejected at parse time instead of crashing the runtime client at\n * connect time.\n */\nconst BackingServiceBaseSchema = z.object({\n source: z.enum(BackingServiceSource),\n /**\n * Brand of the backing service. Orthogonal to `source` (hosting\n * model). Required-in-spirit when `source === MANAGED` and the\n * managed market has multiple vendors (Mongo: `'atlas'` /\n * `'aws-documentdb'` / …; Postgres: `'aws-rds'` / `'gcp-cloud-sql'`\n * / `'supabase'` / `'neon'` / `'render'` / `'azure-database'`;\n * S3: `'aws'` / `'cloudflare-r2'` / …); optional when `source ===\n * SELF` (e.g. S3-self-hosted defaults to MinIO; `provider:\n * 'minio'` is allowed but redundant).\n *\n * Modeled as `z.string().optional()` rather than per-kind enum\n * unions to keep this base schema simple — the canonical brand\n * vocabulary lives in `resolveInfraProvider`'s dispatch table\n * (each kind documents which brand strings it recognizes; unknown\n * brands fall back to the kind's generic `<KIND>_MANAGED` /\n * `<KIND>_SELF` entry where one exists, otherwise return\n * `undefined`).\n *\n * Slice 4.B.0 (2026-05-07) generalized this from \"S3-only\" to\n * every brand-aware kind.\n */\n provider: z.string().min(1).optional(),\n /**\n * Override the catalog-derived hostname for this kind. Honored at\n * `HOST_FACING` perspective (always) and at `CONTAINER_INTERNAL` for\n * `MANAGED` sources. SELF + `CONTAINER_INTERNAL` keeps the catalog\n * container name because that is the only DNS the container network\n * can resolve.\n */\n host: z.string().min(1).optional(),\n /**\n * Override the catalog-derived listen port. Threaded into both\n * docker-compose `<authored>:<authored>` publish and the per-app\n * env-vars (`<KIND>_PORT`).\n */\n port: z.number().int().positive().optional(),\n}).strict();\n\n/**\n * MongoDB backing service. `database` is the database NAME (string).\n *\n * Mongo's connection URL has the shape `mongodb://host:port/<database>`\n * — this string corresponds to the path segment. Pre-3 the field was\n * `name`; renamed to `database` in Slice 3 closeout (L-5) so all\n * data-store kinds use the same property name for the same concept\n * (vs. Postgres which already used `database`).\n */\nexport const MongoBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.string().min(1).optional(),\n}).strict();\nexport type MongoBackingService = z.infer<typeof MongoBackingServiceSchema>;\n\n/**\n * Redis backing service. `database` is the LOGICAL DB INDEX (integer).\n *\n * Redis exposes 16 logical databases (0–15) on a single connection.\n * Authoring a string here (e.g. `'staging'`) would silently parse on\n * the pre-3 union schema and crash ioredis at connect; the integer\n * constraint with `max(15)` fails loud at parse time.\n */\nexport const RedisBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.number().int().min(0).max(15).optional(),\n}).strict();\nexport type RedisBackingService = z.infer<typeof RedisBackingServiceSchema>;\n\n/**\n * PostgreSQL backing service. `database` is the database NAME (string).\n *\n * Symmetric with `MongoBackingService.database` — both are the\n * database identifier in their respective connection URLs.\n */\nexport const PostgresBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.string().min(1).optional(),\n}).strict();\nexport type PostgresBackingService = z.infer<typeof PostgresBackingServiceSchema>;\n\n/**\n * RabbitMQ backing service. `vhost` is the RabbitMQ virtual host.\n *\n * AMQP virtual hosts isolate exchange/queue namespaces inside a single\n * broker. NOT a database — RabbitMQ has no DB concept — so the field\n * is intentionally NOT named `database`.\n */\nexport const RabbitBackingServiceSchema = BackingServiceBaseSchema.extend({\n vhost: z.string().min(1).optional(),\n}).strict();\nexport type RabbitBackingService = z.infer<typeof RabbitBackingServiceSchema>;\n\n/**\n * S3-compatible backing service (MinIO, Scaleway Object Storage, AWS).\n *\n * `endpoint` is a URL (`http://localhost:9000`, `https://s3.eu-west.amazonaws.com`)\n * — the resolver parses it into host/port. `bucket` is the S3 bucket\n * name. NOT a database — S3 has no DB concept.\n */\nexport const S3BackingServiceSchema = BackingServiceBaseSchema.extend({\n endpoint: z.string().min(1).optional(),\n bucket: z.string().min(1).optional(),\n}).strict();\nexport type S3BackingService = z.infer<typeof S3BackingServiceSchema>;\n\n/** ClamAV anti-virus daemon. Stateless, no database/vhost/bucket. */\nexport const ClamAvBackingServiceSchema = BackingServiceBaseSchema;\nexport type ClamAvBackingService = z.infer<typeof ClamAvBackingServiceSchema>;\n\n/**\n * immudb backing service (tamper-evident audit-log store). A stateful DB.\n *\n * On `source: SELF` the credentials are MINTED, never authored (#1696): the platform\n * gives each application its OWN immudb database and its OWN user, which can write that\n * database and nothing else, and delivers both with the application's platform secrets.\n * The name is derived from the application and kept across re-registrations, so\n * `database` is not read for a self-hosted store; it names the database of a MANAGED\n * one.\n *\n * Declare this in EVERY environment where the `COMPLIANCE_AUDIT_TRAIL` engine\n * capability is enabled. `wildo config sync` warns per environment when the audit\n * capability is on but no environment declares an audit store, and the audit client\n * then has nowhere tamper-evident to write.\n *\n * You do NOT author the state-signing keypair that makes the store's\n * whole-server-substitution defense work. The framework provisions it (private half\n * mounted into a `source: SELF` immudb via `--signingKey`, public half pinned by the\n * audit client as `IMMUDB_STATE_PUBLIC_KEY`) — declaring the service is the whole job.\n *\n * @example\n * ```ts\n * backingServices: {\n * immudb: { source: BackingServiceSource.SELF },\n * }\n * ```\n */\nexport const ImmudbBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.string().min(1).optional(),\n}).strict();\nexport type ImmudbBackingService = z.infer<typeof ImmudbBackingServiceSchema>;\n\n/**\n * Discriminated UNION over all backing-service kinds. Used by the\n * `ServiceAddressResolver` and helpers that accept any kind and read\n * only base fields (`source`, `host`, `port`). Consumers that need\n * kind-specific fields MUST narrow first (e.g. via the per-kind type\n * exports above).\n */\nexport type BackingServiceEnvConfig =\n | MongoBackingService\n | RedisBackingService\n | PostgresBackingService\n | RabbitBackingService\n | S3BackingService\n | ClamAvBackingService\n | ImmudbBackingService;\n\n/**\n * Per-environment backing services config (source for each service).\n * Used in environment-specific infra descriptors.\n *\n * Keys stay optional because an app-owned environment only needs to declare the\n * backing services it actually enables. Requiring the full enum-keyed record\n * would force disabled services (for example `postgresql`) into every env file\n * and breaks truthful flattened targeted-app declarations.\n */\nexport const BackingServicesEnvConfigSchema = z.object({\n [BackingServiceKind.MONGODB]: MongoBackingServiceSchema.optional(),\n [BackingServiceKind.REDIS]: RedisBackingServiceSchema.optional(),\n [BackingServiceKind.RABBITMQ]: RabbitBackingServiceSchema.optional(),\n [BackingServiceKind.S3]: S3BackingServiceSchema.optional(),\n [BackingServiceKind.POSTGRESQL]: PostgresBackingServiceSchema.optional(),\n [BackingServiceKind.CLAMAV]: ClamAvBackingServiceSchema.optional(),\n [BackingServiceKind.IMMUDB]: ImmudbBackingServiceSchema.optional(),\n}).strict();\nexport type BackingServicesEnvConfig = z.infer<typeof BackingServicesEnvConfigSchema>;\n/** @wildo_source:part:end platform.config.backing-services */\n\n// =============================================================================\n// BackingServiceKind ↔ InfraCapability / InfraProvider projections\n// =============================================================================\n//\n// Per `infra-provider-planner.md` R-B (locked 2026-05-06): `BackingServicesEnvConfig`\n// IS the canonical per-env infra-selection authoring surface. The\n// `InfraCapability` / `InfraProvider` enums are the planner's projection\n// vocabulary (used by `InfraProviderModule.supportedCapabilities`,\n// `wildo-saas.lock.json sections.infra` keying, and any tooling that\n// walks \"what infra is selected per env\"). The mappings below are the\n// single source of truth for that projection — no other code may\n// reconstruct them locally.\n\n/** @wildo_source:part:start platform.config.infra-provider-resolution facet:layer:platform facet:audience:app-developer */\n/**\n * `BackingServiceKind` → `InfraCapability`. Every extension to `BackingServiceKind` MUST extend this\n * map in the same commit, otherwise the planner cannot project the new kind to its capability slot.\n *\n * INJECTIVE, not bijective — and the difference is a real property of the model rather than a gap.\n * A capability may be granted to a runtime without any environment declaring a backing service for\n * it; see {@link RUNTIME_GRANTED_INFRA_CAPABILITIES} for the ones that are, and why.\n */\nexport const BackingServiceKindToInfraCapability: Record<BackingServiceKind, InfraCapability> = {\n [BackingServiceKind.MONGODB]: InfraCapability.DOCUMENT_DATABASE,\n [BackingServiceKind.POSTGRESQL]: InfraCapability.RELATIONAL_DATABASE,\n [BackingServiceKind.RABBITMQ]: InfraCapability.QUEUING_SYSTEM,\n [BackingServiceKind.REDIS]: InfraCapability.CACHE_MANAGER,\n [BackingServiceKind.S3]: InfraCapability.OBJECT_STORAGE,\n [BackingServiceKind.CLAMAV]: InfraCapability.ANTIVIRUS_SCANNING,\n [BackingServiceKind.IMMUDB]: InfraCapability.AUDIT_LOG_STORAGE,\n};\n\n/**\n * Project `(BackingServiceKind, source, provider?)` → `InfraProvider`.\n *\n * The three-axis dispatch (kind × hosting-model × brand) generalizes\n * the source/brand split across all kinds (Slice 4.B.0, 2026-05-07\n * — was source-only with Atlas as a special source value before).\n *\n * **Brand vocabulary** per kind (`provider` field on the authored\n * `BackingService<X>Schema`):\n *\n * | Kind | source | provider | InfraProvider | Servable today |\n * |---|---|---|---|---|\n * | `MONGODB` | `SELF` | (any) | `MONGODB_SELF` | yes |\n * | `MONGODB` | `MANAGED` | `'atlas'` | `MONGODB_ATLAS` | yes |\n * | `POSTGRESQL` | `SELF` | (any) | `POSTGRES_SELF` | yes |\n * | `POSTGRESQL` | `MANAGED` | `'aws-rds'` | `POSTGRES_AWS_RDS` | no — no module |\n * | `POSTGRESQL` | `MANAGED` | `'gcp-cloud-sql'` | `POSTGRES_GCP_CLOUD_SQL` | no — no module |\n * | `POSTGRESQL` | `MANAGED` | `'azure-database'` | `POSTGRES_AZURE_DATABASE` | no — no module |\n * | `POSTGRESQL` | `MANAGED` | `'supabase'` | `POSTGRES_SUPABASE` | no — no module |\n * | `POSTGRESQL` | `MANAGED` | `'neon'` | `POSTGRES_NEON` | no — no module |\n * | `POSTGRESQL` | `MANAGED` | `'render'` | `POSTGRES_RENDER` | no — no module |\n * | `POSTGRESQL` | `MANAGED` | unset or unrecognized | `POSTGRES_MANAGED` (generic fallback) | no — no module |\n * | `REDIS` | `SELF` | (any) | `REDIS_SELF` | yes |\n * | `RABBITMQ` | `SELF` | (any) | `RABBITMQ_SELF` | yes |\n * | `S3` | (either) | `'minio'` | `MINIO_SELF` | yes |\n * | `S3` | (either) | `'aws'` | `AWS_S3` | no — no credential broker for AWS yet |\n * | `S3` | `SELF` | unset or unrecognized | `MINIO_SELF` | yes |\n * | `S3` | `MANAGED` | unset or unrecognized | `AWS_S3` | no — no credential broker for AWS yet |\n * | `CLAMAV` | `SELF` | (any) | `CLAMAV_SELF` | yes |\n * | `IMMUDB` | `SELF` | (any) | `IMMUDB_SELF` | yes — one database and one confined user minted per application (#1696) |\n *\n * Returns `undefined` for combinations not in the table: a managed cache, broker, antivirus scanner\n * or audit store, and a managed MongoDB under any brand other than `'atlas'`. PostgreSQL has a\n * generic managed fallback; S3 uses brand-first resolution, then source-based defaults.\n *\n * ## Resolving is not the same as being servable\n *\n * This function answers only \"which catalogue entry does this declaration NAME\". Whether the\n * platform can actually deliver that entry — mint the application's credential on the server the\n * application connects to — is a separate question, answered by {@link findUnservableBackingServiceDeclarations}\n * against the provider-module catalogue. A declaration that resolves to nothing, OR to an entry no\n * module can serve (the seven managed PostgreSQL entries, and `AWS_S3` until its credential broker\n * exists), is REFUSED by `wildo config validate`, `wildo config sync` and `wildo lock check`, with a\n * message naming the declarations that ARE servable for that kind.\n *\n * The same `(source, provider)` pair travels to apps-manager at every registration, and apps-manager\n * resolves it with THIS function and mints the application's credentials on the result — so the provider\n * the lockfile records and the provider a credential is minted on are one answer. It also refuses a\n * provider the platform itself holds no administrative credentials for (an Atlas declaration on a\n * platform with no Atlas API key); which providers a platform can serve is platform configuration.\n *\n * ## What this means when you author an environment\n *\n * **`MANAGED` reaches almost nothing today.** Of the managed rows in the table above, the only one\n * the platform serves is MongoDB Atlas (`{ source: MANAGED, provider: 'atlas' }`). Every other kind\n * is declared `{ source: SELF }`. The managed PostgreSQL brands and AWS S3 are catalogue entries a\n * module will serve later, not choices you can make now — a kind becomes declarable as `MANAGED` in\n * the same change that adds the module serving it, and there is deliberately no opt-out: a\n * configuration the platform cannot serve would receive a credential for a server the application\n * never connects to.\n *\n * **An unrecognised brand is not the same failure on every kind.** On the relational database it\n * falls back to the generic managed entry (which is not servable, so it is refused all the same). On\n * the document database, an unknown managed brand resolves to nothing. Object storage recognizes\n * minio/aws first, then falls back by source: SELF to MinIO, MANAGED to AWS S3, including\n * unrecognized brands.\n *\n * **Provider resolution and workload inclusion answer different questions.** Compose and Kubernetes\n * both use the same per-kind inclusion policy, separately from catalogue resolution. Cache, broker\n * and S3 default to self-hosted unless explicitly MANAGED; ClamAV and immudb require explicit SELF.\n * MongoDB and PostgreSQL also include the platform database requirement: an application-level\n * managed choice does not remove a self-hosted database still needed by the platform. Do not infer\n * workload inclusion from this provider resolver.\n */\nexport function resolveInfraProvider(\n kind: BackingServiceKind,\n source: BackingServiceSource,\n provider?: string,\n): InfraProvider | undefined {\n switch (kind) {\n case BackingServiceKind.MONGODB:\n if (source === BackingServiceSource.SELF) return InfraProvider.MONGODB_SELF;\n if (source === BackingServiceSource.MANAGED && provider === 'atlas') return InfraProvider.MONGODB_ATLAS;\n // Other Mongo managed brands (e.g., AWS DocumentDB) — extend\n // the `InfraProvider` enum + this branch in the same slice\n // that adds the first concrete consumer.\n return undefined;\n case BackingServiceKind.POSTGRESQL:\n if (source === BackingServiceSource.SELF) return InfraProvider.POSTGRES_SELF;\n if (source === BackingServiceSource.MANAGED) {\n switch (provider) {\n case 'aws-rds': return InfraProvider.POSTGRES_AWS_RDS;\n case 'gcp-cloud-sql': return InfraProvider.POSTGRES_GCP_CLOUD_SQL;\n case 'azure-database': return InfraProvider.POSTGRES_AZURE_DATABASE;\n case 'supabase': return InfraProvider.POSTGRES_SUPABASE;\n case 'neon': return InfraProvider.POSTGRES_NEON;\n case 'render': return InfraProvider.POSTGRES_RENDER;\n // Generic fallback when the operator has authored\n // `source: MANAGED` without naming a brand (or with an\n // unrecognized brand). Resolving it NAMES the generic\n // catalogue entry; it does not make it servable. No module\n // serves any managed PostgreSQL entry yet, so every one of\n // these is refused by the servability check (#1693) rather\n // than recorded in the lockfile as a selection nothing runs.\n default: return InfraProvider.POSTGRES_MANAGED;\n }\n }\n return undefined;\n case BackingServiceKind.REDIS:\n if (source === BackingServiceSource.SELF) return InfraProvider.REDIS_SELF;\n // Managed Redis brands (ElastiCache, Upstash, Redis Cloud, …)\n // — not catalogued yet; future expansion.\n return undefined;\n case BackingServiceKind.RABBITMQ:\n if (source === BackingServiceSource.SELF) return InfraProvider.RABBITMQ_SELF;\n // Managed RabbitMQ brands (CloudAMQP, AWS MQ, …) —\n // not catalogued yet; future expansion.\n return undefined;\n case BackingServiceKind.S3:\n // S3 dispatch is brand-first because the protocol is\n // standardized (S3-compatible) and the same `source` can host\n // multiple software stacks — `source: SELF` could be MinIO or\n // a self-managed AWS S3 cluster (theoretically). The brand is\n // the canonical disambiguator.\n if (provider === 'minio') return InfraProvider.MINIO_SELF;\n if (provider === 'aws') return InfraProvider.AWS_S3;\n // Default source-based mapping for unbranded S3 — MinIO is\n // the canonical self-hosted; AWS is the canonical managed.\n if (source === BackingServiceSource.SELF) return InfraProvider.MINIO_SELF;\n if (source === BackingServiceSource.MANAGED) return InfraProvider.AWS_S3;\n return undefined;\n case BackingServiceKind.CLAMAV:\n if (source === BackingServiceSource.SELF) return InfraProvider.CLAMAV_SELF;\n return undefined;\n case BackingServiceKind.IMMUDB:\n if (source === BackingServiceSource.SELF) return InfraProvider.IMMUDB_SELF;\n // Managed immudb (immudb Vault) — not catalogued yet; future expansion.\n return undefined;\n }\n}\n/** @wildo_source:part:end platform.config.infra-provider-resolution */\n"]}
1
+ {"version":3,"file":"backing-services.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/backing-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,eAAe,EACf,aAAa,GACd,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAN,IAAY,kBAoBX;AApBD,WAAY,kBAAkB;IAC5B,yCAAm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;IACrB,CAAC;AACH,CAAC;AACD,uEAAuE","sourcesContent":["import { z } from 'zod';\nimport {\n InfraCapability,\n InfraProvider,\n} from './infra-providers.schemas';\n\n/**\n * The backing-service authoring surface of `wildo.infra.<env>.config.ts`.\n *\n * Import from `@wildo-ai/platform-config-lib`. Everything below is what an\n * environment file may declare under `backingServices: { ... }` — the closed kind\n * vocabulary, the hosting-model axis, and the per-kind entry shape. The\n * `InfraCapability` / `InfraProvider` projections further down this file are\n * planner-internal and deliberately outside the anchor: an app author never writes\n * them.\n *\n * Declare a kind ONLY when the environment actually runs it — keys are optional so a\n * flattened app declaration stays truthful about what it enables. Omitting a kind an\n * enabled engine capability depends on is the classic silent-degradation bug: e.g.\n * `COMPLIANCE_AUDIT_TRAIL` without `immudb` leaves the tamper-evident audit store\n * unbacked, which `wildo config sync` reports as a warning per environment.\n *\n * @wildo_source:part:start platform.config.backing-services facet:layer:platform facet:family:infra\n */\nexport enum BackingServiceKind {\n MONGODB = 'mongodb',\n REDIS = 'redis',\n RABBITMQ = 'rabbitmq',\n S3 = 's3',\n POSTGRESQL = 'postgresql',\n CLAMAV = 'clamav',\n /**\n * immudb — an immutable, cryptographically-verifiable database used as a\n * tamper-evident audit-log store (fills the `AUDIT_LOG_STORAGE` capability).\n * A stateful DB: a data volume in dev, self-hosted or immudb Vault in prod.\n */\n IMMUDB = 'immudb',\n /*\n * `backup` was WITHDRAWN 2026-09-26 (#1693), on the #476 precedent that withdrew\n * `metrics-telemetry`: it was declarable, resolved to no provider, rendered no workload, and\n * nothing anywhere read it — a field an author could fill in that did nothing. Backup itself is\n * designed in #8, which decides what an environment declares for it. Do not re-add a kind here\n * before something can serve it: `wildo config sync` refuses a declaration no provider serves.\n */\n}\n\n/**\n * Hosting model of a backing service instance — the orthogonal axis to\n * the **brand** (which is captured by the per-kind `provider` field).\n *\n * - `self`: self-hosted (Docker/K8s container managed by the platform,\n * or operator-managed on-prem). Brands here are open-source\n * software names (e.g. MinIO for S3, vanilla Postgres / MongoDB).\n * - `managed`: external vendor-managed service. Brands here are\n * vendor names (e.g. `'atlas'` for MongoDB Atlas, `'aws-rds'` for\n * AWS RDS, `'supabase'` for Supabase Postgres, `'aws'` for AWS S3).\n *\n * **Slice 4.B.0 reshape (2026-05-07)**: the `ATLAS` value was removed.\n * Pre-reshape `source: ATLAS` becomes `source: MANAGED, provider:\n * 'atlas'`. The reshape generalizes from \"Mongo + S3 are the only\n * brand-aware kinds\" to \"every kind can be brand-aware when the\n * managed market has multiple vendors\" — Postgres in particular\n * (RDS / GCP Cloud SQL / Supabase / Neon / Render / Azure).\n */\nexport enum BackingServiceSource {\n SELF = 'self',\n MANAGED = 'managed',\n}\n\n/**\n * Common fields every backing-service entry shares.\n *\n * Per-kind extensions add the fields that are SEMANTICALLY meaningful\n * for that kind only. Slice 3 closeout (M-4 + L-5): the previous shared\n * `BackingServiceEnvConfigSchema` collapsed `database` into a\n * `union(int, string)` and put `name` only on Mongo; both compromised\n * the framework-mindset rule that \"every field must carry its semantic\n * weight\". The split below means a typo like `redis: { database:\n * 'staging' }` (string on a kind that needs an integer DB index) is\n * rejected at parse time instead of crashing the runtime client at\n * connect time.\n */\nconst BackingServiceBaseSchema = z.object({\n source: z.enum(BackingServiceSource),\n /**\n * Brand of the backing service. Orthogonal to `source` (hosting\n * model). Required-in-spirit when `source === MANAGED` and the\n * managed market has multiple vendors (Mongo: `'atlas'` /\n * `'aws-documentdb'` / …; Postgres: `'aws-rds'` / `'gcp-cloud-sql'`\n * / `'supabase'` / `'neon'` / `'render'` / `'azure-database'`;\n * S3: `'aws'` / `'cloudflare-r2'` / …); optional when `source ===\n * SELF` (e.g. S3-self-hosted defaults to MinIO; `provider:\n * 'minio'` is allowed but redundant).\n *\n * Modeled as `z.string().optional()` rather than per-kind enum\n * unions to keep this base schema simple — the canonical brand\n * vocabulary lives in `resolveInfraProvider`'s dispatch table\n * (each kind documents which brand strings it recognizes; unknown\n * brands fall back to the kind's generic `<KIND>_MANAGED` /\n * `<KIND>_SELF` entry where one exists, otherwise return\n * `undefined`).\n *\n * Slice 4.B.0 (2026-05-07) generalized this from \"S3-only\" to\n * every brand-aware kind.\n */\n provider: z.string().min(1).optional(),\n /**\n * Override the catalog-derived hostname for this kind. Honored at\n * `HOST_FACING` perspective (always) and at `CONTAINER_INTERNAL` for\n * `MANAGED` sources. SELF + `CONTAINER_INTERNAL` keeps the catalog\n * container name because that is the only DNS the container network\n * can resolve.\n */\n host: z.string().min(1).optional(),\n /**\n * Override the catalog-derived listen port. Threaded into both\n * docker-compose `<authored>:<authored>` publish and the per-app\n * env-vars (`<KIND>_PORT`).\n */\n port: z.number().int().positive().optional(),\n}).strict();\n\n/**\n * MongoDB backing service. `database` is the database NAME (string).\n *\n * Mongo's connection URL has the shape `mongodb://host:port/<database>`\n * — this string corresponds to the path segment. Pre-3 the field was\n * `name`; renamed to `database` in Slice 3 closeout (L-5) so all\n * data-store kinds use the same property name for the same concept\n * (vs. Postgres which already used `database`).\n */\nexport const MongoBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.string().min(1).optional(),\n}).strict();\nexport type MongoBackingService = z.infer<typeof MongoBackingServiceSchema>;\n\n/**\n * Redis backing service. `database` is the LOGICAL DB INDEX (integer).\n *\n * Redis exposes 16 logical databases (0–15) on a single connection.\n * Authoring a string here (e.g. `'staging'`) would silently parse on\n * the pre-3 union schema and crash ioredis at connect; the integer\n * constraint with `max(15)` fails loud at parse time.\n */\nexport const RedisBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.number().int().min(0).max(15).optional(),\n}).strict();\nexport type RedisBackingService = z.infer<typeof RedisBackingServiceSchema>;\n\n/**\n * PostgreSQL backing service. `database` is the database NAME (string).\n *\n * Symmetric with `MongoBackingService.database` — both are the\n * database identifier in their respective connection URLs.\n */\nexport const PostgresBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.string().min(1).optional(),\n}).strict();\nexport type PostgresBackingService = z.infer<typeof PostgresBackingServiceSchema>;\n\n/**\n * RabbitMQ backing service. `vhost` is the RabbitMQ virtual host.\n *\n * AMQP virtual hosts isolate exchange/queue namespaces inside a single\n * broker. NOT a database — RabbitMQ has no DB concept — so the field\n * is intentionally NOT named `database`.\n */\nexport const RabbitBackingServiceSchema = BackingServiceBaseSchema.extend({\n vhost: z.string().min(1).optional(),\n}).strict();\nexport type RabbitBackingService = z.infer<typeof RabbitBackingServiceSchema>;\n\n/**\n * S3-compatible backing service (MinIO, Scaleway Object Storage, AWS).\n *\n * `endpoint` is a URL (`http://localhost:9000`, `https://s3.eu-west.amazonaws.com`)\n * — the resolver parses it into host/port. `bucket` is the S3 bucket\n * name. NOT a database — S3 has no DB concept.\n */\nexport const S3BackingServiceSchema = BackingServiceBaseSchema.extend({\n endpoint: z.string().min(1).optional(),\n bucket: z.string().min(1).optional(),\n}).strict();\nexport type S3BackingService = z.infer<typeof S3BackingServiceSchema>;\n\n/** ClamAV anti-virus daemon. Stateless, no database/vhost/bucket. */\nexport const ClamAvBackingServiceSchema = BackingServiceBaseSchema;\nexport type ClamAvBackingService = z.infer<typeof ClamAvBackingServiceSchema>;\n\n/**\n * immudb backing service (tamper-evident audit-log store). A stateful DB.\n *\n * On `source: SELF` the credentials are MINTED, never authored (#1696): the platform\n * gives each application its OWN immudb database and its OWN user, which can write that\n * database and nothing else, and delivers both with the application's platform secrets.\n * The name is derived from the application and kept across re-registrations, so\n * `database` is not read for a self-hosted store; it names the database of a MANAGED\n * one.\n *\n * Declare this in EVERY environment where the `COMPLIANCE_AUDIT_TRAIL` engine\n * capability is enabled. `wildo config sync` warns per environment when the audit\n * capability is on but no environment declares an audit store, and the audit client\n * then has nowhere tamper-evident to write.\n *\n * You do NOT author the state-signing keypair that makes the store's\n * whole-server-substitution defense work. The framework provisions it (private half\n * mounted into a `source: SELF` immudb via `--signingKey`, public half pinned by the\n * audit client as `IMMUDB_STATE_PUBLIC_KEY`) — declaring the service is the whole job.\n *\n * @example\n * ```ts\n * backingServices: {\n * immudb: { source: BackingServiceSource.SELF },\n * }\n * ```\n */\nexport const ImmudbBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.string().min(1).optional(),\n}).strict();\nexport type ImmudbBackingService = z.infer<typeof ImmudbBackingServiceSchema>;\n\n/**\n * Discriminated UNION over all backing-service kinds. Used by the\n * `ServiceAddressResolver` and helpers that accept any kind and read\n * only base fields (`source`, `host`, `port`). Consumers that need\n * kind-specific fields MUST narrow first (e.g. via the per-kind type\n * exports above).\n */\nexport type BackingServiceEnvConfig =\n | MongoBackingService\n | RedisBackingService\n | PostgresBackingService\n | RabbitBackingService\n | S3BackingService\n | ClamAvBackingService\n | ImmudbBackingService;\n\n/**\n * Per-environment backing services config (source for each service).\n * Used in environment-specific infra descriptors.\n *\n * Keys stay optional because an app-owned environment only needs to declare the\n * backing services it actually enables. Requiring the full enum-keyed record\n * would force disabled services (for example `postgresql`) into every env file\n * and breaks truthful flattened targeted-app declarations.\n */\nexport const BackingServicesEnvConfigSchema = z.object({\n [BackingServiceKind.MONGODB]: MongoBackingServiceSchema.optional(),\n [BackingServiceKind.REDIS]: RedisBackingServiceSchema.optional(),\n [BackingServiceKind.RABBITMQ]: RabbitBackingServiceSchema.optional(),\n [BackingServiceKind.S3]: S3BackingServiceSchema.optional(),\n [BackingServiceKind.POSTGRESQL]: PostgresBackingServiceSchema.optional(),\n [BackingServiceKind.CLAMAV]: ClamAvBackingServiceSchema.optional(),\n [BackingServiceKind.IMMUDB]: ImmudbBackingServiceSchema.optional(),\n}).strict();\nexport type BackingServicesEnvConfig = z.infer<typeof BackingServicesEnvConfigSchema>;\n/** @wildo_source:part:end platform.config.backing-services */\n\n// =============================================================================\n// BackingServiceKind ↔ InfraCapability / InfraProvider projections\n// =============================================================================\n//\n// Per `infra-provider-planner.md` R-B (locked 2026-05-06): `BackingServicesEnvConfig`\n// IS the canonical per-env infra-selection authoring surface. The\n// `InfraCapability` / `InfraProvider` enums are the planner's projection\n// vocabulary (used by `InfraProviderModule.supportedCapabilities`,\n// `wildo-saas.lock.json sections.infra` keying, and any tooling that\n// walks \"what infra is selected per env\"). The mappings below are the\n// single source of truth for that projection — no other code may\n// reconstruct them locally.\n\n/** @wildo_source:part:start platform.config.infra-provider-resolution facet:layer:platform facet:audience:app-developer */\n/**\n * `BackingServiceKind` → `InfraCapability`. Every extension to `BackingServiceKind` MUST extend this\n * map in the same commit, otherwise the planner cannot project the new kind to its capability slot.\n *\n * INJECTIVE, not bijective — and the difference is a real property of the model rather than a gap.\n * A capability may be granted to a runtime without any environment declaring a backing service for\n * it; see {@link RUNTIME_GRANTED_INFRA_CAPABILITIES} for the ones that are, and why.\n */\nexport const BackingServiceKindToInfraCapability: Record<BackingServiceKind, InfraCapability> = {\n [BackingServiceKind.MONGODB]: InfraCapability.DOCUMENT_DATABASE,\n [BackingServiceKind.POSTGRESQL]: InfraCapability.RELATIONAL_DATABASE,\n [BackingServiceKind.RABBITMQ]: InfraCapability.QUEUING_SYSTEM,\n [BackingServiceKind.REDIS]: InfraCapability.CACHE_MANAGER,\n [BackingServiceKind.S3]: InfraCapability.OBJECT_STORAGE,\n [BackingServiceKind.CLAMAV]: InfraCapability.ANTIVIRUS_SCANNING,\n [BackingServiceKind.IMMUDB]: InfraCapability.AUDIT_LOG_STORAGE,\n};\n\n/**\n * Project `(BackingServiceKind, source, provider?)` → `InfraProvider`.\n *\n * The three-axis dispatch (kind × hosting-model × brand) generalizes\n * the source/brand split across all kinds (Slice 4.B.0, 2026-05-07\n * — was source-only with Atlas as a special source value before).\n *\n * **Brand vocabulary** per kind (`provider` field on the authored\n * `BackingService<X>Schema`):\n *\n * | Kind | source | provider | InfraProvider | Servable today |\n * |---|---|---|---|---|\n * | `MONGODB` | `SELF` | (any) | `MONGODB_SELF` | yes |\n * | `MONGODB` | `MANAGED` | `'atlas'` | `MONGODB_ATLAS` | yes |\n * | `POSTGRESQL` | `SELF` | (any) | `POSTGRES_SELF` | yes |\n * | `POSTGRESQL` | `MANAGED` | `'aws-rds'` | `POSTGRES_AWS_RDS` | no — no module |\n * | `POSTGRESQL` | `MANAGED` | `'gcp-cloud-sql'` | `POSTGRES_GCP_CLOUD_SQL` | no — no module |\n * | `POSTGRESQL` | `MANAGED` | `'azure-database'` | `POSTGRES_AZURE_DATABASE` | no — no module |\n * | `POSTGRESQL` | `MANAGED` | `'supabase'` | `POSTGRES_SUPABASE` | no — no module |\n * | `POSTGRESQL` | `MANAGED` | `'neon'` | `POSTGRES_NEON` | no — no module |\n * | `POSTGRESQL` | `MANAGED` | `'render'` | `POSTGRES_RENDER` | no — no module |\n * | `POSTGRESQL` | `MANAGED` | unset or unrecognized | `POSTGRES_MANAGED` (generic fallback) | no — no module |\n * | `REDIS` | `SELF` | (any) | `REDIS_SELF` | yes |\n * | `RABBITMQ` | `SELF` | (any) | `RABBITMQ_SELF` | yes |\n * | `S3` | (either) | `'minio'` | `MINIO_SELF` | yes |\n * | `S3` | (either) | `'aws'` | `AWS_S3` | no — no credential broker for AWS yet |\n * | `S3` | `SELF` | unset or unrecognized | `MINIO_SELF` | yes |\n * | `S3` | `MANAGED` | unset or unrecognized | `AWS_S3` | no — no credential broker for AWS yet |\n * | `CLAMAV` | `SELF` | (any) | `CLAMAV_SELF` | yes |\n * | `IMMUDB` | `SELF` | (any) | `IMMUDB_SELF` | yes — one database and one confined user minted per application (#1696) |\n *\n * Returns `undefined` for combinations not in the table: a managed cache, broker, antivirus scanner\n * or audit store, and a managed MongoDB under any brand other than `'atlas'`. PostgreSQL has a\n * generic managed fallback; S3 uses brand-first resolution, then source-based defaults.\n *\n * ## Resolving is not the same as being servable\n *\n * This function answers only \"which catalogue entry does this declaration NAME\". Whether the\n * platform can actually deliver that entry — mint the application's credential on the server the\n * application connects to — is a separate question, answered by {@link findUnservableBackingServiceDeclarations}\n * against the provider-module catalogue. A declaration that resolves to nothing, OR to an entry no\n * module can serve (the seven managed PostgreSQL entries, and `AWS_S3` until its credential broker\n * exists), is REFUSED by `wildo config validate`, `wildo config sync` and `wildo lock check`, with a\n * message naming the declarations that ARE servable for that kind.\n *\n * The same `(source, provider)` pair travels to apps-manager at every registration, and apps-manager\n * resolves it with THIS function and mints the application's credentials on the result — so the provider\n * the lockfile records and the provider a credential is minted on are one answer. It also refuses a\n * provider the platform itself holds no administrative credentials for (an Atlas declaration on a\n * platform with no Atlas API key); which providers a platform can serve is platform configuration.\n *\n * ## What this means when you author an environment\n *\n * **`MANAGED` reaches almost nothing today.** Of the managed rows in the table above, the only one\n * the platform serves is MongoDB Atlas (`{ source: MANAGED, provider: 'atlas' }`). Every other kind\n * is declared `{ source: SELF }`. The managed PostgreSQL brands and AWS S3 are catalogue entries a\n * module will serve later, not choices you can make now — a kind becomes declarable as `MANAGED` in\n * the same change that adds the module serving it, and there is deliberately no opt-out: a\n * configuration the platform cannot serve would receive a credential for a server the application\n * never connects to.\n *\n * **An unrecognised brand is not the same failure on every kind.** On the relational database it\n * falls back to the generic managed entry (which is not servable, so it is refused all the same). On\n * the document database, an unknown managed brand resolves to nothing. Object storage recognizes\n * minio/aws first, then falls back by source: SELF to MinIO, MANAGED to AWS S3, including\n * unrecognized brands.\n *\n * **Provider resolution and workload inclusion answer different questions.** Compose and Kubernetes\n * both use the same per-kind inclusion policy, separately from catalogue resolution. Cache, broker\n * and S3 default to self-hosted unless explicitly MANAGED; ClamAV and immudb require explicit SELF.\n * MongoDB and PostgreSQL also include the platform database requirement: an application-level\n * managed choice does not remove a self-hosted database still needed by the platform. Do not infer\n * workload inclusion from this provider resolver.\n */\nexport function resolveInfraProvider(\n kind: BackingServiceKind,\n source: BackingServiceSource,\n provider?: string,\n): InfraProvider | undefined {\n switch (kind) {\n case BackingServiceKind.MONGODB:\n if (source === BackingServiceSource.SELF) return InfraProvider.MONGODB_SELF;\n if (source === BackingServiceSource.MANAGED && provider === 'atlas') return InfraProvider.MONGODB_ATLAS;\n // Other Mongo managed brands (e.g., AWS DocumentDB) — extend\n // the `InfraProvider` enum + this branch in the same slice\n // that adds the first concrete consumer.\n return undefined;\n case BackingServiceKind.POSTGRESQL:\n if (source === BackingServiceSource.SELF) return InfraProvider.POSTGRES_SELF;\n if (source === BackingServiceSource.MANAGED) {\n switch (provider) {\n case 'aws-rds': return InfraProvider.POSTGRES_AWS_RDS;\n case 'gcp-cloud-sql': return InfraProvider.POSTGRES_GCP_CLOUD_SQL;\n case 'azure-database': return InfraProvider.POSTGRES_AZURE_DATABASE;\n case 'supabase': return InfraProvider.POSTGRES_SUPABASE;\n case 'neon': return InfraProvider.POSTGRES_NEON;\n case 'render': return InfraProvider.POSTGRES_RENDER;\n // Generic fallback when the operator has authored\n // `source: MANAGED` without naming a brand (or with an\n // unrecognized brand). Resolving it NAMES the generic\n // catalogue entry; it does not make it servable. No module\n // serves any managed PostgreSQL entry yet, so every one of\n // these is refused by the servability check (#1693) rather\n // than recorded in the lockfile as a selection nothing runs.\n default: return InfraProvider.POSTGRES_MANAGED;\n }\n }\n return undefined;\n case BackingServiceKind.REDIS:\n if (source === BackingServiceSource.SELF) return InfraProvider.REDIS_SELF;\n // Managed Redis brands (ElastiCache, Upstash, Redis Cloud, …)\n // — not catalogued yet; future expansion.\n return undefined;\n case BackingServiceKind.RABBITMQ:\n if (source === BackingServiceSource.SELF) return InfraProvider.RABBITMQ_SELF;\n // Managed RabbitMQ brands (CloudAMQP, AWS MQ, …) —\n // not catalogued yet; future expansion.\n return undefined;\n case BackingServiceKind.S3:\n // S3 dispatch is brand-first because the protocol is\n // standardized (S3-compatible) and the same `source` can host\n // multiple software stacks — `source: SELF` could be MinIO or\n // a self-managed AWS S3 cluster (theoretically). The brand is\n // the canonical disambiguator.\n if (provider === 'minio') return InfraProvider.MINIO_SELF;\n if (provider === 'aws') return InfraProvider.AWS_S3;\n // Default source-based mapping for unbranded S3 — MinIO is\n // the canonical self-hosted; AWS is the canonical managed.\n if (source === BackingServiceSource.SELF) return InfraProvider.MINIO_SELF;\n if (source === BackingServiceSource.MANAGED) return InfraProvider.AWS_S3;\n return undefined;\n case BackingServiceKind.CLAMAV:\n if (source === BackingServiceSource.SELF) return InfraProvider.CLAMAV_SELF;\n return undefined;\n case BackingServiceKind.IMMUDB:\n if (source === BackingServiceSource.SELF) return InfraProvider.IMMUDB_SELF;\n // Managed immudb (immudb Vault) — not catalogued yet; future expansion.\n return undefined;\n }\n}\n/** @wildo_source:part:end platform.config.infra-provider-resolution */\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cdn.example.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/cdn.example.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpE;;;;;GAKG;AAEH,kHAAkH;AAIlH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAY1E,CAAC;AACF,0DAA0D;AAE1D,+GAA+G;AAK/G,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAKvE,CAAC;AACF,uDAAuD"}
1
+ {"version":3,"file":"cdn.example.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/cdn.example.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpE;;;;;GAKG;AAEH,kHAAkH;AAIlH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAY1E,CAAC;AACF,0DAA0D;AAE1D,+GAA+G;AAK/G,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAKvE,CAAC;AACF,uDAAuD"}
@@ -1 +1 @@
1
- {"version":3,"file":"cdn.example.js","sourceRoot":"","sources":["../../../../src/project-config/shared/cdn.example.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA4B,MAAM,eAAe,CAAC;AAEpE;;;;;GAKG;AAEH,kHAAkH;AAClH,6EAA6E;AAC7E,+EAA+E;AAC/E,wEAAwE;AACxE,MAAM,CAAC,MAAM,0BAA0B,GAAwC;IAC7E,mEAAmE;IACnE,OAAO,EAAE;QACP,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,kBAAkB,EAAE,uDAAuD;QACnF,MAAM,EAAE;YACN,IAAI,EAAE,SAAS,CAAC,UAAU;YAC1B,MAAM,EAAE,iCAAiC;YACzC,iFAAiF;YACjF,cAAc,EAAE,sBAAsB;SACvC;KACF;CACF,CAAC;AACF,0DAA0D;AAE1D,+GAA+G;AAC/G,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,oDAAoD;AACpD,MAAM,CAAC,MAAM,uBAAuB,GAAwC;IAC1E,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,OAAO,EAAE;KACpC;CACF,CAAC;AACF,uDAAuD","sourcesContent":["import { CdnVendor, type WildoCdnConfigInput } from './cdn.schemas';\n\n/**\n * Illustrative `cdn` authoring samples (Tier B) — anchored for the\n * `frontend-cdn-publish` skill. Typed against `WildoCdnConfigInput` so the\n * examples cannot drift from the real schema. Not runtime code; they exist to\n * be extracted into the compiled app-knowledge.\n */\n\n/** @wildo_source:part:start example.infra.cdn.cloudflare facet:kind:usage-example facet:audience:app-developer */\n// In a REMOTE env's wildo.infra.<env>.config.ts (e.g. production), under the\n// top-level `cdn` key. Cloudflare = the live adapter: `wildo frontend publish`\n// uploads the dist to S3 AND installs the CSP edge ruleset on the zone.\nexport const exampleCloudflareCdnConfig: Record<string, WildoCdnConfigInput> = {\n // Serve the marketing website from a CDN instead of its nginx pod.\n website: {\n enabled: true,\n bucket: 'yourapp-web-prod', // public-read S3 bucket — the operator sets the policy\n vendor: {\n kind: CdnVendor.CLOUDFLARE,\n zoneId: 'REPLACE_WITH_CLOUDFLARE_ZONE_ID',\n // env-var NAME holding the API token (Zone→Rulesets→Edit), NEVER the token value\n apiTokenEnvVar: 'CLOUDFLARE_API_TOKEN',\n },\n },\n};\n/** @wildo_source:part:end example.infra.cdn.cloudflare */\n\n/** @wildo_source:part:start example.infra.cdn.generic facet:kind:usage-example facet:audience:app-developer */\n// GENERIC vendor — no live vendor call. `wildo frontend publish` uploads the\n// dist + writes a portable `_headers` CSP file; the operator points their own\n// CDN (Cloudflare Pages / Netlify / Vercel / a hand-wired distribution) at the\n// bucket. Use when the edge is managed out-of-band.\nexport const exampleGenericCdnConfig: Record<string, WildoCdnConfigInput> = {\n docs: {\n enabled: true,\n vendor: { kind: CdnVendor.GENERIC },\n },\n};\n/** @wildo_source:part:end example.infra.cdn.generic */\n"]}
1
+ {"version":3,"file":"cdn.example.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/cdn.example.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA4B,MAAM,eAAe,CAAC;AAEpE;;;;;GAKG;AAEH,kHAAkH;AAClH,6EAA6E;AAC7E,+EAA+E;AAC/E,wEAAwE;AACxE,MAAM,CAAC,MAAM,0BAA0B,GAAwC;IAC7E,mEAAmE;IACnE,OAAO,EAAE;QACP,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,kBAAkB,EAAE,uDAAuD;QACnF,MAAM,EAAE;YACN,IAAI,EAAE,SAAS,CAAC,UAAU;YAC1B,MAAM,EAAE,iCAAiC;YACzC,iFAAiF;YACjF,cAAc,EAAE,sBAAsB;SACvC;KACF;CACF,CAAC;AACF,0DAA0D;AAE1D,+GAA+G;AAC/G,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,oDAAoD;AACpD,MAAM,CAAC,MAAM,uBAAuB,GAAwC;IAC1E,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,OAAO,EAAE;KACpC;CACF,CAAC;AACF,uDAAuD","sourcesContent":["import { CdnVendor, type WildoCdnConfigInput } from './cdn.schemas';\n\n/**\n * Illustrative `cdn` authoring samples (Tier B) — anchored for the\n * `frontend-cdn-publish` skill. Typed against `WildoCdnConfigInput` so the\n * examples cannot drift from the real schema. Not runtime code; they exist to\n * be extracted into the compiled app-knowledge.\n */\n\n/** @wildo_source:part:start example.infra.cdn.cloudflare facet:kind:usage-example facet:audience:app-developer */\n// In a REMOTE env's wildo.infra.<env>.config.ts (e.g. production), under the\n// top-level `cdn` key. Cloudflare = the live adapter: `wildo frontend publish`\n// uploads the dist to S3 AND installs the CSP edge ruleset on the zone.\nexport const exampleCloudflareCdnConfig: Record<string, WildoCdnConfigInput> = {\n // Serve the marketing website from a CDN instead of its nginx pod.\n website: {\n enabled: true,\n bucket: 'yourapp-web-prod', // public-read S3 bucket — the operator sets the policy\n vendor: {\n kind: CdnVendor.CLOUDFLARE,\n zoneId: 'REPLACE_WITH_CLOUDFLARE_ZONE_ID',\n // env-var NAME holding the API token (Zone→Rulesets→Edit), NEVER the token value\n apiTokenEnvVar: 'CLOUDFLARE_API_TOKEN',\n },\n },\n};\n/** @wildo_source:part:end example.infra.cdn.cloudflare */\n\n/** @wildo_source:part:start example.infra.cdn.generic facet:kind:usage-example facet:audience:app-developer */\n// GENERIC vendor — no live vendor call. `wildo frontend publish` uploads the\n// dist + writes a portable `_headers` CSP file; the operator points their own\n// CDN (Cloudflare Pages / Netlify / Vercel / a hand-wired distribution) at the\n// bucket. Use when the edge is managed out-of-band.\nexport const exampleGenericCdnConfig: Record<string, WildoCdnConfigInput> = {\n docs: {\n enabled: true,\n vendor: { kind: CdnVendor.GENERIC },\n },\n};\n/** @wildo_source:part:end example.infra.cdn.generic */\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cdn.schemas.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/cdn.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;;GAcG;AACH,oBAAY,SAAS;IACnB;;;;;;OAMG;IACH,OAAO,YAAY;IACnB;;;;;;;;OAQG;IACH,UAAU,eAAe;CAC1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C;IACzD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;CACnC,CAAC,CAAC;AAGH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC5D,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC;IACrC;;;OAGG;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB;;;;OAIG;IACH,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC;CAClE,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAChE,4BAA4B;IAC5B,+BAA+B;CAChC,CAAC,CAAC;AAGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,YAAY,CAAC;IACjD;;;;;;;OAOG;IACH,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAClC;;;;;;OAMG;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpC;;;;OAIG;IACH,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC;;;OAGG;IACH,MAAM,EAAE,qBAAqB;CAC9B,CAAC,CAAC;AAGH,iDAAiD","sourcesContent":["import { z } from 'zod';\n\n/**\n * @wildo_source:part:start platform.config.cdn facet:layer:platform facet:family:infra\n *\n * Per-service CDN publish configuration, authored per-environment under\n * `wildo.infra.<env>.config.ts > cdn?[serviceKey]` (import the schemas + the\n * `CdnVendor` enum from `@wildo-ai/platform-config-lib`). Opting a frontend\n * into CDN serving (REMOTE envs only — the schema rejects `cdn` in local)\n * makes the deploy render skip its nginx Deployment/Service + ingress route\n * (served off-cluster by the CDN) while keeping its `runtime.endPoints.publicUrl`\n * unchanged; `wildo frontend publish` then uploads the built `dist/` to the S3\n * bucket + re-homes CSP to the edge.\n */\n\n/**\n * CDN vendor brands the framework can drive a live edge-publish against.\n *\n * Imported from `@wildo-ai/platform-config-lib`. Authored per-service-key\n * under `wildo.infra.<env>.config.ts > cdn?[serviceKey].vendor.kind`.\n *\n * The catalog is intentionally small and grows one brand at a time (mirrors\n * the `InfraProvider` brand convention). Each brand that supports LIVE\n * provisioning gets its own arm in {@link CdnVendorConfigSchema} carrying its\n * addressing (`zoneId`, …). `GENERIC` is the provider-agnostic escape hatch:\n * the publish path still uploads the `dist/` + writes a portable `_headers`\n * CSP file, but performs NO live vendor API call — the operator points their\n * own CDN (any `_headers`-consuming host: Cloudflare Pages, Netlify, Vercel,\n * or a bucket fronted by a proxy) at the published bucket.\n */\nexport enum CdnVendor {\n /**\n * No live vendor call. `wildo frontend publish` uploads the built `dist/`\n * to the configured S3 bucket and writes a portable `_headers` CSP file\n * alongside it; the operator wires their own CDN to the bucket. This is the\n * lowest-fabrication path and the correct choice when the CDN is fronted by\n * a host that reads `_headers`, or when the edge policy is managed out-of-band.\n */\n GENERIC = 'generic',\n /**\n * Cloudflare. `wildo frontend publish` additionally ensures a\n * `http_response_headers_transform` ruleset on the authored zone that SETs\n * the resolved CSP response header at the edge (the header nginx would emit\n * on a pod-served frontend). The live call fires only when the API token\n * (resolved from {@link CloudflareCdnVendorConfigSchema.apiTokenEnvVar}) is\n * present at publish time; otherwise the publish emits artifacts and skips\n * the live call with a warning.\n */\n CLOUDFLARE = 'cloudflare',\n}\n\n/**\n * `GENERIC` vendor — no live provisioning, no addressing. Presence of this\n * arm still opts the service into the CDN publish path (upload + `_headers`).\n */\nexport const GenericCdnVendorConfigSchema = z.strictObject({\n kind: z.literal(CdnVendor.GENERIC),\n});\nexport type GenericCdnVendorConfig = z.infer<typeof GenericCdnVendorConfigSchema>;\n\n/**\n * `CLOUDFLARE` vendor — live edge CSP provisioning against a Cloudflare zone.\n *\n * Only the token's ENV-VAR NAME is authored here, never the token value:\n * secrets never live in a checked-in `wildo.infra.<env>.config.ts`. The\n * publish path reads `process.env[apiTokenEnvVar]` at runtime; a missing var\n * degrades to artifacts-only (no throw).\n */\nexport const CloudflareCdnVendorConfigSchema = z.strictObject({\n kind: z.literal(CdnVendor.CLOUDFLARE),\n /**\n * Cloudflare zone id that fronts this frontend's public host. The publish\n * path PUTs the response-header-transform ruleset entrypoint on this zone.\n */\n zoneId: z.string().min(1),\n /**\n * NAME of the environment variable holding the Cloudflare API token (a\n * scoped token with `Zone.Ruleset` edit on the zone). NOT the token itself.\n * Default `CLOUDFLARE_API_TOKEN`.\n */\n apiTokenEnvVar: z.string().min(1).default('CLOUDFLARE_API_TOKEN'),\n});\nexport type CloudflareCdnVendorConfig = z.infer<typeof CloudflareCdnVendorConfigSchema>;\n\n/**\n * Discriminated union over {@link CdnVendor}. Adding a brand = adding an arm\n * here (+ a live adapter in the publish path). The discriminant `kind` gives\n * exhaustive narrowing at every consumer.\n */\nexport const CdnVendorConfigSchema = z.discriminatedUnion('kind', [\n GenericCdnVendorConfigSchema,\n CloudflareCdnVendorConfigSchema,\n]);\nexport type CdnVendorConfig = z.infer<typeof CdnVendorConfigSchema>;\n\n/**\n * Per-service CDN publish config — authored under\n * `wildo.infra.<env>.config.ts > cdn?[serviceKey]`, keyed by the SaaS-config\n * service key (same keyspace as `serviceHosts`).\n *\n * # Semantics\n *\n * Opting a frontend service into CDN serving means, FOR THAT ENVIRONMENT:\n * - the deploy render emits NEITHER an nginx Deployment/Service NOR an ingress\n * / compose route for the service — its public host is served off-cluster by\n * the CDN (DNS points the `<serviceHost>.<publicDomain>` at the CDN edge);\n * - `runtime.endPoints.publicUrl` is UNCHANGED (still\n * `<serviceHost>.<publicDomain>`) — the browser gets the same URL, it just\n * resolves to the CDN. This preserves the CORS / cross-frontend-handoff\n * coherence the ingress model relied on.\n *\n * CDN-served-ness is a PER-ENV deployment decision (a service can be\n * nginx-served in staging and CDN-served in production), which is why this\n * lives in the infra env config alongside `serviceHosts` — NOT on the app\n * service definition. The CSP *content* stays app-owned via the existing\n * `csp` resolution; the publish path REUSES that resolved policy to emit the\n * edge CSP, so this surface carries only the deployment targeting.\n *\n * # Object-storage target\n *\n * The S3 endpoint + credentials come from `backingServices.s3` (the app's\n * existing object-storage authoring surface — reused, not re-declared). Only\n * the bucket (+ optional key prefix) is CDN-specific: static public assets\n * SHOULD live in a bucket separate from the app's private file-storage bucket\n * (different access policy), so `bucket` is authored here; when omitted it\n * falls back to `backingServices.s3.bucket`.\n */\nexport const WildoCdnConfigSchema = z.strictObject({\n /**\n * Opt-out switch WITHOUT deleting the block. `true` (default) => this\n * service is CDN-served in this env (nginx pod + ingress route skipped,\n * publish path active). `false` => authored-but-inactive: the service falls\n * back to normal nginx-pod serving and the publish path ignores it. The\n * emit-skip / publish set keys on `enabled === true`, never on mere\n * presence, so a disabled entry never silently drops the ingress route.\n */\n enabled: z.boolean().default(true),\n /**\n * S3 bucket holding this frontend's PUBLIC static assets. Defaults to\n * `backingServices.s3.bucket` when omitted, but a SEPARATE public-read\n * bucket is recommended (do not mix public static assets with the app's\n * private user-uploaded files). The S3 endpoint + credentials always come\n * from `backingServices.s3`.\n */\n bucket: z.string().min(1).optional(),\n /**\n * Optional object-key prefix within the bucket (e.g. when one bucket serves\n * several frontends). Defaults to the service key. No leading/trailing\n * slash — the uploader joins segments.\n */\n bucketPrefix: z.string().optional(),\n /**\n * CDN vendor + its live-provisioning addressing. `GENERIC` = upload +\n * `_headers` only; branded vendors additionally push the edge CSP policy.\n */\n vendor: CdnVendorConfigSchema,\n});\nexport type WildoCdnConfig = z.infer<typeof WildoCdnConfigSchema>;\nexport type WildoCdnConfigInput = z.input<typeof WildoCdnConfigSchema>;\n/** @wildo_source:part:end platform.config.cdn */\n"]}
1
+ {"version":3,"file":"cdn.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/cdn.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAN,IAAY,SAmBX;AAnBD,WAAY,SAAS;IACnB;;;;;;OAMG;IACH,gCAAmB,CAAA;IACnB;;;;;;;;OAQG;IACH,sCAAyB,CAAA;AAC3B,CAAC,EAnBW,SAAS,KAAT,SAAS,QAmBpB;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,YAAY,CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;CACnC,CAAC,CAAC;AAGH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC5D,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC;IACrC;;;OAGG;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB;;;;OAIG;IACH,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC;CAClE,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAChE,4BAA4B;IAC5B,+BAA+B;CAChC,CAAC,CAAC;AAGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,YAAY,CAAC;IACjD;;;;;;;OAOG;IACH,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAClC;;;;;;OAMG;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpC;;;;OAIG;IACH,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC;;;OAGG;IACH,MAAM,EAAE,qBAAqB;CAC9B,CAAC,CAAC;AAGH,iDAAiD","sourcesContent":["import { z } from 'zod';\n\n/**\n * @wildo_source:part:start platform.config.cdn facet:layer:platform facet:family:infra\n *\n * Per-service CDN publish configuration, authored per-environment under\n * `wildo.infra.<env>.config.ts > cdn?[serviceKey]` (import the schemas + the\n * `CdnVendor` enum from `@wildo-ai/platform-config-lib`). Opting a frontend\n * into CDN serving (REMOTE envs only — the schema rejects `cdn` in local)\n * makes the deploy render skip its nginx Deployment/Service + ingress route\n * (served off-cluster by the CDN) while keeping its `runtime.endPoints.publicUrl`\n * unchanged; `wildo frontend publish` then uploads the built `dist/` to the S3\n * bucket + re-homes CSP to the edge.\n */\n\n/**\n * CDN vendor brands the framework can drive a live edge-publish against.\n *\n * Imported from `@wildo-ai/platform-config-lib`. Authored per-service-key\n * under `wildo.infra.<env>.config.ts > cdn?[serviceKey].vendor.kind`.\n *\n * The catalog is intentionally small and grows one brand at a time (mirrors\n * the `InfraProvider` brand convention). Each brand that supports LIVE\n * provisioning gets its own arm in {@link CdnVendorConfigSchema} carrying its\n * addressing (`zoneId`, …). `GENERIC` is the provider-agnostic escape hatch:\n * the publish path still uploads the `dist/` + writes a portable `_headers`\n * CSP file, but performs NO live vendor API call — the operator points their\n * own CDN (any `_headers`-consuming host: Cloudflare Pages, Netlify, Vercel,\n * or a bucket fronted by a proxy) at the published bucket.\n */\nexport enum CdnVendor {\n /**\n * No live vendor call. `wildo frontend publish` uploads the built `dist/`\n * to the configured S3 bucket and writes a portable `_headers` CSP file\n * alongside it; the operator wires their own CDN to the bucket. This is the\n * lowest-fabrication path and the correct choice when the CDN is fronted by\n * a host that reads `_headers`, or when the edge policy is managed out-of-band.\n */\n GENERIC = 'generic',\n /**\n * Cloudflare. `wildo frontend publish` additionally ensures a\n * `http_response_headers_transform` ruleset on the authored zone that SETs\n * the resolved CSP response header at the edge (the header nginx would emit\n * on a pod-served frontend). The live call fires only when the API token\n * (resolved from {@link CloudflareCdnVendorConfigSchema.apiTokenEnvVar}) is\n * present at publish time; otherwise the publish emits artifacts and skips\n * the live call with a warning.\n */\n CLOUDFLARE = 'cloudflare',\n}\n\n/**\n * `GENERIC` vendor — no live provisioning, no addressing. Presence of this\n * arm still opts the service into the CDN publish path (upload + `_headers`).\n */\nexport const GenericCdnVendorConfigSchema = z.strictObject({\n kind: z.literal(CdnVendor.GENERIC),\n});\nexport type GenericCdnVendorConfig = z.infer<typeof GenericCdnVendorConfigSchema>;\n\n/**\n * `CLOUDFLARE` vendor — live edge CSP provisioning against a Cloudflare zone.\n *\n * Only the token's ENV-VAR NAME is authored here, never the token value:\n * secrets never live in a checked-in `wildo.infra.<env>.config.ts`. The\n * publish path reads `process.env[apiTokenEnvVar]` at runtime; a missing var\n * degrades to artifacts-only (no throw).\n */\nexport const CloudflareCdnVendorConfigSchema = z.strictObject({\n kind: z.literal(CdnVendor.CLOUDFLARE),\n /**\n * Cloudflare zone id that fronts this frontend's public host. The publish\n * path PUTs the response-header-transform ruleset entrypoint on this zone.\n */\n zoneId: z.string().min(1),\n /**\n * NAME of the environment variable holding the Cloudflare API token (a\n * scoped token with `Zone.Ruleset` edit on the zone). NOT the token itself.\n * Default `CLOUDFLARE_API_TOKEN`.\n */\n apiTokenEnvVar: z.string().min(1).default('CLOUDFLARE_API_TOKEN'),\n});\nexport type CloudflareCdnVendorConfig = z.infer<typeof CloudflareCdnVendorConfigSchema>;\n\n/**\n * Discriminated union over {@link CdnVendor}. Adding a brand = adding an arm\n * here (+ a live adapter in the publish path). The discriminant `kind` gives\n * exhaustive narrowing at every consumer.\n */\nexport const CdnVendorConfigSchema = z.discriminatedUnion('kind', [\n GenericCdnVendorConfigSchema,\n CloudflareCdnVendorConfigSchema,\n]);\nexport type CdnVendorConfig = z.infer<typeof CdnVendorConfigSchema>;\n\n/**\n * Per-service CDN publish config — authored under\n * `wildo.infra.<env>.config.ts > cdn?[serviceKey]`, keyed by the SaaS-config\n * service key (same keyspace as `serviceHosts`).\n *\n * # Semantics\n *\n * Opting a frontend service into CDN serving means, FOR THAT ENVIRONMENT:\n * - the deploy render emits NEITHER an nginx Deployment/Service NOR an ingress\n * / compose route for the service — its public host is served off-cluster by\n * the CDN (DNS points the `<serviceHost>.<publicDomain>` at the CDN edge);\n * - `runtime.endPoints.publicUrl` is UNCHANGED (still\n * `<serviceHost>.<publicDomain>`) — the browser gets the same URL, it just\n * resolves to the CDN. This preserves the CORS / cross-frontend-handoff\n * coherence the ingress model relied on.\n *\n * CDN-served-ness is a PER-ENV deployment decision (a service can be\n * nginx-served in staging and CDN-served in production), which is why this\n * lives in the infra env config alongside `serviceHosts` — NOT on the app\n * service definition. The CSP *content* stays app-owned via the existing\n * `csp` resolution; the publish path REUSES that resolved policy to emit the\n * edge CSP, so this surface carries only the deployment targeting.\n *\n * # Object-storage target\n *\n * The S3 endpoint + credentials come from `backingServices.s3` (the app's\n * existing object-storage authoring surface — reused, not re-declared). Only\n * the bucket (+ optional key prefix) is CDN-specific: static public assets\n * SHOULD live in a bucket separate from the app's private file-storage bucket\n * (different access policy), so `bucket` is authored here; when omitted it\n * falls back to `backingServices.s3.bucket`.\n */\nexport const WildoCdnConfigSchema = z.strictObject({\n /**\n * Opt-out switch WITHOUT deleting the block. `true` (default) => this\n * service is CDN-served in this env (nginx pod + ingress route skipped,\n * publish path active). `false` => authored-but-inactive: the service falls\n * back to normal nginx-pod serving and the publish path ignores it. The\n * emit-skip / publish set keys on `enabled === true`, never on mere\n * presence, so a disabled entry never silently drops the ingress route.\n */\n enabled: z.boolean().default(true),\n /**\n * S3 bucket holding this frontend's PUBLIC static assets. Defaults to\n * `backingServices.s3.bucket` when omitted, but a SEPARATE public-read\n * bucket is recommended (do not mix public static assets with the app's\n * private user-uploaded files). The S3 endpoint + credentials always come\n * from `backingServices.s3`.\n */\n bucket: z.string().min(1).optional(),\n /**\n * Optional object-key prefix within the bucket (e.g. when one bucket serves\n * several frontends). Defaults to the service key. No leading/trailing\n * slash — the uploader joins segments.\n */\n bucketPrefix: z.string().optional(),\n /**\n * CDN vendor + its live-provisioning addressing. `GENERIC` = upload +\n * `_headers` only; branded vendors additionally push the edge CSP policy.\n */\n vendor: CdnVendorConfigSchema,\n});\nexport type WildoCdnConfig = z.infer<typeof WildoCdnConfigSchema>;\nexport type WildoCdnConfigInput = z.input<typeof WildoCdnConfigSchema>;\n/** @wildo_source:part:end platform.config.cdn */\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"csp-defaults.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/csp-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAC5C,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CACrD,CAAC;AAgHF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAClC,MAAM,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAKjD,CAAC"}
1
+ {"version":3,"file":"csp-defaults.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/csp-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAw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1\n * — `auth-hardening.md`).\n *\n * # Why one baseline per frontend kind (vs a single platform-wide one)\n *\n * The three `AppFrontendType` kinds (`SAAS_APP` / `STATIC_WEBSITE` /\n * `TECH_DOC`) genuinely have different inline-script / inline-style\n * pressure:\n *\n * - `SAAS_APP` — React SPA built with Vite. Vite's production output\n * uses ESM `<script type=\"module\">` with no inline scripts, AND\n * the runtime emits no inline styles. So the `SAAS_APP` baseline\n * is the tightest of the three: NO `'unsafe-inline'` for scripts,\n * `'unsafe-inline'` for styles ONLY because Tailwind's runtime\n * style-injection (e.g., `@apply` with arbitrary values) emits\n * short-lived inline `<style>` tags.\n * - `TECH_DOC` — Docusaurus 3.x SSG. Its hydration shim and classic-theme\n * bootstrap inject inline `<script>` (theme detection, color-mode\n * restoration and route-state seed), while generated/theme markup uses\n * inline styles. So the `TECH_DOC` baseline MUST allow `'unsafe-inline'`\n * for both scripts AND styles. Tightening\n * to nonce-based `'self'` only is a post-Slice-B follow-up that\n * would require an upstream Docusaurus runtime change OR a\n * nonce-injecting build plugin.\n * - `STATIC_WEBSITE` — Astro SSG marketing site. The marketing\n * surface typically embeds analytics / advertising / chat-widget\n * pixels (each a third-party origin), so the baseline ships an\n * intentionally-empty `script-src` / `connect-src` extension list\n * (just `'self'`) and forces the per-app config to opt into every\n * third-party origin explicitly. Per-app `directives['script-src']`\n * overrides MUST list the third-party hostnames the marketing team\n * has actually whitelisted (no implicit `'unsafe-inline'`).\n *\n * A single platform-wide baseline would force the lowest common\n * denominator (`TECH_DOC`'s `'unsafe-inline'` for everyone) and lose\n * the SAAS_APP tightness for no gain.\n *\n * # Shared posture across all three baselines\n *\n * - `default-src 'self'` — block by default; everything else opts\n * in explicitly via specific directives.\n * - `frame-ancestors 'none'` — refuse iframe embedding. Header-only\n * directive (meta channel ignores it; the `csp-emit.ts` serializer\n * strips it from the meta tag automatically).\n * - `object-src 'none'` — block `<object>` / `<embed>` plugin loading\n * entirely. None of the three frontend kinds have a use case for\n * legacy plugins.\n * - `form-action 'self'` — block `<form action=\"…\">` from POSTing\n * to a third-party origin. Closes the cross-origin form-injection\n * surface even when the rest of the policy is permissive.\n * - `base-uri 'self'` — block `<base href=\"…\">` injection from\n * redirecting relative URLs to an attacker-controlled origin.\n *\n * # Connect-src\n *\n * Every baseline ships `connect-src 'self'` — the resolver merges in\n * additional origins via the app-static `directives['connect-src']`\n * override (e.g., the SaaS backend API hostname), and via Slice B\n * Step 2's env-layer override for per-env additions (Sentry, analytics\n * collectors). The baseline does NOT include any backend hostname\n * because the resolver does NOT know the deployment env at the engine\n * layer; per-env hostnames are an env-config concern.\n *\n * # `report-uri` is intentionally NOT in any baseline\n *\n * The platform doesn't ship a CSP-violation collector yet\n * (`auth-hardening.md` \"Cheap Bonuses — CSP violation monitoring\n * endpoint\" tracks that as an independent follow-up). Authoring a\n * baseline `report-uri` value would be a config lie; per-app authoring\n * via the `WildoCspConfigSchema.reportUri` field is the right seam\n * once a real collector exists.\n */\n\nimport { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';\nimport type { CspDirectiveName } from './csp.schemas';\n\n/**\n * Baseline directive map for one `AppFrontendType`. Internal shape — the\n * resolver in `platform-config-lib/src/project-config/shared/csp-emit.ts` produces\n * the same shape as its post-merge output. Distinct from the AUTHOR-side\n * `WildoCspConfig.directives` (which is partial; this is total).\n */\nexport type CspBaselineDirectiveMap = Readonly<\n Partial<Record<CspDirectiveName, readonly string[]>>\n>;\n\n/**\n * `SAAS_APP` baseline — tightest of the three. Vite-bundled React SPA\n * with no inline scripts (production builds emit `<script type=\"module\">`).\n * `style-src 'unsafe-inline'` covers Tailwind runtime style injection.\n *\n * # Google Fonts origins in `style-src` and `font-src`\n *\n * The design-token system (`saas-frontend-lib/src/core/ui/design-token.utils.ts`)\n * ships `applyGoogleFontPreset()` as the canonical web-font loader for\n * `SAAS_APP` shells. It builds a `https://fonts.googleapis.com/css2?...`\n * `<link rel=\"stylesheet\">` at runtime, which in turn pulls woff2 files\n * from `https://fonts.gstatic.com/...`. Both origins MUST be in the\n * baseline because:\n *\n * 1. The font loader is framework-shipped, not app-authored. An app\n * developer that simply uses an `OKLCH` design-token preset with a\n * Google Font family inherits the loader without writing any code,\n * and would hit CSP blocks on every shell render in production\n * (today they're masked because `reportOnly: true` is the typical\n * dev posture).\n * 2. Widening to two specific origins is dramatically safer than the\n * alternatives — `'unsafe-inline'` (which we already accept for\n * Tailwind) is orders of magnitude broader; nonces are not\n * compatible with a runtime-injected `<link>` that doesn't carry\n * our nonce attribute.\n * 3. Apps that prefer fully-local fonts (e.g., self-hosted woff2 in\n * `public/fonts/`) and never call `applyGoogleFontPreset()` can\n * tighten back via the per-app `directives['style-src']` /\n * `directives['font-src']` override — the resolver merges as a\n * union, so the per-app config can restate `[\"'self'\", \"'unsafe-inline'\"]`\n * without `fonts.googleapis.com` and CSP will warn (or block) any\n * stray Google-Fonts call.\n *\n * `preconnect` to both origins happens at the same site\n * (`design-token.utils.ts` lines 982–996). Preconnect is governed by\n * `connect-src`, not `style-src` / `font-src`, BUT modern browsers\n * treat `<link rel=\"preconnect\">` as a hint that doesn't require CSP\n * fetch directives — the actual fetch later in the pipeline carries\n * the resource type and is what CSP grades. No `connect-src` widening\n * is needed.\n */\nconst SAAS_APP_BASELINE: CspBaselineDirectiveMap = {\n 'default-src': [\"'self'\"],\n 'script-src': [\"'self'\"],\n 'style-src': [\"'self'\", \"'unsafe-inline'\", 'https://fonts.googleapis.com'],\n 'img-src': [\"'self'\", 'data:', 'blob:'],\n 'connect-src': [\"'self'\"],\n 'font-src': [\"'self'\", 'data:', 'https://fonts.gstatic.com'],\n 'frame-ancestors': [\"'none'\"],\n 'object-src': [\"'none'\"],\n 'form-action': [\"'self'\"],\n 'base-uri': [\"'self'\"],\n};\n\n/**\n * `TECH_DOC` baseline — Docusaurus 3.x SSG. `'unsafe-inline'` on both\n * `script-src` AND `style-src` is required by the Docusaurus runtime\n * (classic-theme bootstrap and hydration shim). `img-src` retains `data:` and\n * `blob:` because the documentation product supports generated/MDX images\n * expressed with those browser-native URL schemes. Fonts are self-hosted; the\n * removed OpenAPI theme's inline icon-font allowance is deliberately gone.\n *\n * Tightening to nonce-based `'self'` only is a post-Slice-B follow-up\n * (would require an upstream Docusaurus runtime change OR a\n * nonce-injecting build plugin — out of scope today).\n */\nconst TECH_DOC_BASELINE: CspBaselineDirectiveMap = {\n 'default-src': [\"'self'\"],\n 'script-src': [\"'self'\", \"'unsafe-inline'\"],\n 'style-src': [\"'self'\", \"'unsafe-inline'\"],\n 'img-src': [\"'self'\", 'data:', 'blob:'],\n 'connect-src': [\"'self'\"],\n 'font-src': [\"'self'\"],\n 'frame-ancestors': [\"'none'\"],\n 'object-src': [\"'none'\"],\n 'form-action': [\"'self'\"],\n 'base-uri': [\"'self'\"],\n};\n\n/**\n * `STATIC_WEBSITE` baseline — Astro SSG marketing site. Intentionally\n * narrow `script-src` / `connect-src` to force the per-app config to\n * opt into every third-party hostname (analytics, advertising, chat\n * widget) explicitly. NO implicit `'unsafe-inline'` — the marketing\n * team must opt in per origin (or use nonces / hashes once those are\n * wired by the marketing build plugin).\n *\n * `style-src 'unsafe-inline'` is included because Astro's view\n * transitions and inline scoped styles emit short-lived inline\n * `<style>` tags; stripping that would break the marketing animations\n * the website team relies on.\n *\n * `img-src` includes `https:` because marketing pages routinely embed\n * third-party imagery (case-study screenshots, partner logos hosted on\n * a CDN). Tightening to a closed allow-list per app is the per-app\n * `directives['img-src']` override's job.\n */\nconst STATIC_WEBSITE_BASELINE: CspBaselineDirectiveMap = {\n 'default-src': [\"'self'\"],\n 'script-src': [\"'self'\"],\n 'style-src': [\"'self'\", \"'unsafe-inline'\"],\n 'img-src': [\"'self'\", 'data:', 'blob:', 'https:'],\n 'connect-src': [\"'self'\"],\n 'font-src': [\"'self'\", 'data:'],\n 'frame-ancestors': [\"'none'\"],\n 'object-src': [\"'none'\"],\n 'form-action': [\"'self'\"],\n 'base-uri': [\"'self'\"],\n};\n\n/**\n * Per-`AppFrontendType` baseline registry. Total over the enum — adding\n * a new `AppFrontendType` value forces a baseline edit here at compile\n * time (TS error on the missing key). That coupling is the whole point\n * of the registry shape: a new frontend kind that ships without a CSP\n * baseline would silently get NO policy on any deployment until someone\n * notices.\n */\nexport const CSP_BASELINES: Readonly<\n Record<AppFrontendType, CspBaselineDirectiveMap>\n> = {\n [AppFrontendType.SAAS_APP]: SAAS_APP_BASELINE,\n [AppFrontendType.STATIC_WEBSITE]: STATIC_WEBSITE_BASELINE,\n [AppFrontendType.TECH_DOC]: TECH_DOC_BASELINE,\n};\n"]}
1
+ {"version":3,"file":"csp-defaults.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/csp-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAavE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,iBAAiB,GAA4B;IACjD,aAAa,EAAE,CAAC,QAAQ,CAAC;IACzB,YAAY,EAAE,CAAC,QAAQ,CAAC;IACxB,WAAW,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,8BAA8B,CAAC;IAC1E,SAAS,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC;IACvC,aAAa,EAAE,CAAC,QAAQ,CAAC;IACzB,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,2BAA2B,CAAC;IAC5D,iBAAiB,EAAE,CAAC,QAAQ,CAAC;IAC7B,YAAY,EAAE,CAAC,QAAQ,CAAC;IACxB,aAAa,EAAE,CAAC,QAAQ,CAAC;IACzB,UAAU,EAAE,CAAC,QAAQ,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,iBAAiB,GAA4B;IACjD,aAAa,EAAE,CAAC,QAAQ,CAAC;IACzB,YAAY,EA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single platform-wide one)\n *\n * The three `AppFrontendType` kinds (`SAAS_APP` / `STATIC_WEBSITE` /\n * `TECH_DOC`) genuinely have different inline-script / inline-style\n * pressure:\n *\n * - `SAAS_APP` — React SPA built with Vite. Vite's production output\n * uses ESM `<script type=\"module\">` with no inline scripts, AND\n * the runtime emits no inline styles. So the `SAAS_APP` baseline\n * is the tightest of the three: NO `'unsafe-inline'` for scripts,\n * `'unsafe-inline'` for styles ONLY because Tailwind's runtime\n * style-injection (e.g., `@apply` with arbitrary values) emits\n * short-lived inline `<style>` tags.\n * - `TECH_DOC` — Docusaurus 3.x SSG. Its hydration shim and classic-theme\n * bootstrap inject inline `<script>` (theme detection, color-mode\n * restoration and route-state seed), while generated/theme markup uses\n * inline styles. So the `TECH_DOC` baseline MUST allow `'unsafe-inline'`\n * for both scripts AND styles. Tightening\n * to nonce-based `'self'` only is a post-Slice-B follow-up that\n * would require an upstream Docusaurus runtime change OR a\n * nonce-injecting build plugin.\n * - `STATIC_WEBSITE` — Astro SSG marketing site. The marketing\n * surface typically embeds analytics / advertising / chat-widget\n * pixels (each a third-party origin), so the baseline ships an\n * intentionally-empty `script-src` / `connect-src` extension list\n * (just `'self'`) and forces the per-app config to opt into every\n * third-party origin explicitly. Per-app `directives['script-src']`\n * overrides MUST list the third-party hostnames the marketing team\n * has actually whitelisted (no implicit `'unsafe-inline'`).\n *\n * A single platform-wide baseline would force the lowest common\n * denominator (`TECH_DOC`'s `'unsafe-inline'` for everyone) and lose\n * the SAAS_APP tightness for no gain.\n *\n * # Shared posture across all three baselines\n *\n * - `default-src 'self'` — block by default; everything else opts\n * in explicitly via specific directives.\n * - `frame-ancestors 'none'` — refuse iframe embedding. Header-only\n * directive (meta channel ignores it; the `csp-emit.ts` serializer\n * strips it from the meta tag automatically).\n * - `object-src 'none'` — block `<object>` / `<embed>` plugin loading\n * entirely. None of the three frontend kinds have a use case for\n * legacy plugins.\n * - `form-action 'self'` — block `<form action=\"…\">` from POSTing\n * to a third-party origin. Closes the cross-origin form-injection\n * surface even when the rest of the policy is permissive.\n * - `base-uri 'self'` — block `<base href=\"…\">` injection from\n * redirecting relative URLs to an attacker-controlled origin.\n *\n * # Connect-src\n *\n * Every baseline ships `connect-src 'self'` — the resolver merges in\n * additional origins via the app-static `directives['connect-src']`\n * override (e.g., the SaaS backend API hostname), and via Slice B\n * Step 2's env-layer override for per-env additions (Sentry, analytics\n * collectors). The baseline does NOT include any backend hostname\n * because the resolver does NOT know the deployment env at the engine\n * layer; per-env hostnames are an env-config concern.\n *\n * # `report-uri` is intentionally NOT in any baseline\n *\n * The platform doesn't ship a CSP-violation collector yet\n * (`auth-hardening.md` \"Cheap Bonuses — CSP violation monitoring\n * endpoint\" tracks that as an independent follow-up). Authoring a\n * baseline `report-uri` value would be a config lie; per-app authoring\n * via the `WildoCspConfigSchema.reportUri` field is the right seam\n * once a real collector exists.\n */\n\nimport { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';\nimport type { CspDirectiveName } from './csp.schemas';\n\n/**\n * Baseline directive map for one `AppFrontendType`. Internal shape — the\n * resolver in `platform-config-lib/src/project-config/shared/csp-emit.ts` produces\n * the same shape as its post-merge output. Distinct from the AUTHOR-side\n * `WildoCspConfig.directives` (which is partial; this is total).\n */\nexport type CspBaselineDirectiveMap = Readonly<\n Partial<Record<CspDirectiveName, readonly string[]>>\n>;\n\n/**\n * `SAAS_APP` baseline — tightest of the three. Vite-bundled React SPA\n * with no inline scripts (production builds emit `<script type=\"module\">`).\n * `style-src 'unsafe-inline'` covers Tailwind runtime style injection.\n *\n * # Google Fonts origins in `style-src` and `font-src`\n *\n * The design-token system (`saas-frontend-lib/src/core/ui/design-token.utils.ts`)\n * ships `applyGoogleFontPreset()` as the canonical web-font loader for\n * `SAAS_APP` shells. It builds a `https://fonts.googleapis.com/css2?...`\n * `<link rel=\"stylesheet\">` at runtime, which in turn pulls woff2 files\n * from `https://fonts.gstatic.com/...`. Both origins MUST be in the\n * baseline because:\n *\n * 1. The font loader is framework-shipped, not app-authored. An app\n * developer that simply uses an `OKLCH` design-token preset with a\n * Google Font family inherits the loader without writing any code,\n * and would hit CSP blocks on every shell render in production\n * (today they're masked because `reportOnly: true` is the typical\n * dev posture).\n * 2. Widening to two specific origins is dramatically safer than the\n * alternatives — `'unsafe-inline'` (which we already accept for\n * Tailwind) is orders of magnitude broader; nonces are not\n * compatible with a runtime-injected `<link>` that doesn't carry\n * our nonce attribute.\n * 3. Apps that prefer fully-local fonts (e.g., self-hosted woff2 in\n * `public/fonts/`) and never call `applyGoogleFontPreset()` can\n * tighten back via the per-app `directives['style-src']` /\n * `directives['font-src']` override — the resolver merges as a\n * union, so the per-app config can restate `[\"'self'\", \"'unsafe-inline'\"]`\n * without `fonts.googleapis.com` and CSP will warn (or block) any\n * stray Google-Fonts call.\n *\n * `preconnect` to both origins happens at the same site\n * (`design-token.utils.ts` lines 982–996). Preconnect is governed by\n * `connect-src`, not `style-src` / `font-src`, BUT modern browsers\n * treat `<link rel=\"preconnect\">` as a hint that doesn't require CSP\n * fetch directives — the actual fetch later in the pipeline carries\n * the resource type and is what CSP grades. No `connect-src` widening\n * is needed.\n */\nconst SAAS_APP_BASELINE: CspBaselineDirectiveMap = {\n 'default-src': [\"'self'\"],\n 'script-src': [\"'self'\"],\n 'style-src': [\"'self'\", \"'unsafe-inline'\", 'https://fonts.googleapis.com'],\n 'img-src': [\"'self'\", 'data:', 'blob:'],\n 'connect-src': [\"'self'\"],\n 'font-src': [\"'self'\", 'data:', 'https://fonts.gstatic.com'],\n 'frame-ancestors': [\"'none'\"],\n 'object-src': [\"'none'\"],\n 'form-action': [\"'self'\"],\n 'base-uri': [\"'self'\"],\n};\n\n/**\n * `TECH_DOC` baseline — Docusaurus 3.x SSG. `'unsafe-inline'` on both\n * `script-src` AND `style-src` is required by the Docusaurus runtime\n * (classic-theme bootstrap and hydration shim). `img-src` retains `data:` and\n * `blob:` because the documentation product supports generated/MDX images\n * expressed with those browser-native URL schemes. Fonts are self-hosted; the\n * removed OpenAPI theme's inline icon-font allowance is deliberately gone.\n *\n * Tightening to nonce-based `'self'` only is a post-Slice-B follow-up\n * (would require an upstream Docusaurus runtime change OR a\n * nonce-injecting build plugin — out of scope today).\n */\nconst TECH_DOC_BASELINE: CspBaselineDirectiveMap = {\n 'default-src': [\"'self'\"],\n 'script-src': [\"'self'\", \"'unsafe-inline'\"],\n 'style-src': [\"'self'\", \"'unsafe-inline'\"],\n 'img-src': [\"'self'\", 'data:', 'blob:'],\n 'connect-src': [\"'self'\"],\n 'font-src': [\"'self'\"],\n 'frame-ancestors': [\"'none'\"],\n 'object-src': [\"'none'\"],\n 'form-action': [\"'self'\"],\n 'base-uri': [\"'self'\"],\n};\n\n/**\n * `STATIC_WEBSITE` baseline — Astro SSG marketing site. Intentionally\n * narrow `script-src` / `connect-src` to force the per-app config to\n * opt into every third-party hostname (analytics, advertising, chat\n * widget) explicitly. NO implicit `'unsafe-inline'` — the marketing\n * team must opt in per origin (or use nonces / hashes once those are\n * wired by the marketing build plugin).\n *\n * `style-src 'unsafe-inline'` is included because Astro's view\n * transitions and inline scoped styles emit short-lived inline\n * `<style>` tags; stripping that would break the marketing animations\n * the website team relies on.\n *\n * `img-src` includes `https:` because marketing pages routinely embed\n * third-party imagery (case-study screenshots, partner logos hosted on\n * a CDN). Tightening to a closed allow-list per app is the per-app\n * `directives['img-src']` override's job.\n */\nconst STATIC_WEBSITE_BASELINE: CspBaselineDirectiveMap = {\n 'default-src': [\"'self'\"],\n 'script-src': [\"'self'\"],\n 'style-src': [\"'self'\", \"'unsafe-inline'\"],\n 'img-src': [\"'self'\", 'data:', 'blob:', 'https:'],\n 'connect-src': [\"'self'\"],\n 'font-src': [\"'self'\", 'data:'],\n 'frame-ancestors': [\"'none'\"],\n 'object-src': [\"'none'\"],\n 'form-action': [\"'self'\"],\n 'base-uri': [\"'self'\"],\n};\n\n/**\n * Per-`AppFrontendType` baseline registry. Total over the enum — adding\n * a new `AppFrontendType` value forces a baseline edit here at compile\n * time (TS error on the missing key). That coupling is the whole point\n * of the registry shape: a new frontend kind that ships without a CSP\n * baseline would silently get NO policy on any deployment until someone\n * notices.\n */\nexport const CSP_BASELINES: Readonly<\n Record<AppFrontendType, CspBaselineDirectiveMap>\n> = {\n [AppFrontendType.SAAS_APP]: SAAS_APP_BASELINE,\n [AppFrontendType.STATIC_WEBSITE]: STATIC_WEBSITE_BASELINE,\n [AppFrontendType.TECH_DOC]: TECH_DOC_BASELINE,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"csp-emit.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/csp-emit.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAEf,KAAK,4BAA4B,EAClC,MAAM,sCAAsC,CAAC;AAM9C,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAGvB,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAC5C,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CACrD,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;IAC7C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,OAAO,EACZ;QACE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,UAAU,EAAE;YACnB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;YAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;SAC1B,CAAC;KACH,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