@wildo-ai/wildo-cli 1.1.13 → 1.1.14
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.
- package/dist/src/commands/build/approve.command.d.ts +4 -0
- package/dist/src/commands/build/approve.command.d.ts.map +1 -1
- package/dist/src/commands/build/approve.command.js +14 -3
- package/dist/src/commands/build/approve.command.js.map +1 -1
- package/dist/src/commands/build/close.command.d.ts +4 -0
- package/dist/src/commands/build/close.command.d.ts.map +1 -1
- package/dist/src/commands/build/close.command.js +17 -3
- package/dist/src/commands/build/close.command.js.map +1 -1
- package/dist/src/commands/config/sync.command.d.ts.map +1 -1
- package/dist/src/commands/config/sync.command.js +21 -1
- package/dist/src/commands/config/sync.command.js.map +1 -1
- package/dist/src/commands/creation/feed.command.d.ts.map +1 -1
- package/dist/src/commands/creation/feed.command.js +6 -3
- package/dist/src/commands/creation/feed.command.js.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.d.ts +13 -0
- package/dist/src/commands/fwk/publish-all.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.js +57 -3
- package/dist/src/commands/fwk/publish-all.command.js.map +1 -1
- package/dist/src/commands/fwk/publish-docker.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-docker.command.js +16 -1
- package/dist/src/commands/fwk/publish-docker.command.js.map +1 -1
- package/dist/src/commands/fwk/registry-host.command.d.ts +19 -1
- package/dist/src/commands/fwk/registry-host.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/registry-host.command.js +78 -3
- package/dist/src/commands/fwk/registry-host.command.js.map +1 -1
- package/dist/src/commands/init.command.d.ts +14 -0
- package/dist/src/commands/init.command.d.ts.map +1 -1
- package/dist/src/commands/init.command.js +29 -3
- package/dist/src/commands/init.command.js.map +1 -1
- package/dist/src/commands/registry/repair-lockfile.command.d.ts.map +1 -1
- package/dist/src/commands/registry/repair-lockfile.command.js +1 -0
- package/dist/src/commands/registry/repair-lockfile.command.js.map +1 -1
- package/dist/src/commands/registry/update.command.d.ts.map +1 -1
- package/dist/src/commands/registry/update.command.js +1 -0
- package/dist/src/commands/registry/update.command.js.map +1 -1
- package/dist/src/commands/seal/verify.command.d.ts +18 -0
- package/dist/src/commands/seal/verify.command.d.ts.map +1 -1
- package/dist/src/commands/seal/verify.command.js +62 -1
- package/dist/src/commands/seal/verify.command.js.map +1 -1
- package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
- package/dist/src/services/application/provider-runtime-sync.service.js +26 -1
- package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
- package/dist/src/services/application/saas-skeleton.service.d.ts.map +1 -1
- package/dist/src/services/application/saas-skeleton.service.js +24 -2
- package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
- package/dist/src/services/companion/build-console.service.d.ts +39 -2
- package/dist/src/services/companion/build-console.service.d.ts.map +1 -1
- package/dist/src/services/companion/build-console.service.js +54 -4
- package/dist/src/services/companion/build-console.service.js.map +1 -1
- package/dist/src/services/companion/creation-console.service.d.ts +6 -1
- package/dist/src/services/companion/creation-console.service.d.ts.map +1 -1
- package/dist/src/services/companion/creation-console.service.js +14 -2
- package/dist/src/services/companion/creation-console.service.js.map +1 -1
- package/dist/src/services/companion/creation-drive.service.d.ts.map +1 -1
- package/dist/src/services/companion/creation-drive.service.js +5 -2
- package/dist/src/services/companion/creation-drive.service.js.map +1 -1
- package/dist/src/services/credentials/composed-provider-catalogue.d.ts.map +1 -1
- package/dist/src/services/credentials/composed-provider-catalogue.js +14 -2
- package/dist/src/services/credentials/composed-provider-catalogue.js.map +1 -1
- package/dist/src/services/credentials/secret-requirements.service.d.ts +2 -1
- package/dist/src/services/credentials/secret-requirements.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secret-requirements.service.js +17 -1
- package/dist/src/services/credentials/secret-requirements.service.js.map +1 -1
- package/dist/src/services/deployment/application-runtime-environment.d.ts.map +1 -1
- package/dist/src/services/deployment/application-runtime-environment.js +3 -13
- package/dist/src/services/deployment/application-runtime-environment.js.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js +8 -2
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
- package/dist/src/services/deployment/host-toolchain-readiness.service.d.ts +1 -1
- package/dist/src/services/deployment/host-toolchain-readiness.service.js +1 -1
- package/dist/src/services/deployment/host-toolchain-readiness.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js +3 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js.map +1 -1
- package/dist/src/services/deployment/local-precondition-checks.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-precondition-checks.service.js +4 -2
- package/dist/src/services/deployment/local-precondition-checks.service.js.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.js +8 -3
- package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
- package/dist/src/services/environment/environment-service-profile.utils.d.ts +8 -1
- package/dist/src/services/environment/environment-service-profile.utils.d.ts.map +1 -1
- package/dist/src/services/environment/environment-service-profile.utils.js +14 -1
- package/dist/src/services/environment/environment-service-profile.utils.js.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.d.ts +89 -0
- package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.js +180 -18
- package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
- package/dist/src/services/framework/github-actions-annotation.d.ts +19 -0
- package/dist/src/services/framework/github-actions-annotation.d.ts.map +1 -0
- package/dist/src/services/framework/github-actions-annotation.js +25 -0
- package/dist/src/services/framework/github-actions-annotation.js.map +1 -0
- package/dist/src/services/framework/registry-host/registry-host-upgrade.d.ts +43 -0
- package/dist/src/services/framework/registry-host/registry-host-upgrade.d.ts.map +1 -0
- package/dist/src/services/framework/registry-host/registry-host-upgrade.js +117 -0
- package/dist/src/services/framework/registry-host/registry-host-upgrade.js.map +1 -0
- package/dist/src/services/framework/registry-host/registry-host.service.d.ts +1 -1
- package/dist/src/services/framework/registry-host/registry-host.service.d.ts.map +1 -1
- package/dist/src/services/framework/registry-host/registry-host.service.js +2 -0
- package/dist/src/services/framework/registry-host/registry-host.service.js.map +1 -1
- package/dist/src/services/registry/installed-file-state.utils.d.ts +8 -0
- package/dist/src/services/registry/installed-file-state.utils.d.ts.map +1 -1
- package/dist/src/services/registry/installed-file-state.utils.js +9 -1
- package/dist/src/services/registry/installed-file-state.utils.js.map +1 -1
- package/dist/src/services/registry/module-install.service.d.ts.map +1 -1
- package/dist/src/services/registry/module-install.service.js +1 -0
- package/dist/src/services/registry/module-install.service.js.map +1 -1
- package/dist/src/services/registry/provider-module-scaffold.service.d.ts.map +1 -1
- package/dist/src/services/registry/provider-module-scaffold.service.js +4 -0
- package/dist/src/services/registry/provider-module-scaffold.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/framework-root-package.json +3 -3
- package/package.json +22 -22
- package/scripts/app-dependency-alignment/propagated-engine-overrides.json +1 -1
- package/templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs +17 -2
- package/templates/infra/registry-host/docker-compose.yml +9 -2
- package/templates/infra/registry-host/upgrade-image.sh +108 -0
- package/templates/saas/i18n/email/resources/dataSubjectRequests/create.users-custom_ready/labels.fr.ts +22 -0
- package/templates/saas/i18n/email/resources/dataSubjectRequests/create.users-custom_received/labels.fr.ts +23 -0
- package/templates/saas/i18n/email/resources/dataSubjectRequests/update.users-custom_extended/labels.fr.ts +23 -0
- package/templates/saas/i18n/email/resources/organizationSsoConfig/repairUnreadableConfiguration.organization-users/labels.fr.ts +23 -0
- package/templates/saas/i18n/engine/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.ts +28 -0
- package/templates/saas/i18n/engine/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.ts +28 -0
- package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_APPROVAL.en.ts +2 -1
- package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_APPROVAL.fr.ts +2 -1
- package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.ts +6 -1
- package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.ts +6 -1
- package/templates/saas/i18n/engine/components/LOW_LEVEL_APPROVAL_SEAL.en.ts +40 -0
- package/templates/saas/i18n/engine/components/LOW_LEVEL_APPROVAL_SEAL.fr.ts +40 -0
- package/templates/saas/i18n/engine/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.ts +2 -1
- package/templates/saas/i18n/engine/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.ts +2 -1
- package/templates/saas/i18n/engine/components/LOW_LEVEL_FORM_FIELD_STRING.en.ts +2 -1
- package/templates/saas/i18n/engine/components/LOW_LEVEL_FORM_FIELD_STRING.fr.ts +2 -1
- package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.ts +2 -1
- package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.ts +2 -1
- package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_TERMS.en.ts +3 -1
- package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_TERMS.fr.ts +3 -1
- package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_USER_AUTH.en.ts +2 -1
- package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_USER_AUTH.fr.ts +2 -1
- package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_FILTERS.en.ts +3 -1
- package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_FILTERS.fr.ts +4 -2
- package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_LIST.en.ts +18 -1
- package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_LIST.fr.ts +18 -1
- package/templates/saas/i18n/engine/resources/actorSystemExecutions.en.ts +10 -82
- package/templates/saas/i18n/engine/resources/actorSystemExecutions.fr.ts +0 -72
- package/templates/saas/i18n/engine/resources/actorTasks.en.ts +0 -33
- package/templates/saas/i18n/engine/resources/actorTasks.fr.ts +0 -33
- package/templates/saas/i18n/engine/resources/agentBehaviorReports.en.ts +0 -108
- package/templates/saas/i18n/engine/resources/agentBehaviorReports.fr.ts +0 -108
- package/templates/saas/i18n/engine/resources/agentOperationRecords.en.ts +8 -24
- package/templates/saas/i18n/engine/resources/agentOperationRecords.fr.ts +10 -26
- package/templates/saas/i18n/engine/resources/agentWorkCaptureSettings.en.ts +0 -12
- package/templates/saas/i18n/engine/resources/agentWorkCaptureSettings.fr.ts +0 -12
- package/templates/saas/i18n/engine/resources/anonymous_users.en.ts +8 -74
- package/templates/saas/i18n/engine/resources/anonymous_users.fr.ts +0 -66
- package/templates/saas/i18n/engine/resources/applicationA2aPushDeliveryLog.en.ts +3 -21
- package/templates/saas/i18n/engine/resources/applicationA2aPushDeliveryLog.fr.ts +0 -18
- package/templates/saas/i18n/engine/resources/applicationA2aTokenBudgetState.en.ts +3 -33
- package/templates/saas/i18n/engine/resources/applicationA2aTokenBudgetState.fr.ts +0 -30
- package/templates/saas/i18n/engine/resources/applicationAccessGrants.en.ts +13 -55
- package/templates/saas/i18n/engine/resources/applicationAccessGrants.fr.ts +0 -42
- package/templates/saas/i18n/engine/resources/applicationAgentPolicies.en.ts +8 -24
- package/templates/saas/i18n/engine/resources/applicationAgentPolicies.fr.ts +8 -24
- package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisionContents.en.ts +0 -27
- package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisionContents.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisions.en.ts +13 -43
- package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisions.fr.ts +0 -30
- package/templates/saas/i18n/engine/resources/applicationApiKeys.en.ts +2 -70
- package/templates/saas/i18n/engine/resources/applicationApiKeys.fr.ts +2 -70
- package/templates/saas/i18n/engine/resources/applicationAuditLogs.en.ts +41 -94
- package/templates/saas/i18n/engine/resources/applicationAuditLogs.fr.ts +41 -94
- package/templates/saas/i18n/engine/resources/applicationDataKeys.en.ts +2 -22
- package/templates/saas/i18n/engine/resources/applicationDataKeys.fr.ts +2 -22
- package/templates/saas/i18n/engine/resources/applicationFeatures.en.ts +0 -24
- package/templates/saas/i18n/engine/resources/applicationFeatures.fr.ts +0 -24
- package/templates/saas/i18n/engine/resources/applicationFlowActorExecutions.en.ts +25 -160
- package/templates/saas/i18n/engine/resources/applicationFlowActorExecutions.fr.ts +25 -160
- package/templates/saas/i18n/engine/resources/applicationFlowActorTasks.en.ts +6 -28
- package/templates/saas/i18n/engine/resources/applicationFlowActorTasks.fr.ts +8 -30
- package/templates/saas/i18n/engine/resources/applicationInboundDeliveries.en.ts +92 -23
- package/templates/saas/i18n/engine/resources/applicationInboundDeliveries.fr.ts +95 -26
- package/templates/saas/i18n/engine/resources/applicationM2mWebhookDeliveryLog.en.ts +1 -25
- package/templates/saas/i18n/engine/resources/applicationM2mWebhookDeliveryLog.fr.ts +4 -28
- package/templates/saas/i18n/engine/resources/applicationMetadata.en.ts +0 -18
- package/templates/saas/i18n/engine/resources/applicationMetadata.fr.ts +0 -18
- package/templates/saas/i18n/engine/resources/applicationOAuthClients.en.ts +2 -58
- package/templates/saas/i18n/engine/resources/applicationOAuthClients.fr.ts +2 -58
- package/templates/saas/i18n/engine/resources/applicationProviderCredentials.en.ts +168 -0
- package/templates/saas/i18n/engine/resources/applicationProviderCredentials.fr.ts +168 -0
- package/templates/saas/i18n/engine/resources/applicationScimProvisioningConfig.en.ts +0 -30
- package/templates/saas/i18n/engine/resources/applicationScimProvisioningConfig.fr.ts +0 -30
- package/templates/saas/i18n/engine/resources/applicationSiemDeliveryDlq.en.ts +3 -42
- package/templates/saas/i18n/engine/resources/applicationSiemDeliveryDlq.fr.ts +5 -44
- package/templates/saas/i18n/engine/resources/applicationSiemDeliveryOutbox.en.ts +3 -30
- package/templates/saas/i18n/engine/resources/applicationSiemDeliveryOutbox.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/applicationSiemExportConfig.en.ts +0 -24
- package/templates/saas/i18n/engine/resources/applicationSiemExportConfig.fr.ts +0 -24
- package/templates/saas/i18n/engine/resources/applicationSsoConfig.en.ts +113 -61
- package/templates/saas/i18n/engine/resources/applicationSsoConfig.fr.ts +113 -61
- package/templates/saas/i18n/engine/resources/applicationSsoConnections.en.ts +0 -138
- package/templates/saas/i18n/engine/resources/applicationSsoConnections.fr.ts +0 -138
- package/templates/saas/i18n/engine/resources/applicationVersions.en.ts +3 -27
- package/templates/saas/i18n/engine/resources/applicationVersions.fr.ts +0 -24
- package/templates/saas/i18n/engine/resources/applicationWebhookConfig.en.ts +5 -54
- package/templates/saas/i18n/engine/resources/applicationWebhookConfig.fr.ts +5 -54
- package/templates/saas/i18n/engine/resources/applications.en.ts +39 -2177
- package/templates/saas/i18n/engine/resources/applications.fr.ts +39 -2177
- package/templates/saas/i18n/engine/resources/approvalSeals.en.ts +38 -31
- package/templates/saas/i18n/engine/resources/approvalSeals.fr.ts +38 -31
- package/templates/saas/i18n/engine/resources/auditLogs.en.ts +78 -111
- package/templates/saas/i18n/engine/resources/auditLogs.fr.ts +78 -111
- package/templates/saas/i18n/engine/resources/billingEffectOutbox.en.ts +2 -4
- package/templates/saas/i18n/engine/resources/billingEffectOutbox.fr.ts +2 -4
- package/templates/saas/i18n/engine/resources/billingSubscriptionMutationIntents.en.ts +8 -6
- package/templates/saas/i18n/engine/resources/billingSubscriptionMutationIntents.fr.ts +8 -6
- package/templates/saas/i18n/engine/resources/chatConversations.en.ts +0 -18
- package/templates/saas/i18n/engine/resources/chatConversations.fr.ts +0 -18
- package/templates/saas/i18n/engine/resources/chatIdentityLinks.en.ts +0 -44
- package/templates/saas/i18n/engine/resources/chatIdentityLinks.fr.ts +0 -44
- package/templates/saas/i18n/engine/resources/consumableTokens.en.ts +4 -43
- package/templates/saas/i18n/engine/resources/consumableTokens.fr.ts +4 -43
- package/templates/saas/i18n/engine/resources/conversationMessages.en.ts +16 -27
- package/templates/saas/i18n/engine/resources/conversationMessages.fr.ts +16 -27
- package/templates/saas/i18n/engine/resources/conversationReplyTokens.en.ts +0 -27
- package/templates/saas/i18n/engine/resources/conversationReplyTokens.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/conversationThreads.en.ts +0 -27
- package/templates/saas/i18n/engine/resources/conversationThreads.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/dataSeedRuns.en.ts +22 -17
- package/templates/saas/i18n/engine/resources/dataSeedRuns.fr.ts +22 -17
- package/templates/saas/i18n/engine/resources/dataSubjectRequests.en.ts +410 -0
- package/templates/saas/i18n/engine/resources/dataSubjectRequests.fr.ts +410 -0
- package/templates/saas/i18n/engine/resources/etlPipelineStates.en.ts +128 -146
- package/templates/saas/i18n/engine/resources/etlPipelineStates.fr.ts +0 -18
- package/templates/saas/i18n/engine/resources/evaluationDatasetExports.en.ts +13 -43
- package/templates/saas/i18n/engine/resources/evaluationDatasetExports.fr.ts +0 -30
- package/templates/saas/i18n/engine/resources/evaluationExportAuthorizations.en.ts +0 -12
- package/templates/saas/i18n/engine/resources/evaluationExportAuthorizations.fr.ts +0 -12
- package/templates/saas/i18n/engine/resources/externalDataErasureSuppressions.en.ts +0 -21
- package/templates/saas/i18n/engine/resources/externalDataErasureSuppressions.fr.ts +0 -21
- package/templates/saas/i18n/engine/resources/externalDataOutboundChanges.en.ts +24 -45
- package/templates/saas/i18n/engine/resources/externalDataOutboundChanges.fr.ts +0 -21
- package/templates/saas/i18n/engine/resources/externalDataPendingReferences.en.ts +0 -24
- package/templates/saas/i18n/engine/resources/externalDataPendingReferences.fr.ts +0 -24
- package/templates/saas/i18n/engine/resources/externalDataPipelineMembershipKeys.en.ts +0 -21
- package/templates/saas/i18n/engine/resources/externalDataPipelineMembershipKeys.fr.ts +0 -21
- package/templates/saas/i18n/engine/resources/externalDataPipelineMemberships.en.ts +8 -14
- package/templates/saas/i18n/engine/resources/externalDataPipelineMemberships.fr.ts +0 -6
- package/templates/saas/i18n/engine/resources/externalDataPipelineRequestedKeys.en.ts +0 -24
- package/templates/saas/i18n/engine/resources/externalDataPipelineRequestedKeys.fr.ts +0 -24
- package/templates/saas/i18n/engine/resources/externalDataPipelineRunRecords.en.ts +150 -174
- package/templates/saas/i18n/engine/resources/externalDataPipelineRunRecords.fr.ts +0 -24
- package/templates/saas/i18n/engine/resources/externalDataRemoteVersions.en.ts +12 -33
- package/templates/saas/i18n/engine/resources/externalDataRemoteVersions.fr.ts +0 -21
- package/templates/saas/i18n/engine/resources/externalEffectReservations.en.ts +147 -0
- package/templates/saas/i18n/engine/resources/externalEffectReservations.fr.ts +147 -0
- package/templates/saas/i18n/engine/resources/files.en.ts +0 -39
- package/templates/saas/i18n/engine/resources/files.fr.ts +0 -39
- package/templates/saas/i18n/engine/resources/humanDecisionNoticeStays.en.ts +0 -18
- package/templates/saas/i18n/engine/resources/humanDecisionNoticeStays.fr.ts +0 -18
- package/templates/saas/i18n/engine/resources/idempotentRequestOutcomes.en.ts +115 -0
- package/templates/saas/i18n/engine/resources/idempotentRequestOutcomes.fr.ts +115 -0
- package/templates/saas/i18n/engine/resources/inboundAddressTombstones.en.ts +0 -27
- package/templates/saas/i18n/engine/resources/inboundAddressTombstones.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/inboundContacts.en.ts +3 -30
- package/templates/saas/i18n/engine/resources/inboundContacts.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/inboundEmails.en.ts +0 -27
- package/templates/saas/i18n/engine/resources/inboundEmails.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/jobExecutions.en.ts +11 -25
- package/templates/saas/i18n/engine/resources/jobExecutions.fr.ts +11 -25
- package/templates/saas/i18n/engine/resources/jobPayloadStorage.en.ts +3 -30
- package/templates/saas/i18n/engine/resources/jobPayloadStorage.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/legalHolds.en.ts +0 -88
- package/templates/saas/i18n/engine/resources/legalHolds.fr.ts +0 -88
- package/templates/saas/i18n/engine/resources/modelCallAttributions.en.ts +16 -40
- package/templates/saas/i18n/engine/resources/modelCallAttributions.fr.ts +0 -24
- package/templates/saas/i18n/engine/resources/modelCostPeriodAggregates.en.ts +13 -37
- package/templates/saas/i18n/engine/resources/modelCostPeriodAggregates.fr.ts +0 -24
- package/templates/saas/i18n/engine/resources/oauthConsentGrants.en.ts +10 -40
- package/templates/saas/i18n/engine/resources/oauthConsentGrants.fr.ts +0 -30
- package/templates/saas/i18n/engine/resources/operationApprovalRequests.en.ts +120 -60
- package/templates/saas/i18n/engine/resources/operationApprovalRequests.fr.ts +120 -60
- package/templates/saas/i18n/engine/resources/organizationA2aPushDeliveryLog.en.ts +3 -21
- package/templates/saas/i18n/engine/resources/organizationA2aPushDeliveryLog.fr.ts +0 -18
- package/templates/saas/i18n/engine/resources/organizationA2aTokenBudgetState.en.ts +3 -33
- package/templates/saas/i18n/engine/resources/organizationA2aTokenBudgetState.fr.ts +0 -30
- package/templates/saas/i18n/engine/resources/organizationAgentPolicies.en.ts +0 -27
- package/templates/saas/i18n/engine/resources/organizationAgentPolicies.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisionContents.en.ts +0 -27
- package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisionContents.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisions.en.ts +13 -43
- package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisions.fr.ts +0 -30
- package/templates/saas/i18n/engine/resources/organizationApiKeys.en.ts +2 -79
- package/templates/saas/i18n/engine/resources/organizationApiKeys.fr.ts +2 -79
- package/templates/saas/i18n/engine/resources/organizationBillingAccounts.en.ts +0 -549
- package/templates/saas/i18n/engine/resources/organizationBillingAccounts.fr.ts +0 -549
- package/templates/saas/i18n/engine/resources/organizationChatSettings.en.ts +0 -27
- package/templates/saas/i18n/engine/resources/organizationChatSettings.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/organizationCreditPools.en.ts +13 -18
- package/templates/saas/i18n/engine/resources/organizationCreditPools.fr.ts +13 -18
- package/templates/saas/i18n/engine/resources/organizationCustomDomains.en.ts +195 -0
- package/templates/saas/i18n/engine/resources/organizationCustomDomains.fr.ts +195 -0
- package/templates/saas/i18n/engine/resources/organizationDashboardLayouts.en.ts +153 -0
- package/templates/saas/i18n/engine/resources/organizationDashboardLayouts.fr.ts +153 -0
- package/templates/saas/i18n/engine/resources/organizationEmailDomains.en.ts +0 -39
- package/templates/saas/i18n/engine/resources/organizationEmailDomains.fr.ts +0 -39
- package/templates/saas/i18n/engine/resources/organizationFeatures.en.ts +0 -34
- package/templates/saas/i18n/engine/resources/organizationFeatures.fr.ts +0 -34
- package/templates/saas/i18n/engine/resources/organizationFlowActorExecutions.en.ts +25 -160
- package/templates/saas/i18n/engine/resources/organizationFlowActorExecutions.fr.ts +25 -160
- package/templates/saas/i18n/engine/resources/organizationFlowActorTasks.en.ts +6 -28
- package/templates/saas/i18n/engine/resources/organizationFlowActorTasks.fr.ts +8 -30
- package/templates/saas/i18n/engine/resources/organizationGuidanceState.en.ts +3 -18
- package/templates/saas/i18n/engine/resources/organizationGuidanceState.fr.ts +0 -15
- package/templates/saas/i18n/engine/resources/organizationInboundDeliveries.en.ts +95 -26
- package/templates/saas/i18n/engine/resources/organizationInboundDeliveries.fr.ts +95 -26
- package/templates/saas/i18n/engine/resources/organizationInvoiceRefs.en.ts +14 -45
- package/templates/saas/i18n/engine/resources/organizationInvoiceRefs.fr.ts +14 -45
- package/templates/saas/i18n/engine/resources/organizationLifecycleState.en.ts +1 -17
- package/templates/saas/i18n/engine/resources/organizationLifecycleState.fr.ts +1 -17
- package/templates/saas/i18n/engine/resources/organizationM2mWebhookDeliveryLog.en.ts +2 -26
- package/templates/saas/i18n/engine/resources/organizationM2mWebhookDeliveryLog.fr.ts +4 -28
- package/templates/saas/i18n/engine/resources/organizationMembers.en.ts +2 -95
- package/templates/saas/i18n/engine/resources/organizationMembers.fr.ts +2 -95
- package/templates/saas/i18n/engine/resources/organizationModelUsageCeilingState.en.ts +0 -27
- package/templates/saas/i18n/engine/resources/organizationModelUsageCeilingState.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/organizationNotificationBadges.en.ts +3 -36
- package/templates/saas/i18n/engine/resources/organizationNotificationBadges.fr.ts +0 -33
- package/templates/saas/i18n/engine/resources/organizationNotifications.en.ts +0 -12
- package/templates/saas/i18n/engine/resources/organizationNotifications.fr.ts +0 -12
- package/templates/saas/i18n/engine/resources/organizationOAuthClients.en.ts +2 -67
- package/templates/saas/i18n/engine/resources/organizationOAuthClients.fr.ts +2 -67
- package/templates/saas/i18n/engine/resources/organizationOnboardingOperations.en.ts +0 -9
- package/templates/saas/i18n/engine/resources/organizationOnboardingOperations.fr.ts +0 -9
- package/templates/saas/i18n/engine/resources/organizationPersonTokenCeilingState.en.ts +0 -27
- package/templates/saas/i18n/engine/resources/organizationPersonTokenCeilingState.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/organizationPreferences.en.ts +0 -37
- package/templates/saas/i18n/engine/resources/organizationPreferences.fr.ts +0 -37
- package/templates/saas/i18n/engine/resources/organizationProfiles.en.ts +0 -37
- package/templates/saas/i18n/engine/resources/organizationProfiles.fr.ts +0 -37
- package/templates/saas/i18n/engine/resources/organizationProgressionState.en.ts +1 -17
- package/templates/saas/i18n/engine/resources/organizationProgressionState.fr.ts +1 -17
- package/templates/saas/i18n/engine/resources/organizationProviderCredentials.en.ts +0 -58
- package/templates/saas/i18n/engine/resources/organizationProviderCredentials.fr.ts +0 -58
- package/templates/saas/i18n/engine/resources/organizationRelationships.en.ts +0 -128
- package/templates/saas/i18n/engine/resources/organizationRelationships.fr.ts +0 -128
- package/templates/saas/i18n/engine/resources/organizationRepresentations.en.ts +0 -83
- package/templates/saas/i18n/engine/resources/organizationRepresentations.fr.ts +0 -83
- package/templates/saas/i18n/engine/resources/organizationScimProvisioningConfig.en.ts +0 -43
- package/templates/saas/i18n/engine/resources/organizationScimProvisioningConfig.fr.ts +0 -43
- package/templates/saas/i18n/engine/resources/organizationScimTokens.en.ts +5 -76
- package/templates/saas/i18n/engine/resources/organizationScimTokens.fr.ts +5 -76
- package/templates/saas/i18n/engine/resources/organizationSiemDeliveryDlq.en.ts +4 -43
- package/templates/saas/i18n/engine/resources/organizationSiemDeliveryDlq.fr.ts +6 -45
- package/templates/saas/i18n/engine/resources/organizationSiemDeliveryOutbox.en.ts +3 -30
- package/templates/saas/i18n/engine/resources/organizationSiemDeliveryOutbox.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/organizationSiemExportConfig.en.ts +0 -37
- package/templates/saas/i18n/engine/resources/organizationSiemExportConfig.fr.ts +0 -37
- package/templates/saas/i18n/engine/resources/organizationSsoConfig.en.ts +113 -74
- package/templates/saas/i18n/engine/resources/organizationSsoConfig.fr.ts +113 -74
- package/templates/saas/i18n/engine/resources/organizationSsoConnections.en.ts +0 -148
- package/templates/saas/i18n/engine/resources/organizationSsoConnections.fr.ts +0 -148
- package/templates/saas/i18n/engine/resources/organizationSubscriptions.en.ts +40 -78
- package/templates/saas/i18n/engine/resources/organizationSubscriptions.fr.ts +42 -80
- package/templates/saas/i18n/engine/resources/organizationUnitMembers.en.ts +2 -50
- package/templates/saas/i18n/engine/resources/organizationUnitMembers.fr.ts +2 -50
- package/templates/saas/i18n/engine/resources/organizationUnits.en.ts +0 -49
- package/templates/saas/i18n/engine/resources/organizationUnits.fr.ts +0 -49
- package/templates/saas/i18n/engine/resources/organizationUsageRecords.en.ts +13 -37
- package/templates/saas/i18n/engine/resources/organizationUsageRecords.fr.ts +13 -37
- package/templates/saas/i18n/engine/resources/organizationWebhookConfig.en.ts +5 -67
- package/templates/saas/i18n/engine/resources/organizationWebhookConfig.fr.ts +5 -67
- package/templates/saas/i18n/engine/resources/organizations.en.ts +34 -637
- package/templates/saas/i18n/engine/resources/organizations.fr.ts +32 -635
- package/templates/saas/i18n/engine/resources/platformAccessGrants.en.ts +0 -91
- package/templates/saas/i18n/engine/resources/platformAccessGrants.fr.ts +0 -91
- package/templates/saas/i18n/engine/resources/postCommitEffectOutbox.en.ts +0 -24
- package/templates/saas/i18n/engine/resources/postCommitEffectOutbox.fr.ts +0 -24
- package/templates/saas/i18n/engine/resources/prices.en.ts +47 -108
- package/templates/saas/i18n/engine/resources/prices.fr.ts +48 -109
- package/templates/saas/i18n/engine/resources/products.en.ts +24 -68
- package/templates/saas/i18n/engine/resources/products.fr.ts +24 -68
- package/templates/saas/i18n/engine/resources/professionalQualifications.en.ts +0 -87
- package/templates/saas/i18n/engine/resources/professionalQualifications.fr.ts +0 -87
- package/templates/saas/i18n/engine/resources/promotions.en.ts +4 -56
- package/templates/saas/i18n/engine/resources/promotions.fr.ts +6 -58
- package/templates/saas/i18n/engine/resources/providerCallRecords.en.ts +77 -101
- package/templates/saas/i18n/engine/resources/providerCallRecords.fr.ts +0 -24
- package/templates/saas/i18n/engine/resources/publishedVerificationKeys.en.ts +2 -25
- package/templates/saas/i18n/engine/resources/publishedVerificationKeys.fr.ts +2 -25
- package/templates/saas/i18n/engine/resources/referrals.en.ts +21 -18
- package/templates/saas/i18n/engine/resources/referrals.fr.ts +21 -18
- package/templates/saas/i18n/engine/resources/relationshipCapabilityGrants.en.ts +0 -80
- package/templates/saas/i18n/engine/resources/relationshipCapabilityGrants.fr.ts +0 -80
- package/templates/saas/i18n/engine/resources/relationshipInvitations.en.ts +0 -89
- package/templates/saas/i18n/engine/resources/relationshipInvitations.fr.ts +0 -89
- package/templates/saas/i18n/engine/resources/relationshipMailboxes.en.ts +0 -27
- package/templates/saas/i18n/engine/resources/relationshipMailboxes.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/representativeAssignments.en.ts +108 -112
- package/templates/saas/i18n/engine/resources/representativeAssignments.fr.ts +108 -112
- package/templates/saas/i18n/engine/resources/retentionEnforcementRecords.en.ts +8 -21
- package/templates/saas/i18n/engine/resources/retentionEnforcementRecords.fr.ts +8 -21
- package/templates/saas/i18n/engine/resources/signatureRequestSigners.en.ts +141 -0
- package/templates/saas/i18n/engine/resources/signatureRequestSigners.fr.ts +141 -0
- package/templates/saas/i18n/engine/resources/signatureRequests.en.ts +205 -0
- package/templates/saas/i18n/engine/resources/signatureRequests.fr.ts +205 -0
- package/templates/saas/i18n/engine/resources/smsNumberAssignments.en.ts +101 -0
- package/templates/saas/i18n/engine/resources/smsNumberAssignments.fr.ts +101 -0
- package/templates/saas/i18n/engine/resources/smsOptOuts.en.ts +166 -0
- package/templates/saas/i18n/engine/resources/smsOptOuts.fr.ts +166 -0
- package/templates/saas/i18n/engine/resources/smsProviderEvents.en.ts +195 -0
- package/templates/saas/i18n/engine/resources/smsProviderEvents.fr.ts +195 -0
- package/templates/saas/i18n/engine/resources/ssoDomainReservations.en.ts +0 -27
- package/templates/saas/i18n/engine/resources/ssoDomainReservations.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/systemOfRecordPartitionAssignments.en.ts +3 -39
- package/templates/saas/i18n/engine/resources/systemOfRecordPartitionAssignments.fr.ts +0 -36
- package/templates/saas/i18n/engine/resources/systemOfRecordWriteAdmissions.en.ts +0 -3
- package/templates/saas/i18n/engine/resources/systemOfRecordWriteAdmissions.fr.ts +0 -3
- package/templates/saas/i18n/engine/resources/transactionalCommitReceipts.en.ts +0 -6
- package/templates/saas/i18n/engine/resources/transactionalCommitReceipts.fr.ts +0 -6
- package/templates/saas/i18n/engine/resources/userA2aPushDeliveryLog.en.ts +3 -21
- package/templates/saas/i18n/engine/resources/userA2aPushDeliveryLog.fr.ts +0 -18
- package/templates/saas/i18n/engine/resources/userA2aTokenBudgetState.en.ts +3 -33
- package/templates/saas/i18n/engine/resources/userA2aTokenBudgetState.fr.ts +0 -30
- package/templates/saas/i18n/engine/resources/userAgentWorkDecisionContents.en.ts +0 -27
- package/templates/saas/i18n/engine/resources/userAgentWorkDecisionContents.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/userAgentWorkDecisions.en.ts +13 -43
- package/templates/saas/i18n/engine/resources/userAgentWorkDecisions.fr.ts +0 -30
- package/templates/saas/i18n/engine/resources/userCredentials.en.ts +3 -87
- package/templates/saas/i18n/engine/resources/userCredentials.fr.ts +0 -84
- package/templates/saas/i18n/engine/resources/userFeatures.en.ts +0 -12
- package/templates/saas/i18n/engine/resources/userFeatures.fr.ts +0 -12
- package/templates/saas/i18n/engine/resources/userFlowActorExecutions.en.ts +25 -160
- package/templates/saas/i18n/engine/resources/userFlowActorExecutions.fr.ts +25 -160
- package/templates/saas/i18n/engine/resources/userFlowActorTasks.en.ts +6 -28
- package/templates/saas/i18n/engine/resources/userFlowActorTasks.fr.ts +8 -30
- package/templates/saas/i18n/engine/resources/userGovernedDocumentAcceptances.en.ts +13 -18
- package/templates/saas/i18n/engine/resources/userGovernedDocumentAcceptances.fr.ts +13 -18
- package/templates/saas/i18n/engine/resources/userGuidanceState.en.ts +3 -18
- package/templates/saas/i18n/engine/resources/userGuidanceState.fr.ts +0 -15
- package/templates/saas/i18n/engine/resources/userIdentityLinks.en.ts +13 -40
- package/templates/saas/i18n/engine/resources/userIdentityLinks.fr.ts +0 -27
- package/templates/saas/i18n/engine/resources/userLifecycleState.en.ts +0 -15
- package/templates/saas/i18n/engine/resources/userLifecycleState.fr.ts +0 -15
- package/templates/saas/i18n/engine/resources/userNotificationBadges.en.ts +3 -36
- package/templates/saas/i18n/engine/resources/userNotificationBadges.fr.ts +0 -33
- package/templates/saas/i18n/engine/resources/userPreferences.en.ts +8 -60
- package/templates/saas/i18n/engine/resources/userPreferences.fr.ts +8 -60
- package/templates/saas/i18n/engine/resources/userProfiles.en.ts +5 -56
- package/templates/saas/i18n/engine/resources/userProfiles.fr.ts +0 -51
- package/templates/saas/i18n/engine/resources/userProgressionState.en.ts +1 -17
- package/templates/saas/i18n/engine/resources/userProgressionState.fr.ts +1 -17
- package/templates/saas/i18n/engine/resources/userProviderCredentials.en.ts +0 -52
- package/templates/saas/i18n/engine/resources/userProviderCredentials.fr.ts +0 -52
- package/templates/saas/i18n/engine/resources/userSelfPreferences.en.ts +8 -56
- package/templates/saas/i18n/engine/resources/userSelfPreferences.fr.ts +8 -56
- package/templates/saas/i18n/engine/resources/userSelfProfiles.en.ts +5 -61
- package/templates/saas/i18n/engine/resources/userSelfProfiles.fr.ts +0 -56
- package/templates/saas/i18n/engine/resources/user_self.en.ts +37 -214
- package/templates/saas/i18n/engine/resources/user_self.fr.ts +37 -214
- package/templates/saas/i18n/engine/resources/users.en.ts +53 -180
- package/templates/saas/i18n/engine/resources/users.fr.ts +53 -180
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/Dockerfile +4 -1
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/plugins/api-reference-pages.ts +9 -1
- package/templates/saas/scenarios/add-website/files/website/Dockerfile +4 -1
- package/templates/saas/scenarios/add-website/files/website/astro.config.ts.hbs +4 -0
- package/templates/saas/scenarios/add-website/files/website/package.json.hbs +1 -1
- package/templates/saas/scenarios/add-worker-node/files/workers/__workerDir__/Dockerfile.hbs +3 -1
- package/templates/saas/skeleton/backend-api/Dockerfile +5 -2
- package/templates/saas/skeleton/frontend/Dockerfile +4 -1
- package/templates/saas/skeleton/frontend/vite-engine-dependency-prebundle.ts +10 -1
- package/templates/saas/skeleton/frontend/vite.config.ts.hbs +14 -3
- package/wildo-framework.info.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docker-compose-generator.service.js","sourceRoot":"","sources":["../../../../../src/services/deployment/docker/docker-compose-generator.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EA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AAU,EAAE,mBAAmB,CAAC,WAAW;YAC3C,YAAY,EAAE,mBAAmB,CAAC,aAAa;YAC/C,aAAa,EAAE,mBAAmB,CAAC,cAAc;SAClD;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG,SAAS,CAAC,eAAe,CAAC,UAAU,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAExF,MAAM,UAAU,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,2BAA2B,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,6BAA6B,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC3G,CAAC","sourcesContent":["import { createHash } from 'crypto';\nimport { chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, rmdirSync, statSync, unlinkSync, writeFileSync } from 'fs';\nimport { basename, join, posix, relative } from 'path';\nimport type { PlatformEnvConfigJson, PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { DockerUtils } from '~wildo-cli/services/deployment/docker/docker.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport {\n assertProfileRunsItsDatabaseFamilies,\n includesMongoSearchSidecar,\n selfHostsOptionalServiceAllowedByProfile,\n} from '~wildo-cli/services/environment/environment-service-profile.utils';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { EnvironmentRegistry } from '~wildo-cli/services/environment/environment-registry.service';\nimport { InfrastructureHost, SharedInfrastructureAction } from '~wildo-cli/services/environment/infrastructure-host.service';\nimport {\n BackingServiceKind,\n BackingServiceSource,\n ConfigModuleResolution,\n INFRA_DEFAULT_PORTS,\n loadMinionConfigs,\n loadSaasConfig,\n loadWorkerConfigs,\n RUNTIME_MANDATORY_WRITABLE_PATH,\n PROVIDER_RUNTIME_GENERATED_ENV_FILE_NAME,\n resolveFrameworkLayout,\n type WildoMinionConfig,\n type WildoSaasConfig,\n WildoLocalDataStorage,\n resolveDefaultLocalDataStorage,\n type WildoWorkerConfig,\n PlatformWildoServices,\n selfHostsPlatformKeyVault,\n describeUnreachablePkcs11Module,\n pkcs11ModuleIsReachableInPlatformContainer,\n buildMinionLivenessHeartbeatEnv,\n buildMinionLivenessProbeCommand,\n deriveMinionLivenessProbeTiming,\n MINION_LIVENESS_STARTUP_BUDGET_SEC,\n type MinionLiveness,\n ApplicationRuntimePrincipalKind,\n type ApplicationRuntimePrincipal,\n resolveRuntimeComposeNetworks,\n resolveApplicationDatabaseEngine,\n type DatabaseEngine,\n EnvironmentServiceProfileOptionalService,\n} from '@wildo-ai/platform-config-lib';\nimport { buildMinionServiceName, buildWorkerServiceName } from '@wildo-ai/platform-core-shared';\nimport { FILE_NAMES, GENERATED_FILE_HEADER } from '~wildo-cli/infrastructure/io/io.schemas';\nimport { DEFAULT_DOCKER_COMPOSE_LOCAL_PROJECT_NAME, resolvePlatformImageRef } from '~wildo-cli/services/environment/platform-runtime.schemas';\nimport { readVersion } from '~wildo-cli/kernel/bootstrap';\nimport { ServiceAddressResolver, AddressPerspective } from '~wildo-cli/services/catalog/service-address-resolver.service';\nimport { PLATFORM_INIT_MEMORY, PLATFORM_SERVICE_CATALOG, type PlatformServiceMemoryProfile } from '~wildo-cli/services/catalog/service-catalog.schemas';\nimport { PlatformEnvVarsBuilder } from '~wildo-cli/services/environment/env-vars-builder.service';\nimport { loadInfraHydratedConfig } from '~wildo-cli/services/environment/env-configuration-generator.service';\nimport { SecretsReader } from '~wildo-cli/services/credentials/secrets-reader.service';\nimport { IMMUDB_AUDIT_STATE_LOCAL_DATA_DIR, MONGOT_SYNC_SOURCE } from '~wildo-cli/services/data-services/data-services.schemas';\nimport { PLATFORM_KEY_VAULT_SERVER, renderPlatformKeyVaultServerConfig } from '~wildo-cli/services/data-services/platform-key-vault.server-config';\nimport { TemplateProcessor } from '~wildo-cli/infrastructure/io/template-processor';\nimport type { ApplicationMinionEnvTarget, ApplicationWorkerEnvTarget } from '~wildo-cli/services/environment/env-configuration-generator.service';\nimport { buildContainerisedMinionEnvironment, buildContainerisedWorkerEnvironment, resolveRuntimeTargetAppSlug } from '~wildo-cli/services/deployment/application-runtime-environment';\n\n/**\n * Local-data subdir + filename for the immudb state-signing PRIVATE key materialized for the\n * self-hosted compose immudb container. Kept OUT of the `immudb/` data volume (which is the\n * store the key protects) so a data wipe never removes the signing key.\n */\nconst IMMUDB_SIGNING_KEY_DIR = 'immudb-signing';\nconst IMMUDB_SIGNING_KEY_FILENAME = 'state-signing.key';\n\n/**\n * Issue #74 — local-data subdir + filename for the `mongot` sync-source password file.\n *\n * Same shape and same reasoning as the immudb signing key above: kept OUT of both the\n * `mongodb/` and `mongot/` data directories so a data wipe never removes it, and mounted as a\n * FILE because mongot reads a path (`syncSource.replicaSet.scramAuth.passwordFile`) and never\n * an environment variable.\n *\n * The MODE differs from immudb's, and that difference is not cosmetic: immudb's key is written\n * `0644` because its container UID differs from the host owner, while mongot REFUSES to start on\n * anything more permissive than `0400` (`Secret file … permissions are too permissive (must only\n * be readable by owner)`, exit 1). mongot's image runs as root, so root reads the file whatever\n * the bind mount reports as its owner — measured 2026-08-27 with a host-owned `0400` file and a\n * `mongodb/mongodb-community-search:1.70.3` container that read it and reached `SERVING`.\n */\nconst MONGOT_PASSWORD_DIR = 'mongot-auth';\nconst MONGOT_PASSWORD_FILENAME = 'sync-source.password';\n\n/**\n * Slice 4.8 — ClamAV self-deploy gating.\n *\n * Returns `true` when the env author declared\n * `backingServices.clamav: { source: SELF }` in\n * `wildo.infra.<env>.config.ts` — i.e. they opted into the local\n * `clamav/clamav:1.4` container instead of pointing at an external\n * MANAGED clamd. Returns `false` for MANAGED / external sources or\n * when the entry is omitted entirely.\n *\n * Single source of truth consumed by:\n * - {@link renderDockerComposeTemplate}'s `includeLocalClamAV`\n * context value (drives the `{{#if includeLocalClamAV}}` block in\n * `docker-compose.wildo-platform.yml.hbs`).\n * - {@link getDockerComposeLocalDataServices} (decides whether\n * `local_data/clamav/` must be pre-created / wiped).\n *\n * The RULE itself moved out on 2026-09-09: both lanes now ask\n * `EnvironmentLifecycle.selfHostsBackingService(env, kind)`, which is total over\n * `BackingServiceKind`, so Compose ⇄ K8s parity is structural rather than two\n * predicates that happen to agree — and a kind added to the vocabulary cannot\n * reach either lane without someone deciding what an omitted declaration means\n * for it. This function survives as the NAME the compose lane's context value and\n * local-data list read it by; it is no longer where the rule lives.\n *\n * That predicate reads `env.backingServices` (the in-memory authored snapshot)\n * rather than `loadConfigJson`, which keeps every caller here synchronous and\n * matches the pattern used by {@link resolveInfraHostPort} below.\n */\nfunction resolveIncludeLocalClamAV(env: PlatformEnvironmentConfiguration): boolean {\n return selfHostsServiceAllowedByProfile(env, BackingServiceKind.CLAMAV, EnvironmentServiceProfileOptionalService.ANTIVIRUS_SCANNER);\n}\n\n/**\n * #2303 — whether this environment self-hosts an OPTIONAL backing service, REFUSING a declaration its service profile\n * contradicts. The rule lives in `selfHostsOptionalServiceAllowedByProfile`, which the Kubernetes lane asks too.\n */\nfunction selfHostsServiceAllowedByProfile(\n env: PlatformEnvironmentConfiguration,\n kind: BackingServiceKind.CLAMAV | BackingServiceKind.IMMUDB,\n service: EnvironmentServiceProfileOptionalService,\n): boolean {\n return selfHostsOptionalServiceAllowedByProfile(env, kind, service);\n}\n\n/**\n * #2303 — whether the `mongot` search sidecar belongs in this environment: it is an attachment to a self-hosted\n * mongod, and the service profile may omit it. The ONE gate both the local-data list and the render read, so the\n * profile cannot remove the service while leaving its data directory or volume behind (or the reverse).\n *\n * Omitting it removes the whole mongot surface — the service, mongod's `mongotHost` routing parameters, the\n * `searchCoordinator` user and the config entry — because every one of them sits under the template's\n * `{{#if mongotPasswordHostPath}}` guard, which the render leaves undefined here. A MongoDB-persisted\n * `.ragSource()` resource is then refused at the application's boot, naming the profile.\n */\nfunction resolveIncludeMongotSidecar(env: PlatformEnvironmentConfiguration): boolean {\n return includesMongoSearchSidecar(env);\n}\n\n/**\n * Cache / broker / object-storage self-deploy gating.\n *\n * These three were the only services in the template with NO gate at all: `valkey`, `rabbitmq`,\n * `minio` (+ its `minio-init` bucket step) were rendered for every environment, so an operator who\n * declared `redis: { source: MANAGED }` got a managed cache AND a local Valkey container beside it.\n *\n * They gate on {@link EnvironmentLifecycle.selfHostsBackingService}, which for these three kinds\n * reads `source !== MANAGED` rather than `source === SELF` — read that JSDoc before \"tightening\"\n * it. An UNDECLARED entry keeps the container, exactly as today, because the platform cannot boot\n * without a cache, a broker and an object store and an omitted key must not silently remove one.\n */\nfunction resolveIncludeLocalValkey(env: PlatformEnvironmentConfiguration): boolean {\n return EnvironmentUtils.selfHostsBackingService(env, BackingServiceKind.REDIS);\n}\n\n/** @see resolveIncludeLocalValkey — same rule, RabbitMQ's declaration. */\nfunction resolveIncludeLocalRabbitMQ(env: PlatformEnvironmentConfiguration): boolean {\n return EnvironmentUtils.selfHostsBackingService(env, BackingServiceKind.RABBITMQ);\n}\n\n/** @see resolveIncludeLocalValkey — same rule, the `s3` declaration (MinIO is its self-hosted brand). */\nfunction resolveIncludeLocalMinIO(env: PlatformEnvironmentConfiguration): boolean {\n return EnvironmentUtils.selfHostsBackingService(env, BackingServiceKind.S3);\n}\n\n/**\n * Audit Phase 2 — immudb self-deploy gating. Emits the local `immudb` container\n * (tamper-evident audit-log store) only when `backingServices.immudb.source ===\n * SELF`; a MANAGED immudb (Vault) is an external endpoint. Mirrors\n * {@link resolveIncludeLocalClamAV}.\n */\nfunction resolveIncludeLocalImmudb(env: PlatformEnvironmentConfiguration): boolean {\n return selfHostsServiceAllowedByProfile(env, BackingServiceKind.IMMUDB, EnvironmentServiceProfileOptionalService.IMMUTABLE_AUDIT_STORE);\n}\n\n/**\n * #2933 — the self-hosted OpenBao holding the platform's custodied keys, when `platformKeyManagement.vault.source ===\n * SELF`. The same predicate the Kubernetes lane deploys it on.\n */\nfunction resolveIncludeLocalPlatformKeyVault(env: PlatformEnvironmentConfiguration): boolean {\n return selfHostsPlatformKeyVault(env.platformKeyManagement);\n}\n\n/** What the two apps-manager services (INIT and serving) render for a vendor PKCS#11 client (#3019). */\nexport interface PlatformPkcs11ComposeContext {\n /** Each a read-only bind mount; source and target are YAML double-quoted scalars, compose-interpolation escaped. */\n clientFiles: Array<{ hostPathYaml: string; containerPathYaml: string }>;\n /** The vendor's own variables; `valueYaml` is a YAML double-quoted scalar, compose-interpolation escaped. */\n environment: Array<{ name: string; valueYaml: string }>;\n}\n\n/**\n * #3019 — the vendor PKCS#11 client a containerised apps-manager needs, or `undefined` when the platform is not\n * containerised here (a framework developer's apps-manager runs natively and loads its module from the host) or the\n * environment declares no `pkcs11` token.\n *\n * A module apps-manager cannot reach inside the platform image is REFUSED here rather than rendered: the token would fail\n * to open at boot and every signature on the provider would be refused, from a container whose compose file names no\n * cause. The schema refuses the same thing at load whenever `clientFiles` is declared; this is the half it cannot decide,\n * a host `modulePath` with no mounts, which is legal for the native lane and not for this one.\n *\n * Values are JSON-quoted (a JSON string is a YAML double-quoted scalar) after doubling every `$`, compose's only escape:\n * a vendor path or setting carrying `$` would otherwise be interpolated from the shell that runs `compose up`.\n */\nexport function buildPlatformPkcs11ComposeContext(\n env: PlatformEnvironmentConfiguration,\n includePlatformServices: boolean,\n): PlatformPkcs11ComposeContext | undefined {\n const pkcs11 = env.platformKeyManagement?.pkcs11;\n if (!includePlatformServices || !pkcs11) return undefined;\n if (!pkcs11ModuleIsReachableInPlatformContainer(pkcs11)) throw new Error(describeUnreachablePkcs11Module(pkcs11, env.name));\n const yaml = (value: string): string => JSON.stringify(escapeComposeInterpolation(value));\n return {\n clientFiles: (pkcs11.clientFiles ?? []).map((file) => ({ hostPathYaml: yaml(file.hostPath), containerPathYaml: yaml(file.containerPath) })),\n environment: Object.entries(pkcs11.environment ?? {}).map(([name, value]) => ({ name, valueYaml: yaml(value) })),\n };\n}\n\n/**\n * Pre-create the host directories the rendered compose file will bind-mount.\n *\n * NO-OP in `DOCKER_VOLUME` mode, and that is the point rather than an optimization: the whole\n * reason this function exists is that Docker creates a MISSING bind source as a ROOT-OWNED\n * directory the container's UID then cannot write to. A named volume has no host source, so there\n * is nothing to pre-create — and creating `local_data/<service>/` anyway would leave empty\n * directories that look like data and that `wildo local doctor` would later report as leftovers.\n *\n * The infrastructure-host assertion runs FIRST, before the mode is consulted: whether this\n * environment may converge backing services at all is a question about ownership, and it must be\n * answered the same way under both storage modes.\n *\n * Slice 4 (4.3): resolves saasRoot from the registry, so every CLI seam that runs `docker compose up`\n * against the platform-local compose file shares the SAME pre-up step (single source of truth, D5).\n * Call sites: `LocalUpCommand.runDockerCompose`, `LocalAppReinitService.startEnvironment`, and\n * `dev/start.command.ts` (`startDockerInfra` and its \"infra already running\" branch). (`LocalUpCommand.restartDockerCompose`,\n * the `local up --rebuild` restart, was one until #2988 removed it.) Throws when no SaaS root can be\n * resolved, which keeps the failure loud at the call site.\n */\nexport function ensureLocalDataServiceDirsForComposeRender(\n env: PlatformEnvironmentConfiguration,\n): void {\n InfrastructureHost.assertOwnsSharedInfrastructure(env, SharedInfrastructureAction.CONVERGE_BACKING_SERVICES);\n if (usesDockerVolumeLocalData(env)) return;\n const saasRoot = EnvironmentRegistry.getSaasRoot();\n if (!saasRoot) {\n throw new Error(\n 'Cannot pre-create local_data subdirs: no targeted SaaS app root detected.',\n );\n }\n const services = getDockerComposeLocalDataServices(env);\n EnvironmentPaths.ensureLocalDataServiceDirs(saasRoot, services);\n}\n\n/**\n * Slice 4 (4.4) — wipe wrapper for `wildo local reset`.\n *\n * Counterpart of {@link ensureLocalDataServiceDirsForComposeRender}. Resolves\n * the SaaS root and the same per-env service list that compose actually\n * rendered, then calls {@link EnvironmentPaths.wipeLocalDataServiceDirs}\n * fail-closed — so a stale on-host PG datadir or Mongo journal cannot\n * silently survive a reset and corrupt the next `wildo local up`.\n *\n * Caller MUST invoke this AFTER `docker compose down -v` so no container\n * still holds the bind-mount target open.\n */\nexport function wipeLocalDataServiceDirsForCompose(\n env: PlatformEnvironmentConfiguration,\n): void {\n InfrastructureHost.assertOwnsSharedInfrastructure(env, SharedInfrastructureAction.WIPE_BACKING_SERVICE_DATA);\n const saasRoot = EnvironmentRegistry.getSaasRoot();\n if (!saasRoot) {\n throw new Error(\n 'Cannot wipe local_data subdirs: no targeted SaaS app root detected.',\n );\n }\n // The immudb audit trust anchor goes with the ledger it anchors, and only then: a reset leaves a managed immudb's\n // ledger in place, so its anchor must stay too (see `IMMUDB_AUDIT_STATE_LOCAL_DATA_DIR`).\n const services = [\n ...getDockerComposeLocalDataServices(env),\n ...(resolveIncludeLocalImmudb(env) ? [IMMUDB_AUDIT_STATE_LOCAL_DATA_DIR] : []),\n ];\n EnvironmentPaths.wipeLocalDataServiceDirs(saasRoot, services);\n}\n\n/**\n * Remove this environment's backing-service data VOLUMES.\n *\n * Unconditional, not gated on the current mode, and that asymmetry with\n * {@link ensureLocalDataServiceDirsForComposeRender} is deliberate: `reset` means \"leave nothing\n * behind\", and an environment that ran under `DOCKER_VOLUME` and was then re-authored to\n * `HOST_PATH` still has those volumes. Gating the wipe on the CURRENT mode would strand exactly\n * the data a reset was asked to destroy, and volumes are the half with no visible directory to\n * notice it in. Its sibling `wipeLocalDataServiceDirsForCompose` is likewise unconditional, so\n * `reset` clears both halves whichever way the environment is authored — and the Kind k8s lane\n * shares the host tree, so that half must be cleared regardless.\n *\n * Tolerant of an absent volume (`docker volume rm` on a name nothing created is not a failure:\n * absence is the state being asked for), fail-CLOSED on anything else, matching the host wipe's\n * D6 contract. A volume still held by a container reports `volume is in use` and throws here,\n * which is the loud version of the caller having skipped `docker compose down`.\n *\n * Caller MUST invoke this AFTER `docker compose down` so nothing still holds the volumes.\n */\nexport function wipeLocalDataVolumesForCompose(\n env: PlatformEnvironmentConfiguration,\n): void {\n InfrastructureHost.assertOwnsSharedInfrastructure(env, SharedInfrastructureAction.WIPE_BACKING_SERVICE_DATA);\n const saasRoot = EnvironmentRegistry.getSaasRoot();\n if (!saasRoot) {\n throw new Error(\n 'Cannot remove backing-service data volumes: no targeted SaaS app root detected.',\n );\n }\n const names = listLocalDataVolumeMounts(saasRoot, getDockerComposeLocalDataServices(env)).map((mount) => mount.volumeName);\n if (names.length === 0) return;\n\n const failures: string[] = [];\n for (const name of names) {\n const result = DockerUtils.removeVolume(name);\n if (!result.success) failures.push(`${name}: ${result.error ?? 'unknown error'}`);\n }\n if (failures.length > 0) {\n throw new Error(\n `Failed to remove ${failures.length} backing-service data volume(s):\\n - ${failures.join('\\n - ')}`,\n );\n }\n}\n\n/**\n * The ONE place `localDataStorage` is read.\n *\n * `PlatformEnvironmentConfiguration.localDataStorage` is optional because environment records are\n * built at many sites (hydration from the authored config, the registry cache, test fixtures), and\n * a site that does not yet mirror the field must not produce `undefined`. In a Handlebars boolean\n * context `undefined` is falsy, so an unmirrored environment would silently render the REMOTE\n * bind-mount shape onto a developer's machine — the exact configuration this mechanism exists to\n * stop. Falling back to the derivation keyed on `locationType` makes that case correct instead.\n *\n * Read through this function; never off the field.\n */\nexport function resolveLocalDataStorage(\n env: PlatformEnvironmentConfiguration,\n): WildoLocalDataStorage {\n return env.localDataStorage ?? resolveDefaultLocalDataStorage(env.locationType);\n}\n\n/**\n * True when this environment's backing-service DATA lives in Docker named volumes rather than on\n * the host filesystem. Drives the compose template's per-service mount shape and the top-level\n * `volumes:` block, and tells the `up` / `reset` lifecycle whether there are host directories to\n * create and wipe at all.\n */\nexport function usesDockerVolumeLocalData(\n env: PlatformEnvironmentConfiguration,\n): boolean {\n return resolveLocalDataStorage(env) === WildoLocalDataStorage.DOCKER_VOLUME;\n}\n\n/**\n * The compose template's `platformServiceMemory` context: each platform block's `mem_limit` and V8\n * heap ceiling, from the MEASURED profiles in the service catalog (#1592). Keyed by the names the\n * template uses; INIT runs the apps-manager binary, so it takes apps-manager's profile. Exported so a\n * test can hold every key the template references to a catalog entry — the template engine renders a\n * missing value as an empty string, which would produce `mem_limit: m` without an error anywhere.\n */\nexport function buildPlatformServiceMemoryContext(): Record<\n 'init' | 'appsManager' | 'crontabsBatchesManager' | 'moduleRegistry',\n PlatformServiceMemoryProfile\n> {\n return {\n init: PLATFORM_INIT_MEMORY,\n appsManager: PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].memory,\n crontabsBatchesManager: PLATFORM_SERVICE_CATALOG[PlatformWildoServices.CRONTABS_BATCHES_MANAGER].memory,\n moduleRegistry: PLATFORM_SERVICE_CATALOG[PlatformWildoServices.MODULE_REGISTRY].memory,\n };\n}\n\n/**\n * Compose volume name for one backing service's data, e.g.\n * `wildo-local-data-wonder-todos-3f2a9b1c-postgresql`.\n *\n * ## Why the name is scoped to the APPLICATION, and why that is not optional\n *\n * Every application keeps its own backing-service data: `local_data` lives under the application's\n * own SaaS root, so Wonder Todos and Wonder CRM each have their own Postgres datadir, their own\n * Mongo journal, and so on. Only one platform stack runs on a machine at a time — the container\n * names are fixed (`wildo-postgresql`, …) and the compose project name is the constant\n * `wildo-local` for every application — so the stacks ALTERNATE, each bringing its own data.\n *\n * A volume named for the service alone would therefore MERGE what is today separate: bring one\n * application's stack up, then the other's, and both would mount one `wildo-local-data-postgresql`.\n * Nothing would fail; two applications' databases would simply become one. Scoping the name to the\n * SaaS root reproduces the separation the host-path layout already has, so switching storage mode\n * changes performance and nothing else.\n *\n * The scope is `<basename>-<8 hex of the SaaS root>`: the basename so `docker volume ls` is\n * readable, the digest so two applications whose directories share a name cannot collide. Derived\n * from the SaaS ROOT rather than from `saasConfig.slug` because the slug needs the SaaS config\n * loaded, which framework-developer mode deliberately skips — and a naming scheme that is\n * unavailable in the mode this monorepo runs in is not a naming scheme.\n *\n * Named EXPLICITLY (a `name:` in the `volumes:` block) rather than left to compose's\n * `<project>_<key>` derivation, which would prefix the constant `wildo-local` and separate nothing.\n */\nexport function buildLocalDataVolumeName(saasRoot: string, service: string): string {\n return `${LOCAL_DATA_VOLUME_PREFIX}${buildLocalDataVolumeScope(saasRoot)}-${service}`;\n}\n\n/**\n * The per-application segment of every data-volume name. Stable for a given SaaS root, and a legal\n * Docker volume-name fragment (`[a-zA-Z0-9][a-zA-Z0-9_.-]*`) for any path.\n */\nexport function buildLocalDataVolumeScope(saasRoot: string): string {\n const digest = createHash('sha256').update(saasRoot).digest('hex').slice(0, 8);\n const readable = basename(saasRoot).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');\n return readable.length > 0 ? `${readable}-${digest}` : digest;\n}\n\nconst LOCAL_DATA_VOLUME_PREFIX = 'wildo-local-data-';\n\n/**\n * Every DATA mount the platform compose template emits, as `<template key> → <service, child?>`.\n *\n * This table is the single source of truth for two things that must not drift apart: the mount\n * SOURCE each service gets (a host path or a volume name), and the set of named volumes the\n * top-level `volumes:` block declares. Deriving both from one table is what makes a compose file\n * that mounts a volume it never declared unrepresentable — the failure mode a hand-kept second\n * list produces, and the one compose reports only at `up` time.\n *\n * `child` mirrors the image's own declared `VOLUME`s. `mongo` declares BOTH `/data/db` and\n * `/data/configdb`, so each needs its own mount source; giving it one mount at `/data` leaves the\n * other child to an anonymous volume that survives `down` and is never wiped. Every other image\n * here declares at most one, so it has no child.\n *\n * Keys are what the template interpolates (`{{localDataSources.mongodbDb}}`), so a key renamed\n * here without the template is a mount that renders empty — covered by the render test that asserts\n * no `{{` survives and that every emitted volume is declared.\n */\nconst LOCAL_DATA_MOUNTS: readonly { key: string; service: string; child?: string }[] = [\n { key: 'mongodbDb', service: 'mongodb', child: 'db' },\n { key: 'mongodbConfigdb', service: 'mongodb', child: 'configdb' },\n { key: 'mongot', service: 'mongot' },\n { key: 'valkey', service: 'valkey' },\n { key: 'rabbitmq', service: 'rabbitmq' },\n { key: 'minio', service: 'minio' },\n { key: 'postgresql', service: 'postgresql' },\n { key: 'clamav', service: 'clamav' },\n { key: 'immudb', service: 'immudb' },\n { key: 'openbao', service: 'openbao' },\n];\n\n/** The named volume one data mount reads from. `mongodb` has two (`-db`, `-configdb`); every other service has one. */\nfunction localDataMountVolumeName(saasRoot: string, mount: { service: string; child?: string }): string {\n return buildLocalDataVolumeName(saasRoot, mount.child ? `${mount.service}-${mount.child}` : mount.service);\n}\n\n/** One data mount the compose file emits in `DOCKER_VOLUME` mode: which service, which image child, which volume. */\nexport interface LocalDataVolumeMount {\n readonly service: string;\n /** The image's declared data child (`db` / `configdb` for mongod), absent when the service has one data directory. */\n readonly child?: string;\n readonly volumeName: string;\n}\n\n/**\n * Every data mount, with its volume name, for the given emitted services — the one derivation the\n * wipe, the `volumes:` declarations and host-data adoption all read.\n *\n * It exists because the adoption step derived its volume name by hand from the SERVICE alone, while\n * compose mounts mongod as TWO volumes (`<scope>-mongodb-db`, `<scope>-mongodb-configdb`). On\n * 2026-09-22 `up --adopt-host-data` therefore copied the whole `local_data/mongodb/` tree into\n * `<scope>-mongodb`, a volume nothing mounts, and mongod started on an empty database while its data\n * sat in the orphan. Three sites spelled the name correctly and the fourth did not; one function\n * removes the fourth spelling.\n */\nexport function listLocalDataVolumeMounts(saasRoot: string, services: Iterable<string>): readonly LocalDataVolumeMount[] {\n const emitted = new Set(services);\n return LOCAL_DATA_MOUNTS\n .filter((mount) => emitted.has(mount.service))\n .map((mount) => ({\n service: mount.service,\n ...(mount.child ? { child: mount.child } : {}),\n volumeName: localDataMountVolumeName(saasRoot, mount),\n }));\n}\n\n/**\n * Resolve each data mount's SOURCE for the rendered compose file.\n *\n * In `DOCKER_VOLUME` mode a source is a named volume, which compose resolves against the\n * `volumes:` block; in `HOST_PATH` mode it is the absolute host directory, unchanged from what this\n * template has emitted since the Slice 4 cutover. Returning a plain map keeps every mount in the\n * template a single uniform line instead of nine conditionals — the mount shape is one decision,\n * taken here, not nine decisions repeated in markup.\n */\nexport function buildLocalDataMountSources(\n env: PlatformEnvironmentConfiguration,\n saasRoot: string,\n localDataPath: string,\n): Record<string, string> {\n const useVolumes = usesDockerVolumeLocalData(env);\n const sources: Record<string, string> = {};\n for (const mount of LOCAL_DATA_MOUNTS) {\n /*\n * Concatenated with a literal `/` rather than joined through `path`, because `localDataPath` is\n * the HOST's absolute path and on Windows that is `C:\\\\Users\\\\…`. `path.posix.join` would\n * normalize it and `path.win32.join` would emit backslashes the compose parser reads as\n * escapes; string concatenation reproduces byte-for-byte what this template has emitted since\n * the Slice 4 cutover, which Docker Desktop for Windows accepts today.\n */\n sources[mount.key] = useVolumes\n ? localDataMountVolumeName(saasRoot, mount)\n : `${localDataPath}/${mount.service}${mount.child ? `/${mount.child}` : ''}`;\n }\n return sources;\n}\n\n/**\n * The named volumes this env's compose file must DECLARE — derived from the same table as the\n * mount sources, and narrowed to the services the template actually emits.\n *\n * Empty in `HOST_PATH` mode, which is what drops the whole `volumes:` block: compose rejects an\n * empty mapping, and a block declaring volumes no service mounts would leave `docker volume ls`\n * carrying entries nothing explains.\n *\n * ## Why `mongot` needs its own gate\n *\n * `getDockerComposeLocalDataServices` is the DIRECTORY list, and it includes `mongot` whenever\n * mongod is self-hosted. The template is stricter: it renders the mongot service only under\n * `{{#if mongotPasswordHostPath}}`, because without the sync-source password materialized from\n * `secrets.json` a mongot cannot authenticate, and a half-wired one mongod routes `$vectorSearch`\n * to is worse than none.\n *\n * That difference is invisible in `HOST_PATH` mode — the cost is an empty directory — and becomes\n * visible in `DOCKER_VOLUME` mode, where `docker compose up` CREATES every declared volume, so the\n * looser list leaves an orphan in `docker volume ls` that nothing mounts and nothing explains.\n * Rather than widen the directory list (it is deliberately defensive: the password may be minted\n * between a render and the next `up`), the caller passes the gate the template itself uses.\n */\nexport function buildLocalDataVolumeDeclarations(\n env: PlatformEnvironmentConfiguration,\n saasRoot: string,\n renderedServices: { mongot: boolean; openbao: boolean },\n): readonly { name: string }[] {\n if (!usesDockerVolumeLocalData(env)) return [];\n const emitted = new Set(getDockerComposeLocalDataServices(env));\n if (!renderedServices.mongot) emitted.delete('mongot');\n // Same shape as mongot: the OpenBao service renders only once its unseal key and token ids are provisioned.\n if (!renderedServices.openbao) emitted.delete('openbao');\n return listLocalDataVolumeMounts(saasRoot, emitted).map((mount) => ({ name: mount.volumeName }));\n}\n\n/**\n * Slice 4 (4.3) — single source of truth for which infra services the\n * generated compose file actually renders for a given env.\n *\n * MUST stay in lockstep with the `{{#if include*}}` guards in\n * `docker-compose.wildo-platform.yml.hbs`. Returns the short container-name\n * list (the same tokens used as `local_data/<service>/` subdir names and\n * as the K8s PV `hostPath` `/mnt/local-data/<service>/` segment).\n *\n * Used by every CLI seam that runs `docker compose up` to pre-create the\n * matching `local_data/<service>/` bind-mount source directories before\n * Docker would otherwise create them root-owned. A divergence between this\n * list and the template's `{{#if}}` guards would silently create\n * permission-denied failures on first up — so callers MUST use this helper,\n * not a hand-written list.\n *\n * Stateless services are intentionally excluded — they have no\n * data mount in the template.\n *\n * This is the DIRECTORY and WIPE list, and it is deliberately looser than what the template\n * renders for one service: `mongot` is included whenever mongod is self-hosted, while the template\n * renders the mongot SERVICE only once its sync-source password is materialized. Pre-creating a\n * directory the password may make live moments later is harmless; DECLARING a volume for a service\n * that does not render is not, because `docker compose up` creates every declared volume. So\n * {@link buildLocalDataVolumeDeclarations} takes the template's own gate as an argument rather than\n * this list being tightened — see its JSDoc.\n */\nexport function getDockerComposeLocalDataServices(\n env: PlatformEnvironmentConfiguration,\n): readonly string[] {\n const services: string[] = [];\n if (EnvironmentUtils.needsLocalMongoDB(env)) {\n services.push('mongodb');\n }\n // Issue #74 — mongot's Lucene index directory. Gated on mongod (it is an attachment to one, not an\n // independently sourced service) and on the service profile (#2303), through the same predicate the\n // render reads. STATEFUL: losing it costs a full re-read of every indexed collection through the\n // change stream, not just a restart.\n if (resolveIncludeMongotSidecar(env)) {\n services.push('mongot');\n }\n // Gated since the managed-selection fix: an env that declares `redis` / `rabbitmq` / `s3` as\n // MANAGED points at somebody else's endpoint and must not also bind-mount `local_data/<svc>/` for\n // a container it does not run. An UNDECLARED kind still lands here — see\n // {@link resolveIncludeLocalValkey} for why absence is not withdrawal.\n if (resolveIncludeLocalValkey(env)) {\n services.push('valkey');\n }\n if (resolveIncludeLocalRabbitMQ(env)) {\n services.push('rabbitmq');\n }\n if (resolveIncludeLocalMinIO(env)) {\n services.push('minio');\n }\n if (EnvironmentUtils.needsLocalPostgreSQL(env)) {\n services.push('postgresql');\n }\n if (resolveIncludeLocalClamAV(env)) {\n services.push('clamav');\n }\n if (resolveIncludeLocalImmudb(env)) {\n services.push('immudb');\n }\n if (resolveIncludeLocalPlatformKeyVault(env)) {\n services.push('openbao');\n }\n return services;\n}\n\n/**\n * MinIO console UI listens on 9001 alongside the API on 9000. The console\n * port is image-defined and not part of the author's `s3` surface — keep it\n * pinned so the generated compose file always exposes the admin UI for\n * local debugging.\n */\nconst MINIO_CONSOLE_PORT = 9001;\n\n/**\n * Resolve the host-side port to publish for an infra container.\n *\n * The container always listens on its image-default port (`internalPort`).\n * The author may override the host-side port to avoid conflicts with other\n * services on their machine; in that case the compose generator emits\n * `${authorPort}:${internalPort}` so that:\n * - tools on the host connect to `localhost:${authorPort}` (matches the\n * `HOST_FACING` perspective from `ServiceAddressResolver`)\n * - other compose containers connect to `${containerName}:${internalPort}`\n * (matches the `CONTAINER_INTERNAL` perspective)\n */\nfunction resolveInfraHostPort(\n env: PlatformEnvironmentConfiguration,\n kind: BackingServiceKind,\n internalPort: number,\n): number {\n const override = env.backingServices?.[kind];\n if (!override || override.source !== BackingServiceSource.SELF) {\n return internalPort;\n }\n return override.port ?? internalPort;\n}\n\n\n// ============================================================================\n// Generate .env.wildo-platform (Docker Compose env file)\n// ============================================================================\n\n/**\n * Encode one `.env.wildo-platform` value for its reader: **Docker Compose's own env-file parser**\n * (compose-go), which is NOT the `dotenv` package that reads the per-service `.env` files.\n *\n * ## The two readers differ on exactly one axis\n *\n * Both expand `\\n` / `\\r` inside double quotes and both accept a quoted value spanning physical\n * lines. They diverge on backslash escapes — verified 2026-08-05 with `docker compose config`, the\n * authoritative resolution step:\n *\n * | reader | `\\n` in `\"…\"` | `\\\"` in `\"…\"` |\n * |------------|---------------|----------------------|\n * | `dotenv` | expands | NOT unescaped (kept literal — the trap `encodeDotenvValue` documents) |\n * | compose-go | expands | unescapes |\n *\n * So compose-go is a FULLY unescaping reader, and the correct encoding here is the ordinary\n * escape-and-quote — the same contract `formatEnvFile` (ci-deploy-generator) already writes for the\n * compose lane. `encodeDotenvValue`'s form-SELECTION exists to dodge a lossiness that only affects\n * dotenv; do not reuse it here, and do not \"fix\" this to match it.\n *\n * ## Why not the previous verbatim-quote\n *\n * This helper used to emit `\"${value}\"` verbatim for multi-line values (reproducing the bytes the\n * old `quoteMultiline` produced). That is lossy the moment a value carries BOTH a newline and a\n * `\"`: the inner quote closes the string early and Compose rejects the whole file with\n * `unexpected character \"\\\"\" in variable name` (reproduced 2026-08-05). No value routed here does\n * that today — PEMs carry no quotes — but it is the same latent writer/reader mismatch that\n * produced this session's two live incidents, so it is closed rather than documented.\n *\n * Builders hand us RAW values by contract (see the value-contract note in\n * `env-vars-builder.service.ts`), so encoding happens exactly once, here.\n *\n * Two raw readers of `.env.wildo-platform` decode none of this (`platform-e2e-runner`'s `platform-target.ts` and\n * `engine-behavior-e2e`'s `ci-rebootstrap.lifecycle.ts`): they strip one layer of quotes and keep escapes, so a value\n * with `\\\\`, `\"`, a newline or (since #2955) a `$` reads back escaped there. Every generated credential avoids all\n * four; only an operator-written value can carry one.\n */\nexport function encodeComposeEnvValue(value: string): string {\n if (!/[\\s=#\"'\\\\$]|\\n/.test(value) && value !== '') return value;\n // `$` is doubled: compose-go INTERPOLATES env-file values, unquoted and double-quoted alike, so `x$HOME` would arrive\n // as `x/Users/…`. Measured 2026-11-06 with compose v5.5.1 (`docker compose config`), for an `env_file:` and for an\n // `--env-file` read: `\"a$$HOME-b\"` reads as the literal `a$HOME-b` in both (#2955).\n return `\"${value.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/\\r/g, '\\\\r').replace(/\\n/g, '\\\\n').replace(/\\$/g, '$$$$')}\"`;\n}\n\n/**\n * Generate `.env.wildo-platform` and write it when its content differs from what is on disk.\n *\n * Returns whether the file was written. Generating it is cheap and a pure function of its inputs (`secrets.json`, the\n * hydrated `config.json`, the environment record, the framework mode), so `wildo local up` / `wildo local dev`\n * generate it on EVERY start and let the content comparison decide (#2311). Writing only on a difference is what\n * makes that safe: an unchanged file keeps its bytes and its mtime, so nothing downstream sees a change that did not\n * happen.\n */\nexport function generateEnvWildoPlatform(\n env: PlatformEnvironmentConfiguration,\n isFrameworkDeveloper: boolean,\n credentials: PlatformEnvSecretsJson,\n): boolean {\n InfrastructureHost.assertOwnsSharedInfrastructure(env, SharedInfrastructureAction.WRITE_PLATFORM_ENV);\n // Single load+hydrate seam — the platform env this generator emits for a REMOTE compose deploy\n // must carry the infra posture (OTEL_*/LOG_LEVEL/provider-selection) the setup config.json omits.\n const config = loadInfraHydratedConfig(env);\n\n const composeDir = EnvironmentUtils.resolveDockerComposeDir(env.name);\n if (!existsSync(composeDir)) {\n mkdirSync(composeDir, { recursive: true });\n }\n\n const infraEnv = PlatformEnvVarsBuilder.buildInfraCredentialEnv(credentials, config, env);\n\n const lines: string[] = [\n GENERATED_FILE_HEADER,\n '',\n '# === Infra service credentials ===',\n ];\n\n for (const [key, value] of Object.entries(infraEnv)) {\n lines.push(`${key}=${encodeComposeEnvValue(value)}`);\n }\n\n if (!isFrameworkDeveloper) {\n const addressCtx = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.CONTAINER_INTERNAL);\n const addresses = ServiceAddressResolver.resolve(addressCtx);\n const platformEnv = PlatformEnvVarsBuilder.buildAppsManagerFullEnv(\n credentials, addresses, config, env,\n );\n\n lines.push('');\n lines.push('# === Platform service env vars ===');\n\n for (const [key, value] of Object.entries(platformEnv)) {\n if (!(key in infraEnv)) {\n lines.push(`${key}=${encodeComposeEnvValue(value)}`);\n }\n }\n }\n\n return writeFileWhenContentDiffers(join(composeDir, FILE_NAMES.ENV_WILDO_PLATFORM), lines.join('\\n') + '\\n');\n}\n\n/**\n * Write `content` to `path` unless the file already holds exactly those bytes. Returns whether it wrote.\n *\n * The two compose artifacts are re-derived on every `wildo local up` / `wildo local dev` (#2311), so this comparison\n * IS their currency check: it is total over every input of the render (`config.json`, `secrets.json`, the framework\n * templates, the application's configuration), because it compares what those inputs produce rather than listing them.\n */\nfunction writeFileWhenContentDiffers(path: string, content: string, mode?: number): boolean {\n if (existsSync(path) && readFileSync(path, 'utf8') === content) return false;\n writeFileSync(path, content, mode === undefined ? undefined : { mode });\n return true;\n}\n\n// ============================================================================\n// Render Docker Compose template (Handlebars)\n// ============================================================================\n\n/**\n * Step 6 — compose entry shapes for the per-app minion / worker\n * services. Each service builds from the **wildo-ai monorepo root**\n * (Q1 (B) decision 2026-05-06) so the package's Dockerfile can resolve\n * file:-injected `@wildo-ai/*` engine deps + the nested Wonder Todos\n * workspace lockfile in one go (mirrors `examples/wonder-todos/frontend/Dockerfile`'s\n * established pattern). The Dockerfile path is therefore relative to\n * the framework root, not to the package itself.\n *\n * Env-files mount the Step 5b `.wildo-providers.env`; the platform's\n * `.env.wildo-platform` is loaded separately via `docker compose --env-file`\n * (see `docker.service.ts`) so we deliberately do NOT mount it again\n * via `env_file:` here.\n *\n * Both shapes are emitted under the compose `app-runtimes` profile so\n * `wildo local up` defaults to the platform-only flow and operators\n * opt-in to running app runtimes locally with\n * `docker compose --profile app-runtimes up` (or a future\n * `--include-app-runtimes` flag on `wildo local up`).\n */\nexport interface DockerComposeAppMinionEntry {\n /** Compose service name — `<saasSlug>-minion-<dnsName>` (bucket key RFC1123-normalized via `buildMinionServiceName`). */\n serviceName: string;\n /** Container name pinned for log-tailing convenience. */\n containerName: string;\n /** Absolute build context (the wildo-ai monorepo root). */\n buildContext: string;\n /** POSIX-relative Dockerfile path (from `buildContext` → the minion package's Dockerfile). */\n dockerfile: string;\n /** Per-package provider env-file path (Step 5b emission). */\n providerEnvFile: string;\n /**\n * This minion's OWN environment ({@link composeRuntimeEnvFilePath}), written by\n * {@link writeComposeRuntimeEnvFiles} from the derivation the Kubernetes lane mounts as the runtime's Secret (#2955):\n * its identity, its own principal secret, and its scoped topology. Mounted as an `env_file:`, so the template\n * names no identity or secret of its own.\n */\n runtimeEnvFile: string;\n /** Bucket key from `wildo.saas.config.ts > minions`. */\n minionKey: string;\n /** Display name from the per-folder config. */\n displayName: string;\n /**\n * `user:` — `<uid>:<gid>` from the authored `isolation`, mirroring the k8s\n * pod `runAsUser`/`runAsGroup`.\n */\n runAsUser: string;\n /**\n * The SAME uid/gid as {@link runAsUser}, kept as separate numbers because each\n * `tmpfs:` entry must carry `uid=`/`gid=` options — docker mounts a tmpfs\n * root-owned 0755, so a non-root container cannot write it. Two fields rather\n * than parsing the combined string back apart in the template.\n */\n runAsUserId: number;\n runAsGroupId: number;\n /**\n * Every writable tmpfs path: the mandatory `/tmp` first, then authored\n * additions. Compose gets `tmpfs:` where k8s gets `emptyDir` volumes; the\n * pairing with `read_only: true` is identical and equally load-bearing (the\n * liveness heartbeat file lives under `/tmp`).\n */\n writablePaths: readonly string[];\n /** `pids_limit` — fork-bomb ceiling, mirroring the k8s value. */\n pidsLimit: number;\n /**\n * The heartbeat env the minion runtime writes its liveness file from (#1859) — the same\n * `buildMinionLivenessHeartbeatEnv` the k8s Deployment stamps. Each value is a JSON string with `$`\n * already doubled, so it is a valid YAML scalar compose will not interpolate. Empty for `kind: exec`.\n */\n livenessHeartbeatEnv: ReadonlyArray<{ name: string; valueYaml: string }>;\n /** The compose `healthcheck`, derived from the same parsed liveness as the k8s probes. */\n livenessHealthcheck: MinionComposeHealthcheck;\n /**\n * The compose networks this minion joins: {@link composeMinionNetworks}, the same derivation the k8s pod labels and the\n * minion's environment read (#1771). It was a hand-written list in the template, which gave every minion MongoDB and\n * object storage whatever it declared, and PostgreSQL never.\n */\n networks: readonly string[];\n}\n\n/**\n * A minion's compose networks (#1771): `resolveRuntimeComposeNetworks`, the derivation its k8s pod labels and its\n * generated environment also read, bounded by the application's store (#3367), plus the host-access bridge (#3382).\n *\n * The bridge is the minion's route to the HOST. In this lane the application backend runs on the host, and the\n * minion's runtime endpoints name it through `host.docker.internal` (`toContainerRuntimeEndpoints`, with\n * {@link COMPOSE_HOST_GATEWAY_HOSTNAME}).\n * Every segment above is `internal: true`, and an internal network has no gateway: measured 2026-11-06, a container\n * attached only to one fails `host.docker.internal` with `ENETUNREACH`, while one on a user bridge answers. The\n * host-access bridge is the one non-internal network already here, with container-to-container traffic disabled,\n * so it adds the host and no other container. A worker joins it already, to publish its port (#3368).\n *\n * What it costs, stated plainly: a non-internal network restores NAT, so a local compose minion can now reach the\n * internet. Compose cannot express egress restriction at all (the template says so beside every app runtime), and\n * the Kubernetes lane, where egress IS enforced, is unaffected: this is compose-only, like the bridge.\n */\nexport function composeMinionNetworks(\n minionKey: string,\n declaration: { resourceAccess?: { read?: readonly string[]; write?: readonly string[] }; requiresInternetEgress?: boolean },\n applicationDatabaseEngine: DatabaseEngine,\n): string[] {\n return [\n ...resolveRuntimeComposeNetworks(\n { kind: ApplicationRuntimePrincipalKind.MINION, name: minionKey } as ApplicationRuntimePrincipal,\n // Forwarded verbatim, absence included: an absent declaration and an empty one are different statements.\n { resourceAccess: declaration.resourceAccess, requiresInternetEgress: declaration.requiresInternetEgress },\n // A minion serves no HTTP route.\n { servesHttp: false, applicationDatabaseEngine },\n ),\n COMPOSE_HOST_ACCESS_NETWORK,\n ];\n}\n\n/**\n * A minion's compose `healthcheck`, the mirror of its k8s `livenessProbe` + `startupProbe`. Docker REPORTS an\n * unhealthy container and does not restart it (`restart: unless-stopped` acts on exit only), so locally this\n * makes a deaf minion visible in `docker ps` rather than recovering it. It is still declared from the same\n * contract, so a green local healthcheck means exactly what a passing k8s probe means.\n */\nexport interface MinionComposeHealthcheck {\n /** `[\"CMD\", ...argv]` as JSON, with every `$` doubled so compose does not interpolate the shell script. */\n testJson: string;\n intervalSec: number;\n timeoutSec: number;\n retries: number;\n /** The k8s `startupProbe` budget: failures inside it do not count against `retries`. */\n startPeriodSec: number;\n}\n\n/**\n * Compose interpolates `$VAR` and `${VAR}` in every value of the file, `healthcheck.test` included, and `$$`\n * is its only escape. The probe script is full of `$(...)` and `$t`, so an unescaped render would hand docker\n * a script with its variables already substituted by compose — empty — which fails on every run.\n */\nfunction escapeComposeInterpolation(value: string): string {\n return value.replace(/\\$/g, '$$$$');\n}\n\n/** The compose healthcheck and heartbeat env for one parsed minion liveness (#1859). */\nexport function buildMinionComposeLiveness(liveness: MinionLiveness | undefined): Pick<DockerComposeAppMinionEntry, 'livenessHeartbeatEnv' | 'livenessHealthcheck'> {\n const timing = deriveMinionLivenessProbeTiming(liveness);\n return {\n livenessHeartbeatEnv: Object.entries(buildMinionLivenessHeartbeatEnv(liveness)).map(([name, value]) => ({\n name,\n valueYaml: JSON.stringify(escapeComposeInterpolation(value)),\n })),\n livenessHealthcheck: {\n testJson: JSON.stringify(['CMD', ...buildMinionLivenessProbeCommand(liveness)].map(escapeComposeInterpolation)),\n intervalSec: timing.periodSeconds,\n timeoutSec: timing.timeoutSeconds,\n retries: timing.failureThreshold,\n startPeriodSec: MINION_LIVENESS_STARTUP_BUDGET_SEC,\n },\n };\n}\n\nexport interface DockerComposeAppWorkerEntry {\n /** Compose service name — `<saasSlug>-worker-<dnsName>` (bucket key RFC1123-normalized via `buildWorkerServiceName`). */\n serviceName: string;\n /** Container name pinned for log-tailing convenience. */\n containerName: string;\n /** Absolute build context (the wildo-ai monorepo root). */\n buildContext: string;\n /** POSIX-relative Dockerfile path (from `buildContext` → the worker package's Dockerfile). */\n dockerfile: string;\n /** Per-package provider env-file path (Step 5b emission). */\n providerEnvFile: string;\n /** This worker's OWN environment; see {@link DockerComposeAppMinionEntry.runtimeEnvFile} (#2955). */\n runtimeEnvFile: string;\n /** Bucket key from `wildo.saas.config.ts > workers`. */\n workerKey: string;\n /** Display name from the per-folder config. */\n displayName: string;\n /** HTTP port the worker listens on (also the host-side mapping). */\n httpPort: number;\n /** `/healthz` (or operator-overridden) — informational; no compose-side healthcheck is configured. */\n healthPath: string;\n /** `/readyz` (or operator-overridden) — informational; no compose-side readiness probe is configured. */\n readyPath: string;\n /** `user:` — `<uid>:<gid>`, mirroring the k8s pod `runAsUser`/`runAsGroup`. */\n runAsUser: string;\n /** Same values as {@link DockerComposeAppWorkerEntry.runAsUser}, as numbers for the `tmpfs:` `uid=`/`gid=` options. */\n runAsUserId: number;\n runAsGroupId: number;\n /** Writable tmpfs paths: the mandatory one first, then authored additions. */\n writablePaths: readonly string[];\n /** `pids_limit` — fork-bomb ceiling. */\n pidsLimit: number;\n /** The compose networks this worker joins: {@link composeWorkerNetworks} (#3368). */\n networks: readonly string[];\n}\n\n/**\n * The compose PUBLISH bridge: Docker refuses to publish a host port for a container attached only to internal networks,\n * silently. A compose-only mechanism, not a {@link WildoRuntimeNetwork} segment; see the platform compose template.\n */\nconst COMPOSE_HOST_ACCESS_NETWORK = 'wildo-host-access';\n\n/**\n * A worker's compose networks (#3368): `resolveRuntimeComposeNetworks` for a WORKER — the platform segment and the\n * telemetry collector, the membership its k8s pod labels carry — plus the publish bridge, because every compose worker\n * publishes its HTTP port. The hand-written list this replaced gave every worker MongoDB, Redis, RabbitMQ and object\n * storage, none of which it holds a credential or topology for.\n */\nexport function composeWorkerNetworks(workerKey: string, applicationDatabaseEngine: DatabaseEngine): string[] {\n return [\n ...resolveRuntimeComposeNetworks(\n { kind: ApplicationRuntimePrincipalKind.WORKER, name: workerKey } as ApplicationRuntimePrincipal,\n undefined,\n { servesHttp: false, applicationDatabaseEngine },\n ),\n COMPOSE_HOST_ACCESS_NETWORK,\n ];\n}\n\n/**\n * The compose service + container name for a per-app minion/worker. Delegates to\n * the SHARED name builders so the compose service name is RFC1123-normalized and\n * byte-identical to the k8s Service name, the CI-built image ref, and the backend's\n * `WILDO_WORKER_<NAME>_URL` dispatch host (all derived from the same helper). A\n * camelCase bucket key (`marketingScrapper`) therefore resolves the same on the\n * compose network as in k8s (`{slug}-minion-marketing-scrapper`) — the backend\n * dispatch URL host would otherwise never resolve to the raw-key service name. The\n * RAW bucket key stays the runtime IDENTITY (`APP_OWNED_SERVICE_NAME`), carried\n * separately on the compose entry as `workerKey`/`minionKey`.\n */\nfunction deriveAppRuntimeServiceName(saasSlug: string, kind: 'minion' | 'worker', bucketKey: string): string {\n return kind === 'minion'\n ? buildMinionServiceName(saasSlug, bucketKey)\n : buildWorkerServiceName(saasSlug, bucketKey);\n}\n\nfunction deriveAppRuntimeContainerName(saasSlug: string, kind: 'minion' | 'worker', bucketKey: string): string {\n return deriveAppRuntimeServiceName(saasSlug, kind, bucketKey);\n}\n\n/**\n * Resolve the wildo-ai monorepo root from the framework path passed to\n * the renderer. Used as the compose `build.context` so each runtime-host\n * Dockerfile sees the full monorepo (file:-injected engine deps, nested\n * Wonder Todos workspace lockfile, etc.).\n */\nfunction resolveFrameworkRoot(frameworkPath: string): string {\n return resolveFrameworkLayout(frameworkPath).repositoryRoot;\n}\n\n/**\n * POSIX-relative path from the framework root to a package's Dockerfile.\n * Compose's `dockerfile:` field is interpreted relative to `build.context`\n * (the framework root for Step 6), so the path here must be relative\n * AND POSIX-style (Compose normalizes Windows paths but mixed-style is a\n * known footgun on macOS-host / Linux-container builds).\n */\nfunction relativeDockerfilePath(frameworkRoot: string, packageRoot: string): string {\n return posix.join(...relative(frameworkRoot, packageRoot).split(/[/\\\\]/), 'Dockerfile');\n}\n\n/**\n * Build the per-minion compose entries from the loaded saas + minion\n * configs. The provider env-file path is stable across runs (Step 5b\n * emits it on every `wildo config sync`); compose mounts it via\n * `env_file:` so the minion's process env contains the canonical\n * `WILDO_PROVIDER_*` keys at boot.\n */\nfunction buildAppMinionComposeEntries(input: {\n saasRoot: string;\n frameworkRoot: string;\n saasConfig: WildoSaasConfig;\n minionEntries: ReadonlyArray<{ key: string; absolutePath: string; config: WildoMinionConfig }>;\n /** The environment whose compose directory holds each runtime's own env file. */\n environmentName: string;\n /** The application's own store (#3367), which bounds every runtime's database networks. */\n applicationDatabaseEngine: DatabaseEngine;\n}): DockerComposeAppMinionEntry[] {\n const { saasRoot, frameworkRoot, saasConfig, minionEntries, environmentName, applicationDatabaseEngine } = input;\n return minionEntries.map((entry) => {\n const ref = saasConfig.minions?.[entry.key];\n if (!ref) {\n // Defensive — `loadMinionConfigs` reads from this same bucket so\n // mismatch is impossible in practice. Fail loudly if invariants drift.\n throw new Error(\n `[docker-compose-generator] Minion '${entry.key}' loaded but not found in `\n + `wildo.saas.config.ts > minions. Re-run \\`wildo config sync\\`.`,\n );\n }\n const packageRoot = join(saasRoot, ref.path);\n const providerEnvFile = join(packageRoot, PROVIDER_RUNTIME_GENERATED_ENV_FILE_NAME);\n const serviceName = deriveAppRuntimeServiceName(saasConfig.slug, 'minion', entry.key);\n return {\n serviceName,\n containerName: deriveAppRuntimeContainerName(saasConfig.slug, 'minion', entry.key),\n buildContext: frameworkRoot,\n dockerfile: relativeDockerfilePath(frameworkRoot, packageRoot),\n providerEnvFile,\n runtimeEnvFile: composeRuntimeEnvFilePath(environmentName, serviceName),\n minionKey: entry.key,\n displayName: entry.config.displayName,\n runAsUser: `${entry.config.isolation.runAsUser}:${entry.config.isolation.runAsGroup}`,\n runAsUserId: entry.config.isolation.runAsUser,\n runAsGroupId: entry.config.isolation.runAsGroup,\n // Mandatory `/tmp` first, then authored additions — the same ordering and\n // the same reason as the k8s renderer. The schema rejects `/tmp` inside\n // `writablePaths`, so prepending cannot produce a duplicate.\n writablePaths: [RUNTIME_MANDATORY_WRITABLE_PATH, ...entry.config.isolation.writablePaths],\n pidsLimit: entry.config.isolation.pidsLimit,\n ...buildMinionComposeLiveness(entry.config.liveness),\n networks: composeMinionNetworks(entry.key, ref, applicationDatabaseEngine),\n };\n });\n}\n\nfunction buildAppWorkerComposeEntries(input: {\n saasRoot: string;\n frameworkRoot: string;\n saasConfig: WildoSaasConfig;\n workerEntries: ReadonlyArray<{ key: string; absolutePath: string; config: WildoWorkerConfig }>;\n /** The environment whose compose directory holds each runtime's own env file. */\n environmentName: string;\n /** The application's own store (#3367); a worker reaches no store, but the derivation asks for it. */\n applicationDatabaseEngine: DatabaseEngine;\n}): DockerComposeAppWorkerEntry[] {\n const { saasRoot, frameworkRoot, saasConfig, workerEntries, environmentName, applicationDatabaseEngine } = input;\n return workerEntries.map((entry) => {\n const ref = saasConfig.workers?.[entry.key];\n if (!ref) {\n throw new Error(\n `[docker-compose-generator] Worker '${entry.key}' loaded but not found in `\n + `wildo.saas.config.ts > workers. Re-run \\`wildo config sync\\`.`,\n );\n }\n const packageRoot = join(saasRoot, ref.path);\n const providerEnvFile = join(packageRoot, PROVIDER_RUNTIME_GENERATED_ENV_FILE_NAME);\n const serviceName = deriveAppRuntimeServiceName(saasConfig.slug, 'worker', entry.key);\n return {\n serviceName,\n containerName: deriveAppRuntimeContainerName(saasConfig.slug, 'worker', entry.key),\n buildContext: frameworkRoot,\n dockerfile: relativeDockerfilePath(frameworkRoot, packageRoot),\n providerEnvFile,\n runtimeEnvFile: composeRuntimeEnvFilePath(environmentName, serviceName),\n workerKey: entry.key,\n displayName: entry.config.displayName,\n runAsUser: `${entry.config.isolation.runAsUser}:${entry.config.isolation.runAsGroup}`,\n runAsUserId: entry.config.isolation.runAsUser,\n runAsGroupId: entry.config.isolation.runAsGroup,\n writablePaths: [RUNTIME_MANDATORY_WRITABLE_PATH, ...entry.config.isolation.writablePaths],\n pidsLimit: entry.config.isolation.pidsLimit,\n networks: composeWorkerNetworks(entry.key, applicationDatabaseEngine),\n httpPort: entry.config.http.port,\n healthPath: entry.config.http.healthPath,\n readyPath: entry.config.http.readyPath,\n };\n });\n}\n\n/** The suffix of one app runtime's own compose env file, beside the compose file (#2955). */\nexport const COMPOSE_RUNTIME_ENV_FILE_SUFFIX = '.runtime.env';\n\n/** Where one minion's or worker's own environment lives for the compose `app-runtimes` profile (#2955). */\nexport function composeRuntimeEnvFilePath(environmentName: string, runtimeServiceName: string): string {\n return join(EnvironmentUtils.resolveDockerComposeDir(environmentName), `${runtimeServiceName}${COMPOSE_RUNTIME_ENV_FILE_SUFFIX}`);\n}\n\n/**\n * Write each application minion's and worker's OWN environment for the compose `app-runtimes` profile (#2955).\n *\n * The containers used to receive `${PLATFORM_APPLICATION_PRIMARY_SECRET}` and the bootstrap contract interpolated from\n * `.env.wildo-platform`, which carries the PLATFORM's primary secret in an app-creator install and nothing in a\n * framework-developer one. So a minion or worker presented another principal's secret, or none, and apps-manager\n * refused it. Each now mounts the environment the Kubernetes lane mounts as its Secret, built by the same derivation\n * (`application-runtime-environment.ts`) with the compose network's CONTAINER_INTERNAL addresses: its own identity,\n * its own principal secret, its own scoped topology. The provider env file stays a separate `env_file:`, as the\n * provider Secret stays a separate `envFrom` in Kubernetes.\n *\n * Owner-only (0600): the file holds the runtime's principal secret. Returns the paths written. Writes only the\n * runtimes it is given targets for and deletes nothing: a declared runtime with no target this run keeps its existing\n * file, and one that never had a file makes compose refuse the profile naming it, rather than start the runtime\n * with another principal's secret. Removal is the render's job ({@link pruneUndeclaredComposeRuntimeEnvFiles}).\n */\nexport function writeComposeRuntimeEnvFiles(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n minions: readonly ApplicationMinionEnvTarget[] | undefined,\n workers: readonly ApplicationWorkerEnvTarget[] | undefined,\n /** A caller that already holds the hydrated config (a test, a CI render) passes it, as `generateK8sSecrets` takes it. */\n options: { readonly config?: PlatformEnvConfigJson } = {},\n): string[] {\n const context = {\n credentials,\n addresses: ServiceAddressResolver.resolve(ServiceAddressResolver.fromEnvironment(env, AddressPerspective.CONTAINER_INTERNAL)),\n config: loadInfraHydratedConfig(env, options.config),\n environment: env,\n // A compose container reaches the host by the name the `extra_hosts` line defines (#3382).\n hostGatewayHostname: COMPOSE_HOST_GATEWAY_HOSTNAME,\n };\n // A LOCAL target carries no `appName` (REMOTE deploy context): the slug comes from the runtime's own bootstrap\n // credentials, the same app slug the render names the service with.\n //\n // The runtime endpoints are the target's own, as this container sees them (#3382): a host-run backend through the\n // host gateway, a container-routed one as it is. The shared builders derive them (`toContainerRuntimeEndpoints`),\n // from the context's `hostGatewayHostname`, the same derivation the Kubernetes lane runs (#3390).\n const environments = [\n ...(minions ?? []).map((minion) => buildContainerisedMinionEnvironment(minion, resolveRuntimeTargetAppSlug(minion), context)),\n ...(workers ?? []).map((worker) => buildContainerisedWorkerEnvironment(worker, resolveRuntimeTargetAppSlug(worker), context)),\n ];\n mkdirSync(EnvironmentUtils.resolveDockerComposeDir(env.name), { recursive: true });\n const written: string[] = [];\n for (const { runtimeServiceName, env: runtimeEnv } of environments) {\n const path = composeRuntimeEnvFilePath(env.name, runtimeServiceName);\n const lines = [GENERATED_FILE_HEADER, '', ...Object.entries(runtimeEnv).map(([key, value]) => `${key}=${encodeComposeEnvValue(value)}`)];\n writeFileSync(path, `${lines.join('\\n')}\\n`, { mode: 0o600 });\n chmodSync(path, 0o600);\n written.push(path);\n }\n return written;\n}\n\n/**\n * The name a compose container reaches the HOST by (#3382), and the `extra_hosts` entry that defines it.\n *\n * Docker Desktop resolves `host.docker.internal` itself; Docker Engine on Linux does not, and\n * `host.docker.internal:host-gateway` is Docker's own spelling for it there (`host-gateway` is the daemon's\n * host-gateway address), so the minion and worker services declare it on both. One constant, read by the render\n * (the `extra_hosts` line) and, through the compose runtime context, by `toContainerRuntimeEndpoints` (the URLs), so\n * the two cannot disagree.\n *\n * spec-cite: Docker docs, \"Networking in Compose\" / `extra_hosts` and \"Explore networking features on Docker\n * Desktop\" (`host.docker.internal`); `host-gateway` is the special value `docker run --add-host` documents.\n */\nexport const COMPOSE_HOST_GATEWAY_HOSTNAME = 'host.docker.internal';\nexport const COMPOSE_HOST_GATEWAY_EXTRA_HOST = `${COMPOSE_HOST_GATEWAY_HOSTNAME}:host-gateway`;\n\n/** The runtime env files {@link writeComposeRuntimeEnvFiles} would write for these targets, for an overwrite prompt. */\nexport function composeRuntimeEnvFilePaths(\n environmentName: string,\n minions: readonly ApplicationMinionEnvTarget[] | undefined,\n workers: readonly ApplicationWorkerEnvTarget[] | undefined,\n): string[] {\n return [\n ...(minions ?? []).map((minion) => composeRuntimeEnvFilePath(environmentName, buildMinionServiceName(resolveRuntimeTargetAppSlug(minion), minion.minionName))),\n ...(workers ?? []).map((worker) => composeRuntimeEnvFilePath(environmentName, buildWorkerServiceName(resolveRuntimeTargetAppSlug(worker), worker.workerName))),\n ];\n}\n\n/**\n * Delete each `*.runtime.env` whose runtime the application no longer declares (#2955), so a removed minion or worker\n * leaves no principal secret behind. Keyed on what the configuration DECLARES, never on what one run happened to\n * write: a run that knows no targets (`wildo config sync` in app-creator mode prepares none) or skips a principal\n * (degraded mode) must leave the existing files of declared runtimes alone.\n */\nexport function pruneUndeclaredComposeRuntimeEnvFiles(environmentName: string, declaredRuntimeServiceNames: ReadonlySet<string>): void {\n const composeDir = EnvironmentUtils.resolveDockerComposeDir(environmentName);\n if (!existsSync(composeDir)) return;\n for (const entry of readdirSync(composeDir)) {\n if (!entry.endsWith(COMPOSE_RUNTIME_ENV_FILE_SUFFIX)) continue;\n if (!declaredRuntimeServiceNames.has(entry.slice(0, -COMPOSE_RUNTIME_ENV_FILE_SUFFIX.length))) unlinkSync(join(composeDir, entry));\n }\n}\n\n/**\n * How the compose render evaluates `wildo.saas.config.ts` and each minion's and worker's configuration: against the\n * CLI's own built framework packages ({@link ConfigModuleResolution.LOADER_INSTANCES}, #3440).\n *\n * The render only asks what those files DECLARE (the runtimes, their paths, ports and liveness), and builds the compose\n * file with the `platform-config-lib` build the CLI runs. Left to the loader's inference, a framework checkout aliases\n * `@wildo-ai/platform-config-lib` to its `config-authoring.entry.ts` source, so the first read transpiled about 120\n * framework source modules, and on the CI runner the render's Wonder Todos test exceeded its 30 s budget (#3646). Same\n * root cause and remedy as #3610, #3615 and #3621. The files read here import framework packages and, at most, an\n * application's role enums; none defines a zod schema of its own, so the decorated-zod caveat of that mode does not arise.\n */\nconst COMPOSE_RUNTIME_CONFIG_LOAD_OPTIONS = { moduleResolution: ConfigModuleResolution.LOADER_INSTANCES } as const;\n\n/**\n * Render `docker-compose.wildo-platform.yml` and write it when its content differs from what is on disk.\n *\n * Resolves to whether the compose file was written. `wildo local up` / `wildo local dev` render it on EVERY start\n * (#2311): the comparison of the rendered bytes is the only check that is total over the render's inputs —\n * `config.json`, `secrets.json`, the framework's compose template, the application's minion and worker\n * configuration — where an mtime or a flag keyed on any one of them misses the others. The host-mounted files\n * (the immudb signing key, the mongot password) are re-materialized on every render, so a `local_data` reset that\n * removed them is repaired by the next start whether or not the compose file itself changed.\n */\nexport async function renderDockerComposeTemplate(\n env: PlatformEnvironmentConfiguration,\n frameworkPath: string,\n isFrameworkDeveloper: boolean,\n): Promise<boolean> {\n /*\n * The shared compose project is rendered by its OWNER only. A hosted application's render would carry\n * its own `local_data` paths under the host's project name and container names — `up` from it would\n * recreate the host's containers over a different data directory, which is how a stale database\n * appeared under the right name before `infrastructureHost` existed.\n */\n InfrastructureHost.assertOwnsSharedInfrastructure(env, SharedInfrastructureAction.RENDER_PLATFORM_COMPOSE);\n // #2303 — a profile that runs one database family never renders two (the descriptor refuses the declarations too).\n assertProfileRunsItsDatabaseFamilies(env);\n const config = EnvironmentUtils.loadConfigJson(env.name);\n if (!config) throw new Error('config.json not found');\n\n const processor = new TemplateProcessor(\n resolveFrameworkLayout(frameworkPath).dockerComposeTemplatesHome,\n );\n\n // Slice 4 (4.2) — `localDataPath` template variable.\n //\n // Resolves to the absolute host path\n // `<saasRoot>/.wildo-saas/local_data` so each per-service bind mount in\n // the rendered compose file is unambiguous. We deliberately use ABSOLUTE\n // paths (D4 decision in the slice plan) instead of paths relative to the\n // generated compose file location:\n // - Relative paths would walk up several segments\n // (`../../../local_data/<svc>`) and break if the on-disk layout\n // between `.wildo-saas/infrastructure/environments/<env>/docker-compose/`\n // and `.wildo-saas/local_data/` ever changes.\n // - Absolute paths are independent of `cwd` and survive any future\n // reshuffling of the runtime layout.\n //\n // The CLI guarantees the per-service subdirs exist before\n // `docker compose up` via `EnvironmentPaths.ensureLocalDataServiceDirs()`\n // (Slice 4.3); Docker would otherwise create them as root-owned mount\n // points which container UIDs cannot write to.\n const saasRoot = EnvironmentRegistry.getSaasRoot();\n if (!saasRoot) {\n throw new Error(\n 'Cannot render docker-compose template: no targeted SaaS app root detected.',\n );\n }\n const localDataPath = EnvironmentPaths.resolveScopedLocalDataDir(saasRoot);\n\n // Step 6 — load per-app minion/worker configs so the compose template\n // can emit a service for each one under the `app-runtimes` profile.\n // The platform path stays unchanged when there are no minions/workers\n // declared (the template's `{{#if appMinions.length}}` / `{{#if appWorkers.length}}`\n // guards drop the sections entirely in that case). Framework-developer\n // mode skips the load to keep the platform-only flow side-effect-free.\n const saasConfigForRuntimes = isFrameworkDeveloper\n ? null\n : await loadSaasConfig(join(saasRoot, 'wildo.saas.config.ts'), COMPOSE_RUNTIME_CONFIG_LOAD_OPTIONS);\n const minionEntries = saasConfigForRuntimes\n ? await loadMinionConfigs(saasRoot, saasConfigForRuntimes, COMPOSE_RUNTIME_CONFIG_LOAD_OPTIONS)\n : [];\n const workerEntries = saasConfigForRuntimes\n ? await loadWorkerConfigs(saasRoot, saasConfigForRuntimes, COMPOSE_RUNTIME_CONFIG_LOAD_OPTIONS)\n : [];\n // Step 6 (Q1 (B)) — `build.context` for runtime-host services is the\n // wildo-ai monorepo root so each Dockerfile can resolve file:-injected\n // engine deps. The Dockerfile itself lives inside the package; its\n // path is computed relative to the framework root.\n const frameworkRoot = resolveFrameworkRoot(frameworkPath);\n\n const appMinions = saasConfigForRuntimes\n ? buildAppMinionComposeEntries({\n saasRoot,\n frameworkRoot,\n saasConfig: saasConfigForRuntimes,\n minionEntries,\n environmentName: env.name,\n applicationDatabaseEngine: resolveApplicationDatabaseEngine(config.applicationDatabase),\n })\n : [];\n // The runtimes this render declares are the only ones whose env file may remain (#2955). Total over the\n // configuration, so pruning here can never remove a declared runtime's file.\n pruneUndeclaredComposeRuntimeEnvFiles(env.name, new Set([\n ...minionEntries.map((entry) => deriveAppRuntimeServiceName(saasConfigForRuntimes!.slug, 'minion', entry.key)),\n ...workerEntries.map((entry) => deriveAppRuntimeServiceName(saasConfigForRuntimes!.slug, 'worker', entry.key)),\n ]));\n const appWorkers = saasConfigForRuntimes\n ? buildAppWorkerComposeEntries({\n saasRoot,\n frameworkRoot,\n saasConfig: saasConfigForRuntimes,\n workerEntries,\n environmentName: env.name,\n applicationDatabaseEngine: resolveApplicationDatabaseEngine(config.applicationDatabase),\n })\n : [];\n\n // Slice 2 Phase 5b Wave 2 — local OTel collector inclusion + host port.\n // Emitted only when infra `observability.enabled` AND the authored OTLP\n // endpoint targets localhost (the endpoint IS this local collector; a remote\n // BetterStack endpoint gets no local collector). The host port is parsed from\n // the endpoint so the published `localhost:<port>` matches exactly what the\n // preload-instrumented backend + companion hosts target; defaults to the\n // OTLP/HTTP standard 4318 when the endpoint omits an explicit port.\n const OTEL_OTLP_HTTP_DEFAULT_PORT = '4318';\n const otelObservability = env.observability;\n let includeOtelCollector = false;\n let otelCollectorHostPort = OTEL_OTLP_HTTP_DEFAULT_PORT;\n if (otelObservability?.enabled) {\n let parsedEndpoint: URL | undefined;\n try {\n parsedEndpoint = new URL(otelObservability.endpoint);\n } catch {\n parsedEndpoint = undefined;\n }\n if (\n parsedEndpoint &&\n (parsedEndpoint.hostname === 'localhost' ||\n parsedEndpoint.hostname === '127.0.0.1')\n ) {\n includeOtelCollector = true;\n otelCollectorHostPort = parsedEndpoint.port || OTEL_OTLP_HTTP_DEFAULT_PORT;\n }\n }\n\n // Audit Phase 2 — materialize the immudb state-signing PRIVATE key so the self-hosted immudb\n // container can sign its `ImmutableState` (`--signingKey`), turning the whole-server-substitution\n // defense ON. Only when this env self-hosts immudb AND a keypair was provisioned\n // (`credentials.immudb`, minted from the `FRAMEWORK_MANAGED_SECRET_MATERIALS` registry at setup\n // and by the idempotent self-heal, so present for any file-backed env). The key is the SEC1 \"EC PRIVATE KEY\"\n // PEM immudb parses; written `0644` because the compose bind mount preserves host ownership and\n // immudb's container UID differs, so the file must be world-readable to load (proven in the\n // immudb integration test). SERVER-side ONLY — the private key never enters app env; the matching\n // PUBLIC key reaches the audit client via `IMMUDB_STATE_PUBLIC_KEY` (env-vars-builder). When no\n // keypair is provisioned the template's `{{#if immudbSigningKeyHostPath}}` block drops and immudb\n // runs UNSIGNED (client warns once) — graceful degradation.\n let immudbSigningKeyHostPath: string | undefined;\n // The built-in `immudb` SYSADMIN's INITIAL password — the platform's own framework-managed material\n // (`credentials.immudb.adminPassword`, #1696). apps-manager logs in with the same value (`IMMUDB_ADMIN_PASSWORD`\n // in its env) to mint each application's own database and `READ_WRITE` user; no application receives it.\n //\n // Until #1696 this was COPIED from the owning application's `providerEnv.IMMUDB_PASSWORD`, the credential every\n // application's audit sink also connected with, so each application held the sysadmin of every application's\n // audit data. That copy is gone from this lane AND from the k8s lane (`k8s-secrets-generator`), which is the\n // pair the original copy had to keep in step (`.claude/rules/invariant-call-site-enumeration.md` #23).\n //\n // Read from the SAME `SecretsReader` load as the signing key. Undefined (a CI-reconstructed secrets.json that\n // carries no immudb material) ⇒ the template's `{{#if immudbAdminPassword}}` block drops.\n //\n // ⚠️ immudb only adopts this on a FRESH data dir — it is the INITIAL password, not a reset. An existing\n // `local_data/immudb` keeps whatever it was initialised with. apps-manager moves one still on immudb's packaged\n // default onto this value at its first admin login (`ImmudbAdminManagerService`, audited); one initialised from a\n // real secret needs its sysadmin password set once (`immuadmin user changepassword immudb`) or a fresh data dir.\n let immudbAdminPassword: string | undefined;\n if (resolveIncludeLocalImmudb(env)) {\n const secrets = SecretsReader.loadSecrets(env.name);\n const signingPrivateKey = secrets?.immudb?.stateSigningPrivateKey;\n if (signingPrivateKey) {\n /*\n * Written on EVERY render, and every `wildo local up` / `wildo local dev` renders (#2311). That is what repairs\n * a `local_data` reset: the reset removes this file and leaves the compose file, and Docker does not fail on a\n * missing bind-mount SOURCE, it silently creates a DIRECTORY there. immudb then reports\n * `unable to configure the cryptographic signer: read /etc/immudb/state-signing.key: is a directory` and\n * compose only `container wildo-immudb is unhealthy` (measured 2026-08-22, the first cold start after a full\n * reset). The key itself survives a reset, in `secrets.json`, so this is recoverable by construction.\n *\n * Until #2311 the render was skipped while the compose file was current, so a predicate\n * (`isComposeHostMountedArtifactMissing`) forced it for this one file. Rendering on every start makes the\n * predicate unnecessary, and it is removed: it covered this file and not the mongot password beside it.\n */\n const signingKeyDir = join(localDataPath, IMMUDB_SIGNING_KEY_DIR);\n mkdirSync(signingKeyDir, { recursive: true });\n const signingKeyPath = join(signingKeyDir, IMMUDB_SIGNING_KEY_FILENAME);\n // The Docker-created stand-in is an EMPTY directory; `rmdirSync` refuses a non-empty one, so nothing real is lost.\n if (existsSync(signingKeyPath) && statSync(signingKeyPath).isDirectory()) rmdirSync(signingKeyPath);\n // Rewritten only when it differs: the render runs on every start, possibly while immudb is (re)starting, and a\n // truncate-and-write of identical bytes would open a window in which it reads an empty file.\n writeFileWhenContentDiffers(signingKeyPath, signingPrivateKey, 0o644);\n immudbSigningKeyHostPath = signingKeyPath;\n }\n immudbAdminPassword = secrets?.immudb?.adminPassword;\n }\n\n // Issue #74 — materialize the `mongot` sync-source password so BOTH containers that need it can\n // read the SAME bytes: `mongodb-init` creates the `searchCoordinator` user with it, and `mongot`\n // authenticates with it. Neither can be given the other's copy, and minting it per-container is\n // how the two silently diverge — so it comes from the single framework-managed material and is\n // written once here.\n //\n // `0400` because mongot enforces it (see MONGOT_PASSWORD_DIR). Written on every render, and every\n // `wildo local up` / `wildo local dev` renders (#2311), so a `local_data` reset that removes this\n // file while leaving the compose file behind is repaired by the next start. Missing, it would\n // surface as a mongot that cannot authenticate rather than as anything naming the missing file.\n //\n // `undefined` ⇒ the template's `{{#if mongotPasswordHostPath}}` guard drops the mongot service\n // entirely and mongod runs without a search sidecar. That is the honest degradation: a\n // half-wired mongot that mongod routes `$vectorSearch` to and that cannot answer is worse than\n // no mongot at all, because the application's boot probe tests REACHABILITY.\n //\n // A service profile that omits mongot (#2303) leaves it `undefined` too, whatever material exists.\n let mongotPasswordHostPath: string | undefined;\n if (resolveIncludeMongotSidecar(env)) {\n const mongotPassword = SecretsReader.loadSecrets(env.name)?.mongot?.syncSourcePassword;\n if (mongotPassword) {\n const mongotAuthDir = join(localDataPath, MONGOT_PASSWORD_DIR);\n mkdirSync(mongotAuthDir, { recursive: true });\n const passwordPath = join(mongotAuthDir, MONGOT_PASSWORD_FILENAME);\n // A PREVIOUS render left this file at 0400 — owner READ-only — and `writeFileSync` opens for\n // WRITE, so a re-render EACCES's on the file it wrote itself. That made `wildo local init`\n // succeed exactly once per machine and fail on every subsequent run, which is the worst shape\n // for a first-run-only bug: the failure lands on someone whose environment already worked.\n // Widen just long enough to rewrite, then re-narrow. Unlinking instead would leave a window\n // with no file at all, which a running mongot re-reading its password would lose.\n //\n // Since the render runs on every start (#2311), an identical file at the right mode is left\n // untouched, so a mongot (re)starting meanwhile never meets the widened or truncated window.\n // The Docker-created stand-in for a missing mount source is an EMPTY directory, as for the signing key above.\n if (existsSync(passwordPath) && statSync(passwordPath).isDirectory()) rmdirSync(passwordPath);\n const passwordCurrent = existsSync(passwordPath)\n && statSync(passwordPath).isFile()\n && (statSync(passwordPath).mode & 0o777) === MONGOT_SYNC_SOURCE.PASSWORD_FILE_MODE\n && readFileSync(passwordPath, 'utf8') === mongotPassword;\n if (!passwordCurrent) {\n if (existsSync(passwordPath)) {\n chmodSync(passwordPath, MONGOT_SYNC_SOURCE.PASSWORD_FILE_REWRITE_MODE);\n }\n writeFileSync(passwordPath, mongotPassword, { mode: MONGOT_SYNC_SOURCE.PASSWORD_FILE_MODE });\n // `writeFileSync`'s `mode` is only honored when it CREATES the file — an existing file keeps\n // whatever mode it already had, so re-render alone cannot repair a loosened one. chmod\n // unconditionally, or a file that was ever created differently keeps crashing mongot.\n chmodSync(passwordPath, MONGOT_SYNC_SOURCE.PASSWORD_FILE_MODE);\n }\n mongotPasswordHostPath = passwordPath;\n }\n }\n\n // #2933 — the self-hosted OpenBao. Its material (the unseal key and apps-manager's two token ids) must be provisioned:\n // a declared Vault rendered without it would be a server that cannot unseal, and rendering none would leave\n // apps-manager without the Vault the environment declares, silently. So a missing material is REFUSED, as the\n // Kubernetes lane refuses it; the remedy is `wildo config sync`, which provisions it, and needs nothing running. Its\n // configuration carries key ids only; the secrets are inline in the service, like immudb's admin password, because a\n // framework developer's `.env.wildo-platform` carries no platform env to interpolate.\n let platformKeyVault:\n | {\n image: string; configFilePath: string; dataPath: string; configIndented: string; env: Record<string, string>;\n unsealKey: string; signerToken: string; operatorToken: string; recoveryToken: string; previousUnsealKey?: string;\n }\n | undefined;\n if (resolveIncludeLocalPlatformKeyVault(env)) {\n const material = SecretsReader.loadSecrets(env.name)?.platformKeyVault;\n if (!material?.unsealKey || !material.signerToken || !material.operatorToken || !material.recoveryToken) {\n throw new Error(\n `Environment \"${env.name}\" self-hosts the platform Vault (platformKeyManagement.vault.source = self), but secrets.json `\n + 'carries no platformKeyVault material. Run `wildo config sync`, which provisions it, then render again.',\n );\n }\n {\n // #3006 — a previous unseal key is present only between the two steps of `wildo keys vault-rotate-unseal-key`.\n const config = renderPlatformKeyVaultServerConfig({ unsealKey: material.unsealKey, previousUnsealKey: material.previousUnsealKey });\n platformKeyVault = {\n image: PLATFORM_KEY_VAULT_SERVER.IMAGE,\n configFilePath: PLATFORM_KEY_VAULT_SERVER.CONFIG_FILE_PATH,\n dataPath: PLATFORM_KEY_VAULT_SERVER.DATA_PATH,\n // A YAML block scalar under `content: |`, six spaces in.\n configIndented: config.trimEnd().split('\\n').map((line) => (line ? ` ${line}` : '')).join('\\n'),\n env: {\n unsealKey: PLATFORM_KEY_VAULT_SERVER.ENV.UNSEAL_KEY,\n signerToken: PLATFORM_KEY_VAULT_SERVER.ENV.SIGNER_TOKEN,\n operatorToken: PLATFORM_KEY_VAULT_SERVER.ENV.OPERATOR_TOKEN,\n recoveryToken: PLATFORM_KEY_VAULT_SERVER.ENV.RECOVERY_TOKEN,\n previousUnsealKey: PLATFORM_KEY_VAULT_SERVER.ENV.PREVIOUS_UNSEAL_KEY,\n },\n unsealKey: material.unsealKey,\n signerToken: material.signerToken,\n operatorToken: material.operatorToken,\n recoveryToken: material.recoveryToken,\n ...(material.previousUnsealKey ? { previousUnsealKey: material.previousUnsealKey } : {}),\n };\n }\n }\n\n const context = {\n composeName: DEFAULT_DOCKER_COMPOSE_LOCAL_PROJECT_NAME,\n /**\n * #2933 — the self-hosted OpenBao (service, `wildo-data-keys` segment, apps-manager's membership of it, and its\n * `configs:` entry), or `undefined` when the environment self-hosts none or its material is not provisioned.\n */\n platformKeyVault,\n /**\n * #3019 — the HSM vendor's PKCS#11 client files (read-only mounts) and variables for both apps-manager services, or\n * `undefined` when the platform runs natively or declares no token. Refuses a module the container cannot reach.\n */\n platformPkcs11: buildPlatformPkcs11ComposeContext(env, !isFrameworkDeveloper),\n /**\n * Slice 2 Phase 5b Wave 2 — local OTel collector. `includeOtelCollector`\n * gates both the service (under `services:`) and the inline `configs:`\n * entry that supplies its config (the contrib image is distroless — no\n * shell for an entrypoint heredoc). Ports default to OTLP/HTTP 4318.\n */\n includeOtelCollector,\n otelCollectorHostPort,\n otelCollectorInternalPort: OTEL_OTLP_HTTP_DEFAULT_PORT,\n includeLocalMongoDB: EnvironmentUtils.needsLocalMongoDB(env),\n /**\n * NOT `config.database.engine === POSTGRESQL` — see\n * {@link EnvironmentLifecycle.needsLocalPostgreSQL}. That field also SUBTRACTS MongoDB\n * (`needsLocalMongoDB`), so it could never express \"MongoDB for the platform, PostgreSQL for the\n * application's resources\", which is what an app on the PostgreSQL persistence adapter needs.\n */\n includePostgreSQL: EnvironmentUtils.needsLocalPostgreSQL(env),\n /**\n * Cache / broker / object storage. Each gates its own service block AND its `depends_on` entry\n * on `platform-init` — both, or compose refuses the whole project with\n * `service \"platform-init\" depends on undefined service \"valkey\"`, which is the failure mode a\n * half-applied gate produces (`.claude/rules/invariant-call-site-enumeration.md`).\n * `includeLocalMinIO` additionally gates the `minio-init` bucket-creation step, which exists\n * only to serve the local MinIO.\n */\n includeLocalValkey: resolveIncludeLocalValkey(env),\n includeLocalRabbitMQ: resolveIncludeLocalRabbitMQ(env),\n includeLocalMinIO: resolveIncludeLocalMinIO(env),\n includeLocalClamAV: resolveIncludeLocalClamAV(env),\n includeLocalImmudb: resolveIncludeLocalImmudb(env),\n /**\n * Absolute host path of the materialized immudb state-signing PRIVATE key, or `undefined`\n * when immudb is not self-hosted / no keypair is provisioned. Gates the `--signingKey` block\n * (mount + `command`) in the compose immudb service so it signs its state.\n */\n immudbSigningKeyHostPath,\n /**\n * The self-hosted immudb server's INITIAL sysadmin password: the platform's framework-managed\n * `credentials.immudb.adminPassword` (#1696), the same value apps-manager logs in with. `undefined` ⇒ the\n * template's `environment:` block drops (matching the k8s lane's `optional: true` secretKeyRef).\n */\n immudbAdminPassword,\n /**\n * Issue #74 — absolute host path of the materialized mongot sync-source password file, or\n * `undefined` when this env self-hosts no mongod / carries no mongot material. Gates the whole\n * `mongot` service and the `mongodb-init` step that creates its user.\n */\n mongotPasswordHostPath,\n /** In-container mount point both mongot and mongodb-init read that file at. */\n mongotPasswordFilePath: MONGOT_SYNC_SOURCE.PASSWORD_FILE_PATH,\n /** The `searchCoordinator`-roled user mongot authenticates to mongod as. */\n mongotSyncSourceUsername: MONGOT_SYNC_SOURCE.USERNAME,\n mongotSyncSourceAuthSource: MONGOT_SYNC_SOURCE.AUTH_SOURCE,\n mongotConfigFilePath: MONGOT_SYNC_SOURCE.CONFIG_FILE_PATH,\n mongotDataPath: MONGOT_SYNC_SOURCE.DATA_PATH,\n includePlatformServices: !isFrameworkDeveloper,\n /**\n * Each platform container's `mem_limit` and V8 heap ceiling, from the MEASURED profiles in the\n * service catalog (#1592) — the same numbers the k8s lane renders, so the two cannot drift.\n */\n platformServiceMemory: buildPlatformServiceMemoryContext(),\n /** Step 6 — per-app minion + worker compose entries (under `app-runtimes` profile). */\n appMinions,\n appWorkers,\n // The minion and worker services' `extra_hosts` entry (#3382), from the constant their endpoints are derived with.\n hostGatewayExtraHost: COMPOSE_HOST_GATEWAY_EXTRA_HOST,\n /** Slug used to disambiguate compose service names across coexisting apps on the same host. */\n saasSlug: saasConfigForRuntimes?.slug ?? '',\n /**\n * The PUBLISHED platform image, read only inside `{{#if includePlatformServices}}`: a framework developer's\n * platform runs natively, so their file renders no platform container at all. See `resolvePlatformImageRef`\n * for why there is no locally built answer (#2988) and why the tag is the framework version, never `latest`.\n */\n platformImageRef: resolvePlatformImageRef({ frameworkVersion: readVersion() }),\n localDataPath,\n /**\n * Per-mount SOURCE for every backing-service data directory, and the named volumes to declare.\n *\n * Both derive from one table (`LOCAL_DATA_MOUNTS`) so the file cannot mount a volume it does\n * not declare. `localDataVolumes` is empty in `HOST_PATH` mode, which drops the `volumes:`\n * block entirely — compose rejects an empty mapping.\n *\n * `localDataPath` stays in the context under BOTH modes: the two read-only secret FILE mounts\n * (immudb's state-signing key, mongot's sync-source password) are materialized onto the host\n * from `secrets.json` and have nowhere else to come from, so they are host mounts always.\n */\n localDataSources: buildLocalDataMountSources(env, saasRoot, localDataPath),\n localDataVolumes: buildLocalDataVolumeDeclarations(env, saasRoot, { mongot: mongotPasswordHostPath !== undefined, openbao: platformKeyVault !== undefined }),\n /**\n * Host-side port mappings for self-deployed infra services. Each value\n * defaults to the image-internal port (which is what container-internal\n * traffic always uses); when the author overrides\n * `backingServices.<kind>.port` for a SELF source, that value drives the\n * host-side mapping so `localhost:${authorPort}` reaches the container.\n */\n infraHostPorts: {\n mongodb: resolveInfraHostPort(env, BackingServiceKind.MONGODB, INFRA_DEFAULT_PORTS.MONGODB),\n valkey: resolveInfraHostPort(env, BackingServiceKind.REDIS, INFRA_DEFAULT_PORTS.VALKEY),\n rabbitmq: resolveInfraHostPort(env, BackingServiceKind.RABBITMQ, INFRA_DEFAULT_PORTS.RABBITMQ),\n rabbitmqManagement: INFRA_DEFAULT_PORTS.RABBITMQ_MANAGEMENT,\n minio: resolveInfraHostPort(env, BackingServiceKind.S3, INFRA_DEFAULT_PORTS.MINIO),\n minioConsole: MINIO_CONSOLE_PORT,\n postgresql: resolveInfraHostPort(env, BackingServiceKind.POSTGRESQL, INFRA_DEFAULT_PORTS.POSTGRESQL),\n clamav: resolveInfraHostPort(env, BackingServiceKind.CLAMAV, INFRA_DEFAULT_PORTS.CLAMAV),\n immudb: resolveInfraHostPort(env, BackingServiceKind.IMMUDB, INFRA_DEFAULT_PORTS.IMMUDB),\n // #2933 — no authored override: the platform Vault is not a backing service an environment addresses.\n openbao: INFRA_DEFAULT_PORTS.OPENBAO,\n },\n infraInternalPorts: {\n mongodb: INFRA_DEFAULT_PORTS.MONGODB,\n valkey: INFRA_DEFAULT_PORTS.VALKEY,\n rabbitmq: INFRA_DEFAULT_PORTS.RABBITMQ,\n rabbitmqManagement: INFRA_DEFAULT_PORTS.RABBITMQ_MANAGEMENT,\n minio: INFRA_DEFAULT_PORTS.MINIO,\n minioConsole: MINIO_CONSOLE_PORT,\n postgresql: INFRA_DEFAULT_PORTS.POSTGRESQL,\n clamav: INFRA_DEFAULT_PORTS.CLAMAV,\n immudb: INFRA_DEFAULT_PORTS.IMMUDB,\n openbao: INFRA_DEFAULT_PORTS.OPENBAO,\n // Issue #74 — mongot's three listeners. Present in `infraInternalPorts` and deliberately\n // ABSENT from `infraHostPorts`: nothing on the host is a mongot client (clients talk to\n // mongod, which routes to mongot over gRPC), so publishing them would widen the local\n // attack surface for no consumer.\n mongotGrpc: INFRA_DEFAULT_PORTS.MONGOT_GRPC,\n mongotHealth: INFRA_DEFAULT_PORTS.MONGOT_HEALTH,\n mongotMetrics: INFRA_DEFAULT_PORTS.MONGOT_METRICS,\n },\n };\n\n const rendered = processor.processTemplate(FILE_NAMES.DOCKER_COMPOSE_TEMPLATE, context);\n\n const composeDir = EnvironmentUtils.resolveDockerComposeDir(env.name);\n if (!existsSync(composeDir)) {\n mkdirSync(composeDir, { recursive: true });\n }\n\n return writeFileWhenContentDiffers(join(composeDir, FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM), rendered);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"docker-compose-generator.service.js","sourceRoot":"","sources":["../../../../../src/services/deployment/docker/docker-compose-generator.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACjI,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAGvD,OAAO,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EACL,gCAAgC,EAChC,oCAAoC,EACpC,0BAA0B,EAC1B,wCAAwC,GACzC,MAAM,mEAAmE,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAC;AAC7H,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,+BAA+B,EAC/B,wCAAwC,EACxC,sBAAsB,EAGtB,qBAAqB,EACrB,8BAA8B,EAE9B,qBAAqB,EACrB,yBAAyB,EACzB,+BAA+B,EAC/B,0CAA0C,EAC1C,+BAA+B,EAC/B,+BAA+B,EAC/B,+BAA+B,EAC/B,kCAAkC,EAElC,+BAA+B,EAE/B,6BAA6B,EAC7B,gCAAgC,EAEhC,wCAAwC,GACzC,MAAM,+BAA+B,CAAC;AACvC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EAAE,mBAAmB,CAAC,OAAO;SACrC;QACD,kBAAkB,EAAE;YAClB,OAAO,EAAE,mBAAmB,CAAC,OAAO;YACpC,MAAM,EAAE,mBAAmB,CAAC,MAAM;YAClC,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;YACtC,kBAAkB,EAAE,mBAAmB,CAAC,mBAAmB;YAC3D,KAAK,EAAE,mBAAmB,CAAC,KAAK;YAChC,YAAY,EAAE,kBAAkB;YAChC,UAAU,EAAE,mBAAmB,CAAC,UAAU;YAC1C,MAAM,EAAE,mBAAmB,CAAC,MAAM;YAClC,MAAM,EAAE,mBAAmB,CAAC,MAAM;YAClC,OAAO,EAAE,mBAAmB,CAAC,OAAO;YACpC,yFAAyF;YACzF,wFAAwF;YACxF,sFAAsF;YACtF,kCAAkC;YAClC,UAAU,EAAE,mBAAmB,CAAC,WAAW;YAC3C,YAAY,EAAE,mBAAmB,CAAC,aAAa;YAC/C,aAAa,EAAE,mBAAmB,CAAC,cAAc;SAClD;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG,SAAS,CAAC,eAAe,CAAC,UAAU,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAExF,MAAM,UAAU,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,2BAA2B,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,6BAA6B,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC3G,CAAC","sourcesContent":["import { createHash } from 'crypto';\nimport { chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, rmdirSync, statSync, unlinkSync, writeFileSync } from 'fs';\nimport { basename, join, posix, relative } from 'path';\nimport type { PlatformEnvConfigJson, PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { DockerUtils } from '~wildo-cli/services/deployment/docker/docker.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport {\n assertProfileRunsDeclaredMinions,\n assertProfileRunsItsDatabaseFamilies,\n includesMongoSearchSidecar,\n selfHostsOptionalServiceAllowedByProfile,\n} from '~wildo-cli/services/environment/environment-service-profile.utils';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { EnvironmentRegistry } from '~wildo-cli/services/environment/environment-registry.service';\nimport { InfrastructureHost, SharedInfrastructureAction } from '~wildo-cli/services/environment/infrastructure-host.service';\nimport {\n BackingServiceKind,\n BackingServiceSource,\n ConfigModuleResolution,\n INFRA_DEFAULT_PORTS,\n loadMinionConfigs,\n loadSaasConfig,\n loadWorkerConfigs,\n RUNTIME_MANDATORY_WRITABLE_PATH,\n PROVIDER_RUNTIME_GENERATED_ENV_FILE_NAME,\n resolveFrameworkLayout,\n type WildoMinionConfig,\n type WildoSaasConfig,\n WildoLocalDataStorage,\n resolveDefaultLocalDataStorage,\n type WildoWorkerConfig,\n PlatformWildoServices,\n selfHostsPlatformKeyVault,\n describeUnreachablePkcs11Module,\n pkcs11ModuleIsReachableInPlatformContainer,\n buildMinionLivenessHeartbeatEnv,\n buildMinionLivenessProbeCommand,\n deriveMinionLivenessProbeTiming,\n MINION_LIVENESS_STARTUP_BUDGET_SEC,\n type MinionLiveness,\n ApplicationRuntimePrincipalKind,\n type ApplicationRuntimePrincipal,\n resolveRuntimeComposeNetworks,\n resolveApplicationDatabaseEngine,\n type DatabaseEngine,\n EnvironmentServiceProfileOptionalService,\n} from '@wildo-ai/platform-config-lib';\nimport { buildMinionServiceName, buildWorkerServiceName } from '@wildo-ai/platform-core-shared';\nimport { FILE_NAMES, GENERATED_FILE_HEADER } from '~wildo-cli/infrastructure/io/io.schemas';\nimport { DEFAULT_DOCKER_COMPOSE_LOCAL_PROJECT_NAME, resolvePlatformImageRef } from '~wildo-cli/services/environment/platform-runtime.schemas';\nimport { readVersion } from '~wildo-cli/kernel/bootstrap';\nimport { ServiceAddressResolver, AddressPerspective } from '~wildo-cli/services/catalog/service-address-resolver.service';\nimport { PLATFORM_INIT_MEMORY, PLATFORM_SERVICE_CATALOG, type PlatformServiceMemoryProfile } from '~wildo-cli/services/catalog/service-catalog.schemas';\nimport { PlatformEnvVarsBuilder } from '~wildo-cli/services/environment/env-vars-builder.service';\nimport { loadInfraHydratedConfig } from '~wildo-cli/services/environment/env-configuration-generator.service';\nimport { SecretsReader } from '~wildo-cli/services/credentials/secrets-reader.service';\nimport { IMMUDB_AUDIT_STATE_LOCAL_DATA_DIR, MONGOT_SYNC_SOURCE } from '~wildo-cli/services/data-services/data-services.schemas';\nimport { PLATFORM_KEY_VAULT_SERVER, renderPlatformKeyVaultServerConfig } from '~wildo-cli/services/data-services/platform-key-vault.server-config';\nimport { TemplateProcessor } from '~wildo-cli/infrastructure/io/template-processor';\nimport type { ApplicationMinionEnvTarget, ApplicationWorkerEnvTarget } from '~wildo-cli/services/environment/env-configuration-generator.service';\nimport { buildContainerisedMinionEnvironment, buildContainerisedWorkerEnvironment, resolveRuntimeTargetAppSlug } from '~wildo-cli/services/deployment/application-runtime-environment';\n\n/**\n * Local-data subdir + filename for the immudb state-signing PRIVATE key materialized for the\n * self-hosted compose immudb container. Kept OUT of the `immudb/` data volume (which is the\n * store the key protects) so a data wipe never removes the signing key.\n */\nconst IMMUDB_SIGNING_KEY_DIR = 'immudb-signing';\nconst IMMUDB_SIGNING_KEY_FILENAME = 'state-signing.key';\n\n/**\n * Issue #74 — local-data subdir + filename for the `mongot` sync-source password file.\n *\n * Same shape and same reasoning as the immudb signing key above: kept OUT of both the\n * `mongodb/` and `mongot/` data directories so a data wipe never removes it, and mounted as a\n * FILE because mongot reads a path (`syncSource.replicaSet.scramAuth.passwordFile`) and never\n * an environment variable.\n *\n * The MODE differs from immudb's, and that difference is not cosmetic: immudb's key is written\n * `0644` because its container UID differs from the host owner, while mongot REFUSES to start on\n * anything more permissive than `0400` (`Secret file … permissions are too permissive (must only\n * be readable by owner)`, exit 1). mongot's image runs as root, so root reads the file whatever\n * the bind mount reports as its owner — measured 2026-08-27 with a host-owned `0400` file and a\n * `mongodb/mongodb-community-search:1.70.3` container that read it and reached `SERVING`.\n */\nconst MONGOT_PASSWORD_DIR = 'mongot-auth';\nconst MONGOT_PASSWORD_FILENAME = 'sync-source.password';\n\n/**\n * Slice 4.8 — ClamAV self-deploy gating.\n *\n * Returns `true` when the env author declared\n * `backingServices.clamav: { source: SELF }` in\n * `wildo.infra.<env>.config.ts` — i.e. they opted into the local\n * `clamav/clamav:1.4` container instead of pointing at an external\n * MANAGED clamd. Returns `false` for MANAGED / external sources or\n * when the entry is omitted entirely.\n *\n * Single source of truth consumed by:\n * - {@link renderDockerComposeTemplate}'s `includeLocalClamAV`\n * context value (drives the `{{#if includeLocalClamAV}}` block in\n * `docker-compose.wildo-platform.yml.hbs`).\n * - {@link getDockerComposeLocalDataServices} (decides whether\n * `local_data/clamav/` must be pre-created / wiped).\n *\n * The RULE itself moved out on 2026-09-09: both lanes now ask\n * `EnvironmentLifecycle.selfHostsBackingService(env, kind)`, which is total over\n * `BackingServiceKind`, so Compose ⇄ K8s parity is structural rather than two\n * predicates that happen to agree — and a kind added to the vocabulary cannot\n * reach either lane without someone deciding what an omitted declaration means\n * for it. This function survives as the NAME the compose lane's context value and\n * local-data list read it by; it is no longer where the rule lives.\n *\n * That predicate reads `env.backingServices` (the in-memory authored snapshot)\n * rather than `loadConfigJson`, which keeps every caller here synchronous and\n * matches the pattern used by {@link resolveInfraHostPort} below.\n */\nfunction resolveIncludeLocalClamAV(env: PlatformEnvironmentConfiguration): boolean {\n return selfHostsServiceAllowedByProfile(env, BackingServiceKind.CLAMAV, EnvironmentServiceProfileOptionalService.ANTIVIRUS_SCANNER);\n}\n\n/**\n * #2303 — whether this environment self-hosts an OPTIONAL backing service, REFUSING a declaration its service profile\n * contradicts. The rule lives in `selfHostsOptionalServiceAllowedByProfile`, which the Kubernetes lane asks too.\n */\nfunction selfHostsServiceAllowedByProfile(\n env: PlatformEnvironmentConfiguration,\n kind: BackingServiceKind.CLAMAV | BackingServiceKind.IMMUDB,\n service: EnvironmentServiceProfileOptionalService,\n): boolean {\n return selfHostsOptionalServiceAllowedByProfile(env, kind, service);\n}\n\n/**\n * #2303 — whether the `mongot` search sidecar belongs in this environment: it is an attachment to a self-hosted\n * mongod, and the service profile may omit it. The ONE gate both the local-data list and the render read, so the\n * profile cannot remove the service while leaving its data directory or volume behind (or the reverse).\n *\n * Omitting it removes the whole mongot surface — the service, mongod's `mongotHost` routing parameters, the\n * `searchCoordinator` user and the config entry — because every one of them sits under the template's\n * `{{#if mongotPasswordHostPath}}` guard, which the render leaves undefined here. A MongoDB-persisted\n * `.ragSource()` resource is then refused at the application's boot, naming the profile.\n */\nfunction resolveIncludeMongotSidecar(env: PlatformEnvironmentConfiguration): boolean {\n return includesMongoSearchSidecar(env);\n}\n\n/**\n * Cache / broker / object-storage self-deploy gating.\n *\n * These three were the only services in the template with NO gate at all: `valkey`, `rabbitmq`,\n * `minio` (+ its `minio-init` bucket step) were rendered for every environment, so an operator who\n * declared `redis: { source: MANAGED }` got a managed cache AND a local Valkey container beside it.\n *\n * They gate on {@link EnvironmentLifecycle.selfHostsBackingService}, which for these three kinds\n * reads `source !== MANAGED` rather than `source === SELF` — read that JSDoc before \"tightening\"\n * it. An UNDECLARED entry keeps the container, exactly as today, because the platform cannot boot\n * without a cache, a broker and an object store and an omitted key must not silently remove one.\n */\nfunction resolveIncludeLocalValkey(env: PlatformEnvironmentConfiguration): boolean {\n return EnvironmentUtils.selfHostsBackingService(env, BackingServiceKind.REDIS);\n}\n\n/** @see resolveIncludeLocalValkey — same rule, RabbitMQ's declaration. */\nfunction resolveIncludeLocalRabbitMQ(env: PlatformEnvironmentConfiguration): boolean {\n return EnvironmentUtils.selfHostsBackingService(env, BackingServiceKind.RABBITMQ);\n}\n\n/** @see resolveIncludeLocalValkey — same rule, the `s3` declaration (MinIO is its self-hosted brand). */\nfunction resolveIncludeLocalMinIO(env: PlatformEnvironmentConfiguration): boolean {\n return EnvironmentUtils.selfHostsBackingService(env, BackingServiceKind.S3);\n}\n\n/**\n * Audit Phase 2 — immudb self-deploy gating. Emits the local `immudb` container\n * (tamper-evident audit-log store) only when `backingServices.immudb.source ===\n * SELF`; a MANAGED immudb (Vault) is an external endpoint. Mirrors\n * {@link resolveIncludeLocalClamAV}.\n */\nfunction resolveIncludeLocalImmudb(env: PlatformEnvironmentConfiguration): boolean {\n return selfHostsServiceAllowedByProfile(env, BackingServiceKind.IMMUDB, EnvironmentServiceProfileOptionalService.IMMUTABLE_AUDIT_STORE);\n}\n\n/**\n * #2933 — the self-hosted OpenBao holding the platform's custodied keys, when `platformKeyManagement.vault.source ===\n * SELF`. The same predicate the Kubernetes lane deploys it on.\n */\nfunction resolveIncludeLocalPlatformKeyVault(env: PlatformEnvironmentConfiguration): boolean {\n return selfHostsPlatformKeyVault(env.platformKeyManagement);\n}\n\n/** What the two apps-manager services (INIT and serving) render for a vendor PKCS#11 client (#3019). */\nexport interface PlatformPkcs11ComposeContext {\n /** Each a read-only bind mount; source and target are YAML double-quoted scalars, compose-interpolation escaped. */\n clientFiles: Array<{ hostPathYaml: string; containerPathYaml: string }>;\n /** The vendor's own variables; `valueYaml` is a YAML double-quoted scalar, compose-interpolation escaped. */\n environment: Array<{ name: string; valueYaml: string }>;\n}\n\n/**\n * #3019 — the vendor PKCS#11 client a containerised apps-manager needs, or `undefined` when the platform is not\n * containerised here (a framework developer's apps-manager runs natively and loads its module from the host) or the\n * environment declares no `pkcs11` token.\n *\n * A module apps-manager cannot reach inside the platform image is REFUSED here rather than rendered: the token would fail\n * to open at boot and every signature on the provider would be refused, from a container whose compose file names no\n * cause. The schema refuses the same thing at load whenever `clientFiles` is declared; this is the half it cannot decide,\n * a host `modulePath` with no mounts, which is legal for the native lane and not for this one.\n *\n * Values are JSON-quoted (a JSON string is a YAML double-quoted scalar) after doubling every `$`, compose's only escape:\n * a vendor path or setting carrying `$` would otherwise be interpolated from the shell that runs `compose up`.\n */\nexport function buildPlatformPkcs11ComposeContext(\n env: PlatformEnvironmentConfiguration,\n includePlatformServices: boolean,\n): PlatformPkcs11ComposeContext | undefined {\n const pkcs11 = env.platformKeyManagement?.pkcs11;\n if (!includePlatformServices || !pkcs11) return undefined;\n if (!pkcs11ModuleIsReachableInPlatformContainer(pkcs11)) throw new Error(describeUnreachablePkcs11Module(pkcs11, env.name));\n const yaml = (value: string): string => JSON.stringify(escapeComposeInterpolation(value));\n return {\n clientFiles: (pkcs11.clientFiles ?? []).map((file) => ({ hostPathYaml: yaml(file.hostPath), containerPathYaml: yaml(file.containerPath) })),\n environment: Object.entries(pkcs11.environment ?? {}).map(([name, value]) => ({ name, valueYaml: yaml(value) })),\n };\n}\n\n/**\n * Pre-create the host directories the rendered compose file will bind-mount.\n *\n * NO-OP in `DOCKER_VOLUME` mode, and that is the point rather than an optimization: the whole\n * reason this function exists is that Docker creates a MISSING bind source as a ROOT-OWNED\n * directory the container's UID then cannot write to. A named volume has no host source, so there\n * is nothing to pre-create — and creating `local_data/<service>/` anyway would leave empty\n * directories that look like data and that `wildo local doctor` would later report as leftovers.\n *\n * The infrastructure-host assertion runs FIRST, before the mode is consulted: whether this\n * environment may converge backing services at all is a question about ownership, and it must be\n * answered the same way under both storage modes.\n *\n * Slice 4 (4.3): resolves saasRoot from the registry, so every CLI seam that runs `docker compose up`\n * against the platform-local compose file shares the SAME pre-up step (single source of truth, D5).\n * Call sites: `LocalUpCommand.runDockerCompose`, `LocalAppReinitService.startEnvironment`, and\n * `dev/start.command.ts` (`startDockerInfra` and its \"infra already running\" branch). (`LocalUpCommand.restartDockerCompose`,\n * the `local up --rebuild` restart, was one until #2988 removed it.) Throws when no SaaS root can be\n * resolved, which keeps the failure loud at the call site.\n */\nexport function ensureLocalDataServiceDirsForComposeRender(\n env: PlatformEnvironmentConfiguration,\n): void {\n InfrastructureHost.assertOwnsSharedInfrastructure(env, SharedInfrastructureAction.CONVERGE_BACKING_SERVICES);\n if (usesDockerVolumeLocalData(env)) return;\n const saasRoot = EnvironmentRegistry.getSaasRoot();\n if (!saasRoot) {\n throw new Error(\n 'Cannot pre-create local_data subdirs: no targeted SaaS app root detected.',\n );\n }\n const services = getDockerComposeLocalDataServices(env);\n EnvironmentPaths.ensureLocalDataServiceDirs(saasRoot, services);\n}\n\n/**\n * Slice 4 (4.4) — wipe wrapper for `wildo local reset`.\n *\n * Counterpart of {@link ensureLocalDataServiceDirsForComposeRender}. Resolves\n * the SaaS root and the same per-env service list that compose actually\n * rendered, then calls {@link EnvironmentPaths.wipeLocalDataServiceDirs}\n * fail-closed — so a stale on-host PG datadir or Mongo journal cannot\n * silently survive a reset and corrupt the next `wildo local up`.\n *\n * Caller MUST invoke this AFTER `docker compose down -v` so no container\n * still holds the bind-mount target open.\n */\nexport function wipeLocalDataServiceDirsForCompose(\n env: PlatformEnvironmentConfiguration,\n): void {\n InfrastructureHost.assertOwnsSharedInfrastructure(env, SharedInfrastructureAction.WIPE_BACKING_SERVICE_DATA);\n const saasRoot = EnvironmentRegistry.getSaasRoot();\n if (!saasRoot) {\n throw new Error(\n 'Cannot wipe local_data subdirs: no targeted SaaS app root detected.',\n );\n }\n // The immudb audit trust anchor goes with the ledger it anchors, and only then: a reset leaves a managed immudb's\n // ledger in place, so its anchor must stay too (see `IMMUDB_AUDIT_STATE_LOCAL_DATA_DIR`).\n const services = [\n ...getDockerComposeLocalDataServices(env),\n ...(resolveIncludeLocalImmudb(env) ? [IMMUDB_AUDIT_STATE_LOCAL_DATA_DIR] : []),\n ];\n EnvironmentPaths.wipeLocalDataServiceDirs(saasRoot, services);\n}\n\n/**\n * Remove this environment's backing-service data VOLUMES.\n *\n * Unconditional, not gated on the current mode, and that asymmetry with\n * {@link ensureLocalDataServiceDirsForComposeRender} is deliberate: `reset` means \"leave nothing\n * behind\", and an environment that ran under `DOCKER_VOLUME` and was then re-authored to\n * `HOST_PATH` still has those volumes. Gating the wipe on the CURRENT mode would strand exactly\n * the data a reset was asked to destroy, and volumes are the half with no visible directory to\n * notice it in. Its sibling `wipeLocalDataServiceDirsForCompose` is likewise unconditional, so\n * `reset` clears both halves whichever way the environment is authored — and the Kind k8s lane\n * shares the host tree, so that half must be cleared regardless.\n *\n * Tolerant of an absent volume (`docker volume rm` on a name nothing created is not a failure:\n * absence is the state being asked for), fail-CLOSED on anything else, matching the host wipe's\n * D6 contract. A volume still held by a container reports `volume is in use` and throws here,\n * which is the loud version of the caller having skipped `docker compose down`.\n *\n * Caller MUST invoke this AFTER `docker compose down` so nothing still holds the volumes.\n */\nexport function wipeLocalDataVolumesForCompose(\n env: PlatformEnvironmentConfiguration,\n): void {\n InfrastructureHost.assertOwnsSharedInfrastructure(env, SharedInfrastructureAction.WIPE_BACKING_SERVICE_DATA);\n const saasRoot = EnvironmentRegistry.getSaasRoot();\n if (!saasRoot) {\n throw new Error(\n 'Cannot remove backing-service data volumes: no targeted SaaS app root detected.',\n );\n }\n const names = listLocalDataVolumeMounts(saasRoot, getDockerComposeLocalDataServices(env)).map((mount) => mount.volumeName);\n if (names.length === 0) return;\n\n const failures: string[] = [];\n for (const name of names) {\n const result = DockerUtils.removeVolume(name);\n if (!result.success) failures.push(`${name}: ${result.error ?? 'unknown error'}`);\n }\n if (failures.length > 0) {\n throw new Error(\n `Failed to remove ${failures.length} backing-service data volume(s):\\n - ${failures.join('\\n - ')}`,\n );\n }\n}\n\n/**\n * The ONE place `localDataStorage` is read.\n *\n * `PlatformEnvironmentConfiguration.localDataStorage` is optional because environment records are\n * built at many sites (hydration from the authored config, the registry cache, test fixtures), and\n * a site that does not yet mirror the field must not produce `undefined`. In a Handlebars boolean\n * context `undefined` is falsy, so an unmirrored environment would silently render the REMOTE\n * bind-mount shape onto a developer's machine — the exact configuration this mechanism exists to\n * stop. Falling back to the derivation keyed on `locationType` makes that case correct instead.\n *\n * Read through this function; never off the field.\n */\nexport function resolveLocalDataStorage(\n env: PlatformEnvironmentConfiguration,\n): WildoLocalDataStorage {\n return env.localDataStorage ?? resolveDefaultLocalDataStorage(env.locationType);\n}\n\n/**\n * True when this environment's backing-service DATA lives in Docker named volumes rather than on\n * the host filesystem. Drives the compose template's per-service mount shape and the top-level\n * `volumes:` block, and tells the `up` / `reset` lifecycle whether there are host directories to\n * create and wipe at all.\n */\nexport function usesDockerVolumeLocalData(\n env: PlatformEnvironmentConfiguration,\n): boolean {\n return resolveLocalDataStorage(env) === WildoLocalDataStorage.DOCKER_VOLUME;\n}\n\n/**\n * The compose template's `platformServiceMemory` context: each platform block's `mem_limit` and V8\n * heap ceiling, from the MEASURED profiles in the service catalog (#1592). Keyed by the names the\n * template uses; INIT runs the apps-manager binary, so it takes apps-manager's profile. Exported so a\n * test can hold every key the template references to a catalog entry — the template engine renders a\n * missing value as an empty string, which would produce `mem_limit: m` without an error anywhere.\n */\nexport function buildPlatformServiceMemoryContext(): Record<\n 'init' | 'appsManager' | 'crontabsBatchesManager' | 'moduleRegistry',\n PlatformServiceMemoryProfile\n> {\n return {\n init: PLATFORM_INIT_MEMORY,\n appsManager: PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].memory,\n crontabsBatchesManager: PLATFORM_SERVICE_CATALOG[PlatformWildoServices.CRONTABS_BATCHES_MANAGER].memory,\n moduleRegistry: PLATFORM_SERVICE_CATALOG[PlatformWildoServices.MODULE_REGISTRY].memory,\n };\n}\n\n/**\n * Compose volume name for one backing service's data, e.g.\n * `wildo-local-data-wonder-todos-3f2a9b1c-postgresql`.\n *\n * ## Why the name is scoped to the APPLICATION, and why that is not optional\n *\n * Every application keeps its own backing-service data: `local_data` lives under the application's\n * own SaaS root, so Wonder Todos and Wonder CRM each have their own Postgres datadir, their own\n * Mongo journal, and so on. Only one platform stack runs on a machine at a time — the container\n * names are fixed (`wildo-postgresql`, …) and the compose project name is the constant\n * `wildo-local` for every application — so the stacks ALTERNATE, each bringing its own data.\n *\n * A volume named for the service alone would therefore MERGE what is today separate: bring one\n * application's stack up, then the other's, and both would mount one `wildo-local-data-postgresql`.\n * Nothing would fail; two applications' databases would simply become one. Scoping the name to the\n * SaaS root reproduces the separation the host-path layout already has, so switching storage mode\n * changes performance and nothing else.\n *\n * The scope is `<basename>-<8 hex of the SaaS root>`: the basename so `docker volume ls` is\n * readable, the digest so two applications whose directories share a name cannot collide. Derived\n * from the SaaS ROOT rather than from `saasConfig.slug` because the slug needs the SaaS config\n * loaded, which framework-developer mode deliberately skips — and a naming scheme that is\n * unavailable in the mode this monorepo runs in is not a naming scheme.\n *\n * Named EXPLICITLY (a `name:` in the `volumes:` block) rather than left to compose's\n * `<project>_<key>` derivation, which would prefix the constant `wildo-local` and separate nothing.\n */\nexport function buildLocalDataVolumeName(saasRoot: string, service: string): string {\n return `${LOCAL_DATA_VOLUME_PREFIX}${buildLocalDataVolumeScope(saasRoot)}-${service}`;\n}\n\n/**\n * The per-application segment of every data-volume name. Stable for a given SaaS root, and a legal\n * Docker volume-name fragment (`[a-zA-Z0-9][a-zA-Z0-9_.-]*`) for any path.\n */\nexport function buildLocalDataVolumeScope(saasRoot: string): string {\n const digest = createHash('sha256').update(saasRoot).digest('hex').slice(0, 8);\n const readable = basename(saasRoot).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');\n return readable.length > 0 ? `${readable}-${digest}` : digest;\n}\n\nconst LOCAL_DATA_VOLUME_PREFIX = 'wildo-local-data-';\n\n/**\n * Every DATA mount the platform compose template emits, as `<template key> → <service, child?>`.\n *\n * This table is the single source of truth for two things that must not drift apart: the mount\n * SOURCE each service gets (a host path or a volume name), and the set of named volumes the\n * top-level `volumes:` block declares. Deriving both from one table is what makes a compose file\n * that mounts a volume it never declared unrepresentable — the failure mode a hand-kept second\n * list produces, and the one compose reports only at `up` time.\n *\n * `child` mirrors the image's own declared `VOLUME`s. `mongo` declares BOTH `/data/db` and\n * `/data/configdb`, so each needs its own mount source; giving it one mount at `/data` leaves the\n * other child to an anonymous volume that survives `down` and is never wiped. Every other image\n * here declares at most one, so it has no child.\n *\n * Keys are what the template interpolates (`{{localDataSources.mongodbDb}}`), so a key renamed\n * here without the template is a mount that renders empty — covered by the render test that asserts\n * no `{{` survives and that every emitted volume is declared.\n */\nconst LOCAL_DATA_MOUNTS: readonly { key: string; service: string; child?: string }[] = [\n { key: 'mongodbDb', service: 'mongodb', child: 'db' },\n { key: 'mongodbConfigdb', service: 'mongodb', child: 'configdb' },\n { key: 'mongot', service: 'mongot' },\n { key: 'valkey', service: 'valkey' },\n { key: 'rabbitmq', service: 'rabbitmq' },\n { key: 'minio', service: 'minio' },\n { key: 'postgresql', service: 'postgresql' },\n { key: 'clamav', service: 'clamav' },\n { key: 'immudb', service: 'immudb' },\n { key: 'openbao', service: 'openbao' },\n];\n\n/** The named volume one data mount reads from. `mongodb` has two (`-db`, `-configdb`); every other service has one. */\nfunction localDataMountVolumeName(saasRoot: string, mount: { service: string; child?: string }): string {\n return buildLocalDataVolumeName(saasRoot, mount.child ? `${mount.service}-${mount.child}` : mount.service);\n}\n\n/** One data mount the compose file emits in `DOCKER_VOLUME` mode: which service, which image child, which volume. */\nexport interface LocalDataVolumeMount {\n readonly service: string;\n /** The image's declared data child (`db` / `configdb` for mongod), absent when the service has one data directory. */\n readonly child?: string;\n readonly volumeName: string;\n}\n\n/**\n * Every data mount, with its volume name, for the given emitted services — the one derivation the\n * wipe, the `volumes:` declarations and host-data adoption all read.\n *\n * It exists because the adoption step derived its volume name by hand from the SERVICE alone, while\n * compose mounts mongod as TWO volumes (`<scope>-mongodb-db`, `<scope>-mongodb-configdb`). On\n * 2026-09-22 `up --adopt-host-data` therefore copied the whole `local_data/mongodb/` tree into\n * `<scope>-mongodb`, a volume nothing mounts, and mongod started on an empty database while its data\n * sat in the orphan. Three sites spelled the name correctly and the fourth did not; one function\n * removes the fourth spelling.\n */\nexport function listLocalDataVolumeMounts(saasRoot: string, services: Iterable<string>): readonly LocalDataVolumeMount[] {\n const emitted = new Set(services);\n return LOCAL_DATA_MOUNTS\n .filter((mount) => emitted.has(mount.service))\n .map((mount) => ({\n service: mount.service,\n ...(mount.child ? { child: mount.child } : {}),\n volumeName: localDataMountVolumeName(saasRoot, mount),\n }));\n}\n\n/**\n * Resolve each data mount's SOURCE for the rendered compose file.\n *\n * In `DOCKER_VOLUME` mode a source is a named volume, which compose resolves against the\n * `volumes:` block; in `HOST_PATH` mode it is the absolute host directory, unchanged from what this\n * template has emitted since the Slice 4 cutover. Returning a plain map keeps every mount in the\n * template a single uniform line instead of nine conditionals — the mount shape is one decision,\n * taken here, not nine decisions repeated in markup.\n */\nexport function buildLocalDataMountSources(\n env: PlatformEnvironmentConfiguration,\n saasRoot: string,\n localDataPath: string,\n): Record<string, string> {\n const useVolumes = usesDockerVolumeLocalData(env);\n const sources: Record<string, string> = {};\n for (const mount of LOCAL_DATA_MOUNTS) {\n /*\n * Concatenated with a literal `/` rather than joined through `path`, because `localDataPath` is\n * the HOST's absolute path and on Windows that is `C:\\\\Users\\\\…`. `path.posix.join` would\n * normalize it and `path.win32.join` would emit backslashes the compose parser reads as\n * escapes; string concatenation reproduces byte-for-byte what this template has emitted since\n * the Slice 4 cutover, which Docker Desktop for Windows accepts today.\n */\n sources[mount.key] = useVolumes\n ? localDataMountVolumeName(saasRoot, mount)\n : `${localDataPath}/${mount.service}${mount.child ? `/${mount.child}` : ''}`;\n }\n return sources;\n}\n\n/**\n * The named volumes this env's compose file must DECLARE — derived from the same table as the\n * mount sources, and narrowed to the services the template actually emits.\n *\n * Empty in `HOST_PATH` mode, which is what drops the whole `volumes:` block: compose rejects an\n * empty mapping, and a block declaring volumes no service mounts would leave `docker volume ls`\n * carrying entries nothing explains.\n *\n * ## Why `mongot` needs its own gate\n *\n * `getDockerComposeLocalDataServices` is the DIRECTORY list, and it includes `mongot` whenever\n * mongod is self-hosted. The template is stricter: it renders the mongot service only under\n * `{{#if mongotPasswordHostPath}}`, because without the sync-source password materialized from\n * `secrets.json` a mongot cannot authenticate, and a half-wired one mongod routes `$vectorSearch`\n * to is worse than none.\n *\n * That difference is invisible in `HOST_PATH` mode — the cost is an empty directory — and becomes\n * visible in `DOCKER_VOLUME` mode, where `docker compose up` CREATES every declared volume, so the\n * looser list leaves an orphan in `docker volume ls` that nothing mounts and nothing explains.\n * Rather than widen the directory list (it is deliberately defensive: the password may be minted\n * between a render and the next `up`), the caller passes the gate the template itself uses.\n */\nexport function buildLocalDataVolumeDeclarations(\n env: PlatformEnvironmentConfiguration,\n saasRoot: string,\n renderedServices: { mongot: boolean; openbao: boolean },\n): readonly { name: string }[] {\n if (!usesDockerVolumeLocalData(env)) return [];\n const emitted = new Set(getDockerComposeLocalDataServices(env));\n if (!renderedServices.mongot) emitted.delete('mongot');\n // Same shape as mongot: the OpenBao service renders only once its unseal key and token ids are provisioned.\n if (!renderedServices.openbao) emitted.delete('openbao');\n return listLocalDataVolumeMounts(saasRoot, emitted).map((mount) => ({ name: mount.volumeName }));\n}\n\n/**\n * Slice 4 (4.3) — single source of truth for which infra services the\n * generated compose file actually renders for a given env.\n *\n * MUST stay in lockstep with the `{{#if include*}}` guards in\n * `docker-compose.wildo-platform.yml.hbs`. Returns the short container-name\n * list (the same tokens used as `local_data/<service>/` subdir names and\n * as the K8s PV `hostPath` `/mnt/local-data/<service>/` segment).\n *\n * Used by every CLI seam that runs `docker compose up` to pre-create the\n * matching `local_data/<service>/` bind-mount source directories before\n * Docker would otherwise create them root-owned. A divergence between this\n * list and the template's `{{#if}}` guards would silently create\n * permission-denied failures on first up — so callers MUST use this helper,\n * not a hand-written list.\n *\n * Stateless services are intentionally excluded — they have no\n * data mount in the template.\n *\n * This is the DIRECTORY and WIPE list, and it is deliberately looser than what the template\n * renders for one service: `mongot` is included whenever mongod is self-hosted, while the template\n * renders the mongot SERVICE only once its sync-source password is materialized. Pre-creating a\n * directory the password may make live moments later is harmless; DECLARING a volume for a service\n * that does not render is not, because `docker compose up` creates every declared volume. So\n * {@link buildLocalDataVolumeDeclarations} takes the template's own gate as an argument rather than\n * this list being tightened — see its JSDoc.\n */\nexport function getDockerComposeLocalDataServices(\n env: PlatformEnvironmentConfiguration,\n): readonly string[] {\n const services: string[] = [];\n if (EnvironmentUtils.needsLocalMongoDB(env)) {\n services.push('mongodb');\n }\n // Issue #74 — mongot's Lucene index directory. Gated on mongod (it is an attachment to one, not an\n // independently sourced service) and on the service profile (#2303), through the same predicate the\n // render reads. STATEFUL: losing it costs a full re-read of every indexed collection through the\n // change stream, not just a restart.\n if (resolveIncludeMongotSidecar(env)) {\n services.push('mongot');\n }\n // Gated since the managed-selection fix: an env that declares `redis` / `rabbitmq` / `s3` as\n // MANAGED points at somebody else's endpoint and must not also bind-mount `local_data/<svc>/` for\n // a container it does not run. An UNDECLARED kind still lands here — see\n // {@link resolveIncludeLocalValkey} for why absence is not withdrawal.\n if (resolveIncludeLocalValkey(env)) {\n services.push('valkey');\n }\n if (resolveIncludeLocalRabbitMQ(env)) {\n services.push('rabbitmq');\n }\n if (resolveIncludeLocalMinIO(env)) {\n services.push('minio');\n }\n if (EnvironmentUtils.needsLocalPostgreSQL(env)) {\n services.push('postgresql');\n }\n if (resolveIncludeLocalClamAV(env)) {\n services.push('clamav');\n }\n if (resolveIncludeLocalImmudb(env)) {\n services.push('immudb');\n }\n if (resolveIncludeLocalPlatformKeyVault(env)) {\n services.push('openbao');\n }\n return services;\n}\n\n/**\n * MinIO console UI listens on 9001 alongside the API on 9000. The console\n * port is image-defined and not part of the author's `s3` surface — keep it\n * pinned so the generated compose file always exposes the admin UI for\n * local debugging.\n */\nconst MINIO_CONSOLE_PORT = 9001;\n\n/**\n * Resolve the host-side port to publish for an infra container.\n *\n * The container always listens on its image-default port (`internalPort`).\n * The author may override the host-side port to avoid conflicts with other\n * services on their machine; in that case the compose generator emits\n * `${authorPort}:${internalPort}` so that:\n * - tools on the host connect to `localhost:${authorPort}` (matches the\n * `HOST_FACING` perspective from `ServiceAddressResolver`)\n * - other compose containers connect to `${containerName}:${internalPort}`\n * (matches the `CONTAINER_INTERNAL` perspective)\n */\nfunction resolveInfraHostPort(\n env: PlatformEnvironmentConfiguration,\n kind: BackingServiceKind,\n internalPort: number,\n): number {\n const override = env.backingServices?.[kind];\n if (!override || override.source !== BackingServiceSource.SELF) {\n return internalPort;\n }\n return override.port ?? internalPort;\n}\n\n\n// ============================================================================\n// Generate .env.wildo-platform (Docker Compose env file)\n// ============================================================================\n\n/**\n * Encode one `.env.wildo-platform` value for its reader: **Docker Compose's own env-file parser**\n * (compose-go), which is NOT the `dotenv` package that reads the per-service `.env` files.\n *\n * ## The two readers differ on exactly one axis\n *\n * Both expand `\\n` / `\\r` inside double quotes and both accept a quoted value spanning physical\n * lines. They diverge on backslash escapes — verified 2026-08-05 with `docker compose config`, the\n * authoritative resolution step:\n *\n * | reader | `\\n` in `\"…\"` | `\\\"` in `\"…\"` |\n * |------------|---------------|----------------------|\n * | `dotenv` | expands | NOT unescaped (kept literal — the trap `encodeDotenvValue` documents) |\n * | compose-go | expands | unescapes |\n *\n * So compose-go is a FULLY unescaping reader, and the correct encoding here is the ordinary\n * escape-and-quote — the same contract `formatEnvFile` (ci-deploy-generator) already writes for the\n * compose lane. `encodeDotenvValue`'s form-SELECTION exists to dodge a lossiness that only affects\n * dotenv; do not reuse it here, and do not \"fix\" this to match it.\n *\n * ## Why not the previous verbatim-quote\n *\n * This helper used to emit `\"${value}\"` verbatim for multi-line values (reproducing the bytes the\n * old `quoteMultiline` produced). That is lossy the moment a value carries BOTH a newline and a\n * `\"`: the inner quote closes the string early and Compose rejects the whole file with\n * `unexpected character \"\\\"\" in variable name` (reproduced 2026-08-05). No value routed here does\n * that today — PEMs carry no quotes — but it is the same latent writer/reader mismatch that\n * produced this session's two live incidents, so it is closed rather than documented.\n *\n * Builders hand us RAW values by contract (see the value-contract note in\n * `env-vars-builder.service.ts`), so encoding happens exactly once, here.\n *\n * Two raw readers of `.env.wildo-platform` decode none of this (`platform-e2e-runner`'s `platform-target.ts` and\n * `engine-behavior-e2e`'s `ci-rebootstrap.lifecycle.ts`): they strip one layer of quotes and keep escapes, so a value\n * with `\\\\`, `\"`, a newline or (since #2955) a `$` reads back escaped there. Every generated credential avoids all\n * four; only an operator-written value can carry one.\n */\nexport function encodeComposeEnvValue(value: string): string {\n if (!/[\\s=#\"'\\\\$]|\\n/.test(value) && value !== '') return value;\n // `$` is doubled: compose-go INTERPOLATES env-file values, unquoted and double-quoted alike, so `x$HOME` would arrive\n // as `x/Users/…`. Measured 2026-11-06 with compose v5.5.1 (`docker compose config`), for an `env_file:` and for an\n // `--env-file` read: `\"a$$HOME-b\"` reads as the literal `a$HOME-b` in both (#2955).\n return `\"${value.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/\\r/g, '\\\\r').replace(/\\n/g, '\\\\n').replace(/\\$/g, '$$$$')}\"`;\n}\n\n/**\n * Generate `.env.wildo-platform` and write it when its content differs from what is on disk.\n *\n * Returns whether the file was written. Generating it is cheap and a pure function of its inputs (`secrets.json`, the\n * hydrated `config.json`, the environment record, the framework mode), so `wildo local up` / `wildo local dev`\n * generate it on EVERY start and let the content comparison decide (#2311). Writing only on a difference is what\n * makes that safe: an unchanged file keeps its bytes and its mtime, so nothing downstream sees a change that did not\n * happen.\n */\nexport function generateEnvWildoPlatform(\n env: PlatformEnvironmentConfiguration,\n isFrameworkDeveloper: boolean,\n credentials: PlatformEnvSecretsJson,\n): boolean {\n InfrastructureHost.assertOwnsSharedInfrastructure(env, SharedInfrastructureAction.WRITE_PLATFORM_ENV);\n // Single load+hydrate seam — the platform env this generator emits for a REMOTE compose deploy\n // must carry the infra posture (OTEL_*/LOG_LEVEL/provider-selection) the setup config.json omits.\n const config = loadInfraHydratedConfig(env);\n\n const composeDir = EnvironmentUtils.resolveDockerComposeDir(env.name);\n if (!existsSync(composeDir)) {\n mkdirSync(composeDir, { recursive: true });\n }\n\n const infraEnv = PlatformEnvVarsBuilder.buildInfraCredentialEnv(credentials, config, env);\n\n const lines: string[] = [\n GENERATED_FILE_HEADER,\n '',\n '# === Infra service credentials ===',\n ];\n\n for (const [key, value] of Object.entries(infraEnv)) {\n lines.push(`${key}=${encodeComposeEnvValue(value)}`);\n }\n\n if (!isFrameworkDeveloper) {\n const addressCtx = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.CONTAINER_INTERNAL);\n const addresses = ServiceAddressResolver.resolve(addressCtx);\n const platformEnv = PlatformEnvVarsBuilder.buildAppsManagerFullEnv(\n credentials, addresses, config, env,\n );\n\n lines.push('');\n lines.push('# === Platform service env vars ===');\n\n for (const [key, value] of Object.entries(platformEnv)) {\n if (!(key in infraEnv)) {\n lines.push(`${key}=${encodeComposeEnvValue(value)}`);\n }\n }\n }\n\n return writeFileWhenContentDiffers(join(composeDir, FILE_NAMES.ENV_WILDO_PLATFORM), lines.join('\\n') + '\\n');\n}\n\n/**\n * Write `content` to `path` unless the file already holds exactly those bytes. Returns whether it wrote.\n *\n * The two compose artifacts are re-derived on every `wildo local up` / `wildo local dev` (#2311), so this comparison\n * IS their currency check: it is total over every input of the render (`config.json`, `secrets.json`, the framework\n * templates, the application's configuration), because it compares what those inputs produce rather than listing them.\n */\nfunction writeFileWhenContentDiffers(path: string, content: string, mode?: number): boolean {\n if (existsSync(path) && readFileSync(path, 'utf8') === content) return false;\n writeFileSync(path, content, mode === undefined ? undefined : { mode });\n return true;\n}\n\n// ============================================================================\n// Render Docker Compose template (Handlebars)\n// ============================================================================\n\n/**\n * Step 6 — compose entry shapes for the per-app minion / worker\n * services. Each service builds from the **wildo-ai monorepo root**\n * (Q1 (B) decision 2026-05-06) so the package's Dockerfile can resolve\n * file:-injected `@wildo-ai/*` engine deps + the nested Wonder Todos\n * workspace lockfile in one go (mirrors `examples/wonder-todos/frontend/Dockerfile`'s\n * established pattern). The Dockerfile path is therefore relative to\n * the framework root, not to the package itself.\n *\n * Env-files mount the Step 5b `.wildo-providers.env`; the platform's\n * `.env.wildo-platform` is loaded separately via `docker compose --env-file`\n * (see `docker.service.ts`) so we deliberately do NOT mount it again\n * via `env_file:` here.\n *\n * Both shapes are emitted under the compose `app-runtimes` profile so\n * `wildo local up` defaults to the platform-only flow and operators\n * opt-in to running app runtimes locally with\n * `docker compose --profile app-runtimes up` (or a future\n * `--include-app-runtimes` flag on `wildo local up`).\n */\nexport interface DockerComposeAppMinionEntry {\n /** Compose service name — `<saasSlug>-minion-<dnsName>` (bucket key RFC1123-normalized via `buildMinionServiceName`). */\n serviceName: string;\n /** Container name pinned for log-tailing convenience. */\n containerName: string;\n /** Absolute build context (the wildo-ai monorepo root). */\n buildContext: string;\n /** POSIX-relative Dockerfile path (from `buildContext` → the minion package's Dockerfile). */\n dockerfile: string;\n /** Per-package provider env-file path (Step 5b emission). */\n providerEnvFile: string;\n /**\n * This minion's OWN environment ({@link composeRuntimeEnvFilePath}), written by\n * {@link writeComposeRuntimeEnvFiles} from the derivation the Kubernetes lane mounts as the runtime's Secret (#2955):\n * its identity, its own principal secret, and its scoped topology. Mounted as an `env_file:`, so the template\n * names no identity or secret of its own.\n */\n runtimeEnvFile: string;\n /** Bucket key from `wildo.saas.config.ts > minions`. */\n minionKey: string;\n /** Display name from the per-folder config. */\n displayName: string;\n /**\n * `user:` — `<uid>:<gid>` from the authored `isolation`, mirroring the k8s\n * pod `runAsUser`/`runAsGroup`.\n */\n runAsUser: string;\n /**\n * The SAME uid/gid as {@link runAsUser}, kept as separate numbers because each\n * `tmpfs:` entry must carry `uid=`/`gid=` options — docker mounts a tmpfs\n * root-owned 0755, so a non-root container cannot write it. Two fields rather\n * than parsing the combined string back apart in the template.\n */\n runAsUserId: number;\n runAsGroupId: number;\n /**\n * Every writable tmpfs path: the mandatory `/tmp` first, then authored\n * additions. Compose gets `tmpfs:` where k8s gets `emptyDir` volumes; the\n * pairing with `read_only: true` is identical and equally load-bearing (the\n * liveness heartbeat file lives under `/tmp`).\n */\n writablePaths: readonly string[];\n /** `pids_limit` — fork-bomb ceiling, mirroring the k8s value. */\n pidsLimit: number;\n /**\n * The heartbeat env the minion runtime writes its liveness file from (#1859) — the same\n * `buildMinionLivenessHeartbeatEnv` the k8s Deployment stamps. Each value is a JSON string with `$`\n * already doubled, so it is a valid YAML scalar compose will not interpolate. Empty for `kind: exec`.\n */\n livenessHeartbeatEnv: ReadonlyArray<{ name: string; valueYaml: string }>;\n /** The compose `healthcheck`, derived from the same parsed liveness as the k8s probes. */\n livenessHealthcheck: MinionComposeHealthcheck;\n /**\n * The compose networks this minion joins: {@link composeMinionNetworks}, the same derivation the k8s pod labels and the\n * minion's environment read (#1771). It was a hand-written list in the template, which gave every minion MongoDB and\n * object storage whatever it declared, and PostgreSQL never.\n */\n networks: readonly string[];\n}\n\n/**\n * A minion's compose networks (#1771): `resolveRuntimeComposeNetworks`, the derivation its k8s pod labels and its\n * generated environment also read, bounded by the application's store (#3367), plus the host-access bridge (#3382).\n *\n * The bridge is the minion's route to the HOST. In this lane the application backend runs on the host, and the\n * minion's runtime endpoints name it through `host.docker.internal` (`toContainerRuntimeEndpoints`, with\n * {@link COMPOSE_HOST_GATEWAY_HOSTNAME}).\n * Every segment above is `internal: true`, and an internal network has no gateway: measured 2026-11-06, a container\n * attached only to one fails `host.docker.internal` with `ENETUNREACH`, while one on a user bridge answers. The\n * host-access bridge is the one non-internal network already here, with container-to-container traffic disabled,\n * so it adds the host and no other container. A worker joins it already, to publish its port (#3368).\n *\n * What it costs, stated plainly: a non-internal network restores NAT, so a local compose minion can now reach the\n * internet. Compose cannot express egress restriction at all (the template says so beside every app runtime), and\n * the Kubernetes lane, where egress IS enforced, is unaffected: this is compose-only, like the bridge.\n */\nexport function composeMinionNetworks(\n minionKey: string,\n declaration: { resourceAccess?: { read?: readonly string[]; write?: readonly string[] }; requiresInternetEgress?: boolean },\n applicationDatabaseEngine: DatabaseEngine,\n): string[] {\n return [\n ...resolveRuntimeComposeNetworks(\n { kind: ApplicationRuntimePrincipalKind.MINION, name: minionKey } as ApplicationRuntimePrincipal,\n // Forwarded verbatim, absence included: an absent declaration and an empty one are different statements.\n { resourceAccess: declaration.resourceAccess, requiresInternetEgress: declaration.requiresInternetEgress },\n // A minion serves no HTTP route.\n { servesHttp: false, applicationDatabaseEngine },\n ),\n COMPOSE_HOST_ACCESS_NETWORK,\n ];\n}\n\n/**\n * A minion's compose `healthcheck`, the mirror of its k8s `livenessProbe` + `startupProbe`. Docker REPORTS an\n * unhealthy container and does not restart it (`restart: unless-stopped` acts on exit only), so locally this\n * makes a deaf minion visible in `docker ps` rather than recovering it. It is still declared from the same\n * contract, so a green local healthcheck means exactly what a passing k8s probe means.\n */\nexport interface MinionComposeHealthcheck {\n /** `[\"CMD\", ...argv]` as JSON, with every `$` doubled so compose does not interpolate the shell script. */\n testJson: string;\n intervalSec: number;\n timeoutSec: number;\n retries: number;\n /** The k8s `startupProbe` budget: failures inside it do not count against `retries`. */\n startPeriodSec: number;\n}\n\n/**\n * Compose interpolates `$VAR` and `${VAR}` in every value of the file, `healthcheck.test` included, and `$$`\n * is its only escape. The probe script is full of `$(...)` and `$t`, so an unescaped render would hand docker\n * a script with its variables already substituted by compose — empty — which fails on every run.\n */\nfunction escapeComposeInterpolation(value: string): string {\n return value.replace(/\\$/g, '$$$$');\n}\n\n/** The compose healthcheck and heartbeat env for one parsed minion liveness (#1859). */\nexport function buildMinionComposeLiveness(liveness: MinionLiveness | undefined): Pick<DockerComposeAppMinionEntry, 'livenessHeartbeatEnv' | 'livenessHealthcheck'> {\n const timing = deriveMinionLivenessProbeTiming(liveness);\n return {\n livenessHeartbeatEnv: Object.entries(buildMinionLivenessHeartbeatEnv(liveness)).map(([name, value]) => ({\n name,\n valueYaml: JSON.stringify(escapeComposeInterpolation(value)),\n })),\n livenessHealthcheck: {\n testJson: JSON.stringify(['CMD', ...buildMinionLivenessProbeCommand(liveness)].map(escapeComposeInterpolation)),\n intervalSec: timing.periodSeconds,\n timeoutSec: timing.timeoutSeconds,\n retries: timing.failureThreshold,\n startPeriodSec: MINION_LIVENESS_STARTUP_BUDGET_SEC,\n },\n };\n}\n\nexport interface DockerComposeAppWorkerEntry {\n /** Compose service name — `<saasSlug>-worker-<dnsName>` (bucket key RFC1123-normalized via `buildWorkerServiceName`). */\n serviceName: string;\n /** Container name pinned for log-tailing convenience. */\n containerName: string;\n /** Absolute build context (the wildo-ai monorepo root). */\n buildContext: string;\n /** POSIX-relative Dockerfile path (from `buildContext` → the worker package's Dockerfile). */\n dockerfile: string;\n /** Per-package provider env-file path (Step 5b emission). */\n providerEnvFile: string;\n /** This worker's OWN environment; see {@link DockerComposeAppMinionEntry.runtimeEnvFile} (#2955). */\n runtimeEnvFile: string;\n /** Bucket key from `wildo.saas.config.ts > workers`. */\n workerKey: string;\n /** Display name from the per-folder config. */\n displayName: string;\n /** HTTP port the worker listens on (also the host-side mapping). */\n httpPort: number;\n /** `/healthz` (or operator-overridden) — informational; no compose-side healthcheck is configured. */\n healthPath: string;\n /** `/readyz` (or operator-overridden) — informational; no compose-side readiness probe is configured. */\n readyPath: string;\n /** `user:` — `<uid>:<gid>`, mirroring the k8s pod `runAsUser`/`runAsGroup`. */\n runAsUser: string;\n /** Same values as {@link DockerComposeAppWorkerEntry.runAsUser}, as numbers for the `tmpfs:` `uid=`/`gid=` options. */\n runAsUserId: number;\n runAsGroupId: number;\n /** Writable tmpfs paths: the mandatory one first, then authored additions. */\n writablePaths: readonly string[];\n /** `pids_limit` — fork-bomb ceiling. */\n pidsLimit: number;\n /** The compose networks this worker joins: {@link composeWorkerNetworks} (#3368). */\n networks: readonly string[];\n}\n\n/**\n * The compose PUBLISH bridge: Docker refuses to publish a host port for a container attached only to internal networks,\n * silently. A compose-only mechanism, not a {@link WildoRuntimeNetwork} segment; see the platform compose template.\n */\nconst COMPOSE_HOST_ACCESS_NETWORK = 'wildo-host-access';\n\n/**\n * A worker's compose networks (#3368): `resolveRuntimeComposeNetworks` for a WORKER — the platform segment and the\n * telemetry collector, the membership its k8s pod labels carry — plus the publish bridge, because every compose worker\n * publishes its HTTP port. The hand-written list this replaced gave every worker MongoDB, Redis, RabbitMQ and object\n * storage, none of which it holds a credential or topology for.\n */\nexport function composeWorkerNetworks(workerKey: string, applicationDatabaseEngine: DatabaseEngine): string[] {\n return [\n ...resolveRuntimeComposeNetworks(\n { kind: ApplicationRuntimePrincipalKind.WORKER, name: workerKey } as ApplicationRuntimePrincipal,\n undefined,\n { servesHttp: false, applicationDatabaseEngine },\n ),\n COMPOSE_HOST_ACCESS_NETWORK,\n ];\n}\n\n/**\n * The compose service + container name for a per-app minion/worker. Delegates to\n * the SHARED name builders so the compose service name is RFC1123-normalized and\n * byte-identical to the k8s Service name, the CI-built image ref, and the backend's\n * `WILDO_WORKER_<NAME>_URL` dispatch host (all derived from the same helper). A\n * camelCase bucket key (`marketingScrapper`) therefore resolves the same on the\n * compose network as in k8s (`{slug}-minion-marketing-scrapper`) — the backend\n * dispatch URL host would otherwise never resolve to the raw-key service name. The\n * RAW bucket key stays the runtime IDENTITY (`APP_OWNED_SERVICE_NAME`), carried\n * separately on the compose entry as `workerKey`/`minionKey`.\n */\nfunction deriveAppRuntimeServiceName(saasSlug: string, kind: 'minion' | 'worker', bucketKey: string): string {\n return kind === 'minion'\n ? buildMinionServiceName(saasSlug, bucketKey)\n : buildWorkerServiceName(saasSlug, bucketKey);\n}\n\nfunction deriveAppRuntimeContainerName(saasSlug: string, kind: 'minion' | 'worker', bucketKey: string): string {\n return deriveAppRuntimeServiceName(saasSlug, kind, bucketKey);\n}\n\n/**\n * Resolve the wildo-ai monorepo root from the framework path passed to\n * the renderer. Used as the compose `build.context` so each runtime-host\n * Dockerfile sees the full monorepo (file:-injected engine deps, nested\n * Wonder Todos workspace lockfile, etc.).\n */\nfunction resolveFrameworkRoot(frameworkPath: string): string {\n return resolveFrameworkLayout(frameworkPath).repositoryRoot;\n}\n\n/**\n * POSIX-relative path from the framework root to a package's Dockerfile.\n * Compose's `dockerfile:` field is interpreted relative to `build.context`\n * (the framework root for Step 6), so the path here must be relative\n * AND POSIX-style (Compose normalizes Windows paths but mixed-style is a\n * known footgun on macOS-host / Linux-container builds).\n */\nfunction relativeDockerfilePath(frameworkRoot: string, packageRoot: string): string {\n return posix.join(...relative(frameworkRoot, packageRoot).split(/[/\\\\]/), 'Dockerfile');\n}\n\n/**\n * Build the per-minion compose entries from the loaded saas + minion\n * configs. The provider env-file path is stable across runs (Step 5b\n * emits it on every `wildo config sync`); compose mounts it via\n * `env_file:` so the minion's process env contains the canonical\n * `WILDO_PROVIDER_*` keys at boot.\n */\nfunction buildAppMinionComposeEntries(input: {\n saasRoot: string;\n frameworkRoot: string;\n saasConfig: WildoSaasConfig;\n minionEntries: ReadonlyArray<{ key: string; absolutePath: string; config: WildoMinionConfig }>;\n /** The environment whose compose directory holds each runtime's own env file. */\n environmentName: string;\n /** The application's own store (#3367), which bounds every runtime's database networks. */\n applicationDatabaseEngine: DatabaseEngine;\n}): DockerComposeAppMinionEntry[] {\n const { saasRoot, frameworkRoot, saasConfig, minionEntries, environmentName, applicationDatabaseEngine } = input;\n return minionEntries.map((entry) => {\n const ref = saasConfig.minions?.[entry.key];\n if (!ref) {\n // Defensive — `loadMinionConfigs` reads from this same bucket so\n // mismatch is impossible in practice. Fail loudly if invariants drift.\n throw new Error(\n `[docker-compose-generator] Minion '${entry.key}' loaded but not found in `\n + `wildo.saas.config.ts > minions. Re-run \\`wildo config sync\\`.`,\n );\n }\n const packageRoot = join(saasRoot, ref.path);\n const providerEnvFile = join(packageRoot, PROVIDER_RUNTIME_GENERATED_ENV_FILE_NAME);\n const serviceName = deriveAppRuntimeServiceName(saasConfig.slug, 'minion', entry.key);\n return {\n serviceName,\n containerName: deriveAppRuntimeContainerName(saasConfig.slug, 'minion', entry.key),\n buildContext: frameworkRoot,\n dockerfile: relativeDockerfilePath(frameworkRoot, packageRoot),\n providerEnvFile,\n runtimeEnvFile: composeRuntimeEnvFilePath(environmentName, serviceName),\n minionKey: entry.key,\n displayName: entry.config.displayName,\n runAsUser: `${entry.config.isolation.runAsUser}:${entry.config.isolation.runAsGroup}`,\n runAsUserId: entry.config.isolation.runAsUser,\n runAsGroupId: entry.config.isolation.runAsGroup,\n // Mandatory `/tmp` first, then authored additions — the same ordering and\n // the same reason as the k8s renderer. The schema rejects `/tmp` inside\n // `writablePaths`, so prepending cannot produce a duplicate.\n writablePaths: [RUNTIME_MANDATORY_WRITABLE_PATH, ...entry.config.isolation.writablePaths],\n pidsLimit: entry.config.isolation.pidsLimit,\n ...buildMinionComposeLiveness(entry.config.liveness),\n networks: composeMinionNetworks(entry.key, ref, applicationDatabaseEngine),\n };\n });\n}\n\nfunction buildAppWorkerComposeEntries(input: {\n saasRoot: string;\n frameworkRoot: string;\n saasConfig: WildoSaasConfig;\n workerEntries: ReadonlyArray<{ key: string; absolutePath: string; config: WildoWorkerConfig }>;\n /** The environment whose compose directory holds each runtime's own env file. */\n environmentName: string;\n /** The application's own store (#3367); a worker reaches no store, but the derivation asks for it. */\n applicationDatabaseEngine: DatabaseEngine;\n}): DockerComposeAppWorkerEntry[] {\n const { saasRoot, frameworkRoot, saasConfig, workerEntries, environmentName, applicationDatabaseEngine } = input;\n return workerEntries.map((entry) => {\n const ref = saasConfig.workers?.[entry.key];\n if (!ref) {\n throw new Error(\n `[docker-compose-generator] Worker '${entry.key}' loaded but not found in `\n + `wildo.saas.config.ts > workers. Re-run \\`wildo config sync\\`.`,\n );\n }\n const packageRoot = join(saasRoot, ref.path);\n const providerEnvFile = join(packageRoot, PROVIDER_RUNTIME_GENERATED_ENV_FILE_NAME);\n const serviceName = deriveAppRuntimeServiceName(saasConfig.slug, 'worker', entry.key);\n return {\n serviceName,\n containerName: deriveAppRuntimeContainerName(saasConfig.slug, 'worker', entry.key),\n buildContext: frameworkRoot,\n dockerfile: relativeDockerfilePath(frameworkRoot, packageRoot),\n providerEnvFile,\n runtimeEnvFile: composeRuntimeEnvFilePath(environmentName, serviceName),\n workerKey: entry.key,\n displayName: entry.config.displayName,\n runAsUser: `${entry.config.isolation.runAsUser}:${entry.config.isolation.runAsGroup}`,\n runAsUserId: entry.config.isolation.runAsUser,\n runAsGroupId: entry.config.isolation.runAsGroup,\n writablePaths: [RUNTIME_MANDATORY_WRITABLE_PATH, ...entry.config.isolation.writablePaths],\n pidsLimit: entry.config.isolation.pidsLimit,\n networks: composeWorkerNetworks(entry.key, applicationDatabaseEngine),\n httpPort: entry.config.http.port,\n healthPath: entry.config.http.healthPath,\n readyPath: entry.config.http.readyPath,\n };\n });\n}\n\n/** The suffix of one app runtime's own compose env file, beside the compose file (#2955). */\nexport const COMPOSE_RUNTIME_ENV_FILE_SUFFIX = '.runtime.env';\n\n/** Where one minion's or worker's own environment lives for the compose `app-runtimes` profile (#2955). */\nexport function composeRuntimeEnvFilePath(environmentName: string, runtimeServiceName: string): string {\n return join(EnvironmentUtils.resolveDockerComposeDir(environmentName), `${runtimeServiceName}${COMPOSE_RUNTIME_ENV_FILE_SUFFIX}`);\n}\n\n/**\n * Write each application minion's and worker's OWN environment for the compose `app-runtimes` profile (#2955).\n *\n * The containers used to receive `${PLATFORM_APPLICATION_PRIMARY_SECRET}` and the bootstrap contract interpolated from\n * `.env.wildo-platform`, which carries the PLATFORM's primary secret in an app-creator install and nothing in a\n * framework-developer one. So a minion or worker presented another principal's secret, or none, and apps-manager\n * refused it. Each now mounts the environment the Kubernetes lane mounts as its Secret, built by the same derivation\n * (`application-runtime-environment.ts`) with the compose network's CONTAINER_INTERNAL addresses: its own identity,\n * its own principal secret, its own scoped topology. The provider env file stays a separate `env_file:`, as the\n * provider Secret stays a separate `envFrom` in Kubernetes.\n *\n * Owner-only (0600): the file holds the runtime's principal secret. Returns the paths written. Writes only the\n * runtimes it is given targets for and deletes nothing: a declared runtime with no target this run keeps its existing\n * file, and one that never had a file makes compose refuse the profile naming it, rather than start the runtime\n * with another principal's secret. Removal is the render's job ({@link pruneUndeclaredComposeRuntimeEnvFiles}).\n */\nexport function writeComposeRuntimeEnvFiles(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n minions: readonly ApplicationMinionEnvTarget[] | undefined,\n workers: readonly ApplicationWorkerEnvTarget[] | undefined,\n /** A caller that already holds the hydrated config (a test, a CI render) passes it, as `generateK8sSecrets` takes it. */\n options: { readonly config?: PlatformEnvConfigJson } = {},\n): string[] {\n const context = {\n credentials,\n addresses: ServiceAddressResolver.resolve(ServiceAddressResolver.fromEnvironment(env, AddressPerspective.CONTAINER_INTERNAL)),\n config: loadInfraHydratedConfig(env, options.config),\n environment: env,\n // A compose container reaches the host by the name the `extra_hosts` line defines (#3382).\n hostGatewayHostname: COMPOSE_HOST_GATEWAY_HOSTNAME,\n };\n // A LOCAL target carries no `appName` (REMOTE deploy context): the slug comes from the runtime's own bootstrap\n // credentials, the same app slug the render names the service with.\n //\n // The runtime endpoints are the target's own, as this container sees them (#3382): a host-run backend through the\n // host gateway, a container-routed one as it is. The shared builders derive them (`toContainerRuntimeEndpoints`),\n // from the context's `hostGatewayHostname`, the same derivation the Kubernetes lane runs (#3390).\n const environments = [\n ...(minions ?? []).map((minion) => buildContainerisedMinionEnvironment(minion, resolveRuntimeTargetAppSlug(minion), context)),\n ...(workers ?? []).map((worker) => buildContainerisedWorkerEnvironment(worker, resolveRuntimeTargetAppSlug(worker), context)),\n ];\n mkdirSync(EnvironmentUtils.resolveDockerComposeDir(env.name), { recursive: true });\n const written: string[] = [];\n for (const { runtimeServiceName, env: runtimeEnv } of environments) {\n const path = composeRuntimeEnvFilePath(env.name, runtimeServiceName);\n const lines = [GENERATED_FILE_HEADER, '', ...Object.entries(runtimeEnv).map(([key, value]) => `${key}=${encodeComposeEnvValue(value)}`)];\n writeFileSync(path, `${lines.join('\\n')}\\n`, { mode: 0o600 });\n chmodSync(path, 0o600);\n written.push(path);\n }\n return written;\n}\n\n/**\n * The name a compose container reaches the HOST by (#3382), and the `extra_hosts` entry that defines it.\n *\n * Docker Desktop resolves `host.docker.internal` itself; Docker Engine on Linux does not, and\n * `host.docker.internal:host-gateway` is Docker's own spelling for it there (`host-gateway` is the daemon's\n * host-gateway address), so the minion and worker services declare it on both. One constant, read by the render\n * (the `extra_hosts` line) and, through the compose runtime context, by `toContainerRuntimeEndpoints` (the URLs), so\n * the two cannot disagree.\n *\n * spec-cite: Docker docs, \"Networking in Compose\" / `extra_hosts` and \"Explore networking features on Docker\n * Desktop\" (`host.docker.internal`); `host-gateway` is the special value `docker run --add-host` documents.\n */\nexport const COMPOSE_HOST_GATEWAY_HOSTNAME = 'host.docker.internal';\nexport const COMPOSE_HOST_GATEWAY_EXTRA_HOST = `${COMPOSE_HOST_GATEWAY_HOSTNAME}:host-gateway`;\n\n/** The runtime env files {@link writeComposeRuntimeEnvFiles} would write for these targets, for an overwrite prompt. */\nexport function composeRuntimeEnvFilePaths(\n environmentName: string,\n minions: readonly ApplicationMinionEnvTarget[] | undefined,\n workers: readonly ApplicationWorkerEnvTarget[] | undefined,\n): string[] {\n return [\n ...(minions ?? []).map((minion) => composeRuntimeEnvFilePath(environmentName, buildMinionServiceName(resolveRuntimeTargetAppSlug(minion), minion.minionName))),\n ...(workers ?? []).map((worker) => composeRuntimeEnvFilePath(environmentName, buildWorkerServiceName(resolveRuntimeTargetAppSlug(worker), worker.workerName))),\n ];\n}\n\n/**\n * Delete each `*.runtime.env` whose runtime the application no longer declares (#2955), so a removed minion or worker\n * leaves no principal secret behind. Keyed on what the configuration DECLARES, never on what one run happened to\n * write: a run that knows no targets (`wildo config sync` in app-creator mode prepares none) or skips a principal\n * (degraded mode) must leave the existing files of declared runtimes alone.\n */\nexport function pruneUndeclaredComposeRuntimeEnvFiles(environmentName: string, declaredRuntimeServiceNames: ReadonlySet<string>): void {\n const composeDir = EnvironmentUtils.resolveDockerComposeDir(environmentName);\n if (!existsSync(composeDir)) return;\n for (const entry of readdirSync(composeDir)) {\n if (!entry.endsWith(COMPOSE_RUNTIME_ENV_FILE_SUFFIX)) continue;\n if (!declaredRuntimeServiceNames.has(entry.slice(0, -COMPOSE_RUNTIME_ENV_FILE_SUFFIX.length))) unlinkSync(join(composeDir, entry));\n }\n}\n\n/**\n * How the compose render evaluates `wildo.saas.config.ts` and each minion's and worker's configuration: against the\n * CLI's own built framework packages ({@link ConfigModuleResolution.LOADER_INSTANCES}, #3440).\n *\n * The render only asks what those files DECLARE (the runtimes, their paths, ports and liveness), and builds the compose\n * file with the `platform-config-lib` build the CLI runs. Left to the loader's inference, a framework checkout aliases\n * `@wildo-ai/platform-config-lib` to its `config-authoring.entry.ts` source, so the first read transpiled about 120\n * framework source modules, and on the CI runner the render's Wonder Todos test exceeded its 30 s budget (#3646). Same\n * root cause and remedy as #3610, #3615 and #3621. The files read here import framework packages and, at most, an\n * application's role enums; none defines a zod schema of its own, so the decorated-zod caveat of that mode does not arise.\n */\nconst COMPOSE_RUNTIME_CONFIG_LOAD_OPTIONS = { moduleResolution: ConfigModuleResolution.LOADER_INSTANCES } as const;\n\n/**\n * Render `docker-compose.wildo-platform.yml` and write it when its content differs from what is on disk.\n *\n * Resolves to whether the compose file was written. `wildo local up` / `wildo local dev` render it on EVERY start\n * (#2311): the comparison of the rendered bytes is the only check that is total over the render's inputs —\n * `config.json`, `secrets.json`, the framework's compose template, the application's minion and worker\n * configuration — where an mtime or a flag keyed on any one of them misses the others. The host-mounted files\n * (the immudb signing key, the mongot password) are re-materialized on every render, so a `local_data` reset that\n * removed them is repaired by the next start whether or not the compose file itself changed.\n */\nexport async function renderDockerComposeTemplate(\n env: PlatformEnvironmentConfiguration,\n frameworkPath: string,\n isFrameworkDeveloper: boolean,\n): Promise<boolean> {\n /*\n * The shared compose project is rendered by its OWNER only. A hosted application's render would carry\n * its own `local_data` paths under the host's project name and container names — `up` from it would\n * recreate the host's containers over a different data directory, which is how a stale database\n * appeared under the right name before `infrastructureHost` existed.\n */\n InfrastructureHost.assertOwnsSharedInfrastructure(env, SharedInfrastructureAction.RENDER_PLATFORM_COMPOSE);\n // #2303 — a profile that runs one database family never renders two (the descriptor refuses the declarations too).\n assertProfileRunsItsDatabaseFamilies(env);\n const config = EnvironmentUtils.loadConfigJson(env.name);\n if (!config) throw new Error('config.json not found');\n\n const processor = new TemplateProcessor(\n resolveFrameworkLayout(frameworkPath).dockerComposeTemplatesHome,\n );\n\n // Slice 4 (4.2) — `localDataPath` template variable.\n //\n // Resolves to the absolute host path\n // `<saasRoot>/.wildo-saas/local_data` so each per-service bind mount in\n // the rendered compose file is unambiguous. We deliberately use ABSOLUTE\n // paths (D4 decision in the slice plan) instead of paths relative to the\n // generated compose file location:\n // - Relative paths would walk up several segments\n // (`../../../local_data/<svc>`) and break if the on-disk layout\n // between `.wildo-saas/infrastructure/environments/<env>/docker-compose/`\n // and `.wildo-saas/local_data/` ever changes.\n // - Absolute paths are independent of `cwd` and survive any future\n // reshuffling of the runtime layout.\n //\n // The CLI guarantees the per-service subdirs exist before\n // `docker compose up` via `EnvironmentPaths.ensureLocalDataServiceDirs()`\n // (Slice 4.3); Docker would otherwise create them as root-owned mount\n // points which container UIDs cannot write to.\n const saasRoot = EnvironmentRegistry.getSaasRoot();\n if (!saasRoot) {\n throw new Error(\n 'Cannot render docker-compose template: no targeted SaaS app root detected.',\n );\n }\n const localDataPath = EnvironmentPaths.resolveScopedLocalDataDir(saasRoot);\n\n // Step 6 — load per-app minion/worker configs so the compose template\n // can emit a service for each one under the `app-runtimes` profile.\n // The platform path stays unchanged when there are no minions/workers\n // declared (the template's `{{#if appMinions.length}}` / `{{#if appWorkers.length}}`\n // guards drop the sections entirely in that case). Framework-developer\n // mode skips the load to keep the platform-only flow side-effect-free.\n const saasConfigForRuntimes = isFrameworkDeveloper\n ? null\n : await loadSaasConfig(join(saasRoot, 'wildo.saas.config.ts'), COMPOSE_RUNTIME_CONFIG_LOAD_OPTIONS);\n const minionEntries = saasConfigForRuntimes\n ? await loadMinionConfigs(saasRoot, saasConfigForRuntimes, COMPOSE_RUNTIME_CONFIG_LOAD_OPTIONS)\n : [];\n const workerEntries = saasConfigForRuntimes\n ? await loadWorkerConfigs(saasRoot, saasConfigForRuntimes, COMPOSE_RUNTIME_CONFIG_LOAD_OPTIONS)\n : [];\n // Step 6 (Q1 (B)) — `build.context` for runtime-host services is the\n // wildo-ai monorepo root so each Dockerfile can resolve file:-injected\n // engine deps. The Dockerfile itself lives inside the package; its\n // path is computed relative to the framework root.\n const frameworkRoot = resolveFrameworkRoot(frameworkPath);\n\n const appMinions = saasConfigForRuntimes\n ? buildAppMinionComposeEntries({\n saasRoot,\n frameworkRoot,\n saasConfig: saasConfigForRuntimes,\n minionEntries,\n environmentName: env.name,\n applicationDatabaseEngine: resolveApplicationDatabaseEngine(config.applicationDatabase),\n })\n : [];\n // #2303: a profile whose queue cannot confine its minions (the DATABASE queue on MongoDB) refuses them here, before any\n // file is written. A framework developer's render builds no app runtime (`saasConfigForRuntimes` is null), so for them\n // the env generator and the application's boot carry the same refusal.\n assertProfileRunsDeclaredMinions(env, appMinions.length, resolveApplicationDatabaseEngine(config.applicationDatabase));\n // The runtimes this render declares are the only ones whose env file may remain (#2955). Total over the\n // configuration, so pruning here can never remove a declared runtime's file.\n pruneUndeclaredComposeRuntimeEnvFiles(env.name, new Set([\n ...minionEntries.map((entry) => deriveAppRuntimeServiceName(saasConfigForRuntimes!.slug, 'minion', entry.key)),\n ...workerEntries.map((entry) => deriveAppRuntimeServiceName(saasConfigForRuntimes!.slug, 'worker', entry.key)),\n ]));\n const appWorkers = saasConfigForRuntimes\n ? buildAppWorkerComposeEntries({\n saasRoot,\n frameworkRoot,\n saasConfig: saasConfigForRuntimes,\n workerEntries,\n environmentName: env.name,\n applicationDatabaseEngine: resolveApplicationDatabaseEngine(config.applicationDatabase),\n })\n : [];\n\n // Slice 2 Phase 5b Wave 2 — local OTel collector inclusion + host port.\n // Emitted only when infra `observability.enabled` AND the authored OTLP\n // endpoint targets localhost (the endpoint IS this local collector; a remote\n // BetterStack endpoint gets no local collector). The host port is parsed from\n // the endpoint so the published `localhost:<port>` matches exactly what the\n // preload-instrumented backend + companion hosts target; defaults to the\n // OTLP/HTTP standard 4318 when the endpoint omits an explicit port.\n const OTEL_OTLP_HTTP_DEFAULT_PORT = '4318';\n const otelObservability = env.observability;\n let includeOtelCollector = false;\n let otelCollectorHostPort = OTEL_OTLP_HTTP_DEFAULT_PORT;\n if (otelObservability?.enabled) {\n let parsedEndpoint: URL | undefined;\n try {\n parsedEndpoint = new URL(otelObservability.endpoint);\n } catch {\n parsedEndpoint = undefined;\n }\n if (\n parsedEndpoint &&\n (parsedEndpoint.hostname === 'localhost' ||\n parsedEndpoint.hostname === '127.0.0.1')\n ) {\n includeOtelCollector = true;\n otelCollectorHostPort = parsedEndpoint.port || OTEL_OTLP_HTTP_DEFAULT_PORT;\n }\n }\n\n // Audit Phase 2 — materialize the immudb state-signing PRIVATE key so the self-hosted immudb\n // container can sign its `ImmutableState` (`--signingKey`), turning the whole-server-substitution\n // defense ON. Only when this env self-hosts immudb AND a keypair was provisioned\n // (`credentials.immudb`, minted from the `FRAMEWORK_MANAGED_SECRET_MATERIALS` registry at setup\n // and by the idempotent self-heal, so present for any file-backed env). The key is the SEC1 \"EC PRIVATE KEY\"\n // PEM immudb parses; written `0644` because the compose bind mount preserves host ownership and\n // immudb's container UID differs, so the file must be world-readable to load (proven in the\n // immudb integration test). SERVER-side ONLY — the private key never enters app env; the matching\n // PUBLIC key reaches the audit client via `IMMUDB_STATE_PUBLIC_KEY` (env-vars-builder). When no\n // keypair is provisioned the template's `{{#if immudbSigningKeyHostPath}}` block drops and immudb\n // runs UNSIGNED (client warns once) — graceful degradation.\n let immudbSigningKeyHostPath: string | undefined;\n // The built-in `immudb` SYSADMIN's INITIAL password — the platform's own framework-managed material\n // (`credentials.immudb.adminPassword`, #1696). apps-manager logs in with the same value (`IMMUDB_ADMIN_PASSWORD`\n // in its env) to mint each application's own database and `READ_WRITE` user; no application receives it.\n //\n // Until #1696 this was COPIED from the owning application's `providerEnv.IMMUDB_PASSWORD`, the credential every\n // application's audit sink also connected with, so each application held the sysadmin of every application's\n // audit data. That copy is gone from this lane AND from the k8s lane (`k8s-secrets-generator`), which is the\n // pair the original copy had to keep in step (`.claude/rules/invariant-call-site-enumeration.md` #23).\n //\n // Read from the SAME `SecretsReader` load as the signing key. Undefined (a CI-reconstructed secrets.json that\n // carries no immudb material) ⇒ the template's `{{#if immudbAdminPassword}}` block drops.\n //\n // ⚠️ immudb only adopts this on a FRESH data dir — it is the INITIAL password, not a reset. An existing\n // `local_data/immudb` keeps whatever it was initialised with. apps-manager moves one still on immudb's packaged\n // default onto this value at its first admin login (`ImmudbAdminManagerService`, audited); one initialised from a\n // real secret needs its sysadmin password set once (`immuadmin user changepassword immudb`) or a fresh data dir.\n let immudbAdminPassword: string | undefined;\n if (resolveIncludeLocalImmudb(env)) {\n const secrets = SecretsReader.loadSecrets(env.name);\n const signingPrivateKey = secrets?.immudb?.stateSigningPrivateKey;\n if (signingPrivateKey) {\n /*\n * Written on EVERY render, and every `wildo local up` / `wildo local dev` renders (#2311). That is what repairs\n * a `local_data` reset: the reset removes this file and leaves the compose file, and Docker does not fail on a\n * missing bind-mount SOURCE, it silently creates a DIRECTORY there. immudb then reports\n * `unable to configure the cryptographic signer: read /etc/immudb/state-signing.key: is a directory` and\n * compose only `container wildo-immudb is unhealthy` (measured 2026-08-22, the first cold start after a full\n * reset). The key itself survives a reset, in `secrets.json`, so this is recoverable by construction.\n *\n * Until #2311 the render was skipped while the compose file was current, so a predicate\n * (`isComposeHostMountedArtifactMissing`) forced it for this one file. Rendering on every start makes the\n * predicate unnecessary, and it is removed: it covered this file and not the mongot password beside it.\n */\n const signingKeyDir = join(localDataPath, IMMUDB_SIGNING_KEY_DIR);\n mkdirSync(signingKeyDir, { recursive: true });\n const signingKeyPath = join(signingKeyDir, IMMUDB_SIGNING_KEY_FILENAME);\n // The Docker-created stand-in is an EMPTY directory; `rmdirSync` refuses a non-empty one, so nothing real is lost.\n if (existsSync(signingKeyPath) && statSync(signingKeyPath).isDirectory()) rmdirSync(signingKeyPath);\n // Rewritten only when it differs: the render runs on every start, possibly while immudb is (re)starting, and a\n // truncate-and-write of identical bytes would open a window in which it reads an empty file.\n writeFileWhenContentDiffers(signingKeyPath, signingPrivateKey, 0o644);\n immudbSigningKeyHostPath = signingKeyPath;\n }\n immudbAdminPassword = secrets?.immudb?.adminPassword;\n }\n\n // Issue #74 — materialize the `mongot` sync-source password so BOTH containers that need it can\n // read the SAME bytes: `mongodb-init` creates the `searchCoordinator` user with it, and `mongot`\n // authenticates with it. Neither can be given the other's copy, and minting it per-container is\n // how the two silently diverge — so it comes from the single framework-managed material and is\n // written once here.\n //\n // `0400` because mongot enforces it (see MONGOT_PASSWORD_DIR). Written on every render, and every\n // `wildo local up` / `wildo local dev` renders (#2311), so a `local_data` reset that removes this\n // file while leaving the compose file behind is repaired by the next start. Missing, it would\n // surface as a mongot that cannot authenticate rather than as anything naming the missing file.\n //\n // `undefined` ⇒ the template's `{{#if mongotPasswordHostPath}}` guard drops the mongot service\n // entirely and mongod runs without a search sidecar. That is the honest degradation: a\n // half-wired mongot that mongod routes `$vectorSearch` to and that cannot answer is worse than\n // no mongot at all, because the application's boot probe tests REACHABILITY.\n //\n // A service profile that omits mongot (#2303) leaves it `undefined` too, whatever material exists.\n let mongotPasswordHostPath: string | undefined;\n if (resolveIncludeMongotSidecar(env)) {\n const mongotPassword = SecretsReader.loadSecrets(env.name)?.mongot?.syncSourcePassword;\n if (mongotPassword) {\n const mongotAuthDir = join(localDataPath, MONGOT_PASSWORD_DIR);\n mkdirSync(mongotAuthDir, { recursive: true });\n const passwordPath = join(mongotAuthDir, MONGOT_PASSWORD_FILENAME);\n // A PREVIOUS render left this file at 0400 — owner READ-only — and `writeFileSync` opens for\n // WRITE, so a re-render EACCES's on the file it wrote itself. That made `wildo local init`\n // succeed exactly once per machine and fail on every subsequent run, which is the worst shape\n // for a first-run-only bug: the failure lands on someone whose environment already worked.\n // Widen just long enough to rewrite, then re-narrow. Unlinking instead would leave a window\n // with no file at all, which a running mongot re-reading its password would lose.\n //\n // Since the render runs on every start (#2311), an identical file at the right mode is left\n // untouched, so a mongot (re)starting meanwhile never meets the widened or truncated window.\n // The Docker-created stand-in for a missing mount source is an EMPTY directory, as for the signing key above.\n if (existsSync(passwordPath) && statSync(passwordPath).isDirectory()) rmdirSync(passwordPath);\n const passwordCurrent = existsSync(passwordPath)\n && statSync(passwordPath).isFile()\n && (statSync(passwordPath).mode & 0o777) === MONGOT_SYNC_SOURCE.PASSWORD_FILE_MODE\n && readFileSync(passwordPath, 'utf8') === mongotPassword;\n if (!passwordCurrent) {\n if (existsSync(passwordPath)) {\n chmodSync(passwordPath, MONGOT_SYNC_SOURCE.PASSWORD_FILE_REWRITE_MODE);\n }\n writeFileSync(passwordPath, mongotPassword, { mode: MONGOT_SYNC_SOURCE.PASSWORD_FILE_MODE });\n // `writeFileSync`'s `mode` is only honored when it CREATES the file — an existing file keeps\n // whatever mode it already had, so re-render alone cannot repair a loosened one. chmod\n // unconditionally, or a file that was ever created differently keeps crashing mongot.\n chmodSync(passwordPath, MONGOT_SYNC_SOURCE.PASSWORD_FILE_MODE);\n }\n mongotPasswordHostPath = passwordPath;\n }\n }\n\n // #2933 — the self-hosted OpenBao. Its material (the unseal key and apps-manager's two token ids) must be provisioned:\n // a declared Vault rendered without it would be a server that cannot unseal, and rendering none would leave\n // apps-manager without the Vault the environment declares, silently. So a missing material is REFUSED, as the\n // Kubernetes lane refuses it; the remedy is `wildo config sync`, which provisions it, and needs nothing running. Its\n // configuration carries key ids only; the secrets are inline in the service, like immudb's admin password, because a\n // framework developer's `.env.wildo-platform` carries no platform env to interpolate.\n let platformKeyVault:\n | {\n image: string; configFilePath: string; dataPath: string; configIndented: string; env: Record<string, string>;\n unsealKey: string; signerToken: string; operatorToken: string; recoveryToken: string; previousUnsealKey?: string;\n }\n | undefined;\n if (resolveIncludeLocalPlatformKeyVault(env)) {\n const material = SecretsReader.loadSecrets(env.name)?.platformKeyVault;\n if (!material?.unsealKey || !material.signerToken || !material.operatorToken || !material.recoveryToken) {\n throw new Error(\n `Environment \"${env.name}\" self-hosts the platform Vault (platformKeyManagement.vault.source = self), but secrets.json `\n + 'carries no platformKeyVault material. Run `wildo config sync`, which provisions it, then render again.',\n );\n }\n {\n // #3006 — a previous unseal key is present only between the two steps of `wildo keys vault-rotate-unseal-key`.\n const config = renderPlatformKeyVaultServerConfig({ unsealKey: material.unsealKey, previousUnsealKey: material.previousUnsealKey });\n platformKeyVault = {\n image: PLATFORM_KEY_VAULT_SERVER.IMAGE,\n configFilePath: PLATFORM_KEY_VAULT_SERVER.CONFIG_FILE_PATH,\n dataPath: PLATFORM_KEY_VAULT_SERVER.DATA_PATH,\n // A YAML block scalar under `content: |`, six spaces in.\n configIndented: config.trimEnd().split('\\n').map((line) => (line ? ` ${line}` : '')).join('\\n'),\n env: {\n unsealKey: PLATFORM_KEY_VAULT_SERVER.ENV.UNSEAL_KEY,\n signerToken: PLATFORM_KEY_VAULT_SERVER.ENV.SIGNER_TOKEN,\n operatorToken: PLATFORM_KEY_VAULT_SERVER.ENV.OPERATOR_TOKEN,\n recoveryToken: PLATFORM_KEY_VAULT_SERVER.ENV.RECOVERY_TOKEN,\n previousUnsealKey: PLATFORM_KEY_VAULT_SERVER.ENV.PREVIOUS_UNSEAL_KEY,\n },\n unsealKey: material.unsealKey,\n signerToken: material.signerToken,\n operatorToken: material.operatorToken,\n recoveryToken: material.recoveryToken,\n ...(material.previousUnsealKey ? { previousUnsealKey: material.previousUnsealKey } : {}),\n };\n }\n }\n\n const context = {\n composeName: DEFAULT_DOCKER_COMPOSE_LOCAL_PROJECT_NAME,\n /**\n * #2933 — the self-hosted OpenBao (service, `wildo-data-keys` segment, apps-manager's membership of it, and its\n * `configs:` entry), or `undefined` when the environment self-hosts none or its material is not provisioned.\n */\n platformKeyVault,\n /**\n * #3019 — the HSM vendor's PKCS#11 client files (read-only mounts) and variables for both apps-manager services, or\n * `undefined` when the platform runs natively or declares no token. Refuses a module the container cannot reach.\n */\n platformPkcs11: buildPlatformPkcs11ComposeContext(env, !isFrameworkDeveloper),\n /**\n * Slice 2 Phase 5b Wave 2 — local OTel collector. `includeOtelCollector`\n * gates both the service (under `services:`) and the inline `configs:`\n * entry that supplies its config (the contrib image is distroless — no\n * shell for an entrypoint heredoc). Ports default to OTLP/HTTP 4318.\n */\n includeOtelCollector,\n otelCollectorHostPort,\n otelCollectorInternalPort: OTEL_OTLP_HTTP_DEFAULT_PORT,\n includeLocalMongoDB: EnvironmentUtils.needsLocalMongoDB(env),\n /**\n * NOT `config.database.engine === POSTGRESQL` — see\n * {@link EnvironmentLifecycle.needsLocalPostgreSQL}. That field also SUBTRACTS MongoDB\n * (`needsLocalMongoDB`), so it could never express \"MongoDB for the platform, PostgreSQL for the\n * application's resources\", which is what an app on the PostgreSQL persistence adapter needs.\n */\n includePostgreSQL: EnvironmentUtils.needsLocalPostgreSQL(env),\n /**\n * Cache / broker / object storage. Each gates its own service block AND its `depends_on` entry\n * on `platform-init` — both, or compose refuses the whole project with\n * `service \"platform-init\" depends on undefined service \"valkey\"`, which is the failure mode a\n * half-applied gate produces (`.claude/rules/invariant-call-site-enumeration.md`).\n * `includeLocalMinIO` additionally gates the `minio-init` bucket-creation step, which exists\n * only to serve the local MinIO.\n */\n includeLocalValkey: resolveIncludeLocalValkey(env),\n includeLocalRabbitMQ: resolveIncludeLocalRabbitMQ(env),\n includeLocalMinIO: resolveIncludeLocalMinIO(env),\n includeLocalClamAV: resolveIncludeLocalClamAV(env),\n includeLocalImmudb: resolveIncludeLocalImmudb(env),\n /**\n * Absolute host path of the materialized immudb state-signing PRIVATE key, or `undefined`\n * when immudb is not self-hosted / no keypair is provisioned. Gates the `--signingKey` block\n * (mount + `command`) in the compose immudb service so it signs its state.\n */\n immudbSigningKeyHostPath,\n /**\n * The self-hosted immudb server's INITIAL sysadmin password: the platform's framework-managed\n * `credentials.immudb.adminPassword` (#1696), the same value apps-manager logs in with. `undefined` ⇒ the\n * template's `environment:` block drops (matching the k8s lane's `optional: true` secretKeyRef).\n */\n immudbAdminPassword,\n /**\n * Issue #74 — absolute host path of the materialized mongot sync-source password file, or\n * `undefined` when this env self-hosts no mongod / carries no mongot material. Gates the whole\n * `mongot` service and the `mongodb-init` step that creates its user.\n */\n mongotPasswordHostPath,\n /** In-container mount point both mongot and mongodb-init read that file at. */\n mongotPasswordFilePath: MONGOT_SYNC_SOURCE.PASSWORD_FILE_PATH,\n /** The `searchCoordinator`-roled user mongot authenticates to mongod as. */\n mongotSyncSourceUsername: MONGOT_SYNC_SOURCE.USERNAME,\n mongotSyncSourceAuthSource: MONGOT_SYNC_SOURCE.AUTH_SOURCE,\n mongotConfigFilePath: MONGOT_SYNC_SOURCE.CONFIG_FILE_PATH,\n mongotDataPath: MONGOT_SYNC_SOURCE.DATA_PATH,\n includePlatformServices: !isFrameworkDeveloper,\n /**\n * Each platform container's `mem_limit` and V8 heap ceiling, from the MEASURED profiles in the\n * service catalog (#1592) — the same numbers the k8s lane renders, so the two cannot drift.\n */\n platformServiceMemory: buildPlatformServiceMemoryContext(),\n /** Step 6 — per-app minion + worker compose entries (under `app-runtimes` profile). */\n appMinions,\n appWorkers,\n // The minion, worker and scheduler services' `extra_hosts` entry (#3382), from the constant their endpoints are derived with.\n hostGatewayExtraHost: COMPOSE_HOST_GATEWAY_EXTRA_HOST,\n // The name the scheduler re-points a host-run backend's loopback delivery URL at (#2303).\n hostGatewayHostname: COMPOSE_HOST_GATEWAY_HOSTNAME,\n /** Slug used to disambiguate compose service names across coexisting apps on the same host. */\n saasSlug: saasConfigForRuntimes?.slug ?? '',\n /**\n * The PUBLISHED platform image, read only inside `{{#if includePlatformServices}}`: a framework developer's\n * platform runs natively, so their file renders no platform container at all. See `resolvePlatformImageRef`\n * for why there is no locally built answer (#2988) and why the tag is the framework version, never `latest`.\n */\n platformImageRef: resolvePlatformImageRef({ frameworkVersion: readVersion() }),\n localDataPath,\n /**\n * Per-mount SOURCE for every backing-service data directory, and the named volumes to declare.\n *\n * Both derive from one table (`LOCAL_DATA_MOUNTS`) so the file cannot mount a volume it does\n * not declare. `localDataVolumes` is empty in `HOST_PATH` mode, which drops the `volumes:`\n * block entirely — compose rejects an empty mapping.\n *\n * `localDataPath` stays in the context under BOTH modes: the two read-only secret FILE mounts\n * (immudb's state-signing key, mongot's sync-source password) are materialized onto the host\n * from `secrets.json` and have nowhere else to come from, so they are host mounts always.\n */\n localDataSources: buildLocalDataMountSources(env, saasRoot, localDataPath),\n localDataVolumes: buildLocalDataVolumeDeclarations(env, saasRoot, { mongot: mongotPasswordHostPath !== undefined, openbao: platformKeyVault !== undefined }),\n /**\n * Host-side port mappings for self-deployed infra services. Each value\n * defaults to the image-internal port (which is what container-internal\n * traffic always uses); when the author overrides\n * `backingServices.<kind>.port` for a SELF source, that value drives the\n * host-side mapping so `localhost:${authorPort}` reaches the container.\n */\n infraHostPorts: {\n mongodb: resolveInfraHostPort(env, BackingServiceKind.MONGODB, INFRA_DEFAULT_PORTS.MONGODB),\n valkey: resolveInfraHostPort(env, BackingServiceKind.REDIS, INFRA_DEFAULT_PORTS.VALKEY),\n rabbitmq: resolveInfraHostPort(env, BackingServiceKind.RABBITMQ, INFRA_DEFAULT_PORTS.RABBITMQ),\n rabbitmqManagement: INFRA_DEFAULT_PORTS.RABBITMQ_MANAGEMENT,\n minio: resolveInfraHostPort(env, BackingServiceKind.S3, INFRA_DEFAULT_PORTS.MINIO),\n minioConsole: MINIO_CONSOLE_PORT,\n postgresql: resolveInfraHostPort(env, BackingServiceKind.POSTGRESQL, INFRA_DEFAULT_PORTS.POSTGRESQL),\n clamav: resolveInfraHostPort(env, BackingServiceKind.CLAMAV, INFRA_DEFAULT_PORTS.CLAMAV),\n immudb: resolveInfraHostPort(env, BackingServiceKind.IMMUDB, INFRA_DEFAULT_PORTS.IMMUDB),\n // #2933 — no authored override: the platform Vault is not a backing service an environment addresses.\n openbao: INFRA_DEFAULT_PORTS.OPENBAO,\n },\n infraInternalPorts: {\n mongodb: INFRA_DEFAULT_PORTS.MONGODB,\n valkey: INFRA_DEFAULT_PORTS.VALKEY,\n rabbitmq: INFRA_DEFAULT_PORTS.RABBITMQ,\n rabbitmqManagement: INFRA_DEFAULT_PORTS.RABBITMQ_MANAGEMENT,\n minio: INFRA_DEFAULT_PORTS.MINIO,\n minioConsole: MINIO_CONSOLE_PORT,\n postgresql: INFRA_DEFAULT_PORTS.POSTGRESQL,\n clamav: INFRA_DEFAULT_PORTS.CLAMAV,\n immudb: INFRA_DEFAULT_PORTS.IMMUDB,\n openbao: INFRA_DEFAULT_PORTS.OPENBAO,\n // Issue #74 — mongot's three listeners. Present in `infraInternalPorts` and deliberately\n // ABSENT from `infraHostPorts`: nothing on the host is a mongot client (clients talk to\n // mongod, which routes to mongot over gRPC), so publishing them would widen the local\n // attack surface for no consumer.\n mongotGrpc: INFRA_DEFAULT_PORTS.MONGOT_GRPC,\n mongotHealth: INFRA_DEFAULT_PORTS.MONGOT_HEALTH,\n mongotMetrics: INFRA_DEFAULT_PORTS.MONGOT_METRICS,\n },\n };\n\n const rendered = processor.processTemplate(FILE_NAMES.DOCKER_COMPOSE_TEMPLATE, context);\n\n const composeDir = EnvironmentUtils.resolveDockerComposeDir(env.name);\n if (!existsSync(composeDir)) {\n mkdirSync(composeDir, { recursive: true });\n }\n\n return writeFileWhenContentDiffers(join(composeDir, FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM), rendered);\n}\n"]}
|