@wildo-ai/wildo-cli 1.1.2 → 1.1.4
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/bin/wildo.d.ts.map +1 -1
- package/dist/src/__tests__/sandbox-dependencies.test-helpers.d.ts.map +1 -1
- package/dist/src/commands/acp/probe.command.d.ts.map +1 -1
- package/dist/src/commands/acp/probe.command.js +13 -0
- package/dist/src/commands/acp/probe.command.js.map +1 -1
- package/dist/src/commands/align-deps.command.d.ts.map +1 -1
- package/dist/src/commands/assets/sync.command.d.ts +6 -0
- package/dist/src/commands/assets/sync.command.d.ts.map +1 -1
- package/dist/src/commands/assets/sync.command.js +13 -3
- package/dist/src/commands/assets/sync.command.js.map +1 -1
- package/dist/src/commands/brand/propagate.command.d.ts.map +1 -1
- package/dist/src/commands/compose.command.d.ts.map +1 -1
- package/dist/src/commands/compose.command.js +16 -0
- package/dist/src/commands/compose.command.js.map +1 -1
- package/dist/src/commands/config/__tests__/reapply-declaration.command.test.d.ts.map +1 -1
- package/dist/src/commands/config/__tests__/reapply-declaration.command.test.js +1 -1
- package/dist/src/commands/config/__tests__/reapply-declaration.command.test.js.map +1 -1
- package/dist/src/commands/config/__tests__/sync.command.test.d.ts.map +1 -1
- package/dist/src/commands/config/__tests__/sync.command.test.js +115 -8
- package/dist/src/commands/config/__tests__/sync.command.test.js.map +1 -1
- package/dist/src/commands/config/__tests__/validate.command.test.d.ts.map +1 -1
- package/dist/src/commands/config/mutate.command.d.ts.map +1 -1
- package/dist/src/commands/config/reapply-declaration.command.d.ts.map +1 -1
- package/dist/src/commands/config/sync.command.d.ts +36 -0
- package/dist/src/commands/config/sync.command.d.ts.map +1 -1
- package/dist/src/commands/config/sync.command.js +61 -7
- package/dist/src/commands/config/sync.command.js.map +1 -1
- package/dist/src/commands/config/validate.command.d.ts.map +1 -1
- package/dist/src/commands/context/__tests__/assurance-basis.command.test.d.ts +2 -0
- package/dist/src/commands/context/__tests__/assurance-basis.command.test.d.ts.map +1 -0
- package/dist/src/commands/context/__tests__/assurance-basis.command.test.js +63 -0
- package/dist/src/commands/context/__tests__/assurance-basis.command.test.js.map +1 -0
- package/dist/src/commands/context/__tests__/jurisdictions.command.test.d.ts +19 -0
- package/dist/src/commands/context/__tests__/jurisdictions.command.test.d.ts.map +1 -0
- package/dist/src/commands/context/__tests__/jurisdictions.command.test.js +106 -0
- package/dist/src/commands/context/__tests__/jurisdictions.command.test.js.map +1 -0
- package/dist/src/commands/context/assurance-basis.command.d.ts +61 -0
- package/dist/src/commands/context/assurance-basis.command.d.ts.map +1 -0
- package/dist/src/commands/context/assurance-basis.command.js +166 -0
- package/dist/src/commands/context/assurance-basis.command.js.map +1 -0
- package/dist/src/commands/context/coherence.command.d.ts.map +1 -1
- package/dist/src/commands/context/context-command.utils.d.ts.map +1 -1
- package/dist/src/commands/context/health.command.d.ts.map +1 -1
- package/dist/src/commands/context/info.command.d.ts.map +1 -1
- package/dist/src/commands/context/journey.command.d.ts +6 -2
- package/dist/src/commands/context/journey.command.d.ts.map +1 -1
- package/dist/src/commands/context/journey.command.js +8 -4
- package/dist/src/commands/context/journey.command.js.map +1 -1
- package/dist/src/commands/context/jurisdictions.command.d.ts +36 -0
- package/dist/src/commands/context/jurisdictions.command.d.ts.map +1 -0
- package/dist/src/commands/context/jurisdictions.command.js +115 -0
- package/dist/src/commands/context/jurisdictions.command.js.map +1 -0
- package/dist/src/commands/context/list.command.d.ts.map +1 -1
- package/dist/src/commands/db/db-schema-plan.utils.d.ts.map +1 -1
- package/dist/src/commands/db/diff.command.d.ts.map +1 -1
- package/dist/src/commands/db/generate.command.d.ts.map +1 -1
- package/dist/src/commands/db/migrate.command.d.ts.map +1 -1
- package/dist/src/commands/db/resolve.command.d.ts.map +1 -1
- package/dist/src/commands/dev/__tests__/design-tokens.command.test.d.ts.map +1 -1
- package/dist/src/commands/dev/__tests__/start.command.test.d.ts.map +1 -1
- package/dist/src/commands/dev/__tests__/start.command.test.js +6 -6
- package/dist/src/commands/dev/__tests__/start.command.test.js.map +1 -1
- package/dist/src/commands/dev/__tests__/stop.command.test.d.ts.map +1 -1
- package/dist/src/commands/dev/__tests__/sync-csp.command.test.d.ts.map +1 -1
- package/dist/src/commands/dev/__tests__/sync-csp.command.test.js +71 -0
- package/dist/src/commands/dev/__tests__/sync-csp.command.test.js.map +1 -1
- package/dist/src/commands/dev/charts-audit.command.d.ts +5 -3
- package/dist/src/commands/dev/charts-audit.command.d.ts.map +1 -1
- package/dist/src/commands/dev/charts-audit.command.js +36 -7
- package/dist/src/commands/dev/charts-audit.command.js.map +1 -1
- package/dist/src/commands/dev/design-tokens-generate.command.d.ts.map +1 -1
- package/dist/src/commands/dev/design-tokens-init.command.d.ts.map +1 -1
- package/dist/src/commands/dev/design-tokens-validate.command.d.ts.map +1 -1
- package/dist/src/commands/dev/force-stop.command.d.ts.map +1 -1
- package/dist/src/commands/dev/resources.command.d.ts.map +1 -1
- package/dist/src/commands/dev/start.command.d.ts.map +1 -1
- package/dist/src/commands/dev/start.command.js +8 -7
- package/dist/src/commands/dev/start.command.js.map +1 -1
- package/dist/src/commands/dev/stop-all.command.d.ts.map +1 -1
- package/dist/src/commands/dev/sync-csp.command.d.ts.map +1 -1
- package/dist/src/commands/dev/sync-csp.command.js +35 -7
- package/dist/src/commands/dev/sync-csp.command.js.map +1 -1
- package/dist/src/commands/docs/__tests__/publish.command.test.d.ts +2 -0
- package/dist/src/commands/docs/__tests__/publish.command.test.d.ts.map +1 -0
- package/dist/src/commands/docs/__tests__/publish.command.test.js +101 -0
- package/dist/src/commands/docs/__tests__/publish.command.test.js.map +1 -0
- package/dist/src/commands/docs/publish.command.d.ts +29 -0
- package/dist/src/commands/docs/publish.command.d.ts.map +1 -0
- package/dist/src/commands/docs/publish.command.js +82 -0
- package/dist/src/commands/docs/publish.command.js.map +1 -0
- package/dist/src/commands/frontend/publish.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/__tests__/dev-skills.command.test.d.ts.map +1 -1
- package/dist/src/commands/fwk/__tests__/generate-docs.command.test.d.ts.map +1 -1
- package/dist/src/commands/fwk/__tests__/generate-docs.command.test.js.map +1 -1
- package/dist/src/commands/fwk/audit.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/dev-skills.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/dev-skills.command.js +12 -0
- package/dist/src/commands/fwk/dev-skills.command.js.map +1 -1
- package/dist/src/commands/fwk/generate-docs.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/generate-providers.command.d.ts +21 -0
- package/dist/src/commands/fwk/generate-providers.command.d.ts.map +1 -0
- package/dist/src/commands/fwk/generate-providers.command.js +325 -0
- package/dist/src/commands/fwk/generate-providers.command.js.map +1 -0
- package/dist/src/commands/fwk/graph.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-docker.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-npm.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-bump.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-set.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-show.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-show.command.js +9 -1
- package/dist/src/commands/fwk/version-show.command.js.map +1 -1
- package/dist/src/commands/fwk/version-sync.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/what-touches.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/wt-status.command.d.ts +13 -4
- package/dist/src/commands/fwk/wt-status.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/wt-status.command.js +34 -5
- package/dist/src/commands/fwk/wt-status.command.js.map +1 -1
- package/dist/src/commands/fwk/wt-tail.command.d.ts +12 -6
- package/dist/src/commands/fwk/wt-tail.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/wt-tail.command.js +40 -10
- package/dist/src/commands/fwk/wt-tail.command.js.map +1 -1
- package/dist/src/commands/generate/__tests__/email-command.utils.test.d.ts.map +1 -1
- package/dist/src/commands/generate/__tests__/email-command.utils.test.js +0 -1
- package/dist/src/commands/generate/__tests__/email-command.utils.test.js.map +1 -1
- package/dist/src/commands/generate/email-command.utils.d.ts.map +1 -1
- package/dist/src/commands/generate/email-command.utils.js +1 -0
- package/dist/src/commands/generate/email-command.utils.js.map +1 -1
- package/dist/src/commands/generate/email-preview.command.d.ts +8 -0
- package/dist/src/commands/generate/email-preview.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email-preview.command.js +57 -0
- package/dist/src/commands/generate/email-preview.command.js.map +1 -1
- package/dist/src/commands/generate/email-status.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email-test-send.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email-translate.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email.command.d.ts.map +1 -1
- package/dist/src/commands/generate/labelling-command.utils.d.ts.map +1 -1
- package/dist/src/commands/generate/labelling-command.utils.js +1 -0
- package/dist/src/commands/generate/labelling-command.utils.js.map +1 -1
- package/dist/src/commands/generate/labels-plan.command.d.ts.map +1 -1
- package/dist/src/commands/generate/labels.command.d.ts.map +1 -1
- package/dist/src/commands/generate/translate.command.d.ts.map +1 -1
- package/dist/src/commands/help.command.d.ts.map +1 -1
- package/dist/src/commands/help.command.js +2 -0
- package/dist/src/commands/help.command.js.map +1 -1
- package/dist/src/commands/init.command.d.ts +17 -0
- package/dist/src/commands/init.command.d.ts.map +1 -1
- package/dist/src/commands/init.command.js +89 -4
- package/dist/src/commands/init.command.js.map +1 -1
- package/dist/src/commands/local/__tests__/dev-status.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/dev.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/dev.command.test.js +60 -0
- package/dist/src/commands/local/__tests__/dev.command.test.js.map +1 -1
- package/dist/src/commands/local/__tests__/doctor.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/doctor.command.test.js +16 -2
- package/dist/src/commands/local/__tests__/doctor.command.test.js.map +1 -1
- package/dist/src/commands/local/__tests__/init.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/init.command.test.js +28 -1
- package/dist/src/commands/local/__tests__/init.command.test.js.map +1 -1
- package/dist/src/commands/local/__tests__/reinit.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/reset.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/up.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/up.command.test.js +7 -0
- package/dist/src/commands/local/__tests__/up.command.test.js.map +1 -1
- package/dist/src/commands/local/dev-status.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev.command.d.ts +6 -3
- package/dist/src/commands/local/dev.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev.command.js +13 -4
- package/dist/src/commands/local/dev.command.js.map +1 -1
- package/dist/src/commands/local/doctor.command.d.ts +9 -0
- package/dist/src/commands/local/doctor.command.d.ts.map +1 -1
- package/dist/src/commands/local/doctor.command.js +24 -6
- package/dist/src/commands/local/doctor.command.js.map +1 -1
- package/dist/src/commands/local/down.command.d.ts.map +1 -1
- package/dist/src/commands/local/init.command.d.ts.map +1 -1
- package/dist/src/commands/local/init.command.js +11 -2
- package/dist/src/commands/local/init.command.js.map +1 -1
- package/dist/src/commands/local/logs.command.d.ts.map +1 -1
- package/dist/src/commands/local/reinit.command.d.ts.map +1 -1
- package/dist/src/commands/local/reset.command.d.ts.map +1 -1
- package/dist/src/commands/local/status.command.d.ts.map +1 -1
- package/dist/src/commands/local/up.command.d.ts.map +1 -1
- package/dist/src/commands/local/up.command.js.map +1 -1
- package/dist/src/commands/lock/__tests__/check.command.test.d.ts.map +1 -1
- package/dist/src/commands/lock/__tests__/check.live.contract.test.d.ts.map +1 -1
- package/dist/src/commands/lock/check.command.d.ts.map +1 -1
- package/dist/src/commands/lock/check.command.js +4 -10
- package/dist/src/commands/lock/check.command.js.map +1 -1
- package/dist/src/commands/market/__tests__/generate.command.test.d.ts.map +1 -1
- package/dist/src/commands/market/__tests__/market-command.utils.test.d.ts.map +1 -1
- package/dist/src/commands/market/__tests__/market-command.utils.test.js +0 -1
- package/dist/src/commands/market/__tests__/market-command.utils.test.js.map +1 -1
- package/dist/src/commands/market/generate.command.d.ts.map +1 -1
- package/dist/src/commands/market/market-command.utils.d.ts.map +1 -1
- package/dist/src/commands/market/market-command.utils.js +1 -0
- package/dist/src/commands/market/market-command.utils.js.map +1 -1
- package/dist/src/commands/providers/__tests__/required-inputs.test.d.ts +2 -0
- package/dist/src/commands/providers/__tests__/required-inputs.test.d.ts.map +1 -0
- package/dist/src/commands/providers/__tests__/required-inputs.test.js +35 -0
- package/dist/src/commands/providers/__tests__/required-inputs.test.js.map +1 -0
- package/dist/src/commands/providers/show.command.d.ts +51 -0
- package/dist/src/commands/providers/show.command.d.ts.map +1 -0
- package/dist/src/commands/providers/show.command.js +152 -0
- package/dist/src/commands/providers/show.command.js.map +1 -0
- package/dist/src/commands/registry/add.command.d.ts.map +1 -1
- package/dist/src/commands/registry/info.command.d.ts.map +1 -1
- package/dist/src/commands/registry/lockfile-smoke.command.d.ts.map +1 -1
- package/dist/src/commands/registry/login.command.d.ts.map +1 -1
- package/dist/src/commands/registry/login.command.js +2 -0
- package/dist/src/commands/registry/login.command.js.map +1 -1
- package/dist/src/commands/registry/logout.command.d.ts.map +1 -1
- package/dist/src/commands/registry/ping.command.d.ts.map +1 -1
- package/dist/src/commands/registry/publish.command.d.ts.map +1 -1
- package/dist/src/commands/registry/publish.command.js +2 -0
- package/dist/src/commands/registry/publish.command.js.map +1 -1
- package/dist/src/commands/registry/registry-transport.constants.d.ts +33 -0
- package/dist/src/commands/registry/registry-transport.constants.d.ts.map +1 -0
- package/dist/src/commands/registry/registry-transport.constants.js +33 -0
- package/dist/src/commands/registry/registry-transport.constants.js.map +1 -0
- package/dist/src/commands/registry/remove.command.d.ts.map +1 -1
- package/dist/src/commands/registry/repair-lockfile.command.d.ts.map +1 -1
- package/dist/src/commands/registry/search.command.d.ts.map +1 -1
- package/dist/src/commands/registry/update.command.d.ts.map +1 -1
- package/dist/src/commands/registry/whoami.command.d.ts.map +1 -1
- package/dist/src/commands/registry/whoami.command.js +2 -0
- package/dist/src/commands/registry/whoami.command.js.map +1 -1
- package/dist/src/commands/remote/__tests__/remote-commands.test.d.ts.map +1 -1
- package/dist/src/commands/remote/create.command.d.ts.map +1 -1
- package/dist/src/commands/remote/list.command.d.ts.map +1 -1
- package/dist/src/commands/remote/status.command.d.ts.map +1 -1
- package/dist/src/commands/remote/sync.command.d.ts.map +1 -1
- package/dist/src/commands/setup.command.d.ts.map +1 -1
- package/dist/src/commands/version.command.d.ts.map +1 -1
- package/dist/src/commands/website/__tests__/audit.command.test.d.ts.map +1 -1
- package/dist/src/commands/website/audit.command.d.ts.map +1 -1
- package/dist/src/commands/workbench/__tests__/workbench.commands.test.d.ts.map +1 -1
- package/dist/src/commands/workbench/open.command.d.ts.map +1 -1
- package/dist/src/commands/workbench/status.command.d.ts.map +1 -1
- package/dist/src/infrastructure/errors/error.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/io/file.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/io/io.schemas.d.ts.map +1 -1
- package/dist/src/infrastructure/io/template-processor.d.ts.map +1 -1
- package/dist/src/infrastructure/logger/logger.service.d.ts.map +1 -1
- package/dist/src/infrastructure/process/__tests__/spawn.utils.test.d.ts.map +1 -1
- package/dist/src/infrastructure/process/spawn.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/formatting.service.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/interaction-engine.service.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/markdown-renderer.service.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/ui.schemas.d.ts.map +1 -1
- package/dist/src/infrastructure/utils/string.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/validation/validator.service.d.ts.map +1 -1
- package/dist/src/kernel/__tests__/bootstrap.test.d.ts.map +1 -1
- package/dist/src/kernel/__tests__/command-registry.test.d.ts.map +1 -1
- package/dist/src/kernel/__tests__/command-registry.test.js +9 -0
- package/dist/src/kernel/__tests__/command-registry.test.js.map +1 -1
- package/dist/src/kernel/__tests__/command-runner.test.d.ts.map +1 -1
- package/dist/src/kernel/__tests__/command-scope-utils.test.d.ts.map +1 -1
- package/dist/src/kernel/__tests__/flag-utils.test.d.ts.map +1 -1
- package/dist/src/kernel/__tests__/hooks.test.d.ts.map +1 -1
- package/dist/src/kernel/base-command.d.ts.map +1 -1
- package/dist/src/kernel/bootstrap.d.ts.map +1 -1
- package/dist/src/kernel/command-registry.d.ts.map +1 -1
- package/dist/src/kernel/command-registry.js +6 -0
- package/dist/src/kernel/command-registry.js.map +1 -1
- package/dist/src/kernel/command-runner.d.ts.map +1 -1
- package/dist/src/kernel/command-scope-utils.d.ts.map +1 -1
- package/dist/src/kernel/flag-utils.d.ts.map +1 -1
- package/dist/src/kernel/hooks.d.ts.map +1 -1
- package/dist/src/kernel/logger.d.ts.map +1 -1
- package/dist/src/kernel/types.d.ts +17 -1
- package/dist/src/kernel/types.d.ts.map +1 -1
- package/dist/src/kernel/types.js +16 -0
- package/dist/src/kernel/types.js.map +1 -1
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/__tests__/admin-user.module.test.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.d.ts +2 -0
- package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.d.ts.map +1 -0
- package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.js +146 -0
- package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.js.map +1 -0
- package/dist/src/modules/domain/credentials/__tests__/providers-config.module.test.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/__tests__/providers-config.module.test.js +2 -2
- package/dist/src/modules/domain/credentials/__tests__/providers-config.module.test.js.map +1 -1
- package/dist/src/modules/domain/credentials/admin-user.module.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/approver-user.module.d.ts +85 -0
- package/dist/src/modules/domain/credentials/approver-user.module.d.ts.map +1 -0
- package/dist/src/modules/domain/credentials/approver-user.module.js +92 -0
- package/dist/src/modules/domain/credentials/approver-user.module.js.map +1 -0
- package/dist/src/modules/domain/credentials/module.types.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/providers-config.module.d.ts +17 -9
- package/dist/src/modules/domain/credentials/providers-config.module.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/providers-config.module.js +18 -10
- package/dist/src/modules/domain/credentials/providers-config.module.js.map +1 -1
- package/dist/src/modules/domain/environment/__tests__/database-config.module.test.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/database-config.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/module.types.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/paths-config.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/runtime-selector.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/runtime-semantics.module.d.ts.map +1 -1
- package/dist/src/modules/domain/module.types.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.d.ts +2 -0
- package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.d.ts.map +1 -0
- package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.js +111 -0
- package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.js.map +1 -0
- package/dist/src/services/application/__tests__/app-bootstrap.service.apps-manager-reconnect.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.service.degraded-env.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.service.operation-timeout.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.service.operation-timeout.test.js +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.service.operation-timeout.test.js.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.service.test.js +22 -29
- package/dist/src/services/application/__tests__/app-bootstrap.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.two-phase-seeding.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.two-phase-seeding.test.js +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.two-phase-seeding.test.js.map +1 -1
- package/dist/src/services/application/__tests__/app-runtime-targets.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-runtime-targets.service.test.js +2 -2
- package/dist/src/services/application/__tests__/app-runtime-targets.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/application-assets-delivery.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/application-assets-delivery.service.test.js +19 -0
- package/dist/src/services/application/__tests__/application-assets-delivery.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/application-dependency-alignment.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/application-initialization-verification.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/application-runtime-bootstrap.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/apps-manager-unavailable-classification.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/apps-manager-unavailable-classification.test.js.map +1 -1
- package/dist/src/services/application/__tests__/audit-provider-immudb-backing.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/dev-orchestrator.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/dev-schema-drift.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/existing-app-bootstrap.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/existing-app-bootstrap.service.test.js +0 -1
- package/dist/src/services/application/__tests__/existing-app-bootstrap.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/local-app-reinit.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/local-app-reinit.service.test.js +8 -1
- package/dist/src/services/application/__tests__/local-app-reinit.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/local-application-initialization.guard.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/local-application-initialization.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/local-application-initialization.service.test.js +35 -0
- package/dist/src/services/application/__tests__/local-application-initialization.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/provider-package-links.service.test.d.ts +2 -0
- package/dist/src/services/application/__tests__/provider-package-links.service.test.d.ts.map +1 -0
- package/dist/src/services/application/__tests__/provider-package-links.service.test.js +224 -0
- package/dist/src/services/application/__tests__/provider-package-links.service.test.js.map +1 -0
- package/dist/src/services/application/__tests__/provider-runtime-sync.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/provider-runtime-sync.service.test.js +28 -0
- package/dist/src/services/application/__tests__/provider-runtime-sync.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/saas-and-infra-contracts.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/saas-and-infra-contracts.test.js +0 -1
- package/dist/src/services/application/__tests__/saas-and-infra-contracts.test.js.map +1 -1
- package/dist/src/services/application/__tests__/saas-scaffold.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/saas-skeleton.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/saas-skeleton.service.test.js.map +1 -1
- package/dist/src/services/application/app-bootstrap.service.d.ts +43 -10
- package/dist/src/services/application/app-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/app-bootstrap.service.js +92 -49
- package/dist/src/services/application/app-bootstrap.service.js.map +1 -1
- package/dist/src/services/application/app-env.service.d.ts.map +1 -1
- package/dist/src/services/application/app-local-runtime-addresses.service.d.ts.map +1 -1
- package/dist/src/services/application/app-runtime-targets.service.d.ts.map +1 -1
- package/dist/src/services/application/app-schema-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/application-assets-delivery.service.d.ts +22 -1
- package/dist/src/services/application/application-assets-delivery.service.d.ts.map +1 -1
- package/dist/src/services/application/application-assets-delivery.service.js +35 -7
- package/dist/src/services/application/application-assets-delivery.service.js.map +1 -1
- package/dist/src/services/application/application-dependency-alignment.service.d.ts.map +1 -1
- package/dist/src/services/application/application-dev-port-offsets.d.ts.map +1 -1
- package/dist/src/services/application/application-initialization-verification.service.d.ts.map +1 -1
- package/dist/src/services/application/application-root.utils.d.ts.map +1 -1
- package/dist/src/services/application/application-runtime-bootstrap.service.d.ts +6 -0
- package/dist/src/services/application/application-runtime-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/application-runtime-bootstrap.service.js +41 -2
- package/dist/src/services/application/application-runtime-bootstrap.service.js.map +1 -1
- package/dist/src/services/application/dev-orchestrator.service.d.ts.map +1 -1
- package/dist/src/services/application/dev-schema-drift.service.d.ts.map +1 -1
- package/dist/src/services/application/existing-app-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/local-app-reinit.service.d.ts.map +1 -1
- package/dist/src/services/application/local-application-initialization.service.d.ts.map +1 -1
- package/dist/src/services/application/local-application-initialization.service.js +22 -6
- package/dist/src/services/application/local-application-initialization.service.js.map +1 -1
- package/dist/src/services/application/provider-package-links.service.d.ts +160 -0
- package/dist/src/services/application/provider-package-links.service.d.ts.map +1 -0
- package/dist/src/services/application/provider-package-links.service.js +312 -0
- package/dist/src/services/application/provider-package-links.service.js.map +1 -0
- package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
- package/dist/src/services/application/provider-runtime-sync.service.js +7 -20
- package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
- package/dist/src/services/application/saas-scaffold.service.d.ts.map +1 -1
- package/dist/src/services/application/saas-scaffold.service.js +11 -2
- package/dist/src/services/application/saas-scaffold.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 +46 -26
- package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
- package/dist/src/services/brand/__tests__/brand-asset-delivery.test.d.ts.map +1 -1
- package/dist/src/services/brand/brand-asset-projection.d.ts.map +1 -1
- package/dist/src/services/brand/brand-destination-utils.d.ts.map +1 -1
- package/dist/src/services/brand/brand-propagation.types.d.ts.map +1 -1
- package/dist/src/services/brand/brand-ssot-reader.d.ts.map +1 -1
- package/dist/src/services/brand/destinations/app-public.destination.d.ts.map +1 -1
- package/dist/src/services/brand/destinations/runtime-app-config.destination.d.ts.map +1 -1
- package/dist/src/services/brand/destinations/technical-doc-static.destination.d.ts.map +1 -1
- package/dist/src/services/brand/destinations/website-og.destination.d.ts.map +1 -1
- package/dist/src/services/brand/destinations/website-public.destination.d.ts.map +1 -1
- package/dist/src/services/catalog/__tests__/durable-state-classification.test.d.ts +2 -0
- package/dist/src/services/catalog/__tests__/durable-state-classification.test.d.ts.map +1 -0
- package/dist/src/services/catalog/__tests__/durable-state-classification.test.js +93 -0
- package/dist/src/services/catalog/__tests__/durable-state-classification.test.js.map +1 -0
- package/dist/src/services/catalog/__tests__/service-address-resolver.service.test.d.ts.map +1 -1
- package/dist/src/services/catalog/__tests__/service-address-resolver.service.test.js +25 -5
- package/dist/src/services/catalog/__tests__/service-address-resolver.service.test.js.map +1 -1
- package/dist/src/services/catalog/__tests__/service-catalog.schemas.test.d.ts.map +1 -1
- package/dist/src/services/catalog/__tests__/service-catalog.schemas.test.js +109 -51
- package/dist/src/services/catalog/__tests__/service-catalog.schemas.test.js.map +1 -1
- package/dist/src/services/catalog/service-address-resolver.service.d.ts +0 -1
- package/dist/src/services/catalog/service-address-resolver.service.d.ts.map +1 -1
- package/dist/src/services/catalog/service-address-resolver.service.js +23 -7
- package/dist/src/services/catalog/service-address-resolver.service.js.map +1 -1
- package/dist/src/services/catalog/service-catalog.schemas.d.ts +148 -51
- package/dist/src/services/catalog/service-catalog.schemas.d.ts.map +1 -1
- package/dist/src/services/catalog/service-catalog.schemas.js +230 -78
- package/dist/src/services/catalog/service-catalog.schemas.js.map +1 -1
- package/dist/src/services/coding-agents/__tests__/acp-conformance-probe.service.test.d.ts +2 -0
- package/dist/src/services/coding-agents/__tests__/acp-conformance-probe.service.test.d.ts.map +1 -0
- package/dist/src/services/coding-agents/__tests__/acp-conformance-probe.service.test.js +110 -0
- package/dist/src/services/coding-agents/__tests__/acp-conformance-probe.service.test.js.map +1 -0
- package/dist/src/services/coding-agents/acp-conformance-probe.service.d.ts +32 -0
- package/dist/src/services/coding-agents/acp-conformance-probe.service.d.ts.map +1 -1
- package/dist/src/services/coding-agents/acp-conformance-probe.service.js +165 -7
- package/dist/src/services/coding-agents/acp-conformance-probe.service.js.map +1 -1
- package/dist/src/services/companion/__tests__/companion-client.service.test.d.ts.map +1 -1
- package/dist/src/services/companion/__tests__/companion-client.service.test.js +96 -0
- package/dist/src/services/companion/__tests__/companion-client.service.test.js.map +1 -1
- package/dist/src/services/companion/__tests__/companion-lifecycle.service.test.d.ts.map +1 -1
- package/dist/src/services/companion/__tests__/workbench-browser-launcher.service.test.d.ts.map +1 -1
- package/dist/src/services/companion/__tests__/workbench-cli.service.test.d.ts.map +1 -1
- package/dist/src/services/companion/companion-client-options.utils.d.ts.map +1 -1
- package/dist/src/services/companion/companion-client-options.utils.js +6 -0
- package/dist/src/services/companion/companion-client-options.utils.js.map +1 -1
- package/dist/src/services/companion/companion-client.service.d.ts.map +1 -1
- package/dist/src/services/companion/companion-client.service.js +34 -0
- package/dist/src/services/companion/companion-client.service.js.map +1 -1
- package/dist/src/services/companion/companion-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/companion/companion-local-token.utils.d.ts +20 -0
- package/dist/src/services/companion/companion-local-token.utils.d.ts.map +1 -0
- package/dist/src/services/companion/companion-local-token.utils.js +62 -0
- package/dist/src/services/companion/companion-local-token.utils.js.map +1 -0
- package/dist/src/services/companion/companion.schemas.d.ts +12 -0
- package/dist/src/services/companion/companion.schemas.d.ts.map +1 -1
- package/dist/src/services/companion/companion.schemas.js.map +1 -1
- package/dist/src/services/companion/git-helper.service.d.ts.map +1 -1
- package/dist/src/services/companion/local-companion-authority.service.d.ts.map +1 -1
- package/dist/src/services/companion/local-companion-authority.service.js +9 -30
- package/dist/src/services/companion/local-companion-authority.service.js.map +1 -1
- package/dist/src/services/companion/workbench-browser-launcher.service.d.ts.map +1 -1
- package/dist/src/services/companion/workbench-cli.service.d.ts.map +1 -1
- package/dist/src/services/companion/workbench-cli.service.js +10 -1
- package/dist/src/services/companion/workbench-cli.service.js.map +1 -1
- package/dist/src/services/context/__tests__/context-manager.installed-assets.test.d.ts.map +1 -1
- package/dist/src/services/context/__tests__/context-manager.installed-assets.test.js +7 -0
- package/dist/src/services/context/__tests__/context-manager.installed-assets.test.js.map +1 -1
- package/dist/src/services/context/__tests__/context-manager.service.test.d.ts.map +1 -1
- package/dist/src/services/context/context-manager.service.d.ts +9 -0
- package/dist/src/services/context/context-manager.service.d.ts.map +1 -1
- package/dist/src/services/context/context-manager.service.js +13 -1
- package/dist/src/services/context/context-manager.service.js.map +1 -1
- package/dist/src/services/context/context.schemas.d.ts.map +1 -1
- package/dist/src/services/context/state-manager.service.d.ts.map +1 -1
- package/dist/src/services/credentials/__tests__/ci-secrets-mapping.test.d.ts +28 -0
- package/dist/src/services/credentials/__tests__/ci-secrets-mapping.test.d.ts.map +1 -0
- package/dist/src/services/credentials/__tests__/ci-secrets-mapping.test.js +197 -0
- package/dist/src/services/credentials/__tests__/ci-secrets-mapping.test.js.map +1 -0
- package/dist/src/services/credentials/__tests__/composed-provider-secrets.guard.test.d.ts +2 -0
- package/dist/src/services/credentials/__tests__/composed-provider-secrets.guard.test.d.ts.map +1 -0
- package/dist/src/services/credentials/__tests__/composed-provider-secrets.guard.test.js +327 -0
- package/dist/src/services/credentials/__tests__/composed-provider-secrets.guard.test.js.map +1 -0
- package/dist/src/services/credentials/__tests__/framework-managed-secrets.test.d.ts.map +1 -1
- package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.d.ts +2 -0
- package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.d.ts.map +1 -0
- package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.js +94 -0
- package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.js.map +1 -0
- package/dist/src/services/credentials/__tests__/secrets-contracts.test.d.ts.map +1 -1
- package/dist/src/services/credentials/ci-secrets-adapter.service.d.ts.map +1 -1
- package/dist/src/services/credentials/ci-secrets-adapter.service.js +114 -37
- package/dist/src/services/credentials/ci-secrets-adapter.service.js.map +1 -1
- package/dist/src/services/credentials/composed-provider-catalogue.d.ts +209 -0
- package/dist/src/services/credentials/composed-provider-catalogue.d.ts.map +1 -0
- package/dist/src/services/credentials/composed-provider-catalogue.js +263 -0
- package/dist/src/services/credentials/composed-provider-catalogue.js.map +1 -0
- package/dist/src/services/credentials/credentials.schemas.d.ts +29 -22
- package/dist/src/services/credentials/credentials.schemas.d.ts.map +1 -1
- package/dist/src/services/credentials/credentials.schemas.js +67 -5
- package/dist/src/services/credentials/credentials.schemas.js.map +1 -1
- package/dist/src/services/credentials/credentials.service.d.ts.map +1 -1
- package/dist/src/services/credentials/framework-managed-secrets.d.ts +105 -1
- package/dist/src/services/credentials/framework-managed-secrets.d.ts.map +1 -1
- package/dist/src/services/credentials/framework-managed-secrets.js +51 -8
- package/dist/src/services/credentials/framework-managed-secrets.js.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.d.ts +127 -7
- package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.js +189 -45
- package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
- package/dist/src/services/credentials/secrets-provisioning.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-reader.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-rotation.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-writer.service.d.ts.map +1 -1
- package/dist/src/services/data-services/data-services.schemas.d.ts +0 -1
- package/dist/src/services/data-services/data-services.schemas.d.ts.map +1 -1
- package/dist/src/services/data-services/data-services.schemas.js +0 -1
- package/dist/src/services/data-services/data-services.schemas.js.map +1 -1
- package/dist/src/services/data-services/data-services.service.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/apps-manager-diagnostics.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/ci-deploy-generator.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/ci-deploy-generator.service.test.js +91 -1
- package/dist/src/services/deployment/__tests__/ci-deploy-generator.service.test.js.map +1 -1
- package/dist/src/services/deployment/__tests__/ci-workflow-generator.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/deployment-template-contracts.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/deployment-template-contracts.test.js +45 -15
- package/dist/src/services/deployment/__tests__/deployment-template-contracts.test.js.map +1 -1
- package/dist/src/services/deployment/__tests__/host-toolchain-readiness.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/host-toolchain-readiness.service.test.js +33 -1
- package/dist/src/services/deployment/__tests__/host-toolchain-readiness.service.test.js.map +1 -1
- package/dist/src/services/deployment/__tests__/infra-templates-render-smoke.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/local-dev-observer-lifecycle.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/local-dev-output-boundary.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/local-dev-session-lease.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/local-dev-shutdown-coordinator.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/local-precondition-checks.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/local-precondition-checks.service.test.js +44 -1
- package/dist/src/services/deployment/__tests__/local-precondition-checks.service.test.js.map +1 -1
- package/dist/src/services/deployment/__tests__/local-runtime-process-cleanup.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/parity.compose-vs-k8s.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/parity.compose-vs-k8s.test.js +82 -87
- package/dist/src/services/deployment/__tests__/parity.compose-vs-k8s.test.js.map +1 -1
- package/dist/src/services/deployment/__tests__/platform-lifecycle.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/platform-runtime-policy.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/apps-manager-diagnostics.service.d.ts.map +1 -1
- package/dist/src/services/deployment/ci-deploy-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/ci-deploy-generator.service.js +11 -1
- package/dist/src/services/deployment/ci-deploy-generator.service.js.map +1 -1
- package/dist/src/services/deployment/ci-workflow-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/ci-workflow-generator.service.js +23 -4
- package/dist/src/services/deployment/ci-workflow-generator.service.js.map +1 -1
- package/dist/src/services/deployment/docker/__tests__/compose-env-value-encoding.test.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/__tests__/compose-host-mounted-artifact.test.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/__tests__/docker-compose-generator.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/__tests__/docker-compose-generator.service.test.js +150 -7
- package/dist/src/services/deployment/docker/__tests__/docker-compose-generator.service.test.js.map +1 -1
- package/dist/src/services/deployment/docker/__tests__/docker-compose-readiness.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts +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 +60 -12
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-readiness.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker.service.d.ts.map +1 -1
- package/dist/src/services/deployment/host-toolchain-readiness.service.d.ts.map +1 -1
- package/dist/src/services/deployment/infra-writer.service.d.ts.map +1 -1
- package/dist/src/services/deployment/infra-writer.service.js +34 -7
- package/dist/src/services/deployment/infra-writer.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-bootstrap.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-bootstrap.service.test.js +45 -2
- package/dist/src/services/deployment/k8s/__tests__/k8s-bootstrap.service.test.js.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-manifest-generator.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-manifest-generator.service.test.js +110 -9
- package/dist/src/services/deployment/k8s/__tests__/k8s-manifest-generator.service.test.js.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-operations.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-runtime-env-secrets.test.d.ts +2 -0
- package/dist/src/services/deployment/k8s/__tests__/k8s-runtime-env-secrets.test.d.ts.map +1 -0
- package/dist/src/services/deployment/k8s/__tests__/k8s-runtime-env-secrets.test.js +226 -0
- package/dist/src/services/deployment/k8s/__tests__/k8s-runtime-env-secrets.test.js.map +1 -0
- package/dist/src/services/deployment/k8s/__tests__/k8s-secrets-generator.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-secrets-generator.service.test.js +132 -12
- package/dist/src/services/deployment/k8s/__tests__/k8s-secrets-generator.service.test.js.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/kind.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/local-k8s-application-pruning.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-bootstrap.service.d.ts +23 -0
- package/dist/src/services/deployment/k8s/k8s-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-bootstrap.service.js +52 -6
- package/dist/src/services/deployment/k8s/k8s-bootstrap.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-local-infra-readiness.service.d.ts.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 +45 -9
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts +4 -3
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.js +0 -4
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-operations.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.d.ts +10 -1
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js +193 -33
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/kind.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/local-k8s-application-pruning.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-observer-lifecycle.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-output-boundary.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-session-lease.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-shutdown-coordinator.d.ts.map +1 -1
- package/dist/src/services/deployment/local-infrastructure-initialization.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-precondition-checks.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/local-precondition-checks.service.d.ts +28 -17
- package/dist/src/services/deployment/local-precondition-checks.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-precondition-checks.service.js +83 -3
- package/dist/src/services/deployment/local-precondition-checks.service.js.map +1 -1
- package/dist/src/services/deployment/local-runtime-process-cleanup.service.d.ts.map +1 -1
- package/dist/src/services/deployment/platform-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/deployment/platform-runtime-policy.service.d.ts.map +1 -1
- package/dist/src/services/deployment/version-compare.utils.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens-command.service.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens-config.service.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens-config.template.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens-css-block.service.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens-paths.service.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens.constants.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens.models.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/compose-converge-args.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/config-hydration-seam.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/env-configuration-generator.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/env-configuration-generator.service.test.js +36 -20
- package/dist/src/services/environment/__tests__/env-configuration-generator.service.test.js.map +1 -1
- package/dist/src/services/environment/__tests__/env-sync.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/env-sync.service.test.js +6 -4
- package/dist/src/services/environment/__tests__/env-sync.service.test.js.map +1 -1
- package/dist/src/services/environment/__tests__/env-vars-builder.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/env-vars-builder.service.test.js +89 -8
- package/dist/src/services/environment/__tests__/env-vars-builder.service.test.js.map +1 -1
- package/dist/src/services/environment/__tests__/environment-hydration.utils.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/environment-lifecycle.needs-local-mongodb.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/environment-lifecycle.needs-local-postgresql.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/environment-lifecycle.self-hosts-backing-service.test.d.ts +2 -0
- package/dist/src/services/environment/__tests__/environment-lifecycle.self-hosts-backing-service.test.d.ts.map +1 -0
- package/dist/src/services/environment/__tests__/environment-lifecycle.self-hosts-backing-service.test.js +136 -0
- package/dist/src/services/environment/__tests__/environment-lifecycle.self-hosts-backing-service.test.js.map +1 -0
- package/dist/src/services/environment/__tests__/environment-paths.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/environment-registry.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/environment-setup.non-interactive.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/environment-setup.non-interactive.test.js +23 -0
- package/dist/src/services/environment/__tests__/environment-setup.non-interactive.test.js.map +1 -1
- package/dist/src/services/environment/__tests__/platform-engine-change.utils.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/platform-image-ref.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/platform-image-ref.test.js.map +1 -1
- package/dist/src/services/environment/__tests__/platform-runtime-state.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/provider-secrets-env.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/runtime-bootstrap.authored-database-refresh.test.d.ts.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.d.ts +52 -14
- package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.js +41 -38
- package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
- package/dist/src/services/environment/env-sync.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-sync.service.js +13 -13
- package/dist/src/services/environment/env-sync.service.js.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.d.ts +28 -0
- package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.js +188 -41
- package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
- package/dist/src/services/environment/environment-hydration.utils.d.ts.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.d.ts +53 -1
- package/dist/src/services/environment/environment-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.js +65 -1
- package/dist/src/services/environment/environment-lifecycle.service.js.map +1 -1
- package/dist/src/services/environment/environment-paths.service.d.ts +2 -1
- package/dist/src/services/environment/environment-paths.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-paths.service.js +5 -3
- package/dist/src/services/environment/environment-paths.service.js.map +1 -1
- package/dist/src/services/environment/environment-registry.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-setup.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-setup.service.js +23 -9
- package/dist/src/services/environment/environment-setup.service.js.map +1 -1
- package/dist/src/services/environment/environment.schemas.d.ts.map +1 -1
- package/dist/src/services/environment/environment.service.d.ts +6 -1
- package/dist/src/services/environment/environment.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment.service.js +2 -0
- package/dist/src/services/environment/environment.service.js.map +1 -1
- package/dist/src/services/environment/platform-engine-change.utils.d.ts.map +1 -1
- package/dist/src/services/environment/platform-runtime-state.service.d.ts.map +1 -1
- package/dist/src/services/environment/platform-runtime.schemas.d.ts.map +1 -1
- package/dist/src/services/environment/platform-runtime.schemas.js.map +1 -1
- package/dist/src/services/environment/runtime-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/application-rule-imports.test.d.ts +2 -0
- package/dist/src/services/framework/__tests__/application-rule-imports.test.d.ts.map +1 -0
- package/dist/src/services/framework/__tests__/application-rule-imports.test.js +58 -0
- package/dist/src/services/framework/__tests__/application-rule-imports.test.js.map +1 -0
- package/dist/src/services/framework/__tests__/engine-provider-specifications.reconciliation.test.d.ts +2 -0
- package/dist/src/services/framework/__tests__/engine-provider-specifications.reconciliation.test.d.ts.map +1 -0
- package/dist/src/services/framework/__tests__/engine-provider-specifications.reconciliation.test.js +55 -0
- package/dist/src/services/framework/__tests__/engine-provider-specifications.reconciliation.test.js.map +1 -0
- package/dist/src/services/framework/__tests__/fixtures/framework-knowledge-package-only.fixture.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/fixtures/framework-knowledge-package-only.fixture.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-development-skills-sync.installed-package.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-development-skills-sync.installed-package.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-development-skills-sync.package-only.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-development-skills-sync.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-docker-publish.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-docker-publish.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-application-guidance.validator.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-audit.live.contract.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-audit.live.contract.test.js +17 -0
- package/dist/src/services/framework/__tests__/framework-knowledge-audit.live.contract.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-audit.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-audit.service.test.js +101 -0
- package/dist/src/services/framework/__tests__/framework-knowledge-audit.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-generation.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-generation.service.test.js +4 -70
- package/dist/src/services/framework/__tests__/framework-knowledge-generation.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-npm-publish.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-npm-publish.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-publish-manifest.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-publish-manifest.service.test.js +78 -6
- package/dist/src/services/framework/__tests__/framework-publish-manifest.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-release.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-release.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-secrets-writer.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-version.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-version.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/installed-framework-assets.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/application-rule-imports.d.ts +36 -0
- package/dist/src/services/framework/application-rule-imports.d.ts.map +1 -0
- package/dist/src/services/framework/application-rule-imports.js +77 -0
- package/dist/src/services/framework/application-rule-imports.js.map +1 -0
- package/dist/src/services/framework/framework-development-skills-sync.service.d.ts +23 -0
- package/dist/src/services/framework/framework-development-skills-sync.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-development-skills-sync.service.js +51 -0
- package/dist/src/services/framework/framework-development-skills-sync.service.js.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
- package/dist/src/services/framework/framework-knowledge-application-guidance.validator.d.ts.map +1 -1
- package/dist/src/services/framework/framework-knowledge-audit.service.d.ts +86 -1
- package/dist/src/services/framework/framework-knowledge-audit.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-knowledge-audit.service.js +212 -1
- package/dist/src/services/framework/framework-knowledge-audit.service.js.map +1 -1
- package/dist/src/services/framework/framework-knowledge-generation.service.d.ts +0 -1
- package/dist/src/services/framework/framework-knowledge-generation.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-knowledge-generation.service.js +29 -215
- package/dist/src/services/framework/framework-knowledge-generation.service.js.map +1 -1
- package/dist/src/services/framework/framework-knowledge-scan.constants.d.ts.map +1 -1
- package/dist/src/services/framework/framework-npm-publish.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-npm-publish.service.js +7 -3
- package/dist/src/services/framework/framework-npm-publish.service.js.map +1 -1
- package/dist/src/services/framework/framework-publish-manifest.service.d.ts +44 -1
- package/dist/src/services/framework/framework-publish-manifest.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-publish-manifest.service.js +79 -4
- package/dist/src/services/framework/framework-publish-manifest.service.js.map +1 -1
- package/dist/src/services/framework/framework-release.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-version.service.d.ts +13 -0
- package/dist/src/services/framework/framework-version.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-version.service.js +23 -24
- package/dist/src/services/framework/framework-version.service.js.map +1 -1
- package/dist/src/services/framework/installed-framework-assets.service.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.d.ts +2 -0
- package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.js +100 -0
- package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/client-and-schema-agree.test.d.ts +2 -0
- package/dist/src/services/framework/provider-transposition/__tests__/client-and-schema-agree.test.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/client-and-schema-agree.test.js +92 -0
- package/dist/src/services/framework/provider-transposition/__tests__/client-and-schema-agree.test.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/decision-projection.test.d.ts +2 -0
- package/dist/src/services/framework/provider-transposition/__tests__/decision-projection.test.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/decision-projection.test.js +83 -0
- package/dist/src/services/framework/provider-transposition/__tests__/decision-projection.test.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/plan-matches-emit.test.d.ts +2 -0
- package/dist/src/services/framework/provider-transposition/__tests__/plan-matches-emit.test.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/plan-matches-emit.test.js +219 -0
- package/dist/src/services/framework/provider-transposition/__tests__/plan-matches-emit.test.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/provider-catalogue-record.test.d.ts +2 -0
- package/dist/src/services/framework/provider-transposition/__tests__/provider-catalogue-record.test.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/provider-catalogue-record.test.js +372 -0
- package/dist/src/services/framework/provider-transposition/__tests__/provider-catalogue-record.test.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/transposition-contract.test.d.ts +2 -0
- package/dist/src/services/framework/provider-transposition/__tests__/transposition-contract.test.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/transposition-contract.test.js +794 -0
- package/dist/src/services/framework/provider-transposition/__tests__/transposition-contract.test.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/activepieces-source.reader.d.ts +14 -0
- package/dist/src/services/framework/provider-transposition/activepieces-source.reader.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/activepieces-source.reader.js +1047 -0
- package/dist/src/services/framework/provider-transposition/activepieces-source.reader.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/openapi-enrichment.d.ts +26 -0
- package/dist/src/services/framework/provider-transposition/openapi-enrichment.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/openapi-enrichment.js +57 -0
- package/dist/src/services/framework/provider-transposition/openapi-enrichment.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/openapi-source.reader.d.ts +35 -0
- package/dist/src/services/framework/provider-transposition/openapi-source.reader.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/openapi-source.reader.js +204 -0
- package/dist/src/services/framework/provider-transposition/openapi-source.reader.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/provider-catalogue-record.d.ts +410 -0
- package/dist/src/services/framework/provider-transposition/provider-catalogue-record.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/provider-catalogue-record.js +434 -0
- package/dist/src/services/framework/provider-transposition/provider-catalogue-record.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/provider-merge.d.ts +39 -0
- package/dist/src/services/framework/provider-transposition/provider-merge.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/provider-merge.js +274 -0
- package/dist/src/services/framework/provider-transposition/provider-merge.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/provider-package.emitter.d.ts +139 -0
- package/dist/src/services/framework/provider-transposition/provider-package.emitter.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/provider-package.emitter.js +1586 -0
- package/dist/src/services/framework/provider-transposition/provider-package.emitter.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/sim-source.reader.d.ts +35 -0
- package/dist/src/services/framework/provider-transposition/sim-source.reader.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/sim-source.reader.js +527 -0
- package/dist/src/services/framework/provider-transposition/sim-source.reader.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/transposed-provider.model.d.ts +229 -0
- package/dist/src/services/framework/provider-transposition/transposed-provider.model.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/transposed-provider.model.js +96 -0
- package/dist/src/services/framework/provider-transposition/transposed-provider.model.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/url-template.extractor.d.ts +55 -0
- package/dist/src/services/framework/provider-transposition/url-template.extractor.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/url-template.extractor.js +196 -0
- package/dist/src/services/framework/provider-transposition/url-template.extractor.js.map +1 -0
- package/dist/src/services/frontend/__tests__/cloudflare-cdn.service.test.d.ts.map +1 -1
- package/dist/src/services/frontend/__tests__/frontend-dist-uploader.service.test.d.ts.map +1 -1
- package/dist/src/services/frontend/__tests__/frontend-publish.service.test.d.ts.map +1 -1
- package/dist/src/services/frontend/cloudflare-cdn.service.d.ts.map +1 -1
- package/dist/src/services/frontend/cloudflare-cdn.service.js +33 -2
- package/dist/src/services/frontend/cloudflare-cdn.service.js.map +1 -1
- package/dist/src/services/frontend/frontend-dist-uploader.service.d.ts.map +1 -1
- package/dist/src/services/frontend/frontend-publish.service.d.ts.map +1 -1
- package/dist/src/services/frontend/frontend-publish.service.js +1 -1
- package/dist/src/services/frontend/frontend-publish.service.js.map +1 -1
- package/dist/src/services/generation/domain-generator.service.d.ts.map +1 -1
- package/dist/src/services/generation/generator.schemas.d.ts.map +1 -1
- package/dist/src/services/generation/operation-generator.service.d.ts.map +1 -1
- package/dist/src/services/generation/resource-generator.service.d.ts.map +1 -1
- package/dist/src/services/generation/template-registry.service.d.ts.map +1 -1
- package/dist/src/services/registry/artifact-extractor.utils.d.ts.map +1 -1
- package/dist/src/services/registry/boundary-fanout.utils.d.ts.map +1 -1
- package/dist/src/services/registry/index.d.ts.map +1 -1
- package/dist/src/services/registry/registry-command.utils.d.ts.map +1 -1
- package/dist/src/services/registry/registry-config-resolver.service.d.ts.map +1 -1
- package/dist/src/services/registry/registry-credentials.service.d.ts.map +1 -1
- package/dist/src/services/registry/saas-root-required.error.d.ts.map +1 -1
- package/dist/src/services/security/__tests__/csp-artifact-currency.live.contract.test.d.ts +67 -0
- package/dist/src/services/security/__tests__/csp-artifact-currency.live.contract.test.d.ts.map +1 -0
- package/dist/src/services/security/__tests__/csp-artifact-currency.live.contract.test.js +212 -0
- package/dist/src/services/security/__tests__/csp-artifact-currency.live.contract.test.js.map +1 -0
- package/dist/src/services/security/__tests__/csp-boundary.test.d.ts.map +1 -1
- package/dist/src/services/security/__tests__/csp-sync.service.test.d.ts.map +1 -1
- package/dist/src/services/security/__tests__/csp-sync.service.test.js +411 -5
- package/dist/src/services/security/__tests__/csp-sync.service.test.js.map +1 -1
- package/dist/src/services/security/csp-sync.service.d.ts +27 -5
- package/dist/src/services/security/csp-sync.service.d.ts.map +1 -1
- package/dist/src/services/security/csp-sync.service.js +204 -16
- package/dist/src/services/security/csp-sync.service.js.map +1 -1
- package/dist/src/services/tools/utility-tools.service.d.ts.map +1 -1
- package/dist/src/services/website/__tests__/website-structured-data-audit.adapter-seam.test.d.ts +2 -0
- package/dist/src/services/website/__tests__/website-structured-data-audit.adapter-seam.test.d.ts.map +1 -0
- package/dist/src/services/website/__tests__/website-structured-data-audit.adapter-seam.test.js +94 -0
- package/dist/src/services/website/__tests__/website-structured-data-audit.adapter-seam.test.js.map +1 -0
- package/dist/src/services/website/website-structured-data-audit.service.d.ts +9 -0
- package/dist/src/services/website/website-structured-data-audit.service.d.ts.map +1 -1
- package/dist/src/services/website/website-structured-data-audit.service.js +72 -11
- package/dist/src/services/website/website-structured-data-audit.service.js.map +1 -1
- package/dist/src/test-utils/resolved-homes.test.utils.d.ts.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/framework-root-package.json +2 -0
- package/package.json +19 -17
- package/scripts/app-dependency-alignment/propagated-engine-overrides.json +15 -0
- package/templates/infra/ci/deploy-docker-compose.yml.hbs +1 -1
- package/templates/infra/ci/deploy-k8s.yml.hbs +1 -1
- package/templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs +394 -90
- package/templates/infra/docker-images/backend/Dockerfile.backend-base +7 -1
- package/templates/infra/docker-images/backend/Dockerfile.backend-base-java +7 -1
- package/templates/infra/docker-images/platform/Dockerfile.platform-base.dockerignore +23 -0
- package/templates/infra/k8s/applications/wildo-ai-application/backend.deployment.yaml.hbs +8 -5
- package/templates/infra/k8s/applications/wildo-ai-application/ingress.yaml.hbs +3 -2
- package/templates/infra/k8s/applications/wildo-ai-application/minion.deployment.yaml.hbs +22 -6
- package/templates/infra/k8s/applications/wildo-ai-application/worker.deployment.yaml.hbs +17 -13
- package/templates/infra/k8s/platform/platform-crontabs-batches-manager/deployment.yaml.hbs +11 -0
- package/templates/infra/k8s/storage/local/persistent-volumes.yaml.hbs +18 -4
- package/templates/saas/engine-peer-closure.json +12 -0
- package/templates/saas/i18n/email/components/EmailHeader.tsx +9 -0
- package/templates/saas/i18n/email/components/EmailLayout.tsx +14 -0
- package/templates/saas/i18n/email/resources/applicationApiKeys/create.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationApiKeys/deactivate.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationApiKeys/reactivate.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationApiKeys/regenerate.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationApiKeys/rotate.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationOAuthClients/create.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationOAuthClients/regenerate.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationOAuthClients/rotate.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationVersions/create.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationVersions/delete.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationVersions/deprecate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationVersions/promote.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationVersions/rollback.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/create.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/create.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/delete.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/delete.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/transfer.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/transfer.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/update.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/update.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/create.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/create.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/deactivate.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/deactivate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/delete.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/delete.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/reactivate.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/reactivate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/regenerate.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/regenerate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/rotate.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/rotate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationFeatures/disable_feature.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationFeatures/enable_feature.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationFeatures/reset_features.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationFeatures/update.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/create.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/delete.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/grantOwnership.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/reactivate.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/reactivate.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/resend.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/revoke.user-self_admin/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/revoke.user-self_invitee/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/suspend.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/suspend.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/update.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/create.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/create.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/delete.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/delete.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/regenerate.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/regenerate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/rotate.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/rotate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationUnits/archive.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationUnits/create.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationUnits/delete.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationUnits/move.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationUnits/restore.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationUnits/update.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/activate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/create.admin.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/create.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/request_deletion.admin.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/request_deletion.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/restore.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/suspend.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/update.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/update.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/platformAccessGrants/requestAccess.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/user_self/deactivate_account.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/user_self/reactivate_account.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/assign_roles.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/create.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/delete.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/force_password_reset.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/revoke_roles.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/send_invitation.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/suspend_user.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/unsuspend_user.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/update.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/system/email-otp/template.tsx +1 -0
- package/templates/saas/i18n/email/system/email-verification/template.tsx +1 -1
- package/templates/saas/i18n/email/system/magic-link/template.tsx +1 -1
- package/templates/saas/i18n/email/system/new-device-login/template.tsx +1 -1
- package/templates/saas/i18n/email/system/organization-invitation/template.tsx +1 -0
- package/templates/saas/i18n/email/system/organization-member-removed/template.tsx +1 -0
- package/templates/saas/i18n/email/system/password-reset/template.tsx +1 -1
- package/templates/saas/i18n/email/system/payment-failed/template.tsx +1 -1
- package/templates/saas/i18n/email/system/security-alert/template.tsx +1 -0
- package/templates/saas/i18n/email/system/subscription-cancelled/template.tsx +1 -1
- package/templates/saas/i18n/email/system/subscription-confirmation/template.tsx +1 -0
- package/templates/saas/i18n/email/system/welcome-email/template.tsx +1 -1
- package/templates/saas/scenarios/add-file-picker-provider/files/frontend/src/engine/providers/__providerRef__.frontend-app.module.ts.hbs +10 -4
- package/templates/saas/scenarios/add-minion/files/minions/__minionDir__/src/index.ts.hbs +9 -5
- package/templates/saas/scenarios/add-module/scenario.json +3 -3
- package/templates/saas/scenarios/add-provider/scenario.json +36 -0
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/docusaurus.config.ts.hbs +52 -2
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/csp.config.ts +20 -3
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/pages/auth/exchange.tsx +75 -0
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/pages/search.tsx.hbs +47 -3
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/theme/Root.tsx +46 -4
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/static/img/favicon.svg +5 -4
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/static/img/logo.svg +11 -5
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/wildo.tech-doc.config.ts.hbs +18 -7
- package/templates/saas/scenarios/add-website/files/website/src/app-origin.ts.hbs +32 -16
- package/templates/saas/scenarios/add-website/files/website/src/components/HeaderComponent.tsx +2 -2
- package/templates/saas/scenarios/add-website/files/website/src/pages/index.astro +1 -0
- package/templates/saas/scenarios/add-website/files/website/src/sections/landing.sections.tsx +2 -2
- package/templates/saas/scenarios/add-worker-node/files/workers/__workerDir__/src/index.ts.hbs +9 -5
- package/templates/saas/skeleton/.wildo-saas/dev-framework-scripts/sync-engine.sh +46 -14
- package/templates/saas/skeleton/CLAUDE.md.hbs +12 -0
- package/templates/saas/skeleton/backend-api/package.json.hbs +1 -1
- package/templates/saas/skeleton/backend-api/src/companion-exports.ts +13 -2
- package/templates/saas/skeleton/backend-api/src/index.ts +16 -0
- package/templates/saas/skeleton/frontend/src/config/settings-hub.config.ts +11 -5
- package/templates/saas/skeleton/frontend/src/engine/app-level-views/app-level-views.definitions.module.frontend.ts +1 -1
- package/templates/saas/skeleton/frontend/src/generated/csp.generated.json.hbs +17 -0
- package/templates/saas/skeleton/infrastructure/local/wildo.infra.local.config.ts.hbs +19 -0
- package/templates/saas/skeleton/wildo.saas.config.ts.init.hbs +59 -2
- package/wildo-framework.info.json +1 -1
- package/templates/infra/k8s/internal/gotenberg/deployment.yaml.hbs +0 -46
- package/templates/infra/k8s/internal/gotenberg/service.yaml.hbs +0 -19
- package/templates/infra/k8s/middleware.yaml.hbs +0 -101
- package/templates/saas/scenarios/add-backend-provider/scenario.json +0 -17
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/static/img/favicon.png +0 -0
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/static/img/logo.png +0 -0
- package/templates/saas/skeleton/backend-api/src/provider-contributions.ts +0 -44
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-bootstrap.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/app-bootstrap.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhE,OAAO,EAAsB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EACL,oCAAoC,EACpC,gCAAgC,EAChC,uBAAuB,EACvB,eAAe,EACf,gCAAgC,EAChC,qCAAqC,EAIrC,+BAA+B,EAC/B,gCAAgC,EAChC,uCAAuC,EACvC,wCAAwC,EAExC,qCAAqC,EACrC,mCAAmC,EACnC,gCAAgC,EAChC,gCAAgC,EAChC,yCAAyC,EACzC,mCAAmC,EACnC,uCAAuC,EACvC,gCAAgC,EAChC,mBAAmB,EACnB,wBAAwB,EAExB,UAAU,EACV,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,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CAAC;aACL,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import { existsSync, readFileSync } from 'fs';\nimport { isAbsolute, join, relative, resolve, sep } from 'path';\nimport type { AppConfiguration_BackendAuthored } from '@wildo-ai/saas-backend-lib';\nimport { RuntimeEnvironment, WildoHeaderKeys } from '@wildo-ai/saas-models';\nimport {\n buildAppBootstrapCredentialsResponse,\n APPS_MANAGER_ADMIN_SECRET_HEADER,\n APPS_MANAGER_API_PREFIX,\n AppFrontendType,\n PlatformDocumentationSiteEnvKeys,\n ApplicationCreationVerificationEnvKey,\n type AdminAppManagedDeclaration,\n type AppBootstrapCredentials,\n type AppBootstrapFirstAdminSeed,\n AdminAppInitializeRequestSchema,\n AdminAppInitializeResponseSchema,\n AdminAppReapplyDeclarationRequestSchema,\n AdminAppReapplyDeclarationResponseSchema,\n type AdminAppReapplyDeclarationResponse,\n AppBootstrapCredentialsResponseSchema,\n buildAdminInitializeApplicationPath,\n buildAdminReapplyDeclarationPath,\n buildAppBootstrapCredentialsPath,\n buildLocalhostApplicationRuntimeEndpoints,\n buildK8sApplicationRuntimeEndpoints,\n buildComposeApplicationRuntimeEndpoints,\n buildK8sApplicationIngressRoutes,\n buildK8sInternalUrl,\n APP_RUNTIME_SUBDIR_NAMES,\n type K8sIngressRoute,\n loadConfig,\n resolveAppLayout,\n WildoDeploymentRuntime,\n WildoLocationType,\n WORKSPACE_HOME_NAMES,\n WORKER_CONFIG_FILENAME,\n MINION_CONFIG_FILENAME,\n WildoWorkerConfigSchema,\n WildoMinionConfigSchema,\n ApplicationRuntimePrincipalKind,\n buildMinionRedisKeyPrefix,\n registerMinionLocalProviders,\n buildRuntimePrincipalKey,\n enumerateDeclaredRuntimePrincipals,\n type ApplicationRuntimePrincipal,\n DatabaseEngine,\n AppDatabaseSeedingPhase,\n AppDatabaseSeedingOutcome,\n} from '@wildo-ai/platform-config-lib';\nimport { buildWorkerInternalUrl } from '@wildo-ai/platform-core-shared';\nimport type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvConfigJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport type {\n ApplicationBackendEnvTarget,\n CompanionPlatformEnvTarget,\n ApplicationFrontendEnvExampleTarget,\n ApplicationOperatorEnvTarget,\n ApplicationWorkerEnvTarget,\n ApplicationMinionEnvTarget,\n K8sPodPort,\n} from '~wildo-cli/services/environment/env-configuration-generator.service';\nimport { ApplicationOperatorEnvFileDisposition } from '~wildo-cli/services/environment/env-configuration-generator.service';\nimport { AddressPerspective, ServiceAddressResolver } from '~wildo-cli/services/catalog/service-address-resolver.service';\nimport { buildAppsManagerDiagnosticMessage } from '~wildo-cli/services/deployment/apps-manager-diagnostics.service';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { AppRuntimeTargetsService, type ResolvedAppRuntimeTarget } from './app-runtime-targets.service';\nimport { applyAppSchemaMigrations, resolveAppMigrationsDirectory } from './app-schema-bootstrap.service';\n\n\n/**\n * Budget for a LIGHT apps-manager call — a read, or an idempotent config re-source.\n *\n * Short on purpose: for an operation that should answer in well under a second, a short budget is\n * what gives the timeout its diagnostic value. It says \"apps-manager is not answering\", and it says\n * it quickly.\n */\nconst APPS_MANAGER_TIMEOUT_MS = 15_000;\n\n/**\n * Budget for `POST /admin/apps/:appSlug/initialize` — a HEAVY, long-running provisioning call.\n *\n * ## Why this is not the same number as above\n *\n * Both budgets used to be one constant, and that conflated two unrelated questions: \"is apps-manager\n * unresponsive?\" and \"is apps-manager doing a long job it is supposed to be doing?\". Initialization\n * provisions the application database and its user, mints runtime-principal credentials, reconciles\n * ACLs, connects, and constructs the application's ENTIRE repository registry — ensuring every\n * declared index on every resource.\n *\n * Measured on Wonder Todos, 2026-08-19, on a machine where nothing was wrong: **12.2s** and **21.5s**\n * for the same call on two runs, against an application database holding 95 collections and 514\n * indexes. Both exceeded 15s, so `wildo local dev` aborted the whole session — and did so at the\n * point where the CLI kills the process tree, which made a healthy platform look like a failed one.\n *\n * Note the cost is NOT first-run index CREATION: those 514 indexes already existed. Ensuring them is\n * re-paid on every initialize, so the budget has to cover the steady state, not a cold start.\n *\n * ## Why raising the SHARED constant would have been the wrong fix\n *\n * It would have bought this call its headroom by taking detection value away from the two light\n * calls, which would then need the full budget to report an apps-manager that is simply dead.\n * A budget belongs to an operation, not to a client.\n *\n * The value is deliberately generous rather than tuned to the measurement: the work scales with the\n * application's resource count, and a larger app, a cold page cache or a loaded machine can be\n * several times slower without anything being wrong. It is still bounded, so a genuinely hung\n * apps-manager is reported well inside an interactive session.\n */\nconst APPS_MANAGER_INITIALIZE_TIMEOUT_MS = 180_000;\n\n/**\n * `waitForPlatformServicesReady` gates entry into registered-app bootstrap on\n * apps-manager answering `/health/ready`, but that check and this request are\n * two separate round-trips: apps-manager can pass readiness and then crash\n * (observed 2026-08-06: an uncaught exception from an unrelated OTel\n * telemetry batch-flush timer killed apps-manager seconds after it reported\n * ready) before the registration POST lands, producing an immediate\n * connection-refused \"fetch failed\" that aborted the whole `wildo local dev`\n * session. `platform-lifecycle.service.ts`'s runtime supervisor auto-respawns\n * a crashed platform service within seconds, so a bounded reconnect-wait here\n * — NOT a soft-success, still fails hard on HTTP error responses and after\n * this budget is exhausted — turns a transient crash/respawn window into a\n * short, silent retry instead of a hard command failure.\n */\nconst APPS_MANAGER_RECONNECT_ATTEMPTS = 2;\nconst APPS_MANAGER_RECONNECT_WAIT_MS = 30_000;\nconst APPS_MANAGER_RECONNECT_POLL_INTERVAL_MS = 1_000;\n\n/**\n * Has apps-manager answered AT ALL during this process?\n *\n * The reconnect window above is for a crash/RESPAWN — its own contract says apps-manager \"can pass\n * readiness and then crash\". Riding that out presupposes it was up. When it was never up there is\n * nothing to respawn, and waiting only postpones a conclusion the first `ECONNREFUSED` already\n * reached.\n *\n * Measured 2026-08-28: `wildo config sync` against a deliberately stopped platform took ~3.5\n * minutes, of which ~120 seconds was this wait — `prepareApplicationEnvTargets` is reached by four\n * target builders, and each burned the full 30-second deadline before giving up. The command then\n * degraded to `reconstructBootstrapCredentialsOffline` exactly as designed, so the two minutes\n * bought nothing: the offline path was always going to be taken. Running `config sync` with the\n * platform down is not an error state — it is how an operator regenerates env files between\n * sessions.\n *\n * Process-scoped rather than per-call, because the point is whether THIS run ever established that\n * a platform is there. A stale value cannot outlive the command.\n */\nlet appsManagerAnsweredThisRun = false;\n\n/**\n * Record that apps-manager has been OBSERVED reachable in this process.\n *\n * Called by `waitForAppsManagerReady` as well as by every successful fetch here, and the readiness\n * barrier is the reason this is exported rather than private. The reconnect window exists for the\n * gap that barrier itself documents — apps-manager \"can pass readiness and then crash\" before the\n * registration POST lands — so the very case the retry is FOR is one where the only proof the\n * platform was up came from a probe that never went through `fetchWithReconnect`. Keying the skip\n * solely on this module's own successes would therefore have removed the retry from the one window\n * it was written for, and the pinned crash/respawn test caught exactly that.\n */\nexport function markAppsManagerObservedReachable(): void {\n appsManagerAnsweredThisRun = true;\n}\n\n/**\n * Why a deploy-artifact build could not reach a usable apps-manager (issue #279).\n *\n * A closed vocabulary with a named home, because the two REACHABLE-but-unusable cases mean\n * opposite things to a creator and the old code could tell neither: it reported both as\n * \"Failed to prepare application deploy artifacts: … Check PLATFORM_ADMIN_SECRET\", which is the\n * wrong remedy for both.\n */\nexport enum AppsManagerUnavailableReason {\n /** Nothing answered: no platform is running for this application yet — the fresh-creator case. */\n PLATFORM_NOT_RUNNING = 'PLATFORM_NOT_RUNNING',\n /**\n * Something answered and refused our credentials. On a shared development host this is very\n * rarely a wrong secret: it is ANOTHER application's platform occupying the port.\n */\n PLATFORM_NOT_OURS = 'PLATFORM_NOT_OURS',\n}\n\n/**\n * Classify a deploy-artifact failure, or `null` when it is neither of the known benign shapes.\n *\n * `null` is the important return: a genuine defect must keep failing the command. Only the two\n * cases a first-time creator legitimately hits are skippable, and they are skippable because the\n * artifacts that step produces are CI deploy inputs under `.wildo-saas/deploy/` — nothing\n * `wildo local up` needs, which is why the phase's other outputs (compose, env files, provider\n * runtime) are complete and correct without them.\n */\nexport function classifyAppsManagerUnavailable(error: unknown): AppsManagerUnavailableReason | null {\n const message = error instanceof Error ? error.message : String(error ?? '');\n // 401/403 — `requestJson` names this exactly, and it is the only place that phrasing is produced.\n if (message.includes('rejected bootstrap authentication')) return AppsManagerUnavailableReason.PLATFORM_NOT_OURS;\n\n // Connection-shaped failures. `fetch` wraps the cause, so the code can sit one or two levels down.\n const codes: string[] = [];\n let cursor: unknown = error;\n for (let depth = 0; depth < 4 && cursor instanceof Error; depth += 1) {\n const code = (cursor as NodeJS.ErrnoException).code;\n if (typeof code === 'string') codes.push(code);\n if ((cursor as Error).name) codes.push((cursor as Error).name);\n cursor = (cursor as { cause?: unknown }).cause;\n }\n const connectionShaped = ['ECONNREFUSED', 'ENOTFOUND', 'ECONNRESET', 'EHOSTUNREACH', 'ETIMEDOUT', 'AbortError', 'TimeoutError'];\n if (codes.some((code) => connectionShaped.includes(code))) return AppsManagerUnavailableReason.PLATFORM_NOT_RUNNING;\n if (/fetch failed|ECONNREFUSED|timed? out|was aborted/i.test(message)) return AppsManagerUnavailableReason.PLATFORM_NOT_RUNNING;\n\n return null;\n}\n\n/**\n * Progress for a wait a human is sitting through. stderr, not stdout: callers parse stdout, and a\n * silent multi-second stall is exactly what made this cost so long to explain.\n */\nfunction reportAppsManagerWait(message: string): void {\n process.stderr.write(` ${message}\\n`);\n}\n\n/**\n * Coerce a service key (e.g. `backendApi`) into a K8s-valid port name:\n * lowercase, only `[a-z0-9-]`, no leading/trailing `-`, ≤15 chars (the\n * IANA/K8s `IS_DNS1123_LABEL`-for-ports limit). `backendApi` → `backend-api`.\n * Empty/degenerate input falls back to `port`.\n */\nfunction toK8sPortName(raw: string): string {\n const kebab = raw\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n const trimmed = kebab.slice(0, 15).replace(/-+$/g, '');\n if (trimmed.length === 0) return 'port';\n // K8s port names are IANA_SVC_NAME — they MUST contain at least one letter.\n // An all-numeric service key (e.g. '123') would otherwise emit an invalid\n // port name that kubectl rejects; prefix it to guarantee an alpha char.\n if (!/[a-z]/.test(trimmed)) return `p-${trimmed}`.slice(0, 15);\n return trimmed;\n}\n\nfunction buildLocalRuntimeEndpoint(url: string): { publicUrl: string; internalUrl: string } {\n return {\n publicUrl: url,\n internalUrl: url,\n };\n}\n\nfunction resolveRuntimeEnvironment(\n env: PlatformEnvironmentConfiguration,\n config: PlatformEnvConfigJson | null,\n): RuntimeEnvironment {\n if (config?.runtimeEnvironment) {\n return config.runtimeEnvironment;\n }\n\n if (env.runtimeEnvironment) {\n return env.runtimeEnvironment;\n }\n\n throw new Error(\n `Environment '${env.name}' is missing explicit runtime semantics. Set runtimeEnvironment in config.json or in the environment registry before bootstrapping applications.`,\n );\n}\n\nasync function readErrorBody(response: Response): Promise<string> {\n try {\n const body = await response.text();\n return body.trim();\n } catch {\n return '';\n }\n}\n\nexport interface RegisteredApplicationEnvTargetInput {\n env: PlatformEnvironmentConfiguration;\n credentials: PlatformEnvSecretsJson;\n frameworkPath: string;\n saasRoot: string;\n config?: PlatformEnvConfigJson | null;\n requestedAppSlug?: string | undefined;\n}\n\n/** One authoritative application-registration/credential snapshot used by every runtime projection. */\nexport interface PreparedApplicationEnvTargets {\n runtimeTarget: ResolvedAppRuntimeTarget;\n bootstrapCredentials: AppBootstrapCredentials;\n /**\n * True when apps-manager was UNREACHABLE and the credentials were reconstructed\n * from material already on disk (Step: degraded env generation).\n *\n * Callers MUST surface this. A `.env` that looks current but was written without\n * consulting the control plane is the same \"correct and believed otherwise\"\n * failure as a silent partial sync, pointing the other way — and the one thing a\n * degraded run cannot know is whether apps-manager holds material the runtime\n * does not yet have.\n */\n degraded?: boolean;\n /**\n * Principals that could NOT be regenerated offline, each naming itself and the\n * `.env` it expected. Non-empty only in degraded mode.\n *\n * These are OMITTED from `runtimePrincipalCredentials` rather than faked, so\n * `requireRuntimePrincipalCredentials` still refuses to substitute the\n * application backend's identity for them. The caller reports them; their\n * existing `.env` files are left untouched.\n */\n unresolvedPrincipals?: string[];\n runtimeEndpoints: Record<string, { publicUrl: string; internalUrl: string }>;\n /**\n * The environment resolved during preparation, carried so per-runtime\n * credential fetches reuse it instead of re-deriving.\n *\n * Re-deriving imposed a NEW requirement on callers that construct a target\n * without a fully-populated env — `resolveRuntimeEnvironment` throws rather\n * than defaulting — and a second derivation could in principle disagree with\n * the first, which would fetch a different environment's credentials.\n */\n runtimeEnvironment: RuntimeEnvironment;\n /**\n * Each declared minion's and worker's OWN bootstrap credentials, keyed by\n * `buildRuntimePrincipalKey` (Step 1 / F11).\n *\n * Populated HERE rather than fetched inside the target builders for two\n * reasons. It keeps preparation the single credential-fetch phase — the\n * builders stay pure and a caller that supplies `prepared` needs no network.\n * And it makes the field REQUIRED, so a hand-constructed `prepared` has to\n * state what each runtime holds; an optional map would invite a fallback to\n * the application backend's credentials, which is precisely the collapse this\n * step removes.\n *\n * The application backend is NOT in the map — its credentials are\n * `bootstrapCredentials`.\n */\n runtimePrincipalCredentials: Record<string, AppBootstrapCredentials>;\n}\n\nexport interface ApplicationEnvProjectionInput extends RegisteredApplicationEnvTargetInput {\n /** Supplied by the coordinator so every target family is derived from one logical bootstrap generation. */\n prepared?: PreparedApplicationEnvTargets;\n}\n\nexport class AppBootstrapService {\n /**\n * Service keys (`config.services.<key>`) of the app's frontends that are\n * CDN-served in this environment — authored `cdn?[key].enabled === true` in\n * `wildo.infra.<env>.config.ts`.\n *\n * A CDN-served frontend is served OFF-CLUSTER (its public host resolves via\n * DNS to a CDN edge fronting an object-storage bucket), so it is dropped from\n * BOTH the per-frontend nginx Deployment/Service\n * ({@link buildApplicationFrontendDeployTargets}) AND the ingress / compose\n * route ({@link buildApplicationIngressRoutes}). It is deliberately KEPT in\n * {@link buildRuntimeEndpoints} so `runtime.endPoints.publicUrl` still\n * advertises `<serviceHost>.<publicDomain>` — the browser gets the same URL,\n * it just resolves to the CDN. This advertised-but-not-ingress-routed\n * asymmetry IS the CDN opt-in: the coherence invariant relaxes from \"every\n * advertised host is routed by the ingress\" to \"…routed by the ingress OR\n * served by a CDN\". Maintained by construction here (ingress/deploy frontends\n * = all frontends − these keys; endpoints = all frontends).\n *\n * Keys on `enabled === true`, NOT mere presence, so an authored-but-disabled\n * entry falls back to normal nginx-pod serving (never silently drops a route).\n */\n private static cdnFrontendKeys(env: PlatformEnvironmentConfiguration): ReadonlySet<string> {\n return new Set(\n Object.entries(env.cdn ?? {})\n .filter(([, cdnConfig]) => cdnConfig.enabled)\n .map(([serviceKey]) => serviceKey),\n );\n }\n\n private static buildRuntimeEndpoints(\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>,\n env: PlatformEnvironmentConfiguration,\n ): Record<string, { publicUrl: string; internalUrl: string }> {\n const primaryBackend =\n runtimeTarget.backendServices.find((backend) => backend.key === 'backendApi') ??\n runtimeTarget.backendServices[0];\n const primaryBackendPort = primaryBackend?.defaultPort;\n // Public frontends with the endpoints map key (`serviceName`) DECOUPLED from\n // the serviceHosts resolution key (`.key` = `config.services.<key>`). Keying\n // hosts on `serviceName` silently ignores authored `serviceHosts` (the\n // serviceName `wonder-todos-app` misses the authored `app` entry) and\n // diverges from the apps-manager ingress. See the domain plan.\n const publicFrontends = runtimeTarget.frontendServices.flatMap((frontend) =>\n frontend.defaultPort\n ? [{ serviceName: frontend.serviceName, serviceKey: frontend.key, port: frontend.defaultPort }]\n : [],\n );\n const frontendApplicationPorts = Object.fromEntries(\n publicFrontends.map((frontend) => [frontend.serviceName, frontend.port]),\n );\n const websiteFrontend = runtimeTarget.frontendServices.find(\n (frontend) => frontend.frontendType === AppFrontendType.STATIC_WEBSITE,\n );\n const docsFrontend = runtimeTarget.frontendServices.find(\n (frontend) => frontend.frontendType === AppFrontendType.TECH_DOC,\n );\n\n // Remote Kubernetes: serviceHosts-driven public subdomains of the operator's\n // OWN publicDomain (greenfield — no `{svc}-{slug}-{env}` fan-out); internal\n // URLs are the app's cluster-DNS Service. Local dev + compose stay on\n // localhost. See `.claude/plans/self-host-domain-subdomain-model.md`.\n const namespace = env.kubernetes?.namespace;\n if (\n env.runtime === WildoDeploymentRuntime.KUBERNETES &&\n env.locationType === WildoLocationType.REMOTE &&\n namespace\n ) {\n const runtimeEndpoints = buildK8sApplicationRuntimeEndpoints({\n publicDomain: env.publicDomain,\n namespace,\n serviceHosts: env.serviceHosts,\n appServiceName: runtimeTarget.appSlug,\n frontends: publicFrontends,\n websiteServiceKey: websiteFrontend?.key,\n technicalDocumentationServiceKey: docsFrontend?.key,\n mainBackendApiServiceKey: primaryBackend?.key,\n mainBackendApiPort: primaryBackendPort,\n });\n // Secondary backends ride the same app Service on their own port; the\n // dev companion is a local-only concept (omitted remotely).\n for (const backendService of runtimeTarget.backendServices) {\n if (!backendService.defaultPort) {\n continue;\n }\n const url = buildK8sInternalUrl(runtimeTarget.appSlug, backendService.defaultPort, namespace);\n runtimeEndpoints[backendService.serviceName] = { publicUrl: url, internalUrl: url };\n }\n return runtimeEndpoints;\n }\n\n // Remote Docker Compose: SAME serviceHosts-driven public subdomains as k8s\n // (so the Traefik ingress routes and `runtime.endPoints.publicUrl` agree —\n // the CORS invariant holds for compose too); internal URLs are the app\n // container's own name on the shared compose network. Must NOT fall through\n // to the localhost branch below, which would advertise localhost topology\n // for a remotely-served app.\n if (env.runtime === WildoDeploymentRuntime.DOCKER_COMPOSE && env.locationType === WildoLocationType.REMOTE) {\n const runtimeEndpoints = buildComposeApplicationRuntimeEndpoints({\n publicDomain: env.publicDomain,\n serviceHosts: env.serviceHosts,\n appServiceName: runtimeTarget.appSlug,\n frontends: publicFrontends,\n websiteServiceKey: websiteFrontend?.key,\n technicalDocumentationServiceKey: docsFrontend?.key,\n mainBackendApiServiceKey: primaryBackend?.key,\n mainBackendApiPort: primaryBackendPort,\n });\n // Secondary backends reachable at their own port on the app container\n // (`http://<appSlug>:<port>` on the shared compose network). No dev\n // companion remotely.\n for (const backendService of runtimeTarget.backendServices) {\n if (!backendService.defaultPort) {\n continue;\n }\n const url = `http://${runtimeTarget.appSlug}:${backendService.defaultPort}`;\n runtimeEndpoints[backendService.serviceName] = { publicUrl: url, internalUrl: url };\n }\n return runtimeEndpoints;\n }\n\n const runtimeEndpoints = buildLocalhostApplicationRuntimeEndpoints({\n mainBackendApiPort: primaryBackendPort,\n frontendApplicationPorts,\n websitePort: websiteFrontend?.defaultPort,\n });\n for (const backendService of runtimeTarget.backendServices) {\n if (!backendService.defaultPort) {\n continue;\n }\n\n runtimeEndpoints[backendService.serviceName] = buildLocalRuntimeEndpoint(\n `http://localhost:${backendService.defaultPort}`,\n );\n }\n if (runtimeTarget.localServiceAddresses?.devCompanion?.url) {\n runtimeEndpoints[`${runtimeTarget.appSlug}-dev-companion`] = buildLocalRuntimeEndpoint(\n runtimeTarget.localServiceAddresses.devCompanion.url,\n );\n }\n\n return runtimeEndpoints;\n }\n\n /**\n * serviceHosts-driven ingress routes for the app's public services — the\n * per-app deploy context shared by the k8s ingress + the compose Traefik lane\n * (`buildK8sApplicationIngressRoutes`, runtime-agnostic host→port). Remote\n * only; local has no reverse proxy. Coherent with the runtime endpoints\n * (same resolver + topology).\n */\n private static buildApplicationIngressRoutes(\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>,\n env: PlatformEnvironmentConfiguration,\n ): K8sIngressRoute[] {\n if (env.locationType !== WildoLocationType.REMOTE) {\n return [];\n }\n const primaryBackend =\n runtimeTarget.backendServices.find((backend) => backend.key === 'backendApi') ??\n runtimeTarget.backendServices[0];\n // Host resolution keys on `.key` (config.services key), NOT serviceName —\n // matches the runtime endpoints + the operator's authored serviceHosts.\n // CDN-served frontends are EXCLUDED: their public host is served off-cluster\n // by the CDN, so no ingress rule (k8s) / Traefik router (compose) is emitted\n // for them — while they stay in `buildRuntimeEndpoints` (advertised host\n // preserved). See {@link cdnFrontendKeys}.\n const cdnKeys = AppBootstrapService.cdnFrontendKeys(env);\n const publicFrontends = runtimeTarget.frontendServices.flatMap((frontend) =>\n frontend.defaultPort && !cdnKeys.has(frontend.key)\n ? [{ serviceName: frontend.serviceName, serviceKey: frontend.key, port: frontend.defaultPort }]\n : [],\n );\n return buildK8sApplicationIngressRoutes({\n publicDomain: env.publicDomain,\n serviceHosts: env.serviceHosts,\n frontends: publicFrontends,\n mainBackendApiServiceKey: primaryBackend?.key,\n // Per-service model: the api host routes to the backend's OWN k8s Service\n // (its serviceName), not a shared app Service.\n mainBackendApiServiceName: primaryBackend?.serviceName,\n mainBackendApiPort: primaryBackend?.defaultPort,\n });\n }\n\n /**\n * Derive the BACKEND pod's container/Service ports (per-service deploy model),\n * per-app from the authored `services.<backendKey>.defaultPort`:\n * - the primary backend on `mainBackendApiPort`;\n * - its internal-only API siblings `health`/`webhook`/`oauth`/`mcp` =\n * `mainBackendApiPort - 1..-4`.\n * Frontends are NOT here — each is its own nginx Deployment/Service (see\n * `buildApplicationFrontendDeployTargets`). The internal siblings MUST be\n * Service-exposed: other in-cluster pods reach them via cluster-DNS on those\n * ports (their `internalUrl`). `healthPort` (`mainBackendApiPort - 1`) drives\n * the backend's k8s liveness/readiness probes. Remote only (local has no app\n * k8s deploy).\n *\n * Ports are de-duplicated by number and carry K8s-valid names (see\n * {@link toK8sPortName}); a name collision after sanitisation is disambiguated\n * with a numeric suffix so the emitted Service is always valid.\n */\n private static buildBackendPodPorts(\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>,\n env: PlatformEnvironmentConfiguration,\n ): { podPorts: K8sPodPort[]; healthPort: number | undefined } {\n if (env.locationType !== WildoLocationType.REMOTE) {\n return { podPorts: [], healthPort: undefined };\n }\n const primaryBackend =\n runtimeTarget.backendServices.find((backend) => backend.key === 'backendApi') ??\n runtimeTarget.backendServices[0];\n const backendPort = primaryBackend?.defaultPort;\n\n const seenPorts = new Set<number>();\n const usedNames = new Set<string>();\n const podPorts: K8sPodPort[] = [];\n const add = (rawName: string, containerPort: number | undefined): void => {\n if (containerPort === undefined || seenPorts.has(containerPort)) return;\n seenPorts.add(containerPort);\n let name = toK8sPortName(rawName);\n if (usedNames.has(name)) {\n // Disambiguate on a collision. Truncate the base to leave room for the\n // `-NN` suffix WITHIN the 15-char K8s port-name cap — appending the\n // suffix through `toK8sPortName` again would just re-truncate it back to\n // the colliding base and spin forever. Result stays ≤15 chars.\n const base = name.slice(0, 12).replace(/-+$/g, '');\n let suffix = 2;\n while (suffix < 100 && usedNames.has(`${base}-${suffix}`)) suffix += 1;\n name = `${base}-${suffix}`;\n }\n usedNames.add(name);\n podPorts.push({ name, containerPort });\n };\n\n // Per-service model: the BACKEND pod exposes ONLY the primary backend's\n // ports — its API + internal-only siblings (health/webhook/oauth/mcp), all\n // bound by the one Node process. Frontends are SEPARATE nginx Deployments\n // (see `buildApplicationFrontendDeployTargets`), so their ports are NOT\n // folded into this pod. (Non-primary backend services, if any, would become\n // their own Deployments — a multi-backend follow-up; wonder-todos has one.)\n if (backendPort !== undefined) {\n add('backend', backendPort);\n add('health', backendPort - 1);\n add('webhook', backendPort - 2);\n add('oauth', backendPort - 3);\n add('mcp', backendPort - 4);\n }\n\n return { podPorts, healthPort: backendPort !== undefined ? backendPort - 1 : undefined };\n }\n\n /**\n * The app's public frontends as per-service k8s deploy targets — each becomes\n * its OWN nginx Deployment + Service. `serviceName` is both the k8s object name\n * and the built image name (`{registry}/{serviceName}:{tag}`); `port` is the\n * authored `defaultPort` the frontend Service exposes (forwarded to nginx :80).\n * Frontends without a `defaultPort` are non-served (skipped). CDN-served\n * frontends are ALSO skipped — they get no nginx pod at all (served\n * off-cluster; see {@link cdnFrontendKeys}). Remote only.\n */\n private static buildApplicationFrontendDeployTargets(\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>,\n env: PlatformEnvironmentConfiguration,\n ): Array<{\n serviceName: string;\n port: number;\n isolation: { runAsUser: number; runAsGroup: number; writablePaths: string[] };\n }> {\n if (env.locationType !== WildoLocationType.REMOTE) {\n return [];\n }\n const cdnKeys = AppBootstrapService.cdnFrontendKeys(env);\n return runtimeTarget.frontendServices.flatMap((frontend) =>\n frontend.defaultPort && !cdnKeys.has(frontend.key)\n ? [{\n serviceName: frontend.serviceName,\n port: frontend.defaultPort,\n // Already resolved at the config boundary — passed through, never\n // re-derived, so the k8s and compose lanes cannot disagree.\n isolation: {\n runAsUser: frontend.isolation.runAsUser,\n runAsGroup: frontend.isolation.runAsGroup,\n writablePaths: [...frontend.isolation.writablePaths],\n },\n }]\n : [],\n );\n }\n\n /**\n * Read a runtime's ALREADY-GENERATED `.env` for the one value that cannot be\n * derived offline: its bootstrap secret.\n *\n * Returns `null` when the file does not exist or carries no secret — which is\n * exactly the FIRST-RUN case, and the case that must NOT be papered over: a\n * runtime apps-manager has never registered has no Redis ACL user, no RabbitMQ\n * user and no database role either, so inventing an env for it would produce a\n * runtime that boots and is refused by every backing service.\n */\n private static readPersistedBootstrapSecret(envFilePath: string): string | null {\n if (!existsSync(envFilePath)) return null;\n for (const line of readFileSync(envFilePath, 'utf8').split('\\n')) {\n const match = line.match(/^PLATFORM_APPLICATION_PRIMARY_SECRET=(.+)$/);\n if (match) {\n const value = match[1]!.trim().replace(/^[\"']|[\"']$/g, '');\n return value.length > 0 ? value : null;\n }\n }\n return null;\n }\n\n /**\n * Rebuild {@link AppBootstrapCredentials} WITHOUT contacting apps-manager.\n *\n * Only ONE of the four fields is a secret. `APPLICATION_ID` is already persisted\n * by `saveApplicationRuntimeIdentity` for exactly this reason — the offline\n * compose renders depend on it — and the apps-manager URL and environment are\n * local configuration. So a degraded regeneration reuses the secret the runtime\n * already holds and derives the rest, which is precisely what apps-manager would\n * have returned: it PRESERVES an existing principal's secret rather than\n * re-minting, because rotating it would break a running runtime.\n *\n * `null` means the material is not on disk. The caller must then fail for THAT\n * runtime and say so, rather than degrade the whole sync.\n */\n private static reconstructBootstrapCredentialsOffline(input: {\n envName: string;\n appSlug: string;\n runtimeEnvironment: RuntimeEnvironment;\n appsManagerUrl: string;\n envFilePath: string;\n }): AppBootstrapCredentials | null {\n const primarySecret = AppBootstrapService.readPersistedBootstrapSecret(input.envFilePath);\n const applicationId = EnvironmentUtils.loadApplicationRuntimeIdentity(input.envName)?.[input.appSlug]?.applicationId;\n if (!primarySecret || !applicationId) return null;\n return buildAppBootstrapCredentialsResponse({\n appSlug: input.appSlug,\n applicationId,\n primarySecret,\n appsManagerUrl: input.appsManagerUrl,\n environment: input.runtimeEnvironment,\n }).credentials;\n }\n\n /**\n * True only for a CONNECTION-level failure — apps-manager not listening.\n *\n * Deliberately NOT true for an HTTP error response or a timeout. A 4xx/5xx means\n * apps-manager IS running and rejected the request (bad admin secret, invalid\n * declaration); degrading there would hide a real error behind a reassuring\n * warning. A timeout is ambiguous and is left fatal for the same reason.\n */\n private static isAppsManagerUnreachable(error: unknown): boolean {\n return /Unable to reach apps-manager/.test(ErrorUtils.extractErrorMessage(error));\n }\n\n /**\n * Rebuild EVERY declared principal's credentials offline (Step: degraded env).\n *\n * A minion's or worker's secret is its OWN — that is the entire point of Step 1,\n * which replaced one shared `PLATFORM_APPLICATION_PRIMARY_SECRET` per application\n * with one per runtime. So each principal's value is read from ITS OWN `.env`,\n * located through the same `saasConfig.{minions,workers}.<name>.path` the target\n * builders already use.\n *\n * ⚠️ There is deliberately NO fallback to the application-level secret. Reusing\n * it here would make every runtime present the same identity at the apps-manager\n * door — precisely the F11 collapse Step 1 exists to have removed — and it would\n * do so silently, in a code path whose whole purpose is to be reassuring. A\n * principal whose own secret is not on disk THROWS, naming itself.\n */\n private static async reconstructRuntimePrincipalCredentialsOffline(input: {\n envName: string;\n runtimeTarget: ResolvedAppRuntimeTarget;\n runtimeEnvironment: RuntimeEnvironment;\n appsManagerUrl: string;\n }): Promise<{ credentials: Record<string, AppBootstrapCredentials>; unresolved: string[] }> {\n const saasConfig = await loadConfig<{\n minions?: Record<string, { path: string }>;\n workers?: Record<string, { path: string }>;\n }>(input.runtimeTarget.saasConfigPath);\n\n const entries: Array<readonly [string, AppBootstrapCredentials]> = [];\n const unresolved: string[] = [];\n for (const principal of enumerateDeclaredRuntimePrincipals(input.runtimeTarget.managedDeclaration)\n .filter((candidate) => candidate.kind !== ApplicationRuntimePrincipalKind.APPLICATION_BACKEND)) {\n const name = principal.name ?? '';\n const relativePath = principal.kind === ApplicationRuntimePrincipalKind.MINION\n ? saasConfig.minions?.[name]?.path\n : saasConfig.workers?.[name]?.path;\n const credentials = relativePath\n ? AppBootstrapService.reconstructBootstrapCredentialsOffline({\n envName: input.envName,\n appSlug: input.runtimeTarget.appSlug,\n runtimeEnvironment: input.runtimeEnvironment,\n appsManagerUrl: input.appsManagerUrl,\n envFilePath: join(input.runtimeTarget.appRoot, relativePath, '.env'),\n })\n : null;\n if (!credentials) {\n // Per-runtime granularity: this principal cannot be regenerated offline,\n // but the OTHERS can. Omitting it from the map (rather than throwing)\n // leaves its existing `.env` untouched and lets every other runtime be\n // written — and the omission is REPORTED, not silent, by the caller.\n //\n // Omission is the safe representation: `requireRuntimePrincipalCredentials`\n // refuses to substitute the application backend's identity for a missing\n // entry, so a skipped principal can never end up with the wrong secret.\n unresolved.push(\n `${principal.kind}:${name}`\n + `${relativePath ? ` (expected ${join(relativePath, '.env')})` : ' (no declared path)'}`,\n );\n continue;\n }\n entries.push([buildRuntimePrincipalKey(principal), credentials] as const);\n }\n return { credentials: Object.fromEntries(entries), unresolved };\n }\n\n static async prepareApplicationEnvTargets(\n input: RegisteredApplicationEnvTargetInput,\n ): Promise<PreparedApplicationEnvTargets | null> {\n const runtimeTarget = await AppBootstrapService.resolveRuntimeTarget(input);\n if (!runtimeTarget) {\n return null;\n }\n\n await AppBootstrapService.validateFirstAdminSeedAgainstBackendConfig(runtimeTarget);\n\n if (runtimeTarget.backendServices.length === 0) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' has no backend services to prepare. Check wildo.saas.config.ts service definitions.`,\n );\n }\n\n const config = input.config ?? EnvironmentUtils.loadConfigJson(input.env.name);\n if (!config) {\n throw new Error(`No config for '${input.env.name}'. Run 'wildo config sync' to generate config.json.`);\n }\n\n const runtimeEnvironment = resolveRuntimeEnvironment(input.env, config);\n\n /**\n * ## Breaking the provisioning ↔ schema cycle\n *\n * An application whose own resources persist to PostgreSQL cannot be seeded before its schema\n * exists, and its schema is produced by migration artifacts that only the tooling can read. So\n * provisioning runs in TWO phases with the schema apply between them:\n *\n * 1. register with `DEFERRED` — infrastructure, credentials and platform records; no app rows;\n * 2. apply the application's migrations through the shared runner;\n * 3. register again (idempotent, `REQUIRED`) — now the bootstrap rows land.\n *\n * Phase 3 is a full re-invocation rather than a narrow seed call ON PURPOSE: provisioning also\n * issues the per-role GRANTs, and a grant can only be issued on a table that exists. Running the\n * whole provision after the migrations is what gives every confined role (minions, workers) its\n * grants on the tables the migrations just created — a seed-only endpoint would have left them\n * ungranted and moved the failure into the first minion boot.\n *\n * MongoDB is untouched: no migrations directory means one phase, exactly as before.\n */\n /**\n * From the ALREADY-LOADED config.json rather than the registry record: `applicationDatabase` is\n * deliberately not round-tripped through `environments.json`, because nothing reads it off that\n * cache — see the note in `hydrateEnvironmentFromConfig` about fields the registry does not own.\n *\n * Hoisted to a local so BOTH provisioning phases send the identical declaration. Recomputing it\n * for the second call would be two spellings of one value, and a divergence would land on the\n * provisioner as a database rename mid-provision.\n */\n const applicationDatabaseDeclaration = config.applicationDatabase\n ? {\n ...config.applicationDatabase,\n // The SAME authored value `env-vars-builder` emits as `POSTGRESQL_DATABASE`, so the\n // database the backend connects to and the one the provisioner creates are one name\n // from one source.\n databaseName: config.backingServices?.postgresql?.database,\n }\n : undefined;\n\n /**\n * Two-phase provisioning applies only when a PostgreSQL schema must exist before the application\n * can be seeded — see {@link resolveAppSchemaMigrationsDirectory} for why the ENGINE, and not\n * merely the presence of the migrations directory, is half of that question.\n */\n const usesTwoPhaseProvisioning = AppBootstrapService.resolveAppSchemaMigrationsDirectory(\n runtimeTarget,\n applicationDatabaseDeclaration,\n ) !== undefined;\n\n let bootstrapResponse: { credentials: AppBootstrapCredentials };\n let degraded = false;\n try {\n const firstPhaseOutcome = await AppBootstrapService.ensureApplicationRegistered(input.env, input.credentials, {\n appSlug: runtimeTarget.appSlug,\n appDisplayName: runtimeTarget.appDisplayName,\n appDatabaseName: runtimeTarget.appDatabaseName,\n managedDeclaration: runtimeTarget.managedDeclaration,\n applicationDatabase: applicationDatabaseDeclaration,\n firstAdminSeed: runtimeTarget.firstAdminSeed,\n appDatabaseSeeding: usesTwoPhaseProvisioning\n ? AppDatabaseSeedingPhase.DEFERRED\n : AppDatabaseSeedingPhase.REQUIRED,\n });\n\n if (usesTwoPhaseProvisioning) {\n await AppBootstrapService.completeDeferredAppDatabaseSeeding({\n env: input.env,\n credentials: input.credentials,\n runtimeTarget,\n applicationDatabase: applicationDatabaseDeclaration,\n firstPhaseOutcome,\n });\n }\n\n bootstrapResponse = await AppBootstrapService.fetchBootstrapCredentials(\n input.env,\n input.credentials,\n {\n appSlug: runtimeTarget.appSlug,\n runtimeEnvironment,\n },\n );\n } catch (error) {\n // Degrade ONLY when apps-manager is not listening, and ONLY when the\n // material is already on disk. Every other failure — an HTTP rejection, a\n // timeout, a first run with no persisted secret — stays fatal, because\n // degrading there would either hide a real error or fabricate an identity\n // no backing service recognises.\n if (!AppBootstrapService.isAppsManagerUnreachable(error)) throw error;\n const authoritativeBackend = AppBootstrapService.resolveAuthoritativeBackendTarget(runtimeTarget);\n const offline = authoritativeBackend\n ? AppBootstrapService.reconstructBootstrapCredentialsOffline({\n envName: input.env.name,\n appSlug: runtimeTarget.appSlug,\n runtimeEnvironment,\n appsManagerUrl: AppBootstrapService.getAppsManagerBaseUrl(input.env),\n // `path` is app-root-relative; the runtime target carries the root.\n envFilePath: join(runtimeTarget.appRoot, authoritativeBackend.path, '.env'),\n })\n : null;\n if (!offline) throw error;\n degraded = true;\n bootstrapResponse = { credentials: offline };\n }\n\n // Persist the apps-manager-minted APPLICATION_ID (a Mongo `_id`, NOT\n // derivable offline from the slug) so the OFFLINE docker-compose render\n // paths — `wildo config sync --domain manifest` (which re-renders the\n // compose file LAST in a full sync) and the `wildo local up` self-heal —\n // can bake the correct per-app `APPLICATION_ID` literal into each\n // minion/worker service without re-contacting apps-manager. This method is\n // the single credential-fetch choke point (every app-target builder funnels\n // through it), so one write here keeps the persisted identity fresh for\n // every render flow.\n EnvironmentUtils.saveApplicationRuntimeIdentity(\n input.env.name,\n runtimeTarget.appSlug,\n bootstrapResponse.credentials.APPLICATION_ID,\n );\n\n // The THIRD apps-manager call site, and the one the first draft missed: it sat\n // inside the return expression, outside the try above. Degrading two of three\n // calls moved the failure one step later rather than removing it.\n let runtimePrincipalCredentials: Record<string, AppBootstrapCredentials>;\n let unresolvedPrincipals: string[] = [];\n try {\n runtimePrincipalCredentials = await AppBootstrapService.fetchDeclaredRuntimePrincipalCredentials(\n input,\n runtimeTarget,\n runtimeEnvironment,\n );\n } catch (error) {\n if (!AppBootstrapService.isAppsManagerUnreachable(error)) throw error;\n const offlinePrincipals = await AppBootstrapService.reconstructRuntimePrincipalCredentialsOffline({\n envName: input.env.name,\n runtimeTarget,\n runtimeEnvironment,\n appsManagerUrl: AppBootstrapService.getAppsManagerBaseUrl(input.env),\n });\n runtimePrincipalCredentials = offlinePrincipals.credentials;\n unresolvedPrincipals = offlinePrincipals.unresolved;\n degraded = true;\n\n // Report ALL unresolved principals at once, then fail.\n //\n // Why fail rather than skip: a skipped runtime would be SILENT here — this\n // service has no logger, and the sync command does not hold `prepared`, so\n // nothing would tell the operator that one runtime's `.env` was left stale.\n // Shipping a silent skip would trade a loud failure for exactly the\n // \"correct and believed otherwise\" defect this whole change exists to\n // remove. Granular WRITING is worth having, but only once the skip can be\n // reported — see the note in the plan; the mechanism is the existing\n // `input.prepared` passthrough, which lets the sync command prepare once\n // and read `unresolvedPrincipals` itself.\n //\n // What IS improved: every unresolved principal is named in one message\n // instead of failing on the first, so one run tells the operator the whole\n // list rather than one name per re-run.\n if (unresolvedPrincipals.length > 0) {\n throw new Error(\n `Cannot regenerate env files without apps-manager. `\n + `${unresolvedPrincipals.length} runtime principal(s) have no existing secret on disk:\\n`\n + unresolvedPrincipals.map((entry) => ` - ${entry}`).join('\\n')\n + `\\nA runtime apps-manager has never registered also has no Redis ACL user, no broker `\n + `user and no database role, so its env cannot be produced offline. Every OTHER runtime `\n + `could be regenerated — start apps-manager and re-run to write them all.`,\n );\n }\n }\n\n return {\n runtimeTarget,\n degraded,\n bootstrapCredentials: bootstrapResponse.credentials,\n runtimeEndpoints: AppBootstrapService.buildRuntimeEndpoints(runtimeTarget, input.env),\n runtimeEnvironment,\n runtimePrincipalCredentials,\n unresolvedPrincipals,\n };\n }\n\n private static resolveAuthoritativeBackendTarget(\n runtimeTarget: Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>,\n ) {\n if (!runtimeTarget || runtimeTarget.backendServices.length === 0) {\n return null;\n }\n\n return runtimeTarget.backendServices.find((service) => service.key === 'backendApi')\n ?? runtimeTarget.backendServices[0]\n ?? null;\n }\n\n private static resolveAuthoritativeBackendConfigPath(\n runtimeTarget: Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>,\n ): string | null {\n const backendTarget = AppBootstrapService.resolveAuthoritativeBackendTarget(runtimeTarget);\n if (!backendTarget || !runtimeTarget) {\n return null;\n }\n\n const candidatePaths = [\n resolve(runtimeTarget.appRoot, backendTarget.path, 'src', 'saas-config.backend.ts'),\n resolve(runtimeTarget.appRoot, backendTarget.path, 'src', 'config', 'app-config.backend.ts'),\n ];\n\n return candidatePaths.find((candidatePath) => existsSync(candidatePath)) ?? candidatePaths[0]!;\n }\n\n private static async validateFirstAdminSeedAgainstBackendConfig(\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>,\n ): Promise<void> {\n const projectedUserTypes = runtimeTarget.firstAdminSeed?.userTypes;\n if (!projectedUserTypes || projectedUserTypes.length === 0) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' is missing bootstrap.firstAdmin.userTypes in '${runtimeTarget.saasConfigPath}'. `\n + 'Declare the first-admin bootstrap seed before running bootstrap, sync, reinit, or dev start.',\n );\n }\n\n const authoritativeBackend = AppBootstrapService.resolveAuthoritativeBackendTarget(runtimeTarget);\n if (!authoritativeBackend) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' declares bootstrap.firstAdmin.userTypes but has no backend service to validate against.`,\n );\n }\n\n const backendConfigPath = AppBootstrapService.resolveAuthoritativeBackendConfigPath(runtimeTarget);\n if (!backendConfigPath || !existsSync(backendConfigPath)) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' declares bootstrap.firstAdmin.userTypes, but the authoritative backend config was not found at '${backendConfigPath ?? 'unknown'}' for service '${authoritativeBackend.serviceName}'.`,\n );\n }\n\n const backendConfig = await loadConfig<AppConfiguration_BackendAuthored>(backendConfigPath);\n const declaredBackendUserTypes = new Set(Object.keys(backendConfig.userTypes ?? {}));\n const unknownUserTypes = projectedUserTypes.filter((userType) => !declaredBackendUserTypes.has(userType));\n\n if (unknownUserTypes.length > 0) {\n throw new Error(\n `Invalid bootstrap.firstAdmin.userTypes for application '${runtimeTarget.appSlug}': `\n + `[${unknownUserTypes.join(', ')}] not found in backend config '${backendConfigPath}'. `\n + `Declared backend userTypes: [${[...declaredBackendUserTypes].join(', ')}].`,\n );\n }\n }\n\n private static async resolveRuntimeTarget(input: {\n saasRoot: string;\n requestedAppSlug?: string | undefined;\n }) {\n return AppRuntimeTargetsService.resolve(input.saasRoot, input.requestedAppSlug);\n }\n\n private static getAppsManagerBaseUrl(env: PlatformEnvironmentConfiguration): string {\n const addressContext = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.HOST_FACING);\n const addresses = ServiceAddressResolver.resolve(addressContext);\n return `${addresses.platform.appsManager.url}${APPS_MANAGER_API_PREFIX}`;\n }\n\n private static getAdminSecret(credentials: PlatformEnvSecretsJson): string {\n return credentials.platform.adminSecret;\n }\n\n /**\n * Bounded, silent poll of apps-manager's own `/health/ready` (unversioned —\n * outside `APPS_MANAGER_API_PREFIX`, mirroring `waitForServiceReady` in\n * `platform-lifecycle.service.ts`). Used ONLY to ride out the crash/respawn\n * window documented on {@link APPS_MANAGER_RECONNECT_ATTEMPTS}; not a\n * general-purpose readiness wait — `wildo local dev`'s own platform-readiness\n * barrier already owns that responsibility before this service is entered.\n */\n private static async waitForAppsManagerReconnect(env: PlatformEnvironmentConfiguration): Promise<boolean> {\n const addressContext = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.HOST_FACING);\n const addresses = ServiceAddressResolver.resolve(addressContext);\n const readyUrl = `${addresses.platform.appsManager.url.replace(/\\/$/, '')}/health/ready`;\n\n const deadline = Date.now() + APPS_MANAGER_RECONNECT_WAIT_MS;\n while (Date.now() < deadline) {\n try {\n const probe = await fetch(readyUrl, { signal: AbortSignal.timeout(5_000), redirect: 'manual' });\n if (probe.ok) return true;\n } catch {\n // Connection still refused/reset — keep polling until the deadline.\n }\n await new Promise((resolve) => setTimeout(resolve, APPS_MANAGER_RECONNECT_POLL_INTERVAL_MS));\n }\n return false;\n }\n\n /**\n * Connects with a bounded reconnect-retry on connection-level failure only\n * (never on an HTTP error response, and never on a request timeout — both\n * are handled/thrown by the caller). See {@link APPS_MANAGER_RECONNECT_ATTEMPTS}.\n */\n private static async fetchWithReconnect(\n url: string,\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n init: RequestInit,\n /** Per-OPERATION budget. Defaults to the light-call budget; heavy calls pass their own. */\n timeoutMs: number = APPS_MANAGER_TIMEOUT_MS,\n ): Promise<Response> {\n for (let attempt = 0; ; attempt++) {\n try {\n const response = await fetch(url, {\n ...init,\n headers: {\n [APPS_MANAGER_ADMIN_SECRET_HEADER]: AppBootstrapService.getAdminSecret(credentials),\n ...(init.body ? { [WildoHeaderKeys.CONTENT_TYPE]: 'application/json' } : {}),\n ...(init.headers ?? {}),\n },\n signal: AbortSignal.timeout(timeoutMs),\n });\n // REACHABILITY, not success: an HTTP error response still proves a platform is listening,\n // which is the only question the reconnect decision asks.\n appsManagerAnsweredThisRun = true;\n return response;\n } catch (error) {\n if (error instanceof Error && (error.name === 'AbortError' || error.name === 'TimeoutError')) {\n throw new Error(\n buildAppsManagerDiagnosticMessage({\n envName: env.name,\n summary: `Apps-manager request timed out after ${timeoutMs}ms at ${url}.`,\n }),\n );\n }\n\n /**\n * Never reached in this run ⇒ nothing to ride out. Fail now, and SAY so — the alternative\n * is a silent 30-second stall per call, four times over, ending in the same answer.\n */\n if (!appsManagerAnsweredThisRun) {\n reportAppsManagerWait(\n `apps-manager is not answering at ${AppBootstrapService.getAppsManagerBaseUrl(env)} and has not answered `\n + 'at any point in this run, so there is no crash/respawn to wait out. Continuing without it — a command '\n + 'that can use already-persisted material will; one that cannot will fail with its own diagnostic.',\n );\n throw new Error(\n buildAppsManagerDiagnosticMessage({\n envName: env.name,\n summary: `Unable to reach apps-manager at ${url}: ${ErrorUtils.extractErrorMessage(error)}.`,\n }),\n );\n }\n\n const canRetry = attempt < APPS_MANAGER_RECONNECT_ATTEMPTS;\n if (canRetry) {\n reportAppsManagerWait(\n `apps-manager stopped answering mid-run (attempt ${attempt + 1}/${APPS_MANAGER_RECONNECT_ATTEMPTS}) — `\n + `waiting up to ${APPS_MANAGER_RECONNECT_WAIT_MS / 1_000}s for the supervisor to respawn it...`,\n );\n if (await AppBootstrapService.waitForAppsManagerReconnect(env)) {\n reportAppsManagerWait('apps-manager is back; retrying.');\n continue;\n }\n reportAppsManagerWait('apps-manager did not come back within the window.');\n }\n\n throw new Error(\n buildAppsManagerDiagnosticMessage({\n envName: env.name,\n summary: `Unable to reach apps-manager at ${url}: ${ErrorUtils.extractErrorMessage(error)}.`,\n }),\n );\n }\n }\n }\n\n private static async requestJson(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n path: string,\n init: RequestInit = {},\n /** Per-OPERATION budget — see {@link APPS_MANAGER_INITIALIZE_TIMEOUT_MS}. */\n timeoutMs: number = APPS_MANAGER_TIMEOUT_MS,\n ): Promise<unknown> {\n const baseUrl = AppBootstrapService.getAppsManagerBaseUrl(env).replace(/\\/$/, '');\n const url = `${baseUrl}${path.startsWith('/') ? path : `/${path}`}`;\n\n const response = await AppBootstrapService.fetchWithReconnect(url, env, credentials, init, timeoutMs);\n\n if (!response.ok) {\n if (response.status === 401 || response.status === 403) {\n throw new Error(\n 'Apps-manager rejected bootstrap authentication. Check PLATFORM_ADMIN_SECRET.',\n );\n }\n\n const errorBody = await readErrorBody(response);\n throw new Error(\n `Apps-manager request failed at ${url}: ${response.status} ${response.statusText}${errorBody ? ` - ${errorBody}` : ''}`,\n );\n }\n\n return response.json();\n }\n\n /**\n * The application's migration artifacts, or `undefined` when no PostgreSQL schema has to be\n * applied before the application can be seeded.\n *\n * BOTH conditions are required, and the engine is the one that was missing.\n *\n * The first revision keyed solely on the directory, reasoning that \"an application that HAS\n * migrations needs them applied whatever its declared engine says, because the declaration and the\n * artifacts are two statements that can disagree while only the artifacts can create a table.\"\n * That is false for a MongoDB application: the artifacts describe a POSTGRESQL schema for a store\n * it does not use. The engine declaration is precisely what decides whether any PostgreSQL schema\n * is needed at all.\n *\n * Measured 2026-08-23, flipping this application back to MongoDB for the control run: the\n * `backend-api/migrations` directory survives the flip (it is committed), so two-phase provisioning\n * engaged, deferred the seed, and then tried to migrate a PostgreSQL database that a MongoDB\n * install never creates. `wildo local dev` aborted during application bootstrap with the\n * application left deliberately unseeded — worse than the deadlock the two-phase flow exists to\n * break, because it also affects the engine that never had the problem.\n */\n private static resolveAppSchemaMigrationsDirectory(\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>,\n applicationDatabase: { engine: DatabaseEngine; databaseName?: string } | undefined,\n ): string | undefined {\n if (applicationDatabase?.engine !== DatabaseEngine.POSTGRESQL) return undefined;\n // `appRoot` IS the saas root — `resolveRuntimeTarget` derives `saasConfigPath` by joining the\n // config filename onto it — so it is the same anchor `wildo db migrate` resolves from.\n return resolveAppMigrationsDirectory(runtimeTarget.appRoot);\n }\n\n /**\n * Phase 2 + 3: apply the application's schema, then re-invoke provisioning so the deferred\n * bootstrap rows land and every per-role GRANT is issued over the tables that now exist.\n *\n * Fails closed at both ends, because every degradation here produces an application that looks\n * provisioned and cannot boot:\n *\n * - an apps-manager that did not honour the phase (it is older than the contract, so it reported\n * nothing) is NOT assumed to have seeded — the migrations still run, and the idempotent second\n * call still completes the seed;\n * - an apps-manager that reports anything other than `SEEDED` after the schema exists is a defect,\n * not a state to retry past.\n */\n private static async completeDeferredAppDatabaseSeeding(input: {\n env: PlatformEnvironmentConfiguration;\n credentials: PlatformEnvSecretsJson;\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>;\n applicationDatabase: { engine: DatabaseEngine; databaseName?: string } | undefined;\n firstPhaseOutcome: AppDatabaseSeedingOutcome | undefined;\n }): Promise<void> {\n if (input.firstPhaseOutcome === AppDatabaseSeedingOutcome.NO_PERSISTENCE_TARGET) {\n /**\n * Nothing the tooling does next can seed this application — the target itself is missing, and\n * apps-manager has already logged why. Applying migrations would fail on a database that was\n * never provisioned, with a message about connectivity rather than about the real cause.\n */\n return;\n }\n\n await applyAppSchemaMigrations({\n envName: input.env.name,\n saasRoot: input.runtimeTarget.appRoot,\n appliedBy: `cli:bootstrap:${input.runtimeTarget.appSlug}`,\n reportMissing: (message) => { throw new Error(message); },\n });\n\n const secondPhaseOutcome = await AppBootstrapService.ensureApplicationRegistered(input.env, input.credentials, {\n appSlug: input.runtimeTarget.appSlug,\n appDisplayName: input.runtimeTarget.appDisplayName,\n appDatabaseName: input.runtimeTarget.appDatabaseName,\n managedDeclaration: input.runtimeTarget.managedDeclaration,\n applicationDatabase: input.applicationDatabase,\n firstAdminSeed: input.runtimeTarget.firstAdminSeed,\n appDatabaseSeeding: AppDatabaseSeedingPhase.REQUIRED,\n });\n\n if (secondPhaseOutcome !== undefined && secondPhaseOutcome !== AppDatabaseSeedingOutcome.SEEDED) {\n throw new Error(\n `Application '${input.runtimeTarget.appSlug}' was not seeded after its schema was applied `\n + `(apps-manager reported '${secondPhaseOutcome}'). Its backend requires exactly one APPLICATION `\n + 'row and cannot boot without it.',\n );\n }\n }\n\n static async ensureApplicationRegistered(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n input: {\n appSlug: string;\n appDisplayName: string;\n appDatabaseName?: string | undefined;\n managedDeclaration: AdminAppManagedDeclaration;\n /**\n * The application's own persistence engine, from the authored `applicationDatabase`.\n *\n * This is the CLI half of the door that did not exist: apps-manager's per-application\n * PostgreSQL provisioning is gated on `usePostgreSQL`, which nothing in the repository set\n * until 2026-08-19. Omitted means MongoDB, so an environment that authors nothing is unchanged.\n */\n applicationDatabase?: { engine: DatabaseEngine; databaseName?: string } | undefined;\n firstAdminSeed?: AppBootstrapFirstAdminSeed | undefined;\n /**\n * WHEN apps-manager should seed the application's own database. See\n * {@link AppDatabaseSeedingPhase} for the circularity `DEFERRED` breaks.\n */\n appDatabaseSeeding?: AppDatabaseSeedingPhase | undefined;\n },\n ): Promise<AppDatabaseSeedingOutcome | undefined> {\n const body = AdminAppInitializeRequestSchema.parse({\n name: input.appDisplayName,\n appDatabaseName: input.appDatabaseName,\n userEmail: credentials.admin.email,\n userFirstName: credentials.admin.firstName,\n userLastName: credentials.admin.lastName,\n userPassword: credentials.admin.password,\n managedDeclaration: input.managedDeclaration,\n applicationDatabase: input.applicationDatabase,\n firstAdminSeed: input.firstAdminSeed,\n appDatabaseSeeding: input.appDatabaseSeeding,\n /**\n * Forward the authored `serviceAuth` snapshot mirrored from\n * `wildo.infra.<env>.config.ts`. Apps-manager seeds platform-managed\n * JWT TTLs from this when present; otherwise applies\n * `WildoAuthConfigSchema` defaults at parse time.\n */\n serviceAuth: env.serviceAuth,\n });\n\n const response = await AppBootstrapService.requestJson(\n env,\n credentials,\n buildAdminInitializeApplicationPath(input.appSlug),\n {\n method: 'POST',\n body: JSON.stringify(body),\n },\n APPS_MANAGER_INITIALIZE_TIMEOUT_MS,\n );\n\n /**\n * Returns the outcome rather than discarding it. `undefined` means an apps-manager that predates\n * the two-phase contract and therefore said nothing — which the caller must treat as UNKNOWN, not\n * as seeded.\n */\n return AdminAppInitializeResponseSchema.parse(response).appDatabaseSeeding;\n }\n\n /**\n * POST /admin/apps/:appSlug/reapply-declaration\n *\n * Re-source the declaration-managed slices of the app's stored config\n * from the latest `wildo.saas.config.ts` projection. Idempotent.\n *\n * See `AdminAppReapplyDeclarationRequestSchema` (platform-config-lib)\n * for the contract scope: this does NOT touch credentials, K8s\n * endpoints, infra, or admin user/role seeding.\n */\n static async reapplyApplicationDeclaration(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n input: {\n appSlug: string;\n managedDeclaration: AdminAppManagedDeclaration;\n /**\n * Ask the server to report the diff and write nothing (issue #97).\n *\n * An empty `updatedFields` under a dry run is the coherence proof the init postcondition\n * and `wildo local doctor` rely on.\n */\n dryRun?: boolean;\n },\n ): Promise<AdminAppReapplyDeclarationResponse> {\n /*\n * The flag is omitted rather than sent as `false` when not requested, so the wire payload of an\n * ordinary reapply is byte-identical to what it was before `dryRun` existed. The request schema\n * is a `strictObject`, so this is also what keeps an older apps-manager from rejecting the call.\n */\n const body = AdminAppReapplyDeclarationRequestSchema.parse({\n managedDeclaration: input.managedDeclaration,\n ...(input.dryRun === true ? { dryRun: true } : {}),\n });\n\n const response = await AppBootstrapService.requestJson(\n env,\n credentials,\n buildAdminReapplyDeclarationPath(input.appSlug),\n {\n method: 'POST',\n body: JSON.stringify(body),\n },\n );\n\n return AdminAppReapplyDeclarationResponseSchema.parse(response);\n }\n\n static async fetchBootstrapCredentials(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n input: {\n appSlug: string;\n runtimeEnvironment: RuntimeEnvironment;\n /**\n * Which runtime principal to fetch for (Step 1 / F11). Omitted ⇒ the\n * application backend, which is what every caller wanted when one secret\n * per application was the only thing that existed.\n */\n principal?: ApplicationRuntimePrincipal;\n },\n ) {\n const response = await AppBootstrapService.requestJson(\n env,\n credentials,\n buildAppBootstrapCredentialsPath(\n input.appSlug,\n input.runtimeEnvironment,\n input.principal ? buildRuntimePrincipalKey(input.principal) : undefined,\n ),\n { method: 'GET' },\n );\n\n return AppBootstrapCredentialsResponseSchema.parse(response);\n }\n\n /**\n * Fetch ONE runtime's own bootstrap credentials.\n *\n * The app-level `prepared.bootstrapCredentials` is the APPLICATION BACKEND's\n * identity. Minion and worker targets used to reuse it verbatim — which is\n * exactly what F11 measured when it compared `backend-api/.env` and\n * `marketing-scrapper/.env` and found the secret byte-identical.\n *\n * The `APPLICATION_ID` and apps-manager URL are per-application and come back\n * identical; only `PLATFORM_APPLICATION_PRIMARY_SECRET` differs. Keeping the\n * whole envelope (rather than splicing one field into the app's) means the\n * runtime's `.env` is built from a response that was authenticated and\n * validated as a unit.\n */\n /**\n * Fetch one bootstrap credential set PER declared minion and worker.\n *\n * The app-level `bootstrapCredentials` is the APPLICATION BACKEND's identity.\n * Minion and worker targets used to reuse it verbatim — which is exactly what\n * F11 measured when it compared `backend-api/.env` with\n * `marketing-scrapper/.env` and found the secret byte-identical.\n *\n * `APPLICATION_ID` and the apps-manager URL come back identical for every\n * principal; only `PLATFORM_APPLICATION_PRIMARY_SECRET` differs. The whole\n * envelope is kept rather than splicing one field into the app's, so each\n * runtime's `.env` is built from a response that was authenticated and\n * validated as a unit.\n */\n private static async fetchDeclaredRuntimePrincipalCredentials(\n input: ApplicationEnvProjectionInput,\n runtimeTarget: ResolvedAppRuntimeTarget,\n runtimeEnvironment: RuntimeEnvironment,\n ): Promise<Record<string, AppBootstrapCredentials>> {\n // Sourced from the MANAGED DECLARATION, not a re-read of the saas config.\n // That is the same input apps-manager mints from, so the set of principals\n // the CLI asks for and the set apps-manager stores cannot drift — and it\n // costs no extra filesystem access, since the declaration is already\n // resolved on the target.\n const principals = enumerateDeclaredRuntimePrincipals(runtimeTarget.managedDeclaration)\n .filter((principal) => principal.kind !== ApplicationRuntimePrincipalKind.APPLICATION_BACKEND);\n\n const entries = await Promise.all(\n principals.map(async (principal) => {\n const response = await AppBootstrapService.fetchBootstrapCredentials(\n input.env,\n input.credentials,\n { appSlug: runtimeTarget.appSlug, runtimeEnvironment, principal },\n );\n return [buildRuntimePrincipalKey(principal), response.credentials] as const;\n }),\n );\n return Object.fromEntries(entries);\n }\n\n /**\n * A declared runtime's own credentials, or a hard failure.\n *\n * Deliberately NO fallback to `prepared.bootstrapCredentials`. A fallback here\n * would hand the runtime the application backend's identity and the sync would\n * report success — reintroducing F11 silently, at the one seam built to close\n * it. A missing entry means preparation and the declaration disagree, which is\n * a bug to surface, not to paper over.\n */\n /**\n * Degraded-mode counterpart of {@link requireRuntimePrincipalCredentials}.\n *\n * Returns `null` for a principal the offline reconstruction could not resolve,\n * so the caller SKIPS that runtime and writes the others. Outside degraded mode\n * it delegates and still THROWS — a missing entry there means preparation and\n * the declaration disagree, which is a bug to surface rather than skip.\n *\n * The strictness that matters is untouched either way: nothing ever substitutes\n * the application backend's identity for a principal's.\n */\n private static resolveRuntimePrincipalCredentialsOrSkip(\n prepared: PreparedApplicationEnvTargets,\n principal: ApplicationRuntimePrincipal,\n ): AppBootstrapCredentials | null {\n if (prepared.degraded && !prepared.runtimePrincipalCredentials[buildRuntimePrincipalKey(principal)]) {\n return null;\n }\n return AppBootstrapService.requireRuntimePrincipalCredentials(prepared, principal);\n }\n\n private static requireRuntimePrincipalCredentials(\n prepared: PreparedApplicationEnvTargets,\n principal: ApplicationRuntimePrincipal,\n ): AppBootstrapCredentials {\n const principalKey = buildRuntimePrincipalKey(principal);\n const credentials = prepared.runtimePrincipalCredentials[principalKey];\n if (!credentials) {\n throw new Error(\n `No bootstrap credentials prepared for runtime principal '${principalKey}'. `\n + 'Every declared minion and worker must have its own identity; refusing to fall back to the application backend\\'s.',\n );\n }\n return credentials;\n }\n\n static async buildApplicationBackendTargets(\n input: ApplicationEnvProjectionInput,\n ): Promise<ApplicationBackendEnvTarget[]> {\n const prepared = input.prepared ?? await AppBootstrapService.prepareApplicationEnvTargets(input);\n if (!prepared) {\n return [];\n }\n const { runtimeTarget, bootstrapCredentials, runtimeEndpoints } = prepared;\n\n // App-level deploy context (same value on every backend target, like\n // runtimeEndpoints) — the CI render path reads it to emit the serviceHosts\n // ingress (k8s) / Traefik routing (compose). Empty for local.\n const ingressRoutes = AppBootstrapService.buildApplicationIngressRoutes(runtimeTarget, input.env);\n const { podPorts, healthPort } = AppBootstrapService.buildBackendPodPorts(runtimeTarget, input.env);\n // Per-service model: the frontends deploy as their own nginx Deployments —\n // carried on the (primary-first) backend target's app-deploy context so the\n // CI render emits a backend Deployment + one frontend Deployment per entry.\n const frontends = AppBootstrapService.buildApplicationFrontendDeployTargets(runtimeTarget, input.env);\n // Backend→worker dispatch URLs (G-8 / MW4): every declared worker's per-app\n // k8s Service URL, keyed by bucket name. Emitted into the backend env as\n // `WILDO_WORKER_<NAME>_URL` so the backend's WorkerRemoteClientFactory can\n // call each worker. REMOTE only; same value on every backend target.\n const workerUrls = await AppBootstrapService.buildApplicationWorkerDispatchUrls(runtimeTarget, input.env);\n\n\n // Emit the targets PRIMARY-FIRST. The shared `{appSlug}-secret`\n // (k8s-secrets-generator §5, deduped by appName, first-wins) must bake the\n // PRIMARY backend's identity env (SERVICE_NAME / OTEL_SERVICE_NAME) — the\n // single app pod + every minion mount it — not whichever backend happened to\n // be authored first. Mirrors the `find(key==='backendApi') ?? [0]` primary\n // rule used for runtime endpoints + pod ports.\n const primaryBackend =\n runtimeTarget.backendServices.find((backend) => backend.key === 'backendApi') ??\n runtimeTarget.backendServices[0];\n const orderedBackends = primaryBackend\n ? [primaryBackend, ...runtimeTarget.backendServices.filter((backend) => backend !== primaryBackend)]\n : runtimeTarget.backendServices;\n\n return orderedBackends.map((service) => {\n const serviceRoot = resolve(runtimeTarget.appRoot, service.path);\n const relativeDir = relative(input.frameworkPath, serviceRoot);\n if (relativeDir.startsWith('..')) {\n throw new Error(\n `Application backend '${service.serviceName}' is outside the framework root and cannot receive generated .env files.`,\n );\n }\n return {\n bootstrapCredentials,\n serviceName: service.serviceName,\n relativeDir,\n applicationRuntimeSignalsHome: join(runtimeTarget.appRoot, WORKSPACE_HOME_NAMES.APP_RUNTIME_HOME, APP_RUNTIME_SUBDIR_NAMES.RUNTIME_SIGNALS),\n appDatabaseName: runtimeTarget.appDatabaseName,\n redisKeyPrefix: runtimeTarget.redisKeyPrefix,\n storageBucketPrefix: runtimeTarget.storageBucketPrefix,\n runtimeEndpoints,\n appName: runtimeTarget.appSlug,\n ingressRoutes: ingressRoutes.length > 0 ? ingressRoutes : undefined,\n podPorts: podPorts.length > 0 ? podPorts : undefined,\n healthPort,\n frontends: frontends.length > 0 ? frontends : undefined,\n // Per-service, not per-app: each backend row carries its own resolved\n // isolation. Passed through from the config boundary unchanged.\n isolation: {\n runAsUser: service.isolation.runAsUser,\n runAsGroup: service.isolation.runAsGroup,\n writablePaths: [...service.isolation.writablePaths],\n },\n workerUrls,\n // The backend's own declared provider scope. It legitimately declares\n // most providers, so this changes nothing for it today — but it must be\n // threaded explicitly, because the builder now fails CLOSED: an omitted\n // scope yields no provider secrets rather than all of them.\n scopedProviderRefs: runtimeTarget.backendScopedProviderRefs,\n };\n });\n }\n\n /**\n * Build the backend→worker dispatch URL map (G-8 / MW4): for every worker\n * declared in `wildo.saas.config.ts > workers`, its in-cluster base URL\n * `http://{appSlug}-worker-{bucketKey}:{http.port}`, keyed by bucket name.\n *\n * REMOTE only — local dev has no k8s Services, and worker dispatch is a\n * k8s-deploy concern (the render only deploys workers for REMOTE). The URL is\n * coherent-by-construction with `renderWorkerForTarget` via the shared\n * `buildWorkerInternalUrl` helper (same `{appSlug}-worker-{key}` Service name).\n * The worker `http.port` is read through `WildoWorkerConfigSchema` — the same\n * authoritative parse `buildApplicationWorkerTargets` uses — so a wrong port\n * can never drift from the deployed Service.\n */\n private static async buildApplicationWorkerDispatchUrls(\n runtimeTarget: ResolvedAppRuntimeTarget,\n env: PlatformEnvironmentConfiguration,\n ): Promise<Record<string, string> | undefined> {\n if (env.locationType !== WildoLocationType.REMOTE) {\n return undefined;\n }\n const saasConfig = await loadConfig<{\n workers?: Record<string, { path: string }>;\n }>(runtimeTarget.saasConfigPath);\n const workers = saasConfig.workers ?? {};\n const urls: Record<string, string> = {};\n for (const [workerName, workerRef] of Object.entries(workers)) {\n const workerRoot = resolve(runtimeTarget.appRoot, workerRef.path);\n const workerConfig = WildoWorkerConfigSchema.parse(\n await loadConfig(join(workerRoot, WORKER_CONFIG_FILENAME)),\n );\n urls[workerName] = buildWorkerInternalUrl(\n runtimeTarget.appSlug,\n workerName,\n workerConfig.http.port,\n );\n }\n return Object.keys(urls).length > 0 ? urls : undefined;\n }\n\n static async buildApplicationCompanionTargets(\n input: ApplicationEnvProjectionInput,\n ): Promise<CompanionPlatformEnvTarget[]> {\n const prepared = input.prepared ?? await AppBootstrapService.prepareApplicationEnvTargets(input);\n if (!prepared) {\n return [];\n }\n\n const { runtimeTarget, bootstrapCredentials, runtimeEndpoints } = prepared;\n const companionRoot = resolveAppLayout(runtimeTarget.appRoot).companionHome;\n if (!existsSync(companionRoot)) {\n return [];\n }\n\n const companionRelativeDir = relative(input.frameworkPath, companionRoot);\n if (companionRelativeDir.startsWith('..')) {\n throw new Error(\n `Application companion for '${runtimeTarget.appSlug}' is outside the framework root and cannot receive generated .env files.`,\n );\n }\n\n const companionExtraEnv: Record<string, string> = {};\n\n if (runtimeTarget.localServiceAddresses?.devCompanion?.host) {\n companionExtraEnv.HOST = runtimeTarget.localServiceAddresses.devCompanion.host;\n }\n if (runtimeTarget.localServiceAddresses?.devCompanion?.port) {\n companionExtraEnv.PORT = String(runtimeTarget.localServiceAddresses.devCompanion.port);\n }\n\n return [{\n bootstrapCredentials,\n serviceName: `${runtimeTarget.appSlug}-dev-companion`,\n relativeDir: companionRelativeDir,\n runtimeEndpoints,\n extraEnv: companionExtraEnv,\n }];\n }\n\n static async buildApplicationWorkerTargets(\n input: ApplicationEnvProjectionInput,\n ): Promise<ApplicationWorkerEnvTarget[]> {\n const prepared = input.prepared ?? await AppBootstrapService.prepareApplicationEnvTargets(input);\n if (!prepared) {\n return [];\n }\n\n const { runtimeTarget, bootstrapCredentials, runtimeEndpoints } = prepared;\n const isRemote = input.env.locationType === WildoLocationType.REMOTE;\n const saasConfig = await loadConfig<{\n workers?: Record<string, { path: string }>;\n providers?: { scopes?: { workers?: Record<string, { providers?: Record<string, unknown> }> } };\n }>(runtimeTarget.saasConfigPath);\n const workers = saasConfig.workers ?? {};\n const targets: ApplicationWorkerEnvTarget[] = [];\n\n for (const [workerName, workerRef] of Object.entries(workers)) {\n const workerRoot = resolve(runtimeTarget.appRoot, workerRef.path);\n // Parse through the authoritative schema — validates the authored config\n // AND applies the canonical defaults (port 8080, /healthz, /readyz,\n // replicas 1) from `WorkerHttpSchema`/`WildoWorkerConfigSchema`. Deriving\n // from the spec (rather than re-defaulting `?? 8080` here) keeps the k8s\n // manifest in lockstep with the runtime contract — no drift, no second\n // source of the defaults, and a malformed config fails fast.\n const workerConfig = WildoWorkerConfigSchema.parse(\n await loadConfig(join(workerRoot, WORKER_CONFIG_FILENAME)),\n );\n const relativeDir = relative(input.frameworkPath, workerRoot);\n if (relativeDir.startsWith('..')) {\n throw new Error(\n `Application worker '${workerName}' is outside the framework root and cannot receive generated .env files.`,\n );\n }\n\n const workerCredentials = AppBootstrapService.resolveRuntimePrincipalCredentialsOrSkip(\n prepared,\n { kind: ApplicationRuntimePrincipalKind.WORKER, name: workerName },\n );\n if (!workerCredentials) continue;\n\n targets.push({\n // Workers get their own identity too (D22). Leaving them on the shared\n // application secret would ship the containment with a worker-shaped\n // bypass: a worker could fetch every minion's credentials, so excluding\n // them would not have been the conservative choice.\n bootstrapCredentials: workerCredentials,\n workerName,\n serviceName: workerConfig.name,\n relativeDir,\n runtimeEndpoints,\n // Declared provider scope — see the identical field on the minion target.\n // `myRustWorker` declares `providers: {}` and therefore receives no\n // provider secrets at all; it previously received every one of them.\n scopedProviderRefs: Object.keys(\n saasConfig.providers?.scopes?.workers?.[workerName]?.providers ?? {},\n ),\n // Authored worker HTTP (schema-defaulted): nested `http` populated for\n // every env (the `.env` projection is not remote-only), shared by the\n // worker env-gen and the REMOTE k8s render.\n http: {\n port: workerConfig.http.port,\n healthPath: workerConfig.http.healthPath,\n readyPath: workerConfig.http.readyPath,\n metricsPath: workerConfig.http.metricsPath,\n },\n // NOT inside the `isRemote` branch below — container isolation feeds\n // BOTH renderers (k8s securityContext + volumes, compose\n // `user`/`read_only`/`tmpfs`/`pids_limit`). Same placement and same\n // reason as the minion target below.\n isolation: workerConfig.isolation,\n // REMOTE k8s deploy context (appName + replicas).\n ...(isRemote\n ? { appName: runtimeTarget.appSlug, replicas: workerConfig.replicas }\n : {}),\n });\n }\n\n return targets;\n }\n\n static async buildApplicationMinionTargets(\n input: ApplicationEnvProjectionInput,\n ): Promise<ApplicationMinionEnvTarget[]> {\n const prepared = input.prepared ?? await AppBootstrapService.prepareApplicationEnvTargets(input);\n if (!prepared) {\n return [];\n }\n\n const { runtimeTarget, bootstrapCredentials, runtimeEndpoints } = prepared;\n const saasConfig = await loadConfig<{\n minions?: Record<string, {\n path: string;\n /**\n * The minion's authored application-data access. Read here so env\n * generation can withhold a backing service's TOPOLOGY from a minion that\n * never declared it — the same declaration apps-manager reads to decide\n * whether to mint that minion a credential at all (D11/R3).\n *\n * ABSENT and declared-but-empty are different statements and must stay\n * distinguishable all the way down; see `RuntimeAccessDeclaration`.\n */\n resourceAccess?: { read?: readonly string[]; write?: readonly string[] };\n /** Authored opt-in for a route off the host. Default false, never inferred. */\n requiresInternetEgress?: boolean;\n }>;\n // The scope's providers are a REF -> ENTRY map, not a bag of unknowns. Typed\n // that way so `registerMinionLocalProviders` can merge into it without the\n // call site loosening its contract to fit a placeholder type.\n providers?: { scopes?: { minions?: Record<string, { providers?: Record<string, Record<string, unknown>> }> } };\n }>(runtimeTarget.saasConfigPath);\n const minions = saasConfig.minions ?? {};\n const targets: ApplicationMinionEnvTarget[] = [];\n\n const isRemote = input.env.locationType === WildoLocationType.REMOTE;\n for (const [minionName, minionRef] of Object.entries(minions)) {\n const minionRoot = resolve(runtimeTarget.appRoot, minionRef.path);\n // Parse through the authoritative schema — validates AND applies the\n // canonical `MinionReinstantiationSchema`/`MinionLivenessSchema` defaults\n // (kill_previous, file liveness at /tmp/wildo-minion-alive, staleAfterSec\n // 90). Derived from the spec so the k8s manifest never drifts from the\n // runtime contract, and a malformed minion config fails fast.\n const minionConfig = WildoMinionConfigSchema.parse(\n await loadConfig(join(minionRoot, MINION_CONFIG_FILENAME)),\n );\n const relativeDir = relative(input.frameworkPath, minionRoot);\n if (relativeDir.startsWith('..')) {\n throw new Error(\n `Application minion '${minionName}' is outside the framework root and cannot receive generated .env files.`,\n );\n }\n\n const minionCredentials = AppBootstrapService.resolveRuntimePrincipalCredentialsOrSkip(\n prepared,\n { kind: ApplicationRuntimePrincipalKind.MINION, name: minionName },\n );\n // Degraded mode only: a principal whose own secret is not on disk is SKIPPED\n // so every other runtime is still written. Outside degraded mode the resolver\n // throws, preserving the guard that refuses the backend's identity.\n if (!minionCredentials) continue;\n\n targets.push({\n // The minion's OWN identity, not the application backend's. This one\n // line is what F11 was about: every minion previously shipped with the\n // app's `PLATFORM_APPLICATION_PRIMARY_SECRET`, so at the apps-manager\n // door it could ask as the backend — making any narrowing elsewhere\n // bypassable rather than enforced.\n bootstrapCredentials: minionCredentials,\n minionName,\n serviceName: minionConfig.name,\n relativeDir,\n applicationRuntimeSignalsHome: join(runtimeTarget.appRoot, WORKSPACE_HOME_NAMES.APP_RUNTIME_HOME, APP_RUNTIME_SUBDIR_NAMES.RUNTIME_SIGNALS),\n appDatabaseName: runtimeTarget.appDatabaseName,\n // The minion's OWN Redis namespace (D20), NOT the application's.\n //\n // This is one half of a COUPLED PAIR: apps-manager grants this minion's\n // ACL user exactly `buildMinionRedisKeyPrefix(...)*`, and this is the\n // prefix the minion actually writes under. Derived from the SAME\n // function so the two cannot drift — if they disagree by a character,\n // every Redis operation the minion performs is DENIED and the error\n // names an ACL rather than the mismatch, so nothing in the minion's own\n // configuration explains it.\n //\n // A strict extension of the application prefix, which keeps\n // `RedisService`'s \"an authored prefix must start with `<appSlug>:`\"\n // rule true without changing that rule.\n redisKeyPrefix: buildMinionRedisKeyPrefix(runtimeTarget.appSlug, minionName),\n storageBucketPrefix: runtimeTarget.storageBucketPrefix,\n runtimeEndpoints,\n // NOT inside the `isRemote` branch below: container isolation applies to\n // BOTH renderers. k8s consumes it as securityContext + volumes, compose\n // as `user`/`read_only`/`tmpfs`/`pids_limit`. Gating it on REMOTE would\n // leave local dev running the pre-hardening posture while the manifest\n // claimed otherwise — exactly the k8s/compose asymmetry Step 5b warns\n // about.\n isolation: {\n runAsUser: minionConfig.isolation.runAsUser,\n runAsGroup: minionConfig.isolation.runAsGroup,\n writablePaths: minionConfig.isolation.writablePaths,\n pidsLimit: minionConfig.isolation.pidsLimit,\n },\n // The provider refs this minion DECLARED. Read from the authored scope\n // rather than inherited from the application: a minion scoped to `openai`\n // must not receive the app's Stripe key, and until now it did — the scope\n // was materialised into topology while the SECRETS ignored it entirely.\n // An undeclared scope yields `[]`, i.e. no provider secrets, matching the\n // fail-closed posture `resourceAccess` already takes (D11).\n // R7 — the minion's locally-AUTHORED providers are registered into its own\n // scope before the refs are derived, so a locally-authored provider is\n // visible to this minion exactly as an application-declared one is, and\n // through the SAME projection. Everything downstream — the secret\n // filtering, the generated runtime module — reads the merged scope and\n // cannot tell the two apart, which is what keeps ONE runtime source and\n // ONE secret mechanism.\n //\n // Registered HERE rather than at the catalog: this is the single place\n // that holds both the parsed minion config (which carries the fragment)\n // and the application scope it merges into.\n scopedProviderRefs: Object.keys(\n registerMinionLocalProviders(\n saasConfig.providers?.scopes?.minions?.[minionName],\n minionConfig.localProviders,\n minionName,\n ).providers,\n ),\n // Forwarded VERBATIM, including its absence. Defaulting to `{}` here\n // would turn \"declared nothing\" into \"declared empty\" and silently strip\n // a declaring minion's database topology; defaulting the other way would\n // hand a non-declaring minion a route it never asked for. Neither default\n // is safe, so there is none.\n accessDeclaration: {\n resourceAccess: minionRef.resourceAccess,\n requiresInternetEgress: minionRef.requiresInternetEgress,\n },\n // REMOTE k8s deploy context (schema-defaulted fields, read directly).\n ...(isRemote\n ? {\n appName: runtimeTarget.appSlug,\n reinstantiationPolicy: minionConfig.reinstantiation.policy,\n gracePeriodSec: minionConfig.reinstantiation.gracePeriodSec,\n liveness: {\n kind: minionConfig.liveness.kind,\n filePath: minionConfig.liveness.filePath,\n staleAfterSec: minionConfig.liveness.staleAfterSec,\n execCommand: minionConfig.liveness.execCommand,\n },\n }\n : {}),\n });\n }\n\n return targets;\n }\n\n static async buildApplicationFrontendTargets(input: {\n frameworkPath: string;\n saasRoot: string;\n requestedAppSlug?: string | undefined;\n prepared?: PreparedApplicationEnvTargets;\n }): Promise<ApplicationFrontendEnvExampleTarget[]> {\n const runtimeTarget = input.prepared?.runtimeTarget ?? await AppBootstrapService.resolveRuntimeTarget(input);\n if (!runtimeTarget) {\n return [];\n }\n\n const primaryBackendPort =\n runtimeTarget.backendServices.find((backend) => backend.key === 'backendApi')?.defaultPort ??\n runtimeTarget.backendServices[0]?.defaultPort;\n /**\n * Where the DEV SERVER forwards API traffic. This is an internal hop to a plain-http listener and\n * stays http under every edge scheme — the same public/internal split the runtime topology makes.\n */\n const apiProxyTarget = primaryBackendPort ? `http://localhost:${primaryBackendPort}` : undefined;\n\n return runtimeTarget.frontendServices.map((service) => {\n const relativeDir = relative(input.frameworkPath, resolve(runtimeTarget.appRoot, service.path));\n if (relativeDir.startsWith('..')) {\n throw new Error(\n `Application frontend '${service.serviceName}' is outside the framework root and cannot receive generated .env.example files.`,\n );\n }\n\n const envExample: Record<string, string> = {\n NODE_ENV: 'development',\n VITE_APP_SLUG: runtimeTarget.appSlug,\n VITE_APP_NAME: runtimeTarget.appDisplayName,\n ...(service.defaultPort ? { VITE_PORT: String(service.defaultPort) } : {}),\n };\n\n if (service.defaultPort) {\n envExample.VITE_HMR_HOST = 'localhost';\n envExample.VITE_HMR_CLIENT_PORT = String(service.defaultPort);\n // The HMR socket rides the page's own origin, which is plain http locally.\n envExample.VITE_HMR_PROTOCOL = 'ws';\n }\n\n if (service.frontendType === AppFrontendType.SAAS_APP) {\n if (!apiProxyTarget) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' has no backend API port to bind frontend '${service.serviceName}' to VITE_API_BASE_URL.`,\n );\n }\n\n /**\n * The browser addresses the backend port DIRECTLY. This is the long-standing local behaviour,\n * and as of 2026-08-14 the only one: the dev API proxy was removed, so there is no dev-server\n * origin to address the API on and no proxy target to emit.\n *\n * ⚠️ Under a TLS edge this becomes a mixed-content problem — an https page cannot call the\n * backend's plain-http port. That is one of the reasons the local TLS edge was withdrawn; if\n * one is ever reintroduced, the API origin and the forwarding it implies have to come back\n * TOGETHER, not one before the other.\n */\n envExample.VITE_API_BASE_URL = apiProxyTarget;\n envExample.VITE_FRONTEND_SERVICE_NAME = service.serviceName;\n\n }\n\n if (service.frontendType === AppFrontendType.TECH_DOC) {\n /**\n * The documentation site needs the same three origins the SaaS app does, but under\n * its OWN env names: it is a Docusaurus build, not a Vite app, so it never reads\n * `VITE_*`. Its config refuses to complete a PRODUCTION build when these are unset,\n * because a docs bundle compiles its origins in — a wrong value points every reader\n * at the wrong host instead of failing.\n *\n * Local values are derived here, exactly as `VITE_API_BASE_URL` is, so a developer\n * building the docs locally needs no manual wiring. Remote environments author\n * `documentationSite` in `wildo.infra.<env>.config.ts`, which\n * `PlatformEnvVarsBuilder.emitDocumentationSiteEnv` projects onto the same three\n * names — so the authored value overrides these defaults rather than competing with\n * them.\n */\n if (!apiProxyTarget) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' has no backend API port to bind documentation site '${service.serviceName}' to WILDO_DOCS_API_BASE_URL.`,\n );\n }\n const saasAppPort = runtimeTarget.frontendServices\n .find((frontend) => frontend.frontendType === AppFrontendType.SAAS_APP)?.defaultPort;\n if (!saasAppPort) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' has no SaaS application frontend port to bind documentation site '${service.serviceName}' to WILDO_DOCS_APP_URL. `\n + 'The documentation site deep-links anonymous readers to the SaaS app to sign in.',\n );\n }\n // The docs site is itself served plain http locally, so addressing the backend port directly\n // raises no mixed-content problem and needs no proxy of its own.\n envExample[PlatformDocumentationSiteEnvKeys.WILDO_DOCS_API_BASE_URL] = apiProxyTarget;\n // This one points at the SaaS APP, which IS the edge — so it carries the edge scheme. Left as\n // http it deep-links every anonymous reader at a port that no longer answers.\n envExample[PlatformDocumentationSiteEnvKeys.WILDO_DOCS_APP_URL] =\n `http://localhost:${saasAppPort}`;\n envExample[PlatformDocumentationSiteEnvKeys.WILDO_DOCS_FRONTEND_SERVICE_NAME] = service.serviceName;\n }\n\n return {\n serviceName: service.serviceName,\n relativeDir,\n envExample,\n };\n });\n }\n\n /**\n * Project local authored operator posture into the app-root `.env` target.\n *\n * The generated `config.json` snapshot is the input here. The `.env` file is\n * only a disposable process boundary and is regenerated by both config sync\n * and dev start. Run identity is intentionally absent: the verification\n * supervisor mints it per invocation rather than accepting authored state.\n */\n static buildApplicationOperatorEnvTargets(input: {\n env: PlatformEnvironmentConfiguration;\n config: PlatformEnvConfigJson;\n frameworkPath: string;\n saasRoot: string;\n }): ApplicationOperatorEnvTarget[] {\n const verification = input.config.applicationCreationVerification;\n if (input.env.locationType !== WildoLocationType.LOCAL) {\n if (verification === undefined) return [];\n throw new Error('Application-creation verification operator environment is local-only.');\n }\n\n const repositoryRoot = resolve(input.frameworkPath);\n const applicationRoot = resolve(input.saasRoot);\n const relativeDir = relative(repositoryRoot, applicationRoot);\n if (relativeDir === '' || relativeDir === '..' || relativeDir.startsWith(`..${sep}`) || isAbsolute(relativeDir)) {\n throw new Error('Application operator environment target must remain below the framework repository root.');\n }\n\n return [{\n relativeDir,\n ...(verification === undefined\n ? { disposition: ApplicationOperatorEnvFileDisposition.REMOVE }\n : {\n disposition: ApplicationOperatorEnvFileDisposition.WRITE,\n env: {\n [ApplicationCreationVerificationEnvKey.EVIDENCE_DIRECTORY]: verification.evidenceDirectory,\n [ApplicationCreationVerificationEnvKey.SILENT]: String(verification.silent),\n },\n }),\n }];\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"app-bootstrap.service.js","sourceRoot":"","sources":["../../../../src/services/application/app-bootstrap.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE3D,OAAO,EAAsB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EACL,oCAAoC,EACpC,gCAAgC,EAChC,uBAAuB,EACvB,eAAe,EACf,gCAAgC,EAChC,qCAAqC,EAIrC,+BAA+B,EAC/B,gCAAgC,EAChC,uCAAuC,EACvC,wCAAwC,EAExC,qCAAqC,EACrC,mCAAmC,EACnC,gCAAgC,EAChC,gCAAgC,EAChC,yCAAyC,EACzC,mCAAmC,EACnC,uCAAuC,EACvC,gCAAgC,EAChC,mBAAmB,EACnB,wBAAwB,EAExB,UAAU,EACV,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,+BAA+B,EAC/B,yBAAyB,EACzB,4BAA4B,EAC5B,wBAAwB,EACxB,kCAAkC,EAElC,cAAc,EACd,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,+B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,gCAAgC,CAAC,gCAAgC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;YACtG,CAAC;YAED,OAAO;gBACL,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,eAAe,EAAE,aAAa,CAAC,OAAO;gBACtC,WAAW;gBACX,UAAU;aACX,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,kCAAkC,CAAC,KAIzC;QACC,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,+BAA+B,CAAC;QAClE,IAAI,KAAK,CAAC,GAAG,CAAC,YAAY,KAAK,iBAAiB,CAAC,KAAK,EAAE,CAAC;YACvD,IAAI,YAAY,KAAK,SAAS;gBAAE,OAAO,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;QAC3F,CAAC;QAED,OAAO,CAAC;gBACN,eAAe,EAAE,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC;gBACxC,GAAG,CAAC,YAAY,KAAK,SAAS;oBAC5B,CAAC,CAAC,EAAE,WAAW,EAAE,qCAAqC,CAAC,MAAM,EAAE;oBAC/D,CAAC,CAAC;wBACA,WAAW,EAAE,qCAAqC,CAAC,KAAK;wBACxD,GAAG,EAAE;4BACH,CAAC,qCAAqC,CAAC,kBAAkB,CAAC,EAAE,YAAY,CAAC,iBAAiB;4BAC1F,CAAC,qCAAqC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC;yBAC5E;qBACF,CAAC;aACL,CAAC,CAAC;IACL,CAAC","sourcesContent":["import { existsSync, readFileSync } from 'fs';\nimport { isAbsolute, join, relative, resolve } from 'path';\nimport type { AppConfiguration_BackendAuthored } from '@wildo-ai/saas-backend-lib';\nimport { RuntimeEnvironment, WildoHeaderKeys } from '@wildo-ai/saas-models';\nimport {\n buildAppBootstrapCredentialsResponse,\n APPS_MANAGER_ADMIN_SECRET_HEADER,\n APPS_MANAGER_API_PREFIX,\n AppFrontendType,\n PlatformDocumentationSiteEnvKeys,\n ApplicationCreationVerificationEnvKey,\n type AdminAppManagedDeclaration,\n type AppBootstrapCredentials,\n type AppBootstrapFirstAdminSeed,\n AdminAppInitializeRequestSchema,\n AdminAppInitializeResponseSchema,\n AdminAppReapplyDeclarationRequestSchema,\n AdminAppReapplyDeclarationResponseSchema,\n type AdminAppReapplyDeclarationResponse,\n AppBootstrapCredentialsResponseSchema,\n buildAdminInitializeApplicationPath,\n buildAdminReapplyDeclarationPath,\n buildAppBootstrapCredentialsPath,\n buildLocalhostApplicationRuntimeEndpoints,\n buildK8sApplicationRuntimeEndpoints,\n buildComposeApplicationRuntimeEndpoints,\n buildK8sApplicationIngressRoutes,\n buildK8sInternalUrl,\n APP_RUNTIME_SUBDIR_NAMES,\n type K8sIngressRoute,\n loadConfig,\n resolveAppLayout,\n WildoDeploymentRuntime,\n WildoLocationType,\n WORKSPACE_HOME_NAMES,\n WORKER_CONFIG_FILENAME,\n MINION_CONFIG_FILENAME,\n WildoWorkerConfigSchema,\n WildoMinionConfigSchema,\n ApplicationRuntimePrincipalKind,\n buildMinionRedisKeyPrefix,\n registerMinionLocalProviders,\n buildRuntimePrincipalKey,\n enumerateDeclaredRuntimePrincipals,\n type ApplicationRuntimePrincipal,\n DatabaseEngine,\n AppDatabaseSeedingPhase,\n AppDatabaseSeedingOutcome,\n} from '@wildo-ai/platform-config-lib';\nimport { buildWorkerInternalUrl, buildWorkerLocalUrl } from '@wildo-ai/platform-core-shared';\nimport type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvConfigJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport type {\n ApplicationBackendEnvTarget,\n CompanionPlatformEnvTarget,\n ApplicationFrontendEnvExampleTarget,\n ApplicationOperatorEnvTarget,\n ApplicationWorkerEnvTarget,\n ApplicationMinionEnvTarget,\n K8sPodPort,\n} from '~wildo-cli/services/environment/env-configuration-generator.service';\nimport { ApplicationOperatorEnvFileDisposition } from '~wildo-cli/services/environment/env-configuration-generator.service';\nimport { AddressPerspective, ServiceAddressResolver } from '~wildo-cli/services/catalog/service-address-resolver.service';\nimport { buildAppsManagerDiagnosticMessage } from '~wildo-cli/services/deployment/apps-manager-diagnostics.service';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { AppRuntimeTargetsService, type ResolvedAppRuntimeTarget } from './app-runtime-targets.service';\nimport { applyAppSchemaMigrations, resolveAppMigrationsDirectory } from './app-schema-bootstrap.service';\n\n\n/**\n * Budget for a LIGHT apps-manager call — a read, or an idempotent config re-source.\n *\n * Short on purpose: for an operation that should answer in well under a second, a short budget is\n * what gives the timeout its diagnostic value. It says \"apps-manager is not answering\", and it says\n * it quickly.\n */\nconst APPS_MANAGER_TIMEOUT_MS = 15_000;\n\n/**\n * Budget for `POST /admin/apps/:appSlug/initialize` — a HEAVY, long-running provisioning call.\n *\n * ## Why this is not the same number as above\n *\n * Both budgets used to be one constant, and that conflated two unrelated questions: \"is apps-manager\n * unresponsive?\" and \"is apps-manager doing a long job it is supposed to be doing?\". Initialization\n * provisions the application database and its user, mints runtime-principal credentials, reconciles\n * ACLs, connects, and constructs the application's ENTIRE repository registry — ensuring every\n * declared index on every resource.\n *\n * Measured on Wonder Todos, 2026-08-19, on a machine where nothing was wrong: **12.2s** and **21.5s**\n * for the same call on two runs, against an application database holding 95 collections and 514\n * indexes. Both exceeded 15s, so `wildo local dev` aborted the whole session — and did so at the\n * point where the CLI kills the process tree, which made a healthy platform look like a failed one.\n *\n * Note the cost is NOT first-run index CREATION: those 514 indexes already existed. Ensuring them is\n * re-paid on every initialize, so the budget has to cover the steady state, not a cold start.\n *\n * ## Why raising the SHARED constant would have been the wrong fix\n *\n * It would have bought this call its headroom by taking detection value away from the two light\n * calls, which would then need the full budget to report an apps-manager that is simply dead.\n * A budget belongs to an operation, not to a client.\n *\n * The value is deliberately generous rather than tuned to the measurement: the work scales with the\n * application's resource count, and a larger app, a cold page cache or a loaded machine can be\n * several times slower without anything being wrong. It is still bounded, so a genuinely hung\n * apps-manager is reported well inside an interactive session.\n */\nconst APPS_MANAGER_INITIALIZE_TIMEOUT_MS = 180_000;\n\n/**\n * `waitForPlatformServicesReady` gates entry into registered-app bootstrap on\n * apps-manager answering `/health/ready`, but that check and this request are\n * two separate round-trips: apps-manager can pass readiness and then crash\n * (observed 2026-08-06: an uncaught exception from an unrelated OTel\n * telemetry batch-flush timer killed apps-manager seconds after it reported\n * ready) before the registration POST lands, producing an immediate\n * connection-refused \"fetch failed\" that aborted the whole `wildo local dev`\n * session. `platform-lifecycle.service.ts`'s runtime supervisor auto-respawns\n * a crashed platform service within seconds, so a bounded reconnect-wait here\n * — NOT a soft-success, still fails hard on HTTP error responses and after\n * this budget is exhausted — turns a transient crash/respawn window into a\n * short, silent retry instead of a hard command failure.\n */\nconst APPS_MANAGER_RECONNECT_ATTEMPTS = 2;\nconst APPS_MANAGER_RECONNECT_WAIT_MS = 30_000;\nconst APPS_MANAGER_RECONNECT_POLL_INTERVAL_MS = 1_000;\n\n/**\n * Has apps-manager answered AT ALL during this process?\n *\n * The reconnect window above is for a crash/RESPAWN — its own contract says apps-manager \"can pass\n * readiness and then crash\". Riding that out presupposes it was up. When it was never up there is\n * nothing to respawn, and waiting only postpones a conclusion the first `ECONNREFUSED` already\n * reached.\n *\n * Measured 2026-08-28: `wildo config sync` against a deliberately stopped platform took ~3.5\n * minutes, of which ~120 seconds was this wait — `prepareApplicationEnvTargets` is reached by four\n * target builders, and each burned the full 30-second deadline before giving up. The command then\n * degraded to `reconstructBootstrapCredentialsOffline` exactly as designed, so the two minutes\n * bought nothing: the offline path was always going to be taken. Running `config sync` with the\n * platform down is not an error state — it is how an operator regenerates env files between\n * sessions.\n *\n * Process-scoped rather than per-call, because the point is whether THIS run ever established that\n * a platform is there. A stale value cannot outlive the command.\n */\nlet appsManagerAnsweredThisRun = false;\n\n/**\n * Record that apps-manager has been OBSERVED reachable in this process.\n *\n * Called by `waitForAppsManagerReady` as well as by every successful fetch here, and the readiness\n * barrier is the reason this is exported rather than private. The reconnect window exists for the\n * gap that barrier itself documents — apps-manager \"can pass readiness and then crash\" before the\n * registration POST lands — so the very case the retry is FOR is one where the only proof the\n * platform was up came from a probe that never went through `fetchWithReconnect`. Keying the skip\n * solely on this module's own successes would therefore have removed the retry from the one window\n * it was written for, and the pinned crash/respawn test caught exactly that.\n */\nexport function markAppsManagerObservedReachable(): void {\n appsManagerAnsweredThisRun = true;\n}\n\n/**\n * Why a deploy-artifact build could not reach a usable apps-manager (issue #279).\n *\n * A closed vocabulary with a named home, because the two REACHABLE-but-unusable cases mean\n * opposite things to a creator and the old code could tell neither: it reported both as\n * \"Failed to prepare application deploy artifacts: … Check PLATFORM_ADMIN_SECRET\", which is the\n * wrong remedy for both.\n */\nexport enum AppsManagerUnavailableReason {\n /** Nothing answered: no platform is running for this application yet — the fresh-creator case. */\n PLATFORM_NOT_RUNNING = 'PLATFORM_NOT_RUNNING',\n /**\n * Something answered and refused our credentials. On a shared development host this is very\n * rarely a wrong secret: it is ANOTHER application's platform occupying the port.\n */\n PLATFORM_NOT_OURS = 'PLATFORM_NOT_OURS',\n}\n\n/**\n * Classify a deploy-artifact failure, or `null` when it is neither of the known benign shapes.\n *\n * `null` is the important return: a genuine defect must keep failing the command. Only the two\n * cases a first-time creator legitimately hits are skippable, and they are skippable because the\n * artifacts that step produces are CI deploy inputs under `.wildo-saas/deploy/` — nothing\n * `wildo local up` needs, which is why the phase's other outputs (compose, env files, provider\n * runtime) are complete and correct without them.\n */\nexport function classifyAppsManagerUnavailable(error: unknown): AppsManagerUnavailableReason | null {\n const message = error instanceof Error ? error.message : String(error ?? '');\n // 401/403 — `requestJson` names this exactly, and it is the only place that phrasing is produced.\n if (message.includes('rejected bootstrap authentication')) return AppsManagerUnavailableReason.PLATFORM_NOT_OURS;\n\n // Connection-shaped failures. `fetch` wraps the cause, so the code can sit one or two levels down.\n const codes: string[] = [];\n let cursor: unknown = error;\n for (let depth = 0; depth < 4 && cursor instanceof Error; depth += 1) {\n const code = (cursor as NodeJS.ErrnoException).code;\n if (typeof code === 'string') codes.push(code);\n if ((cursor as Error).name) codes.push((cursor as Error).name);\n cursor = (cursor as { cause?: unknown }).cause;\n }\n const connectionShaped = ['ECONNREFUSED', 'ENOTFOUND', 'ECONNRESET', 'EHOSTUNREACH', 'ETIMEDOUT', 'AbortError', 'TimeoutError'];\n if (codes.some((code) => connectionShaped.includes(code))) return AppsManagerUnavailableReason.PLATFORM_NOT_RUNNING;\n if (/fetch failed|ECONNREFUSED|timed? out|was aborted/i.test(message)) return AppsManagerUnavailableReason.PLATFORM_NOT_RUNNING;\n\n return null;\n}\n\n/**\n * Progress for a wait a human is sitting through. stderr, not stdout: callers parse stdout, and a\n * silent multi-second stall is exactly what made this cost so long to explain.\n */\nfunction reportAppsManagerWait(message: string): void {\n process.stderr.write(` ${message}\\n`);\n}\n\n/**\n * Coerce a service key (e.g. `backendApi`) into a K8s-valid port name:\n * lowercase, only `[a-z0-9-]`, no leading/trailing `-`, ≤15 chars (the\n * IANA/K8s `IS_DNS1123_LABEL`-for-ports limit). `backendApi` → `backend-api`.\n * Empty/degenerate input falls back to `port`.\n */\nfunction toK8sPortName(raw: string): string {\n const kebab = raw\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n const trimmed = kebab.slice(0, 15).replace(/-+$/g, '');\n if (trimmed.length === 0) return 'port';\n // K8s port names are IANA_SVC_NAME — they MUST contain at least one letter.\n // An all-numeric service key (e.g. '123') would otherwise emit an invalid\n // port name that kubectl rejects; prefix it to guarantee an alpha char.\n if (!/[a-z]/.test(trimmed)) return `p-${trimmed}`.slice(0, 15);\n return trimmed;\n}\n\nfunction buildLocalRuntimeEndpoint(url: string): { publicUrl: string; internalUrl: string } {\n return {\n publicUrl: url,\n internalUrl: url,\n };\n}\n\nfunction resolveRuntimeEnvironment(\n env: PlatformEnvironmentConfiguration,\n config: PlatformEnvConfigJson | null,\n): RuntimeEnvironment {\n if (config?.runtimeEnvironment) {\n return config.runtimeEnvironment;\n }\n\n if (env.runtimeEnvironment) {\n return env.runtimeEnvironment;\n }\n\n throw new Error(\n `Environment '${env.name}' is missing explicit runtime semantics. Set runtimeEnvironment in config.json or in the environment registry before bootstrapping applications.`,\n );\n}\n\nasync function readErrorBody(response: Response): Promise<string> {\n try {\n const body = await response.text();\n return body.trim();\n } catch {\n return '';\n }\n}\n\nexport interface RegisteredApplicationEnvTargetInput {\n env: PlatformEnvironmentConfiguration;\n credentials: PlatformEnvSecretsJson;\n saasRoot: string;\n config?: PlatformEnvConfigJson | null;\n requestedAppSlug?: string | undefined;\n}\n\n/** One authoritative application-registration/credential snapshot used by every runtime projection. */\nexport interface PreparedApplicationEnvTargets {\n runtimeTarget: ResolvedAppRuntimeTarget;\n bootstrapCredentials: AppBootstrapCredentials;\n /**\n * True when apps-manager was UNREACHABLE and the credentials were reconstructed\n * from material already on disk (Step: degraded env generation).\n *\n * Callers MUST surface this. A `.env` that looks current but was written without\n * consulting the control plane is the same \"correct and believed otherwise\"\n * failure as a silent partial sync, pointing the other way — and the one thing a\n * degraded run cannot know is whether apps-manager holds material the runtime\n * does not yet have.\n */\n degraded?: boolean;\n /**\n * Principals that could NOT be regenerated offline, each naming itself and the\n * `.env` it expected. Non-empty only in degraded mode.\n *\n * These are OMITTED from `runtimePrincipalCredentials` rather than faked, so\n * `requireRuntimePrincipalCredentials` still refuses to substitute the\n * application backend's identity for them. The caller reports them; their\n * existing `.env` files are left untouched.\n */\n unresolvedPrincipals?: string[];\n runtimeEndpoints: Record<string, { publicUrl: string; internalUrl: string }>;\n /**\n * The environment resolved during preparation, carried so per-runtime\n * credential fetches reuse it instead of re-deriving.\n *\n * Re-deriving imposed a NEW requirement on callers that construct a target\n * without a fully-populated env — `resolveRuntimeEnvironment` throws rather\n * than defaulting — and a second derivation could in principle disagree with\n * the first, which would fetch a different environment's credentials.\n */\n runtimeEnvironment: RuntimeEnvironment;\n /**\n * Each declared minion's and worker's OWN bootstrap credentials, keyed by\n * `buildRuntimePrincipalKey` (Step 1 / F11).\n *\n * Populated HERE rather than fetched inside the target builders for two\n * reasons. It keeps preparation the single credential-fetch phase — the\n * builders stay pure and a caller that supplies `prepared` needs no network.\n * And it makes the field REQUIRED, so a hand-constructed `prepared` has to\n * state what each runtime holds; an optional map would invite a fallback to\n * the application backend's credentials, which is precisely the collapse this\n * step removes.\n *\n * The application backend is NOT in the map — its credentials are\n * `bootstrapCredentials`.\n */\n runtimePrincipalCredentials: Record<string, AppBootstrapCredentials>;\n}\n\nexport interface ApplicationEnvProjectionInput extends RegisteredApplicationEnvTargetInput {\n /** Supplied by the coordinator so every target family is derived from one logical bootstrap generation. */\n prepared?: PreparedApplicationEnvTargets;\n}\n\nexport class AppBootstrapService {\n /**\n * Service keys (`config.services.<key>`) of the app's frontends that are\n * CDN-served in this environment — authored `cdn?[key].enabled === true` in\n * `wildo.infra.<env>.config.ts`.\n *\n * A CDN-served frontend is served OFF-CLUSTER (its public host resolves via\n * DNS to a CDN edge fronting an object-storage bucket), so it is dropped from\n * BOTH the per-frontend nginx Deployment/Service\n * ({@link buildApplicationFrontendDeployTargets}) AND the ingress / compose\n * route ({@link buildApplicationIngressRoutes}). It is deliberately KEPT in\n * {@link buildRuntimeEndpoints} so `runtime.endPoints.publicUrl` still\n * advertises `<serviceHost>.<publicDomain>` — the browser gets the same URL,\n * it just resolves to the CDN. This advertised-but-not-ingress-routed\n * asymmetry IS the CDN opt-in: the coherence invariant relaxes from \"every\n * advertised host is routed by the ingress\" to \"…routed by the ingress OR\n * served by a CDN\". Maintained by construction here (ingress/deploy frontends\n * = all frontends − these keys; endpoints = all frontends).\n *\n * Keys on `enabled === true`, NOT mere presence, so an authored-but-disabled\n * entry falls back to normal nginx-pod serving (never silently drops a route).\n */\n private static cdnFrontendKeys(env: PlatformEnvironmentConfiguration): ReadonlySet<string> {\n return new Set(\n Object.entries(env.cdn ?? {})\n .filter(([, cdnConfig]) => cdnConfig.enabled)\n .map(([serviceKey]) => serviceKey),\n );\n }\n\n private static buildRuntimeEndpoints(\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>,\n env: PlatformEnvironmentConfiguration,\n ): Record<string, { publicUrl: string; internalUrl: string }> {\n const primaryBackend =\n runtimeTarget.backendServices.find((backend) => backend.key === 'backendApi') ??\n runtimeTarget.backendServices[0];\n const primaryBackendPort = primaryBackend?.defaultPort;\n // Public frontends with the endpoints map key (`serviceName`) DECOUPLED from\n // the serviceHosts resolution key (`.key` = `config.services.<key>`). Keying\n // hosts on `serviceName` silently ignores authored `serviceHosts` (the\n // serviceName `wonder-todos-app` misses the authored `app` entry) and\n // diverges from the apps-manager ingress. See the domain plan.\n const publicFrontends = runtimeTarget.frontendServices.flatMap((frontend) =>\n frontend.defaultPort\n ? [{ serviceName: frontend.serviceName, serviceKey: frontend.key, port: frontend.defaultPort }]\n : [],\n );\n const frontendApplicationPorts = Object.fromEntries(\n publicFrontends.map((frontend) => [frontend.serviceName, frontend.port]),\n );\n const websiteFrontend = runtimeTarget.frontendServices.find(\n (frontend) => frontend.frontendType === AppFrontendType.STATIC_WEBSITE,\n );\n const docsFrontend = runtimeTarget.frontendServices.find(\n (frontend) => frontend.frontendType === AppFrontendType.TECH_DOC,\n );\n\n // Remote Kubernetes: serviceHosts-driven public subdomains of the operator's\n // OWN publicDomain (greenfield — no `{svc}-{slug}-{env}` fan-out); internal\n // URLs are the app's cluster-DNS Service. Local dev + compose stay on\n // localhost. See `.claude/plans/self-host-domain-subdomain-model.md`.\n const namespace = env.kubernetes?.namespace;\n if (\n env.runtime === WildoDeploymentRuntime.KUBERNETES &&\n env.locationType === WildoLocationType.REMOTE &&\n namespace\n ) {\n const runtimeEndpoints = buildK8sApplicationRuntimeEndpoints({\n publicDomain: env.publicDomain,\n namespace,\n serviceHosts: env.serviceHosts,\n appServiceName: runtimeTarget.appSlug,\n frontends: publicFrontends,\n websiteServiceKey: websiteFrontend?.key,\n technicalDocumentationServiceKey: docsFrontend?.key,\n mainBackendApiServiceKey: primaryBackend?.key,\n mainBackendApiPort: primaryBackendPort,\n });\n // Secondary backends ride the same app Service on their own port; the\n // dev companion is a local-only concept (omitted remotely).\n for (const backendService of runtimeTarget.backendServices) {\n if (!backendService.defaultPort) {\n continue;\n }\n const url = buildK8sInternalUrl(runtimeTarget.appSlug, backendService.defaultPort, namespace);\n runtimeEndpoints[backendService.serviceName] = { publicUrl: url, internalUrl: url };\n }\n return runtimeEndpoints;\n }\n\n // Remote Docker Compose: SAME serviceHosts-driven public subdomains as k8s\n // (so the Traefik ingress routes and `runtime.endPoints.publicUrl` agree —\n // the CORS invariant holds for compose too); internal URLs are the app\n // container's own name on the shared compose network. Must NOT fall through\n // to the localhost branch below, which would advertise localhost topology\n // for a remotely-served app.\n if (env.runtime === WildoDeploymentRuntime.DOCKER_COMPOSE && env.locationType === WildoLocationType.REMOTE) {\n const runtimeEndpoints = buildComposeApplicationRuntimeEndpoints({\n publicDomain: env.publicDomain,\n serviceHosts: env.serviceHosts,\n appServiceName: runtimeTarget.appSlug,\n frontends: publicFrontends,\n websiteServiceKey: websiteFrontend?.key,\n technicalDocumentationServiceKey: docsFrontend?.key,\n mainBackendApiServiceKey: primaryBackend?.key,\n mainBackendApiPort: primaryBackendPort,\n });\n // Secondary backends reachable at their own port on the app container\n // (`http://<appSlug>:<port>` on the shared compose network). No dev\n // companion remotely.\n for (const backendService of runtimeTarget.backendServices) {\n if (!backendService.defaultPort) {\n continue;\n }\n const url = `http://${runtimeTarget.appSlug}:${backendService.defaultPort}`;\n runtimeEndpoints[backendService.serviceName] = { publicUrl: url, internalUrl: url };\n }\n return runtimeEndpoints;\n }\n\n const runtimeEndpoints = buildLocalhostApplicationRuntimeEndpoints({\n mainBackendApiPort: primaryBackendPort,\n frontendApplicationPorts,\n websitePort: websiteFrontend?.defaultPort,\n });\n for (const backendService of runtimeTarget.backendServices) {\n if (!backendService.defaultPort) {\n continue;\n }\n\n runtimeEndpoints[backendService.serviceName] = buildLocalRuntimeEndpoint(\n `http://localhost:${backendService.defaultPort}`,\n );\n }\n if (runtimeTarget.localServiceAddresses?.devCompanion?.url) {\n runtimeEndpoints[`${runtimeTarget.appSlug}-dev-companion`] = buildLocalRuntimeEndpoint(\n runtimeTarget.localServiceAddresses.devCompanion.url,\n );\n }\n\n return runtimeEndpoints;\n }\n\n /**\n * serviceHosts-driven ingress routes for the app's public services — the\n * per-app deploy context shared by the k8s ingress + the compose Traefik lane\n * (`buildK8sApplicationIngressRoutes`, runtime-agnostic host→port). Remote\n * only; local has no reverse proxy. Coherent with the runtime endpoints\n * (same resolver + topology).\n */\n private static buildApplicationIngressRoutes(\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>,\n env: PlatformEnvironmentConfiguration,\n ): K8sIngressRoute[] {\n if (env.locationType !== WildoLocationType.REMOTE) {\n return [];\n }\n const primaryBackend =\n runtimeTarget.backendServices.find((backend) => backend.key === 'backendApi') ??\n runtimeTarget.backendServices[0];\n // Host resolution keys on `.key` (config.services key), NOT serviceName —\n // matches the runtime endpoints + the operator's authored serviceHosts.\n // CDN-served frontends are EXCLUDED: their public host is served off-cluster\n // by the CDN, so no ingress rule (k8s) / Traefik router (compose) is emitted\n // for them — while they stay in `buildRuntimeEndpoints` (advertised host\n // preserved). See {@link cdnFrontendKeys}.\n const cdnKeys = AppBootstrapService.cdnFrontendKeys(env);\n const publicFrontends = runtimeTarget.frontendServices.flatMap((frontend) =>\n frontend.defaultPort && !cdnKeys.has(frontend.key)\n ? [{ serviceName: frontend.serviceName, serviceKey: frontend.key, port: frontend.defaultPort }]\n : [],\n );\n return buildK8sApplicationIngressRoutes({\n publicDomain: env.publicDomain,\n serviceHosts: env.serviceHosts,\n frontends: publicFrontends,\n mainBackendApiServiceKey: primaryBackend?.key,\n // Per-service model: the api host routes to the backend's OWN k8s Service\n // (its serviceName), not a shared app Service.\n mainBackendApiServiceName: primaryBackend?.serviceName,\n mainBackendApiPort: primaryBackend?.defaultPort,\n });\n }\n\n /**\n * Derive the BACKEND pod's container/Service ports (per-service deploy model),\n * per-app from the authored `services.<backendKey>.defaultPort`:\n * - the primary backend on `mainBackendApiPort`;\n * - its internal-only API siblings `health`/`webhook`/`oauth`/`mcp` =\n * `mainBackendApiPort - 1..-4`.\n * Frontends are NOT here — each is its own nginx Deployment/Service (see\n * `buildApplicationFrontendDeployTargets`). The internal siblings MUST be\n * Service-exposed: other in-cluster pods reach them via cluster-DNS on those\n * ports (their `internalUrl`). `healthPort` (`mainBackendApiPort - 1`) drives\n * the backend's k8s liveness/readiness probes. Remote only (local has no app\n * k8s deploy).\n *\n * Ports are de-duplicated by number and carry K8s-valid names (see\n * {@link toK8sPortName}); a name collision after sanitisation is disambiguated\n * with a numeric suffix so the emitted Service is always valid.\n */\n private static buildBackendPodPorts(\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>,\n env: PlatformEnvironmentConfiguration,\n ): { podPorts: K8sPodPort[]; healthPort: number | undefined } {\n if (env.locationType !== WildoLocationType.REMOTE) {\n return { podPorts: [], healthPort: undefined };\n }\n const primaryBackend =\n runtimeTarget.backendServices.find((backend) => backend.key === 'backendApi') ??\n runtimeTarget.backendServices[0];\n const backendPort = primaryBackend?.defaultPort;\n\n const seenPorts = new Set<number>();\n const usedNames = new Set<string>();\n const podPorts: K8sPodPort[] = [];\n const add = (rawName: string, containerPort: number | undefined): void => {\n if (containerPort === undefined || seenPorts.has(containerPort)) return;\n seenPorts.add(containerPort);\n let name = toK8sPortName(rawName);\n if (usedNames.has(name)) {\n // Disambiguate on a collision. Truncate the base to leave room for the\n // `-NN` suffix WITHIN the 15-char K8s port-name cap — appending the\n // suffix through `toK8sPortName` again would just re-truncate it back to\n // the colliding base and spin forever. Result stays ≤15 chars.\n const base = name.slice(0, 12).replace(/-+$/g, '');\n let suffix = 2;\n while (suffix < 100 && usedNames.has(`${base}-${suffix}`)) suffix += 1;\n name = `${base}-${suffix}`;\n }\n usedNames.add(name);\n podPorts.push({ name, containerPort });\n };\n\n // Per-service model: the BACKEND pod exposes ONLY the primary backend's\n // ports — its API + internal-only siblings (health/webhook/oauth/mcp), all\n // bound by the one Node process. Frontends are SEPARATE nginx Deployments\n // (see `buildApplicationFrontendDeployTargets`), so their ports are NOT\n // folded into this pod. (Non-primary backend services, if any, would become\n // their own Deployments — a multi-backend follow-up; wonder-todos has one.)\n if (backendPort !== undefined) {\n add('backend', backendPort);\n add('health', backendPort - 1);\n add('webhook', backendPort - 2);\n add('oauth', backendPort - 3);\n add('mcp', backendPort - 4);\n }\n\n return { podPorts, healthPort: backendPort !== undefined ? backendPort - 1 : undefined };\n }\n\n /**\n * The app's public frontends as per-service k8s deploy targets — each becomes\n * its OWN nginx Deployment + Service. `serviceName` is both the k8s object name\n * and the built image name (`{registry}/{serviceName}:{tag}`); `port` is the\n * authored `defaultPort` the frontend Service exposes (forwarded to nginx :80).\n * Frontends without a `defaultPort` are non-served (skipped). CDN-served\n * frontends are ALSO skipped — they get no nginx pod at all (served\n * off-cluster; see {@link cdnFrontendKeys}). Remote only.\n */\n private static buildApplicationFrontendDeployTargets(\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>,\n env: PlatformEnvironmentConfiguration,\n ): Array<{\n serviceName: string;\n port: number;\n isolation: { runAsUser: number; runAsGroup: number; writablePaths: string[] };\n }> {\n if (env.locationType !== WildoLocationType.REMOTE) {\n return [];\n }\n const cdnKeys = AppBootstrapService.cdnFrontendKeys(env);\n return runtimeTarget.frontendServices.flatMap((frontend) =>\n frontend.defaultPort && !cdnKeys.has(frontend.key)\n ? [{\n serviceName: frontend.serviceName,\n port: frontend.defaultPort,\n // Already resolved at the config boundary — passed through, never\n // re-derived, so the k8s and compose lanes cannot disagree.\n isolation: {\n runAsUser: frontend.isolation.runAsUser,\n runAsGroup: frontend.isolation.runAsGroup,\n writablePaths: [...frontend.isolation.writablePaths],\n },\n }]\n : [],\n );\n }\n\n /**\n * Read a runtime's ALREADY-GENERATED `.env` for the one value that cannot be\n * derived offline: its bootstrap secret.\n *\n * Returns `null` when the file does not exist or carries no secret — which is\n * exactly the FIRST-RUN case, and the case that must NOT be papered over: a\n * runtime apps-manager has never registered has no Redis ACL user, no RabbitMQ\n * user and no database role either, so inventing an env for it would produce a\n * runtime that boots and is refused by every backing service.\n */\n private static readPersistedBootstrapSecret(envFilePath: string): string | null {\n if (!existsSync(envFilePath)) return null;\n for (const line of readFileSync(envFilePath, 'utf8').split('\\n')) {\n const match = line.match(/^PLATFORM_APPLICATION_PRIMARY_SECRET=(.+)$/);\n if (match) {\n const value = match[1]!.trim().replace(/^[\"']|[\"']$/g, '');\n return value.length > 0 ? value : null;\n }\n }\n return null;\n }\n\n /**\n * Rebuild {@link AppBootstrapCredentials} WITHOUT contacting apps-manager.\n *\n * Only ONE of the four fields is a secret. `APPLICATION_ID` is already persisted\n * by `saveApplicationRuntimeIdentity` for exactly this reason — the offline\n * compose renders depend on it — and the apps-manager URL and environment are\n * local configuration. So a degraded regeneration reuses the secret the runtime\n * already holds and derives the rest, which is precisely what apps-manager would\n * have returned: it PRESERVES an existing principal's secret rather than\n * re-minting, because rotating it would break a running runtime.\n *\n * `null` means the material is not on disk. The caller must then fail for THAT\n * runtime and say so, rather than degrade the whole sync.\n */\n private static reconstructBootstrapCredentialsOffline(input: {\n envName: string;\n appSlug: string;\n runtimeEnvironment: RuntimeEnvironment;\n appsManagerUrl: string;\n envFilePath: string;\n }): AppBootstrapCredentials | null {\n const primarySecret = AppBootstrapService.readPersistedBootstrapSecret(input.envFilePath);\n const applicationId = EnvironmentUtils.loadApplicationRuntimeIdentity(input.envName)?.[input.appSlug]?.applicationId;\n if (!primarySecret || !applicationId) return null;\n return buildAppBootstrapCredentialsResponse({\n appSlug: input.appSlug,\n applicationId,\n primarySecret,\n appsManagerUrl: input.appsManagerUrl,\n environment: input.runtimeEnvironment,\n }).credentials;\n }\n\n /**\n * True only for a CONNECTION-level failure — apps-manager not listening.\n *\n * Deliberately NOT true for an HTTP error response or a timeout. A 4xx/5xx means\n * apps-manager IS running and rejected the request (bad admin secret, invalid\n * declaration); degrading there would hide a real error behind a reassuring\n * warning. A timeout is ambiguous and is left fatal for the same reason.\n */\n private static isAppsManagerUnreachable(error: unknown): boolean {\n return /Unable to reach apps-manager/.test(ErrorUtils.extractErrorMessage(error));\n }\n\n /**\n * Rebuild EVERY declared principal's credentials offline (Step: degraded env).\n *\n * A minion's or worker's secret is its OWN — that is the entire point of Step 1,\n * which replaced one shared `PLATFORM_APPLICATION_PRIMARY_SECRET` per application\n * with one per runtime. So each principal's value is read from ITS OWN `.env`,\n * located through the same `saasConfig.{minions,workers}.<name>.path` the target\n * builders already use.\n *\n * ⚠️ There is deliberately NO fallback to the application-level secret. Reusing\n * it here would make every runtime present the same identity at the apps-manager\n * door — precisely the F11 collapse Step 1 exists to have removed — and it would\n * do so silently, in a code path whose whole purpose is to be reassuring. A\n * principal whose own secret is not on disk THROWS, naming itself.\n */\n private static async reconstructRuntimePrincipalCredentialsOffline(input: {\n envName: string;\n runtimeTarget: ResolvedAppRuntimeTarget;\n runtimeEnvironment: RuntimeEnvironment;\n appsManagerUrl: string;\n }): Promise<{ credentials: Record<string, AppBootstrapCredentials>; unresolved: string[] }> {\n const saasConfig = await loadConfig<{\n minions?: Record<string, { path: string }>;\n workers?: Record<string, { path: string }>;\n }>(input.runtimeTarget.saasConfigPath);\n\n const entries: Array<readonly [string, AppBootstrapCredentials]> = [];\n const unresolved: string[] = [];\n for (const principal of enumerateDeclaredRuntimePrincipals(input.runtimeTarget.managedDeclaration)\n .filter((candidate) => candidate.kind !== ApplicationRuntimePrincipalKind.APPLICATION_BACKEND)) {\n const name = principal.name ?? '';\n const relativePath = principal.kind === ApplicationRuntimePrincipalKind.MINION\n ? saasConfig.minions?.[name]?.path\n : saasConfig.workers?.[name]?.path;\n const credentials = relativePath\n ? AppBootstrapService.reconstructBootstrapCredentialsOffline({\n envName: input.envName,\n appSlug: input.runtimeTarget.appSlug,\n runtimeEnvironment: input.runtimeEnvironment,\n appsManagerUrl: input.appsManagerUrl,\n envFilePath: join(input.runtimeTarget.appRoot, relativePath, '.env'),\n })\n : null;\n if (!credentials) {\n // Per-runtime granularity: this principal cannot be regenerated offline,\n // but the OTHERS can. Omitting it from the map (rather than throwing)\n // leaves its existing `.env` untouched and lets every other runtime be\n // written — and the omission is REPORTED, not silent, by the caller.\n //\n // Omission is the safe representation: `requireRuntimePrincipalCredentials`\n // refuses to substitute the application backend's identity for a missing\n // entry, so a skipped principal can never end up with the wrong secret.\n unresolved.push(\n `${principal.kind}:${name}`\n + `${relativePath ? ` (expected ${join(relativePath, '.env')})` : ' (no declared path)'}`,\n );\n continue;\n }\n entries.push([buildRuntimePrincipalKey(principal), credentials] as const);\n }\n return { credentials: Object.fromEntries(entries), unresolved };\n }\n\n static async prepareApplicationEnvTargets(\n input: RegisteredApplicationEnvTargetInput,\n ): Promise<PreparedApplicationEnvTargets | null> {\n const runtimeTarget = await AppBootstrapService.resolveRuntimeTarget(input);\n if (!runtimeTarget) {\n return null;\n }\n\n await AppBootstrapService.validateFirstAdminSeedAgainstBackendConfig(runtimeTarget);\n\n if (runtimeTarget.backendServices.length === 0) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' has no backend services to prepare. Check wildo.saas.config.ts service definitions.`,\n );\n }\n\n const config = input.config ?? EnvironmentUtils.loadConfigJson(input.env.name);\n if (!config) {\n throw new Error(`No config for '${input.env.name}'. Run 'wildo config sync' to generate config.json.`);\n }\n\n const runtimeEnvironment = resolveRuntimeEnvironment(input.env, config);\n\n /**\n * ## Breaking the provisioning ↔ schema cycle\n *\n * An application whose own resources persist to PostgreSQL cannot be seeded before its schema\n * exists, and its schema is produced by migration artifacts that only the tooling can read. So\n * provisioning runs in TWO phases with the schema apply between them:\n *\n * 1. register with `DEFERRED` — infrastructure, credentials and platform records; no app rows;\n * 2. apply the application's migrations through the shared runner;\n * 3. register again (idempotent, `REQUIRED`) — now the bootstrap rows land.\n *\n * Phase 3 is a full re-invocation rather than a narrow seed call ON PURPOSE: provisioning also\n * issues the per-role GRANTs, and a grant can only be issued on a table that exists. Running the\n * whole provision after the migrations is what gives every confined role (minions, workers) its\n * grants on the tables the migrations just created — a seed-only endpoint would have left them\n * ungranted and moved the failure into the first minion boot.\n *\n * MongoDB is untouched: no migrations directory means one phase, exactly as before.\n */\n /**\n * From the ALREADY-LOADED config.json rather than the registry record: `applicationDatabase` is\n * deliberately not round-tripped through `environments.json`, because nothing reads it off that\n * cache — see the note in `hydrateEnvironmentFromConfig` about fields the registry does not own.\n *\n * Hoisted to a local so BOTH provisioning phases send the identical declaration. Recomputing it\n * for the second call would be two spellings of one value, and a divergence would land on the\n * provisioner as a database rename mid-provision.\n */\n const applicationDatabaseDeclaration = config.applicationDatabase\n ? {\n ...config.applicationDatabase,\n // The SAME authored value `env-vars-builder` emits as `POSTGRESQL_DATABASE`, so the\n // database the backend connects to and the one the provisioner creates are one name\n // from one source.\n databaseName: config.backingServices?.postgresql?.database,\n }\n : undefined;\n\n /**\n * Two-phase provisioning applies only when a PostgreSQL schema must exist before the application\n * can be seeded — see {@link resolveAppSchemaMigrationsDirectory} for why the ENGINE, and not\n * merely the presence of the migrations directory, is half of that question.\n */\n const usesTwoPhaseProvisioning = AppBootstrapService.resolveAppSchemaMigrationsDirectory(\n runtimeTarget,\n applicationDatabaseDeclaration,\n ) !== undefined;\n\n let bootstrapResponse: { credentials: AppBootstrapCredentials };\n let degraded = false;\n try {\n const firstPhaseOutcome = await AppBootstrapService.ensureApplicationRegistered(input.env, input.credentials, {\n appSlug: runtimeTarget.appSlug,\n appDisplayName: runtimeTarget.appDisplayName,\n appDatabaseName: runtimeTarget.appDatabaseName,\n managedDeclaration: runtimeTarget.managedDeclaration,\n applicationDatabase: applicationDatabaseDeclaration,\n firstAdminSeed: runtimeTarget.firstAdminSeed,\n appDatabaseSeeding: usesTwoPhaseProvisioning\n ? AppDatabaseSeedingPhase.DEFERRED\n : AppDatabaseSeedingPhase.REQUIRED,\n });\n\n if (usesTwoPhaseProvisioning) {\n await AppBootstrapService.completeDeferredAppDatabaseSeeding({\n env: input.env,\n credentials: input.credentials,\n runtimeTarget,\n applicationDatabase: applicationDatabaseDeclaration,\n firstPhaseOutcome,\n });\n }\n\n bootstrapResponse = await AppBootstrapService.fetchBootstrapCredentials(\n input.env,\n input.credentials,\n {\n appSlug: runtimeTarget.appSlug,\n runtimeEnvironment,\n },\n );\n } catch (error) {\n // Degrade ONLY when apps-manager is not listening, and ONLY when the\n // material is already on disk. Every other failure — an HTTP rejection, a\n // timeout, a first run with no persisted secret — stays fatal, because\n // degrading there would either hide a real error or fabricate an identity\n // no backing service recognises.\n if (!AppBootstrapService.isAppsManagerUnreachable(error)) throw error;\n const authoritativeBackend = AppBootstrapService.resolveAuthoritativeBackendTarget(runtimeTarget);\n const offline = authoritativeBackend\n ? AppBootstrapService.reconstructBootstrapCredentialsOffline({\n envName: input.env.name,\n appSlug: runtimeTarget.appSlug,\n runtimeEnvironment,\n appsManagerUrl: AppBootstrapService.getAppsManagerBaseUrl(input.env),\n // `path` is app-root-relative; the runtime target carries the root.\n envFilePath: join(runtimeTarget.appRoot, authoritativeBackend.path, '.env'),\n })\n : null;\n if (!offline) throw error;\n degraded = true;\n bootstrapResponse = { credentials: offline };\n }\n\n // Persist the apps-manager-minted APPLICATION_ID (a Mongo `_id`, NOT\n // derivable offline from the slug) so the OFFLINE docker-compose render\n // paths — `wildo config sync --domain manifest` (which re-renders the\n // compose file LAST in a full sync) and the `wildo local up` self-heal —\n // can bake the correct per-app `APPLICATION_ID` literal into each\n // minion/worker service without re-contacting apps-manager. This method is\n // the single credential-fetch choke point (every app-target builder funnels\n // through it), so one write here keeps the persisted identity fresh for\n // every render flow.\n EnvironmentUtils.saveApplicationRuntimeIdentity(\n input.env.name,\n runtimeTarget.appSlug,\n bootstrapResponse.credentials.APPLICATION_ID,\n );\n\n // The THIRD apps-manager call site, and the one the first draft missed: it sat\n // inside the return expression, outside the try above. Degrading two of three\n // calls moved the failure one step later rather than removing it.\n let runtimePrincipalCredentials: Record<string, AppBootstrapCredentials>;\n let unresolvedPrincipals: string[] = [];\n try {\n runtimePrincipalCredentials = await AppBootstrapService.fetchDeclaredRuntimePrincipalCredentials(\n input,\n runtimeTarget,\n runtimeEnvironment,\n );\n } catch (error) {\n if (!AppBootstrapService.isAppsManagerUnreachable(error)) throw error;\n const offlinePrincipals = await AppBootstrapService.reconstructRuntimePrincipalCredentialsOffline({\n envName: input.env.name,\n runtimeTarget,\n runtimeEnvironment,\n appsManagerUrl: AppBootstrapService.getAppsManagerBaseUrl(input.env),\n });\n runtimePrincipalCredentials = offlinePrincipals.credentials;\n unresolvedPrincipals = offlinePrincipals.unresolved;\n degraded = true;\n\n // Report ALL unresolved principals at once, then fail.\n //\n // Why fail rather than skip: a skipped runtime would be SILENT here — this\n // service has no logger, and the sync command does not hold `prepared`, so\n // nothing would tell the operator that one runtime's `.env` was left stale.\n // Shipping a silent skip would trade a loud failure for exactly the\n // \"correct and believed otherwise\" defect this whole change exists to\n // remove. Granular WRITING is worth having, but only once the skip can be\n // reported — see the note in the plan; the mechanism is the existing\n // `input.prepared` passthrough, which lets the sync command prepare once\n // and read `unresolvedPrincipals` itself.\n //\n // What IS improved: every unresolved principal is named in one message\n // instead of failing on the first, so one run tells the operator the whole\n // list rather than one name per re-run.\n if (unresolvedPrincipals.length > 0) {\n throw new Error(\n `Cannot regenerate env files without apps-manager. `\n + `${unresolvedPrincipals.length} runtime principal(s) have no existing secret on disk:\\n`\n + unresolvedPrincipals.map((entry) => ` - ${entry}`).join('\\n')\n + `\\nA runtime apps-manager has never registered also has no Redis ACL user, no broker `\n + `user and no database role, so its env cannot be produced offline. Every OTHER runtime `\n + `could be regenerated — start apps-manager and re-run to write them all.`,\n );\n }\n }\n\n return {\n runtimeTarget,\n degraded,\n bootstrapCredentials: bootstrapResponse.credentials,\n runtimeEndpoints: AppBootstrapService.buildRuntimeEndpoints(runtimeTarget, input.env),\n runtimeEnvironment,\n runtimePrincipalCredentials,\n unresolvedPrincipals,\n };\n }\n\n private static resolveAuthoritativeBackendTarget(\n runtimeTarget: Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>,\n ) {\n if (!runtimeTarget || runtimeTarget.backendServices.length === 0) {\n return null;\n }\n\n return runtimeTarget.backendServices.find((service) => service.key === 'backendApi')\n ?? runtimeTarget.backendServices[0]\n ?? null;\n }\n\n private static resolveAuthoritativeBackendConfigPath(\n runtimeTarget: Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>,\n ): string | null {\n const backendTarget = AppBootstrapService.resolveAuthoritativeBackendTarget(runtimeTarget);\n if (!backendTarget || !runtimeTarget) {\n return null;\n }\n\n const candidatePaths = [\n resolve(runtimeTarget.appRoot, backendTarget.path, 'src', 'saas-config.backend.ts'),\n resolve(runtimeTarget.appRoot, backendTarget.path, 'src', 'config', 'app-config.backend.ts'),\n ];\n\n return candidatePaths.find((candidatePath) => existsSync(candidatePath)) ?? candidatePaths[0]!;\n }\n\n private static async validateFirstAdminSeedAgainstBackendConfig(\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>,\n ): Promise<void> {\n const projectedUserTypes = runtimeTarget.firstAdminSeed?.userTypes;\n if (!projectedUserTypes || projectedUserTypes.length === 0) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' is missing bootstrap.firstAdmin.userTypes in '${runtimeTarget.saasConfigPath}'. `\n + 'Declare the first-admin bootstrap seed before running bootstrap, sync, reinit, or dev start.',\n );\n }\n\n const authoritativeBackend = AppBootstrapService.resolveAuthoritativeBackendTarget(runtimeTarget);\n if (!authoritativeBackend) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' declares bootstrap.firstAdmin.userTypes but has no backend service to validate against.`,\n );\n }\n\n const backendConfigPath = AppBootstrapService.resolveAuthoritativeBackendConfigPath(runtimeTarget);\n if (!backendConfigPath || !existsSync(backendConfigPath)) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' declares bootstrap.firstAdmin.userTypes, but the authoritative backend config was not found at '${backendConfigPath ?? 'unknown'}' for service '${authoritativeBackend.serviceName}'.`,\n );\n }\n\n const backendConfig = await loadConfig<AppConfiguration_BackendAuthored>(backendConfigPath);\n const declaredBackendUserTypes = new Set(Object.keys(backendConfig.userTypes ?? {}));\n const unknownUserTypes = projectedUserTypes.filter((userType) => !declaredBackendUserTypes.has(userType));\n\n if (unknownUserTypes.length > 0) {\n throw new Error(\n `Invalid bootstrap.firstAdmin.userTypes for application '${runtimeTarget.appSlug}': `\n + `[${unknownUserTypes.join(', ')}] not found in backend config '${backendConfigPath}'. `\n + `Declared backend userTypes: [${[...declaredBackendUserTypes].join(', ')}].`,\n );\n }\n }\n\n /**\n * A target's directory as a path relative to ITS application root — the anchor every env writer\n * joins it back onto (see `ApplicationRuntimeTargetAnchor`). Refuses a service path that escapes\n * the application: a `wildo.saas.config.ts` naming `../elsewhere` would otherwise have the CLI\n * write a `.env` into a directory the application does not own.\n */\n private static relativeToApplicationRoot(applicationRoot: string, targetDirectory: string, subject: string): string {\n const relativeDir = relative(resolve(applicationRoot), resolve(targetDirectory));\n if (relativeDir.startsWith('..') || isAbsolute(relativeDir)) {\n throw new Error(`${subject} is outside the application root and cannot receive generated .env files.`);\n }\n return relativeDir;\n }\n\n private static async resolveRuntimeTarget(input: {\n saasRoot: string;\n requestedAppSlug?: string | undefined;\n }) {\n return AppRuntimeTargetsService.resolve(input.saasRoot, input.requestedAppSlug);\n }\n\n private static getAppsManagerBaseUrl(env: PlatformEnvironmentConfiguration): string {\n const addressContext = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.HOST_FACING);\n const addresses = ServiceAddressResolver.resolve(addressContext);\n return `${addresses.platform.appsManager.url}${APPS_MANAGER_API_PREFIX}`;\n }\n\n private static getAdminSecret(credentials: PlatformEnvSecretsJson): string {\n return credentials.platform.adminSecret;\n }\n\n /**\n * Bounded, silent poll of apps-manager's own `/health/ready` (unversioned —\n * outside `APPS_MANAGER_API_PREFIX`, mirroring `waitForServiceReady` in\n * `platform-lifecycle.service.ts`). Used ONLY to ride out the crash/respawn\n * window documented on {@link APPS_MANAGER_RECONNECT_ATTEMPTS}; not a\n * general-purpose readiness wait — `wildo local dev`'s own platform-readiness\n * barrier already owns that responsibility before this service is entered.\n */\n /**\n * One reconnect PROBE, inside the poll loop.\n *\n * Short on purpose, and shorter than the loop's own budget: the caller already owns \"how long do\n * we wait for apps-manager\" through `APPS_MANAGER_RECONNECT_WAIT_MS`, so a probe that lingers\n * only eats that budget in one bite instead of polling with it. 5s is enough for a service on\n * this machine to answer a readiness route, and a probe that cannot is not ready.\n */\n private static readonly APPS_MANAGER_PROBE_TIMEOUT_MS = 5_000;\n\n private static async waitForAppsManagerReconnect(env: PlatformEnvironmentConfiguration): Promise<boolean> {\n const addressContext = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.HOST_FACING);\n const addresses = ServiceAddressResolver.resolve(addressContext);\n const readyUrl = `${addresses.platform.appsManager.url.replace(/\\/$/, '')}/health/ready`;\n\n const deadline = Date.now() + APPS_MANAGER_RECONNECT_WAIT_MS;\n while (Date.now() < deadline) {\n try {\n const probe = await fetch(readyUrl, { signal: AbortSignal.timeout(AppBootstrapService.APPS_MANAGER_PROBE_TIMEOUT_MS), redirect: 'manual' });\n if (probe.ok) return true;\n } catch {\n // Connection still refused/reset — keep polling until the deadline.\n }\n await new Promise((resolve) => setTimeout(resolve, APPS_MANAGER_RECONNECT_POLL_INTERVAL_MS));\n }\n return false;\n }\n\n /**\n * Connects with a bounded reconnect-retry on connection-level failure only\n * (never on an HTTP error response, and never on a request timeout — both\n * are handled/thrown by the caller). See {@link APPS_MANAGER_RECONNECT_ATTEMPTS}.\n */\n private static async fetchWithReconnect(\n url: string,\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n init: RequestInit,\n /** Per-OPERATION budget. Defaults to the light-call budget; heavy calls pass their own. */\n timeoutMs: number = APPS_MANAGER_TIMEOUT_MS,\n ): Promise<Response> {\n for (let attempt = 0; ; attempt++) {\n try {\n const response = await fetch(url, {\n ...init,\n headers: {\n [APPS_MANAGER_ADMIN_SECRET_HEADER]: AppBootstrapService.getAdminSecret(credentials),\n ...(init.body ? { [WildoHeaderKeys.CONTENT_TYPE]: 'application/json' } : {}),\n ...(init.headers ?? {}),\n },\n signal: AbortSignal.timeout(timeoutMs),\n });\n // REACHABILITY, not success: an HTTP error response still proves a platform is listening,\n // which is the only question the reconnect decision asks.\n appsManagerAnsweredThisRun = true;\n return response;\n } catch (error) {\n if (error instanceof Error && (error.name === 'AbortError' || error.name === 'TimeoutError')) {\n throw new Error(\n buildAppsManagerDiagnosticMessage({\n envName: env.name,\n summary: `Apps-manager request timed out after ${timeoutMs}ms at ${url}.`,\n }),\n );\n }\n\n /**\n * Never reached in this run ⇒ nothing to ride out. Fail now, and SAY so — the alternative\n * is a silent 30-second stall per call, four times over, ending in the same answer.\n */\n if (!appsManagerAnsweredThisRun) {\n reportAppsManagerWait(\n `apps-manager is not answering at ${AppBootstrapService.getAppsManagerBaseUrl(env)} and has not answered `\n + 'at any point in this run, so there is no crash/respawn to wait out. Continuing without it — a command '\n + 'that can use already-persisted material will; one that cannot will fail with its own diagnostic.',\n );\n throw new Error(\n buildAppsManagerDiagnosticMessage({\n envName: env.name,\n summary: `Unable to reach apps-manager at ${url}: ${ErrorUtils.extractErrorMessage(error)}.`,\n }),\n );\n }\n\n const canRetry = attempt < APPS_MANAGER_RECONNECT_ATTEMPTS;\n if (canRetry) {\n reportAppsManagerWait(\n `apps-manager stopped answering mid-run (attempt ${attempt + 1}/${APPS_MANAGER_RECONNECT_ATTEMPTS}) — `\n + `waiting up to ${APPS_MANAGER_RECONNECT_WAIT_MS / 1_000}s for the supervisor to respawn it...`,\n );\n if (await AppBootstrapService.waitForAppsManagerReconnect(env)) {\n reportAppsManagerWait('apps-manager is back; retrying.');\n continue;\n }\n reportAppsManagerWait('apps-manager did not come back within the window.');\n }\n\n throw new Error(\n buildAppsManagerDiagnosticMessage({\n envName: env.name,\n summary: `Unable to reach apps-manager at ${url}: ${ErrorUtils.extractErrorMessage(error)}.`,\n }),\n );\n }\n }\n }\n\n private static async requestJson(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n path: string,\n init: RequestInit = {},\n /** Per-OPERATION budget — see {@link APPS_MANAGER_INITIALIZE_TIMEOUT_MS}. */\n timeoutMs: number = APPS_MANAGER_TIMEOUT_MS,\n ): Promise<unknown> {\n const baseUrl = AppBootstrapService.getAppsManagerBaseUrl(env).replace(/\\/$/, '');\n const url = `${baseUrl}${path.startsWith('/') ? path : `/${path}`}`;\n\n const response = await AppBootstrapService.fetchWithReconnect(url, env, credentials, init, timeoutMs);\n\n if (!response.ok) {\n if (response.status === 401 || response.status === 403) {\n throw new Error(\n 'Apps-manager rejected bootstrap authentication. Check PLATFORM_ADMIN_SECRET.',\n );\n }\n\n const errorBody = await readErrorBody(response);\n throw new Error(\n `Apps-manager request failed at ${url}: ${response.status} ${response.statusText}${errorBody ? ` - ${errorBody}` : ''}`,\n );\n }\n\n return response.json();\n }\n\n /**\n * The application's migration artifacts, or `undefined` when no PostgreSQL schema has to be\n * applied before the application can be seeded.\n *\n * BOTH conditions are required, and the engine is the one that was missing.\n *\n * The first revision keyed solely on the directory, reasoning that \"an application that HAS\n * migrations needs them applied whatever its declared engine says, because the declaration and the\n * artifacts are two statements that can disagree while only the artifacts can create a table.\"\n * That is false for a MongoDB application: the artifacts describe a POSTGRESQL schema for a store\n * it does not use. The engine declaration is precisely what decides whether any PostgreSQL schema\n * is needed at all.\n *\n * Measured 2026-08-23, flipping this application back to MongoDB for the control run: the\n * `backend-api/migrations` directory survives the flip (it is committed), so two-phase provisioning\n * engaged, deferred the seed, and then tried to migrate a PostgreSQL database that a MongoDB\n * install never creates. `wildo local dev` aborted during application bootstrap with the\n * application left deliberately unseeded — worse than the deadlock the two-phase flow exists to\n * break, because it also affects the engine that never had the problem.\n */\n private static resolveAppSchemaMigrationsDirectory(\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>,\n applicationDatabase: { engine: DatabaseEngine; databaseName?: string } | undefined,\n ): string | undefined {\n if (applicationDatabase?.engine !== DatabaseEngine.POSTGRESQL) return undefined;\n // `appRoot` IS the saas root — `resolveRuntimeTarget` derives `saasConfigPath` by joining the\n // config filename onto it — so it is the same anchor `wildo db migrate` resolves from.\n return resolveAppMigrationsDirectory(runtimeTarget.appRoot);\n }\n\n /**\n * Phase 2 + 3: apply the application's schema, then re-invoke provisioning so the deferred\n * bootstrap rows land and every per-role GRANT is issued over the tables that now exist.\n *\n * Fails closed at both ends, because every degradation here produces an application that looks\n * provisioned and cannot boot:\n *\n * - an apps-manager that did not honour the phase (it is older than the contract, so it reported\n * nothing) is NOT assumed to have seeded — the migrations still run, and the idempotent second\n * call still completes the seed;\n * - an apps-manager that reports anything other than `SEEDED` after the schema exists is a defect,\n * not a state to retry past.\n */\n private static async completeDeferredAppDatabaseSeeding(input: {\n env: PlatformEnvironmentConfiguration;\n credentials: PlatformEnvSecretsJson;\n runtimeTarget: NonNullable<Awaited<ReturnType<typeof AppBootstrapService.resolveRuntimeTarget>>>;\n applicationDatabase: { engine: DatabaseEngine; databaseName?: string } | undefined;\n firstPhaseOutcome: AppDatabaseSeedingOutcome | undefined;\n }): Promise<void> {\n if (input.firstPhaseOutcome === AppDatabaseSeedingOutcome.NO_PERSISTENCE_TARGET) {\n /**\n * Nothing the tooling does next can seed this application — the target itself is missing, and\n * apps-manager has already logged why. Applying migrations would fail on a database that was\n * never provisioned, with a message about connectivity rather than about the real cause.\n */\n return;\n }\n\n await applyAppSchemaMigrations({\n envName: input.env.name,\n saasRoot: input.runtimeTarget.appRoot,\n appliedBy: `cli:bootstrap:${input.runtimeTarget.appSlug}`,\n reportMissing: (message) => { throw new Error(message); },\n });\n\n const secondPhaseOutcome = await AppBootstrapService.ensureApplicationRegistered(input.env, input.credentials, {\n appSlug: input.runtimeTarget.appSlug,\n appDisplayName: input.runtimeTarget.appDisplayName,\n appDatabaseName: input.runtimeTarget.appDatabaseName,\n managedDeclaration: input.runtimeTarget.managedDeclaration,\n applicationDatabase: input.applicationDatabase,\n firstAdminSeed: input.runtimeTarget.firstAdminSeed,\n appDatabaseSeeding: AppDatabaseSeedingPhase.REQUIRED,\n });\n\n if (secondPhaseOutcome !== undefined && secondPhaseOutcome !== AppDatabaseSeedingOutcome.SEEDED) {\n throw new Error(\n `Application '${input.runtimeTarget.appSlug}' was not seeded after its schema was applied `\n + `(apps-manager reported '${secondPhaseOutcome}'). Its backend requires exactly one APPLICATION `\n + 'row and cannot boot without it.',\n );\n }\n }\n\n static async ensureApplicationRegistered(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n input: {\n appSlug: string;\n appDisplayName: string;\n appDatabaseName?: string | undefined;\n managedDeclaration: AdminAppManagedDeclaration;\n /**\n * The application's own persistence engine, from the authored `applicationDatabase`.\n *\n * This is the CLI half of the door that did not exist: apps-manager's per-application\n * PostgreSQL provisioning is gated on `usePostgreSQL`, which nothing in the repository set\n * until 2026-08-19. Omitted means MongoDB, so an environment that authors nothing is unchanged.\n */\n applicationDatabase?: { engine: DatabaseEngine; databaseName?: string } | undefined;\n firstAdminSeed?: AppBootstrapFirstAdminSeed | undefined;\n /**\n * WHEN apps-manager should seed the application's own database. See\n * {@link AppDatabaseSeedingPhase} for the circularity `DEFERRED` breaks.\n */\n appDatabaseSeeding?: AppDatabaseSeedingPhase | undefined;\n },\n ): Promise<AppDatabaseSeedingOutcome | undefined> {\n const body = AdminAppInitializeRequestSchema.parse({\n name: input.appDisplayName,\n appDatabaseName: input.appDatabaseName,\n userEmail: credentials.admin.email,\n userFirstName: credentials.admin.firstName,\n userLastName: credentials.admin.lastName,\n userPassword: credentials.admin.password,\n /*\n * The SECOND administrator (#575), and this site was enumerated as \"read only — no change\n * expected\" when the CLI half landed. That was WRONG, and it is the site that matters most:\n * `applicationAccessGrants` has zero mentions under `platform/` — it is an ENGINE resource, so\n * the two-person rule bites inside the GENERATED APPLICATION, not on the platform plane. This\n * request is what carries an identity into that application's own database, where\n * `_getDefault_App_FirstUser` is the only writer of `APP_ADMIN_SUPER_ADMIN` at provisioning\n * time.\n *\n * Spread, so a `secrets.json` predating the `approver` block sends nothing at all rather than\n * four `undefined`s that would read as a half-stated identity at the door.\n */\n ...(credentials.approver\n ? {\n approverEmail: credentials.approver.email,\n approverFirstName: credentials.approver.firstName,\n approverLastName: credentials.approver.lastName,\n approverPassword: credentials.approver.password,\n }\n : {}),\n managedDeclaration: input.managedDeclaration,\n applicationDatabase: input.applicationDatabase,\n firstAdminSeed: input.firstAdminSeed,\n appDatabaseSeeding: input.appDatabaseSeeding,\n /**\n * Forward the authored `serviceAuth` snapshot mirrored from\n * `wildo.infra.<env>.config.ts`. Apps-manager seeds platform-managed\n * JWT TTLs from this when present; otherwise applies\n * `WildoAuthConfigSchema` defaults at parse time.\n */\n serviceAuth: env.serviceAuth,\n });\n\n const response = await AppBootstrapService.requestJson(\n env,\n credentials,\n buildAdminInitializeApplicationPath(input.appSlug),\n {\n method: 'POST',\n body: JSON.stringify(body),\n },\n APPS_MANAGER_INITIALIZE_TIMEOUT_MS,\n );\n\n /**\n * Returns the outcome rather than discarding it. `undefined` means an apps-manager that predates\n * the two-phase contract and therefore said nothing — which the caller must treat as UNKNOWN, not\n * as seeded.\n */\n return AdminAppInitializeResponseSchema.parse(response).appDatabaseSeeding;\n }\n\n /**\n * POST /admin/apps/:appSlug/reapply-declaration\n *\n * Re-source the declaration-managed slices of the app's stored config\n * from the latest `wildo.saas.config.ts` projection. Idempotent.\n *\n * See `AdminAppReapplyDeclarationRequestSchema` (platform-config-lib)\n * for the contract scope: this does NOT touch credentials, K8s\n * endpoints, infra, or admin user/role seeding.\n */\n static async reapplyApplicationDeclaration(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n input: {\n appSlug: string;\n managedDeclaration: AdminAppManagedDeclaration;\n /**\n * Ask the server to report the diff and write nothing (issue #97).\n *\n * An empty `updatedFields` under a dry run is the coherence proof the init postcondition\n * and `wildo local doctor` rely on.\n */\n dryRun?: boolean;\n },\n ): Promise<AdminAppReapplyDeclarationResponse> {\n /*\n * The flag is omitted rather than sent as `false` when not requested, so the wire payload of an\n * ordinary reapply is byte-identical to what it was before `dryRun` existed. The request schema\n * is a `strictObject`, so this is also what keeps an older apps-manager from rejecting the call.\n */\n const body = AdminAppReapplyDeclarationRequestSchema.parse({\n managedDeclaration: input.managedDeclaration,\n ...(input.dryRun === true ? { dryRun: true } : {}),\n });\n\n const response = await AppBootstrapService.requestJson(\n env,\n credentials,\n buildAdminReapplyDeclarationPath(input.appSlug),\n {\n method: 'POST',\n body: JSON.stringify(body),\n },\n );\n\n return AdminAppReapplyDeclarationResponseSchema.parse(response);\n }\n\n static async fetchBootstrapCredentials(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n input: {\n appSlug: string;\n runtimeEnvironment: RuntimeEnvironment;\n /**\n * Which runtime principal to fetch for (Step 1 / F11). Omitted ⇒ the\n * application backend, which is what every caller wanted when one secret\n * per application was the only thing that existed.\n */\n principal?: ApplicationRuntimePrincipal;\n },\n ) {\n const response = await AppBootstrapService.requestJson(\n env,\n credentials,\n buildAppBootstrapCredentialsPath(\n input.appSlug,\n input.runtimeEnvironment,\n input.principal ? buildRuntimePrincipalKey(input.principal) : undefined,\n ),\n { method: 'GET' },\n );\n\n return AppBootstrapCredentialsResponseSchema.parse(response);\n }\n\n /**\n * Fetch ONE runtime's own bootstrap credentials.\n *\n * The app-level `prepared.bootstrapCredentials` is the APPLICATION BACKEND's\n * identity. Minion and worker targets used to reuse it verbatim — which is\n * exactly what F11 measured when it compared `backend-api/.env` and\n * `marketing-scrapper/.env` and found the secret byte-identical.\n *\n * The `APPLICATION_ID` and apps-manager URL are per-application and come back\n * identical; only `PLATFORM_APPLICATION_PRIMARY_SECRET` differs. Keeping the\n * whole envelope (rather than splicing one field into the app's) means the\n * runtime's `.env` is built from a response that was authenticated and\n * validated as a unit.\n */\n /**\n * Fetch one bootstrap credential set PER declared minion and worker.\n *\n * The app-level `bootstrapCredentials` is the APPLICATION BACKEND's identity.\n * Minion and worker targets used to reuse it verbatim — which is exactly what\n * F11 measured when it compared `backend-api/.env` with\n * `marketing-scrapper/.env` and found the secret byte-identical.\n *\n * `APPLICATION_ID` and the apps-manager URL come back identical for every\n * principal; only `PLATFORM_APPLICATION_PRIMARY_SECRET` differs. The whole\n * envelope is kept rather than splicing one field into the app's, so each\n * runtime's `.env` is built from a response that was authenticated and\n * validated as a unit.\n */\n private static async fetchDeclaredRuntimePrincipalCredentials(\n input: ApplicationEnvProjectionInput,\n runtimeTarget: ResolvedAppRuntimeTarget,\n runtimeEnvironment: RuntimeEnvironment,\n ): Promise<Record<string, AppBootstrapCredentials>> {\n // Sourced from the MANAGED DECLARATION, not a re-read of the saas config.\n // That is the same input apps-manager mints from, so the set of principals\n // the CLI asks for and the set apps-manager stores cannot drift — and it\n // costs no extra filesystem access, since the declaration is already\n // resolved on the target.\n const principals = enumerateDeclaredRuntimePrincipals(runtimeTarget.managedDeclaration)\n .filter((principal) => principal.kind !== ApplicationRuntimePrincipalKind.APPLICATION_BACKEND);\n\n const entries = await Promise.all(\n principals.map(async (principal) => {\n const response = await AppBootstrapService.fetchBootstrapCredentials(\n input.env,\n input.credentials,\n { appSlug: runtimeTarget.appSlug, runtimeEnvironment, principal },\n );\n return [buildRuntimePrincipalKey(principal), response.credentials] as const;\n }),\n );\n return Object.fromEntries(entries);\n }\n\n /**\n * A declared runtime's own credentials, or a hard failure.\n *\n * Deliberately NO fallback to `prepared.bootstrapCredentials`. A fallback here\n * would hand the runtime the application backend's identity and the sync would\n * report success — reintroducing F11 silently, at the one seam built to close\n * it. A missing entry means preparation and the declaration disagree, which is\n * a bug to surface, not to paper over.\n */\n /**\n * Degraded-mode counterpart of {@link requireRuntimePrincipalCredentials}.\n *\n * Returns `null` for a principal the offline reconstruction could not resolve,\n * so the caller SKIPS that runtime and writes the others. Outside degraded mode\n * it delegates and still THROWS — a missing entry there means preparation and\n * the declaration disagree, which is a bug to surface rather than skip.\n *\n * The strictness that matters is untouched either way: nothing ever substitutes\n * the application backend's identity for a principal's.\n */\n private static resolveRuntimePrincipalCredentialsOrSkip(\n prepared: PreparedApplicationEnvTargets,\n principal: ApplicationRuntimePrincipal,\n ): AppBootstrapCredentials | null {\n if (prepared.degraded && !prepared.runtimePrincipalCredentials[buildRuntimePrincipalKey(principal)]) {\n return null;\n }\n return AppBootstrapService.requireRuntimePrincipalCredentials(prepared, principal);\n }\n\n private static requireRuntimePrincipalCredentials(\n prepared: PreparedApplicationEnvTargets,\n principal: ApplicationRuntimePrincipal,\n ): AppBootstrapCredentials {\n const principalKey = buildRuntimePrincipalKey(principal);\n const credentials = prepared.runtimePrincipalCredentials[principalKey];\n if (!credentials) {\n throw new Error(\n `No bootstrap credentials prepared for runtime principal '${principalKey}'. `\n + 'Every declared minion and worker must have its own identity; refusing to fall back to the application backend\\'s.',\n );\n }\n return credentials;\n }\n\n static async buildApplicationBackendTargets(\n input: ApplicationEnvProjectionInput,\n ): Promise<ApplicationBackendEnvTarget[]> {\n const prepared = input.prepared ?? await AppBootstrapService.prepareApplicationEnvTargets(input);\n if (!prepared) {\n return [];\n }\n const { runtimeTarget, bootstrapCredentials, runtimeEndpoints } = prepared;\n\n // App-level deploy context (same value on every backend target, like\n // runtimeEndpoints) — the CI render path reads it to emit the serviceHosts\n // ingress (k8s) / Traefik routing (compose). Empty for local.\n const ingressRoutes = AppBootstrapService.buildApplicationIngressRoutes(runtimeTarget, input.env);\n const { podPorts, healthPort } = AppBootstrapService.buildBackendPodPorts(runtimeTarget, input.env);\n // Per-service model: the frontends deploy as their own nginx Deployments —\n // carried on the (primary-first) backend target's app-deploy context so the\n // CI render emits a backend Deployment + one frontend Deployment per entry.\n const frontends = AppBootstrapService.buildApplicationFrontendDeployTargets(runtimeTarget, input.env);\n // Backend→worker dispatch URLs (G-8 / MW4): every declared worker's per-app\n // k8s Service URL, keyed by bucket name. Emitted into the backend env as\n // `WILDO_WORKER_<NAME>_URL` so the backend's WorkerRemoteClientFactory can\n // call each worker. BOTH location types since #426 — a k8s Service URL for\n // REMOTE, a loopback address for LOCAL; same value on every backend target.\n const workerUrls = AppBootstrapService.buildApplicationWorkerDispatchUrls(runtimeTarget, input.env);\n\n\n // Emit the targets PRIMARY-FIRST. The shared `{appSlug}-secret`\n // (k8s-secrets-generator §5, deduped by appName, first-wins) must bake the\n // PRIMARY backend's identity env (SERVICE_NAME / OTEL_SERVICE_NAME) — the\n // single app pod + every minion mount it — not whichever backend happened to\n // be authored first. Mirrors the `find(key==='backendApi') ?? [0]` primary\n // rule used for runtime endpoints + pod ports.\n const primaryBackend =\n runtimeTarget.backendServices.find((backend) => backend.key === 'backendApi') ??\n runtimeTarget.backendServices[0];\n const orderedBackends = primaryBackend\n ? [primaryBackend, ...runtimeTarget.backendServices.filter((backend) => backend !== primaryBackend)]\n : runtimeTarget.backendServices;\n\n return orderedBackends.map((service) => {\n const serviceRoot = resolve(runtimeTarget.appRoot, service.path);\n const relativeDir = AppBootstrapService.relativeToApplicationRoot(\n runtimeTarget.appRoot, serviceRoot, `Application backend '${service.serviceName}'`,\n );\n return {\n bootstrapCredentials,\n serviceName: service.serviceName,\n applicationRoot: runtimeTarget.appRoot,\n relativeDir,\n applicationRuntimeSignalsHome: join(runtimeTarget.appRoot, WORKSPACE_HOME_NAMES.APP_RUNTIME_HOME, APP_RUNTIME_SUBDIR_NAMES.RUNTIME_SIGNALS),\n appDatabaseName: runtimeTarget.appDatabaseName,\n redisKeyPrefix: runtimeTarget.redisKeyPrefix,\n storageBucketPrefix: runtimeTarget.storageBucketPrefix,\n runtimeEndpoints,\n appName: runtimeTarget.appSlug,\n ingressRoutes: ingressRoutes.length > 0 ? ingressRoutes : undefined,\n podPorts: podPorts.length > 0 ? podPorts : undefined,\n healthPort,\n frontends: frontends.length > 0 ? frontends : undefined,\n // Per-service, not per-app: each backend row carries its own resolved\n // isolation. Passed through from the config boundary unchanged.\n isolation: {\n runAsUser: service.isolation.runAsUser,\n runAsGroup: service.isolation.runAsGroup,\n writablePaths: [...service.isolation.writablePaths],\n },\n workerUrls,\n // The backend's own declared provider scope. It legitimately declares\n // most providers, so this changes nothing for it today — but it must be\n // threaded explicitly, because the builder now fails CLOSED: an omitted\n // scope yields no provider secrets rather than all of them.\n scopedProviderRefs: runtimeTarget.backendScopedProviderRefs,\n };\n });\n }\n\n /**\n * Build the backend→worker dispatch URL map (G-8 / MW4): for every worker\n * declared in `wildo.saas.config.ts > workers`, its in-cluster base URL\n * `http://{appSlug}-worker-{bucketKey}:{http.port}`, keyed by bucket name.\n *\n * BOTH location types, by different addressing (#426).\n *\n * REMOTE resolves the per-app k8s Service, coherent-by-construction with\n * `renderWorkerForTarget` via the shared `buildWorkerInternalUrl` helper (same\n * `{appSlug}-worker-{key}` Service name). LOCAL has no Service to resolve, so it\n * addresses the supervised worker process on loopback at its authored port.\n *\n * This was `REMOTE only` until 2026-09-09, on the reasoning that \"local dev has no\n * k8s Services, and worker dispatch is a k8s-deploy concern\". The first half is\n * still true; the second stopped being true when `wildo local dev` began starting\n * workers. What local dev lacked was never a worker — it was an ADDRESS, and\n * without one `WorkerRemoteClientFactory.client()` fails closed on the absent\n * `WILDO_WORKER_<NAME>_URL`. That is why the backend-to-worker chain had never run\n * for anyone: it was unreachable in the only environment where anyone could try.\n *\n * The worker `http.port` comes from the resolved runtime target's managed\n * declaration, which `AppRuntimeTargetsService.resolve` built by parsing every\n * worker config through `WildoWorkerConfigSchema` — the same authoritative parse\n * `buildApplicationWorkerTargets` uses — so a wrong port can never drift from the\n * deployed Service or the local listener.\n *\n * It deliberately does NOT re-load `wildo.saas.config.ts` here. The runtime target\n * IS the parsed row; reading the file again would be a second parse of the same\n * truth, and it made this builder the one step of `buildApplicationBackendTargets`\n * that could not run against a resolved target alone (measured 2026-09-09: the\n * backend-targets pin, which stands in a resolved target for a config file that\n * does not exist, failed here and nowhere else once LOCAL joined REMOTE).\n */\n private static buildApplicationWorkerDispatchUrls(\n runtimeTarget: ResolvedAppRuntimeTarget,\n env: PlatformEnvironmentConfiguration,\n ): Record<string, string> | undefined {\n const workers = runtimeTarget.managedDeclaration.workers ?? {};\n const urls: Record<string, string> = {};\n for (const [workerName, worker] of Object.entries(workers)) {\n urls[workerName] = env.locationType === WildoLocationType.REMOTE\n ? buildWorkerInternalUrl(runtimeTarget.appSlug, workerName, worker.http.port)\n : buildWorkerLocalUrl(worker.http.port);\n }\n return Object.keys(urls).length > 0 ? urls : undefined;\n }\n\n static async buildApplicationCompanionTargets(\n input: ApplicationEnvProjectionInput,\n ): Promise<CompanionPlatformEnvTarget[]> {\n const prepared = input.prepared ?? await AppBootstrapService.prepareApplicationEnvTargets(input);\n if (!prepared) {\n return [];\n }\n\n const { runtimeTarget, bootstrapCredentials, runtimeEndpoints } = prepared;\n const companionRoot = resolveAppLayout(runtimeTarget.appRoot).companionHome;\n if (!existsSync(companionRoot)) {\n return [];\n }\n\n const companionRelativeDir = AppBootstrapService.relativeToApplicationRoot(\n runtimeTarget.appRoot, companionRoot, `Application companion for '${runtimeTarget.appSlug}'`,\n );\n\n const companionExtraEnv: Record<string, string> = {};\n\n if (runtimeTarget.localServiceAddresses?.devCompanion?.host) {\n companionExtraEnv.HOST = runtimeTarget.localServiceAddresses.devCompanion.host;\n }\n if (runtimeTarget.localServiceAddresses?.devCompanion?.port) {\n companionExtraEnv.PORT = String(runtimeTarget.localServiceAddresses.devCompanion.port);\n }\n\n return [{\n bootstrapCredentials,\n serviceName: `${runtimeTarget.appSlug}-dev-companion`,\n applicationRoot: runtimeTarget.appRoot,\n relativeDir: companionRelativeDir,\n runtimeEndpoints,\n extraEnv: companionExtraEnv,\n }];\n }\n\n static async buildApplicationWorkerTargets(\n input: ApplicationEnvProjectionInput,\n ): Promise<ApplicationWorkerEnvTarget[]> {\n const prepared = input.prepared ?? await AppBootstrapService.prepareApplicationEnvTargets(input);\n if (!prepared) {\n return [];\n }\n\n const { runtimeTarget, bootstrapCredentials, runtimeEndpoints } = prepared;\n const isRemote = input.env.locationType === WildoLocationType.REMOTE;\n const saasConfig = await loadConfig<{\n workers?: Record<string, { path: string }>;\n providers?: { scopes?: { workers?: Record<string, { providers?: Record<string, unknown> }> } };\n }>(runtimeTarget.saasConfigPath);\n const workers = saasConfig.workers ?? {};\n const targets: ApplicationWorkerEnvTarget[] = [];\n\n for (const [workerName, workerRef] of Object.entries(workers)) {\n const workerRoot = resolve(runtimeTarget.appRoot, workerRef.path);\n // Parse through the authoritative schema — validates the authored config\n // AND applies the canonical defaults (port 8080, /healthz, /readyz,\n // replicas 1) from `WorkerHttpSchema`/`WildoWorkerConfigSchema`. Deriving\n // from the spec (rather than re-defaulting `?? 8080` here) keeps the k8s\n // manifest in lockstep with the runtime contract — no drift, no second\n // source of the defaults, and a malformed config fails fast.\n const workerConfig = WildoWorkerConfigSchema.parse(\n await loadConfig(join(workerRoot, WORKER_CONFIG_FILENAME)),\n );\n const relativeDir = AppBootstrapService.relativeToApplicationRoot(\n runtimeTarget.appRoot, workerRoot, `Application worker '${workerName}'`,\n );\n\n const workerCredentials = AppBootstrapService.resolveRuntimePrincipalCredentialsOrSkip(\n prepared,\n { kind: ApplicationRuntimePrincipalKind.WORKER, name: workerName },\n );\n if (!workerCredentials) continue;\n\n targets.push({\n // Workers get their own identity too (D22). Leaving them on the shared\n // application secret would ship the containment with a worker-shaped\n // bypass: a worker could fetch every minion's credentials, so excluding\n // them would not have been the conservative choice.\n bootstrapCredentials: workerCredentials,\n workerName,\n serviceName: workerConfig.name,\n applicationRoot: runtimeTarget.appRoot,\n relativeDir,\n runtimeEndpoints,\n // Declared provider scope — see the identical field on the minion target.\n // `myRustWorker` declares `providers: {}` and therefore receives no\n // provider secrets at all; it previously received every one of them.\n scopedProviderRefs: Object.keys(\n saasConfig.providers?.scopes?.workers?.[workerName]?.providers ?? {},\n ),\n // Authored worker HTTP (schema-defaulted): nested `http` populated for\n // every env (the `.env` projection is not remote-only), shared by the\n // worker env-gen and the REMOTE k8s render.\n http: {\n port: workerConfig.http.port,\n healthPath: workerConfig.http.healthPath,\n readyPath: workerConfig.http.readyPath,\n metricsPath: workerConfig.http.metricsPath,\n },\n // NOT inside the `isRemote` branch below — container isolation feeds\n // BOTH renderers (k8s securityContext + volumes, compose\n // `user`/`read_only`/`tmpfs`/`pids_limit`). Same placement and same\n // reason as the minion target below.\n isolation: workerConfig.isolation,\n // REMOTE k8s deploy context (appName + replicas).\n ...(isRemote\n ? { appName: runtimeTarget.appSlug, replicas: workerConfig.replicas }\n : {}),\n });\n }\n\n return targets;\n }\n\n static async buildApplicationMinionTargets(\n input: ApplicationEnvProjectionInput,\n ): Promise<ApplicationMinionEnvTarget[]> {\n const prepared = input.prepared ?? await AppBootstrapService.prepareApplicationEnvTargets(input);\n if (!prepared) {\n return [];\n }\n\n const { runtimeTarget, bootstrapCredentials, runtimeEndpoints } = prepared;\n const saasConfig = await loadConfig<{\n minions?: Record<string, {\n path: string;\n /**\n * The minion's authored application-data access. Read here so env\n * generation can withhold a backing service's TOPOLOGY from a minion that\n * never declared it — the same declaration apps-manager reads to decide\n * whether to mint that minion a credential at all (D11/R3).\n *\n * ABSENT and declared-but-empty are different statements and must stay\n * distinguishable all the way down; see `RuntimeAccessDeclaration`.\n */\n resourceAccess?: { read?: readonly string[]; write?: readonly string[] };\n /** Authored opt-in for a route off the host. Default false, never inferred. */\n requiresInternetEgress?: boolean;\n }>;\n // The scope's providers are a REF -> ENTRY map, not a bag of unknowns. Typed\n // that way so `registerMinionLocalProviders` can merge into it without the\n // call site loosening its contract to fit a placeholder type.\n providers?: { scopes?: { minions?: Record<string, { providers?: Record<string, Record<string, unknown>> }> } };\n }>(runtimeTarget.saasConfigPath);\n const minions = saasConfig.minions ?? {};\n const targets: ApplicationMinionEnvTarget[] = [];\n\n const isRemote = input.env.locationType === WildoLocationType.REMOTE;\n for (const [minionName, minionRef] of Object.entries(minions)) {\n const minionRoot = resolve(runtimeTarget.appRoot, minionRef.path);\n // Parse through the authoritative schema — validates AND applies the\n // canonical `MinionReinstantiationSchema`/`MinionLivenessSchema` defaults\n // (kill_previous, file liveness at /tmp/wildo-minion-alive, staleAfterSec\n // 90). Derived from the spec so the k8s manifest never drifts from the\n // runtime contract, and a malformed minion config fails fast.\n const minionConfig = WildoMinionConfigSchema.parse(\n await loadConfig(join(minionRoot, MINION_CONFIG_FILENAME)),\n );\n const relativeDir = AppBootstrapService.relativeToApplicationRoot(\n runtimeTarget.appRoot, minionRoot, `Application minion '${minionName}'`,\n );\n\n const minionCredentials = AppBootstrapService.resolveRuntimePrincipalCredentialsOrSkip(\n prepared,\n { kind: ApplicationRuntimePrincipalKind.MINION, name: minionName },\n );\n // Degraded mode only: a principal whose own secret is not on disk is SKIPPED\n // so every other runtime is still written. Outside degraded mode the resolver\n // throws, preserving the guard that refuses the backend's identity.\n if (!minionCredentials) continue;\n\n targets.push({\n // The minion's OWN identity, not the application backend's. This one\n // line is what F11 was about: every minion previously shipped with the\n // app's `PLATFORM_APPLICATION_PRIMARY_SECRET`, so at the apps-manager\n // door it could ask as the backend — making any narrowing elsewhere\n // bypassable rather than enforced.\n bootstrapCredentials: minionCredentials,\n minionName,\n serviceName: minionConfig.name,\n applicationRoot: runtimeTarget.appRoot,\n relativeDir,\n applicationRuntimeSignalsHome: join(runtimeTarget.appRoot, WORKSPACE_HOME_NAMES.APP_RUNTIME_HOME, APP_RUNTIME_SUBDIR_NAMES.RUNTIME_SIGNALS),\n appDatabaseName: runtimeTarget.appDatabaseName,\n // The minion's OWN Redis namespace (D20), NOT the application's.\n //\n // This is one half of a COUPLED PAIR: apps-manager grants this minion's\n // ACL user exactly `buildMinionRedisKeyPrefix(...)*`, and this is the\n // prefix the minion actually writes under. Derived from the SAME\n // function so the two cannot drift — if they disagree by a character,\n // every Redis operation the minion performs is DENIED and the error\n // names an ACL rather than the mismatch, so nothing in the minion's own\n // configuration explains it.\n //\n // A strict extension of the application prefix, which keeps\n // `RedisService`'s \"an authored prefix must start with `<appSlug>:`\"\n // rule true without changing that rule.\n redisKeyPrefix: buildMinionRedisKeyPrefix(runtimeTarget.appSlug, minionName),\n storageBucketPrefix: runtimeTarget.storageBucketPrefix,\n runtimeEndpoints,\n // NOT inside the `isRemote` branch below: container isolation applies to\n // BOTH renderers. k8s consumes it as securityContext + volumes, compose\n // as `user`/`read_only`/`tmpfs`/`pids_limit`. Gating it on REMOTE would\n // leave local dev running the pre-hardening posture while the manifest\n // claimed otherwise — exactly the k8s/compose asymmetry Step 5b warns\n // about.\n isolation: {\n runAsUser: minionConfig.isolation.runAsUser,\n runAsGroup: minionConfig.isolation.runAsGroup,\n writablePaths: minionConfig.isolation.writablePaths,\n pidsLimit: minionConfig.isolation.pidsLimit,\n },\n // The provider refs this minion DECLARED. Read from the authored scope\n // rather than inherited from the application: a minion scoped to `openai`\n // must not receive the app's Stripe key, and until now it did — the scope\n // was materialised into topology while the SECRETS ignored it entirely.\n // An undeclared scope yields `[]`, i.e. no provider secrets, matching the\n // fail-closed posture `resourceAccess` already takes (D11).\n // R7 — the minion's locally-AUTHORED providers are registered into its own\n // scope before the refs are derived, so a locally-authored provider is\n // visible to this minion exactly as an application-declared one is, and\n // through the SAME projection. Everything downstream — the secret\n // filtering, the generated runtime module — reads the merged scope and\n // cannot tell the two apart, which is what keeps ONE runtime source and\n // ONE secret mechanism.\n //\n // Registered HERE rather than at the catalog: this is the single place\n // that holds both the parsed minion config (which carries the fragment)\n // and the application scope it merges into.\n scopedProviderRefs: Object.keys(\n registerMinionLocalProviders(\n saasConfig.providers?.scopes?.minions?.[minionName],\n minionConfig.localProviders,\n minionName,\n ).providers,\n ),\n // Forwarded VERBATIM, including its absence. Defaulting to `{}` here\n // would turn \"declared nothing\" into \"declared empty\" and silently strip\n // a declaring minion's database topology; defaulting the other way would\n // hand a non-declaring minion a route it never asked for. Neither default\n // is safe, so there is none.\n accessDeclaration: {\n resourceAccess: minionRef.resourceAccess,\n requiresInternetEgress: minionRef.requiresInternetEgress,\n },\n // REMOTE k8s deploy context (schema-defaulted fields, read directly).\n ...(isRemote\n ? {\n appName: runtimeTarget.appSlug,\n reinstantiationPolicy: minionConfig.reinstantiation.policy,\n gracePeriodSec: minionConfig.reinstantiation.gracePeriodSec,\n liveness: {\n kind: minionConfig.liveness.kind,\n filePath: minionConfig.liveness.filePath,\n staleAfterSec: minionConfig.liveness.staleAfterSec,\n execCommand: minionConfig.liveness.execCommand,\n },\n }\n : {}),\n });\n }\n\n return targets;\n }\n\n static async buildApplicationFrontendTargets(input: {\n saasRoot: string;\n requestedAppSlug?: string | undefined;\n prepared?: PreparedApplicationEnvTargets;\n }): Promise<ApplicationFrontendEnvExampleTarget[]> {\n const runtimeTarget = input.prepared?.runtimeTarget ?? await AppBootstrapService.resolveRuntimeTarget(input);\n if (!runtimeTarget) {\n return [];\n }\n\n const primaryBackendPort =\n runtimeTarget.backendServices.find((backend) => backend.key === 'backendApi')?.defaultPort ??\n runtimeTarget.backendServices[0]?.defaultPort;\n /**\n * Where the DEV SERVER forwards API traffic. This is an internal hop to a plain-http listener and\n * stays http under every edge scheme — the same public/internal split the runtime topology makes.\n */\n const apiProxyTarget = primaryBackendPort ? `http://localhost:${primaryBackendPort}` : undefined;\n\n return runtimeTarget.frontendServices.map((service) => {\n const relativeDir = AppBootstrapService.relativeToApplicationRoot(\n runtimeTarget.appRoot, resolve(runtimeTarget.appRoot, service.path), `Application frontend '${service.serviceName}'`,\n );\n\n const envExample: Record<string, string> = {\n NODE_ENV: 'development',\n VITE_APP_SLUG: runtimeTarget.appSlug,\n VITE_APP_NAME: runtimeTarget.appDisplayName,\n ...(service.defaultPort ? { VITE_PORT: String(service.defaultPort) } : {}),\n };\n\n if (service.defaultPort) {\n envExample.VITE_HMR_HOST = 'localhost';\n envExample.VITE_HMR_CLIENT_PORT = String(service.defaultPort);\n // The HMR socket rides the page's own origin, which is plain http locally.\n envExample.VITE_HMR_PROTOCOL = 'ws';\n }\n\n if (service.frontendType === AppFrontendType.SAAS_APP) {\n if (!apiProxyTarget) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' has no backend API port to bind frontend '${service.serviceName}' to VITE_API_BASE_URL.`,\n );\n }\n\n /**\n * The browser addresses the backend port DIRECTLY. This is the long-standing local behaviour,\n * and as of 2026-08-14 the only one: the dev API proxy was removed, so there is no dev-server\n * origin to address the API on and no proxy target to emit.\n *\n * ⚠️ Under a TLS edge this becomes a mixed-content problem — an https page cannot call the\n * backend's plain-http port. That is one of the reasons the local TLS edge was withdrawn; if\n * one is ever reintroduced, the API origin and the forwarding it implies have to come back\n * TOGETHER, not one before the other.\n */\n envExample.VITE_API_BASE_URL = apiProxyTarget;\n envExample.VITE_FRONTEND_SERVICE_NAME = service.serviceName;\n\n }\n\n if (service.frontendType === AppFrontendType.TECH_DOC) {\n /**\n * The documentation site needs the same three origins the SaaS app does, but under\n * its OWN env names: it is a Docusaurus build, not a Vite app, so it never reads\n * `VITE_*`. Its config refuses to complete a PRODUCTION build when these are unset,\n * because a docs bundle compiles its origins in — a wrong value points every reader\n * at the wrong host instead of failing.\n *\n * Local values are derived here, exactly as `VITE_API_BASE_URL` is, so a developer\n * building the docs locally needs no manual wiring. Remote environments author\n * `documentationSite` in `wildo.infra.<env>.config.ts`, which\n * `PlatformEnvVarsBuilder.emitDocumentationSiteEnv` projects onto the same three\n * names — so the authored value overrides these defaults rather than competing with\n * them.\n */\n if (!apiProxyTarget) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' has no backend API port to bind documentation site '${service.serviceName}' to WILDO_DOCS_API_BASE_URL.`,\n );\n }\n const saasAppPort = runtimeTarget.frontendServices\n .find((frontend) => frontend.frontendType === AppFrontendType.SAAS_APP)?.defaultPort;\n if (!saasAppPort) {\n throw new Error(\n `Application '${runtimeTarget.appSlug}' has no SaaS application frontend port to bind documentation site '${service.serviceName}' to WILDO_DOCS_APP_URL. `\n + 'The documentation site deep-links anonymous readers to the SaaS app to sign in.',\n );\n }\n // The docs site is itself served plain http locally, so addressing the backend port directly\n // raises no mixed-content problem and needs no proxy of its own.\n envExample[PlatformDocumentationSiteEnvKeys.WILDO_DOCS_API_BASE_URL] = apiProxyTarget;\n // This one points at the SaaS APP, which IS the edge — so it carries the edge scheme. Left as\n // http it deep-links every anonymous reader at a port that no longer answers.\n envExample[PlatformDocumentationSiteEnvKeys.WILDO_DOCS_APP_URL] =\n `http://localhost:${saasAppPort}`;\n envExample[PlatformDocumentationSiteEnvKeys.WILDO_DOCS_FRONTEND_SERVICE_NAME] = service.serviceName;\n }\n\n return {\n serviceName: service.serviceName,\n applicationRoot: runtimeTarget.appRoot,\n relativeDir,\n envExample,\n };\n });\n }\n\n /**\n * Project local authored operator posture into the app-root `.env` target.\n *\n * The generated `config.json` snapshot is the input here. The `.env` file is\n * only a disposable process boundary and is regenerated by both config sync\n * and dev start. Run identity is intentionally absent: the verification\n * supervisor mints it per invocation rather than accepting authored state.\n */\n static buildApplicationOperatorEnvTargets(input: {\n env: PlatformEnvironmentConfiguration;\n config: PlatformEnvConfigJson;\n saasRoot: string;\n }): ApplicationOperatorEnvTarget[] {\n const verification = input.config.applicationCreationVerification;\n if (input.env.locationType !== WildoLocationType.LOCAL) {\n if (verification === undefined) return [];\n throw new Error('Application-creation verification operator environment is local-only.');\n }\n\n return [{\n applicationRoot: resolve(input.saasRoot),\n ...(verification === undefined\n ? { disposition: ApplicationOperatorEnvFileDisposition.REMOVE }\n : {\n disposition: ApplicationOperatorEnvFileDisposition.WRITE,\n env: {\n [ApplicationCreationVerificationEnvKey.EVIDENCE_DIRECTORY]: verification.evidenceDirectory,\n [ApplicationCreationVerificationEnvKey.SILENT]: String(verification.silent),\n },\n }),\n }];\n }\n}\n"]}
|