@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":"env-configuration-generator.service.js","sourceRoot":"","sources":["../../../../src/services/environment/env-configuration-generator.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,IAAI,WAAW,EACxB,UAAU,EACV,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,SAAS,EACT,Q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,KAAK,KAAK,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,oCAAoC,SAAS,oDAAoD,QAAQ,GAAG,CAAC,CAAC;IAChI,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,uCAAuC,CAAC,eAAuB;IACtE,MAAM,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAC;IACjD,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,6DAA6D,sBAAsB,GAAG,CAAC,CAAC;IAC1G,CAAC;IACD,OAAO,YAAY,CAAC,sBAAsB,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["import {\n closeSync,\n constants as fsConstants,\n existsSync,\n fchmodSync,\n fstatSync,\n ftruncateSync,\n lstatSync,\n mkdirSync,\n openSync,\n readFileSync,\n realpathSync,\n unlinkSync,\n writeFileSync,\n writeSync,\n} from 'fs';\nimport { dirname, join, resolve } from 'path';\nimport {\n resolveFrameworkLayout,\n type AppBootstrapCredentials,\n type K8sIngressRoute,\n BOOTSTRAP_PLATFORM_SERVICES,\n ApplicationCreationVerificationEnvKey,\n WildoLocationType,\n type RuntimeAccessDeclaration,\n} from '@wildo-ai/platform-config-lib';\nimport type { PlatformEnvConfigJson, PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { IMMUDB_AUDIT_STATE_LOCAL_DATA_DIR } from '~wildo-cli/services/data-services/data-services.schemas';\nimport { LOCAL_APPLICATION_BACKEND_LISTEN_HOST } from '~wildo-cli/services/environment/platform-runtime.schemas';\nimport { resolveContainerHostGatewayListenHost } from '~wildo-cli/services/environment/container-host-gateway-listen-host';\nimport { InfrastructureHost } from '~wildo-cli/services/environment/infrastructure-host.service';\nimport { PlatformWildoServices, type MinionLiveness } from '@wildo-ai/platform-config-lib';\nimport { PLATFORM_SERVICE_CATALOG } from '~wildo-cli/services/catalog/service-catalog.schemas';\nimport { FILE_NAMES, GENERATED_FILE_HEADER } from '~wildo-cli/infrastructure/io/io.schemas';\nimport { ServiceAddressResolver, AddressPerspective } from '~wildo-cli/services/catalog/service-address-resolver.service';\nimport { PlatformEnvVarsBuilder } from '~wildo-cli/services/environment/env-vars-builder.service';\nimport { declaredProviderScope } from '~wildo-cli/services/credentials/provider-env-vars.utils';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport { APPLICATION_BACKEND_ENV_KEY_LIST } from '@wildo-ai/platform-core-shared';\n\nconst APPLICATION_BACKEND_RESERVED_ENV_KEYS = new Set<string>(APPLICATION_BACKEND_ENV_KEY_LIST);\n\nfunction assertNoApplicationBackendReservedEnvOverrides(extraEnv: Readonly<Record<string, string>> | undefined, targetDescription: string): void {\n const overriddenKeys = Object.keys(extraEnv ?? {}).filter((key) => APPLICATION_BACKEND_RESERVED_ENV_KEYS.has(key)).sort();\n if (overriddenKeys.length > 0) {\n throw new Error(`${targetDescription} extraEnv cannot override canonical application-backend environment keys: ${overriddenKeys.join(', ')}`);\n }\n}\n\n/**\n * Read a host package.json `version` for OTel `service.version` (audit A-10). Returns undefined\n * when the file or field is absent — `service.version` is then simply omitted (graceful).\n */\nfunction readHostVersion(repositoryRoot: string, relativeDir: string): string | undefined {\n try {\n const pkg = JSON.parse(\n readFileSync(join(repositoryRoot, relativeDir, 'package.json'), 'utf8'),\n ) as { version?: unknown };\n return typeof pkg.version === 'string' ? pkg.version : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Hydrate the infra posture blocks (`logging`, `observability`, `providerSelection`, `email`, `ownershipDnsStandIn`) onto a freshly-loaded\n * `config.json` from the registry `env` (refreshed from authored infra by `RuntimeBootstrap.refreshEnvFromAuthored`).\n *\n * Two writers produce `config.json`. The AUTHORED projection (`buildConfigJsonFromInfraEnvConfig`) carries these\n * blocks; the local lane writes it (`RuntimeBootstrap.ensureConfigJson`, #2311). The SETUP-time file\n * (`credentials.service.ts`), which a remote environment keeps, carries them since #2310 only when the environment\n * authors a descriptor (`overlayAuthoredInfraMembers`), and `loadConfigForSync` lays the descriptor over it again on\n * every sync and writes the result back (`persistAuthoredOverlay`). The registry `env` still wins over the file\n * (audit A-6, `env.x ?? config.x`), because a caller may hand a record setup seeded from the descriptor beside a file\n * written before the overlay existed. It cannot hand a STALE one: the local record is refreshed from the descriptor\n * with absence authoritative (`refreshEnvFromAuthored`), and `hydrateEnvironmentFromConfig` takes these members from\n * the overlaid `config.json`, absence included. Without this hydration, `emitLoggingEnv` / `emitObservabilityEnv`\n * would drop `LOG_LEVEL` / `OTEL_*` (Slice 2 Phase 5b) on a pre-overlay setup file.\n *\n * Shared by BOTH `buildPlatformServiceEnvMap` (platform hosts: apps-manager, crontabs, registry) and\n * `generatePlatformServiceEnvFiles` (app hosts). The platform hosts run the same\n * `--import @wildo-ai/saas-backend-lib/otel-preload` and MUST enable OTel identically, so a single\n * shared hydration keeps every host in lockstep — a prior split left the platform-service env map\n * (built from a SEPARATE un-hydrated config load) with no `OTEL_*` while the app hosts had it.\n */\nfunction hydrateInfraPostureFromEnv(\n config: PlatformEnvConfigJson,\n env: PlatformEnvironmentConfiguration,\n): void {\n config.logging = env.logging ?? config.logging;\n config.observability = env.observability ?? config.observability;\n config.providerSelection = env.providerSelection ?? config.providerSelection;\n config.email = env.email ?? config.email;\n config.agentContentGuardrails = env.agentContentGuardrails ?? config.agentContentGuardrails;\n // Local-only (#2519): the double answering domain-ownership challenges. Same ordering as `email`.\n config.ownershipDnsStandIn = env.ownershipDnsStandIn ?? config.ownershipDnsStandIn;\n}\n\n/**\n * The SINGLE seam every env-emitting path uses to obtain the config that feeds an `emit*Env`\n * builder — the local `.env` files AND every deploy generator (compose, k8s, CI). The on-disk\n * config.json may be the SETUP snapshot (written by `credentials.service.ts`, kept by a remote environment) that\n * OMITS the infra-posture blocks (`logging`/`observability`/`providerSelection`/`email`), or the authored projection\n * that carries them (see {@link hydrateInfraPostureFromEnv}). Any builder that reads a setup snapshot raw\n * therefore emits no `OTEL_*`/`LOG_LEVEL`/provider-selection/receiving domain (the `emit*Env` builders early-return\n * on the absent block). Centralising the load+hydrate here makes that invariant UNBYPASSABLE: no\n * emit path constructs its own un-hydrated config. `providedConfig` covers the deploy callers that\n * already hold a config object (k8s/CI receive it through their options).\n */\nexport function loadInfraHydratedConfig(\n env: PlatformEnvironmentConfiguration,\n providedConfig?: PlatformEnvConfigJson | null,\n): PlatformEnvConfigJson {\n const config = providedConfig ?? EnvironmentUtils.loadConfigJson(env.name);\n if (!config) {\n throw new Error(`config.json not found for env '${env.name}' — run setup first`);\n }\n hydrateInfraPostureFromEnv(config, env);\n return config;\n}\n\n/**\n * A single container/Service port on the single-pod app deployment. `name` is a\n * K8s-valid port name (lowercase, `[a-z0-9-]`, ≤15 chars); `containerPort` is the\n * authored/derived port the app process listens on.\n */\nexport interface K8sPodPort {\n name: string;\n containerPort: number;\n}\n\n/**\n * ## Where an application's runtime targets are anchored\n *\n * Every application runtime target — backend, companion, frontend, worker, minion, and the operator\n * `.env` at the application root — carries the APPLICATION root (absolute) and a path relative to\n * it. Writers join the two; nothing about a target refers to the framework.\n *\n * Until 2026-09-06 `relativeDir` was relative to the FRAMEWORK repository root and every writer\n * joined it onto the framework path (`examples/wonder-todos/backend-api`). That assumed an\n * application lives under `examples/` of a checkout, which is true of the framework-developer lane\n * and of nothing else: an app-creator application (npm-installed CLI, application at `~/my-app`)\n * resolved every target as \"outside the framework root\" and could never receive a `.env`, so it\n * could bring the platform up and never register against it. The framework root is not a property\n * of an application; the application root is, and the framework-developer paths are unchanged by\n * the move (`<checkout>/examples/wonder-todos` + `backend-api` is the same file as before).\n */\nexport interface ApplicationRuntimeTargetAnchor {\n /** The application root (absolute): the directory holding `wildo.saas.config.ts`. */\n applicationRoot: string;\n /** Path from {@link applicationRoot} to the target's own directory. */\n relativeDir: string;\n}\n\nexport interface ApplicationBackendEnvTarget extends ApplicationRuntimeTargetAnchor {\n /** Authored SaaS service key for replica binding. Optional for secret-only targets. */\n serviceKey?: string;\n /**\n * Provider refs this runtime's `providers.scopes.*` declares.\n *\n * Threaded so the env builder can drop every provider secret outside the\n * declared scope. Previously the whole `providerEnv` bag was copied into every\n * application runtime, so a minion scoped to `openai` still received the\n * application's `STRIPE_SECRET_KEY` — an authored boundary the credential\n * layer never read.\n */\n scopedProviderRefs: readonly string[];\n bootstrapCredentials: AppBootstrapCredentials;\n serviceName: string;\n /**\n * The APPLICATION root (absolute) every target of this application is anchored on — the\n * directory holding `wildo.saas.config.ts`. See {@link ApplicationRuntimeTargetAnchor}.\n */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the backend-api directory (e.g. `backend-api`). */\n relativeDir: string;\n /** Absolute app-layout authority shared by every local backend/minion and the companion, independent of service nesting depth. */\n applicationRuntimeSignalsHome: string;\n appDatabaseName?: string;\n /**\n * Authored `wildo.saas.config.dataServices.redis.keyPrefix` (Slice 3.6).\n * Emitted as `REDIS_KEY_PREFIX` in the per-app `.env` and consumed by\n * `RedisService` as the canonical app-level Redis key namespace.\n */\n redisKeyPrefix?: string;\n /**\n * Authored `wildo.saas.config.dataServices.s3.bucketPrefix` (Slice 3.6).\n * Emitted as `STORAGE_BUCKET_PREFIX` in the per-app `.env` and prepended\n * to every application object key by `WildoManagedStorageProvider`.\n */\n storageBucketPrefix?: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n /**\n * App-level deploy context (identical across a given app's backend targets,\n * like {@link runtimeEndpoints}): the app slug + serviceHosts-driven ingress\n * routes (each targeting a per-service Service) the CI render path emits for\n * the k8s ingress / compose Traefik lane. Populated for REMOTE only.\n */\n appName?: string;\n ingressRoutes?: K8sIngressRoute[];\n /**\n * Per-service model: the BACKEND pod's ports (NOT the whole app) — the one port\n * its process binds, where health, webhooks, the OAuth provider and MCP are\n * routes (#1783). Frontends are separate nginx Deployments ({@link frontends}),\n * not folded in here. REMOTE only.\n */\n podPorts?: K8sPodPort[];\n /** The port the backend's k8s probes call: the backend's OWN port, where its health routes are served (#1760). Remote only. */\n healthPort?: number;\n /**\n * Per-service model: the app's public frontends, each deploying as its OWN\n * nginx Deployment + Service. `serviceName` is the k8s object + built image\n * name; `port` is the authored `defaultPort` the frontend Service exposes\n * (→ nginx :80). Same value across a given app's backend targets. REMOTE only.\n */\n frontends?: Array<{\n /** Authored SaaS service key, distinct from the generated service/image name. */\n serviceKey?: string;\n serviceName: string;\n port: number;\n /** Effective isolation for this frontend's nginx pod — see {@link ApplicationBackendEnvTarget.isolation}. */\n isolation?: { runAsUser: number; runAsGroup: number; writablePaths: string[] };\n }>;\n /**\n * Effective container isolation for the BACKEND pod, already resolved through\n * `resolveAppServiceIsolation` — the authored block merged with the\n * kind-correct defaults, never the raw authored value.\n *\n * Resolved once at the config boundary rather than at each renderer because\n * two renderers consume it (k8s manifests, the compose app lane) and a\n * per-renderer fallback is how the same service row ends up running as\n * different users in two lanes.\n *\n * Carries only the authorable knobs. The floor — non-root, read-only rootfs,\n * dropped capabilities, seccomp, no service-account token — is emitted\n * unconditionally by both renderers and is deliberately not representable\n * here, so no caller can hand a value that lowers it.\n */\n isolation?: { runAsUser: number; runAsGroup: number; writablePaths: string[] };\n /**\n * Backend→worker dispatch URLs (G-8 / MW4), keyed by the worker's\n * `wildo.saas.config.ts` bucket name → `http://{appSlug}-worker-{name}:{port}`.\n * Emitted into the backend env as `WILDO_WORKER_<NAME>_URL` so the backend's\n * `WorkerRemoteClientFactory` can reach each declared worker's per-app k8s\n * Service — or, for LOCAL, the supervised worker process on loopback at its\n * authored port. Populated for BOTH location types since #426: it was REMOTE\n * only, which left the dispatch address absent in the one environment where\n * anyone could exercise the chain, so nobody ever had. Same value across a\n * given app's backend targets, like {@link runtimeEndpoints}.\n */\n workerUrls?: Record<string, string>;\n extraEnv?: Record<string, string>;\n}\n\nexport interface CompanionPlatformEnvTarget extends ApplicationRuntimeTargetAnchor {\n bootstrapCredentials: AppBootstrapCredentials;\n serviceName: string;\n /** The application root the companion belongs to (absolute). See {@link ApplicationRuntimeTargetAnchor}. */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the generated companion package (`.wildo-saas/wildo-dev-companion`). */\n relativeDir: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n extraEnv?: Record<string, string>;\n}\n\nexport interface ApplicationFrontendEnvExampleTarget extends ApplicationRuntimeTargetAnchor {\n serviceName: string;\n /** The application root the frontend belongs to (absolute). See {@link ApplicationRuntimeTargetAnchor}. */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the frontend directory (e.g. `frontend`). */\n relativeDir: string;\n envExample: Record<string, string>;\n}\n\n/**\n * App-root operator environment generated from authored infra configuration.\n * This target is deliberately distinct from backend/frontend runtime targets:\n * it serves local developer tools and must never carry deployment secrets.\n */\nexport enum ApplicationOperatorEnvFileDisposition {\n WRITE = 'WRITE',\n REMOVE = 'REMOVE',\n}\n\ninterface ApplicationOperatorEnvTargetBase {\n /** The SaaS application root (absolute) whose `.env` this target owns — the anchor of {@link ApplicationRuntimeTargetAnchor}, with no `relativeDir` because the target IS the root. */\n applicationRoot: string;\n}\n\nexport type ApplicationOperatorEnvTarget = ApplicationOperatorEnvTargetBase & (\n | {\n disposition: ApplicationOperatorEnvFileDisposition.WRITE;\n env: {\n [ApplicationCreationVerificationEnvKey.EVIDENCE_DIRECTORY]: string;\n [ApplicationCreationVerificationEnvKey.SILENT]: string;\n };\n }\n | {\n disposition: ApplicationOperatorEnvFileDisposition.REMOVE;\n }\n);\n\nexport interface ApplicationWorkerEnvTarget extends ApplicationRuntimeTargetAnchor {\n /**\n * Provider refs this runtime's `providers.scopes.*` declares.\n *\n * Threaded so the env builder can drop every provider secret outside the\n * declared scope. Previously the whole `providerEnv` bag was copied into every\n * application runtime, so a minion scoped to `openai` still received the\n * application's `STRIPE_SECRET_KEY` — an authored boundary the credential\n * layer never read.\n */\n scopedProviderRefs: readonly string[];\n bootstrapCredentials: AppBootstrapCredentials;\n workerName: string;\n serviceName: string;\n /** The application root the worker belongs to (absolute). See {@link ApplicationRuntimeTargetAnchor}. */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the worker directory (e.g. `workers/my-rust-worker`). */\n relativeDir: string;\n /**\n * The application's runtime-signals home, where a node worker records how its start ended (#3288) — the record the\n * dev supervisor reads to name a process holding the worker's port. Projected for a LOCAL deployment only.\n */\n applicationRuntimeSignalsHome: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n extraEnv?: Record<string, string>;\n /**\n * Authored `wildo.worker.config.ts > http`, default-applied (WorkerHttpSchema:\n * port 8080, healthPath /healthz, readyPath /readyz). Nested `http` object\n * (structurally a `WorkerHttp`) populated for every env — projected into the\n * worker `.env` (WORKER_HTTP_PORT/…) AND, for REMOTE, driving the per-worker\n * k8s Deployment container port + probes (shared by env-gen and k8s render).\n */\n http?: { port: number; healthPath: string; readyPath: string; metricsPath?: string };\n /**\n * REMOTE k8s deploy context (Phase 8) — the app slug this worker belongs to\n * plus the authored `replicas`. Drives the per-worker Deployment + ClusterIP\n * Service render. Populated for REMOTE only.\n */\n appName?: string;\n replicas?: number;\n /**\n * Authored `wildo.worker.config.ts > isolation`, schema-defaulted. Same shape,\n * same floor/authorable split and same two-renderer consumption as the minion\n * field below — see its JSDoc for why the floor is absent from this type.\n *\n * `runAsUser` genuinely varies per worker image and is why the uid stays\n * authorable at all: Wonder Todos' Node worker runs as `USER node` (1000)\n * while its Rust worker is distroless `nonroot` (65532). A single hardcoded\n * uid would make one of the two unable to read its own image layers.\n */\n isolation?: { runAsUser?: number; runAsGroup?: number; writablePaths?: string[]; pidsLimit?: number };\n}\n\n/**\n * Minions run the full backend pipeline (headless mode), so their env\n * contract mirrors ApplicationBackendEnvTarget: same data-service keys,\n * same bootstrap identity, same runtime topology. The `minionName` field\n * carries the authored bucket key from `wildo.saas.config.ts > minions`\n * for logging and error messages; it is deliberately NOT emitted as an\n * `APP_OWNED_SERVICE_NAME` env var. The Node minion runtime sources its\n * identity from its compiled-in `defineMinionInit({ minionName })` config\n * (cross-validated against the fetched `appConfig.minions[name]`), so an\n * env identity would be a second, drift-prone authority. See the\n * `BackgroundRuntimeType` model JSDoc in `@wildo-ai/saas-models` for the\n * worker (env-read) vs minion (compiled-in) identity distinction.\n */\nexport interface ApplicationMinionEnvTarget extends ApplicationRuntimeTargetAnchor {\n /**\n * Provider refs this runtime's `providers.scopes.*` declares.\n *\n * Threaded so the env builder can drop every provider secret outside the\n * declared scope. Previously the whole `providerEnv` bag was copied into every\n * application runtime, so a minion scoped to `openai` still received the\n * application's `STRIPE_SECRET_KEY` — an authored boundary the credential\n * layer never read.\n */\n scopedProviderRefs: readonly string[];\n /**\n * What this minion DECLARED about its access — forwarded to the env builder,\n * which withholds a backing service's topology from a runtime that may not\n * reach it (Step 5-egress / R-COHERENCE). Required, because an omitted\n * declaration and a declaration of nothing are different statements.\n */\n accessDeclaration: RuntimeAccessDeclaration;\n bootstrapCredentials: AppBootstrapCredentials;\n minionName: string;\n serviceName: string;\n /** The application root the minion belongs to (absolute). See {@link ApplicationRuntimeTargetAnchor}. */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the minion directory (e.g. `services/minions/marketing-scrapper`). */\n relativeDir: string;\n /** Absolute app-layout authority shared with the companion; never derive it from the minion directory. */\n applicationRuntimeSignalsHome: string;\n appDatabaseName?: string;\n redisKeyPrefix?: string;\n storageBucketPrefix?: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n /**\n * Authored `wildo.minion.config.ts > isolation`, schema-defaulted. Consumed by\n * BOTH deploy renderers (k8s securityContext + volumes; compose\n * `user`/`read_only`/`tmpfs`/`pids_limit`), which is why it is not confined to\n * the REMOTE-only fields below.\n *\n * Carries only the authorable knobs. The security floor — non-root, read-only\n * root filesystem, dropped capabilities, seccomp, no service-account token —\n * is emitted unconditionally by the renderers and is deliberately absent from\n * this shape, so no caller can hand a value that lowers it.\n */\n isolation?: { runAsUser?: number; runAsGroup?: number; writablePaths?: string[]; pidsLimit?: number };\n extraEnv?: Record<string, string>;\n /**\n * REMOTE k8s deploy context (Phase 8) — the app slug this minion belongs to\n * plus the authored `wildo.minion.config.ts > reinstantiation` + `liveness`.\n * The render maps `reinstantiationPolicy` → K8s strategy\n * (`kill_previous`→Recreate, `let_run`→RollingUpdate) and derives the liveness\n * probes and heartbeat env from the liveness spec. Populated for REMOTE only.\n */\n appName?: string;\n reinstantiationPolicy?: 'kill_previous' | 'let_run';\n gracePeriodSec?: number;\n /**\n * The PARSED `liveness` block, whole — never a hand-picked subset. The subset this used to carry dropped\n * `heartbeat.intervalSec`, the one value the heartbeat writer and the probe cadence must share (#1859).\n */\n liveness?: MinionLiveness;\n}\n\nexport function buildPlatformServiceEnvMap(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n frameworkPath: string,\n): Record<string, Record<string, string>> {\n // Single load+hydrate seam (loadInfraHydratedConfig): the setup-time config.json omits the\n // infra-posture blocks, so the platform hosts (same otel-preload `--import` + flush logic) would\n // emit no OTEL_*/LOG_LEVEL without this. Reached from BOTH `local up` (platform-lifecycle) and the\n // env-file wrapper below.\n const config = loadInfraHydratedConfig(env);\n\n const addressCtx = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.HOST_FACING);\n const addresses = ServiceAddressResolver.resolve(addressCtx);\n // Each platform host tags its OTel `service.version` from its OWN package.json version (audit A-10\n // parity with the app hosts). Resolved here because this is where the framework repository root is\n // available; the pure env-map builders receive the already-read version string.\n const repositoryRoot = resolveFrameworkLayout(frameworkPath).repositoryRoot;\n\n const envByDir: Record<string, Record<string, string>> = {\n [PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir]:\n PlatformEnvVarsBuilder.buildAppsManagerFullEnv(credentials, addresses, config, env, {\n serviceVersion: readHostVersion(\n repositoryRoot,\n PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir,\n ),\n }),\n };\n\n for (const service of BOOTSTRAP_PLATFORM_SERVICES) {\n envByDir[PLATFORM_SERVICE_CATALOG[service].sourceDir] = PlatformEnvVarsBuilder.buildBootstrapEnv(\n service,\n credentials,\n addresses,\n config,\n env,\n readHostVersion(repositoryRoot, PLATFORM_SERVICE_CATALOG[service].sourceDir),\n );\n }\n\n return envByDir;\n}\n\nexport function generatePlatformServiceEnvFiles(\n env: PlatformEnvironmentConfiguration,\n frameworkPath: string,\n credentials: PlatformEnvSecretsJson,\n log: Logger,\n applicationBackends?: ApplicationBackendEnvTarget[],\n companionApis?: CompanionPlatformEnvTarget[],\n applicationFrontends?: ApplicationFrontendEnvExampleTarget[],\n applicationWorkers?: ApplicationWorkerEnvTarget[],\n applicationMinions?: ApplicationMinionEnvTarget[],\n applicationOperators?: ApplicationOperatorEnvTarget[],\n writePolicy?: {\n /**\n * Skip the SHARED platform-service `.env` writes (apps-manager, module-registry, crontabs) while\n * still writing the invoking application's own targets. Set by `env-sync` when a FOREIGN\n * `wildo local dev` session owns the platform (issue #50): those files carry the running\n * platform's credential basis and are the owner's to regenerate.\n */\n skipPlatformServiceEnvs?: boolean;\n },\n): void {\n const platformServiceEnvs = buildPlatformServiceEnvMap(env, credentials, frameworkPath);\n // Single load+hydrate seam (loadInfraHydratedConfig) for the app-host loops below; the platform\n // hosts are hydrated the same way inside buildPlatformServiceEnvMap above.\n const config = loadInfraHydratedConfig(env);\n const addressCtx = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.HOST_FACING);\n const addresses = ServiceAddressResolver.resolve(addressCtx);\n const frameworkLayout = resolveFrameworkLayout(frameworkPath);\n let serviceCount = 0;\n\n // Provider-secrets sink (LOCAL only). Written here — the SOLE writer of every\n // Wildo non-compose `.env` — so it is present exactly whenever the backend\n // `.env` is, after `wildo config sync` AND after the `wildo local dev`\n // bootstrap, for out-of-band consumers (framework-dev test harnesses).\n const providerSecretsEnvPath = generateProviderSecretsEnvFile(env, credentials);\n if (providerSecretsEnvPath) {\n log.success(` Generated provider-secrets env file: ${providerSecretsEnvPath}`);\n }\n\n /*\n * A HOSTED environment never writes the platform services' env files, whatever the caller asked: those\n * files are its host's platform generation. Skipped here rather than refused, because this function\n * also writes the application's OWN targets below, which are exactly what a hosted application needs.\n */\n if (writePolicy?.skipPlatformServiceEnvs !== true && !InfrastructureHost.isHosted(env)) {\n writeEnvFile(\n join(\n frameworkLayout.repositoryRoot,\n PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir,\n FILE_NAMES.DOT_ENV,\n ),\n platformServiceEnvs[PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir],\n );\n serviceCount++;\n\n for (const [dir, serviceEnv] of Object.entries(platformServiceEnvs)) {\n if (dir === PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir) {\n continue;\n }\n writeEnvFile(join(frameworkLayout.repositoryRoot, dir, FILE_NAMES.DOT_ENV), serviceEnv);\n serviceCount++;\n }\n\n log.success(` Generated .env files for ${serviceCount} platform services`);\n }\n\n if (applicationOperators?.length) {\n for (const operator of applicationOperators) {\n applyApplicationOperatorEnvTarget(operator);\n }\n log.success(` Reconciled .env files for ${applicationOperators.length} application operator root(s)`);\n }\n\n if (applicationBackends?.length) {\n let appCount = 0;\n /*\n * The host's Docker bridge gateway, when a compose runtime's `host.docker.internal` resolves to an address of this\n * host that the loopback bind does not serve (Docker Engine for Linux, #3387). Asked of the daemon once per\n * generation, LOCAL only: every host-run backend on this machine shares the answer.\n */\n const containerHostGatewayListenHost = env.locationType === WildoLocationType.LOCAL ? resolveContainerHostGatewayListenHost() : undefined;\n for (const app of applicationBackends) {\n assertNoApplicationBackendReservedEnvOverrides(app.extraEnv, `application backend ${app.serviceName}`);\n const appEnv = {\n ...PlatformEnvVarsBuilder.buildApplicationBackendEnv(\n app.bootstrapCredentials,\n app.serviceName,\n credentials,\n addresses,\n config,\n env.name,\n declaredProviderScope(app.scopedProviderRefs),\n {\n serviceVersion: readHostVersion(app.applicationRoot, app.relativeDir),\n appDatabaseName: app.appDatabaseName,\n redisKeyPrefix: app.redisKeyPrefix,\n storageBucketPrefix: app.storageBucketPrefix,\n deploymentLocationType: env.locationType,\n runtimeSignalsHome: env.locationType === WildoLocationType.LOCAL\n ? app.applicationRuntimeSignalsHome\n : undefined,\n mongodbDirectConnection: env.locationType === WildoLocationType.LOCAL,\n runtimeEndpoints: app.runtimeEndpoints,\n // A host-run backend listens on the IPv4 loopback, so a compose minion or worker reaches it through the\n // host gateway (#3382); `localhost` alone binds `::1`, which the gateway does not reach.\n ...(env.locationType === WildoLocationType.LOCAL ? { listenHost: LOCAL_APPLICATION_BACKEND_LISTEN_HOST } : {}),\n // On Docker Engine for Linux the gateway is the bridge address, which loopback does not serve (#3387).\n ...(containerHostGatewayListenHost !== undefined ? { containerHostGatewayListenHost } : {}),\n /*\n * Backend→worker dispatch URLs (#426). The target has carried these since G-8 and this\n * writer did not forward them, so `WILDO_WORKER_<NAME>_URL` reached the k8s render and\n * never reached a developer's `backend-api/.env` — the second site of the same invariant,\n * and the reason the chain was unreachable in the only environment anyone could try it in.\n *\n * Forwarded unconditionally: whether a LOCAL target HAS a URL is decided once, in\n * `buildApplicationWorkerDispatchUrls`, and re-deciding it here would be a second opinion\n * about the same question.\n */\n workerUrls: app.workerUrls,\n },\n ),\n ...(app.extraEnv ?? {}),\n };\n // LOCAL-lane durable trust-anchor dir for the immudb audit provider (cross-restart tamper-evidence).\n // Provision it ONLY when immudb audit is configured (its connection secret is present) and not\n // already pinned by the operator. The value is a host absolute path under the durable local_data\n // tier — preserved by `wildo local down`, and wiped by `reset` together with the local immudb's data\n // (`IMMUDB_AUDIT_STATE_LOCAL_DATA_DIR`). An anchor left behind is not harmless: the state-signing key is\n // pinned, and under a pin a fresh ledger below an old anchor is a PROVEN tamper (#3775). This is the\n // LOCAL mechanism ONLY: a host path is meaningless inside a container. REMOTE (staging/production)\n // provisions the anchor on a durable IN-CONTAINER volume instead — the k8s app-backend Deployment\n // mounts a PVC and sets IMMUDB_STATE_DIR (`K8sManifestGenerator.buildForApplication` /\n // `renderApplicationForTarget` + `backend.immudb-audit-state.pvc.yaml.hbs`), and the compose app\n // backend mounts a named volume and sets IMMUDB_STATE_DIR (`docker-compose.app.yml.hbs`, wired in\n // `generateCiDeployArtifacts`). Both use `IMMUDB_AUDIT_STATE_CONTAINER_DIR`.\n if (\n env.locationType === WildoLocationType.LOCAL &&\n credentials.providerEnv?.IMMUDB_HOST &&\n !appEnv['IMMUDB_STATE_DIR']\n ) {\n appEnv['IMMUDB_STATE_DIR'] = EnvironmentPaths.resolveScopedLocalDataServiceDir(app.applicationRoot, IMMUDB_AUDIT_STATE_LOCAL_DATA_DIR);\n }\n writeEnvFile(join(app.applicationRoot, app.relativeDir, FILE_NAMES.DOT_ENV), appEnv);\n appCount++;\n }\n log.success(` Generated .env files for ${appCount} application backend(s)`);\n }\n\n if (companionApis?.length) {\n let companionCount = 0;\n for (const companion of companionApis) {\n const companionEnv = PlatformEnvVarsBuilder.buildCompanionPlatformEnv(\n companion.bootstrapCredentials,\n companion.serviceName,\n credentials,\n addresses,\n config,\n env,\n {\n runtimeEndpoints: companion.runtimeEndpoints,\n host: companion.extraEnv?.HOST,\n port: companion.extraEnv?.PORT ? Number(companion.extraEnv.PORT) : undefined,\n serviceVersion: readHostVersion(companion.applicationRoot, companion.relativeDir),\n },\n );\n writeEnvFile(\n join(companion.applicationRoot, companion.relativeDir, FILE_NAMES.DOT_ENV),\n companionEnv,\n );\n companionCount++;\n }\n log.success(` Generated .env files for ${companionCount} companion API service(s)`);\n }\n\n if (applicationFrontends?.length) {\n let frontendCount = 0;\n for (const frontend of applicationFrontends) {\n // BOTH files, and `.env` is the one that matters.\n //\n // Every other service kind here writes `FILE_NAMES.DOT_ENV`. Frontends stopped at\n // `.env.example`, which Vite's `loadEnv` never reads — so the file the dev server actually\n // consumes was generated by nobody and maintained by hand. That is not a cosmetic gap:\n // `environment-hydration.utils.ts` records what it cost on 2026-08-13. Sync reconciled an\n // edge scheme into `.env.example` and `APPLICATION_RUNTIME_ENDPOINTS`, the hand-written\n // `app/.env` kept its older value, the browser sent an `Origin` the backend did not expect,\n // and `_validateFrontendAppOrigin` refused every `POST /auth/identify` with a 403. Login was\n // completely broken and nothing in any log named the cause.\n //\n // Generating `.env` makes the frontend match every sibling: the file the runtime reads is the\n // file this generator owns, so it cannot drift from the topology it was derived from. A\n // developer who needs a local override still has Vite's `.env.local`, which takes precedence\n // and is not generated — the supported seam for that, rather than editing a derived file.\n //\n // `.env.example` is still written, unchanged, as a readable reference beside it. It is NOT committed in a\n // scaffolded application (its `.gitignore` ignores `**/.env.example` since #3234): it holds the same derived\n // values as `.env`, so tracking it made every first `wildo local dev` dirty a fresh tree.\n const frontendDirectory = join(frontend.applicationRoot, frontend.relativeDir);\n writeEnvFile(join(frontendDirectory, '.env.example'), frontend.envExample);\n writeEnvFile(join(frontendDirectory, FILE_NAMES.DOT_ENV), frontend.envExample);\n frontendCount++;\n }\n log.success(` Generated .env and .env.example files for ${frontendCount} application frontend(s)`);\n }\n\n if (applicationWorkers?.length) {\n let workerCount = 0;\n for (const worker of applicationWorkers) {\n const workerEnv = {\n ...PlatformEnvVarsBuilder.buildApplicationWorkerEnv(\n worker.bootstrapCredentials,\n worker.workerName,\n worker.serviceName,\n credentials,\n config,\n env.name,\n declaredProviderScope(worker.scopedProviderRefs),\n {\n // Project the authored HTTP surface (carried on the target,\n // default-applied from `wildo.worker.config.ts > http` and shared\n // with the REMOTE k8s render) into the worker `.env`.\n http: worker.http,\n serviceVersion: readHostVersion(worker.applicationRoot, worker.relativeDir),\n runtimeEndpoints: worker.runtimeEndpoints,\n deploymentLocationType: env.locationType,\n runtimeSignalsHome: env.locationType === WildoLocationType.LOCAL\n ? worker.applicationRuntimeSignalsHome\n : undefined,\n // HOST-facing: this `.env` is read by a host-run worker (#2955).\n addresses,\n },\n ),\n ...(worker.extraEnv ?? {}),\n };\n writeEnvFile(join(worker.applicationRoot, worker.relativeDir, FILE_NAMES.DOT_ENV), workerEnv);\n workerCount++;\n }\n log.success(` Generated .env files for ${workerCount} application worker(s)`);\n }\n\n if (applicationMinions?.length) {\n let minionCount = 0;\n for (const minion of applicationMinions) {\n assertNoApplicationBackendReservedEnvOverrides(minion.extraEnv, `application minion ${minion.serviceName}`);\n const minionEnv = {\n ...PlatformEnvVarsBuilder.buildApplicationMinionEnv(\n minion.bootstrapCredentials,\n minion.serviceName,\n credentials,\n addresses,\n config,\n env.name,\n declaredProviderScope(minion.scopedProviderRefs),\n minion.accessDeclaration,\n {\n appDatabaseName: minion.appDatabaseName,\n redisKeyPrefix: minion.redisKeyPrefix,\n storageBucketPrefix: minion.storageBucketPrefix,\n deploymentLocationType: env.locationType,\n runtimeSignalsHome: env.locationType === WildoLocationType.LOCAL\n ? minion.applicationRuntimeSignalsHome\n : undefined,\n mongodbDirectConnection: env.locationType === WildoLocationType.LOCAL,\n runtimeEndpoints: minion.runtimeEndpoints,\n serviceVersion: readHostVersion(minion.applicationRoot, minion.relativeDir),\n },\n ),\n ...(minion.extraEnv ?? {}),\n };\n writeEnvFile(join(minion.applicationRoot, minion.relativeDir, FILE_NAMES.DOT_ENV), minionEnv);\n minionCount++;\n }\n log.success(` Generated .env files for ${minionCount} application minion(s)`);\n }\n}\n\n/**\n * Emit the per-env provider-SECRETS env file — the exact runtime provider env\n * (`PlatformEnvVarsBuilder.buildRuntimeProviderEnv`: authored `providerEnv` +\n * framework-injected immudb state key) the backend/companion/worker receive,\n * projected as a standalone `.env` for out-of-band consumers that are NOT\n * launched by `wildo local dev` (framework-dev integration test harnesses,\n * ad-hoc scripts). Carries the SAME provider VALUES as the backend `.env` (one\n * authority — `buildRuntimeProviderEnv`), so it never drifts.\n *\n * Serialized with dotenv double-quote escaping (see {@link encodeDotenvValue}),\n * NOT the raw `writeEnvFile` used for the backend `.env`: the framework-injected\n * `IMMUDB_STATE_PUBLIC_KEY` is a MULTI-LINE SPKI PEM, and a bare `key=value`\n * would split it across physical lines and break the harness loader. Escaping\n * keeps every value on one physical line and round-trips through the matched\n * loader (`engine-behavior-e2e/src/provider-env.ts`) and a standard `.env`\n * parser. Single-line values (API keys) are emitted bare, unchanged.\n *\n * DISTINCT from the runtime-SCOPE `.wildo-providers.env`\n * (`PROVIDER_RUNTIME_GENERATED_ENV_FILE_NAME`), which carries the provider\n * allow-list artifact PATH, not secret values. Never conflate them.\n *\n * LOCAL-only: remote/CI provider secrets are delivered via k8s `providers-secret`,\n * never a local plaintext file. Returns the written path, or `null` when skipped\n * (non-local env, or zero provider secrets to emit).\n */\nexport function generateProviderSecretsEnvFile(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n): string | null {\n if (env.locationType !== WildoLocationType.LOCAL) return null;\n const providerEnv = PlatformEnvVarsBuilder.buildRuntimeProviderEnv(credentials);\n if (Object.keys(providerEnv).length === 0) return null;\n const filePath = join(\n EnvironmentPaths.resolveGeneratedProvidersDir(env.name),\n FILE_NAMES.PROVIDER_SECRETS_ENV,\n );\n const dir = dirname(filePath);\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n const content = Object.entries(providerEnv)\n .map(([key, value]) => `${key}=${encodeDotenvValue(key, value)}`)\n .join('\\n');\n writeFileSync(filePath, `${GENERATED_FILE_HEADER}\\n\\n${content}\\n`);\n return filePath;\n}\n\n/**\n * dotenv encoding — the single escaping authority for EVERY `.env` this module writes\n * (the per-service files via {@link writeEnvFile} and the provider-secrets sink).\n *\n * ## What the reader actually does\n *\n * These files are read by Node processes through the `dotenv` package, whose quoting rules are\n * asymmetric and are the whole reason this function is not a one-liner:\n *\n * | Form | dotenv behaviour |\n * |-----------------|-----------------------------------------------------------------------|\n * | bare | verbatim to end of line, but TRIMMED and truncated at an inline `#` |\n * | `\"…\"` | quotes stripped, `\\n` / `\\r` EXPANDED — but `\\\"` and `\\\\` are NOT unescaped |\n * | `'…'` | quotes stripped, contents fully VERBATIM (real newlines included) |\n * | `` `…` `` | same as single quotes, verbatim |\n *\n * The double-quoted row is the trap. Escaping `\"` as `\\\"` (the JSON/shell reflex) is silently\n * LOSSY here: dotenv hands the consumer the literal backslashes. That is exactly how every\n * JSON-valued var — `APPLICATION_RUNTIME_ENDPOINTS`, `WILDO_PROVIDER_SELECTION_OVERRIDES`,\n * `WILDO_SERVICE_HOSTS` — reached `JSON.parse` as `{\\\"k\\\":…}` and threw\n * `Expected property name or '}' at position 1`, crash-looping backend-api, every minion and the\n * dev companion at startup while the error surfaced as an env *validation* failure. The same\n * lossiness applies to `\\\\`, so a value containing a real backslash was corrupted too.\n *\n * ## The encoding chosen here\n *\n * Escape only what the reader unescapes, and otherwise quote VERBATIM:\n *\n * 1. bare — for clean single-line values (API keys, URLs, ports), keeping files readable/diff-stable;\n * 2. double quotes with `\\n` / `\\r` escaped — the ONLY branch that escapes anything, and it is\n * entered only when the value has no `\"` and no `\\`, so nothing lossy can be emitted. This keeps\n * a multi-line SPKI PEM (`IMMUDB_STATE_PUBLIC_KEY`) on ONE physical line exactly as before;\n * 3. single quotes, verbatim — carries `\"` and `\\` (the JSON case) losslessly;\n * 4. backticks, verbatim — for a value carrying `'` as well;\n * 5. throw — a value carrying all three quote characters has no lossless dotenv form. Fail closed\n * at generation time rather than write config that silently misparses at startup.\n *\n * Builders hand us RAW values by contract (see the value-contract note in\n * `env-vars-builder.service.ts`) — never pre-quoted — so encoding happens exactly once, here.\n *\n * This is the LOCAL dotenv sink only. The compose (`encodeComposeEnvValue`), CI (`formatEnvFile`)\n * and k8s (raw base64) sinks have different readers and therefore different contracts — do not\n * unify them, and do not push encoding back onto the builders.\n */\nfunction encodeDotenvValue(key: string, value: string): string {\n const hasNewline = /[\\n\\r]/.test(value);\n const hasDoubleQuote = value.includes('\"');\n const hasSingleQuote = value.includes(\"'\");\n const hasBacktick = value.includes('`');\n const hasBackslash = value.includes('\\\\');\n\n if (\n !hasNewline &&\n !hasDoubleQuote &&\n !hasSingleQuote &&\n !hasBacktick &&\n !value.includes('#') &&\n value !== '' &&\n value === value.trim()\n ) {\n return value;\n }\n\n // Safe ONLY without `\"` / `\\`, the two characters dotenv refuses to unescape.\n if (!hasDoubleQuote && !hasBackslash) {\n return `\"${value.replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r')}\"`;\n }\n\n if (!hasSingleQuote) return `'${value}'`;\n\n if (!hasBacktick) return `\\`${value}\\``;\n\n throw new Error(\n `Cannot encode env var \"${key}\" for a dotenv file: its value contains a double quote, a single quote and a backtick, ` +\n `so no dotenv quoting form can carry it without corruption. Reshape the value at its builder.`,\n );\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/**\n * Write one generated `.env`, serializing every value through {@link encodeDotenvValue}.\n *\n * These files are loaded by Node processes through the `dotenv` package. That reader — not any\n * general notion of \"escaped\" — is the contract {@link encodeDotenvValue} is written against.\n *\n * Two defects came from ignoring it, in opposite directions, and both are pinned by tests:\n * - a bare `key=value` silently BROKE every multi-line value: the immudb `IMMUDB_STATE_PUBLIC_KEY`\n * SPKI PEM spilled across four physical lines and dotenv kept only `-----BEGIN PUBLIC KEY-----`,\n * so the audit client could not parse its pinned key and fail-closed into a FALSE\n * \"immudb audit store TAMPER DETECTED\";\n * - the escaping added to fix that then over-reached and escaped `\"` as `\\\"`, which dotenv does NOT\n * unescape, so every JSON-valued var (`APPLICATION_RUNTIME_ENDPOINTS`, …) reached `JSON.parse`\n * with literal backslashes and crash-looped backend-api, the minions and the companion.\n *\n * Encoding is the serializer's job — do not push it back onto the builders (the k8s and compose\n * sinks have different readers and would then receive literal quotes).\n */\nfunction writeEnvFile(filePath: string, env: Record<string, string>): void {\n const dir = dirname(filePath);\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n\n const content = Object.entries(env)\n .map(([key, value]) => `${key}=${encodeDotenvValue(key, value)}`)\n .join('\\n');\n\n writeFileSync(filePath, GENERATED_FILE_HEADER + '\\n\\n' + content + '\\n');\n}\n\nconst APPLICATION_OPERATOR_ENV_HEADER = `${GENERATED_FILE_HEADER}\\n# application-creation-verification operator environment`;\nconst APPLICATION_OPERATOR_WRITABLE_ENV_KEYS = [\n ApplicationCreationVerificationEnvKey.EVIDENCE_DIRECTORY,\n ApplicationCreationVerificationEnvKey.SILENT,\n] as const;\n\n/**\n * Reconcile the CLI-owned app-root operator env without following symlinks.\n *\n * The component checks cover hostile state that already exists when sync owns\n * the path. Descriptor-relative publication is not available through Node's\n * portable filesystem API, so this does not claim race freedom against an\n * actively mutating same-UID process; the final file itself is opened with\n * `O_NOFOLLOW` and rechecked against its pathname identity.\n */\nfunction applyApplicationOperatorEnvTarget(target: ApplicationOperatorEnvTarget): void {\n const applicationRoot = resolveCanonicalApplicationOperatorRoot(target.applicationRoot);\n const filePath = join(applicationRoot, FILE_NAMES.DOT_ENV);\n\n if (target.disposition === ApplicationOperatorEnvFileDisposition.REMOVE) {\n removeOwnedApplicationOperatorEnvFile(filePath);\n return;\n }\n\n const suppliedKeys = Object.keys(target.env).sort();\n const expectedKeys = [...APPLICATION_OPERATOR_WRITABLE_ENV_KEYS].sort();\n if (suppliedKeys.length !== expectedKeys.length || suppliedKeys.some((key, index) => key !== expectedKeys[index])) {\n throw new Error(`Application operator environment must contain exactly: ${expectedKeys.join(', ')}.`);\n }\n\n const content = Object.entries(target.env)\n .map(([key, value]) => `${key}=${encodeDotenvValue(key, value)}`)\n .join('\\n');\n let created = false;\n let descriptor: number;\n try {\n descriptor = openSync(\n filePath,\n fsConstants.O_WRONLY | fsConstants.O_CREAT | fsConstants.O_EXCL | fsConstants.O_NOFOLLOW,\n 0o600,\n );\n created = true;\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'EEXIST') throw error;\n descriptor = openSync(filePath, fsConstants.O_RDWR | fsConstants.O_NOFOLLOW);\n }\n try {\n const opened = fstatSync(descriptor);\n if (!opened.isFile()) {\n throw new Error(`Application operator environment target is not a regular file: ${filePath}.`);\n }\n assertCurrentUserSingleLinkFile(opened, filePath, ApplicationOperatorEnvironmentFileOperation.PUBLICATION);\n if (!created && !readFileSync(descriptor, 'utf8').startsWith(`${APPLICATION_OPERATOR_ENV_HEADER}\\n`)) {\n throw new Error(`Refusing to overwrite an app-root .env file not owned by application-creation verification: ${filePath}.`);\n }\n fchmodSync(descriptor, 0o600);\n ftruncateSync(descriptor, 0);\n // ⚠️ Written at an EXPLICIT position 0, not via `writeFileSync(fd, …)`.\n //\n // The ownership check above calls `readFileSync(descriptor)`, which ADVANCES\n // the descriptor's file position to EOF. `ftruncateSync` resets the file's\n // LENGTH but not that position, so a positionless write lands at the old\n // offset and the kernel fills the gap with NUL bytes.\n //\n // The failure is self-inflicting and delayed, which is what made it hard to\n // see: the write SUCCEEDS and the file reads correctly to a human (the NULs\n // are invisible in most editors), but the header no longer sits at byte 0 —\n // so the NEXT sync fails the `startsWith(HEADER)` check and refuses to\n // overwrite a file the framework itself had just written. Observed on Wonder\n // Todos as exactly 240 NUL bytes in front of 240 bytes of correct content.\n writeSync(descriptor, `${APPLICATION_OPERATOR_ENV_HEADER}\\n\\n${content}\\n`, 0, 'utf8');\n const current = lstatSync(filePath);\n assertCurrentUserSingleLinkFile(current, filePath, ApplicationOperatorEnvironmentFileOperation.PUBLICATION);\n if (current.isSymbolicLink() || current.dev !== opened.dev || current.ino !== opened.ino) {\n throw new Error(`Application operator environment pathname identity changed during publication: ${filePath}.`);\n }\n } finally {\n closeSync(descriptor);\n }\n}\n\nfunction removeOwnedApplicationOperatorEnvFile(filePath: string): void {\n try {\n lstatSync(filePath);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return;\n throw error;\n }\n\n const descriptor = openSync(filePath, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW);\n try {\n const opened = fstatSync(descriptor);\n if (!opened.isFile()) {\n throw new Error(`Application operator environment removal target is not a regular file: ${filePath}.`);\n }\n assertCurrentUserSingleLinkFile(opened, filePath, ApplicationOperatorEnvironmentFileOperation.REMOVAL);\n const content = readFileSync(descriptor, 'utf8');\n if (!content.startsWith(`${APPLICATION_OPERATOR_ENV_HEADER}\\n`)) {\n throw new Error(`Refusing to remove an app-root .env file not owned by application-creation verification: ${filePath}.`);\n }\n const current = lstatSync(filePath);\n assertCurrentUserSingleLinkFile(current, filePath, ApplicationOperatorEnvironmentFileOperation.REMOVAL);\n if (current.isSymbolicLink() || current.dev !== opened.dev || current.ino !== opened.ino) {\n throw new Error(`Application operator environment pathname identity changed before removal: ${filePath}.`);\n }\n unlinkSync(filePath);\n } finally {\n closeSync(descriptor);\n }\n}\n\n/**\n * Which side of the operator-environment file lifecycle a single-link assertion is guarding.\n *\n * The member VALUES are interpolated verbatim into the thrown messages (\"… environment publication\n * requires …\"), so they read as prose while still being a closed two-member vocabulary rather than\n * a free-form string an caller could mistype into an incoherent error.\n */\nenum ApplicationOperatorEnvironmentFileOperation {\n /** Writing the operator environment file. */\n PUBLICATION = 'publication',\n /** Unlinking the operator environment file. */\n REMOVAL = 'removal',\n}\n\nfunction assertCurrentUserSingleLinkFile(\n status: { uid: number; nlink: number },\n filePath: string,\n operation: ApplicationOperatorEnvironmentFileOperation,\n): void {\n if (typeof process.getuid !== 'function') {\n throw new Error(`Application operator environment ${operation} cannot establish current-user ownership on this platform: ${filePath}.`);\n }\n if (status.uid !== process.getuid() || status.nlink !== 1) {\n throw new Error(`Application operator environment ${operation} requires a current-user-owned single-link file: ${filePath}.`);\n }\n}\n\n/**\n * The canonical directory the operator `.env` is written into: the application root, symlinks\n * resolved, and proven to be a real directory. Until 2026-09-06 this walked every path segment\n * from the FRAMEWORK repository root down to the application and refused anything that was not\n * strictly below it — an application was assumed to live under `examples/` of a checkout. An\n * app-creator application lives wherever its author put it, so the anchor is the application\n * root itself; the write below still opens the file `O_NOFOLLOW` and re-checks its identity.\n */\nfunction resolveCanonicalApplicationOperatorRoot(applicationRoot: string): string {\n const lexicalApplicationRoot = resolve(applicationRoot);\n const status = lstatSync(lexicalApplicationRoot);\n if (!status.isDirectory()) {\n throw new Error(`Application operator environment root is not a directory: ${lexicalApplicationRoot}.`);\n }\n return realpathSync(lexicalApplicationRoot);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"env-configuration-generator.service.js","sourceRoot":"","sources":["../../../../src/services/environment/env-configuration-generator.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,IAAI,WAAW,EACxB,UAAU,EACV,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,GACV,MAAM,IAAI,CAAC;AACZ,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EACL,sBAAsB,EAGtB,2BAA2B,EAC3B,qCAAqC,EACrC,iBAAiB,GAElB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,iCAAiC,EAAE,MAAM,yDAAyD,CAAC;AAC5G,OAAO,EAAE,qCAAqC,EAAE,MAAM,0DAA0D,CAAC;AACjH,OAAO,EAAE,qCAAqC,EAAE,MAAM,oEAAoE,CAAC;AAC3H,OAAO,EAAE,kBAAkB,EAAE,MAAM,6DAA6D,CAAC;AACjG,OAAO,EAAE,qBAAqB,EAAE,gCAAgC,EAAuB,MAAM,+BAA+B,CAAC;AAC7H,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,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AC","sourcesContent":["import {\n closeSync,\n constants as fsConstants,\n existsSync,\n fchmodSync,\n fstatSync,\n ftruncateSync,\n lstatSync,\n mkdirSync,\n openSync,\n readFileSync,\n realpathSync,\n unlinkSync,\n writeFileSync,\n writeSync,\n} from 'fs';\nimport { dirname, join, resolve } from 'path';\nimport {\n resolveFrameworkLayout,\n type AppBootstrapCredentials,\n type K8sIngressRoute,\n BOOTSTRAP_PLATFORM_SERVICES,\n ApplicationCreationVerificationEnvKey,\n WildoLocationType,\n type RuntimeAccessDeclaration,\n} from '@wildo-ai/platform-config-lib';\nimport type { PlatformEnvConfigJson, PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { IMMUDB_AUDIT_STATE_LOCAL_DATA_DIR } from '~wildo-cli/services/data-services/data-services.schemas';\nimport { LOCAL_APPLICATION_BACKEND_LISTEN_HOST } from '~wildo-cli/services/environment/platform-runtime.schemas';\nimport { resolveContainerHostGatewayListenHost } from '~wildo-cli/services/environment/container-host-gateway-listen-host';\nimport { InfrastructureHost } from '~wildo-cli/services/environment/infrastructure-host.service';\nimport { PlatformWildoServices, resolveApplicationDatabaseEngine, type MinionLiveness } from '@wildo-ai/platform-config-lib';\nimport { PLATFORM_SERVICE_CATALOG } from '~wildo-cli/services/catalog/service-catalog.schemas';\nimport { FILE_NAMES, GENERATED_FILE_HEADER } from '~wildo-cli/infrastructure/io/io.schemas';\nimport { ServiceAddressResolver, AddressPerspective } from '~wildo-cli/services/catalog/service-address-resolver.service';\nimport { PlatformEnvVarsBuilder } from '~wildo-cli/services/environment/env-vars-builder.service';\nimport { declaredProviderScope } from '~wildo-cli/services/credentials/provider-env-vars.utils';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport { APPLICATION_BACKEND_ENV_KEY_LIST } from '@wildo-ai/platform-core-shared';\nimport { assertProfileRunsDeclaredMinions } from '~wildo-cli/services/environment/environment-service-profile.utils';\n\nconst APPLICATION_BACKEND_RESERVED_ENV_KEYS = new Set<string>(APPLICATION_BACKEND_ENV_KEY_LIST);\n\nfunction assertNoApplicationBackendReservedEnvOverrides(extraEnv: Readonly<Record<string, string>> | undefined, targetDescription: string): void {\n const overriddenKeys = Object.keys(extraEnv ?? {}).filter((key) => APPLICATION_BACKEND_RESERVED_ENV_KEYS.has(key)).sort();\n if (overriddenKeys.length > 0) {\n throw new Error(`${targetDescription} extraEnv cannot override canonical application-backend environment keys: ${overriddenKeys.join(', ')}`);\n }\n}\n\n/**\n * Read a host package.json `version` for OTel `service.version` (audit A-10). Returns undefined\n * when the file or field is absent — `service.version` is then simply omitted (graceful).\n */\nfunction readHostVersion(repositoryRoot: string, relativeDir: string): string | undefined {\n try {\n const pkg = JSON.parse(\n readFileSync(join(repositoryRoot, relativeDir, 'package.json'), 'utf8'),\n ) as { version?: unknown };\n return typeof pkg.version === 'string' ? pkg.version : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Hydrate the infra posture blocks (`logging`, `observability`, `providerSelection`, `email`, `ownershipDnsStandIn`) onto a freshly-loaded\n * `config.json` from the registry `env` (refreshed from authored infra by `RuntimeBootstrap.refreshEnvFromAuthored`).\n *\n * Two writers produce `config.json`. The AUTHORED projection (`buildConfigJsonFromInfraEnvConfig`) carries these\n * blocks; the local lane writes it (`RuntimeBootstrap.ensureConfigJson`, #2311). The SETUP-time file\n * (`credentials.service.ts`), which a remote environment keeps, carries them since #2310 only when the environment\n * authors a descriptor (`overlayAuthoredInfraMembers`), and `loadConfigForSync` lays the descriptor over it again on\n * every sync and writes the result back (`persistAuthoredOverlay`). The registry `env` still wins over the file\n * (audit A-6, `env.x ?? config.x`), because a caller may hand a record setup seeded from the descriptor beside a file\n * written before the overlay existed. It cannot hand a STALE one: the local record is refreshed from the descriptor\n * with absence authoritative (`refreshEnvFromAuthored`), and `hydrateEnvironmentFromConfig` takes these members from\n * the overlaid `config.json`, absence included. Without this hydration, `emitLoggingEnv` / `emitObservabilityEnv`\n * would drop `LOG_LEVEL` / `OTEL_*` (Slice 2 Phase 5b) on a pre-overlay setup file.\n *\n * Shared by BOTH `buildPlatformServiceEnvMap` (platform hosts: apps-manager, crontabs, registry) and\n * `generatePlatformServiceEnvFiles` (app hosts). The platform hosts run the same\n * `--import @wildo-ai/saas-backend-lib/otel-preload` and MUST enable OTel identically, so a single\n * shared hydration keeps every host in lockstep — a prior split left the platform-service env map\n * (built from a SEPARATE un-hydrated config load) with no `OTEL_*` while the app hosts had it.\n */\nfunction hydrateInfraPostureFromEnv(\n config: PlatformEnvConfigJson,\n env: PlatformEnvironmentConfiguration,\n): void {\n config.logging = env.logging ?? config.logging;\n config.observability = env.observability ?? config.observability;\n config.providerSelection = env.providerSelection ?? config.providerSelection;\n config.email = env.email ?? config.email;\n config.agentContentGuardrails = env.agentContentGuardrails ?? config.agentContentGuardrails;\n // Local-only (#2519): the double answering domain-ownership challenges. Same ordering as `email`.\n config.ownershipDnsStandIn = env.ownershipDnsStandIn ?? config.ownershipDnsStandIn;\n}\n\n/**\n * The SINGLE seam every env-emitting path uses to obtain the config that feeds an `emit*Env`\n * builder — the local `.env` files AND every deploy generator (compose, k8s, CI). The on-disk\n * config.json may be the SETUP snapshot (written by `credentials.service.ts`, kept by a remote environment) that\n * OMITS the infra-posture blocks (`logging`/`observability`/`providerSelection`/`email`), or the authored projection\n * that carries them (see {@link hydrateInfraPostureFromEnv}). Any builder that reads a setup snapshot raw\n * therefore emits no `OTEL_*`/`LOG_LEVEL`/provider-selection/receiving domain (the `emit*Env` builders early-return\n * on the absent block). Centralising the load+hydrate here makes that invariant UNBYPASSABLE: no\n * emit path constructs its own un-hydrated config. `providedConfig` covers the deploy callers that\n * already hold a config object (k8s/CI receive it through their options).\n */\nexport function loadInfraHydratedConfig(\n env: PlatformEnvironmentConfiguration,\n providedConfig?: PlatformEnvConfigJson | null,\n): PlatformEnvConfigJson {\n const config = providedConfig ?? EnvironmentUtils.loadConfigJson(env.name);\n if (!config) {\n throw new Error(`config.json not found for env '${env.name}' — run setup first`);\n }\n hydrateInfraPostureFromEnv(config, env);\n return config;\n}\n\n/**\n * A single container/Service port on the single-pod app deployment. `name` is a\n * K8s-valid port name (lowercase, `[a-z0-9-]`, ≤15 chars); `containerPort` is the\n * authored/derived port the app process listens on.\n */\nexport interface K8sPodPort {\n name: string;\n containerPort: number;\n}\n\n/**\n * ## Where an application's runtime targets are anchored\n *\n * Every application runtime target — backend, companion, frontend, worker, minion, and the operator\n * `.env` at the application root — carries the APPLICATION root (absolute) and a path relative to\n * it. Writers join the two; nothing about a target refers to the framework.\n *\n * Until 2026-09-06 `relativeDir` was relative to the FRAMEWORK repository root and every writer\n * joined it onto the framework path (`examples/wonder-todos/backend-api`). That assumed an\n * application lives under `examples/` of a checkout, which is true of the framework-developer lane\n * and of nothing else: an app-creator application (npm-installed CLI, application at `~/my-app`)\n * resolved every target as \"outside the framework root\" and could never receive a `.env`, so it\n * could bring the platform up and never register against it. The framework root is not a property\n * of an application; the application root is, and the framework-developer paths are unchanged by\n * the move (`<checkout>/examples/wonder-todos` + `backend-api` is the same file as before).\n */\nexport interface ApplicationRuntimeTargetAnchor {\n /** The application root (absolute): the directory holding `wildo.saas.config.ts`. */\n applicationRoot: string;\n /** Path from {@link applicationRoot} to the target's own directory. */\n relativeDir: string;\n}\n\nexport interface ApplicationBackendEnvTarget extends ApplicationRuntimeTargetAnchor {\n /** Authored SaaS service key for replica binding. Optional for secret-only targets. */\n serviceKey?: string;\n /**\n * Provider refs this runtime's `providers.scopes.*` declares.\n *\n * Threaded so the env builder can drop every provider secret outside the\n * declared scope. Previously the whole `providerEnv` bag was copied into every\n * application runtime, so a minion scoped to `openai` still received the\n * application's `STRIPE_SECRET_KEY` — an authored boundary the credential\n * layer never read.\n */\n scopedProviderRefs: readonly string[];\n bootstrapCredentials: AppBootstrapCredentials;\n serviceName: string;\n /**\n * The APPLICATION root (absolute) every target of this application is anchored on — the\n * directory holding `wildo.saas.config.ts`. See {@link ApplicationRuntimeTargetAnchor}.\n */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the backend-api directory (e.g. `backend-api`). */\n relativeDir: string;\n /** Absolute app-layout authority shared by every local backend/minion and the companion, independent of service nesting depth. */\n applicationRuntimeSignalsHome: string;\n appDatabaseName?: string;\n /**\n * Authored `wildo.saas.config.dataServices.redis.keyPrefix` (Slice 3.6).\n * Emitted as `REDIS_KEY_PREFIX` in the per-app `.env` and consumed by\n * `RedisService` as the canonical app-level Redis key namespace.\n */\n redisKeyPrefix?: string;\n /**\n * Authored `wildo.saas.config.dataServices.s3.bucketPrefix` (Slice 3.6).\n * Emitted as `STORAGE_BUCKET_PREFIX` in the per-app `.env` and prepended\n * to every application object key by `WildoManagedStorageProvider`.\n */\n storageBucketPrefix?: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n /**\n * App-level deploy context (identical across a given app's backend targets,\n * like {@link runtimeEndpoints}): the app slug + serviceHosts-driven ingress\n * routes (each targeting a per-service Service) the CI render path emits for\n * the k8s ingress / compose Traefik lane. Populated for REMOTE only.\n */\n appName?: string;\n ingressRoutes?: K8sIngressRoute[];\n /**\n * Per-service model: the BACKEND pod's ports (NOT the whole app) — the one port\n * its process binds, where health, webhooks, the OAuth provider and MCP are\n * routes (#1783). Frontends are separate nginx Deployments ({@link frontends}),\n * not folded in here. REMOTE only.\n */\n podPorts?: K8sPodPort[];\n /** The port the backend's k8s probes call: the backend's OWN port, where its health routes are served (#1760). Remote only. */\n healthPort?: number;\n /**\n * Per-service model: the app's public frontends, each deploying as its OWN\n * nginx Deployment + Service. `serviceName` is the k8s object + built image\n * name; `port` is the authored `defaultPort` the frontend Service exposes\n * (→ nginx :80). Same value across a given app's backend targets. REMOTE only.\n */\n frontends?: Array<{\n /** Authored SaaS service key, distinct from the generated service/image name. */\n serviceKey?: string;\n serviceName: string;\n port: number;\n /** Effective isolation for this frontend's nginx pod — see {@link ApplicationBackendEnvTarget.isolation}. */\n isolation?: { runAsUser: number; runAsGroup: number; writablePaths: string[] };\n }>;\n /**\n * Effective container isolation for the BACKEND pod, already resolved through\n * `resolveAppServiceIsolation` — the authored block merged with the\n * kind-correct defaults, never the raw authored value.\n *\n * Resolved once at the config boundary rather than at each renderer because\n * two renderers consume it (k8s manifests, the compose app lane) and a\n * per-renderer fallback is how the same service row ends up running as\n * different users in two lanes.\n *\n * Carries only the authorable knobs. The floor — non-root, read-only rootfs,\n * dropped capabilities, seccomp, no service-account token — is emitted\n * unconditionally by both renderers and is deliberately not representable\n * here, so no caller can hand a value that lowers it.\n */\n isolation?: { runAsUser: number; runAsGroup: number; writablePaths: string[] };\n /**\n * Backend→worker dispatch URLs (G-8 / MW4), keyed by the worker's\n * `wildo.saas.config.ts` bucket name → `http://{appSlug}-worker-{name}:{port}`.\n * Emitted into the backend env as `WILDO_WORKER_<NAME>_URL` so the backend's\n * `WorkerRemoteClientFactory` can reach each declared worker's per-app k8s\n * Service — or, for LOCAL, the supervised worker process on loopback at its\n * authored port. Populated for BOTH location types since #426: it was REMOTE\n * only, which left the dispatch address absent in the one environment where\n * anyone could exercise the chain, so nobody ever had. Same value across a\n * given app's backend targets, like {@link runtimeEndpoints}.\n */\n workerUrls?: Record<string, string>;\n extraEnv?: Record<string, string>;\n}\n\nexport interface CompanionPlatformEnvTarget extends ApplicationRuntimeTargetAnchor {\n bootstrapCredentials: AppBootstrapCredentials;\n serviceName: string;\n /** The application root the companion belongs to (absolute). See {@link ApplicationRuntimeTargetAnchor}. */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the generated companion package (`.wildo-saas/wildo-dev-companion`). */\n relativeDir: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n extraEnv?: Record<string, string>;\n}\n\nexport interface ApplicationFrontendEnvExampleTarget extends ApplicationRuntimeTargetAnchor {\n serviceName: string;\n /** The application root the frontend belongs to (absolute). See {@link ApplicationRuntimeTargetAnchor}. */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the frontend directory (e.g. `frontend`). */\n relativeDir: string;\n envExample: Record<string, string>;\n}\n\n/**\n * App-root operator environment generated from authored infra configuration.\n * This target is deliberately distinct from backend/frontend runtime targets:\n * it serves local developer tools and must never carry deployment secrets.\n */\nexport enum ApplicationOperatorEnvFileDisposition {\n WRITE = 'WRITE',\n REMOVE = 'REMOVE',\n}\n\ninterface ApplicationOperatorEnvTargetBase {\n /** The SaaS application root (absolute) whose `.env` this target owns — the anchor of {@link ApplicationRuntimeTargetAnchor}, with no `relativeDir` because the target IS the root. */\n applicationRoot: string;\n}\n\nexport type ApplicationOperatorEnvTarget = ApplicationOperatorEnvTargetBase & (\n | {\n disposition: ApplicationOperatorEnvFileDisposition.WRITE;\n env: {\n [ApplicationCreationVerificationEnvKey.EVIDENCE_DIRECTORY]: string;\n [ApplicationCreationVerificationEnvKey.SILENT]: string;\n };\n }\n | {\n disposition: ApplicationOperatorEnvFileDisposition.REMOVE;\n }\n);\n\nexport interface ApplicationWorkerEnvTarget extends ApplicationRuntimeTargetAnchor {\n /**\n * Provider refs this runtime's `providers.scopes.*` declares.\n *\n * Threaded so the env builder can drop every provider secret outside the\n * declared scope. Previously the whole `providerEnv` bag was copied into every\n * application runtime, so a minion scoped to `openai` still received the\n * application's `STRIPE_SECRET_KEY` — an authored boundary the credential\n * layer never read.\n */\n scopedProviderRefs: readonly string[];\n bootstrapCredentials: AppBootstrapCredentials;\n workerName: string;\n serviceName: string;\n /** The application root the worker belongs to (absolute). See {@link ApplicationRuntimeTargetAnchor}. */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the worker directory (e.g. `workers/my-rust-worker`). */\n relativeDir: string;\n /**\n * The application's runtime-signals home, where a node worker records how its start ended (#3288) — the record the\n * dev supervisor reads to name a process holding the worker's port. Projected for a LOCAL deployment only.\n */\n applicationRuntimeSignalsHome: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n extraEnv?: Record<string, string>;\n /**\n * Authored `wildo.worker.config.ts > http`, default-applied (WorkerHttpSchema:\n * port 8080, healthPath /healthz, readyPath /readyz). Nested `http` object\n * (structurally a `WorkerHttp`) populated for every env — projected into the\n * worker `.env` (WORKER_HTTP_PORT/…) AND, for REMOTE, driving the per-worker\n * k8s Deployment container port + probes (shared by env-gen and k8s render).\n */\n http?: { port: number; healthPath: string; readyPath: string; metricsPath?: string };\n /**\n * REMOTE k8s deploy context (Phase 8) — the app slug this worker belongs to\n * plus the authored `replicas`. Drives the per-worker Deployment + ClusterIP\n * Service render. Populated for REMOTE only.\n */\n appName?: string;\n replicas?: number;\n /**\n * Authored `wildo.worker.config.ts > isolation`, schema-defaulted. Same shape,\n * same floor/authorable split and same two-renderer consumption as the minion\n * field below — see its JSDoc for why the floor is absent from this type.\n *\n * `runAsUser` genuinely varies per worker image and is why the uid stays\n * authorable at all: Wonder Todos' Node worker runs as `USER node` (1000)\n * while its Rust worker is distroless `nonroot` (65532). A single hardcoded\n * uid would make one of the two unable to read its own image layers.\n */\n isolation?: { runAsUser?: number; runAsGroup?: number; writablePaths?: string[]; pidsLimit?: number };\n}\n\n/**\n * Minions run the full backend pipeline (headless mode), so their env\n * contract mirrors ApplicationBackendEnvTarget: same data-service keys,\n * same bootstrap identity, same runtime topology. The `minionName` field\n * carries the authored bucket key from `wildo.saas.config.ts > minions`\n * for logging and error messages; it is deliberately NOT emitted as an\n * `APP_OWNED_SERVICE_NAME` env var. The Node minion runtime sources its\n * identity from its compiled-in `defineMinionInit({ minionName })` config\n * (cross-validated against the fetched `appConfig.minions[name]`), so an\n * env identity would be a second, drift-prone authority. See the\n * `BackgroundRuntimeType` model JSDoc in `@wildo-ai/saas-models` for the\n * worker (env-read) vs minion (compiled-in) identity distinction.\n */\nexport interface ApplicationMinionEnvTarget extends ApplicationRuntimeTargetAnchor {\n /**\n * Provider refs this runtime's `providers.scopes.*` declares.\n *\n * Threaded so the env builder can drop every provider secret outside the\n * declared scope. Previously the whole `providerEnv` bag was copied into every\n * application runtime, so a minion scoped to `openai` still received the\n * application's `STRIPE_SECRET_KEY` — an authored boundary the credential\n * layer never read.\n */\n scopedProviderRefs: readonly string[];\n /**\n * What this minion DECLARED about its access — forwarded to the env builder,\n * which withholds a backing service's topology from a runtime that may not\n * reach it (Step 5-egress / R-COHERENCE). Required, because an omitted\n * declaration and a declaration of nothing are different statements.\n */\n accessDeclaration: RuntimeAccessDeclaration;\n bootstrapCredentials: AppBootstrapCredentials;\n minionName: string;\n serviceName: string;\n /** The application root the minion belongs to (absolute). See {@link ApplicationRuntimeTargetAnchor}. */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the minion directory (e.g. `services/minions/marketing-scrapper`). */\n relativeDir: string;\n /** Absolute app-layout authority shared with the companion; never derive it from the minion directory. */\n applicationRuntimeSignalsHome: string;\n appDatabaseName?: string;\n redisKeyPrefix?: string;\n storageBucketPrefix?: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n /**\n * Authored `wildo.minion.config.ts > isolation`, schema-defaulted. Consumed by\n * BOTH deploy renderers (k8s securityContext + volumes; compose\n * `user`/`read_only`/`tmpfs`/`pids_limit`), which is why it is not confined to\n * the REMOTE-only fields below.\n *\n * Carries only the authorable knobs. The security floor — non-root, read-only\n * root filesystem, dropped capabilities, seccomp, no service-account token —\n * is emitted unconditionally by the renderers and is deliberately absent from\n * this shape, so no caller can hand a value that lowers it.\n */\n isolation?: { runAsUser?: number; runAsGroup?: number; writablePaths?: string[]; pidsLimit?: number };\n extraEnv?: Record<string, string>;\n /**\n * REMOTE k8s deploy context (Phase 8) — the app slug this minion belongs to\n * plus the authored `wildo.minion.config.ts > reinstantiation` + `liveness`.\n * The render maps `reinstantiationPolicy` → K8s strategy\n * (`kill_previous`→Recreate, `let_run`→RollingUpdate) and derives the liveness\n * probes and heartbeat env from the liveness spec. Populated for REMOTE only.\n */\n appName?: string;\n reinstantiationPolicy?: 'kill_previous' | 'let_run';\n gracePeriodSec?: number;\n /**\n * The PARSED `liveness` block, whole — never a hand-picked subset. The subset this used to carry dropped\n * `heartbeat.intervalSec`, the one value the heartbeat writer and the probe cadence must share (#1859).\n */\n liveness?: MinionLiveness;\n}\n\nexport function buildPlatformServiceEnvMap(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n frameworkPath: string,\n): Record<string, Record<string, string>> {\n // Single load+hydrate seam (loadInfraHydratedConfig): the setup-time config.json omits the\n // infra-posture blocks, so the platform hosts (same otel-preload `--import` + flush logic) would\n // emit no OTEL_*/LOG_LEVEL without this. Reached from BOTH `local up` (platform-lifecycle) and the\n // env-file wrapper below.\n const config = loadInfraHydratedConfig(env);\n\n const addressCtx = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.HOST_FACING);\n const addresses = ServiceAddressResolver.resolve(addressCtx);\n // Each platform host tags its OTel `service.version` from its OWN package.json version (audit A-10\n // parity with the app hosts). Resolved here because this is where the framework repository root is\n // available; the pure env-map builders receive the already-read version string.\n const repositoryRoot = resolveFrameworkLayout(frameworkPath).repositoryRoot;\n\n const envByDir: Record<string, Record<string, string>> = {\n [PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir]:\n PlatformEnvVarsBuilder.buildAppsManagerFullEnv(credentials, addresses, config, env, {\n serviceVersion: readHostVersion(\n repositoryRoot,\n PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir,\n ),\n }),\n };\n\n for (const service of BOOTSTRAP_PLATFORM_SERVICES) {\n envByDir[PLATFORM_SERVICE_CATALOG[service].sourceDir] = PlatformEnvVarsBuilder.buildBootstrapEnv(\n service,\n credentials,\n addresses,\n config,\n env,\n readHostVersion(repositoryRoot, PLATFORM_SERVICE_CATALOG[service].sourceDir),\n );\n }\n\n return envByDir;\n}\n\nexport function generatePlatformServiceEnvFiles(\n env: PlatformEnvironmentConfiguration,\n frameworkPath: string,\n credentials: PlatformEnvSecretsJson,\n log: Logger,\n applicationBackends?: ApplicationBackendEnvTarget[],\n companionApis?: CompanionPlatformEnvTarget[],\n applicationFrontends?: ApplicationFrontendEnvExampleTarget[],\n applicationWorkers?: ApplicationWorkerEnvTarget[],\n applicationMinions?: ApplicationMinionEnvTarget[],\n applicationOperators?: ApplicationOperatorEnvTarget[],\n writePolicy?: {\n /**\n * Skip the SHARED platform-service `.env` writes (apps-manager, module-registry, crontabs) while\n * still writing the invoking application's own targets. Set by `env-sync` when a FOREIGN\n * `wildo local dev` session owns the platform (issue #50): those files carry the running\n * platform's credential basis and are the owner's to regenerate.\n */\n skipPlatformServiceEnvs?: boolean;\n },\n): void {\n // Single load+hydrate seam (loadInfraHydratedConfig) for the app-host loops below; the platform\n // hosts are hydrated the same way inside buildPlatformServiceEnvMap below.\n const config = loadInfraHydratedConfig(env);\n // #2303: a profile whose queue cannot confine its minions (the DATABASE queue on MongoDB) refuses them before ANY file is\n // written, so the native lane does not spawn a minion only for its boot to refuse it. Reads the same profile and engine\n // the minion env would carry.\n assertProfileRunsDeclaredMinions(\n { name: env.name, serviceProfile: config.serviceProfile },\n applicationMinions?.length ?? 0,\n resolveApplicationDatabaseEngine(config.applicationDatabase),\n );\n const platformServiceEnvs = buildPlatformServiceEnvMap(env, credentials, frameworkPath);\n const addressCtx = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.HOST_FACING);\n const addresses = ServiceAddressResolver.resolve(addressCtx);\n const frameworkLayout = resolveFrameworkLayout(frameworkPath);\n let serviceCount = 0;\n\n // Provider-secrets sink (LOCAL only). Written here — the SOLE writer of every\n // Wildo non-compose `.env` — so it is present exactly whenever the backend\n // `.env` is, after `wildo config sync` AND after the `wildo local dev`\n // bootstrap, for out-of-band consumers (framework-dev test harnesses).\n const providerSecretsEnvPath = generateProviderSecretsEnvFile(env, credentials);\n if (providerSecretsEnvPath) {\n log.success(` Generated provider-secrets env file: ${providerSecretsEnvPath}`);\n }\n\n /*\n * A HOSTED environment never writes the platform services' env files, whatever the caller asked: those\n * files are its host's platform generation. Skipped here rather than refused, because this function\n * also writes the application's OWN targets below, which are exactly what a hosted application needs.\n */\n if (writePolicy?.skipPlatformServiceEnvs !== true && !InfrastructureHost.isHosted(env)) {\n writeEnvFile(\n join(\n frameworkLayout.repositoryRoot,\n PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir,\n FILE_NAMES.DOT_ENV,\n ),\n platformServiceEnvs[PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir],\n );\n serviceCount++;\n\n for (const [dir, serviceEnv] of Object.entries(platformServiceEnvs)) {\n if (dir === PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir) {\n continue;\n }\n writeEnvFile(join(frameworkLayout.repositoryRoot, dir, FILE_NAMES.DOT_ENV), serviceEnv);\n serviceCount++;\n }\n\n log.success(` Generated .env files for ${serviceCount} platform services`);\n }\n\n if (applicationOperators?.length) {\n for (const operator of applicationOperators) {\n applyApplicationOperatorEnvTarget(operator);\n }\n log.success(` Reconciled .env files for ${applicationOperators.length} application operator root(s)`);\n }\n\n if (applicationBackends?.length) {\n let appCount = 0;\n /*\n * The host's Docker bridge gateway, when a compose runtime's `host.docker.internal` resolves to an address of this\n * host that the loopback bind does not serve (Docker Engine for Linux, #3387). Asked of the daemon once per\n * generation, LOCAL only: every host-run backend on this machine shares the answer.\n */\n const containerHostGatewayListenHost = env.locationType === WildoLocationType.LOCAL ? resolveContainerHostGatewayListenHost() : undefined;\n for (const app of applicationBackends) {\n assertNoApplicationBackendReservedEnvOverrides(app.extraEnv, `application backend ${app.serviceName}`);\n const appEnv = {\n ...PlatformEnvVarsBuilder.buildApplicationBackendEnv(\n app.bootstrapCredentials,\n app.serviceName,\n credentials,\n addresses,\n config,\n env.name,\n declaredProviderScope(app.scopedProviderRefs),\n {\n serviceVersion: readHostVersion(app.applicationRoot, app.relativeDir),\n appDatabaseName: app.appDatabaseName,\n redisKeyPrefix: app.redisKeyPrefix,\n storageBucketPrefix: app.storageBucketPrefix,\n deploymentLocationType: env.locationType,\n runtimeSignalsHome: env.locationType === WildoLocationType.LOCAL\n ? app.applicationRuntimeSignalsHome\n : undefined,\n mongodbDirectConnection: env.locationType === WildoLocationType.LOCAL,\n runtimeEndpoints: app.runtimeEndpoints,\n // A host-run backend listens on the IPv4 loopback, so a compose minion or worker reaches it through the\n // host gateway (#3382); `localhost` alone binds `::1`, which the gateway does not reach.\n ...(env.locationType === WildoLocationType.LOCAL ? { listenHost: LOCAL_APPLICATION_BACKEND_LISTEN_HOST } : {}),\n // On Docker Engine for Linux the gateway is the bridge address, which loopback does not serve (#3387).\n ...(containerHostGatewayListenHost !== undefined ? { containerHostGatewayListenHost } : {}),\n /*\n * Backend→worker dispatch URLs (#426). The target has carried these since G-8 and this\n * writer did not forward them, so `WILDO_WORKER_<NAME>_URL` reached the k8s render and\n * never reached a developer's `backend-api/.env` — the second site of the same invariant,\n * and the reason the chain was unreachable in the only environment anyone could try it in.\n *\n * Forwarded unconditionally: whether a LOCAL target HAS a URL is decided once, in\n * `buildApplicationWorkerDispatchUrls`, and re-deciding it here would be a second opinion\n * about the same question.\n */\n workerUrls: app.workerUrls,\n },\n ),\n ...(app.extraEnv ?? {}),\n };\n // LOCAL-lane durable trust-anchor dir for the immudb audit provider (cross-restart tamper-evidence).\n // Provision it ONLY when immudb audit is configured (its connection secret is present) and not\n // already pinned by the operator. The value is a host absolute path under the durable local_data\n // tier — preserved by `wildo local down`, and wiped by `reset` together with the local immudb's data\n // (`IMMUDB_AUDIT_STATE_LOCAL_DATA_DIR`). An anchor left behind is not harmless: the state-signing key is\n // pinned, and under a pin a fresh ledger below an old anchor is a PROVEN tamper (#3775). This is the\n // LOCAL mechanism ONLY: a host path is meaningless inside a container. REMOTE (staging/production)\n // provisions the anchor on a durable IN-CONTAINER volume instead — the k8s app-backend Deployment\n // mounts a PVC and sets IMMUDB_STATE_DIR (`K8sManifestGenerator.buildForApplication` /\n // `renderApplicationForTarget` + `backend.immudb-audit-state.pvc.yaml.hbs`), and the compose app\n // backend mounts a named volume and sets IMMUDB_STATE_DIR (`docker-compose.app.yml.hbs`, wired in\n // `generateCiDeployArtifacts`). Both use `IMMUDB_AUDIT_STATE_CONTAINER_DIR`.\n if (\n env.locationType === WildoLocationType.LOCAL &&\n credentials.providerEnv?.IMMUDB_HOST &&\n !appEnv['IMMUDB_STATE_DIR']\n ) {\n appEnv['IMMUDB_STATE_DIR'] = EnvironmentPaths.resolveScopedLocalDataServiceDir(app.applicationRoot, IMMUDB_AUDIT_STATE_LOCAL_DATA_DIR);\n }\n writeEnvFile(join(app.applicationRoot, app.relativeDir, FILE_NAMES.DOT_ENV), appEnv);\n appCount++;\n }\n log.success(` Generated .env files for ${appCount} application backend(s)`);\n }\n\n if (companionApis?.length) {\n let companionCount = 0;\n for (const companion of companionApis) {\n const companionEnv = PlatformEnvVarsBuilder.buildCompanionPlatformEnv(\n companion.bootstrapCredentials,\n companion.serviceName,\n credentials,\n addresses,\n config,\n env,\n {\n runtimeEndpoints: companion.runtimeEndpoints,\n host: companion.extraEnv?.HOST,\n port: companion.extraEnv?.PORT ? Number(companion.extraEnv.PORT) : undefined,\n serviceVersion: readHostVersion(companion.applicationRoot, companion.relativeDir),\n },\n );\n writeEnvFile(\n join(companion.applicationRoot, companion.relativeDir, FILE_NAMES.DOT_ENV),\n companionEnv,\n );\n companionCount++;\n }\n log.success(` Generated .env files for ${companionCount} companion API service(s)`);\n }\n\n if (applicationFrontends?.length) {\n let frontendCount = 0;\n for (const frontend of applicationFrontends) {\n // BOTH files, and `.env` is the one that matters.\n //\n // Every other service kind here writes `FILE_NAMES.DOT_ENV`. Frontends stopped at\n // `.env.example`, which Vite's `loadEnv` never reads — so the file the dev server actually\n // consumes was generated by nobody and maintained by hand. That is not a cosmetic gap:\n // `environment-hydration.utils.ts` records what it cost on 2026-08-13. Sync reconciled an\n // edge scheme into `.env.example` and `APPLICATION_RUNTIME_ENDPOINTS`, the hand-written\n // `app/.env` kept its older value, the browser sent an `Origin` the backend did not expect,\n // and `_validateFrontendAppOrigin` refused every `POST /auth/identify` with a 403. Login was\n // completely broken and nothing in any log named the cause.\n //\n // Generating `.env` makes the frontend match every sibling: the file the runtime reads is the\n // file this generator owns, so it cannot drift from the topology it was derived from. A\n // developer who needs a local override still has Vite's `.env.local`, which takes precedence\n // and is not generated — the supported seam for that, rather than editing a derived file.\n //\n // `.env.example` is still written, unchanged, as a readable reference beside it. It is NOT committed in a\n // scaffolded application (its `.gitignore` ignores `**/.env.example` since #3234): it holds the same derived\n // values as `.env`, so tracking it made every first `wildo local dev` dirty a fresh tree.\n const frontendDirectory = join(frontend.applicationRoot, frontend.relativeDir);\n writeEnvFile(join(frontendDirectory, '.env.example'), frontend.envExample);\n writeEnvFile(join(frontendDirectory, FILE_NAMES.DOT_ENV), frontend.envExample);\n frontendCount++;\n }\n log.success(` Generated .env and .env.example files for ${frontendCount} application frontend(s)`);\n }\n\n if (applicationWorkers?.length) {\n let workerCount = 0;\n for (const worker of applicationWorkers) {\n const workerEnv = {\n ...PlatformEnvVarsBuilder.buildApplicationWorkerEnv(\n worker.bootstrapCredentials,\n worker.workerName,\n worker.serviceName,\n credentials,\n config,\n env.name,\n declaredProviderScope(worker.scopedProviderRefs),\n {\n // Project the authored HTTP surface (carried on the target,\n // default-applied from `wildo.worker.config.ts > http` and shared\n // with the REMOTE k8s render) into the worker `.env`.\n http: worker.http,\n serviceVersion: readHostVersion(worker.applicationRoot, worker.relativeDir),\n runtimeEndpoints: worker.runtimeEndpoints,\n deploymentLocationType: env.locationType,\n runtimeSignalsHome: env.locationType === WildoLocationType.LOCAL\n ? worker.applicationRuntimeSignalsHome\n : undefined,\n // HOST-facing: this `.env` is read by a host-run worker (#2955).\n addresses,\n },\n ),\n ...(worker.extraEnv ?? {}),\n };\n writeEnvFile(join(worker.applicationRoot, worker.relativeDir, FILE_NAMES.DOT_ENV), workerEnv);\n workerCount++;\n }\n log.success(` Generated .env files for ${workerCount} application worker(s)`);\n }\n\n if (applicationMinions?.length) {\n let minionCount = 0;\n for (const minion of applicationMinions) {\n assertNoApplicationBackendReservedEnvOverrides(minion.extraEnv, `application minion ${minion.serviceName}`);\n const minionEnv = {\n ...PlatformEnvVarsBuilder.buildApplicationMinionEnv(\n minion.bootstrapCredentials,\n minion.serviceName,\n credentials,\n addresses,\n config,\n env.name,\n declaredProviderScope(minion.scopedProviderRefs),\n minion.accessDeclaration,\n {\n appDatabaseName: minion.appDatabaseName,\n redisKeyPrefix: minion.redisKeyPrefix,\n storageBucketPrefix: minion.storageBucketPrefix,\n deploymentLocationType: env.locationType,\n runtimeSignalsHome: env.locationType === WildoLocationType.LOCAL\n ? minion.applicationRuntimeSignalsHome\n : undefined,\n mongodbDirectConnection: env.locationType === WildoLocationType.LOCAL,\n runtimeEndpoints: minion.runtimeEndpoints,\n serviceVersion: readHostVersion(minion.applicationRoot, minion.relativeDir),\n },\n ),\n ...(minion.extraEnv ?? {}),\n };\n writeEnvFile(join(minion.applicationRoot, minion.relativeDir, FILE_NAMES.DOT_ENV), minionEnv);\n minionCount++;\n }\n log.success(` Generated .env files for ${minionCount} application minion(s)`);\n }\n}\n\n/**\n * Emit the per-env provider-SECRETS env file — the exact runtime provider env\n * (`PlatformEnvVarsBuilder.buildRuntimeProviderEnv`: authored `providerEnv` +\n * framework-injected immudb state key) the backend/companion/worker receive,\n * projected as a standalone `.env` for out-of-band consumers that are NOT\n * launched by `wildo local dev` (framework-dev integration test harnesses,\n * ad-hoc scripts). Carries the SAME provider VALUES as the backend `.env` (one\n * authority — `buildRuntimeProviderEnv`), so it never drifts.\n *\n * Serialized with dotenv double-quote escaping (see {@link encodeDotenvValue}),\n * NOT the raw `writeEnvFile` used for the backend `.env`: the framework-injected\n * `IMMUDB_STATE_PUBLIC_KEY` is a MULTI-LINE SPKI PEM, and a bare `key=value`\n * would split it across physical lines and break the harness loader. Escaping\n * keeps every value on one physical line and round-trips through the matched\n * loader (`engine-behavior-e2e/src/provider-env.ts`) and a standard `.env`\n * parser. Single-line values (API keys) are emitted bare, unchanged.\n *\n * DISTINCT from the runtime-SCOPE `.wildo-providers.env`\n * (`PROVIDER_RUNTIME_GENERATED_ENV_FILE_NAME`), which carries the provider\n * allow-list artifact PATH, not secret values. Never conflate them.\n *\n * LOCAL-only: remote/CI provider secrets are delivered via k8s `providers-secret`,\n * never a local plaintext file. Returns the written path, or `null` when skipped\n * (non-local env, or zero provider secrets to emit).\n */\nexport function generateProviderSecretsEnvFile(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n): string | null {\n if (env.locationType !== WildoLocationType.LOCAL) return null;\n const providerEnv = PlatformEnvVarsBuilder.buildRuntimeProviderEnv(credentials);\n if (Object.keys(providerEnv).length === 0) return null;\n const filePath = join(\n EnvironmentPaths.resolveGeneratedProvidersDir(env.name),\n FILE_NAMES.PROVIDER_SECRETS_ENV,\n );\n const dir = dirname(filePath);\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n const content = Object.entries(providerEnv)\n .map(([key, value]) => `${key}=${encodeDotenvValue(key, value)}`)\n .join('\\n');\n writeFileSync(filePath, `${GENERATED_FILE_HEADER}\\n\\n${content}\\n`);\n return filePath;\n}\n\n/**\n * dotenv encoding — the single escaping authority for EVERY `.env` this module writes\n * (the per-service files via {@link writeEnvFile} and the provider-secrets sink).\n *\n * ## What the reader actually does\n *\n * These files are read by Node processes through the `dotenv` package, whose quoting rules are\n * asymmetric and are the whole reason this function is not a one-liner:\n *\n * | Form | dotenv behaviour |\n * |-----------------|-----------------------------------------------------------------------|\n * | bare | verbatim to end of line, but TRIMMED and truncated at an inline `#` |\n * | `\"…\"` | quotes stripped, `\\n` / `\\r` EXPANDED — but `\\\"` and `\\\\` are NOT unescaped |\n * | `'…'` | quotes stripped, contents fully VERBATIM (real newlines included) |\n * | `` `…` `` | same as single quotes, verbatim |\n *\n * The double-quoted row is the trap. Escaping `\"` as `\\\"` (the JSON/shell reflex) is silently\n * LOSSY here: dotenv hands the consumer the literal backslashes. That is exactly how every\n * JSON-valued var — `APPLICATION_RUNTIME_ENDPOINTS`, `WILDO_PROVIDER_SELECTION_OVERRIDES`,\n * `WILDO_SERVICE_HOSTS` — reached `JSON.parse` as `{\\\"k\\\":…}` and threw\n * `Expected property name or '}' at position 1`, crash-looping backend-api, every minion and the\n * dev companion at startup while the error surfaced as an env *validation* failure. The same\n * lossiness applies to `\\\\`, so a value containing a real backslash was corrupted too.\n *\n * ## The encoding chosen here\n *\n * Escape only what the reader unescapes, and otherwise quote VERBATIM:\n *\n * 1. bare — for clean single-line values (API keys, URLs, ports), keeping files readable/diff-stable;\n * 2. double quotes with `\\n` / `\\r` escaped — the ONLY branch that escapes anything, and it is\n * entered only when the value has no `\"` and no `\\`, so nothing lossy can be emitted. This keeps\n * a multi-line SPKI PEM (`IMMUDB_STATE_PUBLIC_KEY`) on ONE physical line exactly as before;\n * 3. single quotes, verbatim — carries `\"` and `\\` (the JSON case) losslessly;\n * 4. backticks, verbatim — for a value carrying `'` as well;\n * 5. throw — a value carrying all three quote characters has no lossless dotenv form. Fail closed\n * at generation time rather than write config that silently misparses at startup.\n *\n * Builders hand us RAW values by contract (see the value-contract note in\n * `env-vars-builder.service.ts`) — never pre-quoted — so encoding happens exactly once, here.\n *\n * This is the LOCAL dotenv sink only. The compose (`encodeComposeEnvValue`), CI (`formatEnvFile`)\n * and k8s (raw base64) sinks have different readers and therefore different contracts — do not\n * unify them, and do not push encoding back onto the builders.\n */\nfunction encodeDotenvValue(key: string, value: string): string {\n const hasNewline = /[\\n\\r]/.test(value);\n const hasDoubleQuote = value.includes('\"');\n const hasSingleQuote = value.includes(\"'\");\n const hasBacktick = value.includes('`');\n const hasBackslash = value.includes('\\\\');\n\n if (\n !hasNewline &&\n !hasDoubleQuote &&\n !hasSingleQuote &&\n !hasBacktick &&\n !value.includes('#') &&\n value !== '' &&\n value === value.trim()\n ) {\n return value;\n }\n\n // Safe ONLY without `\"` / `\\`, the two characters dotenv refuses to unescape.\n if (!hasDoubleQuote && !hasBackslash) {\n return `\"${value.replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r')}\"`;\n }\n\n if (!hasSingleQuote) return `'${value}'`;\n\n if (!hasBacktick) return `\\`${value}\\``;\n\n throw new Error(\n `Cannot encode env var \"${key}\" for a dotenv file: its value contains a double quote, a single quote and a backtick, ` +\n `so no dotenv quoting form can carry it without corruption. Reshape the value at its builder.`,\n );\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/**\n * Write one generated `.env`, serializing every value through {@link encodeDotenvValue}.\n *\n * These files are loaded by Node processes through the `dotenv` package. That reader — not any\n * general notion of \"escaped\" — is the contract {@link encodeDotenvValue} is written against.\n *\n * Two defects came from ignoring it, in opposite directions, and both are pinned by tests:\n * - a bare `key=value` silently BROKE every multi-line value: the immudb `IMMUDB_STATE_PUBLIC_KEY`\n * SPKI PEM spilled across four physical lines and dotenv kept only `-----BEGIN PUBLIC KEY-----`,\n * so the audit client could not parse its pinned key and fail-closed into a FALSE\n * \"immudb audit store TAMPER DETECTED\";\n * - the escaping added to fix that then over-reached and escaped `\"` as `\\\"`, which dotenv does NOT\n * unescape, so every JSON-valued var (`APPLICATION_RUNTIME_ENDPOINTS`, …) reached `JSON.parse`\n * with literal backslashes and crash-looped backend-api, the minions and the companion.\n *\n * Encoding is the serializer's job — do not push it back onto the builders (the k8s and compose\n * sinks have different readers and would then receive literal quotes).\n */\nfunction writeEnvFile(filePath: string, env: Record<string, string>): void {\n const dir = dirname(filePath);\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n\n const content = Object.entries(env)\n .map(([key, value]) => `${key}=${encodeDotenvValue(key, value)}`)\n .join('\\n');\n\n writeFileSync(filePath, GENERATED_FILE_HEADER + '\\n\\n' + content + '\\n');\n}\n\nconst APPLICATION_OPERATOR_ENV_HEADER = `${GENERATED_FILE_HEADER}\\n# application-creation-verification operator environment`;\nconst APPLICATION_OPERATOR_WRITABLE_ENV_KEYS = [\n ApplicationCreationVerificationEnvKey.EVIDENCE_DIRECTORY,\n ApplicationCreationVerificationEnvKey.SILENT,\n] as const;\n\n/**\n * Reconcile the CLI-owned app-root operator env without following symlinks.\n *\n * The component checks cover hostile state that already exists when sync owns\n * the path. Descriptor-relative publication is not available through Node's\n * portable filesystem API, so this does not claim race freedom against an\n * actively mutating same-UID process; the final file itself is opened with\n * `O_NOFOLLOW` and rechecked against its pathname identity.\n */\nfunction applyApplicationOperatorEnvTarget(target: ApplicationOperatorEnvTarget): void {\n const applicationRoot = resolveCanonicalApplicationOperatorRoot(target.applicationRoot);\n const filePath = join(applicationRoot, FILE_NAMES.DOT_ENV);\n\n if (target.disposition === ApplicationOperatorEnvFileDisposition.REMOVE) {\n removeOwnedApplicationOperatorEnvFile(filePath);\n return;\n }\n\n const suppliedKeys = Object.keys(target.env).sort();\n const expectedKeys = [...APPLICATION_OPERATOR_WRITABLE_ENV_KEYS].sort();\n if (suppliedKeys.length !== expectedKeys.length || suppliedKeys.some((key, index) => key !== expectedKeys[index])) {\n throw new Error(`Application operator environment must contain exactly: ${expectedKeys.join(', ')}.`);\n }\n\n const content = Object.entries(target.env)\n .map(([key, value]) => `${key}=${encodeDotenvValue(key, value)}`)\n .join('\\n');\n let created = false;\n let descriptor: number;\n try {\n descriptor = openSync(\n filePath,\n fsConstants.O_WRONLY | fsConstants.O_CREAT | fsConstants.O_EXCL | fsConstants.O_NOFOLLOW,\n 0o600,\n );\n created = true;\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'EEXIST') throw error;\n descriptor = openSync(filePath, fsConstants.O_RDWR | fsConstants.O_NOFOLLOW);\n }\n try {\n const opened = fstatSync(descriptor);\n if (!opened.isFile()) {\n throw new Error(`Application operator environment target is not a regular file: ${filePath}.`);\n }\n assertCurrentUserSingleLinkFile(opened, filePath, ApplicationOperatorEnvironmentFileOperation.PUBLICATION);\n if (!created && !readFileSync(descriptor, 'utf8').startsWith(`${APPLICATION_OPERATOR_ENV_HEADER}\\n`)) {\n throw new Error(`Refusing to overwrite an app-root .env file not owned by application-creation verification: ${filePath}.`);\n }\n fchmodSync(descriptor, 0o600);\n ftruncateSync(descriptor, 0);\n // ⚠️ Written at an EXPLICIT position 0, not via `writeFileSync(fd, …)`.\n //\n // The ownership check above calls `readFileSync(descriptor)`, which ADVANCES\n // the descriptor's file position to EOF. `ftruncateSync` resets the file's\n // LENGTH but not that position, so a positionless write lands at the old\n // offset and the kernel fills the gap with NUL bytes.\n //\n // The failure is self-inflicting and delayed, which is what made it hard to\n // see: the write SUCCEEDS and the file reads correctly to a human (the NULs\n // are invisible in most editors), but the header no longer sits at byte 0 —\n // so the NEXT sync fails the `startsWith(HEADER)` check and refuses to\n // overwrite a file the framework itself had just written. Observed on Wonder\n // Todos as exactly 240 NUL bytes in front of 240 bytes of correct content.\n writeSync(descriptor, `${APPLICATION_OPERATOR_ENV_HEADER}\\n\\n${content}\\n`, 0, 'utf8');\n const current = lstatSync(filePath);\n assertCurrentUserSingleLinkFile(current, filePath, ApplicationOperatorEnvironmentFileOperation.PUBLICATION);\n if (current.isSymbolicLink() || current.dev !== opened.dev || current.ino !== opened.ino) {\n throw new Error(`Application operator environment pathname identity changed during publication: ${filePath}.`);\n }\n } finally {\n closeSync(descriptor);\n }\n}\n\nfunction removeOwnedApplicationOperatorEnvFile(filePath: string): void {\n try {\n lstatSync(filePath);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return;\n throw error;\n }\n\n const descriptor = openSync(filePath, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW);\n try {\n const opened = fstatSync(descriptor);\n if (!opened.isFile()) {\n throw new Error(`Application operator environment removal target is not a regular file: ${filePath}.`);\n }\n assertCurrentUserSingleLinkFile(opened, filePath, ApplicationOperatorEnvironmentFileOperation.REMOVAL);\n const content = readFileSync(descriptor, 'utf8');\n if (!content.startsWith(`${APPLICATION_OPERATOR_ENV_HEADER}\\n`)) {\n throw new Error(`Refusing to remove an app-root .env file not owned by application-creation verification: ${filePath}.`);\n }\n const current = lstatSync(filePath);\n assertCurrentUserSingleLinkFile(current, filePath, ApplicationOperatorEnvironmentFileOperation.REMOVAL);\n if (current.isSymbolicLink() || current.dev !== opened.dev || current.ino !== opened.ino) {\n throw new Error(`Application operator environment pathname identity changed before removal: ${filePath}.`);\n }\n unlinkSync(filePath);\n } finally {\n closeSync(descriptor);\n }\n}\n\n/**\n * Which side of the operator-environment file lifecycle a single-link assertion is guarding.\n *\n * The member VALUES are interpolated verbatim into the thrown messages (\"… environment publication\n * requires …\"), so they read as prose while still being a closed two-member vocabulary rather than\n * a free-form string an caller could mistype into an incoherent error.\n */\nenum ApplicationOperatorEnvironmentFileOperation {\n /** Writing the operator environment file. */\n PUBLICATION = 'publication',\n /** Unlinking the operator environment file. */\n REMOVAL = 'removal',\n}\n\nfunction assertCurrentUserSingleLinkFile(\n status: { uid: number; nlink: number },\n filePath: string,\n operation: ApplicationOperatorEnvironmentFileOperation,\n): void {\n if (typeof process.getuid !== 'function') {\n throw new Error(`Application operator environment ${operation} cannot establish current-user ownership on this platform: ${filePath}.`);\n }\n if (status.uid !== process.getuid() || status.nlink !== 1) {\n throw new Error(`Application operator environment ${operation} requires a current-user-owned single-link file: ${filePath}.`);\n }\n}\n\n/**\n * The canonical directory the operator `.env` is written into: the application root, symlinks\n * resolved, and proven to be a real directory. Until 2026-09-06 this walked every path segment\n * from the FRAMEWORK repository root down to the application and refused anything that was not\n * strictly below it — an application was assumed to live under `examples/` of a checkout. An\n * app-creator application lives wherever its author put it, so the anchor is the application\n * root itself; the write below still opens the file `O_NOFOLLOW` and re-checks its identity.\n */\nfunction resolveCanonicalApplicationOperatorRoot(applicationRoot: string): string {\n const lexicalApplicationRoot = resolve(applicationRoot);\n const status = lstatSync(lexicalApplicationRoot);\n if (!status.isDirectory()) {\n throw new Error(`Application operator environment root is not a directory: ${lexicalApplicationRoot}.`);\n }\n return realpathSync(lexicalApplicationRoot);\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BackingServiceKind, EnvironmentServiceProfile, EnvironmentServiceProfileOptionalService, type BackingServicesEnvConfig } from '@wildo-ai/platform-config-lib';
|
|
1
|
+
import { BackingServiceKind, DatabaseEngine, EnvironmentServiceProfile, EnvironmentServiceProfileOptionalService, type BackingServicesEnvConfig } from '@wildo-ai/platform-config-lib';
|
|
2
2
|
/**
|
|
3
3
|
* #2303 — what an environment's service profile allows it to RUN, asked by BOTH deployment lanes (the Docker Compose
|
|
4
4
|
* generator and the Kubernetes manifests) through these functions, so the two cannot disagree about which workloads a
|
|
@@ -31,4 +31,11 @@ export declare function includesMongoSearchSidecar(env: ServiceProfileEnvInput):
|
|
|
31
31
|
* passing through it.
|
|
32
32
|
*/
|
|
33
33
|
export declare function assertProfileRunsItsDatabaseFamilies(env: ServiceProfileEnvInput): void;
|
|
34
|
+
/**
|
|
35
|
+
* Refuse to render minions in an environment whose profile runs them on a queue that cannot confine them (#2303): the
|
|
36
|
+
* DATABASE queue of the `small` profile on a MongoDB application, which has no row-level security (PostgreSQL confines
|
|
37
|
+
* each minion to its own queues). The application's boot refuses the same thing through the same function, for a record
|
|
38
|
+
* that reaches a runtime another way.
|
|
39
|
+
*/
|
|
40
|
+
export declare function assertProfileRunsDeclaredMinions(env: ServiceProfileEnvInput, declaredMinionCount: number, applicationDatabaseEngine: DatabaseEngine): void;
|
|
34
41
|
//# sourceMappingURL=environment-service-profile.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-service-profile.utils.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/environment-service-profile.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,
|
|
1
|
+
{"version":3,"file":"environment-service-profile.utils.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/environment-service-profile.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAElB,cAAc,EAEd,yBAAyB,EACzB,wCAAwC,EAKxC,KAAK,wBAAwB,EAC9B,MAAM,+BAA+B,CAAC;AAIvC;;;;;;;;;;GAUG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,eAAe,CAAC,EAAE,wBAAwB,CAAC;IACpD,QAAQ,CAAC,cAAc,CAAC,EAAE,yBAAyB,CAAC;CACrD;AAED;;GAEG;AACH,wBAAgB,wCAAwC,CACtD,GAAG,EAAE,sBAAsB,EAC3B,IAAI,EAAE,kBAAkB,CAAC,MAAM,GAAG,kBAAkB,CAAC,MAAM,EAC3D,OAAO,EAAE,wCAAwC,GAChD,OAAO,CAWT;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAK/E;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAAC,GAAG,EAAE,sBAAsB,GAAG,IAAI,CAWtF;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,sBAAsB,EAC3B,mBAAmB,EAAE,MAAM,EAC3B,yBAAyB,EAAE,cAAc,GACxC,IAAI,CAIN"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BackingServiceSource, DEFAULT_ENVIRONMENT_SERVICE_PROFILE, EnvironmentServiceProfile, EnvironmentServiceProfileOptionalService, describeServiceOmittedByEnvironmentServiceProfile, environmentServiceProfileOmits, environmentServiceProfileRunsOneDatabaseFamily, } from '@wildo-ai/platform-config-lib';
|
|
1
|
+
import { BackingServiceSource, DEFAULT_ENVIRONMENT_SERVICE_PROFILE, EnvironmentServiceProfile, EnvironmentServiceProfileOptionalService, describeMinionsRefusedByEnvironmentServiceProfile, describeServiceOmittedByEnvironmentServiceProfile, environmentServiceProfileOmits, environmentServiceProfileRunsOneDatabaseFamily, } from '@wildo-ai/platform-config-lib';
|
|
2
2
|
import { EnvironmentUtils } from '../../services/environment/environment.service.js';
|
|
3
3
|
/**
|
|
4
4
|
* Whether the environment self-hosts an OPTIONAL backing service, refusing a SELF declaration its profile omits.
|
|
@@ -40,4 +40,17 @@ export function assertProfileRunsItsDatabaseFamilies(env) {
|
|
|
40
40
|
+ `run \`wildo config sync\`, or set serviceProfile to '${EnvironmentServiceProfile.FULL}'.`);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Refuse to render minions in an environment whose profile runs them on a queue that cannot confine them (#2303): the
|
|
45
|
+
* DATABASE queue of the `small` profile on a MongoDB application, which has no row-level security (PostgreSQL confines
|
|
46
|
+
* each minion to its own queues). The application's boot refuses the same thing through the same function, for a record
|
|
47
|
+
* that reaches a runtime another way.
|
|
48
|
+
*/
|
|
49
|
+
export function assertProfileRunsDeclaredMinions(env, declaredMinionCount, applicationDatabaseEngine) {
|
|
50
|
+
if (declaredMinionCount === 0)
|
|
51
|
+
return;
|
|
52
|
+
const refused = describeMinionsRefusedByEnvironmentServiceProfile(env.serviceProfile ?? DEFAULT_ENVIRONMENT_SERVICE_PROFILE, applicationDatabaseEngine);
|
|
53
|
+
if (refused)
|
|
54
|
+
throw new Error(`Environment "${env.name}": ${refused}`);
|
|
55
|
+
}
|
|
43
56
|
//# sourceMappingURL=environment-service-profile.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-service-profile.utils.js","sourceRoot":"","sources":["../../../../src/services/environment/environment-service-profile.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,
|
|
1
|
+
{"version":3,"file":"environment-service-profile.utils.js","sourceRoot":"","sources":["../../../../src/services/environment/environment-service-profile.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EAEpB,mCAAmC,EACnC,yBAAyB,EACzB,wCAAwC,EACxC,iDAAiD,EACjD,iDAAiD,EACjD,8BAA8B,EAC9B,8CAA8C,GAE/C,MAAM,+BAA+B,C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H,2GAA2G;cAC3G,8GAA8G;cAC9G,wDAAwD,yBAAyB,CAAC,IAAI,IAAI,CAC7F,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gCAAgC,CAC9C,GAA2B,EAC3B,mBAA2B,EAC3B,yBAAyC;IAEzC,IAAI,mBAAmB,KAAK,CAAC;QAAE,OAAO;IACtC,MAAM,OAAO,GAAG,iDAAiD,CAAC,GAAG,CAAC,cAAc,IAAI,mCAAmC,EAAE,yBAAyB,CAAC,CAAC;IACxJ,IAAI,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,gBAAgB,GAAG,CAAC,IAAI,MAAM,OAAO,EAAE,CAAC,CAAC;AACxE,CAAC","sourcesContent":["import {\n BackingServiceKind,\n BackingServiceSource,\n DatabaseEngine,\n DEFAULT_ENVIRONMENT_SERVICE_PROFILE,\n EnvironmentServiceProfile,\n EnvironmentServiceProfileOptionalService,\n describeMinionsRefusedByEnvironmentServiceProfile,\n describeServiceOmittedByEnvironmentServiceProfile,\n environmentServiceProfileOmits,\n environmentServiceProfileRunsOneDatabaseFamily,\n type BackingServicesEnvConfig,\n} from '@wildo-ai/platform-config-lib';\n\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\n\n/**\n * #2303 — what an environment's service profile allows it to RUN, asked by BOTH deployment lanes (the Docker Compose\n * generator and the Kubernetes manifests) through these functions, so the two cannot disagree about which workloads a\n * profile removes.\n *\n * The descriptor schema refuses the same contradictions while it is parsed (`define-infra-env-config.ts`). These are\n * the render-time site of the same invariants, for an environment record that reaches a lane by another path (a\n * `config.json` persisted before the profile was authored, a registry record): a render that silently dropped a\n * service would leave a capability that looks enabled and does nothing, and a render that kept it would ignore the\n * profile. Neither may win in silence, so the render stops and says why.\n */\nexport interface ServiceProfileEnvInput {\n readonly name: string;\n readonly backingServices?: BackingServicesEnvConfig;\n readonly serviceProfile?: EnvironmentServiceProfile;\n}\n\n/**\n * Whether the environment self-hosts an OPTIONAL backing service, refusing a SELF declaration its profile omits.\n */\nexport function selfHostsOptionalServiceAllowedByProfile(\n env: ServiceProfileEnvInput,\n kind: BackingServiceKind.CLAMAV | BackingServiceKind.IMMUDB,\n service: EnvironmentServiceProfileOptionalService,\n): boolean {\n const selfHosted = EnvironmentUtils.selfHostsBackingService(env, kind);\n const profile = env.serviceProfile ?? DEFAULT_ENVIRONMENT_SERVICE_PROFILE;\n if (selfHosted && environmentServiceProfileOmits(profile, service)) {\n throw new Error(\n `Environment \"${env.name}\": ${describeServiceOmittedByEnvironmentServiceProfile(profile, service)} `\n + `Yet \\`backingServices.${kind}\\` declares { source: ${BackingServiceSource.SELF} }. Remove that declaration, `\n + `or set serviceProfile to '${EnvironmentServiceProfile.FULL}', then render again.`,\n );\n }\n return selfHosted;\n}\n\n/**\n * Whether the `mongot` search sidecar belongs in this environment: it is an attachment to a self-hosted mongod, and the\n * profile may omit it. Every mongot artifact of a lane (the workload, mongod's `mongotHost` routing parameters, the\n * sync-source user and secret, the data directory or persistent volume) reads this one answer.\n */\nexport function includesMongoSearchSidecar(env: ServiceProfileEnvInput): boolean {\n // `needsLocalMongoDB` is what `selfHostsBackingService(env, MONGODB)` answers with; named directly, as both lanes did\n // before this helper existed.\n return EnvironmentUtils.needsLocalMongoDB(env)\n && !environmentServiceProfileOmits(env.serviceProfile, EnvironmentServiceProfileOptionalService.MONGODB_SEARCH);\n}\n\n/**\n * Refuse to render a profile that runs one database family beside two self-hosted database engines. The descriptor\n * refuses the declarations that would bring a second family; this catches a record that reached the lane without\n * passing through it.\n */\nexport function assertProfileRunsItsDatabaseFamilies(env: ServiceProfileEnvInput): void {\n const profile = env.serviceProfile ?? DEFAULT_ENVIRONMENT_SERVICE_PROFILE;\n if (!environmentServiceProfileRunsOneDatabaseFamily(profile)) return;\n if (EnvironmentUtils.needsLocalMongoDB(env) && EnvironmentUtils.needsLocalPostgreSQL(env)) {\n throw new Error(\n `Environment \"${env.name}\": serviceProfile '${profile}' runs ONE database family, and this environment would run both a `\n + 'MongoDB and a PostgreSQL. Put the platform and the application on the same engine (`database.engine` and '\n + '`applicationDatabase.engine` in wildo.infra.<env>.config.ts), declare only that store in `backingServices`, '\n + `run \\`wildo config sync\\`, or set serviceProfile to '${EnvironmentServiceProfile.FULL}'.`,\n );\n }\n}\n\n/**\n * Refuse to render minions in an environment whose profile runs them on a queue that cannot confine them (#2303): the\n * DATABASE queue of the `small` profile on a MongoDB application, which has no row-level security (PostgreSQL confines\n * each minion to its own queues). The application's boot refuses the same thing through the same function, for a record\n * that reaches a runtime another way.\n */\nexport function assertProfileRunsDeclaredMinions(\n env: ServiceProfileEnvInput,\n declaredMinionCount: number,\n applicationDatabaseEngine: DatabaseEngine,\n): void {\n if (declaredMinionCount === 0) return;\n const refused = describeMinionsRefusedByEnvironmentServiceProfile(env.serviceProfile ?? DEFAULT_ENVIRONMENT_SERVICE_PROFILE, applicationDatabaseEngine);\n if (refused) throw new Error(`Environment \"${env.name}\": ${refused}`);\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawnSync } from 'child_process';
|
|
1
2
|
/** OCI annotation keys (image-spec `annotations.md`, dead-plan-citation: the OCI spec's own file), used here as build labels. */
|
|
2
3
|
export declare const FRAMEWORK_IMAGE_REVISION_LABEL = "org.opencontainers.image.revision";
|
|
3
4
|
export declare const FRAMEWORK_IMAGE_CREATED_LABEL = "org.opencontainers.image.created";
|
|
@@ -16,6 +17,49 @@ export declare const FRAMEWORK_IMAGE_SOURCE_LABEL = "org.opencontainers.image.so
|
|
|
16
17
|
* `imagetools create` carries them along when an alias is repointed at the index.
|
|
17
18
|
*/
|
|
18
19
|
export declare const FRAMEWORK_IMAGE_ATTESTATION_ARGS: readonly ["--provenance=mode=max", "--sbom=true"];
|
|
20
|
+
/**
|
|
21
|
+
* How a pushed framework image is signed (#3063). Chosen by the environment that runs the lane, never by the lane
|
|
22
|
+
* itself: keyless signing needs a workload identity (the release job's GitHub OIDC token), which a developer machine
|
|
23
|
+
* running the break-glass `wildo fwk release` does not have.
|
|
24
|
+
*/
|
|
25
|
+
export declare enum FrameworkImageSigning {
|
|
26
|
+
/**
|
|
27
|
+
* `cosign sign --yes <repository>@<digest>`: a short-lived Fulcio certificate bound to the release workflow's identity,
|
|
28
|
+
* the signature recorded in the Rekor transparency log and stored beside the image index in the registry, then
|
|
29
|
+
* `cosign verify` against that identity. Signs the DIGEST of the index buildx pushed, never a tag, so what is signed is
|
|
30
|
+
* exactly what was built. An alias (`latest`) is covered only while it names that same index: `imagetools create` from
|
|
31
|
+
* one index source keeps the index as it is, so its digest is the signed one.
|
|
32
|
+
*
|
|
33
|
+
* The certificate puts the repository, the workflow, its ref, the commit and the run in the public Rekor log for good.
|
|
34
|
+
* The image's own OCI labels already publish the source URL and the revision.
|
|
35
|
+
*/
|
|
36
|
+
COSIGN_KEYLESS = "cosign_keyless"
|
|
37
|
+
}
|
|
38
|
+
/** The environment variable a release environment sets to a {@link FrameworkImageSigning} member. Unset: no signing. */
|
|
39
|
+
export declare const FRAMEWORK_IMAGE_SIGNING_ENV = "WILDO_FRAMEWORK_IMAGE_SIGNING";
|
|
40
|
+
/** The OIDC issuer of a GitHub Actions workload identity: the issuer of every keyless certificate the release signs with. */
|
|
41
|
+
export declare const GITHUB_ACTIONS_OIDC_ISSUER = "https://token.actions.githubusercontent.com";
|
|
42
|
+
/**
|
|
43
|
+
* The identity a keyless signature made in this job carries, as `cosign verify --certificate-identity` takes it:
|
|
44
|
+
* `https://github.com/<owner>/<repo>/<workflow path>@<ref>`, from `GITHUB_WORKFLOW_REF`. Undefined outside Actions.
|
|
45
|
+
*/
|
|
46
|
+
export declare function githubWorkflowSigningIdentityOf(env?: NodeJS.ProcessEnv): string | undefined;
|
|
47
|
+
/** What became of one image's signature. */
|
|
48
|
+
export declare enum FrameworkImageSignatureOutcome {
|
|
49
|
+
/** Signed by digest. */
|
|
50
|
+
SIGNED = "signed",
|
|
51
|
+
/** The environment asked for no signing (a developer machine running the break-glass release). */
|
|
52
|
+
NOT_REQUESTED = "not_requested",
|
|
53
|
+
/**
|
|
54
|
+
* Asked for and not proven: no workload identity to sign as (`GITHUB_WORKFLOW_REF` unset), the pushed digest unreadable,
|
|
55
|
+
* cosign absent or refusing to sign, or a signature made that `cosign verify` did not confirm. The image is already public, so
|
|
56
|
+
* the release does not stop on it (a consumer's `cosign verify` reports the missing signature, a false claim is not
|
|
57
|
+
* made); the lane reports it, and the image is signed by hand with the command named in `reason`.
|
|
58
|
+
*/
|
|
59
|
+
FAILED = "failed"
|
|
60
|
+
}
|
|
61
|
+
/** The signing the environment asks for, or undefined. An unknown value is refused, never read as "no signing". */
|
|
62
|
+
export declare function frameworkImageSigningOf(env?: NodeJS.ProcessEnv): FrameworkImageSigning | undefined;
|
|
19
63
|
/**
|
|
20
64
|
* The git pathspecs covering what a Docker build SENDS from its context, derived from the ignore file
|
|
21
65
|
* the build itself obeys: `<Dockerfile>.dockerignore` when present (BuildKit prefers it), else the
|
|
@@ -61,7 +105,16 @@ export interface FrameworkDockerPublishOptions {
|
|
|
61
105
|
}
|
|
62
106
|
export interface FrameworkDockerPublishTargetResult {
|
|
63
107
|
imageName: string;
|
|
108
|
+
/** `<registry host>/<namespace>/<image>`, with no tag: what a digest reference is written against. */
|
|
109
|
+
imageRepository: string;
|
|
64
110
|
imageRef: string;
|
|
111
|
+
/** The image index digest the push wrote (`containerimage.digest` in buildx's metadata file), once pushed. */
|
|
112
|
+
digest?: string;
|
|
113
|
+
/** What became of the image's signature, once pushed (#3063). */
|
|
114
|
+
signature?: {
|
|
115
|
+
outcome: FrameworkImageSignatureOutcome;
|
|
116
|
+
reason?: string;
|
|
117
|
+
};
|
|
65
118
|
aliasImageRefs: string[];
|
|
66
119
|
buildContextPath: string;
|
|
67
120
|
dockerfilePath: string;
|
|
@@ -93,8 +146,37 @@ export interface FrameworkDockerPublishResult {
|
|
|
93
146
|
* same command moves to a CI matrix with native runners, and this list does not change.
|
|
94
147
|
*/
|
|
95
148
|
export declare const FRAMEWORK_DOCKER_IMAGE_PLATFORMS: readonly ["linux/amd64", "linux/arm64"];
|
|
149
|
+
/**
|
|
150
|
+
* How long one image build may run, and how many times it is tried (#3063).
|
|
151
|
+
*
|
|
152
|
+
* The arm64 half is built under QEMU, and QEMU can crash the emulated Node process (`qemu: uncaught target
|
|
153
|
+
* signal 4 (Illegal instruction)`) with nothing in the build noticing: the 1.1.13 release (framework-release
|
|
154
|
+
* run 43566115901, 2026-11-14) crashed 103 s into the arm64 `pnpm install`, printed nothing for two hours and
|
|
155
|
+
* was cancelled by GitHub's three-hour job limit, with the version tagged and nothing published. The same
|
|
156
|
+
* step took 3 min 54 s in the 1.1.12 release, from the same base image digest and the same QEMU, so the crash
|
|
157
|
+
* is intermittent, and a second attempt is the remedy.
|
|
158
|
+
*
|
|
159
|
+
* A whole build (both platforms, attestations, push) took 8 min 14 s for 1.1.12, so the bound is generous.
|
|
160
|
+
* Two attempts fit inside the release job's limit with the rest of the lane. A retry cannot release half an
|
|
161
|
+
* image: `buildx build --push` writes the tag only after every platform has built, and the tag is the
|
|
162
|
+
* release's own, which nothing names until the npm step that follows.
|
|
163
|
+
*/
|
|
164
|
+
export declare const FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUT_MS: number;
|
|
165
|
+
export declare const FRAMEWORK_DOCKER_IMAGE_BUILD_ATTEMPTS = 2;
|
|
96
166
|
export declare class FrameworkDockerPublishService {
|
|
97
167
|
static publishImages(options?: FrameworkDockerPublishOptions): Promise<FrameworkDockerPublishResult>;
|
|
168
|
+
/** The image index digest buildx recorded in its metadata file, or undefined when it recorded none. */
|
|
169
|
+
static pushedDigestOf(metadataFile: string): string | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* Sign one pushed image as the environment asks (#3063). Never throws: the image is already public, so a signature
|
|
172
|
+
* that cannot be made is reported (FAILED, with the command to run by hand) rather than stopping the release after it
|
|
173
|
+
* published, and a consumer's `cosign verify` sees it missing rather than being told anything false.
|
|
174
|
+
*
|
|
175
|
+
* cosign reads the registry credentials `docker login` wrote (`loginWithFrameworkSecrets`), and in GitHub Actions takes
|
|
176
|
+
* the job's OIDC token on its own (`id-token: write`). SIGNED means the signature then VERIFIED against this job's
|
|
177
|
+
* workflow identity (`cosign verify`), so the outcome is the registry's answer rather than the signing command's exit.
|
|
178
|
+
*/
|
|
179
|
+
static signImage(target: Pick<FrameworkDockerPublishTargetResult, 'imageRepository' | 'digest'>, signing: FrameworkImageSigning | undefined, spawn?: typeof spawnSync, env?: NodeJS.ProcessEnv): NonNullable<FrameworkDockerPublishTargetResult['signature']>;
|
|
98
180
|
/**
|
|
99
181
|
* Log the Docker CLI in to the framework's registry with `docker.publishToken` from the framework secrets file.
|
|
100
182
|
*
|
|
@@ -147,6 +229,13 @@ export declare class FrameworkDockerPublishService {
|
|
|
147
229
|
* the wrong registry and the later push fails as unauthenticated.
|
|
148
230
|
*/
|
|
149
231
|
private static runDockerLogin;
|
|
232
|
+
/**
|
|
233
|
+
* Run one image build, bounded by `FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUT_MS` and tried
|
|
234
|
+
* `FRAMEWORK_DOCKER_IMAGE_BUILD_ATTEMPTS` times. A build that runs out of time is killed (SIGTERM ends the buildx
|
|
235
|
+
* client, and BuildKit cancels the build when its session closes). Every failure says which attempt it was and
|
|
236
|
+
* why, so a release log shows a hang as a hang rather than as silence.
|
|
237
|
+
*/
|
|
238
|
+
static runDockerBuild(label: string, args: string[], spawn?: typeof spawnSync, log?: (message: string) => void): void;
|
|
150
239
|
private static runDockerCommand;
|
|
151
240
|
}
|
|
152
241
|
//# sourceMappingURL=framework-docker-publish.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-docker-publish.service.d.ts","sourceRoot":"","sources":["../../../../src/services/framework/framework-docker-publish.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"framework-docker-publish.service.d.ts","sourceRoot":"","sources":["../../../../src/services/framework/framework-docker-publish.service.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