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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  2. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  3. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +24 -1
  4. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  5. package/dist/esm/bootstrap/bootstrap.contracts.js +25 -0
  6. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  7. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +117 -1
  8. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  9. package/dist/esm/bootstrap/bootstrap.schemas.js +63 -4
  10. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  11. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +24 -1
  12. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  13. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +24 -0
  14. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  15. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +37 -0
  16. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -0
  17. package/dist/esm/bootstrap/platform-store-preconnect.js +43 -0
  18. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -0
  19. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  20. package/dist/esm/bootstrap/runtime-backing-service-access.js +8 -4
  21. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  22. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  23. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  24. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  25. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
  26. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  27. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +36 -3
  28. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  29. package/dist/esm/bootstrap/runtime-topology.contracts.js +36 -13
  30. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  31. package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts +29 -0
  32. package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
  33. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js +39 -0
  34. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  35. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  36. package/dist/esm/config-authoring.entry.js.map +1 -1
  37. package/dist/esm/index.d.ts +2 -0
  38. package/dist/esm/index.d.ts.map +1 -1
  39. package/dist/esm/index.js +2 -0
  40. package/dist/esm/index.js.map +1 -1
  41. package/dist/esm/lockfile/build-parallelism.d.ts +40 -0
  42. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -0
  43. package/dist/esm/lockfile/build-parallelism.js +64 -0
  44. package/dist/esm/lockfile/build-parallelism.js.map +1 -0
  45. package/dist/esm/lockfile/lockfile-io.d.ts +7 -1
  46. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  47. package/dist/esm/lockfile/lockfile-io.js +17 -3
  48. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  49. package/dist/esm/lockfile/materialize-infra-section.d.ts +28 -7
  50. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  51. package/dist/esm/lockfile/materialize-infra-section.js +24 -11
  52. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  53. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +455 -6
  54. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  55. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +27 -0
  56. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  57. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts +13 -0
  58. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -0
  59. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +56 -0
  60. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -0
  61. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  62. package/dist/esm/project-config/define-infra-env-config.d.ts +886 -29
  63. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  64. package/dist/esm/project-config/define-infra-env-config.js +395 -16
  65. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  66. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  67. package/dist/esm/project-config/define-minion-config.js +1 -2
  68. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  69. package/dist/esm/project-config/define-saas-config.d.ts +142 -25
  70. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  71. package/dist/esm/project-config/define-saas-config.js +229 -26
  72. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  73. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  74. package/dist/esm/project-config/hosted-infra-env-config.d.ts +59 -0
  75. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -0
  76. package/dist/esm/project-config/hosted-infra-env-config.js +187 -0
  77. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -0
  78. package/dist/esm/project-config/index.d.ts +6 -0
  79. package/dist/esm/project-config/index.d.ts.map +1 -1
  80. package/dist/esm/project-config/index.js +6 -0
  81. package/dist/esm/project-config/index.js.map +1 -1
  82. package/dist/esm/project-config/loader.d.ts +35 -0
  83. package/dist/esm/project-config/loader.d.ts.map +1 -1
  84. package/dist/esm/project-config/loader.js +148 -8
  85. package/dist/esm/project-config/loader.js.map +1 -1
  86. package/dist/esm/project-config/npm-version-range.d.ts +23 -0
  87. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -0
  88. package/dist/esm/project-config/npm-version-range.js +175 -0
  89. package/dist/esm/project-config/npm-version-range.js.map +1 -0
  90. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
  91. package/dist/esm/project-config/provider-companion-discovery.d.ts +288 -30
  92. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  93. package/dist/esm/project-config/provider-companion-discovery.js +795 -46
  94. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  95. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +192 -20
  96. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  97. package/dist/esm/project-config/provider-runtime-artifacts.js +381 -42
  98. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  99. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  100. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  101. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  102. package/dist/esm/project-config/shared/auth.schemas.d.ts +14 -35
  103. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  104. package/dist/esm/project-config/shared/auth.schemas.js +14 -35
  105. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  106. package/dist/esm/project-config/shared/backing-service-servability.d.ts +157 -0
  107. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -0
  108. package/dist/esm/project-config/shared/backing-service-servability.js +256 -0
  109. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -0
  110. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +66 -66
  111. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  112. package/dist/esm/project-config/shared/backing-services.schemas.js +75 -67
  113. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  114. package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -1
  115. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  116. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  117. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  118. package/dist/esm/project-config/shared/csp-emit.js +41 -2
  119. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  120. package/dist/esm/project-config/shared/csp.schemas.d.ts +11 -12
  121. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  122. package/dist/esm/project-config/shared/csp.schemas.js +11 -12
  123. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  124. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  125. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  126. package/dist/esm/project-config/shared/environment.schemas.d.ts +152 -12
  127. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  128. package/dist/esm/project-config/shared/environment.schemas.js +186 -9
  129. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  130. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +185 -10
  131. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  132. package/dist/esm/project-config/shared/infra-providers.schemas.js +40 -3
  133. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  134. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
  135. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  136. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  137. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  138. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  139. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  140. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  141. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +77 -47
  142. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  143. package/dist/esm/project-config/shared/minion-resource-access.validation.js +114 -52
  144. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  145. package/dist/esm/project-config/shared/platform-services.schemas.d.ts +50 -0
  146. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  147. package/dist/esm/project-config/shared/platform-services.schemas.js +57 -0
  148. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  149. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +35 -0
  150. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -0
  151. package/dist/esm/project-config/shared/platform-storage.schemas.js +37 -0
  152. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -0
  153. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -1
  154. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  155. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +81 -0
  156. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -0
  157. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js +74 -0
  158. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -0
  159. package/dist/esm/project-config/static-asset-import-noop.d.ts +26 -0
  160. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -0
  161. package/dist/esm/project-config/static-asset-import-noop.js +49 -0
  162. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -0
  163. package/dist/esm/registry/artifact-domain.schemas.d.ts +1 -1
  164. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  165. package/dist/esm/registry/companion-api.schemas.d.ts +0 -176
  166. package/dist/esm/registry/companion-api.schemas.d.ts.map +0 -1
  167. package/dist/esm/registry/companion-api.schemas.js.map +0 -1
  168. package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
  169. package/dist/esm/registry/index.d.ts +3 -1
  170. package/dist/esm/registry/index.d.ts.map +1 -1
  171. package/dist/esm/registry/index.js +3 -1
  172. package/dist/esm/registry/index.js.map +1 -1
  173. package/dist/esm/registry/local-checkout-source.d.ts +31 -0
  174. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -0
  175. package/dist/esm/registry/local-checkout-source.js +45 -0
  176. package/dist/esm/registry/local-checkout-source.js.map +1 -0
  177. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +174 -14
  178. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  179. package/dist/esm/registry/lockfile-modules-section.schemas.js +120 -11
  180. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  181. package/dist/esm/registry/module-artifact.schemas.d.ts +79 -0
  182. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  183. package/dist/esm/registry/module-artifact.schemas.js +36 -0
  184. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  185. package/dist/esm/registry/module-manifest.schemas.d.ts +403 -23
  186. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  187. package/dist/esm/registry/module-manifest.schemas.js +502 -60
  188. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  189. package/dist/esm/registry/module-search.schemas.d.ts +80 -0
  190. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -0
  191. package/dist/esm/registry/module-search.schemas.js +112 -0
  192. package/dist/esm/registry/module-search.schemas.js.map +1 -0
  193. package/dist/esm/registry/registry-config.schemas.d.ts +16 -0
  194. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  195. package/dist/esm/registry/registry-config.schemas.js +8 -0
  196. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  197. package/dist/esm/registry/registry-errors.d.ts +126 -2
  198. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  199. package/dist/esm/registry/registry-errors.js +183 -14
  200. package/dist/esm/registry/registry-errors.js.map +1 -1
  201. package/dist/esm/registry/registry-keys.schemas.d.ts +80 -0
  202. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -0
  203. package/dist/esm/registry/registry-keys.schemas.js +68 -0
  204. package/dist/esm/registry/registry-keys.schemas.js.map +1 -0
  205. package/dist/esm/registry/registry-section-schemas.constants.d.ts +25 -3
  206. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  207. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  208. package/dist/esm/release/framework-release.constants.js.map +1 -1
  209. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  210. package/dist/esm/schemas/framework-secrets.schemas.d.ts +12 -1
  211. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  212. package/dist/esm/schemas/framework-secrets.schemas.js +14 -1
  213. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  214. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  215. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  216. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  217. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
  218. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  219. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  220. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +17 -14
  221. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  222. package/dist/esm/workspace-scope/workspace-homes.schemas.js +8 -7
  223. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  224. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts +15 -6
  225. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  226. package/dist/esm/workspace-scope/workspace-scope.schemas.js +23 -9
  227. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  228. package/package.json +7 -7
  229. package/dist/esm/registry/companion-api.schemas.js +0 -165
  230. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"minion-resource-access.validation.js","sourceRoot":"","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AC7G;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {\n CoreResourceType,\n RESOURCE_SHARED_PERSISTENCE_COLLECTION_ALIASES,\n resolveSharedPersistenceCollectionName,\n type ResourceType,\n} from '@wildo-ai/saas-models';\n\n/**\n * The two safety gates that must hold BEFORE a minion's `resourceAccess` may be\n * turned into database grants (Step 3 shared prerequisites, R11 + the F1 guard).\n *\n * Both exist because of the same asymmetry: `resourceAccess` is a RESOURCE-TYPE\n * whitelist, while a database grant is a COLLECTION grant. The two only line up\n * when the mapping between them is injective over the declarable set — and the\n * alias map is exactly where it is not.\n */\n\n/**\n * Resource types a minion may never declare (D15 / R11).\n *\n * A self-door type addresses \"MY row\" — it is meaningless for a principal that\n * has no row. `APPLICATION_MACHINE` carries no `userId`; a minion is not a user\n * and cannot become one. So the rejection is a SEMANTIC rule that happens to\n * also dissolve F1, not a convenience rule adopted because it was easier.\n *\n * That ordering matters for anyone tempted to relax this later. The alias map\n * holds exactly three entries, and all three are self→admin pairs onto the SAME\n * rows. Remove the self doors from the declarable set and resource-type →\n * collection becomes INJECTIVE, which is what lets a grant derived per resource\n * type mean exactly what the author wrote. Relaxing D15 for convenience would\n * silently restore the coarser floor: declaring `USER_SELF` would grant the\n * whole `users` collection — every user's row, through a door that promises\n * only one.\n *\n * Derived from the alias map rather than listed, so a fourth self door added\n * there is forbidden here on the same commit instead of quietly becoming\n * declarable.\n */\nexport const MINION_FORBIDDEN_SELF_DOOR_RESOURCE_TYPES: readonly string[] =\n Object.keys(RESOURCE_SHARED_PERSISTENCE_COLLECTION_ALIASES);\n\n/** One reason a `resourceAccess` declaration cannot be turned into grants. */\nexport interface MinionResourceAccessViolation {\n /** `read` or `write` — the axis the offending entry was declared on. */\n readonly axis: 'read' | 'write';\n readonly resourceType: string;\n /** Operator-facing explanation naming the consequence and the fix. */\n readonly message: string;\n}\n\n/**\n * Reject self-door types, and refuse any declaration whose types collapse onto\n * one collection.\n *\n * Returns every violation rather than throwing on the first: an author fixing a\n * config wants the whole list, and a caller that wants to fail closed can do so\n * on a non-empty result.\n *\n * ## The injectivity check is NOT redundant with the self-door rejection\n *\n * It is tempting to think removing the self doors makes collisions impossible —\n * that is true of TODAY's alias map and is exactly why this must be checked\n * rather than assumed. The alias map is data: a future entry that aliases two\n * ADMIN types onto one collection would reintroduce the collapse without\n * touching a self door, and the grant derived for one type would silently carry\n * the other's rows. Failing closed here makes that a build failure instead of a\n * containment that quietly widened.\n */\nexport function findMinionResourceAccessViolations(resourceAccess: {\n read?: readonly string[] | undefined;\n write?: readonly string[] | undefined;\n}): MinionResourceAccessViolation[] {\n const violations: MinionResourceAccessViolation[] = [];\n const axes: Array<['read' | 'write', readonly string[]]> = [\n ['read', resourceAccess.read ?? []],\n ['write', resourceAccess.write ?? []],\n ];\n\n for (const [axis, declared] of axes) {\n for (const resourceType of declared) {\n if (MINION_FORBIDDEN_SELF_DOOR_RESOURCE_TYPES.includes(resourceType)) {\n violations.push({\n axis,\n resourceType,\n message:\n `'${resourceType}' is a SELF door and cannot be granted to a minion (D15). `\n + 'A self door addresses \"my row\", and a minion has no row — it is a machine principal '\n + `carrying no userId. Granting it would give access to the whole `\n + `'${resolveSharedPersistenceCollectionName(resourceType as ResourceType)}' collection — `\n + 'every user\\'s row — through a door that promises only one. Declare the ADMIN resource '\n + 'type explicitly if the minion genuinely needs that breadth.',\n });\n }\n }\n\n // Injectivity, per AXIS: two declared types resolving to one collection make\n // the derived grant wider than either declaration reads.\n const collectionOwners = new Map<string, string>();\n for (const resourceType of declared) {\n const collection = resolveSharedPersistenceCollectionName(resourceType as ResourceType);\n const existing = collectionOwners.get(collection);\n if (existing !== undefined && existing !== resourceType) {\n violations.push({\n axis,\n resourceType,\n message:\n `'${resourceType}' and '${existing}' both resolve to the '${collection}' collection, `\n + 'so a grant derived from either carries the other\\'s rows. Refusing to derive grants '\n + 'from a declaration whose types are not injective over collections (F1 guard) — '\n + 'declare exactly one of them.',\n });\n continue;\n }\n collectionOwners.set(collection, resourceType);\n }\n }\n\n return violations;\n}\n\n/**\n * What a minion may touch, per axis — expressed in RESOURCE TYPES, the\n * vocabulary the rest of the platform speaks.\n *\n * ## Why not collection names\n *\n * An earlier revision returned collection names, which quietly made storage the\n * API of a security decision. `resourceAccess` is AUTHORED in resource types,\n * `ResourceType` is what every other Wildo surface passes around, and a\n * collection is one adapter's rendering of where those rows happen to live —\n * MongoDB calls it a collection, PostgreSQL a table, and a future adapter will\n * call it something else again. Naming the security contract after one of them\n * would force every reader to translate back, and would make the grant set look\n * different depending on which database an application chose.\n *\n * The translation therefore happens at the ADAPTER boundary — see\n * {@link resolveGrantStorageNames} — which is the only place that legitimately\n * knows about storage, exactly as external protocol literals are confined to the\n * thin adapter that speaks them.\n *\n * `null` means **no access was declared at all**, which is NOT the same as an\n * empty declaration and must not be flattened into one. Absent ⇒ mint no\n * database user whatsoever (D11 / R3: application-data access is an OPTIONAL\n * capability). Declared-but-empty ⇒ the author asked for a principal with no\n * access, a different and legitimate statement. One \"empty list\" for both would\n * make \"I forgot\" indistinguishable from \"I meant none\".\n */\nexport interface MinionResourceGrants {\n readonly read: readonly ResourceType[];\n readonly write: readonly ResourceType[];\n}\n\n/**\n * Derive a minion's grants from an authored `resourceAccess`.\n *\n * ## `write` does NOT imply `read`, deliberately\n *\n * It is tempting to add read wherever write is granted — most write paths in the\n * backend pipeline do read first (validation, FK resolution, read-modify-write),\n * so a `write: ['todos']` minion will often need `read: ['todos']` too.\n *\n * It is still refused, for the reason this entire workstream exists: a grant the\n * author did not write is a grant nobody reviewed. An insert-only minion is a\n * real shape, and silently widening every writer to a reader would make the\n * declaration stop describing the outcome — the precise property that made\n * `resourceAccess` non-binding before it produced real credentials.\n *\n * The cost is stated rather than hidden: a minion that writes without declaring\n * read will fail at RUNTIME on its first read, with the database naming the\n * action it lacked. A loud, local failure with an obvious fix (declare the read)\n * is the trade this prefers over a silent widening.\n *\n * ## The F2 transitive read path is the CALLER's to supply\n *\n * A declared type can pull in others through nested reads — the closure rule is\n * *declared ∪ child-direction targets declaring nested `onRead`, transitively*.\n * Computing it needs the resource graph, which this layer does not have, so it\n * arrives as `transitiveReadResourceTypes`. Omitting it is correct ONLY when the\n * application declares no nested `onRead` (true of Wonder Todos, measured\n * 2026-08-05); omitting it elsewhere yields a credential that is denied on a\n * path which works today.\n */\nexport function deriveMinionResourceGrants(\n resourceAccess: { read?: readonly string[] | undefined; write?: readonly string[] | undefined } | undefined,\n transitiveReadResourceTypes: readonly string[] = [],\n): MinionResourceGrants | null {\n if (!resourceAccess) return null;\n\n const violations = findMinionResourceAccessViolations(resourceAccess);\n if (violations.length > 0) {\n // Fail closed. Reaching here means the parse-time gate was bypassed (a\n // hand-built object, a future caller); deriving anyway would issue exactly\n // the over-broad grant those gates exist to refuse.\n throw new Error(\n `Refusing to derive minion resource grants from an invalid resourceAccess: `\n + violations.map((violation) => `[${violation.axis}] ${violation.message}`).join(' '),\n );\n }\n\n // Deduped and ordered so a grant set is stable between syncs — an unstable\n // one reads as a change and would re-issue credentials for nothing.\n const normalize = (resourceTypes: readonly string[]): ResourceType[] =>\n [...new Set(resourceTypes)].sort() as ResourceType[];\n\n return {\n read: normalize([...(resourceAccess.read ?? []), ...transitiveReadResourceTypes]),\n write: normalize(resourceAccess.write ?? []),\n };\n}\n\n/**\n * Translate a grant axis into the STORAGE names one adapter will grant on.\n *\n * The single, explicitly-named boundary between the platform vocabulary and a\n * database dialect. A Mongo module builds collection privileges from it; a\n * PostgreSQL module builds table grants; both call the same function so the two\n * cannot disagree about which rows a resource type addresses.\n *\n * Safe to collapse duplicates here ONLY because the F1 guard already refused any\n * declaration whose types share a collection — see\n * {@link findMinionResourceAccessViolations}. Without that guarantee this\n * function would silently merge two declarations into one grant.\n */\nexport function resolveGrantStorageNames(resourceTypes: readonly ResourceType[]): string[] {\n return [...new Set(resourceTypes.map((resourceType) => resolveSharedPersistenceCollectionName(resourceType)))].sort();\n}\n\n/**\n * What the ENGINE reads and writes for every runtime principal, whatever that\n * principal declared — the floor a database role must hold before any authored\n * `resourceAccess` is considered at all.\n *\n * ## Why this is not declarable, and must not become so\n *\n * `resourceAccess` answers \"what application data may this minion touch\". These\n * two entries answer a different question: \"what does the framework itself touch\n * in order to run a repository operation at all\". No author decides them, no\n * author can opt out of them, and asking one to write them down would be asking\n * a human for an answer the mechanism already knows — the exact shape\n * `.claude/rules/derive-before-you-ask.md` refuses. They are derived here, once,\n * from the engine paths that actually perform them:\n *\n * - **`APPLICATION`, read.** `ExecutionContextCreatorBackendService.getApplicationId`\n * resolves the singleton APPLICATION row for EVERY `ResourcePrimaryScope.APPLICATION`\n * operation, through `repositoriesRegistry` directly. That read is structural:\n * a minion declaring `read: ['todos']` is declaring an APPLICATION-scoped read,\n * so it triggers this one before it ever reaches `todos`.\n * - **`AUDIT_LOGS`, append.** `AuditLogsBackendService` writes one row per audited\n * operation, including the `system_context_read` it emits for the read above.\n *\n * Both bypass the in-process `resourceAccess` whitelist by construction —\n * `MinionScopedServicesRegistryHandlerBackendService` decorates the minion's\n * SERVICES registry, and these go through the repositories registry — so the\n * database grant was the only gate they ever met, and it refused them. That\n * asymmetry is the defect: the in-process policy already permits these reads,\n * and the credential did not.\n *\n * ## Why AUDIT_LOGS is APPEND and not WRITE\n *\n * The `write` axis grants `INSERT, UPDATE, DELETE`. Putting the audit table there\n * would let every minion rewrite or delete the evidence of its own actions, which\n * is not a smaller version of the right answer — it is the opposite of one. An\n * audit trail a principal can delete is not an audit trail. The append axis exists\n * so this floor can be satisfied without handing out that capability.\n *\n * assurance-control: WILDO.AUDIT.TAMPER_RESISTANCE — a runtime principal may add\n * audit rows and may never modify or remove them.\n */\nexport const MINION_ENGINE_MANDATORY_READ_RESOURCE_TYPES: readonly ResourceType[] =\n [CoreResourceType.APPLICATION] as unknown as readonly ResourceType[];\n\n/** @see MINION_ENGINE_MANDATORY_READ_RESOURCE_TYPES — the append-only half. */\nexport const MINION_ENGINE_MANDATORY_APPEND_RESOURCE_TYPES: readonly ResourceType[] =\n [CoreResourceType.AUDIT_LOGS] as unknown as readonly ResourceType[];\n\n/**\n * A minion's grants as a DATABASE role must hold them: what the author declared,\n * plus the engine floor above.\n *\n * The third axis is what keeps the floor honest — see\n * {@link MINION_ENGINE_MANDATORY_READ_RESOURCE_TYPES}.\n */\nexport interface MinionDatabaseGrants {\n readonly read: readonly ResourceType[];\n readonly write: readonly ResourceType[];\n /** Insert-only. Never update, never delete. */\n readonly append: readonly ResourceType[];\n}\n\n/**\n * Add the engine floor to an authored derivation — the ONE place database grants\n * acquire it.\n *\n * ## Why here and not in {@link deriveMinionResourceGrants}\n *\n * That function answers \"what did the author declare\", and it has a THIRD\n * consumer that must not receive this floor: the object-storage credential path\n * turns the same grants into blob key prefixes. Widening it there would confine a\n * minion's storage credential to an `applications/` prefix nobody asked for and\n * nothing writes. The floor is a property of holding a DATABASE role, so it is\n * applied at the boundary where a database role is minted — and both database\n * adapters call this one function, so they cannot drift apart the way the mint\n * and revoke halves of those adapters already have once\n * (`.claude/rules/invariant-call-site-enumeration.md` #18).\n *\n * Idempotent: a floor entry the author also declared appears once.\n */\nexport function deriveMinionDatabaseGrants(grants: MinionResourceGrants): MinionDatabaseGrants {\n const normalize = (resourceTypes: readonly ResourceType[]): ResourceType[] =>\n [...new Set(resourceTypes)].sort();\n\n // A floor entry the author declared on a WIDER axis keeps that axis rather than\n // being demoted: declaring `write: ['auditLogs']` is an explicit, reviewed\n // decision, and silently narrowing it here would make the declaration stop\n // describing the outcome.\n const declaredElsewhere = new Set<string>([...grants.read, ...grants.write]);\n\n return {\n read: normalize([...grants.read, ...MINION_ENGINE_MANDATORY_READ_RESOURCE_TYPES]),\n write: normalize(grants.write),\n append: normalize(\n MINION_ENGINE_MANDATORY_APPEND_RESOURCE_TYPES.filter((resourceType) => !declaredElsewhere.has(resourceType)),\n ),\n };\n}\n"]}
1
+ {"version":3,"file":"minion-resource-access.validation.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/minion-resource-access.validation.ts"],"names":[],"mappings":"AAAA,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Y,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAC3G;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {\n CoreResourceType,\n RESOURCE_SHARED_PERSISTENCE_COLLECTION_ALIASES,\n RuntimePrincipalDatabaseGrantAxis,\n resolveSharedPersistenceCollectionName,\n type ResourceType,\n} from '@wildo-ai/saas-models';\n\n/**\n * The two safety gates that must hold BEFORE a minion's `resourceAccess` may be\n * turned into database grants (Step 3 shared prerequisites, R11 + the F1 guard).\n *\n * Both exist because of the same asymmetry: `resourceAccess` is a RESOURCE-TYPE\n * whitelist, while a database grant is a COLLECTION grant. The two only line up\n * when the mapping between them is injective over the declarable set — and the\n * alias map is exactly where it is not.\n */\n\n/**\n * Resource types a minion may never declare (D15 / R11) — every ALIASED door.\n *\n * An aliased door is a resource type whose rows live in ANOTHER resource type's\n * collection (`RESOURCE_SHARED_PERSISTENCE_COLLECTION_ALIASES`). It is always the\n * NARROWER of the two doors, and a database grant cannot be narrower than a\n * collection — so a grant derived from the narrow door carries the wide one.\n *\n * The alias map holds two KINDS of narrow door, and both are refused for that\n * same reason while differing in why they are narrow:\n *\n * - **self doors** (`USER_SELF`, `USER_SELF_PROFILES`, `USER_SELF_PREFERENCES`)\n * address \"MY row\". They are additionally meaningless for a minion:\n * `APPLICATION_MACHINE` carries no `userId`, so there is no row to be \"mine\".\n * Declaring `USER_SELF` would grant the whole `users` collection — every user's\n * row, through a door that promises one.\n * - **subset doors** (`APPLICATION_AUDIT_LOGS`, #317) see a different SUBSET of a\n * shared record set. The application audit door and the organization audit door\n * read one trail; a grant derived from either carries the entire trail.\n *\n * This constant was named `MINION_FORBIDDEN_SELF_DOOR_RESOURCE_TYPES` while the\n * map held only self doors, and kept that name — and a refusal message calling\n * every entry a self door — after the audit door joined it (#458). The rule was\n * never \"self doors are forbidden\"; it is \"a grant must not be wider than the\n * declaration reads\", and the name now says that.\n *\n * Removing every aliased door from the declarable set is also what makes\n * resource-type → collection INJECTIVE, so a grant derived per resource type means\n * exactly what the author wrote. Relaxing it for convenience silently restores\n * the coarser floor.\n *\n * Derived from the alias map rather than listed, so an alias added there is\n * forbidden here on the same commit instead of quietly becoming declarable — and\n * the pin in `minion-resource-access.validation.test.ts` forces that addition to\n * be reviewed rather than absorbed.\n */\nexport const MINION_FORBIDDEN_ALIASED_DOOR_RESOURCE_TYPES: readonly string[] =\n Object.keys(RESOURCE_SHARED_PERSISTENCE_COLLECTION_ALIASES);\n\n/** One reason a `resourceAccess` declaration cannot be turned into grants. */\nexport interface MinionResourceAccessViolation {\n /** The AUTHORED axis the offending entry was declared on — `resourceAccess` has only these two. */\n readonly axis: RuntimePrincipalDatabaseGrantAxis.READ | RuntimePrincipalDatabaseGrantAxis.WRITE;\n readonly resourceType: string;\n /** Operator-facing explanation naming the consequence and the fix. */\n readonly message: string;\n}\n\n/**\n * Reject aliased-door types, and refuse any declaration whose types collapse onto\n * one collection.\n *\n * Returns every violation rather than throwing on the first: an author fixing a\n * config wants the whole list, and a caller that wants to fail closed can do so\n * on a non-empty result.\n *\n * ## The injectivity check is NOT redundant with the aliased-door rejection\n *\n * It is tempting to think removing the aliased doors makes collisions impossible —\n * that is true of TODAY's alias map and is exactly why this must be checked\n * rather than assumed. The alias map is data: a future entry that aliases two\n * types a minion MAY declare onto one collection would reintroduce the collapse,\n * and the grant derived for one type would silently carry the other's rows.\n * Failing closed here makes that a build failure instead of a containment that\n * quietly widened.\n */\nexport function findMinionResourceAccessViolations(resourceAccess: {\n read?: readonly string[] | undefined;\n write?: readonly string[] | undefined;\n}): MinionResourceAccessViolation[] {\n const violations: MinionResourceAccessViolation[] = [];\n const axes: Array<[MinionResourceAccessViolation['axis'], readonly string[]]> = [\n [RuntimePrincipalDatabaseGrantAxis.READ, resourceAccess.read ?? []],\n [RuntimePrincipalDatabaseGrantAxis.WRITE, resourceAccess.write ?? []],\n ];\n\n // An APPEND-ONLY floor entry may not be widened to WRITE by declaration. Refused here, at parse\n // time, rather than honoured downstream: the write axis carries DELETE, so `write: ['auditLogs']`\n // is not a broader version of the audit floor — it is the one grant that lets a principal remove\n // the evidence of what it did. This used to be permitted as \"an explicit, reviewed decision\", and\n // the grant derivation kept the declared axis; but a declaration nobody is forced to justify is not\n // a review, and the property the append axis exists for held only until somebody typed one word.\n // Derived from the floor itself, so a type added to the append floor tomorrow is refused on write\n // on the same commit.\n for (const resourceType of resourceAccess.write ?? []) {\n if ((MINION_ENGINE_MANDATORY_APPEND_RESOURCE_TYPES as readonly string[]).includes(resourceType)) {\n violations.push({\n axis: RuntimePrincipalDatabaseGrantAxis.WRITE,\n resourceType,\n message:\n `'${resourceType}' cannot be declared on a minion's write axis: the engine already grants it APPEND-only `\n + '(insert, never update or delete), and a write grant would let this minion modify or remove rows it '\n + 'appended — for the audit trail, the evidence of its own actions. Remove it from `write`; appending '\n + 'needs no declaration.',\n });\n }\n }\n\n for (const [axis, declared] of axes) {\n for (const resourceType of declared) {\n if (MINION_FORBIDDEN_ALIASED_DOOR_RESOURCE_TYPES.includes(resourceType)) {\n // The message names only what is true of EVERY aliased door: the collection\n // it shares and the wider type that owns it. An earlier message called each\n // entry a \"SELF door … every user's row\", which was false for the audit door.\n const widerResourceType = RESOURCE_SHARED_PERSISTENCE_COLLECTION_ALIASES[resourceType]!;\n const collection = resolveSharedPersistenceCollectionName(resourceType as ResourceType);\n violations.push({\n axis,\n resourceType,\n message:\n `'${resourceType}' is an ALIASED door and cannot be granted to a minion (D15): its rows live in the `\n + `'${collection}' collection it shares with '${widerResourceType}'. A database grant is issued per `\n + `collection, so granting '${resourceType}' would reach every row '${widerResourceType}' addresses — `\n + `wider than the door '${resourceType}' promises. Declare '${widerResourceType}' explicitly if the `\n + 'minion genuinely needs that breadth.',\n });\n }\n }\n\n // Injectivity, per AXIS: two declared types resolving to one collection make\n // the derived grant wider than either declaration reads.\n const collectionOwners = new Map<string, string>();\n for (const resourceType of declared) {\n const collection = resolveSharedPersistenceCollectionName(resourceType as ResourceType);\n const existing = collectionOwners.get(collection);\n if (existing !== undefined && existing !== resourceType) {\n violations.push({\n axis,\n resourceType,\n message:\n `'${resourceType}' and '${existing}' both resolve to the '${collection}' collection, `\n + 'so a grant derived from either carries the other\\'s rows. Refusing to derive grants '\n + 'from a declaration whose types are not injective over collections (F1 guard) — '\n + 'declare exactly one of them.',\n });\n continue;\n }\n collectionOwners.set(collection, resourceType);\n }\n }\n\n return violations;\n}\n\n/**\n * What a minion may touch, per axis — expressed in RESOURCE TYPES, the\n * vocabulary the rest of the platform speaks.\n *\n * ## Why not collection names\n *\n * An earlier revision returned collection names, which quietly made storage the\n * API of a security decision. `resourceAccess` is AUTHORED in resource types,\n * `ResourceType` is what every other Wildo surface passes around, and a\n * collection is one adapter's rendering of where those rows happen to live —\n * MongoDB calls it a collection, PostgreSQL a table, and a future adapter will\n * call it something else again. Naming the security contract after one of them\n * would force every reader to translate back, and would make the grant set look\n * different depending on which database an application chose.\n *\n * The translation therefore happens at the ADAPTER boundary — see\n * {@link resolveGrantStorageNames} — which is the only place that legitimately\n * knows about storage, exactly as external protocol literals are confined to the\n * thin adapter that speaks them.\n *\n * `null` means **no access was declared at all**, which is NOT the same as an\n * empty declaration and must not be flattened into one. Absent ⇒ no authored business-data access. The database credential owner\n * separately supplies the mandatory runtime floor; object storage must not receive\n * that floor. Declared-but-empty remains an explicit author decision. One \"empty list\" for both would\n * make \"I forgot\" indistinguishable from \"I meant none\".\n */\nexport interface MinionResourceGrants {\n readonly read: readonly ResourceType[];\n readonly write: readonly ResourceType[];\n}\n\n/**\n * Derive a minion's grants from an authored `resourceAccess`.\n *\n * ## `write` does NOT imply `read`, deliberately\n *\n * It is tempting to add read wherever write is granted — most write paths in the\n * backend pipeline do read first (validation, FK resolution, read-modify-write),\n * so a `write: ['todos']` minion will often need `read: ['todos']` too.\n *\n * It is still refused, for the reason this entire workstream exists: a grant the\n * author did not write is a grant nobody reviewed. An insert-only minion is a\n * real shape, and silently widening every writer to a reader would make the\n * declaration stop describing the outcome — the precise property that made\n * `resourceAccess` non-binding before it produced real credentials.\n *\n * The cost is stated rather than hidden: a minion that writes without declaring\n * read will fail at RUNTIME on its first read, with the database naming the\n * action it lacked. A loud, local failure with an obvious fix (declare the read)\n * is the trade this prefers over a silent widening.\n *\n * ## The F2 transitive read path is the CALLER's to supply\n *\n * A declared type can pull in others through nested reads — the closure rule is\n * *declared ∪ child-direction targets declaring nested `onRead`, transitively*.\n * Computing it needs the resource graph, which this layer does not have, so it\n * arrives as `transitiveReadResourceTypes`. Omitting it is correct ONLY when the\n * application declares no nested `onRead` (true of Wonder Todos, measured\n * 2026-08-05); omitting it elsewhere yields a credential that is denied on a\n * path which works today.\n */\nexport function deriveMinionResourceGrants(\n resourceAccess: { read?: readonly string[] | undefined; write?: readonly string[] | undefined } | undefined,\n transitiveReadResourceTypes: readonly string[] = [],\n): MinionResourceGrants | null {\n if (!resourceAccess) return null;\n\n const violations = findMinionResourceAccessViolations(resourceAccess);\n if (violations.length > 0) {\n // Fail closed. Reaching here means the parse-time gate was bypassed (a\n // hand-built object, a future caller); deriving anyway would issue exactly\n // the over-broad grant those gates exist to refuse.\n throw new Error(\n `Refusing to derive minion resource grants from an invalid resourceAccess: `\n + violations.map((violation) => `[${violation.axis}] ${violation.message}`).join(' '),\n );\n }\n\n // Deduped and ordered so a grant set is stable between syncs — an unstable\n // one reads as a change and would re-issue credentials for nothing.\n const normalize = (resourceTypes: readonly string[]): ResourceType[] =>\n [...new Set(resourceTypes)].sort() as ResourceType[];\n\n return {\n read: normalize([...(resourceAccess.read ?? []), ...transitiveReadResourceTypes]),\n write: normalize(resourceAccess.write ?? []),\n };\n}\n\n/**\n * Translate a grant axis into the STORAGE names one adapter will grant on.\n *\n * The single, explicitly-named boundary between the platform vocabulary and a\n * database dialect. A Mongo module builds collection privileges from it; a\n * PostgreSQL module builds table grants; both call the same function so the two\n * cannot disagree about which rows a resource type addresses.\n *\n * Safe to collapse duplicates here ONLY because the F1 guard already refused any\n * declaration whose types share a collection — see\n * {@link findMinionResourceAccessViolations}. Without that guarantee this\n * function would silently merge two declarations into one grant.\n */\nexport function resolveGrantStorageNames(resourceTypes: readonly ResourceType[]): string[] {\n return [...new Set(resourceTypes.map((resourceType) => resolveSharedPersistenceCollectionName(resourceType)))].sort();\n}\n\n/**\n * What the ENGINE reads and writes for every runtime principal, whatever that\n * principal declared — the floor a database role must hold before any authored\n * `resourceAccess` is considered at all.\n *\n * ## Why this is not declarable, and must not become so\n *\n * `resourceAccess` answers \"what application data may this minion touch\". These\n * entries answer a different question: \"what does the framework itself touch\n * in order to run a repository operation at all\". No author decides them, no\n * author can opt out of them, and asking one to write them down would be asking\n * a human for an answer the mechanism already knows — the exact shape\n * `.claude/rules/derive-before-you-ask.md` refuses. They are derived here, once,\n * from the engine paths that actually perform them:\n *\n * - **`APPLICATION`, read.** `ExecutionContextCreatorBackendService.getApplicationId`\n * resolves the singleton APPLICATION row for EVERY `ResourcePrimaryScope.APPLICATION`\n * operation, through `repositoriesRegistry` directly. That read is structural:\n * a minion declaring `read: ['todos']` is declaring an APPLICATION-scoped read,\n * so it triggers this one before it ever reaches `todos`.\n * - **`AUDIT_LOGS`, append.** `AuditLogsBackendService` writes one row per audited\n * operation, including the `system_context_read` it emits for the read above.\n * - **`JOB_EXECUTIONS`, read/maintain.** Scheduled receipt, atomic admission,\n * heartbeat and recovery update durable history, including after a restart.\n * - **`JOB_PAYLOAD_STORAGE`, read/append.** Recovery retains completed output\n * without granting the principal permission to rewrite or delete that output.\n *\n * These framework operations bypass the in-process `resourceAccess` whitelist by construction —\n * `MinionScopedServicesRegistryHandlerBackendService` decorates the minion's\n * SERVICES registry, and these go through the repositories registry — so the\n * database grant was the only gate they ever met, and it refused them. That\n * asymmetry is the defect: the in-process policy already permits these reads,\n * and the credential did not.\n *\n * ## Why AUDIT_LOGS is APPEND and not WRITE\n *\n * The `write` axis grants `INSERT, UPDATE, DELETE`. Putting the audit table there\n * would let every minion rewrite or delete the evidence of its own actions, which\n * is not a smaller version of the right answer — it is the opposite of one. An\n * audit trail a principal can delete is not an audit trail. The append axis exists\n * so this floor can be satisfied without handing out that capability.\n *\n * ## What this does NOT cover\n *\n * Named runtime principals only. The APPLICATION BACKEND is issued a database-owning\n * credential on every adapter (PostgreSQL `ALL PRIVILEGES`, MongoDB `readWrite` +\n * `dbAdmin`, Atlas `readWrite`), so nothing at the database layer stops the backend's\n * own credential from amending an audit row; for the backend, audit immutability is\n * the application layer's — `AUDIT_LOGS` exposes no update or delete operation. And\n * only the SELF-MANAGED adapters issue a per-principal credential at all.\n *\n * assurance-control: WILDO.AUDIT.TAMPER_RESISTANCE — a named runtime principal may add\n * audit rows and may never modify or remove them, and may not be granted otherwise.\n */\nexport const MINION_ENGINE_MANDATORY_READ_RESOURCE_TYPES: readonly ResourceType[] =\n [CoreResourceType.APPLICATION, CoreResourceType.JOB_EXECUTIONS, CoreResourceType.JOB_PAYLOAD_STORAGE] as unknown as readonly ResourceType[];\n\n/** @see MINION_ENGINE_MANDATORY_READ_RESOURCE_TYPES — the append-only floor. */\nexport const MINION_ENGINE_MANDATORY_APPEND_RESOURCE_TYPES: readonly ResourceType[] =\n [CoreResourceType.AUDIT_LOGS, CoreResourceType.JOB_PAYLOAD_STORAGE] as unknown as readonly ResourceType[];\n\n/** Insert and update durable execution state, without permission to erase its history. */\nexport const MINION_ENGINE_MANDATORY_MAINTAIN_RESOURCE_TYPES: readonly ResourceType[] =\n [CoreResourceType.JOB_EXECUTIONS] as unknown as readonly ResourceType[];\n\n/**\n * A minion's grants as a DATABASE role must hold them: what the author declared,\n * plus the engine floor above — one resource-type list per\n * {@link RuntimePrincipalDatabaseGrantAxis}, whose members document each axis's verbs.\n *\n * Mapped over the axis vocabulary rather than spelled out, so an axis added there is a compile error\n * at every site that builds or consumes one of these until it is handled.\n *\n * Separate append and maintain axes keep the floor honest — see\n * {@link MINION_ENGINE_MANDATORY_READ_RESOURCE_TYPES}.\n */\nexport type MinionDatabaseGrants = {\n readonly [Axis in RuntimePrincipalDatabaseGrantAxis]: readonly ResourceType[];\n};\n\n/**\n * Add the engine floor to an authored derivation — the ONE place database grants\n * acquire it.\n *\n * ## Why here and not in {@link deriveMinionResourceGrants}\n *\n * That function answers \"what did the author declare\", and it has a THIRD\n * consumer that must not receive this floor: the object-storage credential path\n * turns the same grants into blob key prefixes. Widening it there would confine a\n * minion's storage credential to an `applications/` prefix nobody asked for and\n * nothing writes. The floor is a property of holding a DATABASE role, so it is\n * applied at the boundary where a database role is minted — and both database\n * adapters call this one function, so they cannot drift apart the way the mint\n * and revoke halves of those adapters already have once\n * (`.claude/rules/invariant-call-site-enumeration.md` #18).\n *\n * Idempotent: a floor entry the author also declared appears once.\n */\nexport function deriveMinionDatabaseGrants(grants: MinionResourceGrants): MinionDatabaseGrants {\n const normalize = (resourceTypes: readonly ResourceType[]): ResourceType[] =>\n [...new Set(resourceTypes)].sort();\n\n const declaredWrite = new Set<string>(grants.write);\n\n // Fail closed on an append-only floor entry that arrived on the write axis. The parse-time gate in\n // `findMinionResourceAccessViolations` refuses the declaration; reaching here with one means that\n // gate was bypassed (a hand-built grant object), and honouring it would mint the one credential the\n // append axis exists to withhold.\n const widenedAppendFloor = MINION_ENGINE_MANDATORY_APPEND_RESOURCE_TYPES.filter((resourceType) => declaredWrite.has(resourceType));\n if (widenedAppendFloor.length > 0) {\n throw new Error(\n `Refusing to derive minion database grants that put append-only resource types on the write axis: `\n + `${widenedAppendFloor.join(', ')}. A write grant carries DELETE; these are granted APPEND only.`,\n );\n }\n\n return {\n [RuntimePrincipalDatabaseGrantAxis.READ]: normalize([...grants.read, ...MINION_ENGINE_MANDATORY_READ_RESOURCE_TYPES]),\n [RuntimePrincipalDatabaseGrantAxis.WRITE]: normalize(grants.write),\n [RuntimePrincipalDatabaseGrantAxis.APPEND]: normalize(MINION_ENGINE_MANDATORY_APPEND_RESOURCE_TYPES),\n // A MAINTAIN floor entry the author also declared on write keeps the wider axis: runtime state is\n // not evidence, so the append-floor refusal above deliberately does not extend to it.\n [RuntimePrincipalDatabaseGrantAxis.MAINTAIN]: normalize(\n MINION_ENGINE_MANDATORY_MAINTAIN_RESOURCE_TYPES.filter((resourceType) => !declaredWrite.has(resourceType)),\n ),\n };\n}\n"]}
@@ -42,6 +42,56 @@ export type ProvisionedPlatformApplicationType = PlatformApplicationType.PLATFOR
42
42
  * other, once the other side was corrected. Both sides now read this one table.
43
43
  */
44
44
  export declare const PLATFORM_SERVICE_RUNTIME_SLUG: Record<ProvisionedPlatformApplicationType, PlatformWildoServices>;
45
+ /**
46
+ * The platform-side JWT KEY NAME of a provisioned platform service — the property name under which
47
+ * that service's signing keypair is stored in its platform secrets (`jwt.privateKey[<name>]`,
48
+ * `jwt.publicKey[<name>]`) and under which its public key is PUBLISHED into the platform config's
49
+ * `jwtPublicKeys`.
50
+ *
51
+ * ## Two concepts that share spellings, and must not be merged
52
+ *
53
+ * 1. **This vocabulary — every provisioned platform service's key name.** TOTAL by nature: every
54
+ * service apps-manager provisions gets a keypair, so every one has a name. The platform-side
55
+ * vocabularies (`PlatformJwtPrivateKeys` / `PlatformJwtPublicKeys` in `platform-shared-lib`) are
56
+ * DERIVED from it, and every map from a service to its key name is keyed by
57
+ * {@link ProvisionedPlatformApplicationType} and required per member.
58
+ * 2. **`JwtPublicKeys` in `@wildo-ai/saas-models` — the platform services whose tokens APPLICATIONS
59
+ * verify.** A deliberate SUBSET: module-registry signs nothing to an application, so it is not
60
+ * there, and adding it would invent an issuer/audience verification nothing performs.
61
+ * `platform-shared-lib` asserts at the type level that that subset stays inside this vocabulary.
62
+ *
63
+ * ## Why this is the ONE source
64
+ *
65
+ * Before #514 the same population was enumerated by hand in four places — two of them
66
+ * `Partial<Record<…>>` maps that omitted module-registry. A `Partial` map is exactly the hand-copied
67
+ * population that broke every fresh install when module-registry was added (see
68
+ * `.claude/rules/invariant-call-site-enumeration.md` #21): it compiles with the member missing and
69
+ * falls back to a key the service's secrets never hold.
70
+ *
71
+ * The string VALUES are persisted keys (platform secrets documents, published `jwtPublicKeys`) and
72
+ * must never change spelling.
73
+ */
74
+ export declare enum PlatformServiceJwtKeyName {
75
+ PLATFORM_APPS_MANAGER = "PLATFORM_APPS_MANAGER",
76
+ PLATFORM_CRONTABS_BATCHES_MANAGER = "PLATFORM_CRONTABS_BATCHES_MANAGER",
77
+ PLATFORM_MODULE_REGISTRY = "PLATFORM_MODULE_REGISTRY"
78
+ }
79
+ /**
80
+ * Provisioned platform service → its platform-side JWT key name. Required for every member of
81
+ * {@link ProvisionedPlatformApplicationType}, so a fourth provisioned service fails to compile here
82
+ * until it is given a name.
83
+ */
84
+ export declare const PLATFORM_SERVICE_JWT_KEY_NAME: {
85
+ readonly platform_apps_manager: PlatformServiceJwtKeyName.PLATFORM_APPS_MANAGER;
86
+ readonly platform_crontabs_batches_manager: PlatformServiceJwtKeyName.PLATFORM_CRONTABS_BATCHES_MANAGER;
87
+ readonly platform_module_registry: PlatformServiceJwtKeyName.PLATFORM_MODULE_REGISTRY;
88
+ };
89
+ /**
90
+ * The platform-side JWT key name for a platform-application type name, or `undefined` when the name
91
+ * is not a provisioned platform service. Callers holding a runtime string (a service's own
92
+ * `serviceName`, an inbound service id) go through here rather than casting into the map.
93
+ */
94
+ export declare function resolvePlatformServiceJwtKeyName(serviceName: string | undefined): PlatformServiceJwtKeyName | undefined;
45
95
  /**
46
96
  * The runtime slug for a platform-application type name, or `undefined` when the name is not a
47
97
  * provisioned platform service — a caller then reports or refuses rather than rooting a key
@@ -1 +1 @@
1
- {"version":3,"file":"platform-services.schemas.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/platform-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;;;;;GAMG;AACH,oBAAY,qBAAqB;IAC/B,aAAa,kBAAkB;IAC/B,YAAY,0BAA0B;IACtC,wBAAwB,sCAAsC;IAC9D;;;;OAIG;IACH,eAAe,6BAA6B;CAC7C;AA4BD,eAAO,MAAM,2BAA2B,kGAGyB,CAAC;AAElE,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpF;;;;;GAKG;AACH,MAAM,MAAM,kCAAkC,GAC1C,uBAAuB,CAAC,qBAAqB,GAC7C,uBAAuB,CAAC,iCAAiC,GACzD,uBAAuB,CAAC,wBAAwB,CAAC;AAErD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,kCAAkC,EAAE,qBAAqB,CAI3G,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,qBAAqB,GAAG,SAAS,CAGpH;AAeD,oBAAY,eAAe;IACzB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd"}
1
+ {"version":3,"file":"platform-services.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/platform-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;;;;;GAMG;AACH,oBAAY,qBAAqB;IAC/B,aAAa,kBAAkB;IAC/B,YAAY,0BAA0B;IACtC,wBAAwB,sCAAsC;IAC9D;;;;OAIG;IACH,eAAe,6BAA6B;CAC7C;AA4BD,eAAO,MAAM,2BAA2B,kGAGyB,CAAC;AAElE,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpF;;;;;GAKG;AACH,MAAM,MAAM,kCAAkC,GAC1C,uBAAuB,CAAC,qBAAqB,GAC7C,uBAAuB,CAAC,iCAAiC,GACzD,uBAAuB,CAAC,wBAAwB,CAAC;AAErD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,kCAAkC,EAAE,qBAAqB,CAI3G,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,oBAAY,yBAAyB;IACnC,qBAAqB,0BAA0B;IAC/C,iCAAiC,sCAAsC;IACvE,wBAAwB,6BAA6B;CACtD;AAED;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;CAIgD,CAAC;AAc3F;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,yBAAyB,GAAG,SAAS,CAGvH;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,qBAAqB,GAAG,SAAS,CAGpH;AAeD,oBAAY,eAAe;IACzB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd"}
@@ -42,6 +42,63 @@ export const PLATFORM_SERVICE_RUNTIME_SLUG = {
42
42
  [PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER]: PlatformWildoServices.CRONTABS_BATCHES_MANAGER,
43
43
  [PlatformApplicationType.PLATFORM_MODULE_REGISTRY]: PlatformWildoServices.MODULE_REGISTRY,
44
44
  };
45
+ /**
46
+ * The platform-side JWT KEY NAME of a provisioned platform service — the property name under which
47
+ * that service's signing keypair is stored in its platform secrets (`jwt.privateKey[<name>]`,
48
+ * `jwt.publicKey[<name>]`) and under which its public key is PUBLISHED into the platform config's
49
+ * `jwtPublicKeys`.
50
+ *
51
+ * ## Two concepts that share spellings, and must not be merged
52
+ *
53
+ * 1. **This vocabulary — every provisioned platform service's key name.** TOTAL by nature: every
54
+ * service apps-manager provisions gets a keypair, so every one has a name. The platform-side
55
+ * vocabularies (`PlatformJwtPrivateKeys` / `PlatformJwtPublicKeys` in `platform-shared-lib`) are
56
+ * DERIVED from it, and every map from a service to its key name is keyed by
57
+ * {@link ProvisionedPlatformApplicationType} and required per member.
58
+ * 2. **`JwtPublicKeys` in `@wildo-ai/saas-models` — the platform services whose tokens APPLICATIONS
59
+ * verify.** A deliberate SUBSET: module-registry signs nothing to an application, so it is not
60
+ * there, and adding it would invent an issuer/audience verification nothing performs.
61
+ * `platform-shared-lib` asserts at the type level that that subset stays inside this vocabulary.
62
+ *
63
+ * ## Why this is the ONE source
64
+ *
65
+ * Before #514 the same population was enumerated by hand in four places — two of them
66
+ * `Partial<Record<…>>` maps that omitted module-registry. A `Partial` map is exactly the hand-copied
67
+ * population that broke every fresh install when module-registry was added (see
68
+ * `.claude/rules/invariant-call-site-enumeration.md` #21): it compiles with the member missing and
69
+ * falls back to a key the service's secrets never hold.
70
+ *
71
+ * The string VALUES are persisted keys (platform secrets documents, published `jwtPublicKeys`) and
72
+ * must never change spelling.
73
+ */
74
+ export var PlatformServiceJwtKeyName;
75
+ (function (PlatformServiceJwtKeyName) {
76
+ PlatformServiceJwtKeyName["PLATFORM_APPS_MANAGER"] = "PLATFORM_APPS_MANAGER";
77
+ PlatformServiceJwtKeyName["PLATFORM_CRONTABS_BATCHES_MANAGER"] = "PLATFORM_CRONTABS_BATCHES_MANAGER";
78
+ PlatformServiceJwtKeyName["PLATFORM_MODULE_REGISTRY"] = "PLATFORM_MODULE_REGISTRY";
79
+ })(PlatformServiceJwtKeyName || (PlatformServiceJwtKeyName = {}));
80
+ /**
81
+ * Provisioned platform service → its platform-side JWT key name. Required for every member of
82
+ * {@link ProvisionedPlatformApplicationType}, so a fourth provisioned service fails to compile here
83
+ * until it is given a name.
84
+ */
85
+ export const PLATFORM_SERVICE_JWT_KEY_NAME = {
86
+ [PlatformApplicationType.PLATFORM_APPS_MANAGER]: PlatformServiceJwtKeyName.PLATFORM_APPS_MANAGER,
87
+ [PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER]: PlatformServiceJwtKeyName.PLATFORM_CRONTABS_BATCHES_MANAGER,
88
+ [PlatformApplicationType.PLATFORM_MODULE_REGISTRY]: PlatformServiceJwtKeyName.PLATFORM_MODULE_REGISTRY,
89
+ };
90
+ const _assertEveryJwtKeyNameIsMapped = true;
91
+ void _assertEveryJwtKeyNameIsMapped;
92
+ /**
93
+ * The platform-side JWT key name for a platform-application type name, or `undefined` when the name
94
+ * is not a provisioned platform service. Callers holding a runtime string (a service's own
95
+ * `serviceName`, an inbound service id) go through here rather than casting into the map.
96
+ */
97
+ export function resolvePlatformServiceJwtKeyName(serviceName) {
98
+ if (serviceName === undefined)
99
+ return undefined;
100
+ return PLATFORM_SERVICE_JWT_KEY_NAME[serviceName];
101
+ }
45
102
  /**
46
103
  * The runtime slug for a platform-application type name, or `undefined` when the name is not a
47
104
  * provisioned platform service — a caller then reports or refuses rather than rooting a key
@@ -1 +1 @@
1
- {"version":3,"file":"platform-services.schemas.js","sourceRoot":"","sources":["../../../../src/project-config/shared/platform-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,qBAUX;AAVD,WAAY,qBAAqB;IAC/B,wDAA+B,CAAA;IAC/B,+DAAsC,CAAA;IACtC,uFAA8D,CAAA;IAC9D;;;;OAIG;IACH,qEAA4C,CAAA;AAC9C,CAAC,EAVW,qBAAqB,KAArB,qBAAqB,QAUhC;AA4BD,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,qBAAqB,CAAC,wBAAwB;IAC9C,qBAAqB,CAAC,eAAe;CAC0B,CAAC;AAelE;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAsE;IAC9G,CAAC,uBAAuB,CAAC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,YAAY;IACnF,CAAC,uBAAuB,CAAC,iCAAiC,CAAC,EAAE,qBAAqB,CAAC,wBAAwB;IAC3G,CAAC,uBAAuB,CAAC,wBAAwB,CAAC,EAAE,qBAAqB,CAAC,eAAe;CAC1F,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,WAA+B;IAC/E,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAChD,OAAQ,6BAAmF,CAAC,WAAW,CAAC,CAAC;AAC3G,CAAC;AAYD,MAAM,kCAAkC,GAAuC,IAAI,CAAC;AACpF,KAAK,kCAAkC,CAAC;AAExC,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["import { PlatformApplicationType } from '@wildo-ai/platform-core-shared';\n\n/**\n * Platform microservices. All use the same Docker image (wildo-platform)\n * differentiated at runtime via PLATFORM_SERVICE env var.\n *\n * For app developers: deployed as Docker containers.\n * For framework developers: run natively from source (hot-reload).\n */\nexport enum PlatformWildoServices {\n PLATFORM_INIT = 'platform-init',\n APPS_MANAGER = 'platform-apps-manager',\n CRONTABS_BATCHES_MANAGER = 'platform-crontabs-batches-manager',\n /**\n * Module-registry server (`platform-module-registry`, KD-7).\n * Hosts the central `wildo registry *` HTTP surface; pinned port\n * `PLATFORM_DEFAULT_PORTS.MODULE_REGISTRY` (5154).\n */\n MODULE_REGISTRY = 'platform-module-registry',\n}\n\n/**\n * Bootstrap platform services — long-running platform microservices that boot\n * from the same env contract via `PlatformEnvVarsBuilder.buildBootstrapEnv`.\n *\n * Excludes:\n * - `PLATFORM_INIT` — one-shot initialization job, not a long-running service.\n * - `APPS_MANAGER` — has its own dedicated full-env builder\n * (`PlatformEnvVarsBuilder.buildAppsManagerFullEnv`) with extra wiring\n * (Atlas creds, GitHub provisioning keys, etc.).\n *\n * Single source of truth for everything that iterates \"all bootstrap services\":\n * K8s Secret/ConfigMap emit (`k8s-secrets-generator.service.ts`), Compose\n * runtime catalog, and tests asserting cross-service env contracts.\n *\n * The `satisfies` clause below forces this list to cover every member of\n * `PlatformWildoServices` other than the two explicitly excluded ones —\n * adding a new enum member without listing it here is a compile error.\n * Without that coupling, the previous `Exclude<…>`-based local type alias\n * silently widened to include any future enum member, which masked the\n * \"service in enum but not yet handled by the bootstrap path\" drift class.\n */\ntype BootstrapPlatformServiceCandidate = Exclude<\n PlatformWildoServices,\n PlatformWildoServices.PLATFORM_INIT | PlatformWildoServices.APPS_MANAGER\n>;\n\nexport const BOOTSTRAP_PLATFORM_SERVICES = [\n PlatformWildoServices.CRONTABS_BATCHES_MANAGER,\n PlatformWildoServices.MODULE_REGISTRY,\n] as const satisfies readonly BootstrapPlatformServiceCandidate[];\n\nexport type BootstrapPlatformService = (typeof BOOTSTRAP_PLATFORM_SERVICES)[number];\n\n/**\n * The platform-application TYPES the platform provisions credentials for — the same three the\n * apps-manager provisioner iterates. Named here so the runtime-slug ledger below can be REQUIRED per\n * member: a fourth provisioned service that is not mapped fails to compile before it provisions a\n * grant nobody can use.\n */\nexport type ProvisionedPlatformApplicationType =\n | PlatformApplicationType.PLATFORM_APPS_MANAGER\n | PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER\n | PlatformApplicationType.PLATFORM_MODULE_REGISTRY;\n\n/**\n * ONE service, TWO spellings — and this is the join between them.\n *\n * `PlatformApplicationType` (`platform_crontabs_batches_manager`, underscores) is the platform-\n * application RECORD type: the row in `platformApplications`, the Redis ACL USERNAME, the RabbitMQ\n * user. `PlatformWildoServices` (`platform-crontabs-batches-manager`, hyphens) is the RUNTIME SLUG:\n * the Docker/K8s service name and, since 2026-09-09, the `appSlug` each service process boots with.\n *\n * Why the join matters: every Redis key a platform process writes is rooted at its runtime slug —\n * the engine's `RedisService` roots at `${appSlug}:`, the platform's `PlatformRedisService` at the\n * same slug through this ledger — and the ACL grant minted for the service must therefore be\n * `~<runtime slug>:*`. Two writers rooted at the USERNAME instead (the provisioner's grant, then the\n * platform Redis service's prefix) each produced `NOPERM` on the service's first key, one after the\n * other, once the other side was corrected. Both sides now read this one table.\n */\nexport const PLATFORM_SERVICE_RUNTIME_SLUG: Record<ProvisionedPlatformApplicationType, PlatformWildoServices> = {\n [PlatformApplicationType.PLATFORM_APPS_MANAGER]: PlatformWildoServices.APPS_MANAGER,\n [PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER]: PlatformWildoServices.CRONTABS_BATCHES_MANAGER,\n [PlatformApplicationType.PLATFORM_MODULE_REGISTRY]: PlatformWildoServices.MODULE_REGISTRY,\n};\n\n/**\n * The runtime slug for a platform-application type name, or `undefined` when the name is not a\n * provisioned platform service — a caller then reports or refuses rather than rooting a key\n * namespace, or a grant, on a guess.\n */\nexport function resolvePlatformServiceRuntimeSlug(serviceName: string | undefined): PlatformWildoServices | undefined {\n if (serviceName === undefined) return undefined;\n return (PLATFORM_SERVICE_RUNTIME_SLUG as Record<string, PlatformWildoServices | undefined>)[serviceName];\n}\n\n/**\n * Compile-time assertion: every non-excluded `PlatformWildoServices` member\n * MUST appear in `BOOTSTRAP_PLATFORM_SERVICES`. Adding a new member to the\n * enum without listing it above triggers a `Type 'X' is not assignable to\n * type 'never'` error pointing here, so the exhaustiveness check the\n * `addServiceExtras` switch used to provide for `Exclude<…>`-derived types\n * is preserved.\n */\ntype _AssertExhaustiveBootstrapCoverage =\n Exclude<BootstrapPlatformServiceCandidate, BootstrapPlatformService> extends never ? true : never;\nconst _assertExhaustiveBootstrapCoverage: _AssertExhaustiveBootstrapCoverage = true;\nvoid _assertExhaustiveBootstrapCoverage;\n\nexport enum AppsManagerMode {\n NORMAL = 'normal',\n INIT = 'init',\n}\n\n"]}
1
+ {"version":3,"file":"platform-services.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/platform-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,qBAUX;AAVD,WAAY,qBAAqB;IAC/B,wDAA+B,CAAA;IAC/B,+DAAsC,CAAA;IACtC,uFAA8D,CAAA;IAC9D;;;;OAIG;IACH,qEAA4C,CAAA;AAC9C,CAAC,EAVW,qBAAqB,KAArB,qBAAqB,QAUhC;AA4BD,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,qBAAqB,CA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MAAM,kCAAkC,GAAuC,IAAI,CAAC;AACpF,KAAK,kCAAkC,CAAC;AAExC,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["import { PlatformApplicationType } from '@wildo-ai/platform-core-shared';\n\n/**\n * Platform microservices. All use the same Docker image (wildo-platform)\n * differentiated at runtime via PLATFORM_SERVICE env var.\n *\n * For app developers: deployed as Docker containers.\n * For framework developers: run natively from source (hot-reload).\n */\nexport enum PlatformWildoServices {\n PLATFORM_INIT = 'platform-init',\n APPS_MANAGER = 'platform-apps-manager',\n CRONTABS_BATCHES_MANAGER = 'platform-crontabs-batches-manager',\n /**\n * Module-registry server (`platform-module-registry`, KD-7).\n * Hosts the central `wildo registry *` HTTP surface; pinned port\n * `PLATFORM_DEFAULT_PORTS.MODULE_REGISTRY` (5154).\n */\n MODULE_REGISTRY = 'platform-module-registry',\n}\n\n/**\n * Bootstrap platform services — long-running platform microservices that boot\n * from the same env contract via `PlatformEnvVarsBuilder.buildBootstrapEnv`.\n *\n * Excludes:\n * - `PLATFORM_INIT` — one-shot initialization job, not a long-running service.\n * - `APPS_MANAGER` — has its own dedicated full-env builder\n * (`PlatformEnvVarsBuilder.buildAppsManagerFullEnv`) with extra wiring\n * (Atlas creds, GitHub provisioning keys, etc.).\n *\n * Single source of truth for everything that iterates \"all bootstrap services\":\n * K8s Secret/ConfigMap emit (`k8s-secrets-generator.service.ts`), Compose\n * runtime catalog, and tests asserting cross-service env contracts.\n *\n * The `satisfies` clause below forces this list to cover every member of\n * `PlatformWildoServices` other than the two explicitly excluded ones —\n * adding a new enum member without listing it here is a compile error.\n * Without that coupling, the previous `Exclude<…>`-based local type alias\n * silently widened to include any future enum member, which masked the\n * \"service in enum but not yet handled by the bootstrap path\" drift class.\n */\ntype BootstrapPlatformServiceCandidate = Exclude<\n PlatformWildoServices,\n PlatformWildoServices.PLATFORM_INIT | PlatformWildoServices.APPS_MANAGER\n>;\n\nexport const BOOTSTRAP_PLATFORM_SERVICES = [\n PlatformWildoServices.CRONTABS_BATCHES_MANAGER,\n PlatformWildoServices.MODULE_REGISTRY,\n] as const satisfies readonly BootstrapPlatformServiceCandidate[];\n\nexport type BootstrapPlatformService = (typeof BOOTSTRAP_PLATFORM_SERVICES)[number];\n\n/**\n * The platform-application TYPES the platform provisions credentials for — the same three the\n * apps-manager provisioner iterates. Named here so the runtime-slug ledger below can be REQUIRED per\n * member: a fourth provisioned service that is not mapped fails to compile before it provisions a\n * grant nobody can use.\n */\nexport type ProvisionedPlatformApplicationType =\n | PlatformApplicationType.PLATFORM_APPS_MANAGER\n | PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER\n | PlatformApplicationType.PLATFORM_MODULE_REGISTRY;\n\n/**\n * ONE service, TWO spellings — and this is the join between them.\n *\n * `PlatformApplicationType` (`platform_crontabs_batches_manager`, underscores) is the platform-\n * application RECORD type: the row in `platformApplications`, the Redis ACL USERNAME, the RabbitMQ\n * user. `PlatformWildoServices` (`platform-crontabs-batches-manager`, hyphens) is the RUNTIME SLUG:\n * the Docker/K8s service name and, since 2026-09-09, the `appSlug` each service process boots with.\n *\n * Why the join matters: every Redis key a platform process writes is rooted at its runtime slug —\n * the engine's `RedisService` roots at `${appSlug}:`, the platform's `PlatformRedisService` at the\n * same slug through this ledger — and the ACL grant minted for the service must therefore be\n * `~<runtime slug>:*`. Two writers rooted at the USERNAME instead (the provisioner's grant, then the\n * platform Redis service's prefix) each produced `NOPERM` on the service's first key, one after the\n * other, once the other side was corrected. Both sides now read this one table.\n */\nexport const PLATFORM_SERVICE_RUNTIME_SLUG: Record<ProvisionedPlatformApplicationType, PlatformWildoServices> = {\n [PlatformApplicationType.PLATFORM_APPS_MANAGER]: PlatformWildoServices.APPS_MANAGER,\n [PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER]: PlatformWildoServices.CRONTABS_BATCHES_MANAGER,\n [PlatformApplicationType.PLATFORM_MODULE_REGISTRY]: PlatformWildoServices.MODULE_REGISTRY,\n};\n\n/**\n * The platform-side JWT KEY NAME of a provisioned platform service — the property name under which\n * that service's signing keypair is stored in its platform secrets (`jwt.privateKey[<name>]`,\n * `jwt.publicKey[<name>]`) and under which its public key is PUBLISHED into the platform config's\n * `jwtPublicKeys`.\n *\n * ## Two concepts that share spellings, and must not be merged\n *\n * 1. **This vocabulary — every provisioned platform service's key name.** TOTAL by nature: every\n * service apps-manager provisions gets a keypair, so every one has a name. The platform-side\n * vocabularies (`PlatformJwtPrivateKeys` / `PlatformJwtPublicKeys` in `platform-shared-lib`) are\n * DERIVED from it, and every map from a service to its key name is keyed by\n * {@link ProvisionedPlatformApplicationType} and required per member.\n * 2. **`JwtPublicKeys` in `@wildo-ai/saas-models` — the platform services whose tokens APPLICATIONS\n * verify.** A deliberate SUBSET: module-registry signs nothing to an application, so it is not\n * there, and adding it would invent an issuer/audience verification nothing performs.\n * `platform-shared-lib` asserts at the type level that that subset stays inside this vocabulary.\n *\n * ## Why this is the ONE source\n *\n * Before #514 the same population was enumerated by hand in four places — two of them\n * `Partial<Record<…>>` maps that omitted module-registry. A `Partial` map is exactly the hand-copied\n * population that broke every fresh install when module-registry was added (see\n * `.claude/rules/invariant-call-site-enumeration.md` #21): it compiles with the member missing and\n * falls back to a key the service's secrets never hold.\n *\n * The string VALUES are persisted keys (platform secrets documents, published `jwtPublicKeys`) and\n * must never change spelling.\n */\nexport enum PlatformServiceJwtKeyName {\n PLATFORM_APPS_MANAGER = 'PLATFORM_APPS_MANAGER',\n PLATFORM_CRONTABS_BATCHES_MANAGER = 'PLATFORM_CRONTABS_BATCHES_MANAGER',\n PLATFORM_MODULE_REGISTRY = 'PLATFORM_MODULE_REGISTRY',\n}\n\n/**\n * Provisioned platform service → its platform-side JWT key name. Required for every member of\n * {@link ProvisionedPlatformApplicationType}, so a fourth provisioned service fails to compile here\n * until it is given a name.\n */\nexport const PLATFORM_SERVICE_JWT_KEY_NAME = {\n [PlatformApplicationType.PLATFORM_APPS_MANAGER]: PlatformServiceJwtKeyName.PLATFORM_APPS_MANAGER,\n [PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER]: PlatformServiceJwtKeyName.PLATFORM_CRONTABS_BATCHES_MANAGER,\n [PlatformApplicationType.PLATFORM_MODULE_REGISTRY]: PlatformServiceJwtKeyName.PLATFORM_MODULE_REGISTRY,\n} as const satisfies Record<ProvisionedPlatformApplicationType, PlatformServiceJwtKeyName>;\n\n/**\n * Compile-time assertion: every {@link PlatformServiceJwtKeyName} member is the key name of SOME\n * provisioned service. A name nothing maps to would be a vocabulary member no keypair is ever stored\n * under.\n */\ntype _AssertEveryJwtKeyNameIsMapped =\n Exclude<PlatformServiceJwtKeyName, (typeof PLATFORM_SERVICE_JWT_KEY_NAME)[ProvisionedPlatformApplicationType]> extends never\n ? true\n : never;\nconst _assertEveryJwtKeyNameIsMapped: _AssertEveryJwtKeyNameIsMapped = true;\nvoid _assertEveryJwtKeyNameIsMapped;\n\n/**\n * The platform-side JWT key name for a platform-application type name, or `undefined` when the name\n * is not a provisioned platform service. Callers holding a runtime string (a service's own\n * `serviceName`, an inbound service id) go through here rather than casting into the map.\n */\nexport function resolvePlatformServiceJwtKeyName(serviceName: string | undefined): PlatformServiceJwtKeyName | undefined {\n if (serviceName === undefined) return undefined;\n return (PLATFORM_SERVICE_JWT_KEY_NAME as Record<string, PlatformServiceJwtKeyName | undefined>)[serviceName];\n}\n\n/**\n * The runtime slug for a platform-application type name, or `undefined` when the name is not a\n * provisioned platform service — a caller then reports or refuses rather than rooting a key\n * namespace, or a grant, on a guess.\n */\nexport function resolvePlatformServiceRuntimeSlug(serviceName: string | undefined): PlatformWildoServices | undefined {\n if (serviceName === undefined) return undefined;\n return (PLATFORM_SERVICE_RUNTIME_SLUG as Record<string, PlatformWildoServices | undefined>)[serviceName];\n}\n\n/**\n * Compile-time assertion: every non-excluded `PlatformWildoServices` member\n * MUST appear in `BOOTSTRAP_PLATFORM_SERVICES`. Adding a new member to the\n * enum without listing it above triggers a `Type 'X' is not assignable to\n * type 'never'` error pointing here, so the exhaustiveness check the\n * `addServiceExtras` switch used to provide for `Exclude<…>`-derived types\n * is preserved.\n */\ntype _AssertExhaustiveBootstrapCoverage =\n Exclude<BootstrapPlatformServiceCandidate, BootstrapPlatformService> extends never ? true : never;\nconst _assertExhaustiveBootstrapCoverage: _AssertExhaustiveBootstrapCoverage = true;\nvoid _assertExhaustiveBootstrapCoverage;\n\nexport enum AppsManagerMode {\n NORMAL = 'normal',\n INIT = 'init',\n}\n\n"]}
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The PLATFORM tier's own object-storage bucket, authored for a remote environment (#1112).
4
+ *
5
+ * ## Why the platform needs its own, separate from `backingServices.s3.bucket`
6
+ *
7
+ * `backingServices.s3.bucket` is an APPLICATION's bucket: its backend reads and writes there, and apps-manager
8
+ * confines that application's storage credential to it (#1107). The platform services — apps-manager itself and
9
+ * module-registry — store their own objects too, and both halves of that pair must address ONE bucket: the
10
+ * platform-services STS door confines to the bucket apps-manager's env names, while module-registry addresses
11
+ * objects in the bucket its own env names.
12
+ *
13
+ * Until #1112 the CLI rendered that platform bucket from the `config.json` of whichever application was being
14
+ * registered or deployed, so it became the last-registered application's bucket, and platform objects written
15
+ * earlier went out of reach. Measured on 2026-09-14: module-registry's uploads sat in `wonder-todos-local`, and
16
+ * registering a second application rewrote every platform service's env to that application's bucket.
17
+ *
18
+ * ## Local: a constant. Remote: authored.
19
+ *
20
+ * A local platform is shared by every application checked out beside it, and no configuration on disk is shared
21
+ * across them — every infra file, `config.json` and `secrets.json` belongs to one application. So a local
22
+ * platform's bucket is the constant {@link STORAGE_DEFAULTS.BUCKET}, and authoring this block in a local
23
+ * environment is refused at parse time (the same shape as `cdn`, which is remote-only for its own reason).
24
+ *
25
+ * A remote environment is deployed from one application's infra file and may need a globally unique S3 name, so
26
+ * it can author one here. Absent, the constant applies there too.
27
+ */
28
+ export declare const WildoPlatformStorageConfigSchema: z.ZodObject<{
29
+ /** The bucket apps-manager and module-registry store the platform's own objects in. */
30
+ bucket: z.ZodString;
31
+ }, z.core.$strict>;
32
+ export type WildoPlatformStorageConfig = z.infer<typeof WildoPlatformStorageConfigSchema>;
33
+ /** The platform tier's bucket: the authored remote override, else {@link STORAGE_DEFAULTS.BUCKET}. */
34
+ export declare function resolvePlatformObjectStorageBucket(platformStorage: WildoPlatformStorageConfig | undefined): string;
35
+ //# sourceMappingURL=platform-storage.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-storage.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/platform-storage.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gCAAgC;IAC3C,uFAAuF;;kBAEvF,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,sGAAsG;AACtG,wBAAgB,kCAAkC,CAAC,eAAe,EAAE,0BAA0B,GAAG,SAAS,GAAG,MAAM,CAElH"}
@@ -0,0 +1,37 @@
1
+ import { z } from 'zod';
2
+ import { STORAGE_DEFAULTS } from './infrastructure-defaults.schemas.js';
3
+ /**
4
+ * The PLATFORM tier's own object-storage bucket, authored for a remote environment (#1112).
5
+ *
6
+ * ## Why the platform needs its own, separate from `backingServices.s3.bucket`
7
+ *
8
+ * `backingServices.s3.bucket` is an APPLICATION's bucket: its backend reads and writes there, and apps-manager
9
+ * confines that application's storage credential to it (#1107). The platform services — apps-manager itself and
10
+ * module-registry — store their own objects too, and both halves of that pair must address ONE bucket: the
11
+ * platform-services STS door confines to the bucket apps-manager's env names, while module-registry addresses
12
+ * objects in the bucket its own env names.
13
+ *
14
+ * Until #1112 the CLI rendered that platform bucket from the `config.json` of whichever application was being
15
+ * registered or deployed, so it became the last-registered application's bucket, and platform objects written
16
+ * earlier went out of reach. Measured on 2026-09-14: module-registry's uploads sat in `wonder-todos-local`, and
17
+ * registering a second application rewrote every platform service's env to that application's bucket.
18
+ *
19
+ * ## Local: a constant. Remote: authored.
20
+ *
21
+ * A local platform is shared by every application checked out beside it, and no configuration on disk is shared
22
+ * across them — every infra file, `config.json` and `secrets.json` belongs to one application. So a local
23
+ * platform's bucket is the constant {@link STORAGE_DEFAULTS.BUCKET}, and authoring this block in a local
24
+ * environment is refused at parse time (the same shape as `cdn`, which is remote-only for its own reason).
25
+ *
26
+ * A remote environment is deployed from one application's infra file and may need a globally unique S3 name, so
27
+ * it can author one here. Absent, the constant applies there too.
28
+ */
29
+ export const WildoPlatformStorageConfigSchema = z.strictObject({
30
+ /** The bucket apps-manager and module-registry store the platform's own objects in. */
31
+ bucket: z.string().min(1),
32
+ });
33
+ /** The platform tier's bucket: the authored remote override, else {@link STORAGE_DEFAULTS.BUCKET}. */
34
+ export function resolvePlatformObjectStorageBucket(platformStorage) {
35
+ return platformStorage?.bucket ?? STORAGE_DEFAULTS.BUCKET;
36
+ }
37
+ //# sourceMappingURL=platform-storage.schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-storage.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/platform-storage.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7D,uFAAuF;IACvF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC1B,CAAC,CAAC;AAGH,sGAAsG;AACtG,MAAM,UAAU,kCAAkC,CAAC,eAAuD;IACxG,OAAO,eAAe,EAAE,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC;AAC5D,CAAC","sourcesContent":["import { z } from 'zod';\n\nimport { STORAGE_DEFAULTS } from './infrastructure-defaults.schemas';\n\n/**\n * The PLATFORM tier's own object-storage bucket, authored for a remote environment (#1112).\n *\n * ## Why the platform needs its own, separate from `backingServices.s3.bucket`\n *\n * `backingServices.s3.bucket` is an APPLICATION's bucket: its backend reads and writes there, and apps-manager\n * confines that application's storage credential to it (#1107). The platform services — apps-manager itself and\n * module-registry — store their own objects too, and both halves of that pair must address ONE bucket: the\n * platform-services STS door confines to the bucket apps-manager's env names, while module-registry addresses\n * objects in the bucket its own env names.\n *\n * Until #1112 the CLI rendered that platform bucket from the `config.json` of whichever application was being\n * registered or deployed, so it became the last-registered application's bucket, and platform objects written\n * earlier went out of reach. Measured on 2026-09-14: module-registry's uploads sat in `wonder-todos-local`, and\n * registering a second application rewrote every platform service's env to that application's bucket.\n *\n * ## Local: a constant. Remote: authored.\n *\n * A local platform is shared by every application checked out beside it, and no configuration on disk is shared\n * across them — every infra file, `config.json` and `secrets.json` belongs to one application. So a local\n * platform's bucket is the constant {@link STORAGE_DEFAULTS.BUCKET}, and authoring this block in a local\n * environment is refused at parse time (the same shape as `cdn`, which is remote-only for its own reason).\n *\n * A remote environment is deployed from one application's infra file and may need a globally unique S3 name, so\n * it can author one here. Absent, the constant applies there too.\n */\nexport const WildoPlatformStorageConfigSchema = z.strictObject({\n /** The bucket apps-manager and module-registry store the platform's own objects in. */\n bucket: z.string().min(1),\n});\nexport type WildoPlatformStorageConfig = z.infer<typeof WildoPlatformStorageConfigSchema>;\n\n/** The platform tier's bucket: the authored remote override, else {@link STORAGE_DEFAULTS.BUCKET}. */\nexport function resolvePlatformObjectStorageBucket(platformStorage: WildoPlatformStorageConfig | undefined): string {\n return platformStorage?.bucket ?? STORAGE_DEFAULTS.BUCKET;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"schema-version.schemas.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/schema-version.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4BxB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,aAGpC,CAAC"}
1
+ {"version":3,"file":"schema-version.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/schema-version.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4BxB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,aAGpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"service-definitions.schemas.d.ts","sourceRoot":"","sources":["../../../../src/project-config/shared/service-definitions.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,oBAAY,cAAc;IACxB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,oBAAoB,sCAAuC,CAAC;AACzE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE;;;;;;;;;GASG;AACH,eAAO,MAAM,+BAA+B,SAAS,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAkB9C,eAAO,MAAM,sBAAsB;;;;;kBAKjC,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,8BAA8B;;;;;kBAKzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,K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AAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;iBAI3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY;;kBAEvB,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"service-definitions.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/service-definitions.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,oBAAY,cAAc;IACxB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,oBAAoB,sCAAuC,CAAC;AACzE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE;;;;;;;;;GASG;AACH,eAAO,MAAM,+BAA+B,SAAS,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAkB9C,eAAO,MAAM,sBAAsB;;;;;kBAKjC,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,8BAA8B;;;;;kBAKzC,C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AE9E,eAAO,MAAM,mBAAmB;;;iBAG9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;iBAI3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY;;kBAEvB,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * WHERE each declared system of record lives, per ENVIRONMENT (#1055 §2).
3
+ *
4
+ * The saas config says WHAT the application reads (`systemsOfRecord.<name>`: a vendor, a dialect);
5
+ * this says WHERE that instance is in THIS environment, and `secrets.json` says with what. The same
6
+ * split `applicationDatabase` already makes between selection and substrate, for the same reason: an
7
+ * address is environment-specific and a declaration is not.
8
+ *
9
+ * ## Two authored shapes, and the second one is the point
10
+ *
11
+ * ```ts
12
+ * systemsOfRecord: {
13
+ * odoo: { address: { baseUrl: 'https://acme.odoo.com', database: 'acme', login: 'bot@acme.com' } },
14
+ * }
15
+ * ```
16
+ *
17
+ * ```ts
18
+ * systemsOfRecord: {
19
+ * odoo: { enabled: false }, // this environment has no access to the ERP
20
+ * }
21
+ * ```
22
+ *
23
+ * A developer laptop and a staging with no ERP are the ordinary case, not an edge (#1055 E3), and
24
+ * they need a way to SAY so. Without one, "no access here" and "somebody forgot to author the
25
+ * address" are the same observation — and they need opposite behaviours: the first boots and refuses
26
+ * reads with a clear code, the second refuses at `wildo config sync` and again at boot. So silence is
27
+ * never a declaration: an instance the saas config declares and this file omits entirely is refused.
28
+ *
29
+ * ## What this file deliberately does NOT know
30
+ *
31
+ * Which slots a vendor NEEDS. That is the facet's, and the facet is not in scope here — the saas
32
+ * config and the infra env config parse independently. Completeness is therefore checked at the
33
+ * SEAMS where both are visible: `wildo config sync` and the backend startup validator. What is
34
+ * checked here is only the shape and the slot-slug charset, because a slug outside it could not
35
+ * derive a parseable variable name.
36
+ *
37
+ * ## Addresses are not secrets
38
+ *
39
+ * A base URL is registration-scoped, and a database name and a login identify WHICH deployment and
40
+ * WHICH user rather than proving anything. They belong in the authored infra file, where they are
41
+ * diffable and reviewable. The credential lives in `secrets.json`, keyed by the same derived name.
42
+ */
43
+ import { z } from 'zod';
44
+ /**
45
+ * One instance's address in one environment.
46
+ *
47
+ * A union rather than one object with two optional halves, so the two states cannot be authored at
48
+ * once and neither can be half-written: an entry is either an address or a declaration of absence.
49
+ */
50
+ export declare const WildoSystemOfRecordEnvSchema: z.ZodUnion<readonly [z.ZodObject<{
51
+ /**
52
+ * This environment has NO access to the instance. Reads on a bound resource refuse with a stable
53
+ * code, a scheduled pipeline is not dispatched, and the backend still boots — an application
54
+ * whose ERP is simply not present in staging must still run.
55
+ */
56
+ enabled: z.ZodLiteral<false>;
57
+ }, z.core.$strict>, z.ZodObject<{
58
+ /**
59
+ * The vendor's non-secret address slots, keyed by the facet's slug (Odoo: `baseUrl`, `database`,
60
+ * `login`). Whether the set is COMPLETE is the seam's question, not this schema's.
61
+ */
62
+ address: z.ZodRecord<z.ZodString, z.ZodString>;
63
+ }, z.core.$strict>]>;
64
+ export type WildoSystemOfRecordEnv = z.infer<typeof WildoSystemOfRecordEnvSchema>;
65
+ /** Every instance's address in this environment, keyed by the instance name the saas config declares. */
66
+ export declare const WildoSystemsOfRecordEnvConfigSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
67
+ /**
68
+ * This environment has NO access to the instance. Reads on a bound resource refuse with a stable
69
+ * code, a scheduled pipeline is not dispatched, and the backend still boots — an application
70
+ * whose ERP is simply not present in staging must still run.
71
+ */
72
+ enabled: z.ZodLiteral<false>;
73
+ }, z.core.$strict>, z.ZodObject<{
74
+ /**
75
+ * The vendor's non-secret address slots, keyed by the facet's slug (Odoo: `baseUrl`, `database`,
76
+ * `login`). Whether the set is COMPLETE is the seam's question, not this schema's.
77
+ */
78
+ address: z.ZodRecord<z.ZodString, z.ZodString>;
79
+ }, z.core.$strict>]>>;
80
+ export type WildoSystemsOfRecordEnvConfig = z.infer<typeof WildoSystemsOfRecordEnvConfigSchema>;
81
+ //# sourceMappingURL=systems-of-record-env.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"systems-of-record-env.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/systems-of-record-env.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;IAErC;;;;OAIG;;;IAIH;;;OAGG;;oBAUL,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,yGAAyG;AACzG,eAAO,MAAM,mCAAmC;IAzB5C;;;;OAIG;;;IAIH;;;OAGG;;qBAcqG,CAAC;AAC7G,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * WHERE each declared system of record lives, per ENVIRONMENT (#1055 §2).
3
+ *
4
+ * The saas config says WHAT the application reads (`systemsOfRecord.<name>`: a vendor, a dialect);
5
+ * this says WHERE that instance is in THIS environment, and `secrets.json` says with what. The same
6
+ * split `applicationDatabase` already makes between selection and substrate, for the same reason: an
7
+ * address is environment-specific and a declaration is not.
8
+ *
9
+ * ## Two authored shapes, and the second one is the point
10
+ *
11
+ * ```ts
12
+ * systemsOfRecord: {
13
+ * odoo: { address: { baseUrl: 'https://acme.odoo.com', database: 'acme', login: 'bot@acme.com' } },
14
+ * }
15
+ * ```
16
+ *
17
+ * ```ts
18
+ * systemsOfRecord: {
19
+ * odoo: { enabled: false }, // this environment has no access to the ERP
20
+ * }
21
+ * ```
22
+ *
23
+ * A developer laptop and a staging with no ERP are the ordinary case, not an edge (#1055 E3), and
24
+ * they need a way to SAY so. Without one, "no access here" and "somebody forgot to author the
25
+ * address" are the same observation — and they need opposite behaviours: the first boots and refuses
26
+ * reads with a clear code, the second refuses at `wildo config sync` and again at boot. So silence is
27
+ * never a declaration: an instance the saas config declares and this file omits entirely is refused.
28
+ *
29
+ * ## What this file deliberately does NOT know
30
+ *
31
+ * Which slots a vendor NEEDS. That is the facet's, and the facet is not in scope here — the saas
32
+ * config and the infra env config parse independently. Completeness is therefore checked at the
33
+ * SEAMS where both are visible: `wildo config sync` and the backend startup validator. What is
34
+ * checked here is only the shape and the slot-slug charset, because a slug outside it could not
35
+ * derive a parseable variable name.
36
+ *
37
+ * ## Addresses are not secrets
38
+ *
39
+ * A base URL is registration-scoped, and a database name and a login identify WHICH deployment and
40
+ * WHICH user rather than proving anything. They belong in the authored infra file, where they are
41
+ * diffable and reviewable. The credential lives in `secrets.json`, keyed by the same derived name.
42
+ */
43
+ import { z } from 'zod';
44
+ import { SYSTEM_OF_RECORD_SLOT_SLUG_PATTERN } from '@wildo-ai/saas-models';
45
+ /**
46
+ * One instance's address in one environment.
47
+ *
48
+ * A union rather than one object with two optional halves, so the two states cannot be authored at
49
+ * once and neither can be half-written: an entry is either an address or a declaration of absence.
50
+ */
51
+ export const WildoSystemOfRecordEnvSchema = z.union([
52
+ z.strictObject({
53
+ /**
54
+ * This environment has NO access to the instance. Reads on a bound resource refuse with a stable
55
+ * code, a scheduled pipeline is not dispatched, and the backend still boots — an application
56
+ * whose ERP is simply not present in staging must still run.
57
+ */
58
+ enabled: z.literal(false),
59
+ }),
60
+ z.strictObject({
61
+ /**
62
+ * The vendor's non-secret address slots, keyed by the facet's slug (Odoo: `baseUrl`, `database`,
63
+ * `login`). Whether the set is COMPLETE is the seam's question, not this schema's.
64
+ */
65
+ address: z
66
+ .record(z.string().regex(SYSTEM_OF_RECORD_SLOT_SLUG_PATTERN, 'A slot slug is lowerCamelCase with no separators.'), z.string().min(1))
67
+ .refine((address) => Object.keys(address).length > 0, {
68
+ error: 'An address with no slots says nothing. Author the vendor\'s slots, or declare `{ enabled: false }`.',
69
+ }),
70
+ }),
71
+ ]);
72
+ /** Every instance's address in this environment, keyed by the instance name the saas config declares. */
73
+ export const WildoSystemsOfRecordEnvConfigSchema = z.record(z.string().min(1), WildoSystemOfRecordEnvSchema);
74
+ //# sourceMappingURL=systems-of-record-env.schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"systems-of-record-env.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/systems-of-record-env.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kCAAkC,EAAE,MAAM,uBAAuB,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC;IAClD,CAAC,CAAC,YAAY,CAAC;QACb;;;;WAIG;QACH,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;KAC1B,CAAC;IACF,CAAC,CAAC,YAAY,CAAC;QACb;;;WAGG;QACH,OAAO,EAAE,CAAC;aACP,MAAM,CACL,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kCAAkC,EAAE,mDAAmD,CAAC,EACzG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAClB;aACA,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACpD,KAAK,EAAE,qGAAqG;SAC7G,CAAC;KACL,CAAC;CACH,CAAC,CAAC;AAGH,yGAAyG;AACzG,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["/**\n * WHERE each declared system of record lives, per ENVIRONMENT (#1055 §2).\n *\n * The saas config says WHAT the application reads (`systemsOfRecord.<name>`: a vendor, a dialect);\n * this says WHERE that instance is in THIS environment, and `secrets.json` says with what. The same\n * split `applicationDatabase` already makes between selection and substrate, for the same reason: an\n * address is environment-specific and a declaration is not.\n *\n * ## Two authored shapes, and the second one is the point\n *\n * ```ts\n * systemsOfRecord: {\n * odoo: { address: { baseUrl: 'https://acme.odoo.com', database: 'acme', login: 'bot@acme.com' } },\n * }\n * ```\n *\n * ```ts\n * systemsOfRecord: {\n * odoo: { enabled: false }, // this environment has no access to the ERP\n * }\n * ```\n *\n * A developer laptop and a staging with no ERP are the ordinary case, not an edge (#1055 E3), and\n * they need a way to SAY so. Without one, \"no access here\" and \"somebody forgot to author the\n * address\" are the same observation — and they need opposite behaviours: the first boots and refuses\n * reads with a clear code, the second refuses at `wildo config sync` and again at boot. So silence is\n * never a declaration: an instance the saas config declares and this file omits entirely is refused.\n *\n * ## What this file deliberately does NOT know\n *\n * Which slots a vendor NEEDS. That is the facet's, and the facet is not in scope here — the saas\n * config and the infra env config parse independently. Completeness is therefore checked at the\n * SEAMS where both are visible: `wildo config sync` and the backend startup validator. What is\n * checked here is only the shape and the slot-slug charset, because a slug outside it could not\n * derive a parseable variable name.\n *\n * ## Addresses are not secrets\n *\n * A base URL is registration-scoped, and a database name and a login identify WHICH deployment and\n * WHICH user rather than proving anything. They belong in the authored infra file, where they are\n * diffable and reviewable. The credential lives in `secrets.json`, keyed by the same derived name.\n */\nimport { z } from 'zod';\nimport { SYSTEM_OF_RECORD_SLOT_SLUG_PATTERN } from '@wildo-ai/saas-models';\n\n/**\n * One instance's address in one environment.\n *\n * A union rather than one object with two optional halves, so the two states cannot be authored at\n * once and neither can be half-written: an entry is either an address or a declaration of absence.\n */\nexport const WildoSystemOfRecordEnvSchema = z.union([\n z.strictObject({\n /**\n * This environment has NO access to the instance. Reads on a bound resource refuse with a stable\n * code, a scheduled pipeline is not dispatched, and the backend still boots — an application\n * whose ERP is simply not present in staging must still run.\n */\n enabled: z.literal(false),\n }),\n z.strictObject({\n /**\n * The vendor's non-secret address slots, keyed by the facet's slug (Odoo: `baseUrl`, `database`,\n * `login`). Whether the set is COMPLETE is the seam's question, not this schema's.\n */\n address: z\n .record(\n z.string().regex(SYSTEM_OF_RECORD_SLOT_SLUG_PATTERN, 'A slot slug is lowerCamelCase with no separators.'),\n z.string().min(1),\n )\n .refine((address) => Object.keys(address).length > 0, {\n error: 'An address with no slots says nothing. Author the vendor\\'s slots, or declare `{ enabled: false }`.',\n }),\n }),\n]);\nexport type WildoSystemOfRecordEnv = z.infer<typeof WildoSystemOfRecordEnvSchema>;\n\n/** Every instance's address in this environment, keyed by the instance name the saas config declares. */\nexport const WildoSystemsOfRecordEnvConfigSchema = z.record(z.string().min(1), WildoSystemOfRecordEnvSchema);\nexport type WildoSystemsOfRecordEnvConfig = z.infer<typeof WildoSystemsOfRecordEnvConfigSchema>;\n"]}
@@ -0,0 +1,26 @@
1
+ /** The static-asset extensions a TypeScript module graph may import and Node cannot execute. */
2
+ export declare const STATIC_ASSET_IMPORT_PATTERN_SOURCE = "\\.(css|scss|less|sass|svg|png|jpe?g|gif|webp|ico|avif|woff2?|eot|ttf|otf)(\\?.*)?$";
3
+ /**
4
+ * Make static-asset imports (`.css`, images, fonts) resolve to empty modules for the rest of the
5
+ * process, so a Node-side loader can evaluate an application-authored TypeScript graph that
6
+ * reaches browser code.
7
+ *
8
+ * Why this is needed at all: an application's specifications and website sources import enums
9
+ * from `@wildo-ai/saas-specifications`, whose root transitively reaches frontend component
10
+ * modules that import their stylesheets. Node's ESM loader cannot execute a `.css`, so without
11
+ * this hook an otherwise valid module fails to load solely because a library imports a stylesheet.
12
+ * Static assets carry no meaning for a Node-side reader, so they load as `export default ""`.
13
+ *
14
+ * Process-wide, idempotent, and inert for any graph that imports no static asset. It never touches
15
+ * JavaScript or TypeScript resolution.
16
+ *
17
+ * This is the one copy for in-process callers. Four hand-copied versions existed until 2026-09-25
18
+ * — two in the dev companion and two in the CLI — each with its own regex; the next asset type
19
+ * added to one would have loaded in one tool and failed in another. One copy remains by necessity:
20
+ * the dev companion's introspection subprocess registers a hooks MODULE by path
21
+ * (`asset-noop-hooks.ts`), and loader hooks run on their own thread before anything else loads, so
22
+ * that module must stay dependency-free. `static-asset-pattern-parity.test.ts` in the companion
23
+ * holds its pattern equal to this one.
24
+ */
25
+ export declare function registerStaticAssetImportNoop(): void;
26
+ //# sourceMappingURL=static-asset-import-noop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static-asset-import-noop.d.ts","sourceRoot":"","sources":["../../../../src/project-config/static-asset-import-noop.ts"],"names":[],"mappings":"AAEA,gGAAgG;AAChG,eAAO,MAAM,kCAAkC,wFAAwF,CAAC;AAIxI;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,6BAA6B,IAAI,IAAI,CAqBpD"}