@wildo-ai/platform-config-lib 1.1.10 → 1.1.12

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 (396) hide show
  1. package/dist/esm/_unimplemented/soft-warn.d.ts +24 -49
  2. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
  3. package/dist/esm/_unimplemented/soft-warn.js +24 -49
  4. package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
  5. package/dist/esm/blueprint/anchored-region.d.ts +83 -0
  6. package/dist/esm/blueprint/anchored-region.d.ts.map +1 -0
  7. package/dist/esm/blueprint/anchored-region.js +263 -0
  8. package/dist/esm/blueprint/anchored-region.js.map +1 -0
  9. package/dist/esm/blueprint/blueprint.schemas.d.ts +600 -0
  10. package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -0
  11. package/dist/esm/blueprint/blueprint.schemas.js +638 -0
  12. package/dist/esm/blueprint/blueprint.schemas.js.map +1 -0
  13. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  14. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  15. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  16. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  17. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +13 -1
  18. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  19. package/dist/esm/bootstrap/bootstrap.contracts.js +6 -0
  20. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  21. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +29 -4
  22. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  23. package/dist/esm/bootstrap/bootstrap.schemas.js +29 -4
  24. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  25. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +131 -2
  26. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  27. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +139 -2
  28. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  29. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +21 -0
  30. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
  31. package/dist/esm/bootstrap/platform-store-preconnect.js +25 -0
  32. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
  33. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +80 -0
  34. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -0
  35. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +81 -0
  36. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -0
  37. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +41 -9
  38. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  39. package/dist/esm/bootstrap/runtime-backing-service-access.js +77 -28
  40. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  41. package/dist/esm/bootstrap/runtime-network-policy.d.ts +117 -12
  42. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  43. package/dist/esm/bootstrap/runtime-network-policy.js +222 -23
  44. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  45. package/dist/esm/bootstrap/runtime-network-topology.d.ts +31 -4
  46. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  47. package/dist/esm/bootstrap/runtime-network-topology.js +43 -2
  48. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  49. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  50. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +40 -2
  51. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  52. package/dist/esm/bootstrap/runtime-principal.contracts.js +66 -3
  53. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  54. package/dist/esm/bootstrap/runtime-response-integrity.d.ts +249 -0
  55. package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -0
  56. package/dist/esm/bootstrap/runtime-response-integrity.js +353 -0
  57. package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -0
  58. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts +32 -0
  59. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -0
  60. package/dist/esm/bootstrap/runtime-secret-env.contracts.js +43 -0
  61. package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -0
  62. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  63. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  64. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts +51 -0
  65. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -0
  66. package/dist/esm/canonical-json/rfc8785-canonical-json.js +231 -0
  67. package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -0
  68. package/dist/esm/config-authoring.entry.js.map +1 -1
  69. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  70. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  71. package/dist/esm/index.d.ts +20 -1
  72. package/dist/esm/index.d.ts.map +1 -1
  73. package/dist/esm/index.js +20 -1
  74. package/dist/esm/index.js.map +1 -1
  75. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts +119 -0
  76. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts.map +1 -0
  77. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js +109 -0
  78. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js.map +1 -0
  79. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts +182 -0
  80. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts.map +1 -0
  81. package/dist/esm/key-management/application-signing-key-rotation.contracts.js +145 -0
  82. package/dist/esm/key-management/application-signing-key-rotation.contracts.js.map +1 -0
  83. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts +156 -0
  84. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts.map +1 -0
  85. package/dist/esm/key-management/approval-seal-manifested-copy.js +617 -0
  86. package/dist/esm/key-management/approval-seal-manifested-copy.js.map +1 -0
  87. package/dist/esm/key-management/approval-seal-verifier.d.ts +278 -0
  88. package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -0
  89. package/dist/esm/key-management/approval-seal-verifier.js +355 -0
  90. package/dist/esm/key-management/approval-seal-verifier.js.map +1 -0
  91. package/dist/esm/key-management/approval-seal.contracts.d.ts +128 -0
  92. package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -0
  93. package/dist/esm/key-management/approval-seal.contracts.js +135 -0
  94. package/dist/esm/key-management/approval-seal.contracts.js.map +1 -0
  95. package/dist/esm/key-management/data-key.contracts.d.ts +106 -0
  96. package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -0
  97. package/dist/esm/key-management/data-key.contracts.js +54 -0
  98. package/dist/esm/key-management/data-key.contracts.js.map +1 -0
  99. package/dist/esm/key-management/es256-jws.d.ts +60 -0
  100. package/dist/esm/key-management/es256-jws.d.ts.map +1 -0
  101. package/dist/esm/key-management/es256-jws.js +135 -0
  102. package/dist/esm/key-management/es256-jws.js.map +1 -0
  103. package/dist/esm/key-management/key-provider.spi.d.ts +158 -0
  104. package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -0
  105. package/dist/esm/key-management/key-provider.spi.js +38 -0
  106. package/dist/esm/key-management/key-provider.spi.js.map +1 -0
  107. package/dist/esm/key-management/keyring-rotation.contracts.d.ts +83 -0
  108. package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -0
  109. package/dist/esm/key-management/keyring-rotation.contracts.js +101 -0
  110. package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -0
  111. package/dist/esm/key-management/keyring-status.contracts.d.ts +59 -0
  112. package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -0
  113. package/dist/esm/key-management/keyring-status.contracts.js +45 -0
  114. package/dist/esm/key-management/keyring-status.contracts.js.map +1 -0
  115. package/dist/esm/key-management/pdf-incremental-update.d.ts +158 -0
  116. package/dist/esm/key-management/pdf-incremental-update.d.ts.map +1 -0
  117. package/dist/esm/key-management/pdf-incremental-update.js +730 -0
  118. package/dist/esm/key-management/pdf-incremental-update.js.map +1 -0
  119. package/dist/esm/key-management/pdf-truetype-font.d.ts +35 -0
  120. package/dist/esm/key-management/pdf-truetype-font.d.ts.map +1 -0
  121. package/dist/esm/key-management/pdf-truetype-font.js +152 -0
  122. package/dist/esm/key-management/pdf-truetype-font.js.map +1 -0
  123. package/dist/esm/key-management/qr-code.d.ts +38 -0
  124. package/dist/esm/key-management/qr-code.d.ts.map +1 -0
  125. package/dist/esm/key-management/qr-code.js +325 -0
  126. package/dist/esm/key-management/qr-code.js.map +1 -0
  127. package/dist/esm/key-management/signature-request.contracts.d.ts +91 -0
  128. package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -0
  129. package/dist/esm/key-management/signature-request.contracts.js +96 -0
  130. package/dist/esm/key-management/signature-request.contracts.js.map +1 -0
  131. package/dist/esm/key-management/signing-log-export.contracts.d.ts +215 -0
  132. package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -0
  133. package/dist/esm/key-management/signing-log-export.contracts.js +268 -0
  134. package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -0
  135. package/dist/esm/key-management/vault-custody.contracts.d.ts +98 -0
  136. package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -0
  137. package/dist/esm/key-management/vault-custody.contracts.js +154 -0
  138. package/dist/esm/key-management/vault-custody.contracts.js.map +1 -0
  139. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  140. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  141. package/dist/esm/lockfile/canonical-json.d.ts +1 -1
  142. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  143. package/dist/esm/lockfile/canonical-json.js +1 -1
  144. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  145. package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
  146. package/dist/esm/lockfile/file-lock-hold.js +2 -1
  147. package/dist/esm/lockfile/file-lock-hold.js.map +1 -1
  148. package/dist/esm/lockfile/lockfile-io.d.ts +13 -17
  149. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  150. package/dist/esm/lockfile/lockfile-io.js +29 -30
  151. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  152. package/dist/esm/lockfile/materialize-infra-section.d.ts +22 -20
  153. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  154. package/dist/esm/lockfile/materialize-infra-section.js +13 -14
  155. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  156. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +27 -249
  157. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  158. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +28 -3
  159. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  160. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +146 -0
  161. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts.map +1 -0
  162. package/dist/esm/pnpm-settings/application-pnpm-settings.js +573 -0
  163. package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -0
  164. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
  165. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +22 -3
  166. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
  167. package/dist/esm/project-config/application-served-public-documents.loader.d.ts +26 -0
  168. package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -0
  169. package/dist/esm/project-config/application-served-public-documents.loader.js +86 -0
  170. package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -0
  171. package/dist/esm/project-config/backend-compliance-section.reader.d.ts +35 -0
  172. package/dist/esm/project-config/backend-compliance-section.reader.d.ts.map +1 -0
  173. package/dist/esm/project-config/backend-compliance-section.reader.js +123 -0
  174. package/dist/esm/project-config/backend-compliance-section.reader.js.map +1 -0
  175. package/dist/esm/project-config/backend-compliance-section.worker.d.ts +20 -0
  176. package/dist/esm/project-config/backend-compliance-section.worker.d.ts.map +1 -0
  177. package/dist/esm/project-config/backend-compliance-section.worker.js +78 -0
  178. package/dist/esm/project-config/backend-compliance-section.worker.js.map +1 -0
  179. package/dist/esm/project-config/config-module-resolution.d.ts +32 -0
  180. package/dist/esm/project-config/config-module-resolution.d.ts.map +1 -0
  181. package/dist/esm/project-config/config-module-resolution.js +33 -0
  182. package/dist/esm/project-config/config-module-resolution.js.map +1 -0
  183. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  184. package/dist/esm/project-config/define-infra-env-config.d.ts +344 -69
  185. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  186. package/dist/esm/project-config/define-infra-env-config.js +194 -143
  187. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  188. package/dist/esm/project-config/define-minion-config.d.ts +26 -36
  189. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  190. package/dist/esm/project-config/define-minion-config.js +64 -25
  191. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  192. package/dist/esm/project-config/define-saas-config.d.ts +82 -348
  193. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  194. package/dist/esm/project-config/define-saas-config.js +262 -103
  195. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  196. package/dist/esm/project-config/define-worker-config.d.ts +10 -20
  197. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  198. package/dist/esm/project-config/define-worker-config.js +10 -12
  199. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  200. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  201. package/dist/esm/project-config/hosted-infra-env-config.js +4 -1
  202. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  203. package/dist/esm/project-config/index.d.ts +5 -0
  204. package/dist/esm/project-config/index.d.ts.map +1 -1
  205. package/dist/esm/project-config/index.js +5 -0
  206. package/dist/esm/project-config/index.js.map +1 -1
  207. package/dist/esm/project-config/loader-instances-zod.d.ts +19 -0
  208. package/dist/esm/project-config/loader-instances-zod.d.ts.map +1 -0
  209. package/dist/esm/project-config/loader-instances-zod.js +40 -0
  210. package/dist/esm/project-config/loader-instances-zod.js.map +1 -0
  211. package/dist/esm/project-config/loader.d.ts +131 -14
  212. package/dist/esm/project-config/loader.d.ts.map +1 -1
  213. package/dist/esm/project-config/loader.js +226 -12
  214. package/dist/esm/project-config/loader.js.map +1 -1
  215. package/dist/esm/project-config/minion-liveness.contracts.d.ts +131 -0
  216. package/dist/esm/project-config/minion-liveness.contracts.d.ts.map +1 -0
  217. package/dist/esm/project-config/minion-liveness.contracts.js +167 -0
  218. package/dist/esm/project-config/minion-liveness.contracts.js.map +1 -0
  219. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  220. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  221. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
  222. package/dist/esm/project-config/npm-version-range.js +39 -16
  223. package/dist/esm/project-config/npm-version-range.js.map +1 -1
  224. package/dist/esm/project-config/owning-package-tsconfig.d.ts +15 -0
  225. package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -0
  226. package/dist/esm/project-config/owning-package-tsconfig.js +29 -0
  227. package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -0
  228. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  229. package/dist/esm/project-config/provider-companion-discovery.d.ts +4 -4
  230. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  231. package/dist/esm/project-config/provider-companion-discovery.js +16 -10
  232. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  233. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +103 -49
  234. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  235. package/dist/esm/project-config/provider-runtime-artifacts.js +216 -16
  236. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  237. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +0 -2
  238. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  239. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  240. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  241. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  242. package/dist/esm/project-config/shared/auth.schemas.d.ts +0 -17
  243. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  244. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  245. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
  246. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +9 -10
  247. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  248. package/dist/esm/project-config/shared/backing-services.schemas.js +13 -15
  249. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  250. package/dist/esm/project-config/shared/cdn.schemas.d.ts +0 -51
  251. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  252. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  253. package/dist/esm/project-config/shared/csp-defaults.d.ts +36 -9
  254. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  255. package/dist/esm/project-config/shared/csp-defaults.js +54 -11
  256. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  257. package/dist/esm/project-config/shared/csp-emit.d.ts +60 -13
  258. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  259. package/dist/esm/project-config/shared/csp-emit.js +77 -24
  260. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  261. package/dist/esm/project-config/shared/csp.schemas.d.ts +72 -85
  262. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  263. package/dist/esm/project-config/shared/csp.schemas.js +40 -13
  264. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  265. package/dist/esm/project-config/shared/data-services.schemas.d.ts +0 -8
  266. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  267. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  268. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  269. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  270. package/dist/esm/project-config/shared/environment.schemas.d.ts +101 -8
  271. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  272. package/dist/esm/project-config/shared/environment.schemas.js +128 -9
  273. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  274. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +10 -4
  275. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  276. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  277. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  278. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +2 -1
  279. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  280. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +4 -1
  281. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  282. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  283. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  284. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  285. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  286. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +24 -0
  287. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  288. package/dist/esm/project-config/shared/minion-resource-access.validation.js +25 -2
  289. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  290. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  291. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  292. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +276 -0
  293. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -0
  294. package/dist/esm/project-config/shared/platform-key-management.schemas.js +296 -0
  295. package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -0
  296. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  297. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +2 -2
  298. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  299. package/dist/esm/project-config/shared/platform-storage.schemas.js +16 -2
  300. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  301. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +21 -23
  302. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  303. package/dist/esm/project-config/shared/service-definitions.schemas.js +4 -5
  304. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  305. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +0 -18
  306. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  307. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  308. package/dist/esm/project-config/static-asset-import-noop.d.ts +20 -3
  309. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
  310. package/dist/esm/project-config/static-asset-import-noop.js +36 -20
  311. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
  312. package/dist/esm/registry/artifact-domain.schemas.d.ts +0 -5
  313. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  314. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  315. package/dist/esm/registry/digest.schemas.js.map +1 -1
  316. package/dist/esm/registry/index.d.ts +3 -3
  317. package/dist/esm/registry/index.d.ts.map +1 -1
  318. package/dist/esm/registry/index.js +3 -3
  319. package/dist/esm/registry/index.js.map +1 -1
  320. package/dist/esm/registry/local-checkout-source.d.ts +22 -2
  321. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
  322. package/dist/esm/registry/local-checkout-source.js +66 -3
  323. package/dist/esm/registry/local-checkout-source.js.map +1 -1
  324. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +11 -98
  325. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  326. package/dist/esm/registry/lockfile-modules-section.schemas.js +1 -2
  327. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  328. package/dist/esm/registry/module-artifact.schemas.d.ts +40 -17
  329. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  330. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  331. package/dist/esm/registry/module-manifest.schemas.d.ts +324 -74
  332. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  333. package/dist/esm/registry/module-manifest.schemas.js +377 -19
  334. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  335. package/dist/esm/registry/module-search.schemas.d.ts +2 -0
  336. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
  337. package/dist/esm/registry/module-search.schemas.js +14 -1
  338. package/dist/esm/registry/module-search.schemas.js.map +1 -1
  339. package/dist/esm/registry/registry-config.schemas.d.ts +0 -18
  340. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  341. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  342. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  343. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  344. package/dist/esm/registry/registry-errors.d.ts +103 -5
  345. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  346. package/dist/esm/registry/registry-errors.js +213 -6
  347. package/dist/esm/registry/registry-errors.js.map +1 -1
  348. package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
  349. package/dist/esm/registry/registry-section-schemas.constants.d.ts +5 -0
  350. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  351. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  352. package/dist/esm/registry/registry-url-resolution.d.ts +72 -0
  353. package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -0
  354. package/dist/esm/registry/registry-url-resolution.js +157 -0
  355. package/dist/esm/registry/registry-url-resolution.js.map +1 -0
  356. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  357. package/dist/esm/release/framework-release.constants.js.map +1 -1
  358. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  359. package/dist/esm/schemas/framework-secrets.schemas.d.ts +48 -0
  360. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  361. package/dist/esm/schemas/framework-secrets.schemas.js +53 -0
  362. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  363. package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
  364. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  365. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +1 -1
  366. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  367. package/dist/esm/schemas/platform-config.schemas.d.ts +2 -2
  368. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  369. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  370. package/dist/esm/workspace-scope/index.js.map +1 -1
  371. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  372. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  373. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  374. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  375. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  376. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  377. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  378. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  379. package/dist/tsconfig.build.tsbuildinfo +1 -1
  380. package/package.json +12 -12
  381. package/dist/esm/_unimplemented/index.d.ts +0 -3
  382. package/dist/esm/_unimplemented/index.d.ts.map +0 -1
  383. package/dist/esm/_unimplemented/index.js +0 -3
  384. package/dist/esm/_unimplemented/index.js.map +0 -1
  385. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +0 -137
  386. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +0 -1
  387. package/dist/esm/_unimplemented/unimplemented-field-warning.js +0 -153
  388. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +0 -1
  389. package/dist/esm/project-config/shared/cdn.example.d.ts +0 -14
  390. package/dist/esm/project-config/shared/cdn.example.d.ts.map +0 -1
  391. package/dist/esm/project-config/shared/cdn.example.js +0 -38
  392. package/dist/esm/project-config/shared/cdn.example.js.map +0 -1
  393. package/dist/esm/project-config/shared/schema-version.schemas.d.ts +0 -15
  394. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +0 -1
  395. package/dist/esm/project-config/shared/schema-version.schemas.js +0 -40
  396. package/dist/esm/project-config/shared/schema-version.schemas.js.map +0 -1
@@ -32,6 +32,72 @@ export function buildRuntimeNetworkPodLabels(principal, declaration, options) {
32
32
  }
33
33
  return labels;
34
34
  }
35
+ /**
36
+ * Pod labels for a pod that is not an application runtime principal (a backing service, a platform service, a one-shot
37
+ * init Job), from the segments it belongs to (#3372).
38
+ *
39
+ * The same `wildo.ai/net-<segment>: "true"` vocabulary as {@link buildRuntimeNetworkPodLabels}, deliberately: a
40
+ * Kubernetes segment is FLAT, exactly like the compose network it renders (every member reaches every member), so the
41
+ * service and its clients are described by one string. A label per role (`serves-` / `joins-`) was considered and
42
+ * rejected: compose leaves every intra-segment call implicit (the backend dispatching to a worker over the platform
43
+ * segment, mongod and mongot dialling each other over the Mongo one), so a role split would have to enumerate edges
44
+ * nobody has written down, and a missed one is an outage the compose lane does not have.
45
+ */
46
+ export function buildNetworkMembershipPodLabels(networks) {
47
+ const labels = {};
48
+ for (const network of networks) {
49
+ labels[`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`] = 'true';
50
+ }
51
+ return labels;
52
+ }
53
+ /**
54
+ * Where the cluster DNS answers, for the egress allow every pod needs (#3372).
55
+ *
56
+ * The control plane sets an immutable `kubernetes.io/metadata.name` label on every namespace, so a policy can name
57
+ * `kube-system`; CoreDNS keeps `k8s-app: kube-dns` for backward compatibility with the kube-dns it replaced. Port 53 on
58
+ * BOTH protocols: UDP for ordinary lookups, TCP for a truncated answer.
59
+ *
60
+ * spec-cite: https://kubernetes.io/docs/concepts/services-networking/network-policies/ — "Targeting a Namespace by its
61
+ * name"; https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/ — "Check if the DNS pod is
62
+ * running" (the `k8s-app=kube-dns` value for CoreDNS).
63
+ */
64
+ export const CLUSTER_DNS_SELECTOR = {
65
+ NAMESPACE_LABELS: { 'kubernetes.io/metadata.name': 'kube-system' },
66
+ POD_LABELS: { 'k8s-app': 'kube-dns' },
67
+ PORT: 53,
68
+ };
69
+ /** The name of the segment-allow policy for one network, shared by the builder and anything that reads its output. */
70
+ export function runtimeNetworkPolicyName(network) {
71
+ return `wildo-allow-${network}`;
72
+ }
73
+ /** The name of the namespace-wide DNS egress allow. */
74
+ export const RUNTIME_NETWORK_DNS_POLICY_NAME = 'wildo-allow-dns';
75
+ /** The name of the off-cluster egress allow of one segment. */
76
+ export function runtimeNetworkOffClusterPolicyName(network) {
77
+ return `${runtimeNetworkPolicyName(network)}-off-cluster`;
78
+ }
79
+ /**
80
+ * Every address, in both families: the destination of an off-cluster allow, which is then bounded by the service's
81
+ * ports and by the segment label rather than by an address range.
82
+ */
83
+ export const OFF_CLUSTER_ADDRESS_BLOCKS = ['0.0.0.0/0', '::/0'];
84
+ /**
85
+ * cert-manager's ACME HTTP-01 solver pod: the label cert-manager puts on it and the port it listens on, read from
86
+ * cert-manager's source (`SolverIdentificationLabelKey`, `acmeSolverListenPort`). The pod is created in the namespace
87
+ * of the Challenge, which is the namespace of the Ingress that asked for the certificate, so this namespace.
88
+ *
89
+ * spec-cite: https://github.com/cert-manager/cert-manager/blob/master/pkg/apis/acme/v1/types.go —
90
+ * `SolverIdentificationLabelKey = "acme.cert-manager.io/http01-solver"`;
91
+ * https://github.com/cert-manager/cert-manager/blob/master/pkg/issuer/acme/http/http.go — `acmeSolverListenPort = 8089`;
92
+ * https://cert-manager.io/docs/configuration/acme/http01/ — "Network Policy Considerations" (allow the ingress controller
93
+ * to reach the temporary solver resources).
94
+ */
95
+ export const ACME_HTTP01_SOLVER_SELECTOR = {
96
+ POD_LABELS: { 'acme.cert-manager.io/http01-solver': 'true' },
97
+ PORT: 8089,
98
+ };
99
+ /** The name of the ingress allow for cert-manager's ACME HTTP-01 solver pods. */
100
+ export const ACME_HTTP01_SOLVER_POLICY_NAME = 'wildo-allow-acme-http01-solver';
35
101
  /**
36
102
  * The static policy set for a namespace.
37
103
  *
@@ -40,20 +106,44 @@ export function buildRuntimeNetworkPodLabels(principal, declaration, options) {
40
106
  * 1. **A default-deny for ingress AND egress.** Both, because an egress-only
41
107
  * policy still lets an unlabelled pod be REACHED, and the pair is what makes
42
108
  * absence-of-label mean denial.
43
- * 2. **One ingress policy per INTERNAL network**, admitting only pods carrying
44
- * that network's label. The backing service itself is selected by the same
45
- * label, so a service and its clients are described by one string.
46
- * 3. **One egress policy for `wildo-egress`**, the only door off the cluster
109
+ * 2. **A DNS egress allow for every pod** (#3372). A default-deny egress also
110
+ * denies the lookup that precedes every connection, so without it no pod can
111
+ * resolve the Service of a backing service it is otherwise allowed to reach.
112
+ * It opens the cluster DNS pods on port 53 and nothing else.
113
+ * 3. **One policy per INTERNAL network, in BOTH directions** (#3372): a pod carrying
114
+ * the network's label may reach, and be reached by, every other pod carrying
115
+ * it. Until #3372 this was ingress-only, and under a default-deny egress that
116
+ * meant no client could open a connection to its backing service at all; the
117
+ * backing-service pods carried no label either, so they were unreachable from
118
+ * both ends.
119
+ * 4. **An ingress allow for `wildo-edge`** (#3372): a pod serving a public route is
120
+ * reached through the ingress controller, which runs in another namespace (or
121
+ * on the node's network), so its ingress is open to every source. The edge is
122
+ * public by definition; segmenting it here would only cut the route the
123
+ * ingress object exists to provide. It grants the edge pod no egress.
124
+ * 5. **One egress policy for `wildo-egress`**, the only door off the cluster
47
125
  * below the edge, admitting only pods that AUTHORED the need.
126
+ * 6. **One egress policy per segment whose backing service is served OFF the
127
+ * cluster** (#3511), from `options.offClusterServices`: the segment's members
128
+ * may open a connection to any address on that service's ports, and nothing
129
+ * else. See {@link buildOffClusterServicePolicy} for why the destination is
130
+ * every address.
131
+ * 7. **An ingress allow for cert-manager's ACME HTTP-01 solver pods** (#3511),
132
+ * when `options.admitsAcmeHttp01Solver`: open to every source on the solver's
133
+ * port, for the same reason as the edge (the challenge arrives through the
134
+ * ingress controller, from the ACME server on the internet).
48
135
  *
49
136
  * ⚠️ The default-deny is inert until pods carry labels from
50
- * {@link buildRuntimeNetworkPodLabels}. Emitting the policies WITHOUT wiring the
51
- * labels would deny everything at the first deployment — so the two must land in
52
- * the same change. This is the reverse of the usual vacuity trap: not a control
53
- * that enforces nothing, but a control that enforces everything.
137
+ * {@link buildRuntimeNetworkPodLabels} / {@link buildNetworkMembershipPodLabels}.
138
+ * Emitting the policies WITHOUT wiring the labels denies everything at the first
139
+ * deployment — which is what #3372 found: the application runtimes were
140
+ * labelled, the backing services they dial were not.
54
141
  */
55
- export function buildRuntimeNetworkPolicyDocuments(namespace) {
142
+ export function buildRuntimeNetworkPolicyDocuments(namespace, options = {}) {
56
143
  const meta = (name) => namespace ? { name, namespace } : { name };
144
+ const member = (network) => ({
145
+ matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`]: 'true' },
146
+ });
57
147
  const documents = [
58
148
  {
59
149
  apiVersion: 'networking.k8s.io/v1',
@@ -63,6 +153,31 @@ export function buildRuntimeNetworkPolicyDocuments(namespace) {
63
153
  // policy types with no rules denies both directions.
64
154
  spec: { podSelector: {}, policyTypes: ['Ingress', 'Egress'] },
65
155
  },
156
+ {
157
+ apiVersion: 'networking.k8s.io/v1',
158
+ kind: 'NetworkPolicy',
159
+ metadata: meta(RUNTIME_NETWORK_DNS_POLICY_NAME),
160
+ spec: {
161
+ podSelector: {},
162
+ policyTypes: ['Egress'],
163
+ egress: [
164
+ {
165
+ // ONE peer carrying both selectors: the DNS pods IN kube-system. Two
166
+ // peers would mean "any pod in kube-system, OR any kube-dns pod".
167
+ to: [
168
+ {
169
+ namespaceSelector: { matchLabels: { ...CLUSTER_DNS_SELECTOR.NAMESPACE_LABELS } },
170
+ podSelector: { matchLabels: { ...CLUSTER_DNS_SELECTOR.POD_LABELS } },
171
+ },
172
+ ],
173
+ ports: [
174
+ { protocol: 'UDP', port: CLUSTER_DNS_SELECTOR.PORT },
175
+ { protocol: 'TCP', port: CLUSTER_DNS_SELECTOR.PORT },
176
+ ],
177
+ },
178
+ ],
179
+ },
180
+ },
66
181
  ];
67
182
  for (const network of Object.values(WildoRuntimeNetwork)) {
68
183
  if (!isInternalNetwork(network))
@@ -70,28 +185,32 @@ export function buildRuntimeNetworkPolicyDocuments(namespace) {
70
185
  documents.push({
71
186
  apiVersion: 'networking.k8s.io/v1',
72
187
  kind: 'NetworkPolicy',
73
- metadata: meta(`wildo-allow-${network}`),
188
+ metadata: meta(runtimeNetworkPolicyName(network)),
74
189
  spec: {
75
- podSelector: { matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`]: 'true' } },
76
- policyTypes: ['Ingress'],
77
- ingress: [
78
- {
79
- from: [
80
- { podSelector: { matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`]: 'true' } } },
81
- ],
82
- },
83
- ],
190
+ podSelector: member(network),
191
+ policyTypes: ['Ingress', 'Egress'],
192
+ ingress: [{ from: [{ podSelector: member(network) }] }],
193
+ egress: [{ to: [{ podSelector: member(network) }] }],
84
194
  },
85
195
  });
86
196
  }
87
197
  documents.push({
88
198
  apiVersion: 'networking.k8s.io/v1',
89
199
  kind: 'NetworkPolicy',
90
- metadata: meta(`wildo-allow-${WildoRuntimeNetwork.EGRESS}`),
200
+ metadata: meta(runtimeNetworkPolicyName(WildoRuntimeNetwork.EDGE)),
91
201
  spec: {
92
- podSelector: {
93
- matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${WildoRuntimeNetwork.EGRESS}`]: 'true' },
94
- },
202
+ podSelector: member(WildoRuntimeNetwork.EDGE),
203
+ policyTypes: ['Ingress'],
204
+ // One rule with no `from`: every source. See point 4 above.
205
+ ingress: [{}],
206
+ },
207
+ });
208
+ documents.push({
209
+ apiVersion: 'networking.k8s.io/v1',
210
+ kind: 'NetworkPolicy',
211
+ metadata: meta(runtimeNetworkPolicyName(WildoRuntimeNetwork.EGRESS)),
212
+ spec: {
213
+ podSelector: member(WildoRuntimeNetwork.EGRESS),
95
214
  policyTypes: ['Egress'],
96
215
  // Unrestricted destination, deliberately: this is the AUTHORED door, and
97
216
  // narrowing it by CIDR would be a claim about the internet nobody can keep
@@ -99,6 +218,86 @@ export function buildRuntimeNetworkPolicyDocuments(namespace) {
99
218
  egress: [{}],
100
219
  },
101
220
  });
221
+ // One policy per segment, its ports merged: two declarations naming the same segment are one door, not two.
222
+ const offClusterPorts = new Map();
223
+ for (const service of options.offClusterServices ?? []) {
224
+ if (!isInternalNetwork(service.network)) {
225
+ throw new Error(`An off-cluster service is reached by the members of an internal segment, not of '${service.network}'.`);
226
+ }
227
+ if (service.ports.length === 0) {
228
+ throw new Error(`The off-cluster service of '${service.network}' declares no port; an allow without one would open every port.`);
229
+ }
230
+ const ports = offClusterPorts.get(service.network) ?? new Set();
231
+ for (const port of service.ports)
232
+ ports.add(port);
233
+ offClusterPorts.set(service.network, ports);
234
+ }
235
+ for (const network of Object.values(WildoRuntimeNetwork)) {
236
+ const ports = offClusterPorts.get(network);
237
+ if (ports)
238
+ documents.push(buildOffClusterServicePolicy(meta, member(network), network, [...ports].sort((a, b) => a - b)));
239
+ }
240
+ if (options.admitsAcmeHttp01Solver) {
241
+ documents.push({
242
+ apiVersion: 'networking.k8s.io/v1',
243
+ kind: 'NetworkPolicy',
244
+ metadata: meta(ACME_HTTP01_SOLVER_POLICY_NAME),
245
+ spec: {
246
+ podSelector: { matchLabels: { ...ACME_HTTP01_SOLVER_SELECTOR.POD_LABELS } },
247
+ policyTypes: ['Ingress'],
248
+ // Every source, on the solver's port only: the challenge request is the ACME server's, relayed by the ingress
249
+ // controller from another namespace, and cert-manager's own self-check takes the same path. No egress: the pod
250
+ // only answers.
251
+ ingress: [{ ports: [{ protocol: 'TCP', port: ACME_HTTP01_SOLVER_SELECTOR.PORT }] }],
252
+ },
253
+ });
254
+ }
102
255
  return documents;
103
256
  }
257
+ /**
258
+ * The egress allow of a segment whose backing service lives off the cluster (#3511).
259
+ *
260
+ * ## Why the destination is every address, bounded by port
261
+ *
262
+ * A NetworkPolicy cannot name a destination by DNS name, and a managed service has no address the deployment knows:
263
+ * the endpoint is a name (`*.mongodb.net`, a provider's database host) whose addresses the provider changes, an Atlas
264
+ * `mongodb+srv` URL resolves to a set of hosts only at connect time, and a private endpoint (VPC peering, Private Link)
265
+ * answers on a private address. So the rule names every address on the service's ports, and the segment label decides
266
+ * WHO may use it: a worker, which is on no data segment, still reaches no database port anywhere.
267
+ *
268
+ * spec-cite: https://kubernetes.io/docs/concepts/services-networking/network-policies/ — "What you can't do with network
269
+ * policies": "Targeting of services by name"; "Behavior of `to` and `from` selectors": ipBlock "selects particular IP
270
+ * CIDR ranges to allow as ingress sources or egress destinations. These should be cluster-external IPs".
271
+ *
272
+ * ## Rejected alternatives
273
+ *
274
+ * - **`0.0.0.0/0` except the RFC 1918 ranges** (the usual "internet only" shape). It would cut a managed service reached
275
+ * over a private endpoint, which is the recommended production setup for Atlas and for every cloud database.
276
+ * - **`0.0.0.0/0` except the cluster's pod and service CIDRs.** Nothing in an environment declares them, and inventing a
277
+ * field for them would ask the operator for a fact the cluster already holds. What the exception would prevent is a
278
+ * segment member reaching an IN-CLUSTER pod on the same port through the address rule — a pod outside this namespace,
279
+ * since every non-public pod here sits behind the namespace's default-deny ingress. Whether an ipBlock matches pod
280
+ * addresses at all is left to the network plugin by the API ("it is not defined whether this happens before or after
281
+ * NetworkPolicy processing"). Where it does, a segment member reaches, on the service's port only, a public-route pod
282
+ * of this namespace (which every internet client reaches anyway) and a pod of another namespace that its own ingress
283
+ * policy leaves open. Recorded as the residual rather than closed by a guess; `k8s-network-policy-graph.test.ts`
284
+ * evaluates the set under that pessimistic reading.
285
+ */
286
+ function buildOffClusterServicePolicy(meta, podSelector, network, ports) {
287
+ return {
288
+ apiVersion: 'networking.k8s.io/v1',
289
+ kind: 'NetworkPolicy',
290
+ metadata: meta(runtimeNetworkOffClusterPolicyName(network)),
291
+ spec: {
292
+ podSelector,
293
+ policyTypes: ['Egress'],
294
+ egress: [
295
+ {
296
+ to: OFF_CLUSTER_ADDRESS_BLOCKS.map((cidr) => ({ ipBlock: { cidr } })),
297
+ ports: ports.map((port) => ({ protocol: 'TCP', port })),
298
+ },
299
+ ],
300
+ },
301
+ };
302
+ }
104
303
  //# sourceMappingURL=runtime-network-policy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-network-policy.js","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-network-policy.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,+BAA+B,GAChC,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;;;;;;GAeG;AAEH,gEAAgE;AAChE,MAAM,CAAC,MAAM,4BAA4B,GAAG,eAAe,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAC1C,SAAkD,EAClD,WAAkD,EAClD,OAA2C;IAE3C,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,OAAO,IAAI,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4B,GAAG,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;yBAC5F;qBACF;iBACF;aACF;SACF,CAAC,CAAC;IACL,CAAC;IAED,SAAS,CAAC,IAAI,CAAC;QACb,UAAU,EAAE,sBAAsB;QAClC,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,IAAI,CAAC,eAAe,mBAAmB,CAAC,MAAM,EAAE,CAAC;QAC3D,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,WAAW,EAAE,EAAE,CAAC,GAAG,4BAA4B,GAAG,mBAAmB,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE;aAC1F;YACD,WAAW,EAAE,CAAC,QAAQ,CAAC;YACvB,yEAAyE;YACzE,2EAA2E;YAC3E,wEAAwE;YACxE,MAAM,EAAE,CAAC,EAAE,CAAC;SACb;KACF,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';\nimport type { RuntimeAccessDeclaration } from './runtime-backing-service-access';\nimport {\n WildoRuntimeNetwork,\n isInternalNetwork,\n resolveRuntimeNetworkMembership,\n} from './runtime-network-topology';\n\n/**\n * The Kubernetes rendering of {@link WildoRuntimeNetwork} (Step 5-egress, half A).\n *\n * ## Why labels rather than a policy per runtime\n *\n * Compose expresses segmentation as network MEMBERSHIP; Kubernetes has no such\n * concept — every pod shares one flat pod network and `NetworkPolicy` selects on\n * LABELS. So the same declaration renders two ways: a network list for Compose,\n * and a label set plus a static policy per network for Kubernetes.\n *\n * Keeping the policies STATIC and putting the per-runtime part entirely in labels\n * is what lets the cluster-level manifest generator emit them without knowing the\n * application's runtime inventory — the reason a policy-per-runtime shape was\n * rejected. It also means adding a minion changes only its own pod labels, never\n * a cluster policy, so the two cannot drift out of sync as runtimes come and go.\n */\n\n/** Label prefix marking which segment a pod participates in. */\nexport const RUNTIME_NETWORK_LABEL_PREFIX = 'wildo.ai/net-';\n\n/**\n * Pod labels for a runtime, derived from the SAME call Compose membership uses.\n *\n * A label is only ever `'true'`; ABSENCE is what denies. That asymmetry is\n * deliberate — `'false'` would be a value a selector could match by mistake, and\n * a policy that allowed `net-mongo != 'true'` would admit every pod that simply\n * never set the label.\n */\nexport function buildRuntimeNetworkPodLabels(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration?: RuntimeAccessDeclaration | undefined,\n options?: { readonly servesHttp?: boolean },\n): Record<string, string> {\n const labels: Record<string, string> = {};\n for (const network of resolveRuntimeNetworkMembership(principal, declaration, options)) {\n labels[`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`] = 'true';\n }\n return labels;\n}\n\n/** A `NetworkPolicy` document, in the shape the manifest renderer serialises. */\nexport interface RuntimeNetworkPolicyDocument {\n readonly apiVersion: 'networking.k8s.io/v1';\n readonly kind: 'NetworkPolicy';\n readonly metadata: { readonly name: string; readonly namespace?: string };\n readonly spec: Record<string, unknown>;\n}\n\n/**\n * The static policy set for a namespace.\n *\n * Emits, in order:\n *\n * 1. **A default-deny for ingress AND egress.** Both, because an egress-only\n * policy still lets an unlabelled pod be REACHED, and the pair is what makes\n * absence-of-label mean denial.\n * 2. **One ingress policy per INTERNAL network**, admitting only pods carrying\n * that network's label. The backing service itself is selected by the same\n * label, so a service and its clients are described by one string.\n * 3. **One egress policy for `wildo-egress`**, the only door off the cluster\n * below the edge, admitting only pods that AUTHORED the need.\n *\n * ⚠️ The default-deny is inert until pods carry labels from\n * {@link buildRuntimeNetworkPodLabels}. Emitting the policies WITHOUT wiring the\n * labels would deny everything at the first deployment — so the two must land in\n * the same change. This is the reverse of the usual vacuity trap: not a control\n * that enforces nothing, but a control that enforces everything.\n */\nexport function buildRuntimeNetworkPolicyDocuments(namespace?: string): readonly RuntimeNetworkPolicyDocument[] {\n const meta = (name: string): RuntimeNetworkPolicyDocument['metadata'] =>\n namespace ? { name, namespace } : { name };\n\n const documents: RuntimeNetworkPolicyDocument[] = [\n {\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta('wildo-default-deny'),\n // An empty podSelector selects EVERY pod in the namespace; naming both\n // policy types with no rules denies both directions.\n spec: { podSelector: {}, policyTypes: ['Ingress', 'Egress'] },\n },\n ];\n\n for (const network of Object.values(WildoRuntimeNetwork)) {\n if (!isInternalNetwork(network)) continue;\n documents.push({\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(`wildo-allow-${network}`),\n spec: {\n podSelector: { matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`]: 'true' } },\n policyTypes: ['Ingress'],\n ingress: [\n {\n from: [\n { podSelector: { matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`]: 'true' } } },\n ],\n },\n ],\n },\n });\n }\n\n documents.push({\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(`wildo-allow-${WildoRuntimeNetwork.EGRESS}`),\n spec: {\n podSelector: {\n matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${WildoRuntimeNetwork.EGRESS}`]: 'true' },\n },\n policyTypes: ['Egress'],\n // Unrestricted destination, deliberately: this is the AUTHORED door, and\n // narrowing it by CIDR would be a claim about the internet nobody can keep\n // current. What the declaration buys is that the door is not universal.\n egress: [{}],\n },\n });\n\n return documents;\n}\n"]}
1
+ {"version":3,"file":"runtime-network-policy.js","sourceRoot":"","sources":["../../../src/bootstrap/runtime-network-policy.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,+BAA+B,GAEhC,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;;;;;;GAeG;AAEH,gEAAgE;AAChE,MAAM,CAAC,MAAM,4BAA4B,GAAG,eAAe,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAC1C,SAAkD,EAClD,WAAiD,EACjD,OAAwC;IAExC,MAAM,MAAM,GAA2B,EAAE,CAAC;IA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EAAE,CAAC,CAAC;oBACrE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;iBACxD;aACF;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';\nimport type { RuntimeAccessDeclaration } from './runtime-backing-service-access';\nimport {\n WildoRuntimeNetwork,\n isInternalNetwork,\n resolveRuntimeNetworkMembership,\n type RuntimeNetworkMembershipOptions,\n} from './runtime-network-topology';\n\n/**\n * The Kubernetes rendering of {@link WildoRuntimeNetwork} (Step 5-egress, half A).\n *\n * ## Why labels rather than a policy per runtime\n *\n * Compose expresses segmentation as network MEMBERSHIP; Kubernetes has no such\n * concept — every pod shares one flat pod network and `NetworkPolicy` selects on\n * LABELS. So the same declaration renders two ways: a network list for Compose,\n * and a label set plus a static policy per network for Kubernetes.\n *\n * Keeping the policies STATIC and putting the per-runtime part entirely in labels\n * is what lets the cluster-level manifest generator emit them without knowing the\n * application's runtime inventory — the reason a policy-per-runtime shape was\n * rejected. It also means adding a minion changes only its own pod labels, never\n * a cluster policy, so the two cannot drift out of sync as runtimes come and go.\n */\n\n/** Label prefix marking which segment a pod participates in. */\nexport const RUNTIME_NETWORK_LABEL_PREFIX = 'wildo.ai/net-';\n\n/**\n * Pod labels for a runtime, derived from the SAME call Compose membership uses.\n *\n * A label is only ever `'true'`; ABSENCE is what denies. That asymmetry is\n * deliberate — `'false'` would be a value a selector could match by mistake, and\n * a policy that allowed `net-mongo != 'true'` would admit every pod that simply\n * never set the label.\n */\nexport function buildRuntimeNetworkPodLabels(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration: RuntimeAccessDeclaration | undefined,\n options: RuntimeNetworkMembershipOptions,\n): Record<string, string> {\n const labels: Record<string, string> = {};\n for (const network of resolveRuntimeNetworkMembership(principal, declaration, options)) {\n labels[`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`] = 'true';\n }\n return labels;\n}\n\n/**\n * Pod labels for a pod that is not an application runtime principal (a backing service, a platform service, a one-shot\n * init Job), from the segments it belongs to (#3372).\n *\n * The same `wildo.ai/net-<segment>: \"true\"` vocabulary as {@link buildRuntimeNetworkPodLabels}, deliberately: a\n * Kubernetes segment is FLAT, exactly like the compose network it renders (every member reaches every member), so the\n * service and its clients are described by one string. A label per role (`serves-` / `joins-`) was considered and\n * rejected: compose leaves every intra-segment call implicit (the backend dispatching to a worker over the platform\n * segment, mongod and mongot dialling each other over the Mongo one), so a role split would have to enumerate edges\n * nobody has written down, and a missed one is an outage the compose lane does not have.\n */\nexport function buildNetworkMembershipPodLabels(networks: Iterable<WildoRuntimeNetwork>): Record<string, string> {\n const labels: Record<string, string> = {};\n for (const network of networks) {\n labels[`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`] = 'true';\n }\n return labels;\n}\n\n/** A `NetworkPolicy` document, in the shape the manifest renderer serialises. */\nexport interface RuntimeNetworkPolicyDocument {\n readonly apiVersion: 'networking.k8s.io/v1';\n readonly kind: 'NetworkPolicy';\n readonly metadata: { readonly name: string; readonly namespace?: string };\n readonly spec: Record<string, unknown>;\n}\n\n/**\n * Where the cluster DNS answers, for the egress allow every pod needs (#3372).\n *\n * The control plane sets an immutable `kubernetes.io/metadata.name` label on every namespace, so a policy can name\n * `kube-system`; CoreDNS keeps `k8s-app: kube-dns` for backward compatibility with the kube-dns it replaced. Port 53 on\n * BOTH protocols: UDP for ordinary lookups, TCP for a truncated answer.\n *\n * spec-cite: https://kubernetes.io/docs/concepts/services-networking/network-policies/ — \"Targeting a Namespace by its\n * name\"; https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/ — \"Check if the DNS pod is\n * running\" (the `k8s-app=kube-dns` value for CoreDNS).\n */\nexport const CLUSTER_DNS_SELECTOR = {\n NAMESPACE_LABELS: { 'kubernetes.io/metadata.name': 'kube-system' },\n POD_LABELS: { 'k8s-app': 'kube-dns' },\n PORT: 53,\n} as const;\n\n/** The name of the segment-allow policy for one network, shared by the builder and anything that reads its output. */\nexport function runtimeNetworkPolicyName(network: WildoRuntimeNetwork): string {\n return `wildo-allow-${network}`;\n}\n\n/** The name of the namespace-wide DNS egress allow. */\nexport const RUNTIME_NETWORK_DNS_POLICY_NAME = 'wildo-allow-dns';\n\n/**\n * A backing service a segment's members reach OFF the cluster (#3511): an environment that declares it MANAGED (a\n * MongoDB Atlas cluster, a managed PostgreSQL, a managed broker) has no pod for it in the namespace, so the segment's\n * pod-selector allow reaches nothing and the default-deny would cut its clients off. The deployment lane derives these\n * from the environment's declared providers; this module only renders them.\n */\nexport interface RuntimeNetworkOffClusterService {\n /** The INTERNAL segment whose members are the service's clients. */\n readonly network: WildoRuntimeNetwork;\n /** The TCP ports the service answers on. */\n readonly ports: readonly number[];\n}\n\n/** What the namespace's policy set depends on beyond the segment vocabulary. */\nexport interface RuntimeNetworkPolicyOptions {\n /** The backing services served off the cluster, one egress allow per segment. Empty when everything is self-hosted. */\n readonly offClusterServices?: readonly RuntimeNetworkOffClusterService[];\n /**\n * Whether certificates are issued in this namespace by an ACME HTTP-01 issuer (the remote cluster's cert-manager\n * `ClusterIssuer`). cert-manager then creates a temporary solver pod in the namespace, which the ingress controller\n * must reach for the challenge to be answered; under the default-deny it could not, and no certificate would issue.\n */\n readonly admitsAcmeHttp01Solver?: boolean;\n}\n\n/** The name of the off-cluster egress allow of one segment. */\nexport function runtimeNetworkOffClusterPolicyName(network: WildoRuntimeNetwork): string {\n return `${runtimeNetworkPolicyName(network)}-off-cluster`;\n}\n\n/**\n * Every address, in both families: the destination of an off-cluster allow, which is then bounded by the service's\n * ports and by the segment label rather than by an address range.\n */\nexport const OFF_CLUSTER_ADDRESS_BLOCKS = ['0.0.0.0/0', '::/0'] as const;\n\n/**\n * cert-manager's ACME HTTP-01 solver pod: the label cert-manager puts on it and the port it listens on, read from\n * cert-manager's source (`SolverIdentificationLabelKey`, `acmeSolverListenPort`). The pod is created in the namespace\n * of the Challenge, which is the namespace of the Ingress that asked for the certificate, so this namespace.\n *\n * spec-cite: https://github.com/cert-manager/cert-manager/blob/master/pkg/apis/acme/v1/types.go —\n * `SolverIdentificationLabelKey = \"acme.cert-manager.io/http01-solver\"`;\n * https://github.com/cert-manager/cert-manager/blob/master/pkg/issuer/acme/http/http.go — `acmeSolverListenPort = 8089`;\n * https://cert-manager.io/docs/configuration/acme/http01/ — \"Network Policy Considerations\" (allow the ingress controller\n * to reach the temporary solver resources).\n */\nexport const ACME_HTTP01_SOLVER_SELECTOR = {\n POD_LABELS: { 'acme.cert-manager.io/http01-solver': 'true' },\n PORT: 8089,\n} as const;\n\n/** The name of the ingress allow for cert-manager's ACME HTTP-01 solver pods. */\nexport const ACME_HTTP01_SOLVER_POLICY_NAME = 'wildo-allow-acme-http01-solver';\n\n/**\n * The static policy set for a namespace.\n *\n * Emits, in order:\n *\n * 1. **A default-deny for ingress AND egress.** Both, because an egress-only\n * policy still lets an unlabelled pod be REACHED, and the pair is what makes\n * absence-of-label mean denial.\n * 2. **A DNS egress allow for every pod** (#3372). A default-deny egress also\n * denies the lookup that precedes every connection, so without it no pod can\n * resolve the Service of a backing service it is otherwise allowed to reach.\n * It opens the cluster DNS pods on port 53 and nothing else.\n * 3. **One policy per INTERNAL network, in BOTH directions** (#3372): a pod carrying\n * the network's label may reach, and be reached by, every other pod carrying\n * it. Until #3372 this was ingress-only, and under a default-deny egress that\n * meant no client could open a connection to its backing service at all; the\n * backing-service pods carried no label either, so they were unreachable from\n * both ends.\n * 4. **An ingress allow for `wildo-edge`** (#3372): a pod serving a public route is\n * reached through the ingress controller, which runs in another namespace (or\n * on the node's network), so its ingress is open to every source. The edge is\n * public by definition; segmenting it here would only cut the route the\n * ingress object exists to provide. It grants the edge pod no egress.\n * 5. **One egress policy for `wildo-egress`**, the only door off the cluster\n * below the edge, admitting only pods that AUTHORED the need.\n * 6. **One egress policy per segment whose backing service is served OFF the\n * cluster** (#3511), from `options.offClusterServices`: the segment's members\n * may open a connection to any address on that service's ports, and nothing\n * else. See {@link buildOffClusterServicePolicy} for why the destination is\n * every address.\n * 7. **An ingress allow for cert-manager's ACME HTTP-01 solver pods** (#3511),\n * when `options.admitsAcmeHttp01Solver`: open to every source on the solver's\n * port, for the same reason as the edge (the challenge arrives through the\n * ingress controller, from the ACME server on the internet).\n *\n * ⚠️ The default-deny is inert until pods carry labels from\n * {@link buildRuntimeNetworkPodLabels} / {@link buildNetworkMembershipPodLabels}.\n * Emitting the policies WITHOUT wiring the labels denies everything at the first\n * deployment — which is what #3372 found: the application runtimes were\n * labelled, the backing services they dial were not.\n */\nexport function buildRuntimeNetworkPolicyDocuments(\n namespace?: string,\n options: RuntimeNetworkPolicyOptions = {},\n): readonly RuntimeNetworkPolicyDocument[] {\n const meta = (name: string): RuntimeNetworkPolicyDocument['metadata'] =>\n namespace ? { name, namespace } : { name };\n const member = (network: WildoRuntimeNetwork): { matchLabels: Record<string, string> } => ({\n matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`]: 'true' },\n });\n\n const documents: RuntimeNetworkPolicyDocument[] = [\n {\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta('wildo-default-deny'),\n // An empty podSelector selects EVERY pod in the namespace; naming both\n // policy types with no rules denies both directions.\n spec: { podSelector: {}, policyTypes: ['Ingress', 'Egress'] },\n },\n {\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(RUNTIME_NETWORK_DNS_POLICY_NAME),\n spec: {\n podSelector: {},\n policyTypes: ['Egress'],\n egress: [\n {\n // ONE peer carrying both selectors: the DNS pods IN kube-system. Two\n // peers would mean \"any pod in kube-system, OR any kube-dns pod\".\n to: [\n {\n namespaceSelector: { matchLabels: { ...CLUSTER_DNS_SELECTOR.NAMESPACE_LABELS } },\n podSelector: { matchLabels: { ...CLUSTER_DNS_SELECTOR.POD_LABELS } },\n },\n ],\n ports: [\n { protocol: 'UDP', port: CLUSTER_DNS_SELECTOR.PORT },\n { protocol: 'TCP', port: CLUSTER_DNS_SELECTOR.PORT },\n ],\n },\n ],\n },\n },\n ];\n\n for (const network of Object.values(WildoRuntimeNetwork)) {\n if (!isInternalNetwork(network)) continue;\n documents.push({\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(runtimeNetworkPolicyName(network)),\n spec: {\n podSelector: member(network),\n policyTypes: ['Ingress', 'Egress'],\n ingress: [{ from: [{ podSelector: member(network) }] }],\n egress: [{ to: [{ podSelector: member(network) }] }],\n },\n });\n }\n\n documents.push({\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(runtimeNetworkPolicyName(WildoRuntimeNetwork.EDGE)),\n spec: {\n podSelector: member(WildoRuntimeNetwork.EDGE),\n policyTypes: ['Ingress'],\n // One rule with no `from`: every source. See point 4 above.\n ingress: [{}],\n },\n });\n\n documents.push({\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(runtimeNetworkPolicyName(WildoRuntimeNetwork.EGRESS)),\n spec: {\n podSelector: member(WildoRuntimeNetwork.EGRESS),\n policyTypes: ['Egress'],\n // Unrestricted destination, deliberately: this is the AUTHORED door, and\n // narrowing it by CIDR would be a claim about the internet nobody can keep\n // current. What the declaration buys is that the door is not universal.\n egress: [{}],\n },\n });\n\n // One policy per segment, its ports merged: two declarations naming the same segment are one door, not two.\n const offClusterPorts = new Map<WildoRuntimeNetwork, Set<number>>();\n for (const service of options.offClusterServices ?? []) {\n if (!isInternalNetwork(service.network)) {\n throw new Error(`An off-cluster service is reached by the members of an internal segment, not of '${service.network}'.`);\n }\n if (service.ports.length === 0) {\n throw new Error(`The off-cluster service of '${service.network}' declares no port; an allow without one would open every port.`);\n }\n const ports = offClusterPorts.get(service.network) ?? new Set<number>();\n for (const port of service.ports) ports.add(port);\n offClusterPorts.set(service.network, ports);\n }\n for (const network of Object.values(WildoRuntimeNetwork)) {\n const ports = offClusterPorts.get(network);\n if (ports) documents.push(buildOffClusterServicePolicy(meta, member(network), network, [...ports].sort((a, b) => a - b)));\n }\n\n if (options.admitsAcmeHttp01Solver) {\n documents.push({\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(ACME_HTTP01_SOLVER_POLICY_NAME),\n spec: {\n podSelector: { matchLabels: { ...ACME_HTTP01_SOLVER_SELECTOR.POD_LABELS } },\n policyTypes: ['Ingress'],\n // Every source, on the solver's port only: the challenge request is the ACME server's, relayed by the ingress\n // controller from another namespace, and cert-manager's own self-check takes the same path. No egress: the pod\n // only answers.\n ingress: [{ ports: [{ protocol: 'TCP', port: ACME_HTTP01_SOLVER_SELECTOR.PORT }] }],\n },\n });\n }\n\n return documents;\n}\n\n/**\n * The egress allow of a segment whose backing service lives off the cluster (#3511).\n *\n * ## Why the destination is every address, bounded by port\n *\n * A NetworkPolicy cannot name a destination by DNS name, and a managed service has no address the deployment knows:\n * the endpoint is a name (`*.mongodb.net`, a provider's database host) whose addresses the provider changes, an Atlas\n * `mongodb+srv` URL resolves to a set of hosts only at connect time, and a private endpoint (VPC peering, Private Link)\n * answers on a private address. So the rule names every address on the service's ports, and the segment label decides\n * WHO may use it: a worker, which is on no data segment, still reaches no database port anywhere.\n *\n * spec-cite: https://kubernetes.io/docs/concepts/services-networking/network-policies/ — \"What you can't do with network\n * policies\": \"Targeting of services by name\"; \"Behavior of `to` and `from` selectors\": ipBlock \"selects particular IP\n * CIDR ranges to allow as ingress sources or egress destinations. These should be cluster-external IPs\".\n *\n * ## Rejected alternatives\n *\n * - **`0.0.0.0/0` except the RFC 1918 ranges** (the usual \"internet only\" shape). It would cut a managed service reached\n * over a private endpoint, which is the recommended production setup for Atlas and for every cloud database.\n * - **`0.0.0.0/0` except the cluster's pod and service CIDRs.** Nothing in an environment declares them, and inventing a\n * field for them would ask the operator for a fact the cluster already holds. What the exception would prevent is a\n * segment member reaching an IN-CLUSTER pod on the same port through the address rule — a pod outside this namespace,\n * since every non-public pod here sits behind the namespace's default-deny ingress. Whether an ipBlock matches pod\n * addresses at all is left to the network plugin by the API (\"it is not defined whether this happens before or after\n * NetworkPolicy processing\"). Where it does, a segment member reaches, on the service's port only, a public-route pod\n * of this namespace (which every internet client reaches anyway) and a pod of another namespace that its own ingress\n * policy leaves open. Recorded as the residual rather than closed by a guess; `k8s-network-policy-graph.test.ts`\n * evaluates the set under that pessimistic reading.\n */\nfunction buildOffClusterServicePolicy(\n meta: (name: string) => RuntimeNetworkPolicyDocument['metadata'],\n podSelector: { matchLabels: Record<string, string> },\n network: WildoRuntimeNetwork,\n ports: readonly number[],\n): RuntimeNetworkPolicyDocument {\n return {\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(runtimeNetworkOffClusterPolicyName(network)),\n spec: {\n podSelector,\n policyTypes: ['Egress'],\n egress: [\n {\n to: OFF_CLUSTER_ADDRESS_BLOCKS.map((cidr) => ({ ipBlock: { cidr } })),\n ports: ports.map((port) => ({ protocol: 'TCP', port })),\n },\n ],\n },\n };\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { InfraCapability } from '../project-config/shared/infra-providers.schemas';
2
2
  import type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';
3
- import { type RuntimeAccessDeclaration } from './runtime-backing-service-access';
3
+ import { type RuntimeAccessDeclaration, type RuntimeApplicationStores } from './runtime-backing-service-access';
4
4
  /**
5
5
  * The network segments a Wildo deployment is divided into (Step 5-egress).
6
6
  *
@@ -31,6 +31,13 @@ export declare enum WildoRuntimeNetwork {
31
31
  DATA_AUDIT = "wildo-data-audit",
32
32
  /** The OTel collector. Nearly every runtime emits to it; almost nothing reads from it. */
33
33
  DATA_TELEMETRY = "wildo-data-telemetry",
34
+ /**
35
+ * The platform's own key custodian (#2933, the self-hosted OpenBao). No application runtime joins it: no
36
+ * {@link InfraCapability} maps here, so {@link resolveRuntimeNetworkMembership} can never return it. Its members are
37
+ * the Vault itself and apps-manager, its only client (#3372 named it here so the Kubernetes lane can segment it the
38
+ * way the compose lane always has).
39
+ */
40
+ DATA_KEYS = "wildo-data-keys",
34
41
  /**
35
42
  * The ONLY non-internal network below the edge. Attachment to any non-internal
36
43
  * network restores NAT, so "can this runtime reach the internet?" is decided
@@ -49,6 +56,13 @@ export declare enum WildoRuntimeNetwork {
49
56
  * needs no network of its own, and every `null` states why.
50
57
  */
51
58
  export declare const NETWORK_FOR_CAPABILITY: Record<InfraCapability, WildoRuntimeNetwork | null>;
59
+ /**
60
+ * What a deployment lane knows beyond the runtime's own declaration: the application's store (#3367), required so no
61
+ * lane can omit it and keep a route to the other store, and whether a proxy routes HTTP to the container.
62
+ */
63
+ export interface RuntimeNetworkMembershipOptions extends RuntimeApplicationStores {
64
+ readonly servesHttp?: boolean;
65
+ }
52
66
  /**
53
67
  * The networks a runtime's container joins.
54
68
  *
@@ -63,9 +77,7 @@ export declare const NETWORK_FOR_CAPABILITY: Record<InfraCapability, WildoRuntim
63
77
  * bootstrap material. Withholding it would strand every runtime at boot, and it
64
78
  * grants no application data.
65
79
  */
66
- export declare function resolveRuntimeNetworkMembership(principal: ApplicationRuntimePrincipal | undefined, declaration?: RuntimeAccessDeclaration | undefined, options?: {
67
- readonly servesHttp?: boolean;
68
- }): ReadonlySet<WildoRuntimeNetwork>;
80
+ export declare function resolveRuntimeNetworkMembership(principal: ApplicationRuntimePrincipal | undefined, declaration: RuntimeAccessDeclaration | undefined, options: RuntimeNetworkMembershipOptions): ReadonlySet<WildoRuntimeNetwork>;
69
81
  /**
70
82
  * Networks that must be declared `internal: true`.
71
83
  *
@@ -74,4 +86,19 @@ export declare function resolveRuntimeNetworkMembership(principal: ApplicationRu
74
86
  * one you get by not thinking about it.
75
87
  */
76
88
  export declare function isInternalNetwork(network: WildoRuntimeNetwork): boolean;
89
+ /**
90
+ * The Docker Compose network NAME of each runtime segment, for the compose lanes (the platform stack's app runtimes and
91
+ * the self-hosted application stack).
92
+ *
93
+ * Total over {@link WildoRuntimeNetwork}, so a segment added there is a compile error here rather than a membership a
94
+ * compose file silently drops. `null` means compose declares no such network: `EGRESS`, because the compose data
95
+ * segments are `internal: true` and no compose file declares an egress network, so an authored `requiresInternetEgress`
96
+ * cannot be expressed there; it stays a Kubernetes `NetworkPolicy` fact.
97
+ */
98
+ export declare const COMPOSE_NETWORK_NAME: Record<WildoRuntimeNetwork, string | null>;
99
+ /**
100
+ * A runtime's compose networks: {@link resolveRuntimeNetworkMembership}, the one derivation the Kubernetes pod labels and
101
+ * the runtime's environment also read, named for compose and in segment order so a rendered file is stable between syncs.
102
+ */
103
+ export declare function resolveRuntimeComposeNetworks(principal: ApplicationRuntimePrincipal | undefined, declaration: RuntimeAccessDeclaration | undefined, options: RuntimeNetworkMembershipOptions): string[];
77
104
  //# sourceMappingURL=runtime-network-topology.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-network-topology.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/runtime-network-topology.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,oBAAY,mBAAmB;IAC7B,sFAAsF;IACtF,IAAI,eAAe;IACnB;;;;OAIG;IACH,QAAQ,mBAAmB;IAC3B,UAAU,qBAAqB;IAC/B,aAAa,wBAAwB;IACrC,UAAU,qBAAqB;IAC/B,WAAW,sBAAsB;IACjC,YAAY,uBAAuB;IACnC,cAAc,yBAAyB;IACvC,8FAA8F;IAC9F,UAAU,qBAAqB;IAC/B,0FAA0F;IAC1F,cAAc,yBAAyB;IACvC;;;;;OAKG;IACH,MAAM,iBAAiB;CACxB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,eAAe,EAAE,mBAAmB,GAAG,IAAI,CAwBtF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,2BAA2B,GAAG,SAAS,EAClD,WAAW,CAAC,EAAE,wBAAwB,GAAG,SAAS,EAClD,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GAC1C,WAAW,CAAC,mBAAmB,CAAC,CAgClC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAEvE"}
1
+ {"version":3,"file":"runtime-network-topology.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/runtime-network-topology.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC9B,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,oBAAY,mBAAmB;IAC7B,sFAAsF;IACtF,IAAI,eAAe;IACnB;;;;OAIG;IACH,QAAQ,mBAAmB;IAC3B,UAAU,qBAAqB;IAC/B,aAAa,wBAAwB;IACrC,UAAU,qBAAqB;IAC/B,WAAW,sBAAsB;IACjC,YAAY,uBAAuB;IACnC,cAAc,yBAAyB;IACvC,8FAA8F;IAC9F,UAAU,qBAAqB;IAC/B,0FAA0F;IAC1F,cAAc,yBAAyB;IACvC;;;;;OAKG;IACH,SAAS,oBAAoB;IAC7B;;;;;OAKG;IACH,MAAM,iBAAiB;CACxB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,eAAe,EAAE,mBAAmB,GAAG,IAAI,CAwBtF,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,+BAAgC,SAAQ,wBAAwB;IAC/E,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,2BAA2B,GAAG,SAAS,EAClD,WAAW,EAAE,wBAAwB,GAAG,SAAS,EACjD,OAAO,EAAE,+BAA+B,GACvC,WAAW,CAAC,mBAAmB,CAAC,CAgClC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAEvE;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAa3E,CAAC;AAEF;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,2BAA2B,GAAG,SAAS,EAClD,WAAW,EAAE,wBAAwB,GAAG,SAAS,EACjD,OAAO,EAAE,+BAA+B,GACvC,MAAM,EAAE,CAMV"}
@@ -31,6 +31,13 @@ export var WildoRuntimeNetwork;
31
31
  WildoRuntimeNetwork["DATA_AUDIT"] = "wildo-data-audit";
32
32
  /** The OTel collector. Nearly every runtime emits to it; almost nothing reads from it. */
33
33
  WildoRuntimeNetwork["DATA_TELEMETRY"] = "wildo-data-telemetry";
34
+ /**
35
+ * The platform's own key custodian (#2933, the self-hosted OpenBao). No application runtime joins it: no
36
+ * {@link InfraCapability} maps here, so {@link resolveRuntimeNetworkMembership} can never return it. Its members are
37
+ * the Vault itself and apps-manager, its only client (#3372 named it here so the Kubernetes lane can segment it the
38
+ * way the compose lane always has).
39
+ */
40
+ WildoRuntimeNetwork["DATA_KEYS"] = "wildo-data-keys";
34
41
  /**
35
42
  * The ONLY non-internal network below the edge. Attachment to any non-internal
36
43
  * network restores NAT, so "can this runtime reach the internet?" is decided
@@ -88,7 +95,7 @@ export const NETWORK_FOR_CAPABILITY = {
88
95
  * grants no application data.
89
96
  */
90
97
  export function resolveRuntimeNetworkMembership(principal, declaration, options) {
91
- const access = resolveRuntimeBackingServiceAccess(principal, declaration);
98
+ const access = resolveRuntimeBackingServiceAccess(principal, declaration, options);
92
99
  const networks = new Set();
93
100
  // PLATFORM is for runtimes that FETCH their own bootstrap material — every
94
101
  // runtime principal does, including a worker that holds no backing-service
@@ -112,7 +119,7 @@ export function resolveRuntimeNetworkMembership(principal, declaration, options)
112
119
  // not of what the runtime declared, so it arrives separately rather than being
113
120
  // inferred from the principal kind — an application backend that serves no
114
121
  // public route should not be on the edge merely for being a backend.
115
- if (options?.servesHttp)
122
+ if (options.servesHttp)
116
123
  networks.add(WildoRuntimeNetwork.EDGE);
117
124
  // Authored, never inferred. See `RuntimeBackingServiceAccess`.
118
125
  if (access.requiresInternetEgress)
@@ -129,4 +136,38 @@ export function resolveRuntimeNetworkMembership(principal, declaration, options)
129
136
  export function isInternalNetwork(network) {
130
137
  return network !== WildoRuntimeNetwork.EDGE && network !== WildoRuntimeNetwork.EGRESS;
131
138
  }
139
+ /**
140
+ * The Docker Compose network NAME of each runtime segment, for the compose lanes (the platform stack's app runtimes and
141
+ * the self-hosted application stack).
142
+ *
143
+ * Total over {@link WildoRuntimeNetwork}, so a segment added there is a compile error here rather than a membership a
144
+ * compose file silently drops. `null` means compose declares no such network: `EGRESS`, because the compose data
145
+ * segments are `internal: true` and no compose file declares an egress network, so an authored `requiresInternetEgress`
146
+ * cannot be expressed there; it stays a Kubernetes `NetworkPolicy` fact.
147
+ */
148
+ export const COMPOSE_NETWORK_NAME = {
149
+ [WildoRuntimeNetwork.EDGE]: 'wildo-edge',
150
+ [WildoRuntimeNetwork.PLATFORM]: 'wildo-platform-net',
151
+ [WildoRuntimeNetwork.DATA_MONGO]: 'wildo-data-mongo',
152
+ [WildoRuntimeNetwork.DATA_POSTGRES]: 'wildo-data-postgres',
153
+ [WildoRuntimeNetwork.DATA_REDIS]: 'wildo-data-redis',
154
+ [WildoRuntimeNetwork.DATA_RABBIT]: 'wildo-data-rabbit',
155
+ [WildoRuntimeNetwork.DATA_OBJECTS]: 'wildo-data-objects',
156
+ [WildoRuntimeNetwork.DATA_ANTIVIRUS]: 'wildo-data-antivirus',
157
+ [WildoRuntimeNetwork.DATA_AUDIT]: 'wildo-data-audit',
158
+ [WildoRuntimeNetwork.DATA_TELEMETRY]: 'wildo-data-telemetry',
159
+ [WildoRuntimeNetwork.DATA_KEYS]: 'wildo-data-keys',
160
+ [WildoRuntimeNetwork.EGRESS]: null,
161
+ };
162
+ /**
163
+ * A runtime's compose networks: {@link resolveRuntimeNetworkMembership}, the one derivation the Kubernetes pod labels and
164
+ * the runtime's environment also read, named for compose and in segment order so a rendered file is stable between syncs.
165
+ */
166
+ export function resolveRuntimeComposeNetworks(principal, declaration, options) {
167
+ const membership = resolveRuntimeNetworkMembership(principal, declaration, options);
168
+ return Object.values(WildoRuntimeNetwork)
169
+ .filter((network) => membership.has(network))
170
+ .map((network) => COMPOSE_NETWORK_NAME[network])
171
+ .filter((name) => name !== null);
172
+ }
132
173
  //# sourceMappingURL=runtime-network-topology.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-network-topology.js","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-network-topology.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,OAAO,EACL,kCAAkC,GAEnC,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,mBA0BX;AA1BD,WAAY,mBAAmB;IAC7B,sFAAsF;IACtF,0CAAmB,CAAA;IACnB;;;;OAIG;IACH,kDAA2B,CAAA;IAC3B,sDAA+B,CAAA;IAC/B,4DAAqC,CAAA;IACrC,sDAA+B,CAAA;IAC/B,wDAAiC,CAAA;IACjC,0DAAmC,CAAA;IACnC,8DAAuC,CAAA;IACvC,8FAA8F;IAC9F,sDAA+B,CAAA;IAC/B,0FAA0F;IAC1F,8DAAuC,CAAA;IACvC;;;;;OAKG;IACH,8CAAuB,CAAA;AACzB,CAA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AC/E,+EAA+E;IAC/E,qCAAqC;IACrC,IAAI,SAAS;QAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAE1D,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;QACnD,IAAI,OAAO;YAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,4EAA4E;IAC5E,+EAA+E;IAC/E,2EAA2E;IAC3E,qEAAqE;IACrE,IAAI,OAAO,EAAE,UAAU;QAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAEhE,+DAA+D;IAC/D,IAAI,MAAM,CAAC,sBAAsB;QAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAE5E,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA4B;IAC5D,OAAO,OAAO,KAAK,mBAAmB,CAAC,IAAI,IAAI,OAAO,KAAK,mBAAmB,CAAC,MAAM,CAAC;AACxF,CAAC","sourcesContent":["import { InfraCapability } from '../project-config/shared/infra-providers.schemas';\nimport type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';\nimport {\n resolveRuntimeBackingServiceAccess,\n type RuntimeAccessDeclaration,\n} from './runtime-backing-service-access';\n\n/**\n * The network segments a Wildo deployment is divided into (Step 5-egress).\n *\n * Docker Compose has no `NetworkPolicy` object, but it has the mechanism that\n * matters for the destination half: membership of user-defined bridge networks,\n * with per-network embedded DNS. A container not attached to a network can\n * neither resolve nor route to the services on it — deny-by-default at the\n * network level. Kubernetes expresses the same division as `NetworkPolicy`\n * egress rules. Both renderers derive from THIS enum so they cannot describe\n * different topologies.\n */\nexport enum WildoRuntimeNetwork {\n /** Reverse proxy + every container serving HTTP. Not internal: it faces the world. */\n EDGE = 'wildo-edge',\n /**\n * The control plane — apps-manager, module-registry, crontabs — plus every\n * runtime that must fetch its secrets and configuration. Internal: nothing here\n * needs a route off the host.\n */\n PLATFORM = 'wildo-platform',\n DATA_MONGO = 'wildo-data-mongo',\n DATA_POSTGRES = 'wildo-data-postgres',\n DATA_REDIS = 'wildo-data-redis',\n DATA_RABBIT = 'wildo-data-rabbit',\n DATA_OBJECTS = 'wildo-data-objects',\n DATA_ANTIVIRUS = 'wildo-data-antivirus',\n /** Tamper-evident audit-log storage (immudb) — a service of its own, not a database table. */\n DATA_AUDIT = 'wildo-data-audit',\n /** The OTel collector. Nearly every runtime emits to it; almost nothing reads from it. */\n DATA_TELEMETRY = 'wildo-data-telemetry',\n /**\n * The ONLY non-internal network below the edge. Attachment to any non-internal\n * network restores NAT, so \"can this runtime reach the internet?\" is decided\n * here and nowhere else — marking the data networks internal is necessary but\n * not sufficient.\n */\n EGRESS = 'wildo-egress',\n}\n\n/**\n * Which network serves each backing-service capability.\n *\n * A total `Record`, deliberately: adding a member to {@link InfraCapability}\n * becomes a COMPILE ERROR here rather than a capability that silently reaches no\n * network — or worse, one whose runtimes silently keep the flat-network\n * reachability this segmentation exists to remove. `null` means the capability\n * needs no network of its own, and every `null` states why.\n */\nexport const NETWORK_FOR_CAPABILITY: Record<InfraCapability, WildoRuntimeNetwork | null> = {\n [InfraCapability.DOCUMENT_DATABASE]: WildoRuntimeNetwork.DATA_MONGO,\n [InfraCapability.RELATIONAL_DATABASE]: WildoRuntimeNetwork.DATA_POSTGRES,\n [InfraCapability.CACHE_MANAGER]: WildoRuntimeNetwork.DATA_REDIS,\n [InfraCapability.QUEUING_SYSTEM]: WildoRuntimeNetwork.DATA_RABBIT,\n [InfraCapability.OBJECT_STORAGE]: WildoRuntimeNetwork.DATA_OBJECTS,\n [InfraCapability.ANTIVIRUS_SCANNING]: WildoRuntimeNetwork.DATA_ANTIVIRUS,\n // ⚠️ CORRECTED 2026-08-12. Both of the entries below were `null`, on reasoning\n // that measurement disproved while building the 5B service table:\n //\n // - AUDIT_LOG_STORAGE was \"served BY the document/relational database\". It is\n // not: `immudb` is a service of its own, with its own container, and a\n // runtime that writes audit records dials IT rather than a database table.\n // - METRICS_TELEMETRY was \"no application runtime dials them directly today\".\n // Also false — runtimes emit spans and metrics to the collector, and that\n // traffic is live in development. A `null` here would have cut tracing for\n // every runtime the moment segmentation was enforced, with NO readiness\n // check covering it: a first-use failure, silent until someone noticed spans\n // had stopped.\n [InfraCapability.AUDIT_LOG_STORAGE]: WildoRuntimeNetwork.DATA_AUDIT,\n [InfraCapability.METRICS_TELEMETRY]: WildoRuntimeNetwork.DATA_TELEMETRY,\n // Backup remains genuinely operator-side: no application runtime dials it, and\n // the backup tooling runs outside the application's network entirely.\n [InfraCapability.BACKUP_MANAGER]: null,\n};\n\n/**\n * The networks a runtime's container joins.\n *\n * Derived from the SAME declaration as its credentials and its environment\n * topology — see {@link resolveRuntimeBackingServiceAccess}. That is the whole\n * point: a runtime kept off a service's network must also not hold that service's\n * credential nor receive its connect URL, and the only way three enforcement\n * points stay in agreement is by not deriving the answer three times.\n *\n * `PLATFORM` is unconditional. Every runtime — including a worker, which holds no\n * backing-service credentials at all — must reach apps-manager to fetch its own\n * bootstrap material. Withholding it would strand every runtime at boot, and it\n * grants no application data.\n */\nexport function resolveRuntimeNetworkMembership(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration?: RuntimeAccessDeclaration | undefined,\n options?: { readonly servesHttp?: boolean },\n): ReadonlySet<WildoRuntimeNetwork> {\n const access = resolveRuntimeBackingServiceAccess(principal, declaration);\n const networks = new Set<WildoRuntimeNetwork>();\n\n // PLATFORM is for runtimes that FETCH their own bootstrap material — every\n // runtime principal does, including a worker that holds no backing-service\n // credentials at all. A caller with NO principal is not a runtime principal:\n // today that is the static frontend, an nginx container that authenticates to\n // nothing and has no bootstrap material to fetch.\n //\n // This was previously unconditional, which put that frontend on the platform\n // segment. Harmless — the segment carries no application data and the container\n // could not authenticate anyway — but it is reachability nobody asked for, and\n // \"unconditional because every case so far needed it\" is exactly the default a\n // later reader assumes was measured.\n if (principal) networks.add(WildoRuntimeNetwork.PLATFORM);\n\n for (const capability of access.capabilities) {\n const network = NETWORK_FOR_CAPABILITY[capability];\n if (network) networks.add(network);\n }\n\n // Serving HTTP is a property of the DEPLOYMENT (does a proxy route to it?),\n // not of what the runtime declared, so it arrives separately rather than being\n // inferred from the principal kind — an application backend that serves no\n // public route should not be on the edge merely for being a backend.\n if (options?.servesHttp) networks.add(WildoRuntimeNetwork.EDGE);\n\n // Authored, never inferred. See `RuntimeBackingServiceAccess`.\n if (access.requiresInternetEgress) networks.add(WildoRuntimeNetwork.EGRESS);\n\n return networks;\n}\n\n/**\n * Networks that must be declared `internal: true`.\n *\n * Derived by EXCLUSION from the two that legitimately carry a route off the host,\n * so a network added to the enum is internal by default. The safe posture is the\n * one you get by not thinking about it.\n */\nexport function isInternalNetwork(network: WildoRuntimeNetwork): boolean {\n return network !== WildoRuntimeNetwork.EDGE && network !== WildoRuntimeNetwork.EGRESS;\n}\n"]}
1
+ {"version":3,"file":"runtime-network-topology.js","sourceRoot":"","sources":["../../../src/bootstrap/runtime-network-topology.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,OAAO,EACL,kCAAkC,GAGnC,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,mBAiCX;AAjCD,WAAY,mBAAmB;IAC7B,sFAAsF;IACtF,0CAAmB,CAAA;IACnB;;;;OAIG;IACH,kDAA2B,CAAA;IAC3B,sDAA+B,CAAA;IAC/B,4DAAqC,CAAA;IACrC,sDAA+B,CAAA;IAC/B,wDAAiC,CAAA;IACjC,0DAAmC,CAAA;IACnC,8DAAuC,CAAA;IACvC,8FAA8F;IAC9F,sDAA+B,CAAA;IAC/B,0FAA0F;IAC1F,8DAAuC,CAAA;IACvC;;;;;OA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ACtD,CAAC,mBAAmB,CAAC,YAAY,CAAC,EAAE,oBAAoB;IACxD,CAAC,mBAAmB,CAAC,cAAc,CAAC,EAAE,sBAAsB;IAC5D,CAAC,mBAAmB,CAAC,UAAU,CAAC,EAAE,kBAAkB;IACpD,CAAC,mBAAmB,CAAC,cAAc,CAAC,EAAE,sBAAsB;IAC5D,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,iBAAiB;IAClD,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,IAAI;CACnC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAC3C,SAAkD,EAClD,WAAiD,EACjD,OAAwC;IAExC,MAAM,UAAU,GAAG,+BAA+B,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IACpF,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC;SACtC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SAC5C,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;SAC/C,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import { InfraCapability } from '../project-config/shared/infra-providers.schemas';\nimport type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';\nimport {\n resolveRuntimeBackingServiceAccess,\n type RuntimeAccessDeclaration,\n type RuntimeApplicationStores,\n} from './runtime-backing-service-access';\n\n/**\n * The network segments a Wildo deployment is divided into (Step 5-egress).\n *\n * Docker Compose has no `NetworkPolicy` object, but it has the mechanism that\n * matters for the destination half: membership of user-defined bridge networks,\n * with per-network embedded DNS. A container not attached to a network can\n * neither resolve nor route to the services on it — deny-by-default at the\n * network level. Kubernetes expresses the same division as `NetworkPolicy`\n * egress rules. Both renderers derive from THIS enum so they cannot describe\n * different topologies.\n */\nexport enum WildoRuntimeNetwork {\n /** Reverse proxy + every container serving HTTP. Not internal: it faces the world. */\n EDGE = 'wildo-edge',\n /**\n * The control plane — apps-manager, module-registry, crontabs — plus every\n * runtime that must fetch its secrets and configuration. Internal: nothing here\n * needs a route off the host.\n */\n PLATFORM = 'wildo-platform',\n DATA_MONGO = 'wildo-data-mongo',\n DATA_POSTGRES = 'wildo-data-postgres',\n DATA_REDIS = 'wildo-data-redis',\n DATA_RABBIT = 'wildo-data-rabbit',\n DATA_OBJECTS = 'wildo-data-objects',\n DATA_ANTIVIRUS = 'wildo-data-antivirus',\n /** Tamper-evident audit-log storage (immudb) — a service of its own, not a database table. */\n DATA_AUDIT = 'wildo-data-audit',\n /** The OTel collector. Nearly every runtime emits to it; almost nothing reads from it. */\n DATA_TELEMETRY = 'wildo-data-telemetry',\n /**\n * The platform's own key custodian (#2933, the self-hosted OpenBao). No application runtime joins it: no\n * {@link InfraCapability} maps here, so {@link resolveRuntimeNetworkMembership} can never return it. Its members are\n * the Vault itself and apps-manager, its only client (#3372 named it here so the Kubernetes lane can segment it the\n * way the compose lane always has).\n */\n DATA_KEYS = 'wildo-data-keys',\n /**\n * The ONLY non-internal network below the edge. Attachment to any non-internal\n * network restores NAT, so \"can this runtime reach the internet?\" is decided\n * here and nowhere else — marking the data networks internal is necessary but\n * not sufficient.\n */\n EGRESS = 'wildo-egress',\n}\n\n/**\n * Which network serves each backing-service capability.\n *\n * A total `Record`, deliberately: adding a member to {@link InfraCapability}\n * becomes a COMPILE ERROR here rather than a capability that silently reaches no\n * network — or worse, one whose runtimes silently keep the flat-network\n * reachability this segmentation exists to remove. `null` means the capability\n * needs no network of its own, and every `null` states why.\n */\nexport const NETWORK_FOR_CAPABILITY: Record<InfraCapability, WildoRuntimeNetwork | null> = {\n [InfraCapability.DOCUMENT_DATABASE]: WildoRuntimeNetwork.DATA_MONGO,\n [InfraCapability.RELATIONAL_DATABASE]: WildoRuntimeNetwork.DATA_POSTGRES,\n [InfraCapability.CACHE_MANAGER]: WildoRuntimeNetwork.DATA_REDIS,\n [InfraCapability.QUEUING_SYSTEM]: WildoRuntimeNetwork.DATA_RABBIT,\n [InfraCapability.OBJECT_STORAGE]: WildoRuntimeNetwork.DATA_OBJECTS,\n [InfraCapability.ANTIVIRUS_SCANNING]: WildoRuntimeNetwork.DATA_ANTIVIRUS,\n // ⚠️ CORRECTED 2026-08-12. Both of the entries below were `null`, on reasoning\n // that measurement disproved while building the 5B service table:\n //\n // - AUDIT_LOG_STORAGE was \"served BY the document/relational database\". It is\n // not: `immudb` is a service of its own, with its own container, and a\n // runtime that writes audit records dials IT rather than a database table.\n // - METRICS_TELEMETRY was \"no application runtime dials them directly today\".\n // Also false — runtimes emit spans and metrics to the collector, and that\n // traffic is live in development. A `null` here would have cut tracing for\n // every runtime the moment segmentation was enforced, with NO readiness\n // check covering it: a first-use failure, silent until someone noticed spans\n // had stopped.\n [InfraCapability.AUDIT_LOG_STORAGE]: WildoRuntimeNetwork.DATA_AUDIT,\n [InfraCapability.METRICS_TELEMETRY]: WildoRuntimeNetwork.DATA_TELEMETRY,\n // Backup remains genuinely operator-side: no application runtime dials it, and\n // the backup tooling runs outside the application's network entirely.\n [InfraCapability.BACKUP_MANAGER]: null,\n};\n\n/**\n * What a deployment lane knows beyond the runtime's own declaration: the application's store (#3367), required so no\n * lane can omit it and keep a route to the other store, and whether a proxy routes HTTP to the container.\n */\nexport interface RuntimeNetworkMembershipOptions extends RuntimeApplicationStores {\n readonly servesHttp?: boolean;\n}\n\n/**\n * The networks a runtime's container joins.\n *\n * Derived from the SAME declaration as its credentials and its environment\n * topology — see {@link resolveRuntimeBackingServiceAccess}. That is the whole\n * point: a runtime kept off a service's network must also not hold that service's\n * credential nor receive its connect URL, and the only way three enforcement\n * points stay in agreement is by not deriving the answer three times.\n *\n * `PLATFORM` is unconditional. Every runtime — including a worker, which holds no\n * backing-service credentials at all — must reach apps-manager to fetch its own\n * bootstrap material. Withholding it would strand every runtime at boot, and it\n * grants no application data.\n */\nexport function resolveRuntimeNetworkMembership(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration: RuntimeAccessDeclaration | undefined,\n options: RuntimeNetworkMembershipOptions,\n): ReadonlySet<WildoRuntimeNetwork> {\n const access = resolveRuntimeBackingServiceAccess(principal, declaration, options);\n const networks = new Set<WildoRuntimeNetwork>();\n\n // PLATFORM is for runtimes that FETCH their own bootstrap material — every\n // runtime principal does, including a worker that holds no backing-service\n // credentials at all. A caller with NO principal is not a runtime principal:\n // today that is the static frontend, an nginx container that authenticates to\n // nothing and has no bootstrap material to fetch.\n //\n // This was previously unconditional, which put that frontend on the platform\n // segment. Harmless — the segment carries no application data and the container\n // could not authenticate anyway — but it is reachability nobody asked for, and\n // \"unconditional because every case so far needed it\" is exactly the default a\n // later reader assumes was measured.\n if (principal) networks.add(WildoRuntimeNetwork.PLATFORM);\n\n for (const capability of access.capabilities) {\n const network = NETWORK_FOR_CAPABILITY[capability];\n if (network) networks.add(network);\n }\n\n // Serving HTTP is a property of the DEPLOYMENT (does a proxy route to it?),\n // not of what the runtime declared, so it arrives separately rather than being\n // inferred from the principal kind — an application backend that serves no\n // public route should not be on the edge merely for being a backend.\n if (options.servesHttp) networks.add(WildoRuntimeNetwork.EDGE);\n\n // Authored, never inferred. See `RuntimeBackingServiceAccess`.\n if (access.requiresInternetEgress) networks.add(WildoRuntimeNetwork.EGRESS);\n\n return networks;\n}\n\n/**\n * Networks that must be declared `internal: true`.\n *\n * Derived by EXCLUSION from the two that legitimately carry a route off the host,\n * so a network added to the enum is internal by default. The safe posture is the\n * one you get by not thinking about it.\n */\nexport function isInternalNetwork(network: WildoRuntimeNetwork): boolean {\n return network !== WildoRuntimeNetwork.EDGE && network !== WildoRuntimeNetwork.EGRESS;\n}\n\n/**\n * The Docker Compose network NAME of each runtime segment, for the compose lanes (the platform stack's app runtimes and\n * the self-hosted application stack).\n *\n * Total over {@link WildoRuntimeNetwork}, so a segment added there is a compile error here rather than a membership a\n * compose file silently drops. `null` means compose declares no such network: `EGRESS`, because the compose data\n * segments are `internal: true` and no compose file declares an egress network, so an authored `requiresInternetEgress`\n * cannot be expressed there; it stays a Kubernetes `NetworkPolicy` fact.\n */\nexport const COMPOSE_NETWORK_NAME: Record<WildoRuntimeNetwork, string | null> = {\n [WildoRuntimeNetwork.EDGE]: 'wildo-edge',\n [WildoRuntimeNetwork.PLATFORM]: 'wildo-platform-net',\n [WildoRuntimeNetwork.DATA_MONGO]: 'wildo-data-mongo',\n [WildoRuntimeNetwork.DATA_POSTGRES]: 'wildo-data-postgres',\n [WildoRuntimeNetwork.DATA_REDIS]: 'wildo-data-redis',\n [WildoRuntimeNetwork.DATA_RABBIT]: 'wildo-data-rabbit',\n [WildoRuntimeNetwork.DATA_OBJECTS]: 'wildo-data-objects',\n [WildoRuntimeNetwork.DATA_ANTIVIRUS]: 'wildo-data-antivirus',\n [WildoRuntimeNetwork.DATA_AUDIT]: 'wildo-data-audit',\n [WildoRuntimeNetwork.DATA_TELEMETRY]: 'wildo-data-telemetry',\n [WildoRuntimeNetwork.DATA_KEYS]: 'wildo-data-keys',\n [WildoRuntimeNetwork.EGRESS]: null,\n};\n\n/**\n * A runtime's compose networks: {@link resolveRuntimeNetworkMembership}, the one derivation the Kubernetes pod labels and\n * the runtime's environment also read, named for compose and in segment order so a rendered file is stable between syncs.\n */\nexport function resolveRuntimeComposeNetworks(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration: RuntimeAccessDeclaration | undefined,\n options: RuntimeNetworkMembershipOptions,\n): string[] {\n const membership = resolveRuntimeNetworkMembership(principal, declaration, options);\n return Object.values(WildoRuntimeNetwork)\n .filter((network) => membership.has(network))\n .map((network) => COMPOSE_NETWORK_NAME[network])\n .filter((name): name is string => name !== null);\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-platform-access.js","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-platform-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAoC,MAAM,+BAA+B,CAAC;AAClH,+EAA+E;AAC/E,8DAA8D;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AAyBvG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,UAAU,wBAAwB,CACtC,SAAkD,EAClD,WAAwD;IAExD,2EAA2E;IAC3E,+EAA+E;IAC/E,6EAA6E;IAC7E,YAAY;IACZ,IAAI,SAAS,EAAE,IAAI,KAAK,+BAA+B,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/F,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,yBAAyB,CAAC,gBAAgB,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5F,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC","sourcesContent":["import { ApplicationRuntimePrincipalKind, type ApplicationRuntimePrincipal } from './runtime-principal.contracts';\n// Declared under `project-config` so an authored config can NAME it — see that\n// file for why the authoring entry cannot reach `bootstrap/`.\nimport { MinionPlatformAccessScope } from '../project-config/shared/minion-platform-access.vocabulary';\n\n/**\n * The PLATFORM-ACCESS axis (Step 3 / R4 / R5) — a minion reading its own\n * platform-level records, today its cron/schedule entries.\n *\n * ## Why this is a SECOND axis and not part of `resourceAccess`\n *\n * `resourceAccess` answers \"which of the APPLICATION's resources may this minion\n * touch?\". This answers \"may it see the PLATFORM's record OF ITSELF?\" — a\n * different subject, a different store, and a different blast radius. R5 requires\n * the two be separately declarable with neither implying the other, so nothing\n * here consults `resourceAccess` and nothing there consults this.\n *\n * A minion that declares data access but no platform access is a normal shape\n * (it works on todos, never inspects its own schedule). So is the reverse (a\n * health-reporting minion that reads its tick history and touches no app data).\n */\n\n\n/** The authored declaration — optional, and absent means none. */\nexport interface MinionPlatformAccessDeclaration {\n readonly scopes?: readonly MinionPlatformAccessScope[];\n}\n\n/**\n * A filter that can ONLY ever address the caller's own records.\n *\n * ## Scoped-to-self BY SHAPE, which is the whole point of R4\n *\n * The obvious implementation takes a minion NAME and refuses when it does not\n * match the caller. That is scoped-to-self by CHECK, and it fails the way every\n * check fails: someone adds an admin path, or an internal caller passes the name\n * it was given, and the refusal is one conditional away from gone.\n *\n * This takes **no target parameter at all**. The subject is derived from the\n * PRINCIPAL, so \"read minion B's schedule\" is not a request that gets refused —\n * it is a request that cannot be expressed. A future caller wanting cross-minion\n * reads must add a new function, which is a reviewable act, rather than passing a\n * different string to this one, which is not.\n *\n * Returns `null` when the principal may not read platform records at all, so the\n * caller has nothing to query WITH — the same fail-closed shape as\n * `deriveMinionResourceGrants` returning `null`.\n *\n * ## ⚠️ PRECONDITION: `principal` must be VERIFIED, not self-asserted\n *\n * The by-shape property above is real and it is CONDITIONAL. This function makes a\n * cross-minion read inexpressible *given a trustworthy principal* — it says\n * nothing about where the principal came from, and a caller that accepts a\n * self-asserted one has a hole this signature cannot close.\n *\n * That is not hypothetical. A minion is delivered the application's\n * `APPLICATION_PLATFORM_REQUEST` **private** key: the delivery projection strips\n * per-app CREDENTIAL paths (`database.*`) and the JWT material is not among them,\n * so it survives in the base blob. A minion can therefore sign a token naming a\n * sibling minion or the application backend, and a by-shape endpoint would\n * satisfy \"no selector exists\" while still failing R4's acceptance criterion.\n *\n * So a caller MUST obtain the principal from a party that learns it from the\n * secret PRESENTED rather than one asserted in a claim — today that is\n * apps-manager, which resolves it by matching the presenting secret against the\n * minted per-principal set. Found by the `Minion Scope` session while building the\n * transport for this axis; recorded here because the precondition belongs with the\n * contract, not only in the transport that happens to satisfy it.\n */\nexport function buildOwnCronRecordFilter(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration: MinionPlatformAccessDeclaration | undefined,\n): { readonly minionName: string } | null {\n // Only a MINION has cron records of its own. The application backend reads\n // schedules through its own authority, and a worker has none — so neither is a\n // subject here, and granting them a filter would invent a record that has no\n // referent.\n if (principal?.kind !== ApplicationRuntimePrincipalKind.MINION || !principal.name) return null;\n if (!declaration?.scopes?.includes(MinionPlatformAccessScope.OWN_CRON_RECORDS)) return null;\n return { minionName: principal.name };\n}\n"]}
1
+ {"version":3,"file":"runtime-platform-access.js","sourceRoot":"","sources":["../../../src/bootstrap/runtime-platform-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAoC,MAAM,+BAA+B,CAAC;AAClH,+EAA+E;AAC/E,8DAA8D;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AAyBvG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,UAAU,wBAAwB,CACtC,SAAkD,EAClD,WAAwD;IAExD,2EAA2E;IAC3E,+EAA+E;IAC/E,6EAA6E;IAC7E,YAAY;IACZ,IAAI,SAAS,EAAE,IAAI,KAAK,+BAA+B,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/F,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,yBAAyB,CAAC,gBAAgB,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5F,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC","sourcesContent":["import { ApplicationRuntimePrincipalKind, type ApplicationRuntimePrincipal } from './runtime-principal.contracts';\n// Declared under `project-config` so an authored config can NAME it — see that\n// file for why the authoring entry cannot reach `bootstrap/`.\nimport { MinionPlatformAccessScope } from '../project-config/shared/minion-platform-access.vocabulary';\n\n/**\n * The PLATFORM-ACCESS axis (Step 3 / R4 / R5) — a minion reading its own\n * platform-level records, today its cron/schedule entries.\n *\n * ## Why this is a SECOND axis and not part of `resourceAccess`\n *\n * `resourceAccess` answers \"which of the APPLICATION's resources may this minion\n * touch?\". This answers \"may it see the PLATFORM's record OF ITSELF?\" — a\n * different subject, a different store, and a different blast radius. R5 requires\n * the two be separately declarable with neither implying the other, so nothing\n * here consults `resourceAccess` and nothing there consults this.\n *\n * A minion that declares data access but no platform access is a normal shape\n * (it works on todos, never inspects its own schedule). So is the reverse (a\n * health-reporting minion that reads its tick history and touches no app data).\n */\n\n\n/** The authored declaration — optional, and absent means none. */\nexport interface MinionPlatformAccessDeclaration {\n readonly scopes?: readonly MinionPlatformAccessScope[];\n}\n\n/**\n * A filter that can ONLY ever address the caller's own records.\n *\n * ## Scoped-to-self BY SHAPE, which is the whole point of R4\n *\n * The obvious implementation takes a minion NAME and refuses when it does not\n * match the caller. That is scoped-to-self by CHECK, and it fails the way every\n * check fails: someone adds an admin path, or an internal caller passes the name\n * it was given, and the refusal is one conditional away from gone.\n *\n * This takes **no target parameter at all**. The subject is derived from the\n * PRINCIPAL, so \"read minion B's schedule\" is not a request that gets refused —\n * it is a request that cannot be expressed. A future caller wanting cross-minion\n * reads must add a new function, which is a reviewable act, rather than passing a\n * different string to this one, which is not.\n *\n * Returns `null` when the principal may not read platform records at all, so the\n * caller has nothing to query WITH — the same fail-closed shape as\n * `deriveMinionResourceGrants` returning `null`.\n *\n * ## ⚠️ PRECONDITION: `principal` must be VERIFIED, not self-asserted\n *\n * The by-shape property above is real and it is CONDITIONAL. This function makes a\n * cross-minion read inexpressible *given a trustworthy principal* — it says\n * nothing about where the principal came from, and a caller that accepts a\n * self-asserted one has a hole this signature cannot close.\n *\n * That is not hypothetical. A minion is delivered the application's\n * `APPLICATION_PLATFORM_REQUEST` **private** key: the delivery projection strips\n * per-app CREDENTIAL paths (`database.*`) and the JWT material is not among them,\n * so it survives in the base blob. A minion can therefore sign a token naming a\n * sibling minion or the application backend, and a by-shape endpoint would\n * satisfy \"no selector exists\" while still failing R4's acceptance criterion.\n *\n * So a caller MUST obtain the principal from a party that learns it from the\n * secret PRESENTED rather than one asserted in a claim — today that is\n * apps-manager, which resolves it by matching the presenting secret against the\n * minted per-principal set. Found by the `Minion Scope` session while building the\n * transport for this axis; recorded here because the precondition belongs with the\n * contract, not only in the transport that happens to satisfy it.\n */\nexport function buildOwnCronRecordFilter(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration: MinionPlatformAccessDeclaration | undefined,\n): { readonly minionName: string } | null {\n // Only a MINION has cron records of its own. The application backend reads\n // schedules through its own authority, and a worker has none — so neither is a\n // subject here, and granting them a filter would invent a record that has no\n // referent.\n if (principal?.kind !== ApplicationRuntimePrincipalKind.MINION || !principal.name) return null;\n if (!declaration?.scopes?.includes(MinionPlatformAccessScope.OWN_CRON_RECORDS)) return null;\n return { minionName: principal.name };\n}\n"]}