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

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 (187) hide show
  1. package/dist/esm/_unimplemented/index.d.ts.map +1 -1
  2. package/dist/esm/_unimplemented/index.js.map +1 -1
  3. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
  4. package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
  5. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +1 -1
  6. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -1
  7. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  8. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  9. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  10. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  11. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  12. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  13. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  14. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  15. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  16. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  17. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  18. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  19. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
  20. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
  21. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  22. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  23. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  24. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  25. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  26. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  27. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
  28. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  29. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  30. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  31. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  32. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  33. package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
  34. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  35. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  36. package/dist/esm/config-authoring.entry.js.map +1 -1
  37. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  38. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  39. package/dist/esm/index.d.ts.map +1 -1
  40. package/dist/esm/index.js.map +1 -1
  41. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  42. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  43. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  44. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  45. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  46. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  47. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  48. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  49. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  50. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  51. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
  52. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
  53. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  54. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  55. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  56. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  57. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  58. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  59. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  60. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  61. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  62. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  63. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  64. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  65. package/dist/esm/project-config/index.d.ts.map +1 -1
  66. package/dist/esm/project-config/index.js.map +1 -1
  67. package/dist/esm/project-config/loader.d.ts.map +1 -1
  68. package/dist/esm/project-config/loader.js.map +1 -1
  69. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  70. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  71. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
  72. package/dist/esm/project-config/npm-version-range.js.map +1 -1
  73. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
  74. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  75. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  76. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  77. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  78. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  79. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  80. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  81. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  82. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  83. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  84. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  85. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  86. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  87. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
  88. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
  89. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  90. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  91. package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -1
  92. package/dist/esm/project-config/shared/cdn.example.js.map +1 -1
  93. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  94. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  95. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  96. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  97. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  98. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  99. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  100. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  101. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  102. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  103. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  104. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  105. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  106. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  107. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  108. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  109. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
  110. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  111. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  112. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  113. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  114. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  115. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  116. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  117. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  118. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  119. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  120. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  121. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  122. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  123. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  124. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  125. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -1
  126. package/dist/esm/project-config/shared/schema-version.schemas.js.map +1 -1
  127. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  128. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  129. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  130. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  131. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
  132. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
  133. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  134. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  135. package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
  136. package/dist/esm/registry/digest.schemas.js.map +1 -1
  137. package/dist/esm/registry/index.d.ts.map +1 -1
  138. package/dist/esm/registry/index.js.map +1 -1
  139. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
  140. package/dist/esm/registry/local-checkout-source.js.map +1 -1
  141. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  142. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  143. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  144. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  145. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  146. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  147. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
  148. package/dist/esm/registry/module-search.schemas.js.map +1 -1
  149. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  150. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  151. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  152. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  153. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  154. package/dist/esm/registry/registry-errors.js.map +1 -1
  155. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
  156. package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
  157. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  158. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  159. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  160. package/dist/esm/release/framework-release.constants.js.map +1 -1
  161. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  162. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  163. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  164. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  165. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  166. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  167. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  168. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  169. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  170. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  171. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
  172. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  173. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  174. package/dist/esm/workspace-scope/index.js.map +1 -1
  175. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  176. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  177. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  178. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  179. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  180. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  181. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  182. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  183. package/dist/tsconfig.build.tsbuildinfo +1 -0
  184. package/package.json +7 -7
  185. package/dist/esm/registry/companion-api.schemas.d.ts +0 -0
  186. package/dist/esm/registry/companion-api.schemas.d.ts.map +0 -0
  187. package/dist/esm/registry/companion-api.schemas.js.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"define-saas-config.js","sourceRoot":"","sources":["../../../../src/project-config/define-saas-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAChG,OAAO,EACL,eAAe,EACf,6BAA6B,EAC7B,uCAAuC,EACvC,uCAAuC,EACvC,2CAA2C,EAC3C,0CAA0C,EAC1C,kCAAkC,EAClC,4BAA4B,EAC5B,gBAAgB,EAChB,8BAA8B,EAC9B,iCA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,KAAK,MAAM,iBAAiB,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/D,KAAK,MAAM,UAAU,IAAI,iBAAiB,CAAC,kBAAkB,EAAE,CAAC;gBAC9D,iCAAiC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;IACH,CAAC;IACD,KAAK,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC,EAAE,CAAC;QAC1F,IAAI,UAAU,EAAE,OAAO,KAAK,IAAI;YAAE,SAAS;QAC3C,MAAM,UAAU,GAAG,aAAiC,CAAC;QACrD,IAAI,iCAAiC,CAAC,UAAU,CAAC,KAAK,8BAA8B,CAAC,OAAO;YAAE,SAAS;QACvG,IAAI,CAAC,iCAAiC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACvD,YAAY,CACV,8BAA8B,EAC9B,sBAAsB,UAAU,EAAE,EAClC,eAAe,UAAU,oPAAoP,UAAU,gCAAgC,CACxT,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { MinionPlatformAccessScope } from './shared/minion-platform-access.vocabulary';\nimport { z } from 'zod';\nimport { ExternalProvider_ConnectionShapeSchema } from '@wildo-ai/external-connectors-models';\nimport { findMinionResourceAccessViolations } from './shared/minion-resource-access.validation';\nimport {\n AppFrontendType,\n ApplicationAiUsePostureSchema,\n ApplicationClientStorageInventorySchema,\n ApplicationOperatingJurisdictionsSchema,\n ApplicationOperatorComplianceIdentitySchema,\n ApplicationProviderComplianceChoicesSchema,\n ApplicationRetentionScheduleSchema,\n ApplicationRiskPostureSchema,\n EngineCapability,\n EngineCapabilityResolutionMode,\n getEngineCapabilityResolutionMode,\n PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY,\n ReviewCadence,\n type ApplicationAiUsePosture,\n type BuiltinProviderCapability,\n type ApplicationClientStorageInventory,\n type ApplicationOperatingJurisdictions,\n type ApplicationOperatorComplianceIdentity,\n type ApplicationProviderComplianceChoices,\n type ApplicationRetentionSchedule,\n type ApplicationRiskPosture,\n ProviderTier,\n ProviderBrowserOperationPoliciesSchema,\n ProviderAugmentationOptInsSchema,\n ProviderSharedConnectionsSchema,\n ProviderPackageAllowListSchema,\n OrganizationTypesConfigSchema,\n SystemsOfRecordConfigSchema,\n OrganizationTypeDerivationOutcome,\n deriveFirstAdministratorOrganizationType,\n resolveApplicationOwnerOrganizationType,\n type OrganizationTypesConfig,\n type SystemsOfRecordConfig,\n} from '@wildo-ai/saas-models';\nimport {\n BUILTIN_PROVIDER_CAPABILITY,\n BUILTIN_PROVIDER_PROTOCOL,\n} from '@wildo-ai/saas-models/public-runtime';\nimport { buildMinionServiceName, buildWorkerServiceName, normalizeServiceKeyToDnsName } from '@wildo-ai/platform-core-shared';\n// Phase 0 of the provider-registration refactor — see\n// `.cursor/plans/provider-registration-refactor-implementation-plan.md`\n// §Phase 0.13. Imports are `import type` so the schema-only authoring\n// in Phase 0 does not pull runtime code from the new packages.\nimport {\n UnimplementedFieldSource,\n createUnimplementedFieldWarner,\n} from '../_unimplemented/unimplemented-field-warning';\nimport { emitSoftWarn } from '../_unimplemented/soft-warn';\nimport { RegistryConfigSchema, type RegistryConfig } from '../registry/registry-config.schemas';\nimport { AppDataServicesSchema } from './shared/data-services.schemas';\nimport { ApplicationModulesSchema } from './shared/application-modules.schemas';\nimport { WildoSchemaVersionSchema } from './shared/schema-version.schemas';\nimport {\n AppLibraryDefinitionSchema,\n AppRefSchema,\n AppServiceDefinitionSchema,\n} from './shared/service-definitions.schemas';\n\n/**\n * Per-minion resource access whitelist (KD-11 in\n * `.cursor/plans/minions-and-workers-implementation.md`).\n *\n * Authored at the SaaS-config level (NOT inside `wildo.minion.config.ts`)\n * because the resource catalog is owned by the application's\n * `specifications` block — keeping the whitelist here ensures the\n * single authoring surface for \"what can each minion read / write?\"\n * lives next to \"what services exist in this app?\".\n *\n * Default semantics:\n * - Field omitted → minion gets NO repository access (fail-closed).\n * - `read: []` / `write: []` → explicit \"no access\" (same effect as omission,\n * but documents intent).\n * - `read: ['*']` → all readable resources (escape hatch — Phase 2's\n * `MinionScopedServicesRegistryHandlerBackendService` recognises the\n * wildcard sentinel).\n * - Resource names are validated cross-config in Phase 2 against the\n * parsed resource catalog (`start-minion-application` per IC-2);\n * Phase 1 only validates SHAPE, not membership.\n *\n * The bucket value is the existing `AppRefSchema` shape (strict,\n * `path` only) extended with the optional `resourceAccess` block —\n * extending `AppRefSchema.extend()` keeps the strict-key invariant\n * so an unknown key on a minion entry still parses to a clear error.\n */\nexport const MinionResourceAccessSchema = z.strictObject({\n read: z.array(z.string().min(1)).default([]),\n write: z.array(z.string().min(1)).default([]),\n}).superRefine((resourceAccess, ctx) => {\n // Enforced at PARSE time, not at grant-derivation time, and the difference is\n // the point: this is the declaration an author writes, so the error belongs\n // where they can see the line that caused it. By the time apps-manager derives\n // grants the config is long gone, and the failure would surface as a database\n // privilege nobody asked for.\n for (const violation of findMinionResourceAccessViolations(resourceAccess)) {\n ctx.addIssue({\n code: 'custom',\n path: [violation.axis],\n message: violation.message,\n });\n }\n});\nexport type MinionResourceAccess = z.infer<typeof MinionResourceAccessSchema>;\n\n/**\n * The authored PLATFORM-ACCESS declaration, as one named schema.\n *\n * Extracted from the inline literal it started as because the axis has to be\n * declared at every hop between `wildo.saas.config.ts` and the apps-manager\n * door — the managed declaration, its Zod schema, the bootstrap-config response,\n * the strict application-config object, and the engine's loader mirror. Six\n * hand-written copies of `{ scopes: z.array(...) }` is six chances for one of\n * them to disagree, and a hop that disagrees STRIPS the axis silently.\n *\n * Mirrors {@link MinionPlatformAccessDeclaration}, which is the type the\n * derivation (`buildOwnCronRecordFilter`) consumes.\n */\n/**\n * Reconciled 2026-08-18. Two parallel workstreams briefly declared this axis in\n * this file with different shapes — a flat capability array and this scoped\n * object — which is a duplicate `const`, a PARSE error, and took the whole file\n * (and `wildo config sync`) down. A third party then renamed one of them apart\n * to unblock the parse, which left the other's five call sites dangling.\n *\n * The scoped shape SURVIVED, by agreement with its author; the flat one and its\n * vocabulary are deleted. The name is back to the one those call sites already\n * use, so no consumer carries the scar of the collision.\n */\nexport const MinionPlatformAccessSchema = z.strictObject({\n scopes: z.array(z.enum(MinionPlatformAccessScope)).optional(),\n});\nexport type MinionPlatformAccess = z.infer<typeof MinionPlatformAccessSchema>;\n\n/**\n * The same axis as it TRAVELS, typed structurally.\n *\n * ## Why the carried type is not the authored one\n *\n * `MinionPlatformAccessSchema` infers `{ scopes?: MinionPlatformAccessScope[] }`,\n * and a TypeScript enum is a NOMINAL type. Every hop between the author and the\n * apps-manager door is re-declared in a package that would then have to NAME that\n * enum through a public specifier — and the engine's `AppConfiguration` cannot,\n * so `tsc` refuses the whole application-config schema:\n *\n * TS2742 The inferred type of 'Wildo_Application_ResolvedConfig_Schema'\n * cannot be named without a reference to '…/node_modules/@wildo-ai/saas-models/src'\n * TS7056 The inferred type of this node exceeds the maximum length the compiler will serialize\n *\n * Measured, not guessed: reverting only the engine-side field removes both\n * errors, and re-adding it structurally keeps them away. See\n * `.claude/rules/package-public-entrypoints.md` for the general mechanism.\n *\n * ## Why this loses nothing\n *\n * The vocabulary is enforced where enforcement belongs — at AUTHORING, by\n * `MinionPlatformAccessSchema` above, on the line the author wrote; and at the\n * DOOR, where apps-manager drops any scope this engine cannot name before it\n * mints an attestation. The hops in between are transport. Typing transported\n * data as the closed vocabulary would claim a guarantee the wire cannot give:\n * these values arrive from a stored declaration that some other engine revision\n * may have written.\n */\nexport const MinionPlatformAccessCarriedSchema = z.strictObject({\n scopes: z.array(z.string().min(1)).optional(),\n});\nexport type MinionPlatformAccessCarried = z.infer<typeof MinionPlatformAccessCarriedSchema>;\n\nconst MinionBucketEntrySchema = AppRefSchema.extend({\n resourceAccess: MinionResourceAccessSchema.optional(),\n /**\n * Whether this minion needs a route to the public internet (Step 5-egress).\n *\n * ## Why it is AUTHORED and defaults to false\n *\n * Network segmentation marks the backing-service networks `internal`, but\n * attachment to ANY non-internal network restores NAT — so \"may this runtime\n * reach the internet?\" is decided by one declaration and nowhere else. Marking\n * the data networks internal is necessary and not sufficient.\n *\n * It is NOT inferred from `resourceAccess`. A scraper legitimately reaches the\n * internet, and it is tempting to grant egress to any minion that touches data\n * — but declaring `read: ['todos']` is not a statement about the internet, and\n * conflating them would make egress universal for every data-touching minion,\n * which is precisely the \"everything can reach everything\" posture this removes.\n *\n * The point is not to refuse egress. It is to stop it being universal and\n * unstated, so a reviewer can see which minions leave the cluster and ask why.\n *\n * Default `false`, deliberately: the safe posture is the one an author gets by\n * not thinking about it. A minion that genuinely needs the internet says so in\n * one line, and that line is the thing a security review reads.\n */\n requiresInternetEgress: z.boolean().optional().default(false),\n /**\n * PLATFORM-level access — what this minion may see of the platform's record OF\n * ITSELF (R4 / R5). Today: its own cron/schedule entries.\n *\n * **Independent of `resourceAccess` by requirement, not by accident (R5).**\n * Neither implies the other, and nothing in the derivation of either consults\n * the other. A minion that works on todos and never inspects its schedule is a\n * normal shape; so is a health-reporting minion that reads its tick history and\n * touches no application data.\n *\n * The scope vocabulary has ONE member on purpose. There is no\n * `ALL_CRON_RECORDS`: a scope that could name another minion is a scope\n * somebody eventually grants, and R4 requires a cross-minion read to be\n * INEXPRESSIBLE rather than refused.\n */\n platformAccess: MinionPlatformAccessSchema.optional(),\n});\nexport type MinionBucketEntry = z.infer<typeof MinionBucketEntrySchema>;\n\nconst BootstrapFirstAdminSeedSchema = z.object({\n userTypes: z.array(z.string().min(1)).min(1),\n});\nexport type BootstrapFirstAdminSeed = z.infer<typeof BootstrapFirstAdminSeedSchema>;\n\nconst AppBootstrapSchema = z.object({\n firstAdmin: BootstrapFirstAdminSeedSchema.optional(),\n});\nexport type AppBootstrap = z.infer<typeof AppBootstrapSchema>;\ntype AppBootstrapInput = z.input<typeof AppBootstrapSchema>;\n\n/**\n * Per-runtime provider visibility authored at the application level.\n *\n * `defineSaaSProviders({ scopes })` is the canonical app-side provider\n * graph. Tooling materializes this declaration into runtime-specific\n * artifacts; runtime packages should consume those artifacts instead of\n * importing `wildo.saas.config.ts`.\n */\nexport const EngineCapabilityActivationSchema = z.strictObject({\n enabled: z.boolean(),\n required: z.boolean().optional(),\n});\nexport type EngineCapabilityActivation = z.infer<typeof EngineCapabilityActivationSchema>;\nexport type EngineCapabilityActivationInput = z.input<typeof EngineCapabilityActivationSchema>;\n\nexport const EngineCapabilityActivationsSchema = z.partialRecord(\n z.enum(EngineCapability),\n EngineCapabilityActivationSchema,\n).default({});\nexport type EngineCapabilityActivations = z.infer<typeof EngineCapabilityActivationsSchema>;\n\nexport const ProviderConfigurationsSchema = z.record(\n z.string().min(1),\n z.record(z.string().min(1), z.unknown()).optional(),\n).default(() => ({}));\nexport type ProviderConfigurations = z.infer<typeof ProviderConfigurationsSchema>;\nexport type ProviderConfigurationsInput = z.input<typeof ProviderConfigurationsSchema>;\n\nconst BUILTIN_PROVIDER_CAPABILITY_VALUES = new Set<string>(\n Object.values(BUILTIN_PROVIDER_CAPABILITY),\n);\nconst CUSTOM_PROVIDER_CAPABILITY_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;\n\nexport const ProviderCapabilitySelectorSchema = z.string().min(1).refine(\n (value) => BUILTIN_PROVIDER_CAPABILITY_VALUES.has(value) || CUSTOM_PROVIDER_CAPABILITY_PATTERN.test(value),\n {\n message:\n 'Provider capabilities must be a built-in ProviderCapability or app custom kebab-case capability.',\n },\n);\n\n/**\n * The protocols an application may WRITE: exactly the `BUILTIN_PROVIDER_PROTOCOL` keys. Until\n * 2026-09-05 (#327) the engine enum's snake_case wire values were accepted here too — a second\n * spelling that discovery (which compares against provider modules' declared KEYS) then refused\n * at boot with a message about reachability rather than about the protocol. The refusal now\n * happens at config time and names the value and the allowed set.\n */\nconst AUTHORABLE_PROVIDER_PROTOCOLS = new Set<string>(Object.values(BUILTIN_PROVIDER_PROTOCOL) as string[]);\n\nexport const ProviderProtocolSelectorSchema = z.string().min(1).superRefine((value, ctx) => {\n if (AUTHORABLE_PROVIDER_PROTOCOLS.has(value)) return;\n ctx.addIssue({\n code: 'custom',\n message:\n `Unknown or retired provider protocol \"${value}\". Authorable protocols: `\n + `${[...AUTHORABLE_PROVIDER_PROTOCOLS].join(', ')}.`,\n });\n});\n\nexport const SaasProviderScopeSelectionSchema = z.strictObject({\n engineCapabilities: z.array(z.enum(EngineCapability)).default([]),\n providerCapabilities: z.array(ProviderCapabilitySelectorSchema).default([]),\n protocols: z.array(ProviderProtocolSelectorSchema).default([]),\n /**\n * The tier the application EXPECTS this provider to hold (#328). A provider's\n * tier is declared on its module metadata, not here; this is the application\n * stating what it depends on, so that tooling can refuse a CATALOGUE provider\n * quietly filling a slot the application treats as core, and so that the\n * discovery walk (`wildo config sync`) can report a mismatch between the\n * expectation and the module. Like every other field of this selection it is\n * catalog-typed when `defineSaaSProviders<Catalog>` is used.\n */\n tier: z.enum(ProviderTier).optional(),\n /**\n * The vendor grouping the application expects (#328) — the sub-cut case:\n * `microsoft-graph-mail` and `microsoft-teams` both declare `vendor: 'microsoft'`,\n * which is the handle a shared OAuth client or secret is later bound by.\n */\n vendor: z.string().min(1).optional(),\n});\nexport type SaasProviderScopeSelection = z.infer<typeof SaasProviderScopeSelectionSchema>;\n\nexport const SaasProviderSelectionPolicySchema = z.strictObject({\n primary: z.string().min(1),\n /**\n * Ordered substitutes considered after the primary among providers eligible in the runtime scope.\n * Remaining eligible providers follow the policy refs. Resolution does not validate credentials\n * or vendor health, and an ineligible primary does not empty a nonempty eligible set.\n * These are NOT a failover list: nothing\n * retries a second provider when a call to the first one FAILS. Renamed from `fallbacks`\n * 2026-09-08, because that name promised the behaviour the framework deliberately does not\n * have (see `EngineCapabilityResolutionMode.SELECT_ONE`).\n */\n whenUnavailable: z.array(z.string().min(1)).default([]),\n});\nexport type SaasProviderSelectionPolicy = z.infer<typeof SaasProviderSelectionPolicySchema>;\n\nconst SaasProviderRuntimeScopeSchema = z.strictObject({\n providers: z.record(z.string().min(1), SaasProviderScopeSelectionSchema).default({}),\n selection: z.partialRecord(\n z.enum(EngineCapability),\n SaasProviderSelectionPolicySchema,\n ).optional(),\n}).superRefine((scope, ctx) => {\n const providerRefs = new Set(Object.keys(scope.providers));\n for (const [capability, policy] of Object.entries(scope.selection ?? {})) {\n for (const providerRef of [policy.primary, ...(policy.whenUnavailable ?? [])]) {\n if (!providerRefs.has(providerRef)) {\n ctx.addIssue({\n code: 'custom',\n path: ['selection', capability],\n message: `Provider selection for ${capability} references \"${providerRef}\" but it is not declared in this scope.`,\n });\n }\n }\n }\n});\nexport type SaasProviderRuntimeScope = z.infer<typeof SaasProviderRuntimeScopeSchema>;\n\n/**\n * WHICH of a provider's admissible connections THIS application permits.\n *\n * The two layers this sits between are the point, and they answer different questions. A provider's\n * catalogue record says what the VENDOR can support — Slack can be installed per workspace, so an\n * organization-owned connection is possible. This says what the APPLICATION offers — a product may\n * decide Slack is a shared team integration and never a personal one, even though the vendor allows\n * both. Collapsing them would make a vendor opening a capability look identical to a product\n * deciding to use it.\n *\n * NARROWING ONLY. An entry here can subtract from what the provider admits and can never add to it:\n * naming a connection the catalogue does not record grants nothing, because the vendor's own support\n * is not something an application can declare into existence. The registry intersects the two, and\n * a policy that intersects to nothing leaves the provider connectable by nobody — which is a\n * legitimate way to switch a provider's connect surface off without removing the provider.\n *\n * Absent means \"everything the provider admits\", not \"nothing\". A product that has never thought\n * about this gets the catalogue's answer, which is the conservative one already.\n */\nexport const SaasProviderConnectionPolicySchema = z.strictObject({\n /**\n * The permitted subset, as owner-scope × delegation pairs.\n *\n * Authored with the SAME vocabulary the catalogue and the runtime use, rather than a local copy:\n * a connection shape means one thing across the provider record, this policy, the connect leg and\n * the resolver, and three of those four would not notice a fourth spelling until a connection\n * silently failed to resolve.\n */\n admissible: z.array(ExternalProvider_ConnectionShapeSchema).min(1),\n});\nexport type SaasProviderConnectionPolicy = z.infer<typeof SaasProviderConnectionPolicySchema>;\n\nexport const SaasProviderConnectionPoliciesSchema = z.record(\n z.string().min(1),\n SaasProviderConnectionPolicySchema,\n).default(() => ({}));\nexport type SaasProviderConnectionPolicies = z.infer<typeof SaasProviderConnectionPoliciesSchema>;\n\nexport const SaasProvidersScopesSchema = z.strictObject({\n backend: SaasProviderRuntimeScopeSchema.optional(),\n companion: SaasProviderRuntimeScopeSchema.optional(),\n frontendServices: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),\n minions: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),\n workers: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),\n});\nexport type SaasProvidersScopes = z.infer<typeof SaasProvidersScopesSchema>;\n\nexport const SaasConfigProvidersBlockSchema = z.strictObject({\n scopes: SaasProvidersScopesSchema,\n /**\n * Per-provider connection policy. Sits beside `scopes` because both are the APPLICATION's decisions\n * about providers — one says which runtimes may reach a provider, the other which owners may\n * connect one — as opposed to `providerConfigurations`, which is an opaque per-provider runtime bag.\n */\n connections: SaasProviderConnectionPoliciesSchema,\n /**\n * Which provider operations a signed-in person's browser may trigger, and on whose account (#367).\n * The third of the application's decisions about providers, and the only one that opens a door: an\n * operation absent here is not reachable from a browser at all. `providerRef` → `operationId` → policy;\n * see `ProviderBrowserOperationPolicySchema` for the roles and connection rules.\n */\n browserOperations: ProviderBrowserOperationPoliciesSchema,\n /**\n * Which packages may ADD OPERATIONS to a provider they do not own (#1672), `baseRef` → package names. The\n * fourth of the application's decisions about providers, and a trust decision: an augmentation's operations\n * spend the base provider's grant. Absent means none — installing an augmenting package adds nothing. See\n * `ProviderAugmentationOptInsSchema`.\n *\n * assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — third-party code is admitted to a shared grant\n * only by the application's explicit, reviewable declaration.\n */\n augmentations: ProviderAugmentationOptInsSchema.optional(),\n /**\n * Which refs spend ONE vendor grant (#1725), `baseRef` → `{ refs, sharedWithSignIn? }`. The fifth of the\n * application's decisions about providers: the base ref owns the connection's OAuth client and audiences, and\n * every listed ref reads and writes the one stored grant. Absent means every ref is its own connection. Not to\n * be confused with `connections` above, which is a per-ref admissibility policy. See\n * `ProviderSharedConnectionsSchema`.\n *\n * assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — which refs may spend one delegated grant is the\n * application's explicit declaration, checked by `wildo config sync` and again when the registry boots.\n */\n sharedConnections: ProviderSharedConnectionsSchema.optional(),\n /**\n * Provider packages from OUTSIDE the names discovery walks by itself (#1676): a third party's\n * `@acme/wildo-provider-teams`. The sixth of the application's decisions about providers, and a trust decision:\n * a listed package's companion entry is executed by `wildo config sync`. Listing admits it to discovery and\n * activates nothing. Absent means none. See `ProviderPackageAllowListSchema`.\n *\n * assurance-control: WILDO.SECURITY.FAIL_CLOSED — third-party code enters provider discovery only by the\n * application's explicit, reviewable listing, and every admission is printed and recorded in the provider lock.\n */\n packages: ProviderPackageAllowListSchema.optional(),\n}).superRefine((block, ctx) => {\n // A base or a member no runtime scope declares cannot be reached, so the declaration would describe a grant\n // nothing spends — refused here, at the one place both halves are visible. Which scope must hold the BASE\n // beside each member is `wildo config sync`'s check, because it needs the discovered runtime targets.\n const scoped = new Set<string>([\n ...Object.keys(block.scopes.backend?.providers ?? {}),\n ...Object.keys(block.scopes.companion?.providers ?? {}),\n ...Object.values(block.scopes.frontendServices ?? {}).flatMap((scope) => Object.keys(scope.providers ?? {})),\n ...Object.values(block.scopes.minions ?? {}).flatMap((scope) => Object.keys(scope.providers ?? {})),\n ...Object.values(block.scopes.workers ?? {}).flatMap((scope) => Object.keys(scope.providers ?? {})),\n ]);\n for (const [baseRef, connection] of Object.entries(block.sharedConnections ?? {})) {\n for (const ref of [baseRef, ...connection.refs]) {\n if (!scoped.has(ref)) {\n ctx.addIssue({\n code: 'custom',\n path: ['sharedConnections', baseRef],\n message: `providers.sharedConnections.\"${baseRef}\" names \"${ref}\", which no providers.scopes entry declares. `\n + 'Scope every ref of a shared connection, its base included.',\n });\n }\n }\n }\n}).default(() => ({ scopes: {}, connections: {}, browserOperations: {} }));\nexport type SaasConfigProvidersBlock = z.infer<typeof SaasConfigProvidersBlockSchema>;\nexport type SaasConfigProvidersBlockInput = z.input<typeof SaasConfigProvidersBlockSchema>;\n\nexport interface SaasProviderCatalogEntry {\n engineCapabilities?: readonly string[];\n providerCapabilities?: readonly string[];\n protocols?: readonly string[];\n /** The tier the catalog records for the provider (#328). */\n tier?: ProviderTier;\n /** The vendor grouping the catalog records for the provider (#328). */\n vendor?: string;\n}\n\nexport type SaasProviderCatalog = Record<string, SaasProviderCatalogEntry>;\n\ntype CatalogFieldValue<\n TCatalog extends SaasProviderCatalog,\n TRef extends keyof TCatalog & string,\n TField extends keyof SaasProviderCatalogEntry,\n> = TCatalog[TRef][TField] extends readonly (infer TValue)[]\n ? Extract<TValue, string>\n : never;\n\nexport interface SaasProviderSelectionPolicyInput<TProviderRef extends string = string> {\n primary: TProviderRef;\n /** Ordered substitutes for an UNAVAILABLE preceding ref. Not failover — see the schema. */\n whenUnavailable?: TProviderRef[];\n}\n\nexport type SaasProviderScopeSelectionInputFromCatalog<\n TCatalog extends SaasProviderCatalog,\n TRef extends keyof TCatalog & string,\n> = {\n engineCapabilities?: Array<CatalogFieldValue<TCatalog, TRef, 'engineCapabilities'>>;\n providerCapabilities?: Array<CatalogFieldValue<TCatalog, TRef, 'providerCapabilities'>>;\n protocols?: Array<CatalogFieldValue<TCatalog, TRef, 'protocols'>>;\n /** Must equal the catalog's tier for the ref when the catalog records one. */\n tier?: TCatalog[TRef]['tier'];\n vendor?: TCatalog[TRef]['vendor'];\n};\n\nexport type SaasProviderRuntimeScopeInputFromCatalog<TCatalog extends SaasProviderCatalog> = {\n providers?: Partial<{\n [TRef in keyof TCatalog & string]: SaasProviderScopeSelectionInputFromCatalog<TCatalog, TRef>;\n }>;\n selection?: Partial<Record<\n EngineCapability,\n SaasProviderSelectionPolicyInput<keyof TCatalog & string>\n >>;\n};\n\nexport type SaasConfigProvidersBlockInputFromCatalog<TCatalog extends SaasProviderCatalog> = {\n connections?: z.input<typeof SaasProviderConnectionPoliciesSchema>;\n /** Keyed by a catalogued provider ref; see `SaasConfigProvidersBlockSchema.browserOperations`. */\n browserOperations?: Partial<Record<keyof TCatalog & string, z.input<typeof ProviderBrowserOperationPoliciesSchema>[string]>>;\n /** Keyed by a catalogued provider ref; see `SaasConfigProvidersBlockSchema.augmentations`. */\n augmentations?: Partial<Record<keyof TCatalog & string, string[]>>;\n /** Keyed by the catalogued BASE ref; see `SaasConfigProvidersBlockSchema.sharedConnections`. */\n sharedConnections?: Partial<Record<keyof TCatalog & string, { refs: Array<keyof TCatalog & string>; sharedWithSignIn?: boolean }>>;\n /** npm package names; see `SaasConfigProvidersBlockSchema.packages`. */\n packages?: string[];\n scopes: {\n backend?: SaasProviderRuntimeScopeInputFromCatalog<TCatalog>;\n companion?: SaasProviderRuntimeScopeInputFromCatalog<TCatalog>;\n frontendServices?: Record<string, SaasProviderRuntimeScopeInputFromCatalog<TCatalog>>;\n minions?: Record<string, SaasProviderRuntimeScopeInputFromCatalog<TCatalog>>;\n workers?: Record<string, SaasProviderRuntimeScopeInputFromCatalog<TCatalog>>;\n };\n};\n\nexport function defineSaaSProviders(\n providers: z.input<typeof SaasConfigProvidersBlockSchema>,\n): SaasConfigProvidersBlock;\nexport function defineSaaSProviders<TCatalog extends SaasProviderCatalog>(\n providers: SaasConfigProvidersBlockInputFromCatalog<TCatalog>,\n): SaasConfigProvidersBlock;\nexport function defineSaaSProviders(\n providers: z.input<typeof SaasConfigProvidersBlockSchema>,\n): SaasConfigProvidersBlock {\n return SaasConfigProvidersBlockSchema.parse(providers);\n}\n\nexport interface WildoSaasConfig {\n version?: z.infer<typeof WildoSchemaVersionSchema>;\n name: string;\n slug: string;\n displayName: string;\n description?: string;\n type: 'saas';\n services: Record<string, z.infer<typeof AppServiceDefinitionSchema>>;\n modules: z.infer<typeof ApplicationModulesSchema>;\n libraries?: Record<string, z.infer<typeof AppLibraryDefinitionSchema>>;\n specifications?: z.infer<typeof AppRefSchema>;\n minions?: Record<string, MinionBucketEntry>;\n workers?: Record<string, z.infer<typeof AppRefSchema>>;\n engineCapabilities: EngineCapabilityActivations;\n providerConfigurations: ProviderConfigurations;\n providers: SaasConfigProvidersBlock;\n /** See `WildoSaasConfigSchema.organizationTypes`. Required, at least one. */\n organizationTypes: OrganizationTypesConfig;\n /** See `WildoSaasConfigSchema.systemsOfRecord`. */\n systemsOfRecord?: SystemsOfRecordConfig;\n bootstrap?: AppBootstrap;\n dataServices: z.infer<typeof AppDataServicesSchema>;\n /** See `WildoSaasConfigSchema.dataRetention`. Optional and partial: an undeclared class is undecided, never \"forever\". */\n dataRetention?: ApplicationRetentionSchedule;\n /** See `WildoSaasConfigSchema.assuranceReviewCadence`. Absent means no committed review schedule, never a default. */\n assuranceReviewCadence?: ReviewCadence;\n /** See `WildoSaasConfigSchema.aiUsePosture`. An enabled AI capability with no entry is reported, never assumed harmless. */\n aiUsePosture?: ApplicationAiUsePosture;\n /** See `WildoSaasConfigSchema.clientStorage`. Keyed by frontend surface; an absent surface is uninventoried, an empty array is \"sets nothing\". */\n clientStorage?: ApplicationClientStorageInventory;\n /**\n * WHO operates this service, in what legal role, on what lawful basis (issue #131).\n *\n * The answers a compliance document needs in its opening sections. Absent, a produced privacy\n * notice cannot name who is publishing it — and because a landing REPLACES the document, an\n * operator who answered by editing it lost the answer on the next regeneration.\n */\n /**\n * WHERE this application operates (issue #229).\n *\n * A SIBLING of `operatorComplianceIdentity`, not a field inside it: where you sell is known long\n * before why you may process, and nesting it would make a jurisdiction unrecordable until the\n * lawful bases were settled.\n *\n * Absent means nobody has answered — never \"nowhere\". A declared jurisdiction that no registered\n * assurance source reaches is reported as a known unknown rather than passed over.\n */\n operatingJurisdictions?: ApplicationOperatingJurisdictions;\n operatorComplianceIdentity?: ApplicationOperatorComplianceIdentity;\n /**\n * Per configured provider, who runs it and where it processes (issue #130).\n *\n * The provider declares what is POSSIBLE; this is the operator's CHOICE among those. A vendor-hosted\n * provider is a third-party recipient a notice must enumerate; a self-hosted one is not a recipient\n * at all, and without this axis a produced notice would call an audit ledger you run yourself a\n * third party.\n */\n providerComplianceChoices?: ApplicationProviderComplianceChoices;\n /**\n * What the operator DECIDED to do about each derived risk signal (#300 Layer 2).\n *\n * The same possibilities/choice split as `providerComplianceChoices` above, one layer over: the\n * engine derives what is risky, and this is what the operator chose about it. PARTIAL by design —\n * a signal with no entry is reported as undeclared rather than refused, because a compliance\n * workflow may never stand in front of the mechanism, and because silence is not acceptance.\n *\n * A posture of `AVOIDED` is the one a measurement can CONTRADICT, which is the whole reason this\n * is typed configuration rather than prose: declare that an exposure is not taken while the\n * derivation finds it present, and the two statements cannot both be true.\n */\n riskPosture?: ApplicationRiskPosture;\n moduleRegistries?: RegistryConfig;\n}\n\nexport interface WildoSaasConfigInput {\n version?: z.input<typeof WildoSchemaVersionSchema>;\n name: string;\n slug: string;\n displayName: string;\n description?: string;\n type: 'saas';\n services: Record<string, z.input<typeof AppServiceDefinitionSchema>>;\n /**\n * OPTIONAL, matching `ApplicationModulesSchema`, which is `.optional()`. Declared as required\n * here it contradicted its own schema: a config that legitimately omits `modules` parses fine\n * at runtime and was rejected by the type.\n */\n modules?: z.input<typeof ApplicationModulesSchema>;\n libraries?: Record<string, z.input<typeof AppLibraryDefinitionSchema>>;\n specifications?: z.input<typeof AppRefSchema>;\n minions?: Record<string, z.input<typeof MinionBucketEntrySchema>>;\n workers?: Record<string, z.input<typeof AppRefSchema>>;\n engineCapabilities?: z.input<typeof EngineCapabilityActivationsSchema>;\n providerConfigurations?: z.input<typeof ProviderConfigurationsSchema>;\n providers?: z.input<typeof SaasConfigProvidersBlockSchema>;\n /** See `WildoSaasConfigSchema.organizationTypes`. Required, at least one. */\n organizationTypes: z.input<typeof OrganizationTypesConfigSchema>;\n bootstrap?: AppBootstrapInput;\n dataServices: z.input<typeof AppDataServicesSchema>;\n /** See `WildoSaasConfigSchema.systemsOfRecord`. */\n systemsOfRecord?: z.input<typeof SystemsOfRecordConfigSchema>;\n /** See `WildoSaasConfigSchema.dataRetention`. */\n dataRetention?: z.input<typeof ApplicationRetentionScheduleSchema>;\n /** See `WildoSaasConfigSchema.aiUsePosture`. */\n aiUsePosture?: z.input<typeof ApplicationAiUsePostureSchema>;\n /** See `WildoSaasConfigSchema.clientStorage`. */\n clientStorage?: z.input<typeof ApplicationClientStorageInventorySchema>;\n operatingJurisdictions?: z.input<typeof ApplicationOperatingJurisdictionsSchema>;\n operatorComplianceIdentity?: z.input<typeof ApplicationOperatorComplianceIdentitySchema>;\n providerComplianceChoices?: z.input<typeof ApplicationProviderComplianceChoicesSchema>;\n /** See `WildoSaasConfigSchema.riskPosture`. */\n riskPosture?: z.input<typeof ApplicationRiskPostureSchema>;\n moduleRegistries?: z.input<typeof RegistryConfigSchema>;\n}\n\n/**\n * @wildo_source:part:start platform.config.saas facet:layer:platform facet:family:bootstrap\n *\n * Root `wildo.saas.config.ts` application declaration: services, modules,\n * engine capabilities, provider scopes, provider configurations and data\n * services. Import `defineSaasConfig` from `@wildo-ai/platform-config-lib` and\n * keep cross-service choices here rather than scattering them through runtime\n * source files.\n */\n/**\n * The root schema is `z.strictObject` (not `z.object`) so that authoring an\n * unknown top-level key surfaces as a\n * Zod parse error at `defineSaasConfig` time instead of being silently\n * dropped. A typoed `dataServises:` block (or a removed-then-re-introduced\n * `secretsSharingPolicy`) would otherwise compile cleanly, parse cleanly,\n * and produce no runtime warning — exactly the failure mode the\n * `@unimplemented` machinery exists to prevent. The fail-closed posture\n * trades a slightly louder authoring boundary for a guarantee that every\n * authored top-level concern is either consumed or explicitly rejected.\n */\nexport const WildoSaasConfigSchema = z.strictObject({\n /**\n * Authored schema-format version for this `wildo.saas.config.ts`,\n * expressed as a **SemVer 2.0.0 string** (e.g. `'1.0.0'`,\n * `'2.3.1-rc.1'`, `'1.0.0+build.42'`).\n *\n * SemVer (not a bare integer) keeps MAJOR-vs-MINOR-vs-PATCH meaning explicit\n * for future configuration evolution — bare integers conflate \"breaking\", \"feature\n * add\" and \"bug-fix\" into a single dimension and force every bump to\n * look like a breaking change.\n *\n * The field is intentionally optional (no Zod default) so unauthored\n * configurations stay silent. Version-based migration enforcement is not\n * available yet; an authored value records intent but does not itself perform\n * a migration or authorize an incompatible configuration.\n */\n version: WildoSchemaVersionSchema.optional(),\n name: z.string().min(1),\n slug: z.string().min(1).regex(/^[a-z0-9-]+$/, 'slug must be lowercase alphanumeric with hyphens'),\n displayName: z.string().min(1),\n description: z.string().optional(),\n type: z.literal('saas'),\n\n services: z.record(z.string(), AppServiceDefinitionSchema),\n modules: ApplicationModulesSchema,\n libraries: z.record(z.string(), AppLibraryDefinitionSchema).optional(),\n specifications: AppRefSchema.optional(),\n /**\n * Long-running \"minion\" actor hosts (scheduled or always-up).\n *\n * Each entry declares the `resourceAccess` read/write allowlists consumed by\n * the minion runtime's scoped services-registry proxy. Missing lists deny\n * resource calls; unknown declared resource names fail startup. This is\n * runtime containment, separate from the operation's own authorization and\n * the minion's provider and platform-access scopes.\n */\n minions: z.record(z.string(), MinionBucketEntrySchema).optional(),\n /**\n * HTTP-only \"worker\" subprocesses (compute-heavy, often Rust/Go).\n *\n * Node workers use `defineWorkerInit` from `@wildo-ai/saas-workers-node-lib`;\n * other languages implement the same HTTP and token-verification contract.\n * Workers have no `resourceAccess` field: they are not backend queue consumers\n * and do not receive application repository access. Pass the data required\n * by their request contract instead of treating them as minions.\n */\n workers: z.record(z.string(), AppRefSchema).optional(),\n\n engineCapabilities: EngineCapabilityActivationsSchema,\n providerConfigurations: ProviderConfigurationsSchema,\n\n /**\n * Per-facet provider registries.\n *\n * Authored as a `z.custom` because the value is a constructed object\n * (registry instances carry methods like `getProviderByRef`); strict\n * runtime parsing of method-bearing values is intentionally skipped\n * — the application/provider composition boundary enforces the registry\n * invariants.\n *\n * See the `SaasConfigProvidersBlock` JSDoc above for the role of each\n * registry facet.\n */\n providers: SaasConfigProvidersBlockSchema,\n\n /**\n * The application's organization types — required, and at least one (#1032, decided 2026-09-14).\n *\n * Authored HERE rather than in `backend-api/src/saas-config.backend.ts`, where it used to live,\n * because the platform needs it and cannot read backend-authored configuration: apps-manager seeds\n * the organization of the application's first administrator, and that organization must carry one\n * of these types. It reaches the platform inside the declaration, like `providers` and\n * `engineCapabilities`, and the backend refuses to author it.\n *\n * Every organization carries a type, and a member of an organization whose type names no entry here\n * cannot sign in — which is why this is not optional.\n */\n organizationTypes: OrganizationTypesConfigSchema,\n\n bootstrap: AppBootstrapSchema.optional(),\n dataServices: AppDataServicesSchema,\n\n /**\n * The systems of record this application reads its own business rows out of — Odoo, an S/4HANA\n * OData service, a Dynamics deployment — each a NAMED INSTANCE that resources bind by name.\n *\n * Declared HERE, beside `dataServices`, because it answers the same question from the other side:\n * `dataServices` says which stores this application OWNS, and this says which stores it READS and\n * does not own. Both are application-wide operator decisions rather than per-resource authoring.\n *\n * Declaring the block is what ENABLES the external-data lane (#1055 D3); there is no capability\n * flag, because the lane has no meaning without an instance to point at. Each instance's ADDRESS\n * and SECRETS live in the environment (`wildo.infra.<location>.config.ts` and `secrets.json`) under\n * names DERIVED from the instance name — `WILDO_SOR_<NAME>__<SLOT>` — never authored, so renaming an\n * instance renames its variables and `wildo config sync` reports the ones that went missing.\n *\n * Not `providers`, deliberately (#1055 D10). A provider is selected through the capability plane and\n * may carry a person's lent credential; a system of record is a deployment the application reads with\n * its OWN service identity, and nothing serves both.\n */\n systemsOfRecord: SystemsOfRecordConfigSchema.optional(),\n\n /**\n * How long this application keeps each class of data, and why.\n *\n * Declared HERE, beside `dataServices`, because the two describe the same thing from opposite ends:\n * `dataServices` says which stores exist, and this says how long what is in them is kept. Both are\n * application-wide operator decisions rather than per-resource authoring.\n *\n * Optional as a whole, and partial within itself. An application that has decided nothing omits it;\n * one that has decided only its customer-data period declares only that. Absence is never read as\n * \"kept forever\" — a compliance document states the classes that ARE declared and marks the rest as\n * needing an operator decision, which is what lets the document be produced today rather than\n * waiting on a number nobody has yet.\n *\n * Two consumers, and the second is why the classes are the STORES: a privacy notice's retention\n * paragraph (issue #89, which is why this exists), and the backup-and-restore inventory a remote\n * environment still has none of (issue #8) — one declaration answers both instead of two that drift.\n */\n dataRetention: ApplicationRetentionScheduleSchema.optional(),\n\n /**\n * How often this application re-reviews its compliance programme.\n *\n * A COMMITMENT, and that is why it is declared rather than asked. `top_down.compliance-conception`\n * used to elicit a next-review DATE in free text — \"answer as an ISO date, after today's\" — which is\n * three things wrong at once: a date goes stale the moment it passes, it has to be re-answered on\n * every run, and it is a proxy for the thing actually being promised. The promise is the CADENCE;\n * the date is an output (`deriveNextReviewOn`), computed from the instant the programme was drafted.\n * The general form: a date is a PROXY for \"an input may have changed\", and where every input is\n * enumerable the trigger is computable and the date is an output, never a question.\n *\n * Optional, and an absent cadence is NOT a default. A programme produced without one is still\n * produced: no obligation carries a next-review date, and the programme states in a stamped limitation\n * that no schedule is committed. Committing to one is a workflow, and a workflow MARKS rather than\n * standing in front of the mechanism. Declaring it here is still the better place than any form: the\n * answer is committed, diffable, and reused by every later run.\n *\n * `AS_NEEDED` is a legitimate value for the vocabulary and schedules nothing, so it produces the same\n * marked programme as no declaration — never a silently chosen far-future date.\n *\n * The vocabulary is `ReviewCadence`, shared with market/roadmap/brand authoring rather than\n * re-declared — one closed vocabulary, one runtime source (CLAUDE.md).\n */\n assuranceReviewCadence: z.enum(ReviewCadence).optional(),\n\n /**\n * Whether each AI capability this application enables DECIDES something about a person, and who\n * reviews it if so.\n *\n * A capability establishes that AI is in use and for what function; it cannot establish consequence,\n * because the same `AI_LLM` backs a summariser that decides nothing and a screener that decides a\n * great deal (issue #92).\n *\n * Optional and partial, like `dataRetention` — but the silence here is the more dangerous one. A\n * notice describing AI use without addressing consequence does not read as \"unknown\", it reads as\n * \"nothing significant happens\", which silently claims an exemption. So an enabled AI capability with\n * no entry is REPORTED as outstanding rather than assumed harmless.\n */\n aiUsePosture: ApplicationAiUsePostureSchema.optional(),\n\n /**\n * What this application stores in a visitor's browser, per FRONTEND SURFACE — the itemised table a\n * cookie notice IS (issue #91).\n *\n * Per surface because a public marketing site and the authenticated application set different things,\n * and one merged list would be wrong for both. The FRAMEWORK's own cookies are not declared here:\n * every application inherits them and none authored them, so they are answered by\n * `ENGINE_CLIENT_STORAGE_ENTRIES` and reported separately.\n *\n * Optional and partial. A surface with no entry has not been inventoried and is reported as such; an\n * empty ARRAY is the different, positive answer — this surface sets nothing of its own.\n */\n clientStorage: ApplicationClientStorageInventorySchema.optional(),\n operatingJurisdictions: ApplicationOperatingJurisdictionsSchema.optional(),\n operatorComplianceIdentity: ApplicationOperatorComplianceIdentitySchema.optional(),\n providerComplianceChoices: ApplicationProviderComplianceChoicesSchema.optional(),\n riskPosture: ApplicationRiskPostureSchema.optional(),\n\n /**\n * Module registries the app pulls modules from. Each entry pairs a\n * stable id (used by lockfile entries + the `--registry <id>` CLI\n * flag) with a registry HTTP origin. Optional — when omitted, CLI\n * commands fall back to alias resolution (`local` / `public`) or\n * the env-policy default (`WILDO_FRAMEWORK_DEVELOPER` → local;\n * else public).\n *\n * Example: `[{ id: 'wildo', url: 'https://registry.wildo.ai' }]`\n *\n * Credentials never live here — they live per-machine under\n * the local Wildo credential store. This config only points at endpoints.\n */\n moduleRegistries: RegistryConfigSchema.optional(),\n\n // Technical-documentation and marketing-website configuration belong in\n // their respective service folders as\n // `wildo.tech-doc.config.ts` and `wildo.website.config.ts`,\n // co-located with the public packages that own their semantics\n // (`@wildo-ai/saas-technical-doc` and `@wildo-ai/saas-website`). The\n // schemas, types, `defineXxxConfig` helpers, and (for website) the\n // jiti-backed loader now live entirely in those packages.\n // The dev companion / Astro build discover and load each per-service\n // file via the unique service of the matching `frontendType`. The\n // single-frontend-per-kind constraint enforced by the `superRefine`\n // below guarantees that \"the TECH_DOC service folder\" and \"the\n // STATIC_WEBSITE service folder\" are unambiguous.\n}).superRefine((config, ctx) => {\n /*\n * The first administrator's organization type must be DERIVABLE, and this is the earliest place to\n * say so. apps-manager derives it at initialization with the same function; refusing here turns a\n * failure midway through provisioning into an authoring error at the moment the file is loaded.\n */\n const firstAdministratorUserTypes = config.bootstrap?.firstAdmin?.userTypes;\n if (firstAdministratorUserTypes !== undefined) {\n const derivation = deriveFirstAdministratorOrganizationType(config.organizationTypes, firstAdministratorUserTypes);\n if (derivation.outcome === OrganizationTypeDerivationOutcome.NONE) {\n ctx.addIssue({\n code: 'custom',\n path: ['bootstrap', 'firstAdmin', 'userTypes'],\n message:\n `No organization type covers the first administrator's user types (${firstAdministratorUserTypes.join(', ')}). `\n + 'The platform seeds the first administrator into an organization of the type whose `userTypes` include all of '\n + 'them; declare one in `organizationTypes`.',\n });\n } else if (derivation.outcome === OrganizationTypeDerivationOutcome.AMBIGUOUS) {\n ctx.addIssue({\n code: 'custom',\n path: ['bootstrap', 'firstAdmin', 'userTypes'],\n message:\n `Several organization types cover the first administrator's user types (${derivation.candidates.join(', ')}), `\n + 'so the type of the organization the platform seeds for them cannot be derived. Narrow the `userTypes` of all '\n + 'but one of them.',\n });\n }\n\n /*\n * A declared OWNER type must be able to take the bootstrap organization (#1054).\n *\n * The organization the platform seeds for the first administrator IS the organization that owns\n * the application, so a marked type whose `userTypes` do not cover the administrator's is a\n * declaration that cannot be satisfied. Without this the failure is SILENT rather than loud: the\n * derivation above finds no marked type among the fitting ones, falls through to the unmarked\n * candidates, and seeds the administrator into a customer-shaped tenant — leaving an application\n * that declares an owner type and has no owner organization, with no door that could type one\n * afterwards (`Organization.type` is creation-time identity).\n *\n * Checked here rather than in `OrganizationTypesConfigSchema`, because it is a statement about\n * TWO top-level blocks — `organizationTypes` and `bootstrap` — and the types schema can only see\n * its own.\n */\n const ownerTypeDerivation = resolveApplicationOwnerOrganizationType(config.organizationTypes);\n if (ownerTypeDerivation.outcome === OrganizationTypeDerivationOutcome.DERIVED) {\n const ownerTypeUserTypes = config.organizationTypes?.[ownerTypeDerivation.organizationType]?.userTypes ?? [];\n const uncoveredUserTypes = firstAdministratorUserTypes.filter((userType) => !ownerTypeUserTypes.includes(userType));\n if (uncoveredUserTypes.length > 0) {\n ctx.addIssue({\n code: 'custom',\n path: ['organizationTypes', ownerTypeDerivation.organizationType, 'userTypes'],\n message:\n `Organization type '${ownerTypeDerivation.organizationType}' declares \\`ownsApplication\\` but its \\`userTypes\\` `\n + `do not include ${uncoveredUserTypes.map((userType) => `'${userType}'`).join(', ')}, which the first administrator holds `\n + `(bootstrap.firstAdmin.userTypes: ${firstAdministratorUserTypes.join(', ')}). The organization seeded for the first `\n + 'administrator is the organization that owns the application, so the owner type must grant everything that '\n + 'administrator is. Add the missing user types to it, or move the marker to the type that already covers them.',\n });\n }\n }\n }\n\n /*\n * A declared system of record needs an organization to belong to (#1055, resting on #1054).\n *\n * Rows read out of a system of record are stamped with the OWNER organization's id, which is what\n * lets the per-row tenant gate pass with no exemption. An application that declares an instance and\n * no `ownsApplication` type has nothing to stamp with, so every read of every bound resource would\n * refuse at request time with `owner_organization_absent` — a runtime failure whose cause is an\n * authoring omission three layers up.\n *\n * Refused here rather than at boot because this is exactly the kind of contradiction one file can\n * see: both blocks are in scope, and turning it into an authoring error means nobody can commit it.\n * The DERIVATION being ambiguous (two marked types) is refused by `OrganizationTypesConfigSchema`\n * itself, so only the NONE outcome is left to answer here.\n */\n if (config.systemsOfRecord !== undefined && Object.keys(config.systemsOfRecord).length > 0) {\n const ownerTypeForSystemsOfRecord = resolveApplicationOwnerOrganizationType(config.organizationTypes);\n if (ownerTypeForSystemsOfRecord.outcome === OrganizationTypeDerivationOutcome.NONE) {\n ctx.addIssue({\n code: 'custom',\n path: ['systemsOfRecord'],\n message:\n `This application declares ${Object.keys(config.systemsOfRecord).map((name) => `'${name}'`).join(', ')} as a system of record, `\n + 'but no organization type declares `ownsApplication`. Rows read out of a system of record are stamped with the owning '\n + \"organization's id — that stamp is what makes them belong to a tenant at all — so without one every read would refuse. \"\n + 'Mark the organization type whose organization operates this application.',\n });\n }\n }\n\n const availableServiceKeys = new Set(Object.keys(config.services));\n const frontendServiceKeys = new Set(\n Object.entries(config.services)\n .filter(([, definition]) => definition.frontendType !== undefined)\n .map(([serviceKey]) => serviceKey),\n );\n\n for (const [moduleId, moduleBinding] of Object.entries(config.modules ?? {})) {\n for (const serviceKey of moduleBinding.services) {\n if (availableServiceKeys.has(serviceKey)) {\n continue;\n }\n\n ctx.addIssue({\n code: 'custom',\n path: ['modules', moduleId, 'services'],\n message: `Module \"${moduleId}\" references unknown service \"${serviceKey}\".`,\n });\n }\n }\n\n // Minion/worker bucket keys are RFC1123-normalized (via `buildMinionServiceName`\n // / `buildWorkerServiceName`) into the k8s object / built image / compose service\n // / worker dispatch-host DNS name at deploy time. camelCase keys are ACCEPTED and\n // normalized — matching the `services.<key>` convention and the existing\n // `WILDO_WORKER_<NAME>_URL` env-key normalization — but two keys that COLLAPSE to\n // the same DNS name would silently deploy as ONE Service/image, and a key that\n // normalizes to EMPTY (all-symbol) would emit an invalid trailing-hyphen name.\n // Fail fast at authoring on either, independently per background-runtime map.\n // The full generated deploy name is `{slug}-{minion|worker}-{dnsName}`. It is\n // used as the k8s Service `metadata.name` AND the `app.kubernetes.io/name` label\n // value — both bounded by the RFC1123 label limit of 63 chars. A longer name is\n // rejected by kubectl at deploy time (and by Docker for the image tag), so fail\n // fast at authoring rather than let CI/deploy blow up. Truncating instead would\n // be a silent \"trick\" that risks a collision with a sibling key — rejected.\n const K8S_LABEL_MAX_LENGTH = 63;\n for (const [mapLabel, bucket, buildServiceName] of [\n ['minions', config.minions, buildMinionServiceName],\n ['workers', config.workers, buildWorkerServiceName],\n ] as const) {\n if (!bucket) continue;\n const dnsNameToKey = new Map<string, string>();\n for (const bucketKey of Object.keys(bucket)) {\n const dnsName = normalizeServiceKeyToDnsName(bucketKey);\n if (dnsName.length === 0) {\n ctx.addIssue({\n code: 'custom',\n path: [mapLabel, bucketKey],\n message:\n `${mapLabel} key \"${bucketKey}\" normalizes to an empty DNS name — it must contain at least ` +\n `one [a-z0-9] character so the deployed k8s Service / image name is valid (e.g. \"market-scraper\").`,\n });\n continue;\n }\n const serviceName = buildServiceName(config.slug, bucketKey);\n if (serviceName.length > K8S_LABEL_MAX_LENGTH) {\n ctx.addIssue({\n code: 'custom',\n path: [mapLabel, bucketKey],\n message:\n `${mapLabel} key \"${bucketKey}\" generates the deploy name \"${serviceName}\" ` +\n `(${serviceName.length} chars), exceeding the ${K8S_LABEL_MAX_LENGTH}-char RFC1123 limit for a ` +\n `k8s Service / label name. Shorten the ${mapLabel.slice(0, -1)} key or the app slug (\"${config.slug}\").`,\n });\n }\n const existing = dnsNameToKey.get(dnsName);\n if (existing !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: [mapLabel, bucketKey],\n message:\n `${mapLabel} keys \"${existing}\" and \"${bucketKey}\" both normalize to the DNS name \"${dnsName}\" — ` +\n `they would deploy as the SAME k8s Service / image / compose service. Rename one so the normalized names differ.`,\n });\n continue;\n }\n dnsNameToKey.set(dnsName, bucketKey);\n }\n }\n\n const scopeBuckets: Record<string, ReadonlySet<string>> = {\n services: availableServiceKeys,\n minions: new Set(Object.keys(config.minions ?? {})),\n workers: new Set(Object.keys(config.workers ?? {})),\n };\n\n const validateProviderScope = (\n scopePath: Array<string | number>,\n scope: SaasProviderRuntimeScope | undefined,\n ): void => {\n if (!scope) return;\n\n for (const [providerRef, selection] of Object.entries(scope.providers)) {\n for (const capability of selection.engineCapabilities) {\n if (config.engineCapabilities?.[capability]?.enabled !== true) {\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'providers', providerRef, 'engineCapabilities'],\n message:\n `Provider \"${providerRef}\" selects disabled or unauthored engine capability \"${capability}\".`,\n });\n }\n }\n\n /*\n * The two capability lists must AGREE (#438). `providerCapabilities` are vendor-side tokens;\n * `PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY` projects each into the engine slot it fills, and\n * `engineCapabilities` is the application's statement of which slots this provider serves in\n * this scope. Two statements about one fact, and nothing compared them.\n *\n * Measured on Wonder Todos before this check existed: the companion scope declared\n * `providerCapabilities: ['CODING_AGENT']` under `engineCapabilities: [AI_LLM]` — a token\n * that projects to AI_CODING_AGENT, claiming a slot it does not fill and omitting the one it\n * does. It was invisible because a coding agent resolves its provider by `providerRef`, never\n * through the slot, so nothing ever asked the projection whether it agreed.\n *\n * A token with NO slot (`SSO_OAUTH2`, `FRONTEND_FILE_PICKER`, `FRONTEND_CAPTCHA`) projects to\n * nothing and is not an omission — those providers legitimately declare no engine capability.\n * Only tokens that DO map participate, which is why this compares sets rather than counts.\n */\n const projectedCapabilities = new Set(\n selection.providerCapabilities\n .map((token) => PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY[token as BuiltinProviderCapability])\n .filter((capability): capability is EngineCapability => Boolean(capability)),\n );\n const declaredCapabilities = new Set<EngineCapability>(selection.engineCapabilities as EngineCapability[]);\n\n const claimedButNotProjected = [...declaredCapabilities].filter((capability) => !projectedCapabilities.has(capability));\n const projectedButNotClaimed = [...projectedCapabilities].filter((capability) => !declaredCapabilities.has(capability));\n\n if (claimedButNotProjected.length > 0 || projectedButNotClaimed.length > 0) {\n const parts: string[] = [];\n if (projectedButNotClaimed.length > 0) {\n parts.push(\n `providerCapabilities project ${projectedButNotClaimed.join(', ')} which engineCapabilities does not declare`,\n );\n }\n if (claimedButNotProjected.length > 0) {\n parts.push(\n `engineCapabilities declares ${claimedButNotProjected.join(', ')} which no declared providerCapability projects`,\n );\n }\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'providers', providerRef, 'engineCapabilities'],\n message:\n `Provider \"${providerRef}\" declares capability lists that disagree: ${parts.join('; ')}. `\n + 'The two lists describe one fact — which engine slots this provider serves in this scope — '\n + 'so make them agree by adding the missing engineCapabilities, or by removing a providerCapability the provider does not serve here.',\n });\n }\n }\n\n for (const [capability, policy] of Object.entries(scope.selection ?? {})) {\n // A FAN_OUT capability (e.g. COMPLIANCE_AUDIT_TRAIL) writes to EVERY declared\n // provider — a `selection` (primary + failover) is meaningless for it. Reject\n // it; declaring the providers is enough (all are active).\n if (\n getEngineCapabilityResolutionMode(capability as EngineCapability)\n === EngineCapabilityResolutionMode.FAN_OUT\n ) {\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'selection', capability],\n message:\n `\"${capability}\" is a FAN_OUT capability — every declared provider is active (no primary/failover). Remove its \\`selection\\` entry; declaring the providers is enough.`,\n });\n continue;\n }\n for (const providerRef of [policy.primary, ...(policy.whenUnavailable ?? [])]) {\n const providerSelection = scope.providers[providerRef];\n if (providerSelection && !providerSelection.engineCapabilities.includes(capability as EngineCapability)) {\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'selection', capability],\n message:\n `Provider selection for \"${capability}\" references provider \"${providerRef}\" that does not declare engineCapabilities including ${capability}.`,\n });\n }\n }\n }\n };\n\n validateProviderScope(['providers', 'scopes', 'backend'], config.providers?.scopes.backend);\n validateProviderScope(['providers', 'scopes', 'companion'], config.providers?.scopes.companion);\n\n for (const [serviceKey, scope] of Object.entries(config.providers?.scopes.frontendServices ?? {})) {\n if (!availableServiceKeys.has(serviceKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'frontendServices', serviceKey],\n message: `Provider scope references unknown frontend service \"${serviceKey}\".`,\n });\n } else if (!frontendServiceKeys.has(serviceKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'frontendServices', serviceKey],\n message:\n `Provider scope references non-frontend service \"${serviceKey}\". ` +\n 'Only services with a frontendType may appear under providers.scopes.frontendServices.',\n });\n }\n validateProviderScope(['providers', 'scopes', 'frontendServices', serviceKey], scope);\n }\n\n for (const [minionKey, scope] of Object.entries(config.providers?.scopes.minions ?? {})) {\n if (!scopeBuckets.minions.has(minionKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'minions', minionKey],\n message: `Provider scope references unknown minion \"${minionKey}\".`,\n });\n }\n validateProviderScope(['providers', 'scopes', 'minions', minionKey], scope);\n }\n\n for (const [workerKey, scope] of Object.entries(config.providers?.scopes.workers ?? {})) {\n if (!scopeBuckets.workers.has(workerKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'workers', workerKey],\n message: `Provider scope references unknown worker \"${workerKey}\".`,\n });\n }\n validateProviderScope(['providers', 'scopes', 'workers', workerKey], scope);\n }\n\n // At most one service may use each \"single-instance\" frontend kind.\n //\n // `TECH_DOC` and `STATIC_WEBSITE` are framework-managed singletons:\n // a SaaS app has at most one technical-documentation site and at\n // most one marketing/landing site. The per-service config files\n // (`wildo.tech-doc.config.ts` for `TECH_DOC`, `wildo.website.config.ts`\n // for `STATIC_WEBSITE`) are discovered by the companion / Astro\n // build through the unique service of the matching `frontendType`.\n // If the schema allowed two `TECH_DOC` services, the companion\n // would have no deterministic way to project the OpenAPI YAMLs to\n // \"the\" docs root — every consumer would need a \"which docs\n // service?\" indirection for no real-world payoff (multi-doc-site\n // / multi-marketing-site SaaS apps are not a use case we have\n // ever needed to support).\n //\n // The constraint is enforced at parse time so the failure surfaces\n // at `defineSaasConfig` (CLI parse, dev watcher reload) rather than\n // at first companion-driven OpenAPI publish — the latter would be\n // a confusing \"your second docs service was silently picked over\n // the first\" type of failure.\n //\n // `SAAS_APP` is intentionally NOT constrained here: a single repo\n // can ship multiple SaaS-app frontends (e.g. a customer surface and\n // an internal admin), each owning its own session, and the\n // cross-frontend handoff already handles that fan-out via\n // `runtime.endPoints[*].publicUrl`. The session-owning role does not\n // create a unique-receiver assumption the way the docs / website\n // frontends do.\n const singletonFrontends: ReadonlyArray<AppFrontendType> = [\n AppFrontendType.TECH_DOC,\n AppFrontendType.STATIC_WEBSITE,\n ];\n for (const kind of singletonFrontends) {\n const matchingServiceKeys = Object.entries(config.services)\n .filter(([, def]) => def.frontendType === kind)\n .map(([key]) => key);\n if (matchingServiceKeys.length > 1) {\n for (const offendingKey of matchingServiceKeys) {\n ctx.addIssue({\n code: 'custom',\n path: ['services', offendingKey, 'frontendType'],\n message:\n `frontendType='${kind}' may be declared on at most one service ` +\n `per SaaS app (found ${matchingServiceKeys.length}: ${matchingServiceKeys.join(', ')}). ` +\n `${kind} is a framework-managed singleton — the companion / build ` +\n `pipeline addresses it as \"the ${kind} service\" with no disambiguator. ` +\n `Collapse the duplicates into a single service or split them into separate apps.`,\n });\n }\n }\n }\n}) as unknown as z.ZodType<WildoSaasConfig, WildoSaasConfigInput>;\n/** @wildo_source:part:end platform.config.saas */\n\n/**\n * Define a SaaS application configuration.\n * Provides full IDE autocompletion for engine capabilities, provider scopes,\n * services, modules, and data services.\n *\n * @example\n * ```ts\n * import { defineSaasConfig } from '@wildo-ai/platform-config-lib';\n * import { EngineCapability } from '@wildo-ai/saas-models';\n *\n * export default defineSaasConfig({\n * name: 'wonder-todos',\n * slug: 'wonder-todos',\n * displayName: 'Wonder Todos',\n * type: 'saas',\n * engineCapabilities: {\n * [EngineCapability.EMAIL_TRANSACTIONAL]: { enabled: true },\n * [EngineCapability.SMS]: { enabled: false },\n * [EngineCapability.AI_LLM]: { enabled: true },\n * },\n * providerConfigurations: {},\n * providers: defineSaaSProviders({\n * scopes: {\n * backend: {\n * providers: {\n * resend: {\n * engineCapabilities: [EngineCapability.EMAIL_TRANSACTIONAL],\n * providerCapabilities: ['EMAIL_TRANSACTIONAL'],\n * protocols: ['EMAIL_PROVIDER'],\n * },\n * },\n * },\n * },\n * }),\n * // ...\n * });\n * ```\n */\nexport function defineSaasConfig(config: WildoSaasConfigInput): WildoSaasConfig {\n const parsed = WildoSaasConfigSchema.parse(config);\n emitUnimplementedRuntimeWarnings(parsed);\n return parsed;\n}\n\n/**\n * Emit `@unimplemented` parse-time warnings for every authored field that\n * has no runtime consumer yet (Slice 3.4 contract — see\n * `_unimplemented/unimplemented-field-warning.ts` JSDoc for the full\n * design rationale and the per-call dedupe semantics).\n *\n * The full surface and the matching deferred-backlog IDs are documented\n * once in `.cursor/context/cli-dx.md` (\"Schema fields with `@unimplemented`\n * runtime contract\"). When a deferred slice ships, the matching `if`\n * branch below MUST be removed in the same commit as the runtime wiring\n * — leaving a stale warning is worse than silence because authors will\n * start ignoring the channel.\n *\n * Surfaces today:\n *\n * - `version` (!== undefined) → `D-5`\n *\n * The `minions` / `workers` `@unimplemented` branches were REMOVED\n * 2026-05-05 with the close of D-1 once the runtime path landed\n * end-to-end (publisher → per-minion queue → minion consumer →\n * onTick handler / worker host with HTTP+JWT verifier + apps-manager\n * deploy orchestration). See the close-out note in\n * `.claude/plans/minions-and-workers-implementation.md` Phase 4. The\n * per-entry `resourceAccess` soft-warns below stay — those are\n * advisories about the authoring contract, not \"runtime missing\"\n * markers.\n *\n * Provider activation and product feature modeling no longer warn here:\n * `engineCapabilities` and `providers` are active runtime inputs, while\n * entitlement/product features live in the feature system.\n *\n * The `csp?` placeholder warning that previously lived here moved to\n * `engine/saas-technical-doc/src/config/define-tech-doc-config.ts`\n * along with the rest of `WildoTechnicalDocConfigSchema` (Step 7.5\n * refactor, saas-technical-doc.md). The `wildo.tech-doc.config.ts`\n * loader emits `[wildo-tech-doc-config] @unimplemented field 'csp'\n * authored — runtime support tracked under D-CSP` whenever a value\n * is authored.\n *\n * For `version` the test is `!== undefined` because the field is\n * `.optional()` (no default) — the warning fires iff the author wrote\n * `version: <n>` in their config. See the JSDoc on the schema field\n * above for the rationale.\n */\nfunction emitUnimplementedRuntimeWarnings(config: WildoSaasConfig): void {\n const warn = createUnimplementedFieldWarner(UnimplementedFieldSource.SAAS_CONFIG);\n\n if (config.version !== undefined) {\n warn('version', 'D-5');\n }\n\n // H-3 (`minions-and-workers-implementation.md` Phase 1): per-minion\n // soft-warns covering the KD-11 `resourceAccess` authoring posture.\n // These fire AFTER the `@unimplemented` block per the IC-1 emit-\n // ordering contract; the `emitSoftWarn` utility caps repeats\n // process-wide so the dev watcher's per-save re-parses do not spam.\n //\n // Two advisory shapes (the per-resource membership check against the parsed catalog runs in Phase 2\n // from `start-minion-application` per IC-2 — Phase 1 only validates STRUCTURAL shape):\n //\n // 1. `resourceAccess.missing` — entry omits the block entirely\n // (fail-closed default; advisory\n // so a forgotten whitelist is\n // visible without blocking dev).\n // 2. `resourceAccess.empty` — both `read` and `write` are\n // empty arrays (intent-equivalent\n // to omission, but flagged so the\n // author knows the minion will be\n // blocked at every repository call).\n //\n // An ASYMMETRIC whitelist (`write: []` beside a non-empty `read`, or the reverse) is NOT advised on,\n // and it used to be (`resourceAccess.read-only` / `.write-only`). Both fields are required, so an empty\n // side is always AUTHORED — it is the declaration of intent, not a typo — and the advisory told the\n // author to \"keep as-is\" while printing on every `wildo` command with no way to acknowledge it (#1637:\n // Wonder Todos' read-only scraper put it at the top of every command's output). A side left empty by\n // mistake is refused at the first call that needs it, by `ResourceAccessForbiddenError`, which names the\n // minion, the resource and the access mode.\n for (const [minionKey, entry] of Object.entries(config.minions ?? {})) {\n const scope = `minions.${minionKey}`;\n if (!entry.resourceAccess) {\n emitSoftWarn(\n scope,\n 'resourceAccess.missing',\n 'no resourceAccess block authored — the v1 minion runtime will deny every repository call by default (KD-11 fail-closed). Author { read: [...], write: [...] } in wildo.saas.config.ts > minions to opt-in.',\n );\n continue;\n }\n const { read, write } = entry.resourceAccess;\n if (read.length === 0 && write.length === 0) {\n emitSoftWarn(\n scope,\n 'resourceAccess.empty',\n 'resourceAccess block is present but both `read` and `write` are empty arrays — equivalent to omitting the block. Author at least one resource name to grant access.',\n );\n }\n }\n\n // M1 (audit-logging Phase 1+2 hardening) — coherence advisory: an ENABLED\n // capability whose resolution mode is FAN_OUT (e.g. COMPLIANCE_AUDIT_TRAIL)\n // writes to EVERY declared provider, so with ZERO providers declaring it the\n // fan-out is a SILENT no-op — the exact compliance hole (an \"enabled\" audit\n // trail that reaches nothing) a config check should surface. The inverse (a\n // provider declaring a non-`enabled` capability) is already a HARD error in the\n // provider-scope refinement, so only this enabled-but-unserved direction needs\n // an advisory. Soft-warn (not fail-closed) so the enable-first-then-wire\n // authoring order isn't blocked.\n const capabilitiesDeclaredByAnyProvider = new Set<EngineCapability>();\n const allProviderScopes = [\n config.providers?.scopes.backend,\n config.providers?.scopes.companion,\n ...Object.values(config.providers?.scopes.frontendServices ?? {}),\n ...Object.values(config.providers?.scopes.minions ?? {}),\n ...Object.values(config.providers?.scopes.workers ?? {}),\n ];\n for (const scope of allProviderScopes) {\n if (!scope) continue;\n for (const providerSelection of Object.values(scope.providers)) {\n for (const capability of providerSelection.engineCapabilities) {\n capabilitiesDeclaredByAnyProvider.add(capability);\n }\n }\n }\n for (const [capabilityKey, activation] of Object.entries(config.engineCapabilities ?? {})) {\n if (activation?.enabled !== true) continue;\n const capability = capabilityKey as EngineCapability;\n if (getEngineCapabilityResolutionMode(capability) !== EngineCapabilityResolutionMode.FAN_OUT) continue;\n if (!capabilitiesDeclaredByAnyProvider.has(capability)) {\n emitSoftWarn(\n 'providers.engineCapabilities',\n `fanout-no-provider:${capability}`,\n `capability \"${capability}\" is enabled and FAN_OUT (every declared provider receives every emission), but NO provider in any scope declares it — its fan-out (e.g. the compliance audit trail) is a SILENT no-op. Declare at least one provider with engineCapabilities: ['${capability}'], or disable the capability.`,\n );\n }\n }\n}\n"]}
1
+ {"version":3,"file":"define-saas-config.js","sourceRoot":"","sources":["../../../src/project-config/define-saas-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAChG,OAAO,EACL,eAAe,EACf,6BAA6B,EAC7B,uCAAuC,EACvC,uCAAuC,EACvC,2CAA2C,EAC3C,0CAA0C,EAC1C,kCAAkC,EAClC,4BAA4B,EAC5B,gBAAgB,EAChB,8BAA8B,EAC9B,iCAAiC,EACjC,wCAAwC,EACxC,aAAa,EASb,YAAY,EACZ,sCAAsC,EACtC,gCAAgC,EAChC,+BAA+B,EAC/B,8BAA8B,EAC9B,6B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U,IAAI,iBAAiB,CAAC,kBAAkB,EAAE,CAAC;gBAC9D,iCAAiC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;IACH,CAAC;IACD,KAAK,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC,EAAE,CAAC;QAC1F,IAAI,UAAU,EAAE,OAAO,KAAK,IAAI;YAAE,SAAS;QAC3C,MAAM,UAAU,GAAG,aAAiC,CAAC;QACrD,IAAI,iCAAiC,CAAC,UAAU,CAAC,KAAK,8BAA8B,CAAC,OAAO;YAAE,SAAS;QACvG,IAAI,CAAC,iCAAiC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACvD,YAAY,CACV,8BAA8B,EAC9B,sBAAsB,UAAU,EAAE,EAClC,eAAe,UAAU,oPAAoP,UAAU,gCAAgC,CACxT,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { MinionPlatformAccessScope } from './shared/minion-platform-access.vocabulary';\nimport { z } from 'zod';\nimport { ExternalProvider_ConnectionShapeSchema } from '@wildo-ai/external-connectors-models';\nimport { findMinionResourceAccessViolations } from './shared/minion-resource-access.validation';\nimport {\n AppFrontendType,\n ApplicationAiUsePostureSchema,\n ApplicationClientStorageInventorySchema,\n ApplicationOperatingJurisdictionsSchema,\n ApplicationOperatorComplianceIdentitySchema,\n ApplicationProviderComplianceChoicesSchema,\n ApplicationRetentionScheduleSchema,\n ApplicationRiskPostureSchema,\n EngineCapability,\n EngineCapabilityResolutionMode,\n getEngineCapabilityResolutionMode,\n PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY,\n ReviewCadence,\n type ApplicationAiUsePosture,\n type BuiltinProviderCapability,\n type ApplicationClientStorageInventory,\n type ApplicationOperatingJurisdictions,\n type ApplicationOperatorComplianceIdentity,\n type ApplicationProviderComplianceChoices,\n type ApplicationRetentionSchedule,\n type ApplicationRiskPosture,\n ProviderTier,\n ProviderBrowserOperationPoliciesSchema,\n ProviderAugmentationOptInsSchema,\n ProviderSharedConnectionsSchema,\n ProviderPackageAllowListSchema,\n OrganizationTypesConfigSchema,\n SystemsOfRecordConfigSchema,\n OrganizationTypeDerivationOutcome,\n deriveFirstAdministratorOrganizationType,\n resolveApplicationOwnerOrganizationType,\n type OrganizationTypesConfig,\n type SystemsOfRecordConfig,\n} from '@wildo-ai/saas-models';\nimport {\n BUILTIN_PROVIDER_CAPABILITY,\n BUILTIN_PROVIDER_PROTOCOL,\n} from '@wildo-ai/saas-models/public-runtime';\nimport { buildMinionServiceName, buildWorkerServiceName, normalizeServiceKeyToDnsName } from '@wildo-ai/platform-core-shared';\n// Phase 0 of the provider-registration refactor — see\n// `.cursor/plans/provider-registration-refactor-implementation-plan.md`\n// §Phase 0.13. Imports are `import type` so the schema-only authoring\n// in Phase 0 does not pull runtime code from the new packages.\nimport {\n UnimplementedFieldSource,\n createUnimplementedFieldWarner,\n} from '../_unimplemented/unimplemented-field-warning';\nimport { emitSoftWarn } from '../_unimplemented/soft-warn';\nimport { RegistryConfigSchema, type RegistryConfig } from '../registry/registry-config.schemas';\nimport { AppDataServicesSchema } from './shared/data-services.schemas';\nimport { ApplicationModulesSchema } from './shared/application-modules.schemas';\nimport { WildoSchemaVersionSchema } from './shared/schema-version.schemas';\nimport {\n AppLibraryDefinitionSchema,\n AppRefSchema,\n AppServiceDefinitionSchema,\n} from './shared/service-definitions.schemas';\n\n/**\n * Per-minion resource access whitelist (KD-11 in\n * `.cursor/plans/minions-and-workers-implementation.md`).\n *\n * Authored at the SaaS-config level (NOT inside `wildo.minion.config.ts`)\n * because the resource catalog is owned by the application's\n * `specifications` block — keeping the whitelist here ensures the\n * single authoring surface for \"what can each minion read / write?\"\n * lives next to \"what services exist in this app?\".\n *\n * Default semantics:\n * - Field omitted → minion gets NO repository access (fail-closed).\n * - `read: []` / `write: []` → explicit \"no access\" (same effect as omission,\n * but documents intent).\n * - `read: ['*']` → all readable resources (escape hatch — Phase 2's\n * `MinionScopedServicesRegistryHandlerBackendService` recognises the\n * wildcard sentinel).\n * - Resource names are validated cross-config in Phase 2 against the\n * parsed resource catalog (`start-minion-application` per IC-2);\n * Phase 1 only validates SHAPE, not membership.\n *\n * The bucket value is the existing `AppRefSchema` shape (strict,\n * `path` only) extended with the optional `resourceAccess` block —\n * extending `AppRefSchema.extend()` keeps the strict-key invariant\n * so an unknown key on a minion entry still parses to a clear error.\n */\nexport const MinionResourceAccessSchema = z.strictObject({\n read: z.array(z.string().min(1)).default([]),\n write: z.array(z.string().min(1)).default([]),\n}).superRefine((resourceAccess, ctx) => {\n // Enforced at PARSE time, not at grant-derivation time, and the difference is\n // the point: this is the declaration an author writes, so the error belongs\n // where they can see the line that caused it. By the time apps-manager derives\n // grants the config is long gone, and the failure would surface as a database\n // privilege nobody asked for.\n for (const violation of findMinionResourceAccessViolations(resourceAccess)) {\n ctx.addIssue({\n code: 'custom',\n path: [violation.axis],\n message: violation.message,\n });\n }\n});\nexport type MinionResourceAccess = z.infer<typeof MinionResourceAccessSchema>;\n\n/**\n * The authored PLATFORM-ACCESS declaration, as one named schema.\n *\n * Extracted from the inline literal it started as because the axis has to be\n * declared at every hop between `wildo.saas.config.ts` and the apps-manager\n * door — the managed declaration, its Zod schema, the bootstrap-config response,\n * the strict application-config object, and the engine's loader mirror. Six\n * hand-written copies of `{ scopes: z.array(...) }` is six chances for one of\n * them to disagree, and a hop that disagrees STRIPS the axis silently.\n *\n * Mirrors {@link MinionPlatformAccessDeclaration}, which is the type the\n * derivation (`buildOwnCronRecordFilter`) consumes.\n */\n/**\n * Reconciled 2026-08-18. Two parallel workstreams briefly declared this axis in\n * this file with different shapes — a flat capability array and this scoped\n * object — which is a duplicate `const`, a PARSE error, and took the whole file\n * (and `wildo config sync`) down. A third party then renamed one of them apart\n * to unblock the parse, which left the other's five call sites dangling.\n *\n * The scoped shape SURVIVED, by agreement with its author; the flat one and its\n * vocabulary are deleted. The name is back to the one those call sites already\n * use, so no consumer carries the scar of the collision.\n */\nexport const MinionPlatformAccessSchema = z.strictObject({\n scopes: z.array(z.enum(MinionPlatformAccessScope)).optional(),\n});\nexport type MinionPlatformAccess = z.infer<typeof MinionPlatformAccessSchema>;\n\n/**\n * The same axis as it TRAVELS, typed structurally.\n *\n * ## Why the carried type is not the authored one\n *\n * `MinionPlatformAccessSchema` infers `{ scopes?: MinionPlatformAccessScope[] }`,\n * and a TypeScript enum is a NOMINAL type. Every hop between the author and the\n * apps-manager door is re-declared in a package that would then have to NAME that\n * enum through a public specifier — and the engine's `AppConfiguration` cannot,\n * so `tsc` refuses the whole application-config schema:\n *\n * TS2742 The inferred type of 'Wildo_Application_ResolvedConfig_Schema'\n * cannot be named without a reference to '…/node_modules/@wildo-ai/saas-models/src'\n * TS7056 The inferred type of this node exceeds the maximum length the compiler will serialize\n *\n * Measured, not guessed: reverting only the engine-side field removes both\n * errors, and re-adding it structurally keeps them away. See\n * `.claude/rules/package-public-entrypoints.md` for the general mechanism.\n *\n * ## Why this loses nothing\n *\n * The vocabulary is enforced where enforcement belongs — at AUTHORING, by\n * `MinionPlatformAccessSchema` above, on the line the author wrote; and at the\n * DOOR, where apps-manager drops any scope this engine cannot name before it\n * mints an attestation. The hops in between are transport. Typing transported\n * data as the closed vocabulary would claim a guarantee the wire cannot give:\n * these values arrive from a stored declaration that some other engine revision\n * may have written.\n */\nexport const MinionPlatformAccessCarriedSchema = z.strictObject({\n scopes: z.array(z.string().min(1)).optional(),\n});\nexport type MinionPlatformAccessCarried = z.infer<typeof MinionPlatformAccessCarriedSchema>;\n\nconst MinionBucketEntrySchema = AppRefSchema.extend({\n resourceAccess: MinionResourceAccessSchema.optional(),\n /**\n * Whether this minion needs a route to the public internet (Step 5-egress).\n *\n * ## Why it is AUTHORED and defaults to false\n *\n * Network segmentation marks the backing-service networks `internal`, but\n * attachment to ANY non-internal network restores NAT — so \"may this runtime\n * reach the internet?\" is decided by one declaration and nowhere else. Marking\n * the data networks internal is necessary and not sufficient.\n *\n * It is NOT inferred from `resourceAccess`. A scraper legitimately reaches the\n * internet, and it is tempting to grant egress to any minion that touches data\n * — but declaring `read: ['todos']` is not a statement about the internet, and\n * conflating them would make egress universal for every data-touching minion,\n * which is precisely the \"everything can reach everything\" posture this removes.\n *\n * The point is not to refuse egress. It is to stop it being universal and\n * unstated, so a reviewer can see which minions leave the cluster and ask why.\n *\n * Default `false`, deliberately: the safe posture is the one an author gets by\n * not thinking about it. A minion that genuinely needs the internet says so in\n * one line, and that line is the thing a security review reads.\n */\n requiresInternetEgress: z.boolean().optional().default(false),\n /**\n * PLATFORM-level access — what this minion may see of the platform's record OF\n * ITSELF (R4 / R5). Today: its own cron/schedule entries.\n *\n * **Independent of `resourceAccess` by requirement, not by accident (R5).**\n * Neither implies the other, and nothing in the derivation of either consults\n * the other. A minion that works on todos and never inspects its schedule is a\n * normal shape; so is a health-reporting minion that reads its tick history and\n * touches no application data.\n *\n * The scope vocabulary has ONE member on purpose. There is no\n * `ALL_CRON_RECORDS`: a scope that could name another minion is a scope\n * somebody eventually grants, and R4 requires a cross-minion read to be\n * INEXPRESSIBLE rather than refused.\n */\n platformAccess: MinionPlatformAccessSchema.optional(),\n});\nexport type MinionBucketEntry = z.infer<typeof MinionBucketEntrySchema>;\n\nconst BootstrapFirstAdminSeedSchema = z.object({\n userTypes: z.array(z.string().min(1)).min(1),\n});\nexport type BootstrapFirstAdminSeed = z.infer<typeof BootstrapFirstAdminSeedSchema>;\n\nconst AppBootstrapSchema = z.object({\n firstAdmin: BootstrapFirstAdminSeedSchema.optional(),\n});\nexport type AppBootstrap = z.infer<typeof AppBootstrapSchema>;\ntype AppBootstrapInput = z.input<typeof AppBootstrapSchema>;\n\n/**\n * Per-runtime provider visibility authored at the application level.\n *\n * `defineSaaSProviders({ scopes })` is the canonical app-side provider\n * graph. Tooling materializes this declaration into runtime-specific\n * artifacts; runtime packages should consume those artifacts instead of\n * importing `wildo.saas.config.ts`.\n */\nexport const EngineCapabilityActivationSchema = z.strictObject({\n enabled: z.boolean(),\n required: z.boolean().optional(),\n});\nexport type EngineCapabilityActivation = z.infer<typeof EngineCapabilityActivationSchema>;\nexport type EngineCapabilityActivationInput = z.input<typeof EngineCapabilityActivationSchema>;\n\nexport const EngineCapabilityActivationsSchema = z.partialRecord(\n z.enum(EngineCapability),\n EngineCapabilityActivationSchema,\n).default({});\nexport type EngineCapabilityActivations = z.infer<typeof EngineCapabilityActivationsSchema>;\n\nexport const ProviderConfigurationsSchema = z.record(\n z.string().min(1),\n z.record(z.string().min(1), z.unknown()).optional(),\n).default(() => ({}));\nexport type ProviderConfigurations = z.infer<typeof ProviderConfigurationsSchema>;\nexport type ProviderConfigurationsInput = z.input<typeof ProviderConfigurationsSchema>;\n\nconst BUILTIN_PROVIDER_CAPABILITY_VALUES = new Set<string>(\n Object.values(BUILTIN_PROVIDER_CAPABILITY),\n);\nconst CUSTOM_PROVIDER_CAPABILITY_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;\n\nexport const ProviderCapabilitySelectorSchema = z.string().min(1).refine(\n (value) => BUILTIN_PROVIDER_CAPABILITY_VALUES.has(value) || CUSTOM_PROVIDER_CAPABILITY_PATTERN.test(value),\n {\n message:\n 'Provider capabilities must be a built-in ProviderCapability or app custom kebab-case capability.',\n },\n);\n\n/**\n * The protocols an application may WRITE: exactly the `BUILTIN_PROVIDER_PROTOCOL` keys. Until\n * 2026-09-05 (#327) the engine enum's snake_case wire values were accepted here too — a second\n * spelling that discovery (which compares against provider modules' declared KEYS) then refused\n * at boot with a message about reachability rather than about the protocol. The refusal now\n * happens at config time and names the value and the allowed set.\n */\nconst AUTHORABLE_PROVIDER_PROTOCOLS = new Set<string>(Object.values(BUILTIN_PROVIDER_PROTOCOL) as string[]);\n\nexport const ProviderProtocolSelectorSchema = z.string().min(1).superRefine((value, ctx) => {\n if (AUTHORABLE_PROVIDER_PROTOCOLS.has(value)) return;\n ctx.addIssue({\n code: 'custom',\n message:\n `Unknown or retired provider protocol \"${value}\". Authorable protocols: `\n + `${[...AUTHORABLE_PROVIDER_PROTOCOLS].join(', ')}.`,\n });\n});\n\nexport const SaasProviderScopeSelectionSchema = z.strictObject({\n engineCapabilities: z.array(z.enum(EngineCapability)).default([]),\n providerCapabilities: z.array(ProviderCapabilitySelectorSchema).default([]),\n protocols: z.array(ProviderProtocolSelectorSchema).default([]),\n /**\n * The tier the application EXPECTS this provider to hold (#328). A provider's\n * tier is declared on its module metadata, not here; this is the application\n * stating what it depends on, so that tooling can refuse a CATALOGUE provider\n * quietly filling a slot the application treats as core, and so that the\n * discovery walk (`wildo config sync`) can report a mismatch between the\n * expectation and the module. Like every other field of this selection it is\n * catalog-typed when `defineSaaSProviders<Catalog>` is used.\n */\n tier: z.enum(ProviderTier).optional(),\n /**\n * The vendor grouping the application expects (#328) — the sub-cut case:\n * `microsoft-graph-mail` and `microsoft-teams` both declare `vendor: 'microsoft'`,\n * which is the handle a shared OAuth client or secret is later bound by.\n */\n vendor: z.string().min(1).optional(),\n});\nexport type SaasProviderScopeSelection = z.infer<typeof SaasProviderScopeSelectionSchema>;\n\nexport const SaasProviderSelectionPolicySchema = z.strictObject({\n primary: z.string().min(1),\n /**\n * Ordered substitutes considered after the primary among providers eligible in the runtime scope.\n * Remaining eligible providers follow the policy refs. Resolution does not validate credentials\n * or vendor health, and an ineligible primary does not empty a nonempty eligible set.\n * These are NOT a failover list: nothing\n * retries a second provider when a call to the first one FAILS. Renamed from `fallbacks`\n * 2026-09-08, because that name promised the behaviour the framework deliberately does not\n * have (see `EngineCapabilityResolutionMode.SELECT_ONE`).\n */\n whenUnavailable: z.array(z.string().min(1)).default([]),\n});\nexport type SaasProviderSelectionPolicy = z.infer<typeof SaasProviderSelectionPolicySchema>;\n\nconst SaasProviderRuntimeScopeSchema = z.strictObject({\n providers: z.record(z.string().min(1), SaasProviderScopeSelectionSchema).default({}),\n selection: z.partialRecord(\n z.enum(EngineCapability),\n SaasProviderSelectionPolicySchema,\n ).optional(),\n}).superRefine((scope, ctx) => {\n const providerRefs = new Set(Object.keys(scope.providers));\n for (const [capability, policy] of Object.entries(scope.selection ?? {})) {\n for (const providerRef of [policy.primary, ...(policy.whenUnavailable ?? [])]) {\n if (!providerRefs.has(providerRef)) {\n ctx.addIssue({\n code: 'custom',\n path: ['selection', capability],\n message: `Provider selection for ${capability} references \"${providerRef}\" but it is not declared in this scope.`,\n });\n }\n }\n }\n});\nexport type SaasProviderRuntimeScope = z.infer<typeof SaasProviderRuntimeScopeSchema>;\n\n/**\n * WHICH of a provider's admissible connections THIS application permits.\n *\n * The two layers this sits between are the point, and they answer different questions. A provider's\n * catalogue record says what the VENDOR can support — Slack can be installed per workspace, so an\n * organization-owned connection is possible. This says what the APPLICATION offers — a product may\n * decide Slack is a shared team integration and never a personal one, even though the vendor allows\n * both. Collapsing them would make a vendor opening a capability look identical to a product\n * deciding to use it.\n *\n * NARROWING ONLY. An entry here can subtract from what the provider admits and can never add to it:\n * naming a connection the catalogue does not record grants nothing, because the vendor's own support\n * is not something an application can declare into existence. The registry intersects the two, and\n * a policy that intersects to nothing leaves the provider connectable by nobody — which is a\n * legitimate way to switch a provider's connect surface off without removing the provider.\n *\n * Absent means \"everything the provider admits\", not \"nothing\". A product that has never thought\n * about this gets the catalogue's answer, which is the conservative one already.\n */\nexport const SaasProviderConnectionPolicySchema = z.strictObject({\n /**\n * The permitted subset, as owner-scope × delegation pairs.\n *\n * Authored with the SAME vocabulary the catalogue and the runtime use, rather than a local copy:\n * a connection shape means one thing across the provider record, this policy, the connect leg and\n * the resolver, and three of those four would not notice a fourth spelling until a connection\n * silently failed to resolve.\n */\n admissible: z.array(ExternalProvider_ConnectionShapeSchema).min(1),\n});\nexport type SaasProviderConnectionPolicy = z.infer<typeof SaasProviderConnectionPolicySchema>;\n\nexport const SaasProviderConnectionPoliciesSchema = z.record(\n z.string().min(1),\n SaasProviderConnectionPolicySchema,\n).default(() => ({}));\nexport type SaasProviderConnectionPolicies = z.infer<typeof SaasProviderConnectionPoliciesSchema>;\n\nexport const SaasProvidersScopesSchema = z.strictObject({\n backend: SaasProviderRuntimeScopeSchema.optional(),\n companion: SaasProviderRuntimeScopeSchema.optional(),\n frontendServices: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),\n minions: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),\n workers: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),\n});\nexport type SaasProvidersScopes = z.infer<typeof SaasProvidersScopesSchema>;\n\nexport const SaasConfigProvidersBlockSchema = z.strictObject({\n scopes: SaasProvidersScopesSchema,\n /**\n * Per-provider connection policy. Sits beside `scopes` because both are the APPLICATION's decisions\n * about providers — one says which runtimes may reach a provider, the other which owners may\n * connect one — as opposed to `providerConfigurations`, which is an opaque per-provider runtime bag.\n */\n connections: SaasProviderConnectionPoliciesSchema,\n /**\n * Which provider operations a signed-in person's browser may trigger, and on whose account (#367).\n * The third of the application's decisions about providers, and the only one that opens a door: an\n * operation absent here is not reachable from a browser at all. `providerRef` → `operationId` → policy;\n * see `ProviderBrowserOperationPolicySchema` for the roles and connection rules.\n */\n browserOperations: ProviderBrowserOperationPoliciesSchema,\n /**\n * Which packages may ADD OPERATIONS to a provider they do not own (#1672), `baseRef` → package names. The\n * fourth of the application's decisions about providers, and a trust decision: an augmentation's operations\n * spend the base provider's grant. Absent means none — installing an augmenting package adds nothing. See\n * `ProviderAugmentationOptInsSchema`.\n *\n * assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — third-party code is admitted to a shared grant\n * only by the application's explicit, reviewable declaration.\n */\n augmentations: ProviderAugmentationOptInsSchema.optional(),\n /**\n * Which refs spend ONE vendor grant (#1725), `baseRef` → `{ refs, sharedWithSignIn? }`. The fifth of the\n * application's decisions about providers: the base ref owns the connection's OAuth client and audiences, and\n * every listed ref reads and writes the one stored grant. Absent means every ref is its own connection. Not to\n * be confused with `connections` above, which is a per-ref admissibility policy. See\n * `ProviderSharedConnectionsSchema`.\n *\n * assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — which refs may spend one delegated grant is the\n * application's explicit declaration, checked by `wildo config sync` and again when the registry boots.\n */\n sharedConnections: ProviderSharedConnectionsSchema.optional(),\n /**\n * Provider packages from OUTSIDE the names discovery walks by itself (#1676): a third party's\n * `@acme/wildo-provider-teams`. The sixth of the application's decisions about providers, and a trust decision:\n * a listed package's companion entry is executed by `wildo config sync`. Listing admits it to discovery and\n * activates nothing. Absent means none. See `ProviderPackageAllowListSchema`.\n *\n * assurance-control: WILDO.SECURITY.FAIL_CLOSED — third-party code enters provider discovery only by the\n * application's explicit, reviewable listing, and every admission is printed and recorded in the provider lock.\n */\n packages: ProviderPackageAllowListSchema.optional(),\n}).superRefine((block, ctx) => {\n // A base or a member no runtime scope declares cannot be reached, so the declaration would describe a grant\n // nothing spends — refused here, at the one place both halves are visible. Which scope must hold the BASE\n // beside each member is `wildo config sync`'s check, because it needs the discovered runtime targets.\n const scoped = new Set<string>([\n ...Object.keys(block.scopes.backend?.providers ?? {}),\n ...Object.keys(block.scopes.companion?.providers ?? {}),\n ...Object.values(block.scopes.frontendServices ?? {}).flatMap((scope) => Object.keys(scope.providers ?? {})),\n ...Object.values(block.scopes.minions ?? {}).flatMap((scope) => Object.keys(scope.providers ?? {})),\n ...Object.values(block.scopes.workers ?? {}).flatMap((scope) => Object.keys(scope.providers ?? {})),\n ]);\n for (const [baseRef, connection] of Object.entries(block.sharedConnections ?? {})) {\n for (const ref of [baseRef, ...connection.refs]) {\n if (!scoped.has(ref)) {\n ctx.addIssue({\n code: 'custom',\n path: ['sharedConnections', baseRef],\n message: `providers.sharedConnections.\"${baseRef}\" names \"${ref}\", which no providers.scopes entry declares. `\n + 'Scope every ref of a shared connection, its base included.',\n });\n }\n }\n }\n}).default(() => ({ scopes: {}, connections: {}, browserOperations: {} }));\nexport type SaasConfigProvidersBlock = z.infer<typeof SaasConfigProvidersBlockSchema>;\nexport type SaasConfigProvidersBlockInput = z.input<typeof SaasConfigProvidersBlockSchema>;\n\nexport interface SaasProviderCatalogEntry {\n engineCapabilities?: readonly string[];\n providerCapabilities?: readonly string[];\n protocols?: readonly string[];\n /** The tier the catalog records for the provider (#328). */\n tier?: ProviderTier;\n /** The vendor grouping the catalog records for the provider (#328). */\n vendor?: string;\n}\n\nexport type SaasProviderCatalog = Record<string, SaasProviderCatalogEntry>;\n\ntype CatalogFieldValue<\n TCatalog extends SaasProviderCatalog,\n TRef extends keyof TCatalog & string,\n TField extends keyof SaasProviderCatalogEntry,\n> = TCatalog[TRef][TField] extends readonly (infer TValue)[]\n ? Extract<TValue, string>\n : never;\n\nexport interface SaasProviderSelectionPolicyInput<TProviderRef extends string = string> {\n primary: TProviderRef;\n /** Ordered substitutes for an UNAVAILABLE preceding ref. Not failover — see the schema. */\n whenUnavailable?: TProviderRef[];\n}\n\nexport type SaasProviderScopeSelectionInputFromCatalog<\n TCatalog extends SaasProviderCatalog,\n TRef extends keyof TCatalog & string,\n> = {\n engineCapabilities?: Array<CatalogFieldValue<TCatalog, TRef, 'engineCapabilities'>>;\n providerCapabilities?: Array<CatalogFieldValue<TCatalog, TRef, 'providerCapabilities'>>;\n protocols?: Array<CatalogFieldValue<TCatalog, TRef, 'protocols'>>;\n /** Must equal the catalog's tier for the ref when the catalog records one. */\n tier?: TCatalog[TRef]['tier'];\n vendor?: TCatalog[TRef]['vendor'];\n};\n\nexport type SaasProviderRuntimeScopeInputFromCatalog<TCatalog extends SaasProviderCatalog> = {\n providers?: Partial<{\n [TRef in keyof TCatalog & string]: SaasProviderScopeSelectionInputFromCatalog<TCatalog, TRef>;\n }>;\n selection?: Partial<Record<\n EngineCapability,\n SaasProviderSelectionPolicyInput<keyof TCatalog & string>\n >>;\n};\n\nexport type SaasConfigProvidersBlockInputFromCatalog<TCatalog extends SaasProviderCatalog> = {\n connections?: z.input<typeof SaasProviderConnectionPoliciesSchema>;\n /** Keyed by a catalogued provider ref; see `SaasConfigProvidersBlockSchema.browserOperations`. */\n browserOperations?: Partial<Record<keyof TCatalog & string, z.input<typeof ProviderBrowserOperationPoliciesSchema>[string]>>;\n /** Keyed by a catalogued provider ref; see `SaasConfigProvidersBlockSchema.augmentations`. */\n augmentations?: Partial<Record<keyof TCatalog & string, string[]>>;\n /** Keyed by the catalogued BASE ref; see `SaasConfigProvidersBlockSchema.sharedConnections`. */\n sharedConnections?: Partial<Record<keyof TCatalog & string, { refs: Array<keyof TCatalog & string>; sharedWithSignIn?: boolean }>>;\n /** npm package names; see `SaasConfigProvidersBlockSchema.packages`. */\n packages?: string[];\n scopes: {\n backend?: SaasProviderRuntimeScopeInputFromCatalog<TCatalog>;\n companion?: SaasProviderRuntimeScopeInputFromCatalog<TCatalog>;\n frontendServices?: Record<string, SaasProviderRuntimeScopeInputFromCatalog<TCatalog>>;\n minions?: Record<string, SaasProviderRuntimeScopeInputFromCatalog<TCatalog>>;\n workers?: Record<string, SaasProviderRuntimeScopeInputFromCatalog<TCatalog>>;\n };\n};\n\nexport function defineSaaSProviders(\n providers: z.input<typeof SaasConfigProvidersBlockSchema>,\n): SaasConfigProvidersBlock;\nexport function defineSaaSProviders<TCatalog extends SaasProviderCatalog>(\n providers: SaasConfigProvidersBlockInputFromCatalog<TCatalog>,\n): SaasConfigProvidersBlock;\nexport function defineSaaSProviders(\n providers: z.input<typeof SaasConfigProvidersBlockSchema>,\n): SaasConfigProvidersBlock {\n return SaasConfigProvidersBlockSchema.parse(providers);\n}\n\nexport interface WildoSaasConfig {\n version?: z.infer<typeof WildoSchemaVersionSchema>;\n name: string;\n slug: string;\n displayName: string;\n description?: string;\n type: 'saas';\n services: Record<string, z.infer<typeof AppServiceDefinitionSchema>>;\n modules: z.infer<typeof ApplicationModulesSchema>;\n libraries?: Record<string, z.infer<typeof AppLibraryDefinitionSchema>>;\n specifications?: z.infer<typeof AppRefSchema>;\n minions?: Record<string, MinionBucketEntry>;\n workers?: Record<string, z.infer<typeof AppRefSchema>>;\n engineCapabilities: EngineCapabilityActivations;\n providerConfigurations: ProviderConfigurations;\n providers: SaasConfigProvidersBlock;\n /** See `WildoSaasConfigSchema.organizationTypes`. Required, at least one. */\n organizationTypes: OrganizationTypesConfig;\n /** See `WildoSaasConfigSchema.systemsOfRecord`. */\n systemsOfRecord?: SystemsOfRecordConfig;\n bootstrap?: AppBootstrap;\n dataServices: z.infer<typeof AppDataServicesSchema>;\n /** See `WildoSaasConfigSchema.dataRetention`. Optional and partial: an undeclared class is undecided, never \"forever\". */\n dataRetention?: ApplicationRetentionSchedule;\n /** See `WildoSaasConfigSchema.assuranceReviewCadence`. Absent means no committed review schedule, never a default. */\n assuranceReviewCadence?: ReviewCadence;\n /** See `WildoSaasConfigSchema.aiUsePosture`. An enabled AI capability with no entry is reported, never assumed harmless. */\n aiUsePosture?: ApplicationAiUsePosture;\n /** See `WildoSaasConfigSchema.clientStorage`. Keyed by frontend surface; an absent surface is uninventoried, an empty array is \"sets nothing\". */\n clientStorage?: ApplicationClientStorageInventory;\n /**\n * WHO operates this service, in what legal role, on what lawful basis (issue #131).\n *\n * The answers a compliance document needs in its opening sections. Absent, a produced privacy\n * notice cannot name who is publishing it — and because a landing REPLACES the document, an\n * operator who answered by editing it lost the answer on the next regeneration.\n */\n /**\n * WHERE this application operates (issue #229).\n *\n * A SIBLING of `operatorComplianceIdentity`, not a field inside it: where you sell is known long\n * before why you may process, and nesting it would make a jurisdiction unrecordable until the\n * lawful bases were settled.\n *\n * Absent means nobody has answered — never \"nowhere\". A declared jurisdiction that no registered\n * assurance source reaches is reported as a known unknown rather than passed over.\n */\n operatingJurisdictions?: ApplicationOperatingJurisdictions;\n operatorComplianceIdentity?: ApplicationOperatorComplianceIdentity;\n /**\n * Per configured provider, who runs it and where it processes (issue #130).\n *\n * The provider declares what is POSSIBLE; this is the operator's CHOICE among those. A vendor-hosted\n * provider is a third-party recipient a notice must enumerate; a self-hosted one is not a recipient\n * at all, and without this axis a produced notice would call an audit ledger you run yourself a\n * third party.\n */\n providerComplianceChoices?: ApplicationProviderComplianceChoices;\n /**\n * What the operator DECIDED to do about each derived risk signal (#300 Layer 2).\n *\n * The same possibilities/choice split as `providerComplianceChoices` above, one layer over: the\n * engine derives what is risky, and this is what the operator chose about it. PARTIAL by design —\n * a signal with no entry is reported as undeclared rather than refused, because a compliance\n * workflow may never stand in front of the mechanism, and because silence is not acceptance.\n *\n * A posture of `AVOIDED` is the one a measurement can CONTRADICT, which is the whole reason this\n * is typed configuration rather than prose: declare that an exposure is not taken while the\n * derivation finds it present, and the two statements cannot both be true.\n */\n riskPosture?: ApplicationRiskPosture;\n moduleRegistries?: RegistryConfig;\n}\n\nexport interface WildoSaasConfigInput {\n version?: z.input<typeof WildoSchemaVersionSchema>;\n name: string;\n slug: string;\n displayName: string;\n description?: string;\n type: 'saas';\n services: Record<string, z.input<typeof AppServiceDefinitionSchema>>;\n /**\n * OPTIONAL, matching `ApplicationModulesSchema`, which is `.optional()`. Declared as required\n * here it contradicted its own schema: a config that legitimately omits `modules` parses fine\n * at runtime and was rejected by the type.\n */\n modules?: z.input<typeof ApplicationModulesSchema>;\n libraries?: Record<string, z.input<typeof AppLibraryDefinitionSchema>>;\n specifications?: z.input<typeof AppRefSchema>;\n minions?: Record<string, z.input<typeof MinionBucketEntrySchema>>;\n workers?: Record<string, z.input<typeof AppRefSchema>>;\n engineCapabilities?: z.input<typeof EngineCapabilityActivationsSchema>;\n providerConfigurations?: z.input<typeof ProviderConfigurationsSchema>;\n providers?: z.input<typeof SaasConfigProvidersBlockSchema>;\n /** See `WildoSaasConfigSchema.organizationTypes`. Required, at least one. */\n organizationTypes: z.input<typeof OrganizationTypesConfigSchema>;\n bootstrap?: AppBootstrapInput;\n dataServices: z.input<typeof AppDataServicesSchema>;\n /** See `WildoSaasConfigSchema.systemsOfRecord`. */\n systemsOfRecord?: z.input<typeof SystemsOfRecordConfigSchema>;\n /** See `WildoSaasConfigSchema.dataRetention`. */\n dataRetention?: z.input<typeof ApplicationRetentionScheduleSchema>;\n /** See `WildoSaasConfigSchema.aiUsePosture`. */\n aiUsePosture?: z.input<typeof ApplicationAiUsePostureSchema>;\n /** See `WildoSaasConfigSchema.clientStorage`. */\n clientStorage?: z.input<typeof ApplicationClientStorageInventorySchema>;\n operatingJurisdictions?: z.input<typeof ApplicationOperatingJurisdictionsSchema>;\n operatorComplianceIdentity?: z.input<typeof ApplicationOperatorComplianceIdentitySchema>;\n providerComplianceChoices?: z.input<typeof ApplicationProviderComplianceChoicesSchema>;\n /** See `WildoSaasConfigSchema.riskPosture`. */\n riskPosture?: z.input<typeof ApplicationRiskPostureSchema>;\n moduleRegistries?: z.input<typeof RegistryConfigSchema>;\n}\n\n/**\n * @wildo_source:part:start platform.config.saas facet:layer:platform facet:family:bootstrap\n *\n * Root `wildo.saas.config.ts` application declaration: services, modules,\n * engine capabilities, provider scopes, provider configurations and data\n * services. Import `defineSaasConfig` from `@wildo-ai/platform-config-lib` and\n * keep cross-service choices here rather than scattering them through runtime\n * source files.\n */\n/**\n * The root schema is `z.strictObject` (not `z.object`) so that authoring an\n * unknown top-level key surfaces as a\n * Zod parse error at `defineSaasConfig` time instead of being silently\n * dropped. A typoed `dataServises:` block (or a removed-then-re-introduced\n * `secretsSharingPolicy`) would otherwise compile cleanly, parse cleanly,\n * and produce no runtime warning — exactly the failure mode the\n * `@unimplemented` machinery exists to prevent. The fail-closed posture\n * trades a slightly louder authoring boundary for a guarantee that every\n * authored top-level concern is either consumed or explicitly rejected.\n */\nexport const WildoSaasConfigSchema = z.strictObject({\n /**\n * Authored schema-format version for this `wildo.saas.config.ts`,\n * expressed as a **SemVer 2.0.0 string** (e.g. `'1.0.0'`,\n * `'2.3.1-rc.1'`, `'1.0.0+build.42'`).\n *\n * SemVer (not a bare integer) keeps MAJOR-vs-MINOR-vs-PATCH meaning explicit\n * for future configuration evolution — bare integers conflate \"breaking\", \"feature\n * add\" and \"bug-fix\" into a single dimension and force every bump to\n * look like a breaking change.\n *\n * The field is intentionally optional (no Zod default) so unauthored\n * configurations stay silent. Version-based migration enforcement is not\n * available yet; an authored value records intent but does not itself perform\n * a migration or authorize an incompatible configuration.\n */\n version: WildoSchemaVersionSchema.optional(),\n name: z.string().min(1),\n slug: z.string().min(1).regex(/^[a-z0-9-]+$/, 'slug must be lowercase alphanumeric with hyphens'),\n displayName: z.string().min(1),\n description: z.string().optional(),\n type: z.literal('saas'),\n\n services: z.record(z.string(), AppServiceDefinitionSchema),\n modules: ApplicationModulesSchema,\n libraries: z.record(z.string(), AppLibraryDefinitionSchema).optional(),\n specifications: AppRefSchema.optional(),\n /**\n * Long-running \"minion\" actor hosts (scheduled or always-up).\n *\n * Each entry declares the `resourceAccess` read/write allowlists consumed by\n * the minion runtime's scoped services-registry proxy. Missing lists deny\n * resource calls; unknown declared resource names fail startup. This is\n * runtime containment, separate from the operation's own authorization and\n * the minion's provider and platform-access scopes.\n */\n minions: z.record(z.string(), MinionBucketEntrySchema).optional(),\n /**\n * HTTP-only \"worker\" subprocesses (compute-heavy, often Rust/Go).\n *\n * Node workers use `defineWorkerInit` from `@wildo-ai/saas-workers-node-lib`;\n * other languages implement the same HTTP and token-verification contract.\n * Workers have no `resourceAccess` field: they are not backend queue consumers\n * and do not receive application repository access. Pass the data required\n * by their request contract instead of treating them as minions.\n */\n workers: z.record(z.string(), AppRefSchema).optional(),\n\n engineCapabilities: EngineCapabilityActivationsSchema,\n providerConfigurations: ProviderConfigurationsSchema,\n\n /**\n * Per-facet provider registries.\n *\n * Authored as a `z.custom` because the value is a constructed object\n * (registry instances carry methods like `getProviderByRef`); strict\n * runtime parsing of method-bearing values is intentionally skipped\n * — the application/provider composition boundary enforces the registry\n * invariants.\n *\n * See the `SaasConfigProvidersBlock` JSDoc above for the role of each\n * registry facet.\n */\n providers: SaasConfigProvidersBlockSchema,\n\n /**\n * The application's organization types — required, and at least one (#1032, decided 2026-09-14).\n *\n * Authored HERE rather than in `backend-api/src/saas-config.backend.ts`, where it used to live,\n * because the platform needs it and cannot read backend-authored configuration: apps-manager seeds\n * the organization of the application's first administrator, and that organization must carry one\n * of these types. It reaches the platform inside the declaration, like `providers` and\n * `engineCapabilities`, and the backend refuses to author it.\n *\n * Every organization carries a type, and a member of an organization whose type names no entry here\n * cannot sign in — which is why this is not optional.\n */\n organizationTypes: OrganizationTypesConfigSchema,\n\n bootstrap: AppBootstrapSchema.optional(),\n dataServices: AppDataServicesSchema,\n\n /**\n * The systems of record this application reads its own business rows out of — Odoo, an S/4HANA\n * OData service, a Dynamics deployment — each a NAMED INSTANCE that resources bind by name.\n *\n * Declared HERE, beside `dataServices`, because it answers the same question from the other side:\n * `dataServices` says which stores this application OWNS, and this says which stores it READS and\n * does not own. Both are application-wide operator decisions rather than per-resource authoring.\n *\n * Declaring the block is what ENABLES the external-data lane (#1055 D3); there is no capability\n * flag, because the lane has no meaning without an instance to point at. Each instance's ADDRESS\n * and SECRETS live in the environment (`wildo.infra.<location>.config.ts` and `secrets.json`) under\n * names DERIVED from the instance name — `WILDO_SOR_<NAME>__<SLOT>` — never authored, so renaming an\n * instance renames its variables and `wildo config sync` reports the ones that went missing.\n *\n * Not `providers`, deliberately (#1055 D10). A provider is selected through the capability plane and\n * may carry a person's lent credential; a system of record is a deployment the application reads with\n * its OWN service identity, and nothing serves both.\n */\n systemsOfRecord: SystemsOfRecordConfigSchema.optional(),\n\n /**\n * How long this application keeps each class of data, and why.\n *\n * Declared HERE, beside `dataServices`, because the two describe the same thing from opposite ends:\n * `dataServices` says which stores exist, and this says how long what is in them is kept. Both are\n * application-wide operator decisions rather than per-resource authoring.\n *\n * Optional as a whole, and partial within itself. An application that has decided nothing omits it;\n * one that has decided only its customer-data period declares only that. Absence is never read as\n * \"kept forever\" — a compliance document states the classes that ARE declared and marks the rest as\n * needing an operator decision, which is what lets the document be produced today rather than\n * waiting on a number nobody has yet.\n *\n * Two consumers, and the second is why the classes are the STORES: a privacy notice's retention\n * paragraph (issue #89, which is why this exists), and the backup-and-restore inventory a remote\n * environment still has none of (issue #8) — one declaration answers both instead of two that drift.\n */\n dataRetention: ApplicationRetentionScheduleSchema.optional(),\n\n /**\n * How often this application re-reviews its compliance programme.\n *\n * A COMMITMENT, and that is why it is declared rather than asked. `top_down.compliance-conception`\n * used to elicit a next-review DATE in free text — \"answer as an ISO date, after today's\" — which is\n * three things wrong at once: a date goes stale the moment it passes, it has to be re-answered on\n * every run, and it is a proxy for the thing actually being promised. The promise is the CADENCE;\n * the date is an output (`deriveNextReviewOn`), computed from the instant the programme was drafted.\n * The general form: a date is a PROXY for \"an input may have changed\", and where every input is\n * enumerable the trigger is computable and the date is an output, never a question.\n *\n * Optional, and an absent cadence is NOT a default. A programme produced without one is still\n * produced: no obligation carries a next-review date, and the programme states in a stamped limitation\n * that no schedule is committed. Committing to one is a workflow, and a workflow MARKS rather than\n * standing in front of the mechanism. Declaring it here is still the better place than any form: the\n * answer is committed, diffable, and reused by every later run.\n *\n * `AS_NEEDED` is a legitimate value for the vocabulary and schedules nothing, so it produces the same\n * marked programme as no declaration — never a silently chosen far-future date.\n *\n * The vocabulary is `ReviewCadence`, shared with market/roadmap/brand authoring rather than\n * re-declared — one closed vocabulary, one runtime source (CLAUDE.md).\n */\n assuranceReviewCadence: z.enum(ReviewCadence).optional(),\n\n /**\n * Whether each AI capability this application enables DECIDES something about a person, and who\n * reviews it if so.\n *\n * A capability establishes that AI is in use and for what function; it cannot establish consequence,\n * because the same `AI_LLM` backs a summariser that decides nothing and a screener that decides a\n * great deal (issue #92).\n *\n * Optional and partial, like `dataRetention` — but the silence here is the more dangerous one. A\n * notice describing AI use without addressing consequence does not read as \"unknown\", it reads as\n * \"nothing significant happens\", which silently claims an exemption. So an enabled AI capability with\n * no entry is REPORTED as outstanding rather than assumed harmless.\n */\n aiUsePosture: ApplicationAiUsePostureSchema.optional(),\n\n /**\n * What this application stores in a visitor's browser, per FRONTEND SURFACE — the itemised table a\n * cookie notice IS (issue #91).\n *\n * Per surface because a public marketing site and the authenticated application set different things,\n * and one merged list would be wrong for both. The FRAMEWORK's own cookies are not declared here:\n * every application inherits them and none authored them, so they are answered by\n * `ENGINE_CLIENT_STORAGE_ENTRIES` and reported separately.\n *\n * Optional and partial. A surface with no entry has not been inventoried and is reported as such; an\n * empty ARRAY is the different, positive answer — this surface sets nothing of its own.\n */\n clientStorage: ApplicationClientStorageInventorySchema.optional(),\n operatingJurisdictions: ApplicationOperatingJurisdictionsSchema.optional(),\n operatorComplianceIdentity: ApplicationOperatorComplianceIdentitySchema.optional(),\n providerComplianceChoices: ApplicationProviderComplianceChoicesSchema.optional(),\n riskPosture: ApplicationRiskPostureSchema.optional(),\n\n /**\n * Module registries the app pulls modules from. Each entry pairs a\n * stable id (used by lockfile entries + the `--registry <id>` CLI\n * flag) with a registry HTTP origin. Optional — when omitted, CLI\n * commands fall back to alias resolution (`local` / `public`) or\n * the env-policy default (`WILDO_FRAMEWORK_DEVELOPER` → local;\n * else public).\n *\n * Example: `[{ id: 'wildo', url: 'https://registry.wildo.ai' }]`\n *\n * Credentials never live here — they live per-machine under\n * the local Wildo credential store. This config only points at endpoints.\n */\n moduleRegistries: RegistryConfigSchema.optional(),\n\n // Technical-documentation and marketing-website configuration belong in\n // their respective service folders as\n // `wildo.tech-doc.config.ts` and `wildo.website.config.ts`,\n // co-located with the public packages that own their semantics\n // (`@wildo-ai/saas-technical-doc` and `@wildo-ai/saas-website`). The\n // schemas, types, `defineXxxConfig` helpers, and (for website) the\n // jiti-backed loader now live entirely in those packages.\n // The dev companion / Astro build discover and load each per-service\n // file via the unique service of the matching `frontendType`. The\n // single-frontend-per-kind constraint enforced by the `superRefine`\n // below guarantees that \"the TECH_DOC service folder\" and \"the\n // STATIC_WEBSITE service folder\" are unambiguous.\n}).superRefine((config, ctx) => {\n /*\n * The first administrator's organization type must be DERIVABLE, and this is the earliest place to\n * say so. apps-manager derives it at initialization with the same function; refusing here turns a\n * failure midway through provisioning into an authoring error at the moment the file is loaded.\n */\n const firstAdministratorUserTypes = config.bootstrap?.firstAdmin?.userTypes;\n if (firstAdministratorUserTypes !== undefined) {\n const derivation = deriveFirstAdministratorOrganizationType(config.organizationTypes, firstAdministratorUserTypes);\n if (derivation.outcome === OrganizationTypeDerivationOutcome.NONE) {\n ctx.addIssue({\n code: 'custom',\n path: ['bootstrap', 'firstAdmin', 'userTypes'],\n message:\n `No organization type covers the first administrator's user types (${firstAdministratorUserTypes.join(', ')}). `\n + 'The platform seeds the first administrator into an organization of the type whose `userTypes` include all of '\n + 'them; declare one in `organizationTypes`.',\n });\n } else if (derivation.outcome === OrganizationTypeDerivationOutcome.AMBIGUOUS) {\n ctx.addIssue({\n code: 'custom',\n path: ['bootstrap', 'firstAdmin', 'userTypes'],\n message:\n `Several organization types cover the first administrator's user types (${derivation.candidates.join(', ')}), `\n + 'so the type of the organization the platform seeds for them cannot be derived. Narrow the `userTypes` of all '\n + 'but one of them.',\n });\n }\n\n /*\n * A declared OWNER type must be able to take the bootstrap organization (#1054).\n *\n * The organization the platform seeds for the first administrator IS the organization that owns\n * the application, so a marked type whose `userTypes` do not cover the administrator's is a\n * declaration that cannot be satisfied. Without this the failure is SILENT rather than loud: the\n * derivation above finds no marked type among the fitting ones, falls through to the unmarked\n * candidates, and seeds the administrator into a customer-shaped tenant — leaving an application\n * that declares an owner type and has no owner organization, with no door that could type one\n * afterwards (`Organization.type` is creation-time identity).\n *\n * Checked here rather than in `OrganizationTypesConfigSchema`, because it is a statement about\n * TWO top-level blocks — `organizationTypes` and `bootstrap` — and the types schema can only see\n * its own.\n */\n const ownerTypeDerivation = resolveApplicationOwnerOrganizationType(config.organizationTypes);\n if (ownerTypeDerivation.outcome === OrganizationTypeDerivationOutcome.DERIVED) {\n const ownerTypeUserTypes = config.organizationTypes?.[ownerTypeDerivation.organizationType]?.userTypes ?? [];\n const uncoveredUserTypes = firstAdministratorUserTypes.filter((userType) => !ownerTypeUserTypes.includes(userType));\n if (uncoveredUserTypes.length > 0) {\n ctx.addIssue({\n code: 'custom',\n path: ['organizationTypes', ownerTypeDerivation.organizationType, 'userTypes'],\n message:\n `Organization type '${ownerTypeDerivation.organizationType}' declares \\`ownsApplication\\` but its \\`userTypes\\` `\n + `do not include ${uncoveredUserTypes.map((userType) => `'${userType}'`).join(', ')}, which the first administrator holds `\n + `(bootstrap.firstAdmin.userTypes: ${firstAdministratorUserTypes.join(', ')}). The organization seeded for the first `\n + 'administrator is the organization that owns the application, so the owner type must grant everything that '\n + 'administrator is. Add the missing user types to it, or move the marker to the type that already covers them.',\n });\n }\n }\n }\n\n /*\n * A declared system of record needs an organization to belong to (#1055, resting on #1054).\n *\n * Rows read out of a system of record are stamped with the OWNER organization's id, which is what\n * lets the per-row tenant gate pass with no exemption. An application that declares an instance and\n * no `ownsApplication` type has nothing to stamp with, so every read of every bound resource would\n * refuse at request time with `owner_organization_absent` — a runtime failure whose cause is an\n * authoring omission three layers up.\n *\n * Refused here rather than at boot because this is exactly the kind of contradiction one file can\n * see: both blocks are in scope, and turning it into an authoring error means nobody can commit it.\n * The DERIVATION being ambiguous (two marked types) is refused by `OrganizationTypesConfigSchema`\n * itself, so only the NONE outcome is left to answer here.\n */\n if (config.systemsOfRecord !== undefined && Object.keys(config.systemsOfRecord).length > 0) {\n const ownerTypeForSystemsOfRecord = resolveApplicationOwnerOrganizationType(config.organizationTypes);\n if (ownerTypeForSystemsOfRecord.outcome === OrganizationTypeDerivationOutcome.NONE) {\n ctx.addIssue({\n code: 'custom',\n path: ['systemsOfRecord'],\n message:\n `This application declares ${Object.keys(config.systemsOfRecord).map((name) => `'${name}'`).join(', ')} as a system of record, `\n + 'but no organization type declares `ownsApplication`. Rows read out of a system of record are stamped with the owning '\n + \"organization's id — that stamp is what makes them belong to a tenant at all — so without one every read would refuse. \"\n + 'Mark the organization type whose organization operates this application.',\n });\n }\n }\n\n const availableServiceKeys = new Set(Object.keys(config.services));\n const frontendServiceKeys = new Set(\n Object.entries(config.services)\n .filter(([, definition]) => definition.frontendType !== undefined)\n .map(([serviceKey]) => serviceKey),\n );\n\n for (const [moduleId, moduleBinding] of Object.entries(config.modules ?? {})) {\n for (const serviceKey of moduleBinding.services) {\n if (availableServiceKeys.has(serviceKey)) {\n continue;\n }\n\n ctx.addIssue({\n code: 'custom',\n path: ['modules', moduleId, 'services'],\n message: `Module \"${moduleId}\" references unknown service \"${serviceKey}\".`,\n });\n }\n }\n\n // Minion/worker bucket keys are RFC1123-normalized (via `buildMinionServiceName`\n // / `buildWorkerServiceName`) into the k8s object / built image / compose service\n // / worker dispatch-host DNS name at deploy time. camelCase keys are ACCEPTED and\n // normalized — matching the `services.<key>` convention and the existing\n // `WILDO_WORKER_<NAME>_URL` env-key normalization — but two keys that COLLAPSE to\n // the same DNS name would silently deploy as ONE Service/image, and a key that\n // normalizes to EMPTY (all-symbol) would emit an invalid trailing-hyphen name.\n // Fail fast at authoring on either, independently per background-runtime map.\n // The full generated deploy name is `{slug}-{minion|worker}-{dnsName}`. It is\n // used as the k8s Service `metadata.name` AND the `app.kubernetes.io/name` label\n // value — both bounded by the RFC1123 label limit of 63 chars. A longer name is\n // rejected by kubectl at deploy time (and by Docker for the image tag), so fail\n // fast at authoring rather than let CI/deploy blow up. Truncating instead would\n // be a silent \"trick\" that risks a collision with a sibling key — rejected.\n const K8S_LABEL_MAX_LENGTH = 63;\n for (const [mapLabel, bucket, buildServiceName] of [\n ['minions', config.minions, buildMinionServiceName],\n ['workers', config.workers, buildWorkerServiceName],\n ] as const) {\n if (!bucket) continue;\n const dnsNameToKey = new Map<string, string>();\n for (const bucketKey of Object.keys(bucket)) {\n const dnsName = normalizeServiceKeyToDnsName(bucketKey);\n if (dnsName.length === 0) {\n ctx.addIssue({\n code: 'custom',\n path: [mapLabel, bucketKey],\n message:\n `${mapLabel} key \"${bucketKey}\" normalizes to an empty DNS name — it must contain at least ` +\n `one [a-z0-9] character so the deployed k8s Service / image name is valid (e.g. \"market-scraper\").`,\n });\n continue;\n }\n const serviceName = buildServiceName(config.slug, bucketKey);\n if (serviceName.length > K8S_LABEL_MAX_LENGTH) {\n ctx.addIssue({\n code: 'custom',\n path: [mapLabel, bucketKey],\n message:\n `${mapLabel} key \"${bucketKey}\" generates the deploy name \"${serviceName}\" ` +\n `(${serviceName.length} chars), exceeding the ${K8S_LABEL_MAX_LENGTH}-char RFC1123 limit for a ` +\n `k8s Service / label name. Shorten the ${mapLabel.slice(0, -1)} key or the app slug (\"${config.slug}\").`,\n });\n }\n const existing = dnsNameToKey.get(dnsName);\n if (existing !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: [mapLabel, bucketKey],\n message:\n `${mapLabel} keys \"${existing}\" and \"${bucketKey}\" both normalize to the DNS name \"${dnsName}\" — ` +\n `they would deploy as the SAME k8s Service / image / compose service. Rename one so the normalized names differ.`,\n });\n continue;\n }\n dnsNameToKey.set(dnsName, bucketKey);\n }\n }\n\n const scopeBuckets: Record<string, ReadonlySet<string>> = {\n services: availableServiceKeys,\n minions: new Set(Object.keys(config.minions ?? {})),\n workers: new Set(Object.keys(config.workers ?? {})),\n };\n\n const validateProviderScope = (\n scopePath: Array<string | number>,\n scope: SaasProviderRuntimeScope | undefined,\n ): void => {\n if (!scope) return;\n\n for (const [providerRef, selection] of Object.entries(scope.providers)) {\n for (const capability of selection.engineCapabilities) {\n if (config.engineCapabilities?.[capability]?.enabled !== true) {\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'providers', providerRef, 'engineCapabilities'],\n message:\n `Provider \"${providerRef}\" selects disabled or unauthored engine capability \"${capability}\".`,\n });\n }\n }\n\n /*\n * The two capability lists must AGREE (#438). `providerCapabilities` are vendor-side tokens;\n * `PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY` projects each into the engine slot it fills, and\n * `engineCapabilities` is the application's statement of which slots this provider serves in\n * this scope. Two statements about one fact, and nothing compared them.\n *\n * Measured on Wonder Todos before this check existed: the companion scope declared\n * `providerCapabilities: ['CODING_AGENT']` under `engineCapabilities: [AI_LLM]` — a token\n * that projects to AI_CODING_AGENT, claiming a slot it does not fill and omitting the one it\n * does. It was invisible because a coding agent resolves its provider by `providerRef`, never\n * through the slot, so nothing ever asked the projection whether it agreed.\n *\n * A token with NO slot (`SSO_OAUTH2`, `FRONTEND_FILE_PICKER`, `FRONTEND_CAPTCHA`) projects to\n * nothing and is not an omission — those providers legitimately declare no engine capability.\n * Only tokens that DO map participate, which is why this compares sets rather than counts.\n */\n const projectedCapabilities = new Set(\n selection.providerCapabilities\n .map((token) => PROVIDER_CAPABILITY_TO_ENGINE_CAPABILITY[token as BuiltinProviderCapability])\n .filter((capability): capability is EngineCapability => Boolean(capability)),\n );\n const declaredCapabilities = new Set<EngineCapability>(selection.engineCapabilities as EngineCapability[]);\n\n const claimedButNotProjected = [...declaredCapabilities].filter((capability) => !projectedCapabilities.has(capability));\n const projectedButNotClaimed = [...projectedCapabilities].filter((capability) => !declaredCapabilities.has(capability));\n\n if (claimedButNotProjected.length > 0 || projectedButNotClaimed.length > 0) {\n const parts: string[] = [];\n if (projectedButNotClaimed.length > 0) {\n parts.push(\n `providerCapabilities project ${projectedButNotClaimed.join(', ')} which engineCapabilities does not declare`,\n );\n }\n if (claimedButNotProjected.length > 0) {\n parts.push(\n `engineCapabilities declares ${claimedButNotProjected.join(', ')} which no declared providerCapability projects`,\n );\n }\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'providers', providerRef, 'engineCapabilities'],\n message:\n `Provider \"${providerRef}\" declares capability lists that disagree: ${parts.join('; ')}. `\n + 'The two lists describe one fact — which engine slots this provider serves in this scope — '\n + 'so make them agree by adding the missing engineCapabilities, or by removing a providerCapability the provider does not serve here.',\n });\n }\n }\n\n for (const [capability, policy] of Object.entries(scope.selection ?? {})) {\n // A FAN_OUT capability (e.g. COMPLIANCE_AUDIT_TRAIL) writes to EVERY declared\n // provider — a `selection` (primary + failover) is meaningless for it. Reject\n // it; declaring the providers is enough (all are active).\n if (\n getEngineCapabilityResolutionMode(capability as EngineCapability)\n === EngineCapabilityResolutionMode.FAN_OUT\n ) {\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'selection', capability],\n message:\n `\"${capability}\" is a FAN_OUT capability — every declared provider is active (no primary/failover). Remove its \\`selection\\` entry; declaring the providers is enough.`,\n });\n continue;\n }\n for (const providerRef of [policy.primary, ...(policy.whenUnavailable ?? [])]) {\n const providerSelection = scope.providers[providerRef];\n if (providerSelection && !providerSelection.engineCapabilities.includes(capability as EngineCapability)) {\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'selection', capability],\n message:\n `Provider selection for \"${capability}\" references provider \"${providerRef}\" that does not declare engineCapabilities including ${capability}.`,\n });\n }\n }\n }\n };\n\n validateProviderScope(['providers', 'scopes', 'backend'], config.providers?.scopes.backend);\n validateProviderScope(['providers', 'scopes', 'companion'], config.providers?.scopes.companion);\n\n for (const [serviceKey, scope] of Object.entries(config.providers?.scopes.frontendServices ?? {})) {\n if (!availableServiceKeys.has(serviceKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'frontendServices', serviceKey],\n message: `Provider scope references unknown frontend service \"${serviceKey}\".`,\n });\n } else if (!frontendServiceKeys.has(serviceKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'frontendServices', serviceKey],\n message:\n `Provider scope references non-frontend service \"${serviceKey}\". ` +\n 'Only services with a frontendType may appear under providers.scopes.frontendServices.',\n });\n }\n validateProviderScope(['providers', 'scopes', 'frontendServices', serviceKey], scope);\n }\n\n for (const [minionKey, scope] of Object.entries(config.providers?.scopes.minions ?? {})) {\n if (!scopeBuckets.minions.has(minionKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'minions', minionKey],\n message: `Provider scope references unknown minion \"${minionKey}\".`,\n });\n }\n validateProviderScope(['providers', 'scopes', 'minions', minionKey], scope);\n }\n\n for (const [workerKey, scope] of Object.entries(config.providers?.scopes.workers ?? {})) {\n if (!scopeBuckets.workers.has(workerKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'workers', workerKey],\n message: `Provider scope references unknown worker \"${workerKey}\".`,\n });\n }\n validateProviderScope(['providers', 'scopes', 'workers', workerKey], scope);\n }\n\n // At most one service may use each \"single-instance\" frontend kind.\n //\n // `TECH_DOC` and `STATIC_WEBSITE` are framework-managed singletons:\n // a SaaS app has at most one technical-documentation site and at\n // most one marketing/landing site. The per-service config files\n // (`wildo.tech-doc.config.ts` for `TECH_DOC`, `wildo.website.config.ts`\n // for `STATIC_WEBSITE`) are discovered by the companion / Astro\n // build through the unique service of the matching `frontendType`.\n // If the schema allowed two `TECH_DOC` services, the companion\n // would have no deterministic way to project the OpenAPI YAMLs to\n // \"the\" docs root — every consumer would need a \"which docs\n // service?\" indirection for no real-world payoff (multi-doc-site\n // / multi-marketing-site SaaS apps are not a use case we have\n // ever needed to support).\n //\n // The constraint is enforced at parse time so the failure surfaces\n // at `defineSaasConfig` (CLI parse, dev watcher reload) rather than\n // at first companion-driven OpenAPI publish — the latter would be\n // a confusing \"your second docs service was silently picked over\n // the first\" type of failure.\n //\n // `SAAS_APP` is intentionally NOT constrained here: a single repo\n // can ship multiple SaaS-app frontends (e.g. a customer surface and\n // an internal admin), each owning its own session, and the\n // cross-frontend handoff already handles that fan-out via\n // `runtime.endPoints[*].publicUrl`. The session-owning role does not\n // create a unique-receiver assumption the way the docs / website\n // frontends do.\n const singletonFrontends: ReadonlyArray<AppFrontendType> = [\n AppFrontendType.TECH_DOC,\n AppFrontendType.STATIC_WEBSITE,\n ];\n for (const kind of singletonFrontends) {\n const matchingServiceKeys = Object.entries(config.services)\n .filter(([, def]) => def.frontendType === kind)\n .map(([key]) => key);\n if (matchingServiceKeys.length > 1) {\n for (const offendingKey of matchingServiceKeys) {\n ctx.addIssue({\n code: 'custom',\n path: ['services', offendingKey, 'frontendType'],\n message:\n `frontendType='${kind}' may be declared on at most one service ` +\n `per SaaS app (found ${matchingServiceKeys.length}: ${matchingServiceKeys.join(', ')}). ` +\n `${kind} is a framework-managed singleton — the companion / build ` +\n `pipeline addresses it as \"the ${kind} service\" with no disambiguator. ` +\n `Collapse the duplicates into a single service or split them into separate apps.`,\n });\n }\n }\n }\n}) as unknown as z.ZodType<WildoSaasConfig, WildoSaasConfigInput>;\n/** @wildo_source:part:end platform.config.saas */\n\n/**\n * Define a SaaS application configuration.\n * Provides full IDE autocompletion for engine capabilities, provider scopes,\n * services, modules, and data services.\n *\n * @example\n * ```ts\n * import { defineSaasConfig } from '@wildo-ai/platform-config-lib';\n * import { EngineCapability } from '@wildo-ai/saas-models';\n *\n * export default defineSaasConfig({\n * name: 'wonder-todos',\n * slug: 'wonder-todos',\n * displayName: 'Wonder Todos',\n * type: 'saas',\n * engineCapabilities: {\n * [EngineCapability.EMAIL_TRANSACTIONAL]: { enabled: true },\n * [EngineCapability.SMS]: { enabled: false },\n * [EngineCapability.AI_LLM]: { enabled: true },\n * },\n * providerConfigurations: {},\n * providers: defineSaaSProviders({\n * scopes: {\n * backend: {\n * providers: {\n * resend: {\n * engineCapabilities: [EngineCapability.EMAIL_TRANSACTIONAL],\n * providerCapabilities: ['EMAIL_TRANSACTIONAL'],\n * protocols: ['EMAIL_PROVIDER'],\n * },\n * },\n * },\n * },\n * }),\n * // ...\n * });\n * ```\n */\nexport function defineSaasConfig(config: WildoSaasConfigInput): WildoSaasConfig {\n const parsed = WildoSaasConfigSchema.parse(config);\n emitUnimplementedRuntimeWarnings(parsed);\n return parsed;\n}\n\n/**\n * Emit `@unimplemented` parse-time warnings for every authored field that\n * has no runtime consumer yet (Slice 3.4 contract — see\n * `_unimplemented/unimplemented-field-warning.ts` JSDoc for the full\n * design rationale and the per-call dedupe semantics).\n *\n * The full surface and the matching deferred-backlog IDs are documented\n * once in `.cursor/context/cli-dx.md` (\"Schema fields with `@unimplemented`\n * runtime contract\"). When a deferred slice ships, the matching `if`\n * branch below MUST be removed in the same commit as the runtime wiring\n * — leaving a stale warning is worse than silence because authors will\n * start ignoring the channel.\n *\n * Surfaces today:\n *\n * - `version` (!== undefined) → `D-5`\n *\n * The `minions` / `workers` `@unimplemented` branches were REMOVED\n * 2026-05-05 with the close of D-1 once the runtime path landed\n * end-to-end (publisher → per-minion queue → minion consumer →\n * onTick handler / worker host with HTTP+JWT verifier + apps-manager\n * deploy orchestration). See the close-out note in\n * `.claude/plans/minions-and-workers-implementation.md` Phase 4. The\n * per-entry `resourceAccess` soft-warns below stay — those are\n * advisories about the authoring contract, not \"runtime missing\"\n * markers.\n *\n * Provider activation and product feature modeling no longer warn here:\n * `engineCapabilities` and `providers` are active runtime inputs, while\n * entitlement/product features live in the feature system.\n *\n * The `csp?` placeholder warning that previously lived here moved to\n * `engine/saas-technical-doc/src/config/define-tech-doc-config.ts`\n * along with the rest of `WildoTechnicalDocConfigSchema` (Step 7.5\n * refactor, saas-technical-doc.md). The `wildo.tech-doc.config.ts`\n * loader emits `[wildo-tech-doc-config] @unimplemented field 'csp'\n * authored — runtime support tracked under D-CSP` whenever a value\n * is authored.\n *\n * For `version` the test is `!== undefined` because the field is\n * `.optional()` (no default) — the warning fires iff the author wrote\n * `version: <n>` in their config. See the JSDoc on the schema field\n * above for the rationale.\n */\nfunction emitUnimplementedRuntimeWarnings(config: WildoSaasConfig): void {\n const warn = createUnimplementedFieldWarner(UnimplementedFieldSource.SAAS_CONFIG);\n\n if (config.version !== undefined) {\n warn('version', 'D-5');\n }\n\n // H-3 (`minions-and-workers-implementation.md` Phase 1): per-minion\n // soft-warns covering the KD-11 `resourceAccess` authoring posture.\n // These fire AFTER the `@unimplemented` block per the IC-1 emit-\n // ordering contract; the `emitSoftWarn` utility caps repeats\n // process-wide so the dev watcher's per-save re-parses do not spam.\n //\n // Two advisory shapes (the per-resource membership check against the parsed catalog runs in Phase 2\n // from `start-minion-application` per IC-2 — Phase 1 only validates STRUCTURAL shape):\n //\n // 1. `resourceAccess.missing` — entry omits the block entirely\n // (fail-closed default; advisory\n // so a forgotten whitelist is\n // visible without blocking dev).\n // 2. `resourceAccess.empty` — both `read` and `write` are\n // empty arrays (intent-equivalent\n // to omission, but flagged so the\n // author knows the minion will be\n // blocked at every repository call).\n //\n // An ASYMMETRIC whitelist (`write: []` beside a non-empty `read`, or the reverse) is NOT advised on,\n // and it used to be (`resourceAccess.read-only` / `.write-only`). Both fields are required, so an empty\n // side is always AUTHORED — it is the declaration of intent, not a typo — and the advisory told the\n // author to \"keep as-is\" while printing on every `wildo` command with no way to acknowledge it (#1637:\n // Wonder Todos' read-only scraper put it at the top of every command's output). A side left empty by\n // mistake is refused at the first call that needs it, by `ResourceAccessForbiddenError`, which names the\n // minion, the resource and the access mode.\n for (const [minionKey, entry] of Object.entries(config.minions ?? {})) {\n const scope = `minions.${minionKey}`;\n if (!entry.resourceAccess) {\n emitSoftWarn(\n scope,\n 'resourceAccess.missing',\n 'no resourceAccess block authored — the v1 minion runtime will deny every repository call by default (KD-11 fail-closed). Author { read: [...], write: [...] } in wildo.saas.config.ts > minions to opt-in.',\n );\n continue;\n }\n const { read, write } = entry.resourceAccess;\n if (read.length === 0 && write.length === 0) {\n emitSoftWarn(\n scope,\n 'resourceAccess.empty',\n 'resourceAccess block is present but both `read` and `write` are empty arrays — equivalent to omitting the block. Author at least one resource name to grant access.',\n );\n }\n }\n\n // M1 (audit-logging Phase 1+2 hardening) — coherence advisory: an ENABLED\n // capability whose resolution mode is FAN_OUT (e.g. COMPLIANCE_AUDIT_TRAIL)\n // writes to EVERY declared provider, so with ZERO providers declaring it the\n // fan-out is a SILENT no-op — the exact compliance hole (an \"enabled\" audit\n // trail that reaches nothing) a config check should surface. The inverse (a\n // provider declaring a non-`enabled` capability) is already a HARD error in the\n // provider-scope refinement, so only this enabled-but-unserved direction needs\n // an advisory. Soft-warn (not fail-closed) so the enable-first-then-wire\n // authoring order isn't blocked.\n const capabilitiesDeclaredByAnyProvider = new Set<EngineCapability>();\n const allProviderScopes = [\n config.providers?.scopes.backend,\n config.providers?.scopes.companion,\n ...Object.values(config.providers?.scopes.frontendServices ?? {}),\n ...Object.values(config.providers?.scopes.minions ?? {}),\n ...Object.values(config.providers?.scopes.workers ?? {}),\n ];\n for (const scope of allProviderScopes) {\n if (!scope) continue;\n for (const providerSelection of Object.values(scope.providers)) {\n for (const capability of providerSelection.engineCapabilities) {\n capabilitiesDeclaredByAnyProvider.add(capability);\n }\n }\n }\n for (const [capabilityKey, activation] of Object.entries(config.engineCapabilities ?? {})) {\n if (activation?.enabled !== true) continue;\n const capability = capabilityKey as EngineCapability;\n if (getEngineCapabilityResolutionMode(capability) !== EngineCapabilityResolutionMode.FAN_OUT) continue;\n if (!capabilitiesDeclaredByAnyProvider.has(capability)) {\n emitSoftWarn(\n 'providers.engineCapabilities',\n `fanout-no-provider:${capability}`,\n `capability \"${capability}\" is enabled and FAN_OUT (every declared provider receives every emission), but NO provider in any scope declares it — its fan-out (e.g. the compliance audit trail) is a SILENT no-op. Declare at least one provider with engineCapabilities: ['${capability}'], or disable the capability.`,\n );\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"define-worker-config.d.ts","sourceRoot":"","sources":["../../../../src/project-config/define-worker-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB;;EAAwB,CAAC;AACtD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB;;;;;kBAK3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmBlC;;;;;;;OAOG;;;;;;;kBAIH,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE7E;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,sBAAsB,GAAG,iBAAiB,CAEpF"}
1
+ {"version":3,"file":"define-worker-config.d.ts","sourceRoot":"","sources":["../../../src/project-config/define-worker-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB;;EAAwB,CAAC;AACtD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB;;;;;kBAK3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmBlC;;;;;;;OAOG;;;;;;;kBAIH,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE7E;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,sBAAsB,GAAG,iBAAiB,CAEpF"}
@@ -1 +1 @@
1
- {"version":3,"file":"define-worker-config.js","sourceRoot":"","sources":["../../../../src/project-config/define-worker-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,gB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,EAAE,mBAAmB;IAC5B,gEAAgE;IAChE,0DAA0D;IAC1D,mEAAmE;IACnE,gEAAgE;IAChE,oEAAoE;IACpE,kEAAkE;IAClE,iEAAiE;IACjE,yDAAyD;IACzD,IAAI,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;IACnC,IAAI,EAAE,gBAAgB;IACtB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAChD,SAAS,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC1C,UAAU,EAAE,gBAAgB,CAAC,QAAQ,EAAE;IACvC;;;;;;;OAOG;IACH,SAAS,EAAE,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC;CAC/C,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAC1B,sBAAsB,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAC7C,CAAC,CAAC,CAAC;AAIH;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAA8B;IAC/D,OAAO,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n WorkerRuntimeSchema,\n ResourceLimitsSchema,\n DataAccessSchema,\n RuntimeIsolationSchema,\n refineRuntimeIsolation,\n} from './shared/service-definitions.schemas';\n\n/**\n * Worker authentication strategy on the inbound HTTP surface.\n *\n * Only `'wildo-jwt'` is supported in v1 — the worker validates the\n * incoming bearer against the dynamically-resolved Wildo public key\n * (Q3 LOCKED in `.cursor/plans/minions-and-workers-implementation.md`),\n * exactly mirroring the existing `applicationAuthMode: 'dynamic'`\n * default in `platform-service-auth.shared.platform.middleware.ts`.\n *\n * Authoring this as an enum (rather than a bare string) front-loads the\n * decision — a future `'mtls'` / `'static-token'` variant will require\n * a deliberate schema bump and a corresponding registry entry, never an\n * accidental \"any string accepted\" weakening.\n */\nexport const WorkerAuthSchema = z.enum(['wildo-jwt']);\nexport type WorkerAuth = z.infer<typeof WorkerAuthSchema>;\n\n/**\n * Inbound HTTP surface for a worker subprocess.\n *\n * G-18 in the implementation plan: every worker MUST expose\n * `/healthz` (liveness) and `/readyz` (readiness) so K8s probes have\n * a uniform contract across Rust / Node / Java implementations. The\n * `metrics?` path is opt-in (Prometheus scrape) — defaulting it to\n * `/metrics` would force every worker to ship a metrics surface,\n * which is out of scope for v1's \"acknowledge service\" implementations.\n *\n * Defaults are baked into the schema so the example\n * `wildo.worker.config.ts` files stay terse:\n * - `port` → 8080 (industry-standard worker default)\n * - `healthPath` → '/healthz'\n * - `readyPath` → '/readyz'\n */\nexport const WorkerHttpSchema = z.strictObject({\n port: z.number().int().positive().default(8080),\n healthPath: z.string().min(1).startsWith('/').default('/healthz'),\n readyPath: z.string().min(1).startsWith('/').default('/readyz'),\n metricsPath: z.string().min(1).startsWith('/').optional(),\n});\nexport type WorkerHttp = z.infer<typeof WorkerHttpSchema>;\n\n/**\n * Per-folder worker configuration.\n *\n * Phase 1 schema honesty (KD-1, KD-3, KD-4, Q7 in\n * `.cursor/plans/minions-and-workers-implementation.md`):\n *\n * - The legacy `queue` block is REMOVED. Workers are HTTP-only in\n * v1 — backend-to-worker communication goes through the inbound\n * `http` surface, not via direct queue consumption (KD-4). When\n * queue-driven workers land post-v1 they will re-enter the schema\n * via a deliberate, explicit field (probably `inboundQueue?`) so\n * the \"HTTP-only today\" contract stays visible.\n *\n * - `http` (required) declares the inbound surface contract — see\n * `WorkerHttpSchema` JSDoc.\n *\n * - `auth` (required) declares the inbound authentication strategy —\n * `'wildo-jwt'` only in v1 (Q3 LOCKED).\n *\n * - `replicas` (default 1) is authored explicitly per Q7 LOCKED —\n * Phase 3's K8s emitter reads this field directly. HPA wiring is\n * NOT modelled here (deferred); fixed `replicas` is the only\n * scaling primitive in v1.\n *\n * - `dataAccess` is RETAINED for forward compatibility but stays\n * inert in v1 — workers have NO database / cache / queue access\n * by default per KD-2. Authoring the field today will be flagged\n * by the soft-warn machinery in Phase 2 once\n * `start-worker-application` lands.\n *\n * The schema is `z.strictObject` so a typo (`hht:` instead of `http:`)\n * fails fast rather than being silently dropped — same posture as\n * `WildoSaasConfigSchema` (Slice 3 deep-review H-1).\n */\nexport const WildoWorkerConfigSchema = z.strictObject({\n version: z.number().int().positive().default(1),\n name: z.string().min(1),\n displayName: z.string().min(1),\n description: z.string().optional(),\n runtime: WorkerRuntimeSchema,\n // `.prefault({})` (NOT `.default({})`) so the empty input flows\n // through `WorkerHttpSchema` and the inner field defaults\n // (`port: 8080`, `healthPath: '/healthz'`, `readyPath: '/readyz'`)\n // are applied. Zod v4's `.default(x)` is an OUTPUT default — it\n // returns `x` as-is without re-parsing — which would yield the bare\n // `{}` and silently lose every inner default. The `prefault` form\n // is the Zod v4 idiom for \"use this value if input is undefined,\n // and route it through the schema like any other input\".\n http: WorkerHttpSchema.prefault({}),\n auth: WorkerAuthSchema,\n replicas: z.number().int().positive().default(1),\n resources: ResourceLimitsSchema.optional(),\n dataAccess: DataAccessSchema.optional(),\n /**\n * Container isolation. `.prefault({})` — NOT `.optional()` — because an absent\n * block must still yield the secure defaults: \"authored nothing\" is the common\n * case and is exactly the one that must come out hardened.\n *\n * Only image-dependent and ADDITIVE knobs are authorable; the security floor is\n * emitted unconditionally by the renderers. See {@link RuntimeIsolationSchema}.\n */\n isolation: RuntimeIsolationSchema.prefault({}),\n}).superRefine((cfg, ctx) => {\n refineRuntimeIsolation(cfg.isolation, ctx);\n});\nexport type WildoWorkerConfig = z.infer<typeof WildoWorkerConfigSchema>;\nexport type WildoWorkerConfigInput = z.input<typeof WildoWorkerConfigSchema>;\n\n/**\n * Define a worker service configuration.\n * Workers are HTTP-only subprocesses — no queue consumption, no DB / cache\n * by default (KD-2 / KD-4). Backend-to-worker communication uses the\n * declared `http` surface with `auth='wildo-jwt'` bearers.\n */\nexport function defineWorkerConfig(config: WildoWorkerConfigInput): WildoWorkerConfig {\n return WildoWorkerConfigSchema.parse(config);\n}\n"]}
1
+ {"version":3,"file":"define-worker-config.js","sourceRoot":"","sources":["../../../src/project-config/define-worker-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,sCAAsC,CAAC;AAE9C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAGtD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC/C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IACjE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC/D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CAC1D,CAAC,CAAC;AAGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,YAAY,CAAC;IACpD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,mBAAmB;IAC5B,gEAAgE;IAChE,0DAA0D;IAC1D,mEAAmE;IACnE,gEAAgE;IAChE,oEAAoE;IACpE,kEAAkE;IAClE,iEAAiE;IACjE,yDAAyD;IACzD,IAAI,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;IACnC,IAAI,EAAE,gBAAgB;IACtB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAChD,SAAS,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC1C,UAAU,EAAE,gBAAgB,CAAC,QAAQ,EAAE;IACvC;;;;;;;OAOG;IACH,SAAS,EAAE,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC;CAC/C,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAC1B,sBAAsB,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAC7C,CAAC,CAAC,CAAC;AAIH;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAA8B;IAC/D,OAAO,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n WorkerRuntimeSchema,\n ResourceLimitsSchema,\n DataAccessSchema,\n RuntimeIsolationSchema,\n refineRuntimeIsolation,\n} from './shared/service-definitions.schemas';\n\n/**\n * Worker authentication strategy on the inbound HTTP surface.\n *\n * Only `'wildo-jwt'` is supported in v1 — the worker validates the\n * incoming bearer against the dynamically-resolved Wildo public key\n * (Q3 LOCKED in `.cursor/plans/minions-and-workers-implementation.md`),\n * exactly mirroring the existing `applicationAuthMode: 'dynamic'`\n * default in `platform-service-auth.shared.platform.middleware.ts`.\n *\n * Authoring this as an enum (rather than a bare string) front-loads the\n * decision — a future `'mtls'` / `'static-token'` variant will require\n * a deliberate schema bump and a corresponding registry entry, never an\n * accidental \"any string accepted\" weakening.\n */\nexport const WorkerAuthSchema = z.enum(['wildo-jwt']);\nexport type WorkerAuth = z.infer<typeof WorkerAuthSchema>;\n\n/**\n * Inbound HTTP surface for a worker subprocess.\n *\n * G-18 in the implementation plan: every worker MUST expose\n * `/healthz` (liveness) and `/readyz` (readiness) so K8s probes have\n * a uniform contract across Rust / Node / Java implementations. The\n * `metrics?` path is opt-in (Prometheus scrape) — defaulting it to\n * `/metrics` would force every worker to ship a metrics surface,\n * which is out of scope for v1's \"acknowledge service\" implementations.\n *\n * Defaults are baked into the schema so the example\n * `wildo.worker.config.ts` files stay terse:\n * - `port` → 8080 (industry-standard worker default)\n * - `healthPath` → '/healthz'\n * - `readyPath` → '/readyz'\n */\nexport const WorkerHttpSchema = z.strictObject({\n port: z.number().int().positive().default(8080),\n healthPath: z.string().min(1).startsWith('/').default('/healthz'),\n readyPath: z.string().min(1).startsWith('/').default('/readyz'),\n metricsPath: z.string().min(1).startsWith('/').optional(),\n});\nexport type WorkerHttp = z.infer<typeof WorkerHttpSchema>;\n\n/**\n * Per-folder worker configuration.\n *\n * Phase 1 schema honesty (KD-1, KD-3, KD-4, Q7 in\n * `.cursor/plans/minions-and-workers-implementation.md`):\n *\n * - The legacy `queue` block is REMOVED. Workers are HTTP-only in\n * v1 — backend-to-worker communication goes through the inbound\n * `http` surface, not via direct queue consumption (KD-4). When\n * queue-driven workers land post-v1 they will re-enter the schema\n * via a deliberate, explicit field (probably `inboundQueue?`) so\n * the \"HTTP-only today\" contract stays visible.\n *\n * - `http` (required) declares the inbound surface contract — see\n * `WorkerHttpSchema` JSDoc.\n *\n * - `auth` (required) declares the inbound authentication strategy —\n * `'wildo-jwt'` only in v1 (Q3 LOCKED).\n *\n * - `replicas` (default 1) is authored explicitly per Q7 LOCKED —\n * Phase 3's K8s emitter reads this field directly. HPA wiring is\n * NOT modelled here (deferred); fixed `replicas` is the only\n * scaling primitive in v1.\n *\n * - `dataAccess` is RETAINED for forward compatibility but stays\n * inert in v1 — workers have NO database / cache / queue access\n * by default per KD-2. Authoring the field today will be flagged\n * by the soft-warn machinery in Phase 2 once\n * `start-worker-application` lands.\n *\n * The schema is `z.strictObject` so a typo (`hht:` instead of `http:`)\n * fails fast rather than being silently dropped — same posture as\n * `WildoSaasConfigSchema` (Slice 3 deep-review H-1).\n */\nexport const WildoWorkerConfigSchema = z.strictObject({\n version: z.number().int().positive().default(1),\n name: z.string().min(1),\n displayName: z.string().min(1),\n description: z.string().optional(),\n runtime: WorkerRuntimeSchema,\n // `.prefault({})` (NOT `.default({})`) so the empty input flows\n // through `WorkerHttpSchema` and the inner field defaults\n // (`port: 8080`, `healthPath: '/healthz'`, `readyPath: '/readyz'`)\n // are applied. Zod v4's `.default(x)` is an OUTPUT default — it\n // returns `x` as-is without re-parsing — which would yield the bare\n // `{}` and silently lose every inner default. The `prefault` form\n // is the Zod v4 idiom for \"use this value if input is undefined,\n // and route it through the schema like any other input\".\n http: WorkerHttpSchema.prefault({}),\n auth: WorkerAuthSchema,\n replicas: z.number().int().positive().default(1),\n resources: ResourceLimitsSchema.optional(),\n dataAccess: DataAccessSchema.optional(),\n /**\n * Container isolation. `.prefault({})` — NOT `.optional()` — because an absent\n * block must still yield the secure defaults: \"authored nothing\" is the common\n * case and is exactly the one that must come out hardened.\n *\n * Only image-dependent and ADDITIVE knobs are authorable; the security floor is\n * emitted unconditionally by the renderers. See {@link RuntimeIsolationSchema}.\n */\n isolation: RuntimeIsolationSchema.prefault({}),\n}).superRefine((cfg, ctx) => {\n refineRuntimeIsolation(cfg.isolation, ctx);\n});\nexport type WildoWorkerConfig = z.infer<typeof WildoWorkerConfigSchema>;\nexport type WildoWorkerConfigInput = z.input<typeof WildoWorkerConfigSchema>;\n\n/**\n * Define a worker service configuration.\n * Workers are HTTP-only subprocesses — no queue consumption, no DB / cache\n * by default (KD-2 / KD-4). Backend-to-worker communication uses the\n * declared `http` surface with `auth='wildo-jwt'` bearers.\n */\nexport function defineWorkerConfig(config: WildoWorkerConfigInput): WildoWorkerConfig {\n return WildoWorkerConfigSchema.parse(config);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"hosted-infra-env-config.d.ts","sourceRoot":"","sources":["../../../../src/project-config/hosted-infra-env-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EAEzB,MAAM,2BAA2B,CAAC;AAInC;;;GAGG;AACH,MAAM,WAAW,mCAAmC;IAClD,MAAM,EAAE,yBAAyB,CAAC;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,2EAA2E;IAC3E,IAAI,EAAE,2BAA2B,CAAC;IAClC,gBAAgB;IAChB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB;IAChB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,qBAAa,mCAAoC,SAAQ,KAAK;IAC5D,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;gBAEvB,gBAAgB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE;CAQxF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,mCAAmC,GAAG,mBAAmB,CAkE3G"}
1
+ {"version":3,"file":"hosted-infra-env-config.d.ts","sourceRoot":"","sources":["../../../src/project-config/hosted-infra-env-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EAEzB,MAAM,2BAA2B,CAAC;AAInC;;;GAGG;AACH,MAAM,WAAW,mCAAmC;IAClD,MAAM,EAAE,yBAAyB,CAAC;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,2EAA2E;IAC3E,IAAI,EAAE,2BAA2B,CAAC;IAClC,gBAAgB;IAChB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB;IAChB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,qBAAa,mCAAoC,SAAQ,KAAK;IAC5D,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;gBAEvB,gBAAgB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE;CAQxF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,mCAAmC,GAAG,mBAAmB,CAkE3G"}