@wildo-ai/platform-config-lib 1.0.1 → 1.1.1

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 (414) hide show
  1. package/LICENSE +34 -0
  2. package/dist/esm/.builder.pid +9 -0
  3. package/dist/esm/_unimplemented/index.d.ts +3 -0
  4. package/dist/esm/_unimplemented/index.d.ts.map +1 -0
  5. package/dist/esm/_unimplemented/index.js +3 -0
  6. package/dist/esm/_unimplemented/index.js.map +1 -0
  7. package/dist/esm/_unimplemented/soft-warn.d.ts +124 -0
  8. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -0
  9. package/dist/esm/_unimplemented/soft-warn.js +170 -0
  10. package/dist/esm/_unimplemented/soft-warn.js.map +1 -0
  11. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +137 -0
  12. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +1 -0
  13. package/dist/esm/_unimplemented/unimplemented-field-warning.js +153 -0
  14. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -0
  15. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  16. package/dist/esm/bootstrap/application-backend-env.contracts.js +1 -1
  17. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  18. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts +13 -0
  19. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -0
  20. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js +14 -0
  21. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -0
  22. package/dist/esm/bootstrap/bootstrap-planner.d.ts +1 -1
  23. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  24. package/dist/esm/bootstrap/bootstrap-planner.js +1 -1
  25. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  26. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +141 -37
  27. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  28. package/dist/esm/bootstrap/bootstrap.contracts.js +104 -18
  29. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  30. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +430 -421
  31. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  32. package/dist/esm/bootstrap/bootstrap.schemas.js +383 -21
  33. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  34. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +213 -8
  35. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  36. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +230 -5
  37. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  38. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +79 -0
  39. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -0
  40. package/dist/esm/bootstrap/runtime-backing-service-access.js +83 -0
  41. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -0
  42. package/dist/esm/bootstrap/runtime-network-policy.d.ts +63 -0
  43. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -0
  44. package/dist/esm/bootstrap/runtime-network-policy.js +104 -0
  45. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -0
  46. package/dist/esm/bootstrap/runtime-network-topology.d.ts +78 -0
  47. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -0
  48. package/dist/esm/bootstrap/runtime-network-topology.js +134 -0
  49. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -0
  50. package/dist/esm/bootstrap/runtime-platform-access.d.ts +67 -0
  51. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -0
  52. package/dist/esm/bootstrap/runtime-platform-access.js +57 -0
  53. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -0
  54. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +173 -0
  55. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -0
  56. package/dist/esm/bootstrap/runtime-principal.contracts.js +218 -0
  57. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -0
  58. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +112 -1
  59. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  60. package/dist/esm/bootstrap/runtime-topology.contracts.js +141 -8
  61. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  62. package/dist/esm/config-authoring.entry.d.ts +3 -0
  63. package/dist/esm/config-authoring.entry.d.ts.map +1 -0
  64. package/dist/esm/config-authoring.entry.js +5 -0
  65. package/dist/esm/config-authoring.entry.js.map +1 -0
  66. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  67. package/dist/esm/credentials/credential-generator.service.js +1 -1
  68. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  69. package/dist/esm/index.d.ts +30 -15
  70. package/dist/esm/index.d.ts.map +1 -1
  71. package/dist/esm/index.js +16 -1
  72. package/dist/esm/index.js.map +1 -1
  73. package/dist/esm/lockfile/canonical-json.d.ts +41 -0
  74. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -0
  75. package/dist/esm/lockfile/canonical-json.js +56 -0
  76. package/dist/esm/lockfile/canonical-json.js.map +1 -0
  77. package/dist/esm/lockfile/lockfile-io.d.ts +231 -0
  78. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -0
  79. package/dist/esm/lockfile/lockfile-io.js +303 -0
  80. package/dist/esm/lockfile/lockfile-io.js.map +1 -0
  81. package/dist/esm/lockfile/materialize-infra-section.d.ts +99 -0
  82. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -0
  83. package/dist/esm/lockfile/materialize-infra-section.js +153 -0
  84. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -0
  85. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +522 -0
  86. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -0
  87. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +116 -0
  88. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -0
  89. package/dist/esm/project-config/define-framework-config.d.ts +36 -10
  90. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  91. package/dist/esm/project-config/define-framework-config.js +67 -3
  92. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  93. package/dist/esm/project-config/define-infra-env-config.d.ts +570 -0
  94. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -0
  95. package/dist/esm/project-config/define-infra-env-config.js +726 -0
  96. package/dist/esm/project-config/define-infra-env-config.js.map +1 -0
  97. package/dist/esm/project-config/define-minion-config.d.ts +221 -23
  98. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  99. package/dist/esm/project-config/define-minion-config.js +228 -11
  100. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  101. package/dist/esm/project-config/define-saas-config.d.ts +427 -218
  102. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  103. package/dist/esm/project-config/define-saas-config.js +704 -75
  104. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  105. package/dist/esm/project-config/define-worker-config.d.ts +106 -10
  106. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  107. package/dist/esm/project-config/define-worker-config.js +99 -9
  108. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  109. package/dist/esm/project-config/index.d.ts +28 -21
  110. package/dist/esm/project-config/index.d.ts.map +1 -1
  111. package/dist/esm/project-config/index.js +14 -7
  112. package/dist/esm/project-config/index.js.map +1 -1
  113. package/dist/esm/project-config/loader.d.ts +120 -10
  114. package/dist/esm/project-config/loader.d.ts.map +1 -1
  115. package/dist/esm/project-config/loader.js +290 -38
  116. package/dist/esm/project-config/loader.js.map +1 -1
  117. package/dist/esm/project-config/minion-local-provider-registration.d.ts +69 -0
  118. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -0
  119. package/dist/esm/project-config/minion-local-provider-registration.js +72 -0
  120. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -0
  121. package/dist/esm/project-config/provider-catalog-types.d.ts +12 -0
  122. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -0
  123. package/dist/esm/project-config/provider-catalog-types.js +49 -0
  124. package/dist/esm/project-config/provider-catalog-types.js.map +1 -0
  125. package/dist/esm/project-config/provider-companion-discovery.d.ts +24 -0
  126. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -0
  127. package/dist/esm/project-config/provider-companion-discovery.js +244 -0
  128. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -0
  129. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +297 -0
  130. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -0
  131. package/dist/esm/project-config/provider-runtime-artifacts.js +860 -0
  132. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -0
  133. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +18 -0
  134. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -0
  135. package/dist/esm/project-config/shared/application-creation-verification.schemas.js +25 -0
  136. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -0
  137. package/dist/esm/project-config/shared/application-modules.schemas.d.ts +10 -2
  138. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  139. package/dist/esm/project-config/shared/application-modules.schemas.js +12 -1
  140. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  141. package/dist/esm/project-config/shared/application-modules.utils.d.ts +2 -1
  142. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  143. package/dist/esm/project-config/shared/application-modules.utils.js +6 -1
  144. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  145. package/dist/esm/project-config/shared/auth.schemas.d.ts +102 -0
  146. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -0
  147. package/dist/esm/project-config/shared/auth.schemas.js +100 -0
  148. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -0
  149. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +316 -39
  150. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  151. package/dist/esm/project-config/shared/backing-services.schemas.js +359 -24
  152. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  153. package/dist/esm/project-config/shared/cdn.example.d.ts +14 -0
  154. package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -0
  155. package/dist/esm/project-config/shared/cdn.example.js +38 -0
  156. package/dist/esm/project-config/shared/cdn.example.js.map +1 -0
  157. package/dist/esm/project-config/shared/cdn.schemas.d.ts +182 -0
  158. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -0
  159. package/dist/esm/project-config/shared/cdn.schemas.js +151 -0
  160. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -0
  161. package/dist/esm/project-config/shared/csp-defaults.d.ts +92 -0
  162. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -0
  163. package/dist/esm/project-config/shared/csp-defaults.js +195 -0
  164. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -0
  165. package/dist/esm/project-config/shared/csp-emit.d.ts +106 -0
  166. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -0
  167. package/dist/esm/project-config/shared/csp-emit.js +305 -0
  168. package/dist/esm/project-config/shared/csp-emit.js.map +1 -0
  169. package/dist/esm/project-config/shared/csp.schemas.d.ts +266 -0
  170. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -0
  171. package/dist/esm/project-config/shared/csp.schemas.js +281 -0
  172. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -0
  173. package/dist/esm/project-config/shared/data-services.schemas.d.ts +45 -9
  174. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  175. package/dist/esm/project-config/shared/data-services.schemas.js +45 -9
  176. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  177. package/dist/esm/project-config/shared/env-example-defaults.d.ts +0 -1
  178. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  179. package/dist/esm/project-config/shared/env-example-defaults.js +1 -2
  180. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  181. package/dist/esm/project-config/shared/environment.schemas.d.ts +134 -8
  182. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  183. package/dist/esm/project-config/shared/environment.schemas.js +185 -2
  184. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  185. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +779 -0
  186. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -0
  187. package/dist/esm/project-config/shared/infra-providers.schemas.js +210 -0
  188. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -0
  189. package/dist/esm/project-config/shared/infra-service.schemas.d.ts +18 -0
  190. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -0
  191. package/dist/esm/project-config/shared/infra-service.schemas.js +16 -0
  192. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -0
  193. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +83 -1
  194. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  195. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +99 -2
  196. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  197. package/dist/esm/project-config/shared/k8s-utils.d.ts +51 -7
  198. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  199. package/dist/esm/project-config/shared/k8s-utils.js +59 -12
  200. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  201. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts +31 -0
  202. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -0
  203. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js +32 -0
  204. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -0
  205. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +142 -0
  206. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -0
  207. package/dist/esm/project-config/shared/minion-resource-access.validation.js +159 -0
  208. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -0
  209. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts +100 -0
  210. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -0
  211. package/dist/esm/project-config/shared/object-storage-session-policy.js +130 -0
  212. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -0
  213. package/dist/esm/project-config/shared/platform-services.schemas.d.ts +9 -14
  214. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  215. package/dist/esm/project-config/shared/platform-services.schemas.js +13 -9
  216. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  217. package/dist/esm/project-config/shared/schema-version.schemas.d.ts +15 -0
  218. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -0
  219. package/dist/esm/project-config/shared/schema-version.schemas.js +40 -0
  220. package/dist/esm/project-config/shared/schema-version.schemas.js.map +1 -0
  221. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +283 -8
  222. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  223. package/dist/esm/project-config/shared/service-definitions.schemas.js +325 -8
  224. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  225. package/dist/esm/registry/artifact-domain.schemas.d.ts +54 -0
  226. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -0
  227. package/dist/esm/registry/artifact-domain.schemas.js +40 -0
  228. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -0
  229. package/dist/esm/registry/companion-api.schemas.d.ts +176 -0
  230. package/dist/esm/registry/companion-api.schemas.d.ts.map +1 -0
  231. package/dist/esm/registry/companion-api.schemas.js +165 -0
  232. package/dist/esm/registry/companion-api.schemas.js.map +1 -0
  233. package/dist/esm/registry/digest.schemas.d.ts +20 -0
  234. package/dist/esm/registry/digest.schemas.d.ts.map +1 -0
  235. package/dist/esm/registry/digest.schemas.js +21 -0
  236. package/dist/esm/registry/digest.schemas.js.map +1 -0
  237. package/dist/esm/registry/index.d.ts +33 -0
  238. package/dist/esm/registry/index.d.ts.map +1 -0
  239. package/dist/esm/registry/index.js +33 -0
  240. package/dist/esm/registry/index.js.map +1 -0
  241. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +107 -0
  242. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -0
  243. package/dist/esm/registry/lockfile-modules-section.schemas.js +67 -0
  244. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -0
  245. package/dist/esm/registry/module-artifact.schemas.d.ts +94 -0
  246. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -0
  247. package/dist/esm/registry/module-artifact.schemas.js +69 -0
  248. package/dist/esm/registry/module-artifact.schemas.js.map +1 -0
  249. package/dist/esm/registry/module-manifest.schemas.d.ts +134 -0
  250. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -0
  251. package/dist/esm/registry/module-manifest.schemas.js +155 -0
  252. package/dist/esm/registry/module-manifest.schemas.js.map +1 -0
  253. package/dist/esm/registry/registry-config.schemas.d.ts +31 -0
  254. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -0
  255. package/dist/esm/registry/registry-config.schemas.js +24 -0
  256. package/dist/esm/registry/registry-config.schemas.js.map +1 -0
  257. package/dist/esm/registry/registry-defaults.constants.d.ts +37 -0
  258. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -0
  259. package/dist/esm/registry/registry-defaults.constants.js +37 -0
  260. package/dist/esm/registry/registry-defaults.constants.js.map +1 -0
  261. package/dist/esm/registry/registry-errors.d.ts +109 -0
  262. package/dist/esm/registry/registry-errors.d.ts.map +1 -0
  263. package/dist/esm/registry/registry-errors.js +185 -0
  264. package/dist/esm/registry/registry-errors.js.map +1 -0
  265. package/dist/esm/registry/registry-section-schemas.constants.d.ts +39 -0
  266. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -0
  267. package/dist/esm/registry/registry-section-schemas.constants.js +22 -0
  268. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -0
  269. package/dist/esm/release/framework-release.constants.d.ts +26 -1
  270. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  271. package/dist/esm/release/framework-release.constants.js +27 -2
  272. package/dist/esm/release/framework-release.constants.js.map +1 -1
  273. package/dist/esm/schemas/framework-info.schemas.d.ts +1 -1
  274. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  275. package/dist/esm/schemas/framework-info.schemas.js +1 -1
  276. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  277. package/dist/esm/schemas/framework-secrets.schemas.d.ts +5 -5
  278. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  279. package/dist/esm/schemas/framework-secrets.schemas.js +1 -1
  280. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  281. package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
  282. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  283. package/dist/esm/schemas/platform-application-config.schemas.js +11 -2
  284. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  285. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +7 -7
  286. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  287. package/dist/esm/schemas/platform-application-secrets.schemas.js +17 -2
  288. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  289. package/dist/esm/schemas/platform-config.schemas.d.ts +12 -13
  290. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  291. package/dist/esm/schemas/platform-config.schemas.js +15 -3
  292. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  293. package/dist/esm/workspace-scope/application-subject-manifest.d.ts +26 -0
  294. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -0
  295. package/dist/esm/workspace-scope/application-subject-manifest.js +43 -0
  296. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -0
  297. package/dist/esm/workspace-scope/index.d.ts +5 -2
  298. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  299. package/dist/esm/workspace-scope/index.js +4 -1
  300. package/dist/esm/workspace-scope/index.js.map +1 -1
  301. package/dist/esm/workspace-scope/resolve-homes.d.ts +20 -0
  302. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -0
  303. package/dist/esm/workspace-scope/resolve-homes.js +62 -0
  304. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -0
  305. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +211 -0
  306. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -0
  307. package/dist/esm/workspace-scope/workspace-homes.schemas.js +113 -0
  308. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -0
  309. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts +10 -5
  310. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  311. package/dist/esm/workspace-scope/workspace-scope-detector.js +22 -36
  312. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  313. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts +147 -58
  314. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  315. package/dist/esm/workspace-scope/workspace-scope.schemas.js +174 -78
  316. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  317. package/dist/tsconfig.build.tsbuildinfo +1 -1
  318. package/package.json +31 -17
  319. package/dist/esm/credentials/credentials-provisioner.service.d.ts +0 -190
  320. package/dist/esm/credentials/credentials-provisioner.service.d.ts.map +0 -1
  321. package/dist/esm/credentials/credentials-provisioner.service.js +0 -278
  322. package/dist/esm/credentials/credentials-provisioner.service.js.map +0 -1
  323. package/dist/esm/infra-managers/infra-manager.models.d.ts +0 -146
  324. package/dist/esm/infra-managers/infra-manager.models.d.ts.map +0 -1
  325. package/dist/esm/infra-managers/infra-manager.models.js +0 -2
  326. package/dist/esm/infra-managers/infra-manager.models.js.map +0 -1
  327. package/dist/esm/infra-managers/mongo-atlas-manager.service.d.ts +0 -64
  328. package/dist/esm/infra-managers/mongo-atlas-manager.service.d.ts.map +0 -1
  329. package/dist/esm/infra-managers/mongo-atlas-manager.service.js +0 -307
  330. package/dist/esm/infra-managers/mongo-atlas-manager.service.js.map +0 -1
  331. package/dist/esm/infra-managers/postgresql-manager.service.d.ts +0 -115
  332. package/dist/esm/infra-managers/postgresql-manager.service.d.ts.map +0 -1
  333. package/dist/esm/infra-managers/postgresql-manager.service.js +0 -403
  334. package/dist/esm/infra-managers/postgresql-manager.service.js.map +0 -1
  335. package/dist/esm/infra-managers/rabbitmq-manager.service.d.ts +0 -64
  336. package/dist/esm/infra-managers/rabbitmq-manager.service.d.ts.map +0 -1
  337. package/dist/esm/infra-managers/rabbitmq-manager.service.js +0 -288
  338. package/dist/esm/infra-managers/rabbitmq-manager.service.js.map +0 -1
  339. package/dist/esm/infra-managers/redis-manager.service.d.ts +0 -78
  340. package/dist/esm/infra-managers/redis-manager.service.d.ts.map +0 -1
  341. package/dist/esm/infra-managers/redis-manager.service.js +0 -326
  342. package/dist/esm/infra-managers/redis-manager.service.js.map +0 -1
  343. package/dist/esm/project-config/define-infra-config.d.ts +0 -128
  344. package/dist/esm/project-config/define-infra-config.d.ts.map +0 -1
  345. package/dist/esm/project-config/define-infra-config.js +0 -87
  346. package/dist/esm/project-config/define-infra-config.js.map +0 -1
  347. package/dist/esm/project-config/define-platform-config.d.ts +0 -65
  348. package/dist/esm/project-config/define-platform-config.d.ts.map +0 -1
  349. package/dist/esm/project-config/define-platform-config.js +0 -22
  350. package/dist/esm/project-config/define-platform-config.js.map +0 -1
  351. package/dist/esm/project-config/define-platform-env-config.d.ts +0 -41
  352. package/dist/esm/project-config/define-platform-env-config.d.ts.map +0 -1
  353. package/dist/esm/project-config/define-platform-env-config.js +0 -45
  354. package/dist/esm/project-config/define-platform-env-config.js.map +0 -1
  355. package/dist/esm/project-config/define-project-config.d.ts +0 -38
  356. package/dist/esm/project-config/define-project-config.d.ts.map +0 -1
  357. package/dist/esm/project-config/define-project-config.js +0 -57
  358. package/dist/esm/project-config/define-project-config.js.map +0 -1
  359. package/dist/esm/project-config/define-sharing-policy.d.ts +0 -35
  360. package/dist/esm/project-config/define-sharing-policy.d.ts.map +0 -1
  361. package/dist/esm/project-config/define-sharing-policy.js +0 -30
  362. package/dist/esm/project-config/define-sharing-policy.js.map +0 -1
  363. package/dist/esm/project-config/sharing-policy-validation.d.ts +0 -40
  364. package/dist/esm/project-config/sharing-policy-validation.d.ts.map +0 -1
  365. package/dist/esm/project-config/sharing-policy-validation.js +0 -143
  366. package/dist/esm/project-config/sharing-policy-validation.js.map +0 -1
  367. package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.d.ts +0 -23
  368. package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.d.ts.map +0 -1
  369. package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.js +0 -13
  370. package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.js.map +0 -1
  371. package/src/bootstrap/application-backend-env.contracts.ts +0 -17
  372. package/src/bootstrap/bootstrap-planner.ts +0 -46
  373. package/src/bootstrap/bootstrap.contracts.ts +0 -251
  374. package/src/bootstrap/bootstrap.schemas.ts +0 -164
  375. package/src/bootstrap/platform-runtime-env.contracts.ts +0 -99
  376. package/src/bootstrap/runtime-topology.contracts.ts +0 -102
  377. package/src/credentials/credential-generator.service.ts +0 -39
  378. package/src/index.ts +0 -16
  379. package/src/project-config/__tests__/application-modules.utils.test.ts +0 -53
  380. package/src/project-config/__tests__/define-framework-config.test.ts +0 -43
  381. package/src/project-config/__tests__/define-saas-config.test.ts +0 -210
  382. package/src/project-config/__tests__/loader.test.ts +0 -100
  383. package/src/project-config/define-framework-config.ts +0 -44
  384. package/src/project-config/define-infra-config.ts +0 -168
  385. package/src/project-config/define-minion-config.ts +0 -27
  386. package/src/project-config/define-platform-config.ts +0 -28
  387. package/src/project-config/define-platform-env-config.ts +0 -59
  388. package/src/project-config/define-project-config.ts +0 -63
  389. package/src/project-config/define-saas-config.ts +0 -171
  390. package/src/project-config/define-sharing-policy.ts +0 -36
  391. package/src/project-config/define-worker-config.ts +0 -27
  392. package/src/project-config/index.ts +0 -23
  393. package/src/project-config/loader.ts +0 -220
  394. package/src/project-config/shared/application-modules.schemas.ts +0 -12
  395. package/src/project-config/shared/application-modules.utils.ts +0 -65
  396. package/src/project-config/shared/backing-services.schemas.ts +0 -59
  397. package/src/project-config/shared/data-services.schemas.ts +0 -58
  398. package/src/project-config/shared/env-example-defaults.ts +0 -50
  399. package/src/project-config/shared/environment.schemas.ts +0 -136
  400. package/src/project-config/shared/infrastructure-defaults.schemas.ts +0 -47
  401. package/src/project-config/shared/k8s-utils.ts +0 -56
  402. package/src/project-config/shared/platform-services.schemas.ts +0 -33
  403. package/src/project-config/shared/service-definitions.schemas.ts +0 -38
  404. package/src/project-config/sharing-policy-validation.ts +0 -159
  405. package/src/release/framework-release.constants.ts +0 -2
  406. package/src/schemas/__tests__/platform-config.schemas.test.ts +0 -90
  407. package/src/schemas/framework-info.schemas.ts +0 -13
  408. package/src/schemas/framework-secrets.schemas.ts +0 -19
  409. package/src/schemas/platform-application-config.schemas.ts +0 -25
  410. package/src/schemas/platform-application-secrets.schemas.ts +0 -78
  411. package/src/schemas/platform-config.schemas.ts +0 -45
  412. package/src/workspace-scope/index.ts +0 -2
  413. package/src/workspace-scope/workspace-scope-detector.ts +0 -98
  414. package/src/workspace-scope/workspace-scope.schemas.ts +0 -224
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-infra-env-config.js","sourceRoot":"","sources":["../../../../src/project-config/define-infra-env-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,O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C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YACjD,IAAI,sBAAsB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC3C,SAAS;YACX,CAAC;YACD,IAAI,CAAC,OAAO,UAAU,EAAE,EAAE,MAAM,EAAE,wBAAwB,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks';\nimport { RuntimeEnvironment } from '@wildo-ai/saas-models';\nimport { z } from 'zod';\nimport {\n UnimplementedFieldSource,\n createUnimplementedFieldWarner,\n} from '../_unimplemented/unimplemented-field-warning';\nimport { WildoAuthConfigSchema } from './shared/auth.schemas';\nimport { ApplicationCreationVerificationConfigSchema } from './shared/application-creation-verification.schemas';\nimport { BackingServiceKind, BackingServiceSource, BackingServicesEnvConfigSchema } from './shared/backing-services.schemas';\nimport { WildoCdnConfigSchema } from './shared/cdn.schemas';\nimport { EnvCspOverrideSchema } from './shared/csp.schemas';\nimport { WildoSchemaVersionSchema } from './shared/schema-version.schemas';\nimport {\n InfraServiceAddressingSchema,\n InfraServiceK8sSchema,\n} from './shared/infra-service.schemas';\nimport {\n DatabaseEngine,\n WildoDeploymentConfigSchema,\n WildoDeploymentRuntime,\n WildoEnvironment,\n WildoEnvironmentIdSchema,\n WildoKubernetesConfigSchema,\n WildoLocationType,\n WildoLoggingConfigSchema,\n WildoObservabilityConfigSchema,\n WildoDocumentationSiteConfigSchema,\n WildoProviderSelectionOverridesSchema,\n WildoRemoteProviderSchema,\n isLocalEnvironmentId,\n} from './shared/environment.schemas';\n\nconst InfraEnvKubernetesSchema = WildoKubernetesConfigSchema.extend({\n services: z.record(z.string(), InfraServiceK8sSchema).optional(),\n}).strict();\n\n/**\n * DNS subdomain chain regex: one or more lowercase RFC 1123 labels\n * joined by dots. Empty string is allowed separately via the union\n * below — it means \"this service lives at the apex of `publicDomain`\".\n *\n * Examples accepted: `'app'`, `'docs'`, `'dev'`, `'www2'`, `'admin.ops'`.\n * Examples rejected: `'App'` (uppercase), `'-app'` / `'app-'`\n * (dash at boundary), `'app..docs'` / `'.app'` / `'app.'` (malformed\n * dots), `'a/b'` (non-DNS character).\n */\nconst SERVICE_HOST_LABEL = /^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*$/;\n\n/**\n * Per-service public hostname mapping, authored per-environment.\n *\n * - **Keys** are service keys from `wildo.saas.config.ts`\n * (`config.services.<key>`). The mapping is NOT validated against\n * the SaaS config at the Zod level (the two configs live in\n * separate files and are parsed independently). Cross-file\n * validation against the SaaS-config service registry is the\n * responsibility of consumers that wire the two parsed configs\n * together (URL composers, ingress manifest generators) — each\n * consumer enforces it at the seam where both configs are in\n * scope. This schema cannot enforce it standalone.\n * - **Values** are the subdomain chain prefixed to `publicDomain`, OR\n * the empty string for apex. Composed as\n * `https://${value ? `${value}.` : ''}${publicDomain}`.\n *\n * The mapping is intentionally per-environment (living inside\n * `wildo.infra.<env>.config.ts`) because local / staging / production\n * routinely have different topologies — e.g., local collapses\n * everything to `localhost`, staging mounts everything under\n * `*.staging.example.com`, production uses bespoke subdomains like\n * `app.example.com` + `dev.example.com` for docs. Binding the\n * hostname to a frontend kind or to the service key would force a\n * single topology on every environment; the per-env map keeps those\n * decisions explicit and author-driven.\n *\n * See `cross-app-jwt-propagation.md` Step 1 for the motivating\n * decision and the Step 2 URL composer that consumes this mapping\n * when building cross-frontend handoff URLs.\n */\nconst ServiceHostValueSchema = z.string()\n .refine(\n (value) => value === '' || SERVICE_HOST_LABEL.test(value),\n 'serviceHosts value must be a lowercase DNS subdomain chain (e.g. \"app\", \"docs\", \"dev.admin\") or \"\" (empty string, meaning apex).',\n );\n\nconst ServiceHostsMapSchema = z.record(z.string().min(1), ServiceHostValueSchema);\nconst consumedInfraCspServiceKeysContext = new AsyncLocalStorage<ReadonlySet<string>>();\n\nfunction parseConsumedInfraCspServiceKeysFromEnv(): ReadonlySet<string> {\n return new Set(\n (process.env.WILDO_CONSUMED_INFRA_CSP_SERVICE_KEYS ?? '')\n .split(',')\n .map((value) => value.trim())\n .filter((value) => value.length > 0),\n );\n}\n\nfunction getConsumedInfraCspServiceKeys(): ReadonlySet<string> {\n const contextKeys = consumedInfraCspServiceKeysContext.getStore();\n const envKeys = parseConsumedInfraCspServiceKeysFromEnv();\n if (contextKeys === undefined || contextKeys.size === 0) {\n return envKeys;\n }\n if (envKeys.size === 0) {\n return contextKeys;\n }\n return new Set([...contextKeys, ...envKeys]);\n}\n\nconst WildoInfraEnvConfigInputSchema = z.object({\n /**\n * Authored schema-format version for this `wildo.infra.<env>.config.ts`,\n * expressed as a **SemVer 2.0.0 string** (e.g. `'1.0.0'`,\n * `'2.3.1-rc.1'`, `'1.0.0+build.42'`).\n *\n * @unimplemented Slice 3.5 wires a parse-time warning when this is\n * authored. The full schema-evolution / migration tooling story is\n * tracked under deferred-backlog **D-5**\n * (`.cursor/plans/post-flattening-completion-fixes.md`). Symmetrical\n * with `WildoSaasConfig.version` — both reservations land/retire\n * together so the migration tooling, when it ships, can target both\n * authored configs through a single mechanism. SemVer (not a bare\n * integer) was chosen for the same reason as on the SaaS-config side\n * — see the JSDoc on `WildoSaasConfig.version`. Field is `.optional()`\n * (no Zod default) so unauthored configs stay silent.\n */\n version: WildoSchemaVersionSchema.optional(),\n environment: WildoEnvironmentIdSchema,\n locationType: z.enum(WildoLocationType).optional(),\n runtimeEnvironment: z.enum(RuntimeEnvironment).optional(),\n runtime: z.enum(WildoDeploymentRuntime),\n /**\n * The store the PLATFORM's own data lives in (apps-manager + module-registry:\n * users, organizations, applications, sessions, API keys).\n *\n * **This is a DECLARED property of the environment, and that is the whole point.** It used to\n * exist only as an answer to an interactive prompt, persisted to the machine-local\n * `environments.json` — so it could not be committed, reviewed, or reproduced on a second\n * machine, and a value inferred from which backing services happened to be declared filled the\n * gap. Authoring it here makes it travel with the repository like every other environment\n * property.\n *\n * OPTIONAL. When omitted, the engine is INFERRED from the declared backing services\n * (`inferDatabaseChoiceFromInfraConfig`), which is what every pre-existing environment relies\n * on — so omitting this field preserves today's behaviour exactly. When authored, it is the\n * AUTHORITY and the inference is not consulted.\n *\n * Authoring it is REQUIRED to express a PostgreSQL platform that ALSO runs a mongod, because the\n * inference resolves `postgresql && mongodb` to MongoDB — so that dual-store combination is\n * unreachable by inference, by construction. Since 2026-08-28 a PostgreSQL platform no longer has\n * to declare `backingServices.mongodb` at all (see the refinement below), so the single-store case\n * is now expressible too.\n *\n * @example A PostgreSQL platform, no mongod.\n * ```ts\n * database: { engine: DatabaseEngine.POSTGRESQL, source: BackingServiceSource.SELF },\n * backingServices: { postgresql: { source: BackingServiceSource.SELF } },\n * ```\n *\n * @example A DUAL-STORE platform — PostgreSQL for itself, a mongod beside it for the Mongo-backed\n * applications it hosts. This is the shape that needs `database` authored.\n * ```ts\n * database: { engine: DatabaseEngine.POSTGRESQL, source: BackingServiceSource.SELF },\n * backingServices: {\n * mongodb: { source: BackingServiceSource.SELF },\n * postgresql: { source: BackingServiceSource.SELF },\n * },\n * ```\n *\n * NOTE this is the PLATFORM's engine. An APPLICATION's own store is chosen separately by that\n * application's `DATABASE_DEFAULT_ADAPTER`; declaring `backingServices.postgresql` alone gives an\n * application a PostgreSQL substrate without moving the platform.\n */\n database: z\n .strictObject({\n engine: z.enum(DatabaseEngine),\n source: z.enum(BackingServiceSource),\n /**\n * Managed-brand identifier when `source === MANAGED` — `'atlas'` for Mongo; one of\n * `'aws-rds' | 'gcp-cloud-sql' | 'azure-database' | 'supabase' | 'neon' | 'render'` for\n * Postgres. Mirrors `PlatformEnvConfigJson['database'].provider` exactly; this field is\n * deliberately the same vocabulary rather than a parallel one.\n */\n provider: z.string().min(1).optional(),\n })\n .optional(),\n /** @wildo_source:part:start platform.config.application-database facet:layer:platform facet:family:bootstrap facet:audience:app-developer */\n /**\n * Which declared backing store the APPLICATION's own resources persist to.\n *\n * ## Why this is a SEPARATE field from `database`\n *\n * `database` above is the PLATFORM's engine — where apps-manager's own tables live. This one is the\n * application's, and the two move independently: a PostgreSQL platform can host a MongoDB\n * application and vice versa. Collapsing them would make one decision imply the other, which is\n * exactly the conflation the emitter's own contract warns against.\n *\n * ## Why it carries only `engine`\n *\n * The SUBSTRATE is already declared: `backingServices.postgresql` says where the database is and\n * who provisions it, and `env-vars-builder` already emits `POSTGRESQL_HOST/PORT/DATABASE` to the\n * application backend whenever the environment self-hosts one. What was missing is the SELECTION,\n * and only the selection belongs here.\n *\n * ## Why an authored field rather than an env variable\n *\n * The emitter states the rule this field exists to satisfy: *\"which store an application persists to\n * is a deployment decision that must be legible in one place, not an emergent property of which\n * variables happen to be set\"*. Before this, the only way to select PostgreSQL for an application\n * was to hand-edit `backend-api/.env` — machine-local, ungitted, and not reproducible on another\n * developer's machine. That is the same defect the platform `database` field above was added to\n * remove, and the reason both live in the authored, committed config.\n *\n * Absent means MongoDB, matching `ApplicationBackendDataEnvKeys.DATABASE_DEFAULT_ADAPTER`'s own\n * default — so every existing deployment is unaffected by this field existing.\n *\n * @example An application on PostgreSQL, on a platform that is also on PostgreSQL.\n * ```ts\n * database: { engine: DatabaseEngine.POSTGRESQL, source: BackingServiceSource.SELF },\n * applicationDatabase: { engine: DatabaseEngine.POSTGRESQL },\n * backingServices: {\n * postgresql: { source: BackingServiceSource.SELF, database: 'my-app-db' },\n * },\n * ```\n */\n applicationDatabase: z\n .strictObject({\n engine: z.enum(DatabaseEngine),\n })\n .optional(),\n /**\n * ## Choosing PostgreSQL creates a standing obligation — MIGRATIONS\n *\n * This is the part that is easy to miss, and it is not a detail of deployment: on MongoDB a\n * collection exists the moment something writes to it, so a new resource needs nothing. On\n * PostgreSQL a resource's TABLE is built by a MIGRATION, and nothing creates it implicitly. So on\n * this engine, adding or reshaping a resource owes an artifact:\n *\n * - `wildo db diff` — what separates the model from the accepted plan;\n * - `wildo db generate --name <label>` — writes `backend-api/migrations/<timestamp>_<name>/`\n * AND advances `backend-api/migrations/schema-plan.lock.json`, in one step. Commit them\n * TOGETHER; either one alone is the two-artifact drift the design exists to prevent;\n * - `wildo db migrate` — applies pending migrations by hand. Usually unnecessary: the application\n * backend applies them at BOOT, and `wildo local dev` reconciles drift before the app starts.\n *\n * Skip it and nothing warns until the backend refuses to start with\n * `postgresql_table_schema_mismatch` — an accurate message that names neither the migration nor\n * the command. See the `application-database-migrations` skill.\n */\n /** @wildo_source:part:end platform.config.application-database */\n /**\n * Public domain that browsers and external clients use to reach this\n * deployment. Ingress / reverse proxy / DNS terminate here; every\n * service-level subdomain is mounted under it via {@link serviceHosts}\n * (`https://<serviceHost>.<publicDomain>`, e.g. `app.example.com`; a\n * `serviceHosts` value of `''` mounts the service at the apex). Greenfield,\n * single-app, mono-env — there is NO `<service>-<appSlug>-<env>` fan-out.\n *\n * Applies to BOTH `WildoDeploymentRuntime.KUBERNETES` and\n * `WildoDeploymentRuntime.DOCKER_COMPOSE`. For compose envs without a\n * reverse proxy, author `'localhost'` explicitly. For K8s local,\n * author `'local.wildo.ai'` (or your `*.local` apex). For remote,\n * author your apex (e.g. `'wonder-todos.com'`).\n *\n * NOT to be confused with the K8s-internal service-mesh hostname\n * (`<service>.<namespace>.svc.cluster.local`), which stays implicit\n * and is derived from `kubernetes.namespace` at composition time.\n *\n * REQUIRED — there is no read-time fallback. The default that\n * `wildo init` writes into the generated config file lives in\n * `PUBLIC_DOMAIN_DEFAULTS` (`infrastructure-defaults.schemas.ts`),\n * but the schema enforces explicit authoring so a hand-edited\n * config that drops the field fails Zod parse with a clear error\n * instead of silently falling back.\n */\n publicDomain: z.string().min(1),\n /**\n * Per-service public hostname authoring for this environment.\n *\n * The app developer maps each publicly-exposed service (by its\n * `services.<key>` in `wildo.saas.config.ts`) to the subdomain\n * chain under `publicDomain` where it is reachable in this\n * environment. An empty string value mounts the service at the\n * apex of `publicDomain`.\n *\n * Explicit authoring only — there is NO auto-derivation from the\n * service key or from `frontendType`. An app-dev who wants the\n * docs service to live at `dev.example.com` (rather than the more\n * conventional `docs.example.com`) writes\n * `serviceHosts: { docs: 'dev' }` here; an app-dev who splits\n * marketing across `example.com` and `landing.example.com` can\n * author `serviceHosts: { www: '', landing: 'landing' }` without\n * the framework second-guessing the intent.\n *\n * Field is `.optional()` because many projects (local dev,\n * Docker Compose collapsed to `localhost`, single-frontend SaaS\n * apps) do not need per-service hostname authoring. Downstream\n * consumers (URL composers, ingress manifest generators) MUST\n * handle both \"no mapping authored\" and \"service key not\n * mapped\" as defined fallback paths — never as silent errors.\n */\n serviceHosts: ServiceHostsMapSchema.optional(),\n kubernetes: InfraEnvKubernetesSchema.optional(),\n remoteProvider: WildoRemoteProviderSchema.strict().optional(),\n deployment: WildoDeploymentConfigSchema.optional(),\n backingServices: BackingServicesEnvConfigSchema,\n /**\n * Per-environment logging posture. `level` is projected to `LOG_LEVEL`\n * by `env-vars-builder` for every long-running platform/application\n * process (`LoggerService.loadConfiguration` reads it at boot);\n * `formattedConsoleErrors` is projected to `LOG_FORMATTED_CONSOLE_ERRORS`\n * and overrides the auto-detected pino-pretty / JSON branch for\n * environments that want explicit control. Persisted into\n * `PlatformEnvConfigJson.logging` and hydrated back by\n * `hydrateEnvironmentFromConfig` so the runtime contract survives a\n * `wildo config sync` cycle.\n */\n logging: WildoLoggingConfigSchema.optional(),\n /**\n * Per-environment OTLP telemetry posture (Slice 2 Phase 5). `enabled` is projected to\n * `OTEL_ENABLED` and drives the `--import @wildo-ai/saas-backend-lib/otel-preload` wiring;\n * `endpoint` is projected to `OTEL_EXPORTER_OTLP_ENDPOINT`. The provider auth header\n * (`OTEL_EXPORTER_OTLP_HEADERS`) is derived from the selected `OBSERVABILITY_TELEMETRY`\n * provider's secret by `env-vars-builder`, not authored here. Persisted into\n * `PlatformEnvConfigJson.observability` and hydrated by `hydrateEnvironmentFromConfig`.\n */\n observability: WildoObservabilityConfigSchema.optional(),\n /**\n * Per-environment external-provider SELECTION override. Overrides the\n * app-wide `providers.scopes.backend.selection[capability]` primary/fallbacks\n * from `wildo.saas.config.ts` for THIS environment only — e.g. author\n * `providerSelection: { EMAIL_TRANSACTIONAL: { primary: 'email-preview' } }`\n * in `wildo.infra.local.config.ts` so local uses the non-sending\n * `email-preview` provider while remote envs keep the SaaS-config default\n * (`resend`). Projected to `WILDO_PROVIDER_SELECTION_OVERRIDES` by\n * `env-vars-builder` and applied by `ExternalProvidersRegistryBackendService`.\n * See {@link WildoProviderSelectionOverridesSchema}.\n */\n providerSelection: WildoProviderSelectionOverridesSchema.optional(),\n /**\n * Per-environment origins the documentation site is BUILT against.\n *\n * A docs bundle is static, so the origins are compiled in: a bundle built with the\n * wrong ones points every reader at the wrong host rather than failing. Authoring them\n * per environment is what lets `wildo config sync` carry them, instead of an operator\n * remembering three env vars on a build command.\n *\n * Projected to `WILDO_DOCS_API_BASE_URL` / `WILDO_DOCS_APP_URL` /\n * `WILDO_DOCS_FRONTEND_SERVICE_NAME` by `env-vars-builder`.\n * See {@link WildoDocumentationSiteConfigSchema}.\n */\n documentationSite: WildoDocumentationSiteConfigSchema.optional(),\n /**\n * Local-only operator configuration for application-creation verification.\n * The authored value is snapshotted into generated `config.json` and then\n * projected into the app-root `.env`; `.env` is never the authoring source.\n */\n applicationCreationVerification: ApplicationCreationVerificationConfigSchema.optional(),\n serviceAuth: WildoAuthConfigSchema.strict().optional(),\n /**\n * Per-environment Content-Security-Policy overrides, keyed by SaaS-config\n * service key (parallel to the `serviceHosts` keying convention).\n *\n * # Consumer wiring\n *\n * The generic resolver in `platform-config-lib` accepts this layer,\n * and `wildo dev sync-csp` is the first build-time consumer that\n * threads `parsed.csp[serviceKey]` into generated frontend CSP\n * artifacts and nginx marker rewrites. `defineInfraEnvConfig` still\n * emits a one-line stderr warning for authored service keys that are\n * not explicitly declared as consumed by the current loader; known\n * CSP-capable frontend keys are suppressed by the CLI while it loads\n * the shared infra config.\n *\n * Cross-validation against SaaS-config service keys is not enforceable\n * inside this schema alone because the infra config file is parsed\n * independently. Consumers that load both files together must validate\n * their own seam; `wildo dev sync-csp` rejects unknown `csp.<key>`\n * entries before emitting generated artifacts.\n *\n * # Where this fits in the three-layer CSP cake\n *\n * 1. Platform default (per-`AppFrontendType` baseline) — `csp-defaults.ts`.\n * 2. App-static (per-frontend `csp?` block) — authored on each\n * service-definition (today: `wildo.tech-doc.config.ts.csp?` per\n * `saas-technical-doc.md` Step 7.5).\n * 3. **THIS FIELD** — env-specific overrides authored under\n * `wildo.infra.<env>.config.ts.csp?[serviceKey]`. The\n * `resolveCspPolicy({ envOverride, environmentId })` resolver\n * in `platform-config-lib/src/project-config/shared/csp-emit.ts`\n * accepts this shape, the schema's `superRefine` enforces the\n * LOCAL-only `viteDevLoosening` rule, and `wildo dev sync-csp`\n * reads `parsed.csp[serviceKey]` when generating service-local\n * artifacts.\n *\n * # Why per-env overrides exist\n *\n * - Sentry / DataDog ingest origins differ per deployment (staging\n * vs production violation collectors).\n * - Vite dev mode needs `'unsafe-inline'` + `'unsafe-eval'` in\n * `script-src` (HMR client bootstrap injects an inline `<script>`,\n * module/sourcemap transforms run through `eval()`). The\n * framework auto-applies this for `local` + `SAAS_APP` via the\n * resolver's auto-default; the `viteDevLoosening` field exists\n * only for explicit opt-out (debugging real CSP issues) or for\n * non-canonical envs that also run Vite dev.\n * - Per-env `reportOnly` ramping: ship `reportOnly: true` in\n * staging while the violation collector ramps up, flip to\n * enforcing in prod once the directive overrides settle.\n *\n * # Always additive (resolver contract)\n *\n * Env-layer entries can only LOOSEN policy (`extraDirectives` is\n * APPEND-only over the app-static layer; `reportOnly` / `reportUri`\n * scalars override the app-static value when present;\n * `viteDevLoosening: true` appends `'unsafe-inline'` and\n * `'unsafe-eval'` to `script-src`). There is no `'replace-baseline'`\n * equivalent at this layer — env config exists to LOOSEN per-\n * deployment, not to replace an app's chosen posture. If an env\n * genuinely needs a different posture, the right answer is to fix\n * the app-static layer.\n *\n * # `.optional()` rationale\n *\n * Most environments (local dev, single-frontend SaaS apps that\n * accept the baseline policy verbatim) do not author per-service\n * CSP overrides. Downstream consumers MUST handle both \"no overrides\n * authored\" and \"service key not mapped\" as defined no-op fallbacks\n * — never as silent errors.\n *\n * `EnvCspOverrideSchema` is itself `z.strictObject` (csp.schemas.ts),\n * so unknown keys inside an authored override are rejected at the\n * inner-record level — no need to re-apply `.strict()` at the\n * `z.record` value position.\n */\n csp: z\n .record(z.string().min(1), EnvCspOverrideSchema)\n .optional(),\n /**\n * Per-service OPT-IN to CDN serving, keyed by SaaS-config service key\n * (same keyspace as `serviceHosts` / `csp`). Authoring an `enabled` entry\n * makes the deploy render skip the service's nginx Deployment/Service AND\n * its ingress / compose route — its public host is served off-cluster by a\n * CDN fronting an object-storage bucket, while `runtime.endPoints.publicUrl`\n * stays `<serviceHost>.<publicDomain>` (coherence preserved). See\n * {@link WildoCdnConfigSchema}. `wildo frontend publish` uploads the built\n * `dist/` + re-homes CSP to the edge for these services.\n *\n * `.optional()` — most apps serve every frontend from an nginx pod (no CDN);\n * consumers MUST treat \"no cdn authored\" and \"service key not mapped\" as the\n * defined no-op (nginx-served) fallback. `WildoCdnConfigSchema` is itself\n * `z.strictObject`, so unknown keys inside an authored entry are rejected at\n * the inner level — no `.strict()` needed at the `z.record` value position.\n */\n cdn: z\n .record(z.string().min(1), WildoCdnConfigSchema)\n .optional(),\n devCompanion: InfraServiceAddressingSchema.optional(),\n}).strict().superRefine((config, ctx) => {\n const resolvedEnvironment = config.environment;\n\n const resolvedLocationType = config.locationType\n ?? (isLocalEnvironmentId(resolvedEnvironment) ? WildoLocationType.LOCAL : WildoLocationType.REMOTE);\n\n if (isLocalEnvironmentId(resolvedEnvironment) && resolvedLocationType === WildoLocationType.REMOTE) {\n ctx.addIssue({\n code: 'custom',\n path: ['locationType'],\n message: `\"${resolvedEnvironment}\" environment cannot use remote locationType`,\n });\n }\n\n if (!isLocalEnvironmentId(resolvedEnvironment) && resolvedLocationType === WildoLocationType.LOCAL) {\n ctx.addIssue({\n code: 'custom',\n path: ['locationType'],\n message: 'Only the \"local\" environment id can use local locationType',\n });\n }\n\n if (!isLocalEnvironmentId(resolvedEnvironment) && !config.runtimeEnvironment) {\n ctx.addIssue({\n code: 'custom',\n path: ['runtimeEnvironment'],\n message: 'runtimeEnvironment is required for remote environments',\n });\n }\n\n /**\n * A declared PostgreSQL platform must declare the stores it actually needs — checked HERE, at\n * author time, rather than only at env generation.\n *\n * `env-vars-builder` already throws on both of these, but it throws during\n * `wildo config sync`, i.e. after the operator has committed the config and moved on. The same\n * refusal at parse time names the problem while the file is still open. The runtime throws\n * REMAIN as the backstop — they also guard generated/non-authored paths this schema never sees\n * (see `.claude/rules/invariant-call-site-enumeration.md`: an invariant enforced at one of its\n * sites is enforced at none of the others).\n */\n if (config.database?.engine === DatabaseEngine.POSTGRESQL) {\n if (!config.backingServices[BackingServiceKind.POSTGRESQL]) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['backingServices', BackingServiceKind.POSTGRESQL],\n message:\n 'database.engine is POSTGRESQL but no `backingServices.postgresql` is declared: the platform '\n + 'would be pointed at a PostgreSQL that nothing provisions. Declare it, or drop `database` '\n + 'to let the engine be inferred.',\n });\n }\n\n /**\n * RETIRED 2026-08-28. A PostgreSQL-engined platform no longer requires a mongod.\n *\n * This used to refuse a PostgreSQL platform that did not also declare\n * `backingServices.mongodb: { source: SELF }`, on two stated grounds — and BOTH had since been\n * met, which is exactly why it needed retiring rather than keeping:\n *\n * 1. \"six resources declare `persistenceAdapter: MONGODB`\" — retired 2026-08-22 (item C).\n * `bootstrap-plane-persistence-adapter.test.ts` now asserts the INVERSE, that none of the\n * six declares an adapter, so re-pinning any one of them fails that suite.\n * 2. \"`crontabs-batches-manager` … with zero PostgreSQL awareness\" — ported (item D). On a\n * PostgreSQL platform it takes `connectWithUrl(postgresUrl)` and never opens a Mongo\n * connection at all.\n *\n * The guard's own instruction was \"retire this together with those pins and the crontabs port —\n * NOT before\". Both landed; nobody came back. What kept a mongod alive after that was a THIRD\n * reason neither the guard nor its message ever named: apps-manager's env schema declared\n * `MONGO_CONNECT_URL` and `BASE_MONGO_SERVER_URL` as unconditionally REQUIRED, and its INIT\n * threw without them. That is the shape worth remembering — a transitional guard whose recorded\n * checklist is fully ticked while the real blocker sits somewhere it does not mention. Those\n * env keys are now engine-conditional, so nothing forces a mongod any more.\n *\n * A mongod remains perfectly legal to declare, and is still REQUIRED in practice for a platform\n * that hosts Mongo-backed applications — but that is an operator's judgment about the\n * applications they run, exactly as the `applicationDatabase` rule below already argues, and not\n * something this schema can decide for them.\n */\n }\n\n /**\n * An application cannot persist to a store the environment does not declare.\n *\n * Deliberately NOT symmetric with the platform rule above: that one also requires MongoDB to stay\n * declared, because the platform's own BOOTSTRAP plane is Mongo-wired. An application has no such\n * plane — once its resources are on PostgreSQL, nothing of the application's needs a mongod — so\n * requiring one here would forbid the very end-state this field exists to reach.\n */\n if (config.applicationDatabase?.engine === DatabaseEngine.POSTGRESQL\n && config.backingServices[BackingServiceKind.POSTGRESQL] === undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['backingServices', BackingServiceKind.POSTGRESQL],\n message:\n 'applicationDatabase.engine is POSTGRESQL but no `backingServices.postgresql` is declared: the '\n + 'application would be pointed at a PostgreSQL that nothing provisions. Declare it alongside.',\n });\n }\n\n if (!isLocalEnvironmentId(resolvedEnvironment) && config.applicationCreationVerification !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['applicationCreationVerification'],\n message: 'applicationCreationVerification is local-only and must be authored in wildo.infra.local.config.ts.',\n });\n }\n\n if (\n !isLocalEnvironmentId(resolvedEnvironment)\n && resolvedLocationType === WildoLocationType.REMOTE\n && config.runtime === WildoDeploymentRuntime.KUBERNETES\n ) {\n if (!config.remoteProvider) {\n ctx.addIssue({\n code: 'custom',\n path: ['remoteProvider'],\n message: 'remoteProvider is required for remote Kubernetes environments',\n });\n }\n if (!config.kubernetes) {\n ctx.addIssue({\n code: 'custom',\n path: ['kubernetes'],\n message: 'kubernetes is required for remote Kubernetes environments',\n });\n }\n }\n\n // CSP env-layer dev-only escape hatch — `viteDevLoosening: true`\n // injects BOTH `'unsafe-inline'` and `'unsafe-eval'` into `script-src`\n // (Vite's HMR client bootstrap is an inline `<script>` and its module\n // / sourcemap transforms run through `eval()`). The auto-default\n // already handles the canonical case (`local` + `SAAS_APP` →\n // auto-true). Explicit `viteDevLoosening: true` is REJECTED outside\n // the LOCAL environment because shipping `'unsafe-inline'` +\n // `'unsafe-eval'` to staging / production would punch a hole through\n // the entire CSP posture (every XSS payload becomes scriptable via\n // `eval()`-style sinks the baseline specifically denies, and inline\n // `<script>` injection escapes nonce-/hash-based mitigation). Failing\n // fast at parse time prevents an authored `csp.app.viteDevLoosening:\n // true` entry from silently shipping to production via a copy-paste\n // from the local config.\n if (config.csp && !isLocalEnvironmentId(resolvedEnvironment)) {\n for (const [serviceKey, override] of Object.entries(config.csp)) {\n if (override?.viteDevLoosening === true) {\n ctx.addIssue({\n code: 'custom',\n path: ['csp', serviceKey, 'viteDevLoosening'],\n message:\n `csp.${serviceKey}.viteDevLoosening cannot be true in environment \"${resolvedEnvironment}\" — `\n + `the dev-only escape hatch is restricted to \"${WildoEnvironment.LOCAL}\". `\n + `Author this flag ONLY in wildo.infra.local.config.ts; remote envs MUST reject `\n + `'unsafe-inline'/'unsafe-eval' so XSS payloads can't reach eval-style sinks or `\n + `inline-script injection. Production Vite builds emit <script type=\"module\"> with `\n + `no inline scripts and no eval(), so production envs never NEED this flag.`,\n });\n }\n }\n }\n\n // CDN serving is a REMOTE-only concern: it replaces a frontend's nginx pod\n // (Deployment + Service + ingress route), which exists ONLY in a remote\n // k8s/compose deploy. Local dev runs native frontend dev servers — there is\n // no nginx pod to skip and nowhere to publish to. Reject an authored `cdn`\n // block outside a remote env at parse time so a config copy-pasted from a\n // remote env can't silently make `wildo frontend publish --env local`\n // attempt an S3 upload (and so the semantic stays enforced, not implicit).\n if (config.cdn && resolvedLocationType !== WildoLocationType.REMOTE) {\n for (const serviceKey of Object.keys(config.cdn)) {\n ctx.addIssue({\n code: 'custom',\n path: ['cdn', serviceKey],\n message:\n `cdn.${serviceKey} is only valid in a REMOTE environment — CDN serving replaces the `\n + `frontend's nginx pod, which local dev does not have. Author cdn blocks only in `\n + `wildo.infra.remote.config.ts (staging / production).`,\n });\n }\n }\n});\n\nexport const WildoInfraEnvConfigSchema = WildoInfraEnvConfigInputSchema.transform((config) => {\n const environment = config.environment;\n const locationType = config.locationType\n ?? (isLocalEnvironmentId(environment) ? WildoLocationType.LOCAL : WildoLocationType.REMOTE);\n\n return {\n version: config.version,\n environment,\n locationType,\n runtimeEnvironment: config.runtimeEnvironment,\n runtime: config.runtime,\n /**\n * Projected EXPLICITLY, like every field here — this list IS the contract, and a field omitted\n * from it is silently dropped no matter what the input schema accepted. `undefined` when the\n * environment does not author one, which is the signal downstream consumers use to fall back to\n * `inferDatabaseChoiceFromInfraConfig`.\n */\n database: config.database,\n applicationDatabase: config.applicationDatabase,\n publicDomain: config.publicDomain,\n serviceHosts: config.serviceHosts,\n kubernetes: config.kubernetes,\n remoteProvider: config.remoteProvider,\n deployment: config.deployment,\n backingServices: config.backingServices,\n logging: config.logging,\n observability: config.observability,\n providerSelection: config.providerSelection,\n applicationCreationVerification: config.applicationCreationVerification,\n serviceAuth: config.serviceAuth,\n csp: config.csp,\n cdn: config.cdn,\n documentationSite: config.documentationSite,\n devCompanion: config.devCompanion,\n };\n});\n\nexport type WildoInfraEnvConfig = z.output<typeof WildoInfraEnvConfigSchema>;\nexport type WildoInfraEnvConfigInput = z.input<typeof WildoInfraEnvConfigSchema>;\n\n/**\n * Scope `csp.<serviceKey>` warning suppression to the current async load path.\n *\n * The docs CSP generator loads authored infra config through `loadConfig()`,\n * which evaluates `defineInfraEnvConfig(...)` inside the same process. Using\n * an async-local context lets that loader declare which keys are actively\n * consumed without mutating `process.env` across concurrent config loads.\n *\n * `WILDO_CONSUMED_INFRA_CSP_SERVICE_KEYS` remains supported as a coarse global\n * fallback (tests / external callers), but in-process loaders SHOULD prefer\n * this helper so suppression cannot leak between unrelated async work.\n */\nexport async function withConsumedInfraCspServiceKeys<T>(\n serviceKeys: Iterable<string>,\n callback: () => Promise<T> | T,\n): Promise<T> {\n const normalizedKeys = new Set(\n [...serviceKeys]\n .map((value) => value.trim())\n .filter((value) => value.length > 0),\n );\n if (normalizedKeys.size === 0) {\n return await callback();\n }\n const parentKeys = consumedInfraCspServiceKeysContext.getStore();\n const mergedKeys = new Set(parentKeys ?? []);\n for (const serviceKey of normalizedKeys) {\n mergedKeys.add(serviceKey);\n }\n return await consumedInfraCspServiceKeysContext.run(mergedKeys, callback);\n}\n\n/**\n * Define an app-owned environment descriptor under `infrastructure/<env>`.\n *\n * This is the canonical authored env contract for the flattened targeted-app\n * layout.\n *\n * After successful parsing, emits Slice 3.5 `@unimplemented` warnings for\n * authored fields that remain reserved or are not declared as consumed by\n * the current loader — see `_unimplemented/unimplemented-field-warning.ts`\n * for the design rationale (channel = stderr, dedupe = once-per-call,\n * format = single-line with backlog ID).\n */\nexport function defineInfraEnvConfig(config: WildoInfraEnvConfigInput): WildoInfraEnvConfig {\n const parsed = WildoInfraEnvConfigSchema.parse(config);\n emitInfraUnimplementedRuntimeWarnings(parsed);\n return parsed;\n}\n\n/**\n * Emit `@unimplemented` parse-time warnings for every authored\n * `WildoInfraEnvConfig` field that remains reserved or is not declared as\n * consumed by the current loader (Slice 3.5 contract — see\n * `_unimplemented/unimplemented-field-warning.ts`).\n *\n * Surfaces today (2 field families):\n *\n * - `version` (!== undefined) → `D-5`\n * - `csp.<serviceKey>` (each authored entry) → `B-2C` (auth-hardening\n * Slice B Step 2 closeout — the schema reservation shipped, the\n * superRefine guard against `viteDevLoosening: true` outside LOCAL\n * is live, and `wildo dev sync-csp` declares the CSP-capable\n * frontend service keys it consumes while loading authored infra\n * config, so warnings remain reserved for genuinely unconsumed keys.)\n *\n * `logging.{level, formattedConsoleErrors}` is intentionally NOT in this\n * list: Slice 3.5 wires both fields end-to-end (persistence,\n * `env-vars-builder` → `LOG_LEVEL` / `LOG_FORMATTED_CONSOLE_ERRORS`,\n * `LoggerService.loadConfiguration`), so they have a real runtime\n * consumer and silence is the honest behavior.\n *\n * `domain` is intentionally NOT in this list either: Slice 3.5 deleted\n * the field outright as a wrong-seam, and the post-Slice-3.5\n * `external-public-domain-rename.md` follow-up renamed the canonical\n * hostname seam to top-level `publicDomain` (replacing the misnamed\n * `kubernetes.baseDomain` of Slice 3.5). Both `domain` and\n * `kubernetes.baseDomain` are now strict-rejected by the schema —\n * the canonical seam is `publicDomain` at the top level. See the\n * strict-pin tests in `__tests__/define-infra-env-config.unimplemented.test.ts`.\n *\n * When the deferred backlog item lands, the matching `if` branch below\n * MUST be removed in the same commit as the runtime wiring — leaving a\n * stale warning is worse than silence.\n */\nfunction emitInfraUnimplementedRuntimeWarnings(config: WildoInfraEnvConfig): void {\n const warn = createUnimplementedFieldWarner(UnimplementedFieldSource.INFRA_ENV_CONFIG);\n const AUTH_HARDENING_PLAN_PATH = '.cursor/plans/auth-hardening.md';\n const consumedCspServiceKeys = getConsumedInfraCspServiceKeys();\n\n if (config.version !== undefined) {\n warn('version', 'D-5');\n }\n\n if (config.csp !== undefined) {\n // Walk every authored service key so a multi-service author\n // (e.g. csp: { docs: {…}, app: {…} }) sees one warning per\n // service — the dedupe key is the field path, so per-key\n // emission is what matches the createUnimplementedFieldWarner\n // contract.\n for (const serviceKey of Object.keys(config.csp)) {\n if (consumedCspServiceKeys.has(serviceKey)) {\n continue;\n }\n warn(`csp.${serviceKey}`, 'B-2C', AUTH_HARDENING_PLAN_PATH);\n }\n }\n}\n"]}
@@ -1,4 +1,174 @@
1
1
  import { z } from 'zod';
2
+ import { type RuntimeIsolation } from './shared/service-definitions.schemas';
3
+ /**
4
+ * Reinstantiation policy when an `'always-up'` minion is restarted
5
+ * (deploy, config reload, manual `kubectl rollout restart`).
6
+ *
7
+ * - `'kill_previous'` (default) — the apps-manager terminates the
8
+ * running pod before the new one starts. Matches K8s `Recreate`
9
+ * strategy. Correct default for stateful actor-flow minions where
10
+ * two concurrent instances would corrupt invariants.
11
+ * - `'let_run'` — both pods run side-by-side until the previous one
12
+ * exits naturally. Matches K8s `RollingUpdate` strategy with
13
+ * `maxSurge: 1, maxUnavailable: 0`. Authored explicitly when the
14
+ * minion can tolerate momentary duplication (e.g. an idempotent
15
+ * scraper).
16
+ *
17
+ * `gracePeriodSec` is optional and only meaningful for
18
+ * `'kill_previous'` (forwarded to the K8s `terminationGracePeriodSeconds`
19
+ * Phase 3 manifest emitter — Q7 LOCKED). Authoring it on `'let_run'`
20
+ * is harmless today but silently ignored.
21
+ */
22
+ export declare const MinionReinstantiationSchema: z.ZodObject<{
23
+ policy: z.ZodDefault<z.ZodEnum<{
24
+ kill_previous: "kill_previous";
25
+ let_run: "let_run";
26
+ }>>;
27
+ gracePeriodSec: z.ZodOptional<z.ZodNumber>;
28
+ }, z.core.$strict>;
29
+ export type MinionReinstantiation = z.infer<typeof MinionReinstantiationSchema>;
30
+ /**
31
+ * Per-minion liveness contract — G-18 + NR-3 in
32
+ * `.cursor/plans/minions-and-workers-implementation.md`.
33
+ *
34
+ * Minions have NO inbound HTTP surface (KD-1 / Q5 LOCKED), so the K8s
35
+ * liveness probe cannot use the `httpGet` shape that workers use. The
36
+ * supported probes are:
37
+ *
38
+ * - `kind: 'file'` (default) — the minion's actor loop touches
39
+ * `filePath` every `heartbeat.intervalSec` seconds. The K8s probe
40
+ * is an `exec` probe that runs `find <filePath> -mmin -<staleAfterSec/60>`
41
+ * and fails when the file is older than `staleAfterSec`.
42
+ *
43
+ * - `kind: 'exec'` — the minion provides its own probe command (e.g.
44
+ * `['curl', '-fsS', 'http://localhost:9090/internal/healthz']` for
45
+ * a minion that exposes a loopback-only debug surface). The
46
+ * contract is "exit 0 = healthy, anything else = restart".
47
+ *
48
+ * `staleAfterSec` MUST be > `heartbeat.intervalSec` (the schema's
49
+ * `superRefine` enforces this — a stale-window equal to or shorter
50
+ * than the heartbeat would guarantee K8s flaps the pod even when
51
+ * the minion is healthy). The 90s / 30s defaults give a 3× safety
52
+ * margin which the cron-cadence vs liveness-cadence interaction
53
+ * documented in NR-3 needs to keep the deploy story sane.
54
+ */
55
+ export declare const MinionLivenessSchema: z.ZodObject<{
56
+ kind: z.ZodDefault<z.ZodEnum<{
57
+ file: "file";
58
+ exec: "exec";
59
+ }>>;
60
+ filePath: z.ZodDefault<z.ZodString>;
61
+ execCommand: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
+ heartbeat: z.ZodPrefault<z.ZodObject<{
63
+ intervalSec: z.ZodDefault<z.ZodNumber>;
64
+ }, z.core.$strict>>;
65
+ staleAfterSec: z.ZodDefault<z.ZodNumber>;
66
+ }, z.core.$strict>;
67
+ export type MinionLiveness = z.infer<typeof MinionLivenessSchema>;
68
+ /**
69
+ * Per-minion container isolation. An ALIAS of the shared
70
+ * {@link RuntimeIsolationSchema} — minions and workers have identical isolation
71
+ * contracts, and the floor/authorable split is documented there. Kept as a named
72
+ * export so minion-facing code and its pins read in minion terms.
73
+ *
74
+ * ## ⚠️ The one MINION-SPECIFIC consequence, and it is load-bearing
75
+ *
76
+ * {@link MinionLivenessSchema} defaults to a FILE probe at
77
+ * `/tmp/wildo-minion-alive`, touched by the actor loop every
78
+ * `heartbeat.intervalSec`. So `readOnlyRootFilesystem: true` with no writable
79
+ * `/tmp` makes the heartbeat unwritable and Kubernetes restart-loops **every
80
+ * healthy minion** — the probe fails for a reason unrelated to the workload's
81
+ * health. The renderers always emit the `/tmp` mount alongside the read-only
82
+ * flag; the two must never be separated.
83
+ *
84
+ * Workers probe over HTTP and so do not share this acute coupling, which is why
85
+ * the reasoning lives here rather than in the shared schema.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * // Most minions author nothing — the secure defaults apply.
90
+ * isolation: undefined
91
+ *
92
+ * // A minion whose image runs as uid 1000 and needs a scratch directory:
93
+ * isolation: { runAsUser: 1000, runAsGroup: 1000, writablePaths: ['/var/cache/scraper'] }
94
+ * ```
95
+ */
96
+ export declare const MinionIsolationSchema: z.ZodObject<{
97
+ runAsUser: z.ZodDefault<z.ZodNumber>;
98
+ runAsGroup: z.ZodDefault<z.ZodNumber>;
99
+ writablePaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
100
+ pidsLimit: z.ZodDefault<z.ZodNumber>;
101
+ }, z.core.$strict>;
102
+ export type MinionIsolation = RuntimeIsolation;
103
+ /**
104
+ * The mandatory writable mount, kept as a named constant rather than a literal
105
+ * repeated across the k8s and compose renderers — two copies of a path this
106
+ * load-bearing WILL drift, and the failure mode (restart-looping healthy
107
+ * minions) is far from the edit that caused it.
108
+ *
109
+ * Matches `MinionLivenessSchema.filePath`'s default directory.
110
+ */
111
+ export declare const MINION_MANDATORY_WRITABLE_PATH = "/tmp";
112
+ /**
113
+ * Per-folder minion configuration (`wildo.minion.config.ts`).
114
+ *
115
+ * Phase 1 schema honesty (KD-1, KD-3, KD-7, KD-8 + G-18 in
116
+ * `.cursor/plans/minions-and-workers-implementation.md`):
117
+ *
118
+ * - `mode` (`'always-up' | 'cron'`) — KD-3. Determines the K8s
119
+ * deployment shape Phase 3 will emit. `schedule` is required iff
120
+ * `mode === 'cron'` (enforced by the top-level `superRefine`).
121
+ *
122
+ * - `reinstantiation` — KD-7. Only meaningful for `'always-up'`
123
+ * today (cron minions are short-lived); the schema accepts the
124
+ * field on cron minions but it stays inert at runtime so the
125
+ * surface stays uniform.
126
+ *
127
+ * - `replicas` is pinned to `1` per KD-8 — minions are SINGLETONS
128
+ * in v1 (no horizontal scaling). The literal-`1` constraint is
129
+ * enforced at parse time so a future "let me run two of these"
130
+ * request must come through a deliberate schema bump, not a silent
131
+ * config tweak. Authored explicitly in the schema (rather than
132
+ * omitted) so the K8s manifest emitter has a single source of
133
+ * truth — symmetric with the worker schema's `replicas` field.
134
+ *
135
+ * - `liveness` — G-18 + NR-3. Defaults to file-heartbeat 30s /
136
+ * stale-after 90s, which the cron-cadence vs liveness-cadence
137
+ * note in NR-3 picked as the safe baseline.
138
+ *
139
+ * - The legacy `dataAccess` block is REMOVED — minion access to
140
+ * repositories is governed by the bucket-level `resourceAccess`
141
+ * whitelist authored on the minion entry in `wildo.saas.config.ts`
142
+ * (KD-11). Keeping a redundant per-minion-config field would
143
+ * create a second source of truth and an obvious "which one wins?"
144
+ * bug surface.
145
+ *
146
+ * - `isolation` — container security posture. Only the image-dependent and
147
+ * ADDITIVE knobs are authorable; the security floor (non-root, read-only
148
+ * rootfs, dropped capabilities, seccomp, no service-account token) is
149
+ * emitted unconditionally and cannot be configured down. See
150
+ * {@link MinionIsolationSchema} for why that split exists.
151
+ *
152
+ * - `localProviders` — providers this minion AUTHORS beside its own code,
153
+ * for the case the application catalog does not carry them (R7).
154
+ *
155
+ * This is NOT a return of the legacy `providers` block, which was removed so
156
+ * that `defineSaaSProviders({ scopes })` would be the single source of truth
157
+ * and per-minion visibility a PROJECTION of it. That property is preserved:
158
+ * a fragment declared here is REGISTERED INTO the application catalog at
159
+ * config load (`registerMinionLocalProviderFragments`), and everything
160
+ * downstream — scope projection, the fail-closed secret filtering, the
161
+ * generated runtime module — reads the catalog and cannot tell a registered
162
+ * fragment from an application-authored entry.
163
+ *
164
+ * One authoring LOCATION per provider; one runtime SOURCE for all of them.
165
+ * The consequence that matters: because a registered fragment IS a catalog
166
+ * entry, its SECRETS arrive through the same single mechanism as every other
167
+ * provider's. Authoring a provider here creates no second secret channel.
168
+ *
169
+ * The schema is `z.strictObject` so a typo (`scedule:` instead of
170
+ * `schedule:`) fails fast — same posture as `WildoSaasConfigSchema`.
171
+ */
2
172
  export declare const WildoMinionConfigSchema: z.ZodObject<{
3
173
  version: z.ZodDefault<z.ZodNumber>;
4
174
  name: z.ZodString;
@@ -7,35 +177,63 @@ export declare const WildoMinionConfigSchema: z.ZodObject<{
7
177
  runtime: z.ZodObject<{
8
178
  type: z.ZodString;
9
179
  language: z.ZodString;
10
- }, z.core.$strip, core.$ZodObjectExtra>;
11
- schedule: z.ZodString;
180
+ }, z.core.$strip>;
181
+ /**
182
+ * Provider fragments this minion authors locally — registered into the
183
+ * application catalog at config load, never a parallel catalog. See the
184
+ * `localProviders` note in this file's header for why this is not the legacy
185
+ * `providers` block returning.
186
+ *
187
+ * Keyed by provider ref, exactly as the application catalog is, so a collision
188
+ * with an application-declared ref is detectable — and REFUSED — at
189
+ * registration rather than resolved by a precedence rule nobody reads.
190
+ */
191
+ localProviders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
192
+ mode: z.ZodEnum<{
193
+ "always-up": "always-up";
194
+ cron: "cron";
195
+ }>;
196
+ /** Cron expression (required iff `mode === 'cron'`). */
197
+ schedule: z.ZodOptional<z.ZodString>;
198
+ reinstantiation: z.ZodPrefault<z.ZodObject<{
199
+ policy: z.ZodDefault<z.ZodEnum<{
200
+ kill_previous: "kill_previous";
201
+ let_run: "let_run";
202
+ }>>;
203
+ gracePeriodSec: z.ZodOptional<z.ZodNumber>;
204
+ }, z.core.$strict>>;
205
+ replicas: z.ZodDefault<z.ZodLiteral<1>>;
206
+ liveness: z.ZodPrefault<z.ZodObject<{
207
+ kind: z.ZodDefault<z.ZodEnum<{
208
+ file: "file";
209
+ exec: "exec";
210
+ }>>;
211
+ filePath: z.ZodDefault<z.ZodString>;
212
+ execCommand: z.ZodOptional<z.ZodArray<z.ZodString>>;
213
+ heartbeat: z.ZodPrefault<z.ZodObject<{
214
+ intervalSec: z.ZodDefault<z.ZodNumber>;
215
+ }, z.core.$strict>>;
216
+ staleAfterSec: z.ZodDefault<z.ZodNumber>;
217
+ }, z.core.$strict>>;
12
218
  resources: z.ZodOptional<z.ZodObject<{
13
219
  cpu: z.ZodOptional<z.ZodString>;
14
220
  memory: z.ZodOptional<z.ZodString>;
15
- }, z.core.$strip, core.$ZodObjectExtra>>;
16
- providers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
17
- required: z.ZodDefault<z.ZodBoolean>;
18
- }, z.core.$strip, core.$ZodObjectExtra>>>;
19
- dataAccess: z.ZodOptional<z.ZodObject<{
20
- database: z.ZodOptional<z.ZodEnum<{
21
- "read-only": "read-only";
22
- "read-write": "read-write";
23
- none: "none";
24
- }>>;
25
- cache: z.ZodOptional<z.ZodBoolean>;
26
- queue: z.ZodOptional<z.ZodEnum<{
27
- none: "none";
28
- consumer: "consumer";
29
- producer: "producer";
30
- both: "both";
31
- }>>;
32
- }, z.core.$strip, core.$ZodObjectExtra>>;
33
- }, z.core.$strip, core.$ZodObjectExtra>;
221
+ }, z.core.$strip>>;
222
+ isolation: z.ZodPrefault<z.ZodObject<{
223
+ runAsUser: z.ZodDefault<z.ZodNumber>;
224
+ runAsGroup: z.ZodDefault<z.ZodNumber>;
225
+ writablePaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
226
+ pidsLimit: z.ZodDefault<z.ZodNumber>;
227
+ }, z.core.$strict>>;
228
+ }, z.core.$strict>;
34
229
  export type WildoMinionConfig = z.infer<typeof WildoMinionConfigSchema>;
35
230
  export type WildoMinionConfigInput = z.input<typeof WildoMinionConfigSchema>;
36
231
  /**
37
- * Define a minion (scheduled task / cron agent) configuration.
38
- * Minions run on a schedule and can access data services and providers.
232
+ * Define a minion (long-running actor host or scheduled tick) configuration.
233
+ *
234
+ * Minions have NO inbound HTTP surface (KD-1) and are SINGLETONS
235
+ * (`replicas: 1`, KD-8). The full v1 architectural rationale is in
236
+ * `.cursor/plans/minions-and-workers-implementation.md`.
39
237
  */
40
238
  export declare function defineMinionConfig(config: WildoMinionConfigInput): WildoMinionConfig;
41
239
  //# sourceMappingURL=define-minion-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-minion-config.d.ts","sourceRoot":"","sources":["../../../src/project-config/define-minion-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAalC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE7E;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,sBAAsB,GAAG,iBAAiB,CAEpF"}
1
+ {"version":3,"file":"define-minion-config.d.ts","sourceRoot":"","sources":["../../../../src/project-config/define-minion-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,sCAAsC,CAAC;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,2BAA2B;;;;;;kBAGtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;kBA6B/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,qBAAqB;;;;;kBAAyB,CAAC;AAC5D,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,SAAkC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;IAMlC;;;;;;;;;OASG;;;;;;IAGH,wDAAwD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoCxD,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE7E;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,sBAAsB,GAAG,iBAAiB,CAEpF"}
@@ -1,24 +1,241 @@
1
1
  import { z } from 'zod';
2
- import { WorkerRuntimeSchema, ResourceLimitsSchema, DataAccessSchema } from './shared/service-definitions.schemas.js';
3
- export const WildoMinionConfigSchema = z.object({
2
+ import { WorkerRuntimeSchema, ResourceLimitsSchema, RuntimeIsolationSchema, RUNTIME_MANDATORY_WRITABLE_PATH, refineRuntimeIsolation, } from './shared/service-definitions.schemas.js';
3
+ /**
4
+ * Reinstantiation policy when an `'always-up'` minion is restarted
5
+ * (deploy, config reload, manual `kubectl rollout restart`).
6
+ *
7
+ * - `'kill_previous'` (default) — the apps-manager terminates the
8
+ * running pod before the new one starts. Matches K8s `Recreate`
9
+ * strategy. Correct default for stateful actor-flow minions where
10
+ * two concurrent instances would corrupt invariants.
11
+ * - `'let_run'` — both pods run side-by-side until the previous one
12
+ * exits naturally. Matches K8s `RollingUpdate` strategy with
13
+ * `maxSurge: 1, maxUnavailable: 0`. Authored explicitly when the
14
+ * minion can tolerate momentary duplication (e.g. an idempotent
15
+ * scraper).
16
+ *
17
+ * `gracePeriodSec` is optional and only meaningful for
18
+ * `'kill_previous'` (forwarded to the K8s `terminationGracePeriodSeconds`
19
+ * Phase 3 manifest emitter — Q7 LOCKED). Authoring it on `'let_run'`
20
+ * is harmless today but silently ignored.
21
+ */
22
+ export const MinionReinstantiationSchema = z.strictObject({
23
+ policy: z.enum(['kill_previous', 'let_run']).default('kill_previous'),
24
+ gracePeriodSec: z.number().int().nonnegative().optional(),
25
+ });
26
+ /**
27
+ * Per-minion liveness contract — G-18 + NR-3 in
28
+ * `.cursor/plans/minions-and-workers-implementation.md`.
29
+ *
30
+ * Minions have NO inbound HTTP surface (KD-1 / Q5 LOCKED), so the K8s
31
+ * liveness probe cannot use the `httpGet` shape that workers use. The
32
+ * supported probes are:
33
+ *
34
+ * - `kind: 'file'` (default) — the minion's actor loop touches
35
+ * `filePath` every `heartbeat.intervalSec` seconds. The K8s probe
36
+ * is an `exec` probe that runs `find <filePath> -mmin -<staleAfterSec/60>`
37
+ * and fails when the file is older than `staleAfterSec`.
38
+ *
39
+ * - `kind: 'exec'` — the minion provides its own probe command (e.g.
40
+ * `['curl', '-fsS', 'http://localhost:9090/internal/healthz']` for
41
+ * a minion that exposes a loopback-only debug surface). The
42
+ * contract is "exit 0 = healthy, anything else = restart".
43
+ *
44
+ * `staleAfterSec` MUST be > `heartbeat.intervalSec` (the schema's
45
+ * `superRefine` enforces this — a stale-window equal to or shorter
46
+ * than the heartbeat would guarantee K8s flaps the pod even when
47
+ * the minion is healthy). The 90s / 30s defaults give a 3× safety
48
+ * margin which the cron-cadence vs liveness-cadence interaction
49
+ * documented in NR-3 needs to keep the deploy story sane.
50
+ */
51
+ export const MinionLivenessSchema = z.strictObject({
52
+ kind: z.enum(['file', 'exec']).default('file'),
53
+ filePath: z.string().min(1).default('/tmp/wildo-minion-alive'),
54
+ execCommand: z.array(z.string().min(1)).min(1).optional(),
55
+ heartbeat: z
56
+ .strictObject({
57
+ intervalSec: z.number().int().positive().default(30),
58
+ })
59
+ .prefault({}),
60
+ staleAfterSec: z.number().int().positive().default(90),
61
+ }).superRefine((val, ctx) => {
62
+ if (val.kind === 'exec' && (!val.execCommand || val.execCommand.length === 0)) {
63
+ ctx.addIssue({
64
+ code: 'custom',
65
+ path: ['execCommand'],
66
+ message: "liveness.execCommand is required (and non-empty) when liveness.kind === 'exec'.",
67
+ });
68
+ }
69
+ if (val.staleAfterSec <= val.heartbeat.intervalSec) {
70
+ ctx.addIssue({
71
+ code: 'custom',
72
+ path: ['staleAfterSec'],
73
+ message: `liveness.staleAfterSec (${val.staleAfterSec}s) must be strictly greater than ` +
74
+ `liveness.heartbeat.intervalSec (${val.heartbeat.intervalSec}s) — otherwise the K8s ` +
75
+ 'liveness probe will flap the pod even when the minion is healthy. ' +
76
+ 'Recommended: staleAfterSec ≥ 3× heartbeat.intervalSec.',
77
+ });
78
+ }
79
+ });
80
+ /**
81
+ * Per-minion container isolation. An ALIAS of the shared
82
+ * {@link RuntimeIsolationSchema} — minions and workers have identical isolation
83
+ * contracts, and the floor/authorable split is documented there. Kept as a named
84
+ * export so minion-facing code and its pins read in minion terms.
85
+ *
86
+ * ## ⚠️ The one MINION-SPECIFIC consequence, and it is load-bearing
87
+ *
88
+ * {@link MinionLivenessSchema} defaults to a FILE probe at
89
+ * `/tmp/wildo-minion-alive`, touched by the actor loop every
90
+ * `heartbeat.intervalSec`. So `readOnlyRootFilesystem: true` with no writable
91
+ * `/tmp` makes the heartbeat unwritable and Kubernetes restart-loops **every
92
+ * healthy minion** — the probe fails for a reason unrelated to the workload's
93
+ * health. The renderers always emit the `/tmp` mount alongside the read-only
94
+ * flag; the two must never be separated.
95
+ *
96
+ * Workers probe over HTTP and so do not share this acute coupling, which is why
97
+ * the reasoning lives here rather than in the shared schema.
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * // Most minions author nothing — the secure defaults apply.
102
+ * isolation: undefined
103
+ *
104
+ * // A minion whose image runs as uid 1000 and needs a scratch directory:
105
+ * isolation: { runAsUser: 1000, runAsGroup: 1000, writablePaths: ['/var/cache/scraper'] }
106
+ * ```
107
+ */
108
+ export const MinionIsolationSchema = RuntimeIsolationSchema;
109
+ /**
110
+ * The mandatory writable mount, kept as a named constant rather than a literal
111
+ * repeated across the k8s and compose renderers — two copies of a path this
112
+ * load-bearing WILL drift, and the failure mode (restart-looping healthy
113
+ * minions) is far from the edit that caused it.
114
+ *
115
+ * Matches `MinionLivenessSchema.filePath`'s default directory.
116
+ */
117
+ export const MINION_MANDATORY_WRITABLE_PATH = RUNTIME_MANDATORY_WRITABLE_PATH;
118
+ /**
119
+ * Per-folder minion configuration (`wildo.minion.config.ts`).
120
+ *
121
+ * Phase 1 schema honesty (KD-1, KD-3, KD-7, KD-8 + G-18 in
122
+ * `.cursor/plans/minions-and-workers-implementation.md`):
123
+ *
124
+ * - `mode` (`'always-up' | 'cron'`) — KD-3. Determines the K8s
125
+ * deployment shape Phase 3 will emit. `schedule` is required iff
126
+ * `mode === 'cron'` (enforced by the top-level `superRefine`).
127
+ *
128
+ * - `reinstantiation` — KD-7. Only meaningful for `'always-up'`
129
+ * today (cron minions are short-lived); the schema accepts the
130
+ * field on cron minions but it stays inert at runtime so the
131
+ * surface stays uniform.
132
+ *
133
+ * - `replicas` is pinned to `1` per KD-8 — minions are SINGLETONS
134
+ * in v1 (no horizontal scaling). The literal-`1` constraint is
135
+ * enforced at parse time so a future "let me run two of these"
136
+ * request must come through a deliberate schema bump, not a silent
137
+ * config tweak. Authored explicitly in the schema (rather than
138
+ * omitted) so the K8s manifest emitter has a single source of
139
+ * truth — symmetric with the worker schema's `replicas` field.
140
+ *
141
+ * - `liveness` — G-18 + NR-3. Defaults to file-heartbeat 30s /
142
+ * stale-after 90s, which the cron-cadence vs liveness-cadence
143
+ * note in NR-3 picked as the safe baseline.
144
+ *
145
+ * - The legacy `dataAccess` block is REMOVED — minion access to
146
+ * repositories is governed by the bucket-level `resourceAccess`
147
+ * whitelist authored on the minion entry in `wildo.saas.config.ts`
148
+ * (KD-11). Keeping a redundant per-minion-config field would
149
+ * create a second source of truth and an obvious "which one wins?"
150
+ * bug surface.
151
+ *
152
+ * - `isolation` — container security posture. Only the image-dependent and
153
+ * ADDITIVE knobs are authorable; the security floor (non-root, read-only
154
+ * rootfs, dropped capabilities, seccomp, no service-account token) is
155
+ * emitted unconditionally and cannot be configured down. See
156
+ * {@link MinionIsolationSchema} for why that split exists.
157
+ *
158
+ * - `localProviders` — providers this minion AUTHORS beside its own code,
159
+ * for the case the application catalog does not carry them (R7).
160
+ *
161
+ * This is NOT a return of the legacy `providers` block, which was removed so
162
+ * that `defineSaaSProviders({ scopes })` would be the single source of truth
163
+ * and per-minion visibility a PROJECTION of it. That property is preserved:
164
+ * a fragment declared here is REGISTERED INTO the application catalog at
165
+ * config load (`registerMinionLocalProviderFragments`), and everything
166
+ * downstream — scope projection, the fail-closed secret filtering, the
167
+ * generated runtime module — reads the catalog and cannot tell a registered
168
+ * fragment from an application-authored entry.
169
+ *
170
+ * One authoring LOCATION per provider; one runtime SOURCE for all of them.
171
+ * The consequence that matters: because a registered fragment IS a catalog
172
+ * entry, its SECRETS arrive through the same single mechanism as every other
173
+ * provider's. Authoring a provider here creates no second secret channel.
174
+ *
175
+ * The schema is `z.strictObject` so a typo (`scedule:` instead of
176
+ * `schedule:`) fails fast — same posture as `WildoSaasConfigSchema`.
177
+ */
178
+ export const WildoMinionConfigSchema = z.strictObject({
4
179
  version: z.number().int().positive().default(1),
5
180
  name: z.string().min(1),
6
181
  displayName: z.string().min(1),
7
182
  description: z.string().optional(),
8
183
  runtime: WorkerRuntimeSchema,
9
- /** Cron expression for scheduling (e.g. every 6 hours) */
10
- schedule: z.string().min(1),
184
+ /**
185
+ * Provider fragments this minion authors locally — registered into the
186
+ * application catalog at config load, never a parallel catalog. See the
187
+ * `localProviders` note in this file's header for why this is not the legacy
188
+ * `providers` block returning.
189
+ *
190
+ * Keyed by provider ref, exactly as the application catalog is, so a collision
191
+ * with an application-declared ref is detectable — and REFUSED — at
192
+ * registration rather than resolved by a precedence rule nobody reads.
193
+ */
194
+ localProviders: z.record(z.string().min(1), z.record(z.string().min(1), z.unknown())).optional(),
195
+ mode: z.enum(['always-up', 'cron']),
196
+ /** Cron expression (required iff `mode === 'cron'`). */
197
+ schedule: z.string().min(1).optional(),
198
+ // `.prefault({})` (NOT `.default({})`) so the empty input flows
199
+ // through the inner schema and the field defaults are applied —
200
+ // Zod v4's `.default(x)` returns `x` as-is without re-parsing.
201
+ // See the matching JSDoc on `define-worker-config.ts > http` for
202
+ // the rationale.
203
+ reinstantiation: MinionReinstantiationSchema.prefault({}),
204
+ replicas: z.literal(1).default(1),
205
+ liveness: MinionLivenessSchema.prefault({}),
11
206
  resources: ResourceLimitsSchema.optional(),
12
- providers: z.record(z.string(), z.object({
13
- required: z.boolean().default(true),
14
- })).optional(),
15
- dataAccess: DataAccessSchema.optional(),
207
+ // `.prefault({})` for the same reason as `reinstantiation`/`liveness`: the
208
+ // empty input must flow through the inner schema so the field defaults apply.
209
+ // NOT `.optional()` — an absent `isolation` block must still produce the
210
+ // secure uid/gid/pids defaults, because "authored nothing" is the common case
211
+ // and it is exactly the case that must come out hardened.
212
+ isolation: MinionIsolationSchema.prefault({}),
213
+ }).superRefine((cfg, ctx) => {
214
+ if (cfg.mode === 'cron' && !cfg.schedule) {
215
+ ctx.addIssue({
216
+ code: 'custom',
217
+ path: ['schedule'],
218
+ message: "schedule is required when mode === 'cron' (a cron minion without a schedule is a no-op).",
219
+ });
220
+ }
221
+ refineRuntimeIsolation(cfg.isolation, ctx);
222
+ if (cfg.mode === 'always-up' && cfg.schedule) {
223
+ ctx.addIssue({
224
+ code: 'custom',
225
+ path: ['schedule'],
226
+ message: "schedule must be omitted when mode === 'always-up' (the always-up loop is the single tick source; " +
227
+ 'authoring a cron expression on top would create two competing schedulers).',
228
+ });
229
+ }
16
230
  });
17
231
  /**
18
- * Define a minion (scheduled task / cron agent) configuration.
19
- * Minions run on a schedule and can access data services and providers.
232
+ * Define a minion (long-running actor host or scheduled tick) configuration.
233
+ *
234
+ * Minions have NO inbound HTTP surface (KD-1) and are SINGLETONS
235
+ * (`replicas: 1`, KD-8). The full v1 architectural rationale is in
236
+ * `.cursor/plans/minions-and-workers-implementation.md`.
20
237
  */
21
238
  export function defineMinionConfig(config) {
22
239
  return WildoMinionConfigSchema.parse(config);
23
240
  }
24
- //# sourceMappingURL=define-minion-config.js.map
241
+ //# sourceMappingURL=define-minion-config.js.map