@wildo-ai/wildo-cli 1.1.9 → 1.1.10
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/bin/wildo.js +0 -0
- package/dist/bin/wildo.js.map +1 -1
- package/dist/src/commands/acp/probe.command.d.ts.map +1 -1
- 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/align-deps.command.js.map +1 -1
- package/dist/src/commands/assets/sync.command.d.ts.map +1 -1
- 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/brand/propagate.command.js.map +1 -1
- package/dist/src/commands/build/accept.command.d.ts.map +1 -1
- package/dist/src/commands/build/accept.command.js.map +1 -1
- package/dist/src/commands/build/dispatches.command.d.ts.map +1 -1
- package/dist/src/commands/build/dispatches.command.js.map +1 -1
- package/dist/src/commands/build/next.command.d.ts.map +1 -1
- package/dist/src/commands/build/next.command.js.map +1 -1
- package/dist/src/commands/build/rearm.command.d.ts.map +1 -1
- package/dist/src/commands/build/rearm.command.js.map +1 -1
- package/dist/src/commands/build/run.command.d.ts.map +1 -1
- package/dist/src/commands/build/run.command.js.map +1 -1
- package/dist/src/commands/build/tasks.command.d.ts.map +1 -1
- package/dist/src/commands/build/tasks.command.js.map +1 -1
- package/dist/src/commands/compose.command.d.ts.map +1 -1
- package/dist/src/commands/compose.command.js.map +1 -1
- package/dist/src/commands/config/check-resources.command.d.ts +50 -0
- package/dist/src/commands/config/check-resources.command.d.ts.map +1 -0
- package/dist/src/commands/config/check-resources.command.js +121 -0
- package/dist/src/commands/config/check-resources.command.js.map +1 -0
- package/dist/src/commands/config/data-retention.command.d.ts.map +1 -1
- package/dist/src/commands/config/data-retention.command.js.map +1 -1
- package/dist/src/commands/config/document-releases.command.d.ts.map +1 -1
- package/dist/src/commands/config/document-releases.command.js.map +1 -1
- package/dist/src/commands/config/legal-notice.command.d.ts +17 -0
- package/dist/src/commands/config/legal-notice.command.d.ts.map +1 -0
- package/dist/src/commands/config/legal-notice.command.js +59 -0
- package/dist/src/commands/config/legal-notice.command.js.map +1 -0
- package/dist/src/commands/config/mutate.command.d.ts.map +1 -1
- package/dist/src/commands/config/mutate.command.js.map +1 -1
- package/dist/src/commands/config/reapply-declaration.command.d.ts.map +1 -1
- package/dist/src/commands/config/reapply-declaration.command.js.map +1 -1
- package/dist/src/commands/config/service-consent.command.d.ts.map +1 -1
- package/dist/src/commands/config/service-consent.command.js.map +1 -1
- package/dist/src/commands/config/subject-data-recipients.command.d.ts.map +1 -1
- package/dist/src/commands/config/subject-data-recipients.command.js.map +1 -1
- package/dist/src/commands/config/sync.command.d.ts.map +1 -1
- package/dist/src/commands/config/sync.command.js.map +1 -1
- package/dist/src/commands/config/validate.command.d.ts +8 -0
- package/dist/src/commands/config/validate.command.d.ts.map +1 -1
- package/dist/src/commands/config/validate.command.js +65 -4
- package/dist/src/commands/config/validate.command.js.map +1 -1
- package/dist/src/commands/context/assurance-basis.command.d.ts.map +1 -1
- package/dist/src/commands/context/assurance-basis.command.js.map +1 -1
- package/dist/src/commands/context/coherence.command.d.ts.map +1 -1
- package/dist/src/commands/context/coherence.command.js.map +1 -1
- package/dist/src/commands/context/context-command.utils.d.ts.map +1 -1
- package/dist/src/commands/context/context-command.utils.js.map +1 -1
- package/dist/src/commands/context/elements.command.d.ts.map +1 -1
- package/dist/src/commands/context/elements.command.js.map +1 -1
- package/dist/src/commands/context/health.command.d.ts.map +1 -1
- package/dist/src/commands/context/health.command.js.map +1 -1
- package/dist/src/commands/context/info.command.d.ts.map +1 -1
- package/dist/src/commands/context/info.command.js.map +1 -1
- package/dist/src/commands/context/journey.command.d.ts +8 -2
- package/dist/src/commands/context/journey.command.d.ts.map +1 -1
- package/dist/src/commands/context/journey.command.js +102 -12
- package/dist/src/commands/context/journey.command.js.map +1 -1
- package/dist/src/commands/context/jurisdictions.command.d.ts.map +1 -1
- package/dist/src/commands/context/jurisdictions.command.js.map +1 -1
- package/dist/src/commands/context/launch-blockers.command.d.ts +2 -1
- package/dist/src/commands/context/launch-blockers.command.d.ts.map +1 -1
- package/dist/src/commands/context/launch-blockers.command.js +3 -2
- package/dist/src/commands/context/launch-blockers.command.js.map +1 -1
- package/dist/src/commands/context/list.command.d.ts.map +1 -1
- package/dist/src/commands/context/list.command.js.map +1 -1
- package/dist/src/commands/context/pipelines.command.d.ts.map +1 -1
- package/dist/src/commands/context/pipelines.command.js.map +1 -1
- package/dist/src/commands/context/workspace.command.d.ts.map +1 -1
- package/dist/src/commands/context/workspace.command.js.map +1 -1
- package/dist/src/commands/creation/accept.command.d.ts +4 -0
- package/dist/src/commands/creation/accept.command.d.ts.map +1 -1
- package/dist/src/commands/creation/accept.command.js +29 -4
- package/dist/src/commands/creation/accept.command.js.map +1 -1
- package/dist/src/commands/creation/answer.command.d.ts.map +1 -1
- package/dist/src/commands/creation/answer.command.js.map +1 -1
- package/dist/src/commands/creation/brand-logo.command.d.ts +18 -0
- package/dist/src/commands/creation/brand-logo.command.d.ts.map +1 -0
- package/dist/src/commands/creation/brand-logo.command.js +43 -0
- package/dist/src/commands/creation/brand-logo.command.js.map +1 -0
- package/dist/src/commands/creation/brief.command.d.ts.map +1 -1
- package/dist/src/commands/creation/brief.command.js.map +1 -1
- package/dist/src/commands/creation/deliberate.command.d.ts +2 -2
- package/dist/src/commands/creation/deliberate.command.d.ts.map +1 -1
- package/dist/src/commands/creation/deliberate.command.js +2 -2
- package/dist/src/commands/creation/deliberate.command.js.map +1 -1
- package/dist/src/commands/creation/depth.command.d.ts.map +1 -1
- package/dist/src/commands/creation/depth.command.js +1 -1
- package/dist/src/commands/creation/depth.command.js.map +1 -1
- package/dist/src/commands/creation/diff.command.d.ts.map +1 -1
- package/dist/src/commands/creation/diff.command.js.map +1 -1
- package/dist/src/commands/creation/feed.command.d.ts.map +1 -1
- package/dist/src/commands/creation/feed.command.js.map +1 -1
- package/dist/src/commands/creation/loop.command.d.ts.map +1 -1
- package/dist/src/commands/creation/loop.command.js.map +1 -1
- package/dist/src/commands/creation/persona.command.d.ts +3 -2
- package/dist/src/commands/creation/persona.command.d.ts.map +1 -1
- package/dist/src/commands/creation/persona.command.js +10 -3
- package/dist/src/commands/creation/persona.command.js.map +1 -1
- package/dist/src/commands/creation/preflight.command.d.ts.map +1 -1
- package/dist/src/commands/creation/preflight.command.js.map +1 -1
- package/dist/src/commands/creation/prompt-hook.command.d.ts.map +1 -1
- package/dist/src/commands/creation/prompt-hook.command.js.map +1 -1
- package/dist/src/commands/creation/propose.command.d.ts.map +1 -1
- package/dist/src/commands/creation/propose.command.js.map +1 -1
- package/dist/src/commands/creation/pulse.command.d.ts.map +1 -1
- package/dist/src/commands/creation/pulse.command.js.map +1 -1
- package/dist/src/commands/creation/questions.command.d.ts.map +1 -1
- package/dist/src/commands/creation/questions.command.js.map +1 -1
- package/dist/src/commands/creation/reason.command.d.ts.map +1 -1
- package/dist/src/commands/creation/reason.command.js.map +1 -1
- package/dist/src/commands/creation/report.command.d.ts.map +1 -1
- package/dist/src/commands/creation/report.command.js.map +1 -1
- package/dist/src/commands/creation/revert.command.d.ts.map +1 -1
- package/dist/src/commands/creation/revert.command.js.map +1 -1
- package/dist/src/commands/creation/run.command.d.ts.map +1 -1
- package/dist/src/commands/creation/run.command.js.map +1 -1
- package/dist/src/commands/creation/statusline.command.d.ts.map +1 -1
- package/dist/src/commands/creation/statusline.command.js.map +1 -1
- package/dist/src/commands/creation/watch.command.d.ts.map +1 -1
- package/dist/src/commands/creation/watch.command.js.map +1 -1
- package/dist/src/commands/creation/why.command.d.ts +3 -1
- package/dist/src/commands/creation/why.command.d.ts.map +1 -1
- package/dist/src/commands/creation/why.command.js +28 -9
- package/dist/src/commands/creation/why.command.js.map +1 -1
- package/dist/src/commands/creation/writes.command.d.ts.map +1 -1
- package/dist/src/commands/creation/writes.command.js.map +1 -1
- package/dist/src/commands/db/db-schema-plan-migration.utils.d.ts.map +1 -1
- package/dist/src/commands/db/db-schema-plan-migration.utils.js.map +1 -1
- package/dist/src/commands/db/db-schema-plan.utils.d.ts.map +1 -1
- package/dist/src/commands/db/db-schema-plan.utils.js.map +1 -1
- package/dist/src/commands/db/diff.command.d.ts.map +1 -1
- package/dist/src/commands/db/diff.command.js.map +1 -1
- package/dist/src/commands/db/generate.command.d.ts.map +1 -1
- package/dist/src/commands/db/generate.command.js.map +1 -1
- package/dist/src/commands/db/migrate.command.d.ts.map +1 -1
- package/dist/src/commands/db/migrate.command.js.map +1 -1
- package/dist/src/commands/db/resolve.command.d.ts.map +1 -1
- package/dist/src/commands/db/resolve.command.js.map +1 -1
- package/dist/src/commands/dev/charts-audit.command.d.ts.map +1 -1
- 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-generate.command.js.map +1 -1
- package/dist/src/commands/dev/design-tokens-init.command.d.ts.map +1 -1
- package/dist/src/commands/dev/design-tokens-init.command.js.map +1 -1
- package/dist/src/commands/dev/design-tokens-validate.command.d.ts.map +1 -1
- package/dist/src/commands/dev/design-tokens-validate.command.js.map +1 -1
- package/dist/src/commands/dev/force-stop.command.d.ts.map +1 -1
- package/dist/src/commands/dev/force-stop.command.js.map +1 -1
- package/dist/src/commands/dev/resources.command.d.ts.map +1 -1
- package/dist/src/commands/dev/resources.command.js.map +1 -1
- package/dist/src/commands/dev/start.command.d.ts.map +1 -1
- 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/stop-all.command.js.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.map +1 -1
- package/dist/src/commands/docs/publish.command.d.ts.map +1 -1
- package/dist/src/commands/docs/publish.command.js.map +1 -1
- package/dist/src/commands/frontend/publish.command.d.ts.map +1 -1
- package/dist/src/commands/frontend/publish.command.js.map +1 -1
- package/dist/src/commands/fwk/audit.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/audit.command.js.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.map +1 -1
- package/dist/src/commands/fwk/generate-docs.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/generate-docs.command.js.map +1 -1
- package/dist/src/commands/fwk/generate-providers.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/generate-providers.command.js.map +1 -1
- package/dist/src/commands/fwk/graph.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/graph.command.js.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.js.map +1 -1
- package/dist/src/commands/fwk/publish-docker.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-docker.command.js.map +1 -1
- package/dist/src/commands/fwk/publish-npm.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-npm.command.js.map +1 -1
- package/dist/src/commands/fwk/version-bump.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-bump.command.js.map +1 -1
- package/dist/src/commands/fwk/version-set.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-set.command.js.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.map +1 -1
- package/dist/src/commands/fwk/version-sync.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-sync.command.js.map +1 -1
- package/dist/src/commands/fwk/what-touches.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/what-touches.command.js.map +1 -1
- package/dist/src/commands/fwk/wt-status.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/wt-status.command.js.map +1 -1
- package/dist/src/commands/fwk/wt-tail.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/wt-tail.command.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.map +1 -1
- package/dist/src/commands/generate/email-preview.command.d.ts.map +1 -1
- 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-status.command.js.map +1 -1
- package/dist/src/commands/generate/email-test-send.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email-test-send.command.js.map +1 -1
- package/dist/src/commands/generate/email-translate.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email-translate.command.js.map +1 -1
- package/dist/src/commands/generate/email.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email.command.js.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.map +1 -1
- package/dist/src/commands/generate/labels-plan.command.d.ts.map +1 -1
- package/dist/src/commands/generate/labels-plan.command.js.map +1 -1
- package/dist/src/commands/generate/labels.command.d.ts.map +1 -1
- package/dist/src/commands/generate/labels.command.js.map +1 -1
- package/dist/src/commands/generate/translate.command.d.ts.map +1 -1
- package/dist/src/commands/generate/translate.command.js.map +1 -1
- package/dist/src/commands/help.command.d.ts.map +1 -1
- package/dist/src/commands/help.command.js.map +1 -1
- package/dist/src/commands/init.command.d.ts.map +1 -1
- package/dist/src/commands/init.command.js.map +1 -1
- package/dist/src/commands/local/deregister.command.d.ts.map +1 -1
- package/dist/src/commands/local/deregister.command.js.map +1 -1
- package/dist/src/commands/local/dev-status.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev-status.command.js.map +1 -1
- package/dist/src/commands/local/dev.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev.command.js.map +1 -1
- package/dist/src/commands/local/doctor.command.d.ts.map +1 -1
- 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/down.command.js.map +1 -1
- package/dist/src/commands/local/init.command.d.ts.map +1 -1
- 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/logs.command.js.map +1 -1
- package/dist/src/commands/local/reinit.command.d.ts.map +1 -1
- package/dist/src/commands/local/reinit.command.js.map +1 -1
- package/dist/src/commands/local/reset.command.d.ts.map +1 -1
- package/dist/src/commands/local/reset.command.js.map +1 -1
- package/dist/src/commands/local/restore.command.d.ts.map +1 -1
- package/dist/src/commands/local/restore.command.js.map +1 -1
- package/dist/src/commands/local/smoke.command.d.ts.map +1 -1
- package/dist/src/commands/local/smoke.command.js.map +1 -1
- package/dist/src/commands/local/status.command.d.ts.map +1 -1
- package/dist/src/commands/local/status.command.js.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/local-defaults/capture.command.d.ts.map +1 -1
- package/dist/src/commands/local-defaults/capture.command.js.map +1 -1
- package/dist/src/commands/lock/check.command.d.ts.map +1 -1
- package/dist/src/commands/lock/check.command.js.map +1 -1
- package/dist/src/commands/market/generate.command.d.ts.map +1 -1
- package/dist/src/commands/market/generate.command.js.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.map +1 -1
- package/dist/src/commands/prefs/set.command.d.ts.map +1 -1
- package/dist/src/commands/prefs/set.command.js.map +1 -1
- package/dist/src/commands/providers/show.command.d.ts.map +1 -1
- package/dist/src/commands/providers/show.command.js.map +1 -1
- package/dist/src/commands/registry/add.command.d.ts.map +1 -1
- package/dist/src/commands/registry/add.command.js.map +1 -1
- package/dist/src/commands/registry/info.command.d.ts.map +1 -1
- package/dist/src/commands/registry/info.command.js.map +1 -1
- package/dist/src/commands/registry/key.command.d.ts.map +1 -1
- package/dist/src/commands/registry/key.command.js.map +1 -1
- package/dist/src/commands/registry/lockfile-smoke.command.d.ts.map +1 -1
- package/dist/src/commands/registry/lockfile-smoke.command.js.map +1 -1
- package/dist/src/commands/registry/login.command.d.ts.map +1 -1
- 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/logout.command.js.map +1 -1
- package/dist/src/commands/registry/outdated.command.d.ts.map +1 -1
- package/dist/src/commands/registry/outdated.command.js.map +1 -1
- package/dist/src/commands/registry/ping.command.d.ts.map +1 -1
- package/dist/src/commands/registry/ping.command.js.map +1 -1
- package/dist/src/commands/registry/publish.command.d.ts.map +1 -1
- package/dist/src/commands/registry/publish.command.js.map +1 -1
- package/dist/src/commands/registry/registry-transport.constants.d.ts.map +1 -1
- package/dist/src/commands/registry/registry-transport.constants.js.map +1 -1
- package/dist/src/commands/registry/remove.command.d.ts.map +1 -1
- package/dist/src/commands/registry/remove.command.js.map +1 -1
- package/dist/src/commands/registry/repair-lockfile.command.d.ts.map +1 -1
- package/dist/src/commands/registry/repair-lockfile.command.js.map +1 -1
- package/dist/src/commands/registry/search.command.d.ts.map +1 -1
- package/dist/src/commands/registry/search.command.js.map +1 -1
- package/dist/src/commands/registry/status.command.d.ts.map +1 -1
- package/dist/src/commands/registry/status.command.js.map +1 -1
- package/dist/src/commands/registry/update.command.d.ts.map +1 -1
- package/dist/src/commands/registry/update.command.js.map +1 -1
- package/dist/src/commands/registry/whoami.command.d.ts.map +1 -1
- package/dist/src/commands/registry/whoami.command.js.map +1 -1
- package/dist/src/commands/registry/yank.command.d.ts.map +1 -1
- package/dist/src/commands/registry/yank.command.js.map +1 -1
- package/dist/src/commands/remote/create.command.d.ts.map +1 -1
- package/dist/src/commands/remote/create.command.js.map +1 -1
- package/dist/src/commands/remote/list.command.d.ts.map +1 -1
- package/dist/src/commands/remote/list.command.js.map +1 -1
- package/dist/src/commands/remote/status.command.d.ts.map +1 -1
- package/dist/src/commands/remote/status.command.js.map +1 -1
- package/dist/src/commands/remote/sync.command.d.ts.map +1 -1
- package/dist/src/commands/remote/sync.command.js.map +1 -1
- package/dist/src/commands/secrets/github.command.d.ts.map +1 -1
- package/dist/src/commands/secrets/github.command.js.map +1 -1
- package/dist/src/commands/secrets/list.command.d.ts.map +1 -1
- package/dist/src/commands/secrets/list.command.js.map +1 -1
- package/dist/src/commands/secrets/set.command.d.ts.map +1 -1
- package/dist/src/commands/secrets/set.command.js.map +1 -1
- package/dist/src/commands/secrets/unset.command.d.ts.map +1 -1
- package/dist/src/commands/secrets/unset.command.js.map +1 -1
- package/dist/src/commands/setup.command.d.ts.map +1 -1
- package/dist/src/commands/setup.command.js.map +1 -1
- package/dist/src/commands/update.command.d.ts.map +1 -1
- package/dist/src/commands/update.command.js.map +1 -1
- package/dist/src/commands/version.command.d.ts.map +1 -1
- package/dist/src/commands/version.command.js.map +1 -1
- package/dist/src/commands/website/audit.command.d.ts.map +1 -1
- package/dist/src/commands/website/audit.command.js.map +1 -1
- package/dist/src/commands/workbench/open.command.d.ts.map +1 -1
- package/dist/src/commands/workbench/open.command.js.map +1 -1
- package/dist/src/commands/workbench/parallelism.command.d.ts.map +1 -1
- package/dist/src/commands/workbench/parallelism.command.js.map +1 -1
- package/dist/src/commands/workbench/status.command.d.ts.map +1 -1
- package/dist/src/commands/workbench/status.command.js.map +1 -1
- package/dist/src/infrastructure/errors/error.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/errors/error.utils.js.map +1 -1
- package/dist/src/infrastructure/io/file.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/io/file.utils.js.map +1 -1
- package/dist/src/infrastructure/io/io.schemas.d.ts.map +1 -1
- package/dist/src/infrastructure/io/io.schemas.js.map +1 -1
- package/dist/src/infrastructure/io/template-processor.d.ts.map +1 -1
- package/dist/src/infrastructure/io/template-processor.js.map +1 -1
- package/dist/src/infrastructure/logger/logger.service.d.ts.map +1 -1
- package/dist/src/infrastructure/logger/logger.service.js.map +1 -1
- package/dist/src/infrastructure/process/spawn.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/process/spawn.utils.js.map +1 -1
- package/dist/src/infrastructure/ui/formatting.service.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/formatting.service.js.map +1 -1
- package/dist/src/infrastructure/ui/interaction-engine.service.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/interaction-engine.service.js.map +1 -1
- package/dist/src/infrastructure/ui/markdown-renderer.service.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/markdown-renderer.service.js.map +1 -1
- package/dist/src/infrastructure/ui/ui.schemas.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/ui.schemas.js.map +1 -1
- package/dist/src/infrastructure/utils/string.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/utils/string.utils.js.map +1 -1
- package/dist/src/infrastructure/validation/validator.service.d.ts.map +1 -1
- package/dist/src/infrastructure/validation/validator.service.js.map +1 -1
- package/dist/src/kernel/base-command.d.ts.map +1 -1
- package/dist/src/kernel/base-command.js.map +1 -1
- package/dist/src/kernel/bootstrap.d.ts.map +1 -1
- package/dist/src/kernel/bootstrap.js.map +1 -1
- package/dist/src/kernel/command-index-cache.d.ts.map +1 -1
- package/dist/src/kernel/command-index-cache.js.map +1 -1
- package/dist/src/kernel/command-registry.d.ts.map +1 -1
- 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-runner.js.map +1 -1
- package/dist/src/kernel/command-scope-utils.d.ts.map +1 -1
- package/dist/src/kernel/command-scope-utils.js.map +1 -1
- package/dist/src/kernel/flag-utils.d.ts.map +1 -1
- package/dist/src/kernel/flag-utils.js.map +1 -1
- package/dist/src/kernel/hooks.d.ts.map +1 -1
- package/dist/src/kernel/hooks.js.map +1 -1
- package/dist/src/kernel/logger.d.ts.map +1 -1
- package/dist/src/kernel/logger.js.map +1 -1
- package/dist/src/kernel/types.d.ts.map +1 -1
- package/dist/src/kernel/types.js.map +1 -1
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js.map +1 -1
- package/dist/src/modules/domain/credentials/admin-user.module.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/admin-user.module.js.map +1 -1
- package/dist/src/modules/domain/credentials/approver-user.module.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/approver-user.module.js.map +1 -1
- package/dist/src/modules/domain/credentials/creation-essentials.module.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/creation-essentials.module.js.map +1 -1
- package/dist/src/modules/domain/credentials/module.types.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/module.types.js.map +1 -1
- package/dist/src/modules/domain/environment/database-config.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/database-config.module.js.map +1 -1
- package/dist/src/modules/domain/environment/module.types.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/module.types.js.map +1 -1
- package/dist/src/modules/domain/environment/paths-config.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/paths-config.module.js.map +1 -1
- package/dist/src/modules/domain/environment/runtime-selector.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/runtime-selector.module.js.map +1 -1
- package/dist/src/modules/domain/environment/runtime-semantics.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/runtime-semantics.module.js.map +1 -1
- package/dist/src/modules/domain/module.types.d.ts.map +1 -1
- package/dist/src/modules/domain/module.types.js.map +1 -1
- package/dist/src/services/application/app-bootstrap.service.d.ts.map +1 -1
- 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-env.service.js.map +1 -1
- package/dist/src/services/application/app-local-runtime-addresses.service.d.ts.map +1 -1
- package/dist/src/services/application/app-local-runtime-addresses.service.js.map +1 -1
- package/dist/src/services/application/app-runtime-targets.service.d.ts.map +1 -1
- package/dist/src/services/application/app-runtime-targets.service.js.map +1 -1
- package/dist/src/services/application/app-schema-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/app-schema-bootstrap.service.js.map +1 -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.map +1 -1
- package/dist/src/services/application/application-browser-smoke.service.d.ts.map +1 -1
- package/dist/src/services/application/application-browser-smoke.service.js.map +1 -1
- package/dist/src/services/application/application-creation-readiness.service.d.ts.map +1 -1
- package/dist/src/services/application/application-creation-readiness.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-dependency-alignment.service.js.map +1 -1
- package/dist/src/services/application/application-dev-port-offsets.d.ts.map +1 -1
- package/dist/src/services/application/application-dev-port-offsets.js.map +1 -1
- package/dist/src/services/application/application-initialization-verification.service.d.ts.map +1 -1
- package/dist/src/services/application/application-initialization-verification.service.js.map +1 -1
- package/dist/src/services/application/application-root.utils.d.ts.map +1 -1
- package/dist/src/services/application/application-root.utils.js.map +1 -1
- package/dist/src/services/application/application-runtime-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/application-runtime-bootstrap.service.js.map +1 -1
- package/dist/src/services/application/backend-config.paths.d.ts.map +1 -1
- package/dist/src/services/application/backend-config.paths.js.map +1 -1
- package/dist/src/services/application/composition-provider-plan.service.d.ts.map +1 -1
- package/dist/src/services/application/composition-provider-plan.service.js.map +1 -1
- package/dist/src/services/application/creation-host-readiness.service.d.ts.map +1 -1
- package/dist/src/services/application/creation-host-readiness.service.js.map +1 -1
- package/dist/src/services/application/creation-preflight.service.d.ts.map +1 -1
- package/dist/src/services/application/creation-preflight.service.js.map +1 -1
- package/dist/src/services/application/degraded-registration-declaration-convergence.service.d.ts.map +1 -1
- package/dist/src/services/application/degraded-registration-declaration-convergence.service.js.map +1 -1
- package/dist/src/services/application/dev-orchestrator.service.d.ts.map +1 -1
- package/dist/src/services/application/dev-orchestrator.service.js.map +1 -1
- package/dist/src/services/application/dev-schema-drift.service.d.ts.map +1 -1
- package/dist/src/services/application/dev-schema-drift.service.js.map +1 -1
- package/dist/src/services/application/environment-provider-configurations.service.d.ts.map +1 -1
- package/dist/src/services/application/environment-provider-configurations.service.js.map +1 -1
- package/dist/src/services/application/existing-app-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/existing-app-bootstrap.service.js.map +1 -1
- package/dist/src/services/application/frontend-provider-source.service.d.ts.map +1 -1
- package/dist/src/services/application/frontend-provider-source.service.js.map +1 -1
- package/dist/src/services/application/frontend-public-config-secret-screen.service.d.ts.map +1 -1
- package/dist/src/services/application/frontend-public-config-secret-screen.service.js.map +1 -1
- package/dist/src/services/application/local-app-reinit.service.d.ts.map +1 -1
- package/dist/src/services/application/local-app-reinit.service.js.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.map +1 -1
- package/dist/src/services/application/provider-package-links.service.d.ts.map +1 -1
- package/dist/src/services/application/provider-package-links.service.js.map +1 -1
- package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
- package/dist/src/services/application/provider-runtime-sync.service.js.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.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.map +1 -1
- package/dist/src/services/application/stored-declaration-currency.service.d.ts.map +1 -1
- package/dist/src/services/application/stored-declaration-currency.service.js.map +1 -1
- package/dist/src/services/application/systems-of-record-library.service.d.ts.map +1 -1
- package/dist/src/services/application/systems-of-record-library.service.js.map +1 -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.map +1 -1
- package/dist/src/services/catalog/service-catalog.schemas.d.ts.map +1 -1
- package/dist/src/services/catalog/service-catalog.schemas.js.map +1 -1
- 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.map +1 -1
- package/dist/src/services/coding-agents/coding-agent-login.service.d.ts.map +1 -1
- package/dist/src/services/coding-agents/coding-agent-login.service.js.map +1 -1
- package/dist/src/services/companion/build-console.service.d.ts +62 -2
- package/dist/src/services/companion/build-console.service.d.ts.map +1 -1
- package/dist/src/services/companion/build-console.service.js +70 -5
- package/dist/src/services/companion/build-console.service.js.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.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.map +1 -1
- package/dist/src/services/companion/companion-health-hint.utils.d.ts.map +1 -1
- package/dist/src/services/companion/companion-health-hint.utils.js.map +1 -1
- package/dist/src/services/companion/companion-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/companion/companion-lifecycle.service.js.map +1 -1
- package/dist/src/services/companion/companion-local-token.utils.d.ts.map +1 -1
- package/dist/src/services/companion/companion-local-token.utils.js.map +1 -1
- 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/console-fast-path.d.ts +21 -3
- package/dist/src/services/companion/console-fast-path.d.ts.map +1 -1
- package/dist/src/services/companion/console-fast-path.js +57 -12
- package/dist/src/services/companion/console-fast-path.js.map +1 -1
- package/dist/src/services/companion/console-verb.utils.d.ts.map +1 -1
- package/dist/src/services/companion/console-verb.utils.js.map +1 -1
- package/dist/src/services/companion/creation-console.service.d.ts +76 -0
- package/dist/src/services/companion/creation-console.service.d.ts.map +1 -1
- package/dist/src/services/companion/creation-console.service.js +124 -11
- package/dist/src/services/companion/creation-console.service.js.map +1 -1
- package/dist/src/services/companion/creation-run-report.models.d.ts.map +1 -1
- package/dist/src/services/companion/creation-run-report.models.js.map +1 -1
- package/dist/src/services/companion/git-helper.service.d.ts.map +1 -1
- package/dist/src/services/companion/git-helper.service.js.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.map +1 -1
- package/dist/src/services/companion/workbench-browser-launcher.service.d.ts.map +1 -1
- package/dist/src/services/companion/workbench-browser-launcher.service.js.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.map +1 -1
- package/dist/src/services/compliance/data-retention-schedule.generator.d.ts.map +1 -1
- package/dist/src/services/compliance/data-retention-schedule.generator.js.map +1 -1
- package/dist/src/services/compliance/generated-compliance-module-wiring.d.ts +5 -3
- package/dist/src/services/compliance/generated-compliance-module-wiring.d.ts.map +1 -1
- package/dist/src/services/compliance/generated-compliance-module-wiring.js +4 -2
- package/dist/src/services/compliance/generated-compliance-module-wiring.js.map +1 -1
- package/dist/src/services/compliance/governed-document-releases.generator.d.ts.map +1 -1
- package/dist/src/services/compliance/governed-document-releases.generator.js.map +1 -1
- package/dist/src/services/compliance/legal-notice.generator.d.ts +45 -0
- package/dist/src/services/compliance/legal-notice.generator.d.ts.map +1 -0
- package/dist/src/services/compliance/legal-notice.generator.js +97 -0
- package/dist/src/services/compliance/legal-notice.generator.js.map +1 -0
- package/dist/src/services/compliance/service-consent-requirement.generator.d.ts.map +1 -1
- package/dist/src/services/compliance/service-consent-requirement.generator.js.map +1 -1
- package/dist/src/services/compliance/subject-data-recipients.generator.d.ts.map +1 -1
- package/dist/src/services/compliance/subject-data-recipients.generator.js.map +1 -1
- package/dist/src/services/context/context-manager.service.d.ts.map +1 -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/context.schemas.js.map +1 -1
- package/dist/src/services/context/machine-preferences.writer.d.ts.map +1 -1
- package/dist/src/services/context/machine-preferences.writer.js.map +1 -1
- package/dist/src/services/context/state-manager.service.d.ts.map +1 -1
- package/dist/src/services/context/state-manager.service.js.map +1 -1
- package/dist/src/services/credentials/application-secret-owners.service.d.ts.map +1 -1
- package/dist/src/services/credentials/application-secret-owners.service.js.map +1 -1
- package/dist/src/services/credentials/application-secrets.service.d.ts.map +1 -1
- package/dist/src/services/credentials/application-secrets.service.js.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.map +1 -1
- package/dist/src/services/credentials/composed-provider-catalogue.d.ts.map +1 -1
- package/dist/src/services/credentials/composed-provider-catalogue.js.map +1 -1
- package/dist/src/services/credentials/credentials.schemas.d.ts.map +1 -1
- 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/credentials.service.js.map +1 -1
- package/dist/src/services/credentials/framework-managed-secrets.d.ts.map +1 -1
- package/dist/src/services/credentials/framework-managed-secrets.js.map +1 -1
- package/dist/src/services/credentials/local-defaults.service.d.ts.map +1 -1
- package/dist/src/services/credentials/local-defaults.service.js.map +1 -1
- package/dist/src/services/credentials/local-secrets-store.service.d.ts.map +1 -1
- package/dist/src/services/credentials/local-secrets-store.service.js.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
- package/dist/src/services/credentials/provider-secret-format.d.ts.map +1 -1
- package/dist/src/services/credentials/provider-secret-format.js.map +1 -1
- package/dist/src/services/credentials/remote-secrets-store.service.d.ts.map +1 -1
- package/dist/src/services/credentials/remote-secrets-store.service.js.map +1 -1
- package/dist/src/services/credentials/secret-requirements.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secret-requirements.service.js.map +1 -1
- package/dist/src/services/credentials/secrets-provisioning.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-provisioning.service.js.map +1 -1
- package/dist/src/services/credentials/secrets-reader.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-reader.service.js.map +1 -1
- package/dist/src/services/credentials/secrets-rotation.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-rotation.service.js.map +1 -1
- package/dist/src/services/credentials/secrets-writer.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-writer.service.js.map +1 -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.map +1 -1
- package/dist/src/services/data-services/data-services.service.d.ts.map +1 -1
- package/dist/src/services/data-services/data-services.service.js.map +1 -1
- package/dist/src/services/deployment/apps-manager-diagnostics.service.d.ts.map +1 -1
- package/dist/src/services/deployment/apps-manager-diagnostics.service.js.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.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.map +1 -1
- package/dist/src/services/deployment/docker/backing-service-health-watch.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/backing-service-health-watch.js.map +1 -1
- package/dist/src/services/deployment/docker/compose-service-health.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/compose-service-health.js.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js.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-compose-readiness.service.js.map +1 -1
- package/dist/src/services/deployment/docker/docker.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker.schemas.js.map +1 -1
- package/dist/src/services/deployment/docker/docker.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker.service.js.map +1 -1
- package/dist/src/services/deployment/docker/local-data-adoption.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/local-data-adoption.service.js.map +1 -1
- package/dist/src/services/deployment/host-toolchain-readiness.service.d.ts.map +1 -1
- package/dist/src/services/deployment/host-toolchain-readiness.service.js.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.map +1 -1
- package/dist/src/services/deployment/k8s/cluster-controller-charts.constants.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/cluster-controller-charts.constants.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-bootstrap.service.d.ts.map +1 -1
- 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-local-infra-readiness.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts.map +1 -1
- 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-operations.service.js.map +1 -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.map +1 -1
- package/dist/src/services/deployment/k8s/k8s.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s.schemas.js.map +1 -1
- package/dist/src/services/deployment/k8s/kind.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/kind.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/local-k8s-application-pruning.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/local-k8s-application-pruning.service.js.map +1 -1
- package/dist/src/services/deployment/local-dev-observer-lifecycle.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-observer-lifecycle.js.map +1 -1
- package/dist/src/services/deployment/local-dev-output-boundary.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-output-boundary.js.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-session-lease.service.js.map +1 -1
- package/dist/src/services/deployment/local-dev-shutdown-coordinator.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-shutdown-coordinator.js.map +1 -1
- package/dist/src/services/deployment/local-infrastructure-initialization.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-infrastructure-initialization.service.js.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.schemas.js.map +1 -1
- package/dist/src/services/deployment/local-precondition-checks.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-precondition-checks.service.js.map +1 -1
- package/dist/src/services/deployment/local-runtime-process-cleanup.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-runtime-process-cleanup.service.js.map +1 -1
- package/dist/src/services/deployment/platform-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/deployment/platform-lifecycle.service.js.map +1 -1
- package/dist/src/services/deployment/platform-runtime-policy.service.d.ts.map +1 -1
- package/dist/src/services/deployment/platform-runtime-policy.service.js.map +1 -1
- package/dist/src/services/deployment/version-compare.utils.d.ts.map +1 -1
- package/dist/src/services/deployment/version-compare.utils.js.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-command.service.js.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.service.js.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-config.template.js.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-css-block.service.js.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-paths.service.js.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.constants.js.map +1 -1
- package/dist/src/services/design-tokens/design-tokens.models.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens.models.js.map +1 -1
- package/dist/src/services/environment/application-backing-service-addressing.utils.d.ts.map +1 -1
- package/dist/src/services/environment/application-backing-service-addressing.utils.js.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.js.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.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
- 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-hydration.utils.js.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.js.map +1 -1
- package/dist/src/services/environment/environment-paths.service.d.ts.map +1 -1
- 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-registry.service.js.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.map +1 -1
- package/dist/src/services/environment/environment.schemas.d.ts.map +1 -1
- package/dist/src/services/environment/environment.schemas.js.map +1 -1
- package/dist/src/services/environment/environment.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment.service.js.map +1 -1
- package/dist/src/services/environment/hosted-infrastructure-leftovers.service.d.ts.map +1 -1
- package/dist/src/services/environment/hosted-infrastructure-leftovers.service.js.map +1 -1
- package/dist/src/services/environment/infrastructure-host.service.d.ts.map +1 -1
- package/dist/src/services/environment/infrastructure-host.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-engine-change.utils.js.map +1 -1
- package/dist/src/services/environment/platform-runtime-state.service.d.ts.map +1 -1
- package/dist/src/services/environment/platform-runtime-state.service.js.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/environment/runtime-bootstrap.service.js.map +1 -1
- package/dist/src/services/framework/application-claude-settings.d.ts +39 -5
- package/dist/src/services/framework/application-claude-settings.d.ts.map +1 -1
- package/dist/src/services/framework/application-claude-settings.js +100 -25
- package/dist/src/services/framework/application-claude-settings.js.map +1 -1
- package/dist/src/services/framework/application-rule-imports.d.ts.map +1 -1
- package/dist/src/services/framework/application-rule-imports.js.map +1 -1
- package/dist/src/services/framework/claude-plugin-compiler.d.ts.map +1 -1
- package/dist/src/services/framework/claude-plugin-compiler.js +3 -2
- package/dist/src/services/framework/claude-plugin-compiler.js.map +1 -1
- package/dist/src/services/framework/dev-compile-status.paths.d.ts.map +1 -1
- package/dist/src/services/framework/dev-compile-status.paths.js.map +1 -1
- 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.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-application-guidance.validator.js.map +1 -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.map +1 -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.map +1 -1
- package/dist/src/services/framework/framework-knowledge-scan.constants.d.ts.map +1 -1
- package/dist/src/services/framework/framework-knowledge-scan.constants.js.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.map +1 -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.map +1 -1
- package/dist/src/services/framework/framework-release.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-release.service.js.map +1 -1
- package/dist/src/services/framework/framework-update.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-update.service.js.map +1 -1
- package/dist/src/services/framework/framework-version.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-version.service.js.map +1 -1
- package/dist/src/services/framework/frontend-component-catalog.generator.d.ts.map +1 -1
- package/dist/src/services/framework/frontend-component-catalog.generator.js.map +1 -1
- package/dist/src/services/framework/frontend-library-root-exports.d.ts.map +1 -1
- package/dist/src/services/framework/frontend-library-root-exports.js.map +1 -1
- package/dist/src/services/framework/installed-framework-assets.service.d.ts.map +1 -1
- package/dist/src/services/framework/installed-framework-assets.service.js.map +1 -1
- package/dist/src/services/framework/npm-registry-output.d.ts.map +1 -1
- package/dist/src/services/framework/npm-registry-output.js.map +1 -1
- package/dist/src/services/framework/package-install.service.d.ts.map +1 -1
- package/dist/src/services/framework/package-install.service.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/activepieces-source.reader.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/activepieces-source.reader.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/api-version-settlement.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/api-version-settlement.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/base-url-settlement.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/base-url-settlement.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/openapi-enrichment.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/openapi-enrichment.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/openapi-source.reader.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/openapi-source.reader.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/provider-catalogue-record.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/provider-catalogue-record.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/provider-merge.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/provider-merge.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/provider-package.emitter.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/provider-package.emitter.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/request-helper-url.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/request-helper-url.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/sim-source.reader.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/sim-source.reader.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/source-static-evaluator.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/source-static-evaluator.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/transposed-provider.model.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/transposed-provider.model.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/url-template.extractor.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/url-template.extractor.js.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.map +1 -1
- package/dist/src/services/frontend/frontend-dist-uploader.service.d.ts.map +1 -1
- package/dist/src/services/frontend/frontend-dist-uploader.service.js.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.map +1 -1
- package/dist/src/services/generation/domain-generator.service.d.ts.map +1 -1
- package/dist/src/services/generation/domain-generator.service.js.map +1 -1
- package/dist/src/services/generation/generator.schemas.d.ts.map +1 -1
- package/dist/src/services/generation/generator.schemas.js.map +1 -1
- package/dist/src/services/generation/operation-generator.service.d.ts.map +1 -1
- package/dist/src/services/generation/operation-generator.service.js.map +1 -1
- package/dist/src/services/generation/resource-generator.service.d.ts.map +1 -1
- package/dist/src/services/generation/resource-generator.service.js.map +1 -1
- package/dist/src/services/generation/template-registry.service.d.ts.map +1 -1
- package/dist/src/services/generation/template-registry.service.js.map +1 -1
- package/dist/src/services/registry/artifact-extractor.utils.d.ts.map +1 -1
- package/dist/src/services/registry/artifact-extractor.utils.js.map +1 -1
- package/dist/src/services/registry/artifact-trust.utils.d.ts.map +1 -1
- package/dist/src/services/registry/artifact-trust.utils.js.map +1 -1
- package/dist/src/services/registry/boundary-fanout.utils.d.ts.map +1 -1
- package/dist/src/services/registry/boundary-fanout.utils.js.map +1 -1
- package/dist/src/services/registry/git-ignored-paths.utils.d.ts.map +1 -1
- package/dist/src/services/registry/git-ignored-paths.utils.js.map +1 -1
- package/dist/src/services/registry/index.d.ts.map +1 -1
- package/dist/src/services/registry/index.js.map +1 -1
- package/dist/src/services/registry/installed-file-state.utils.d.ts.map +1 -1
- package/dist/src/services/registry/installed-file-state.utils.js.map +1 -1
- package/dist/src/services/registry/local-checkout-module-source.service.d.ts.map +1 -1
- package/dist/src/services/registry/local-checkout-module-source.service.js.map +1 -1
- package/dist/src/services/registry/migration-obligation.utils.d.ts.map +1 -1
- package/dist/src/services/registry/migration-obligation.utils.js.map +1 -1
- package/dist/src/services/registry/module-acquisition.utils.d.ts.map +1 -1
- package/dist/src/services/registry/module-acquisition.utils.js.map +1 -1
- package/dist/src/services/registry/module-artifact-files.utils.d.ts.map +1 -1
- package/dist/src/services/registry/module-artifact-files.utils.js.map +1 -1
- package/dist/src/services/registry/module-registration.service.d.ts.map +1 -1
- package/dist/src/services/registry/module-registration.service.js.map +1 -1
- package/dist/src/services/registry/module-requirements.service.d.ts.map +1 -1
- package/dist/src/services/registry/module-requirements.service.js.map +1 -1
- package/dist/src/services/registry/provider-install-step.d.ts.map +1 -1
- package/dist/src/services/registry/provider-install-step.js.map +1 -1
- package/dist/src/services/registry/provider-module-checks.service.d.ts.map +1 -1
- package/dist/src/services/registry/provider-module-checks.service.js.map +1 -1
- package/dist/src/services/registry/provider-module-identity.service.d.ts.map +1 -1
- package/dist/src/services/registry/provider-module-identity.service.js.map +1 -1
- package/dist/src/services/registry/provider-wiring.service.d.ts.map +1 -1
- package/dist/src/services/registry/provider-wiring.service.js.map +1 -1
- package/dist/src/services/registry/registry-command.utils.d.ts.map +1 -1
- package/dist/src/services/registry/registry-command.utils.js.map +1 -1
- package/dist/src/services/registry/registry-config-resolver.service.d.ts.map +1 -1
- package/dist/src/services/registry/registry-config-resolver.service.js.map +1 -1
- package/dist/src/services/registry/registry-credentials.service.d.ts.map +1 -1
- package/dist/src/services/registry/registry-credentials.service.js.map +1 -1
- package/dist/src/services/registry/saas-root-required.error.d.ts.map +1 -1
- package/dist/src/services/registry/saas-root-required.error.js.map +1 -1
- package/dist/src/services/security/csp-sync.service.d.ts.map +1 -1
- 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/tools/utility-tools.service.js.map +1 -1
- package/dist/src/services/tracker/creation-run-tracker.service.d.ts.map +1 -1
- package/dist/src/services/tracker/creation-run-tracker.service.js.map +1 -1
- package/dist/src/services/website/website-label-pack-audit.service.d.ts.map +1 -1
- package/dist/src/services/website/website-label-pack-audit.service.js.map +1 -1
- 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.map +1 -1
- package/dist/src/services/website/website-workspace.service.d.ts.map +1 -1
- package/dist/src/services/website/website-workspace.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +17 -17
- package/templates/saas/i18n/email/email-template-definitions.ts +5 -1
- package/templates/saas/scenarios/add-locale/files/website/src/i18n/__localePath__.json.hbs +21 -1
- package/templates/saas/scenarios/add-locale/files/website/src/pages/__localePath__/index.astro +1 -0
- package/templates/saas/scenarios/add-marketing-page/files/website/src/pages/__pageRef__.astro.hbs +1 -0
- package/templates/saas/scenarios/add-module/scenario.json +5 -0
- package/templates/saas/scenarios/add-website/files/website/src/components/FooterComponent.tsx.hbs +14 -6
- package/templates/saas/scenarios/add-website/files/website/src/content/llms.txt.hbs +3 -3
- package/templates/saas/scenarios/add-website/files/website/src/i18n/en.json.hbs +4 -0
- package/templates/saas/scenarios/add-website/files/website/src/pages/index.astro +1 -0
- package/templates/saas/scenarios/add-website/files/website/src/pages/llms.txt.ts +3 -1
- package/templates/saas/scenarios/add-website/files/website/src/styles/website.css +14 -0
- package/templates/saas/skeleton/backend-api/src/engine/email/email-template-definitions.ts +5 -1
- package/templates/saas/skeleton/shared-lib/src/engine/roles.ts +10 -2
- package/templates/saas/skeleton/specifications/src/companion-exports.ts +28 -3
- package/wildo-framework.info.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-infrastructure-leftovers.service.js","sourceRoot":"","sources":["../../../../../../src/services/environment/hosted-infrastructure-leftovers.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,wEAAwE,CAAC;AACnH,OAAO,EACL,yBAAyB,EACzB,WAAW,GAEZ,MAAM,qDAAqD,CAAC;AAE7D,+GAA+G;AAC/G,MAAM,0BAA0B,GAAG,mCAAmC,CAAC;AACvE,MAA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IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,2BAA2B,CAAC,OAAe;IAClD,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAC/F,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;QAAE,OAAO,EAAE,CAAC;IACxC,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,kGAAkG;QAClG,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IAE7D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAiC,CAAC,CAAC,CAAC;IACxE,OAAO,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC;SAC7C,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,WAAW,CAAC,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SACjG,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,OAAiD,CAAC;SACrE,IAAI,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import { existsSync, readdirSync, readFileSync } from 'fs';\nimport { join } from 'path';\nimport { FILE_NAMES } from '~wildo-cli/infrastructure/io/io.schemas';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { DockerUtils } from '~wildo-cli/services/deployment/docker/docker.service';\nimport { buildLocalDataVolumeScope } from '~wildo-cli/services/deployment/docker/docker-compose-generator.service';\nimport {\n SECRETS_SECTION_OWNERSHIP,\n SecretOwner,\n type PlatformEnvSecretsJson,\n} from '~wildo-cli/services/credentials/credentials.schemas';\n\n/** The rendered platform compose project and the env file it reads — both the infrastructure host's to own. */\nconst PLATFORM_COMPOSE_FILE_NAME = 'docker-compose.wildo-platform.yml';\nconst PLATFORM_COMPOSE_ENV_FILE_NAME = '.env.wildo-platform';\n\nexport interface HostedInfrastructureLeftover {\n /** What the artifact is, in one clause an operator can act on. */\n readonly what: string;\n /**\n * WHERE it is. Absolute for anything on disk, so the operator can LOOK before removing anything.\n *\n * A Docker volume has no such path — on macOS and Windows its bytes live inside the runtime's VM\n * — so a volume leftover carries the command that inspects it (`docker volume inspect <name>`)\n * rather than a filesystem location it does not have. Reporting an invented path would be worse\n * than reporting none: it sends an operator to a directory that is not there, on the one entry\n * whose whole purpose is to be looked at before it is deleted.\n */\n readonly path: string;\n}\n\n/**\n * The infrastructure artifacts an application wrote while it still OWNED its environment, still on disk\n * after it became hosted (#1194).\n *\n * ## Why this is reported at all — nothing here changes behaviour\n *\n * A hosted environment reads its host's compose project and its host's shared credentials, so every\n * artifact below is inert. That is exactly what makes it worth naming: it is indistinguishable from live\n * configuration by looking at it. Measured on Wonder CRM, hosted by Wonder Todos, 2026-09-16:\n *\n * - the stale compose render declares the SAME fixed container names as the host's (`wildo-postgresql`,\n * `wildo-valkey`, …) over a DIFFERENT data directory, so running it by hand claims the host's\n * containers over the wrong bytes — the divergence hosting exists to end;\n * - 493 MB of `local_data` no container binds any more;\n * - the application's own `secrets.json` still carried every SHARED section, one of which (`mongot`) had\n * already diverged from the host's copy.\n *\n * ## Report, never delete\n *\n * Each entry names a path and says it is inert. Deleting on the operator's behalf would remove the only\n * copy of data they may still want to migrate out of the old store, and a stale store is not an emergency.\n * `writeSecretsJson` already projects application-owned sections for a hosted environment, so the secrets\n * entry disappears on the next legitimate write; the others have no such path.\n */\nexport function collectHostedInfrastructureLeftovers(input: {\n saasRoot: string;\n envName: string;\n}): readonly HostedInfrastructureLeftover[] {\n const leftovers: HostedInfrastructureLeftover[] = [];\n const composeDir = EnvironmentPaths.resolveDockerComposeDir(input.envName);\n\n const composeFile = join(composeDir, PLATFORM_COMPOSE_FILE_NAME);\n if (existsSync(composeFile)) {\n leftovers.push({\n what: 'a rendered platform compose project — it declares the same container names as the host\\'s over this '\n + 'application\\'s own data directories, so running it by hand would claim the host\\'s containers',\n path: composeFile,\n });\n }\n\n const composeEnvFile = join(composeDir, PLATFORM_COMPOSE_ENV_FILE_NAME);\n if (existsSync(composeEnvFile)) {\n leftovers.push({ what: 'the platform env file that compose project reads', path: composeEnvFile });\n }\n\n const localDataDir = EnvironmentPaths.resolveScopedLocalDataDir(input.saasRoot);\n const localDataEntries = readDirectoryEntries(localDataDir);\n if (localDataEntries.length > 0) {\n leftovers.push({\n what: `backing-service data this application no longer runs (${localDataEntries.join(', ')}) — the host's `\n + 'containers bind the HOST\\'s directories',\n path: localDataDir,\n });\n }\n\n /*\n * The volume half of the same leftover. An application that OWNED its environment and kept its\n * backing-service data in named volumes still has them after it became hosted: nothing mounts\n * them, `wildo local reset` refuses for a hosted environment, and — unlike the directory half —\n * there is no folder an operator stumbles over. Measured invisibility is what earns it a report.\n *\n * Listed from Docker rather than derived from the current environment, because the environment\n * that created them is precisely the one that stopped existing: it may have been authored\n * `DOCKER_VOLUME` and re-authored since, and its service list may have changed. The name prefix\n * carries the per-application scope, so only THIS application's volumes are reported.\n */\n for (const volume of listOwnLocalDataVolumes(input.saasRoot)) {\n leftovers.push({\n what: `backing-service data in a Docker volume this application no longer runs (${volume}) — `\n + 'the host\\'s containers use the HOST\\'s storage',\n path: `docker volume inspect ${volume}`,\n });\n }\n\n const ownSharedSections = readOwnSharedSecretSections(input.envName);\n if (ownSharedSections.length > 0) {\n leftovers.push({\n what: `shared credential sections in this application's own secrets file (${ownSharedSections.join(', ')}) — `\n + 'a hosted environment reads these from the host, so a copy here can diverge unnoticed',\n path: join(EnvironmentPaths.resolveSecretsDir(input.envName), FILE_NAMES.SECRETS_JSON),\n });\n }\n\n return leftovers;\n}\n\n/**\n * This application's own backing-service data volumes, by the per-application name scope.\n *\n * Best-effort: a Docker that is not running is not a finding here — the leftovers report is a\n * diagnostic and must never turn \"Docker is down\" into an infrastructure complaint it cannot\n * substantiate (`negative-results-require-a-positive-probe.md`: an empty list from a daemon that\n * never answered is not evidence of absence, so it is reported as nothing rather than as none).\n */\nfunction listOwnLocalDataVolumes(saasRoot: string): string[] {\n const prefix = `wildo-local-data-${buildLocalDataVolumeScope(saasRoot)}-`;\n const listed = DockerUtils.listVolumeNames();\n if (!listed.success) return [];\n return listed.names.filter((name) => name.startsWith(prefix)).sort();\n}\n\nfunction readDirectoryEntries(directory: string): string[] {\n if (!existsSync(directory)) return [];\n try {\n // Dotfiles are not backing-service data (`.DS_Store`, editor droppings) and reporting one as\n // leftover infrastructure would send an operator looking for a store that was never there.\n return readdirSync(directory).filter((entry) => !entry.startsWith('.')).sort();\n } catch {\n return [];\n }\n}\n\n/**\n * The SHARED-owned sections present in the application's OWN secrets file, by\n * {@link SECRETS_SECTION_OWNERSHIP} — the same vocabulary the hosted read overlay and the writer use, so\n * a section added to the contract tomorrow is classified here without an edit.\n */\nfunction readOwnSharedSecretSections(envName: string): string[] {\n const secretsPath = join(EnvironmentPaths.resolveSecretsDir(envName), FILE_NAMES.SECRETS_JSON);\n if (!existsSync(secretsPath)) return [];\n let parsed: unknown;\n try {\n parsed = JSON.parse(readFileSync(secretsPath, 'utf8'));\n } catch {\n // An unreadable secrets file is a different problem, reported by the checks that need to READ it.\n return [];\n }\n if (typeof parsed !== 'object' || parsed === null) return [];\n\n const present = new Set(Object.keys(parsed as Record<string, unknown>));\n return Object.entries(SECRETS_SECTION_OWNERSHIP)\n .filter(([section, owner]) => owner === SecretOwner.SHARED_INFRASTRUCTURE && present.has(section))\n .map(([section]) => section as keyof PlatformEnvSecretsJson as string)\n .sort();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"hosted-infrastructure-leftovers.service.js","sourceRoot":"","sources":["../../../../src/services/environment/hosted-infrastructure-leftovers.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,wEAAwE,CAAC;AACnH,OAAO,EACL,yBAAyB,EACzB,WAAW,GAEZ,MAAM,qDAAqD,CAAC;AAE7D,+GAA+G;AAC/G,MAAM,0BAA0B,GAAG,mCAAmC,CAAC;AACvE,MAAM,8BAA8B,GAAG,qBAAqB,CAAC;AAiB7D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,oCAAoC,CAAC,KAGpD;IACC,MAAM,SAAS,GAAmC,EAAE,CAAC;IACrD,MAAM,UAAU,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAE3E,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,0BAA0B,CAAC,CAAC;IACjE,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC5B,SAAS,CAAC,IAAI,CAAC;YACb,IAAI,EAAE,sGAAsG;kBACxG,+FAA+F;YACnG,IAAI,EAAE,WAAW;SAClB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,8BAA8B,CAAC,CAAC;IACxE,IAAI,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QAC/B,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,kDAAkD,EAAE,IAAI,EAAE,cAAc,EAAE,CAA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E,OAAO,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC;SAC7C,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,WAAW,CAAC,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SACjG,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,OAAiD,CAAC;SACrE,IAAI,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import { existsSync, readdirSync, readFileSync } from 'fs';\nimport { join } from 'path';\nimport { FILE_NAMES } from '~wildo-cli/infrastructure/io/io.schemas';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { DockerUtils } from '~wildo-cli/services/deployment/docker/docker.service';\nimport { buildLocalDataVolumeScope } from '~wildo-cli/services/deployment/docker/docker-compose-generator.service';\nimport {\n SECRETS_SECTION_OWNERSHIP,\n SecretOwner,\n type PlatformEnvSecretsJson,\n} from '~wildo-cli/services/credentials/credentials.schemas';\n\n/** The rendered platform compose project and the env file it reads — both the infrastructure host's to own. */\nconst PLATFORM_COMPOSE_FILE_NAME = 'docker-compose.wildo-platform.yml';\nconst PLATFORM_COMPOSE_ENV_FILE_NAME = '.env.wildo-platform';\n\nexport interface HostedInfrastructureLeftover {\n /** What the artifact is, in one clause an operator can act on. */\n readonly what: string;\n /**\n * WHERE it is. Absolute for anything on disk, so the operator can LOOK before removing anything.\n *\n * A Docker volume has no such path — on macOS and Windows its bytes live inside the runtime's VM\n * — so a volume leftover carries the command that inspects it (`docker volume inspect <name>`)\n * rather than a filesystem location it does not have. Reporting an invented path would be worse\n * than reporting none: it sends an operator to a directory that is not there, on the one entry\n * whose whole purpose is to be looked at before it is deleted.\n */\n readonly path: string;\n}\n\n/**\n * The infrastructure artifacts an application wrote while it still OWNED its environment, still on disk\n * after it became hosted (#1194).\n *\n * ## Why this is reported at all — nothing here changes behaviour\n *\n * A hosted environment reads its host's compose project and its host's shared credentials, so every\n * artifact below is inert. That is exactly what makes it worth naming: it is indistinguishable from live\n * configuration by looking at it. Measured on Wonder CRM, hosted by Wonder Todos, 2026-09-16:\n *\n * - the stale compose render declares the SAME fixed container names as the host's (`wildo-postgresql`,\n * `wildo-valkey`, …) over a DIFFERENT data directory, so running it by hand claims the host's\n * containers over the wrong bytes — the divergence hosting exists to end;\n * - 493 MB of `local_data` no container binds any more;\n * - the application's own `secrets.json` still carried every SHARED section, one of which (`mongot`) had\n * already diverged from the host's copy.\n *\n * ## Report, never delete\n *\n * Each entry names a path and says it is inert. Deleting on the operator's behalf would remove the only\n * copy of data they may still want to migrate out of the old store, and a stale store is not an emergency.\n * `writeSecretsJson` already projects application-owned sections for a hosted environment, so the secrets\n * entry disappears on the next legitimate write; the others have no such path.\n */\nexport function collectHostedInfrastructureLeftovers(input: {\n saasRoot: string;\n envName: string;\n}): readonly HostedInfrastructureLeftover[] {\n const leftovers: HostedInfrastructureLeftover[] = [];\n const composeDir = EnvironmentPaths.resolveDockerComposeDir(input.envName);\n\n const composeFile = join(composeDir, PLATFORM_COMPOSE_FILE_NAME);\n if (existsSync(composeFile)) {\n leftovers.push({\n what: 'a rendered platform compose project — it declares the same container names as the host\\'s over this '\n + 'application\\'s own data directories, so running it by hand would claim the host\\'s containers',\n path: composeFile,\n });\n }\n\n const composeEnvFile = join(composeDir, PLATFORM_COMPOSE_ENV_FILE_NAME);\n if (existsSync(composeEnvFile)) {\n leftovers.push({ what: 'the platform env file that compose project reads', path: composeEnvFile });\n }\n\n const localDataDir = EnvironmentPaths.resolveScopedLocalDataDir(input.saasRoot);\n const localDataEntries = readDirectoryEntries(localDataDir);\n if (localDataEntries.length > 0) {\n leftovers.push({\n what: `backing-service data this application no longer runs (${localDataEntries.join(', ')}) — the host's `\n + 'containers bind the HOST\\'s directories',\n path: localDataDir,\n });\n }\n\n /*\n * The volume half of the same leftover. An application that OWNED its environment and kept its\n * backing-service data in named volumes still has them after it became hosted: nothing mounts\n * them, `wildo local reset` refuses for a hosted environment, and — unlike the directory half —\n * there is no folder an operator stumbles over. Measured invisibility is what earns it a report.\n *\n * Listed from Docker rather than derived from the current environment, because the environment\n * that created them is precisely the one that stopped existing: it may have been authored\n * `DOCKER_VOLUME` and re-authored since, and its service list may have changed. The name prefix\n * carries the per-application scope, so only THIS application's volumes are reported.\n */\n for (const volume of listOwnLocalDataVolumes(input.saasRoot)) {\n leftovers.push({\n what: `backing-service data in a Docker volume this application no longer runs (${volume}) — `\n + 'the host\\'s containers use the HOST\\'s storage',\n path: `docker volume inspect ${volume}`,\n });\n }\n\n const ownSharedSections = readOwnSharedSecretSections(input.envName);\n if (ownSharedSections.length > 0) {\n leftovers.push({\n what: `shared credential sections in this application's own secrets file (${ownSharedSections.join(', ')}) — `\n + 'a hosted environment reads these from the host, so a copy here can diverge unnoticed',\n path: join(EnvironmentPaths.resolveSecretsDir(input.envName), FILE_NAMES.SECRETS_JSON),\n });\n }\n\n return leftovers;\n}\n\n/**\n * This application's own backing-service data volumes, by the per-application name scope.\n *\n * Best-effort: a Docker that is not running is not a finding here — the leftovers report is a\n * diagnostic and must never turn \"Docker is down\" into an infrastructure complaint it cannot\n * substantiate (`negative-results-require-a-positive-probe.md`: an empty list from a daemon that\n * never answered is not evidence of absence, so it is reported as nothing rather than as none).\n */\nfunction listOwnLocalDataVolumes(saasRoot: string): string[] {\n const prefix = `wildo-local-data-${buildLocalDataVolumeScope(saasRoot)}-`;\n const listed = DockerUtils.listVolumeNames();\n if (!listed.success) return [];\n return listed.names.filter((name) => name.startsWith(prefix)).sort();\n}\n\nfunction readDirectoryEntries(directory: string): string[] {\n if (!existsSync(directory)) return [];\n try {\n // Dotfiles are not backing-service data (`.DS_Store`, editor droppings) and reporting one as\n // leftover infrastructure would send an operator looking for a store that was never there.\n return readdirSync(directory).filter((entry) => !entry.startsWith('.')).sort();\n } catch {\n return [];\n }\n}\n\n/**\n * The SHARED-owned sections present in the application's OWN secrets file, by\n * {@link SECRETS_SECTION_OWNERSHIP} — the same vocabulary the hosted read overlay and the writer use, so\n * a section added to the contract tomorrow is classified here without an edit.\n */\nfunction readOwnSharedSecretSections(envName: string): string[] {\n const secretsPath = join(EnvironmentPaths.resolveSecretsDir(envName), FILE_NAMES.SECRETS_JSON);\n if (!existsSync(secretsPath)) return [];\n let parsed: unknown;\n try {\n parsed = JSON.parse(readFileSync(secretsPath, 'utf8'));\n } catch {\n // An unreadable secrets file is a different problem, reported by the checks that need to READ it.\n return [];\n }\n if (typeof parsed !== 'object' || parsed === null) return [];\n\n const present = new Set(Object.keys(parsed as Record<string, unknown>));\n return Object.entries(SECRETS_SECTION_OWNERSHIP)\n .filter(([section, owner]) => owner === SecretOwner.SHARED_INFRASTRUCTURE && present.has(section))\n .map(([section]) => section as keyof PlatformEnvSecretsJson as string)\n .sort();\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infrastructure-host.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"infrastructure-host.service.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/infrastructure-host.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAK5G,oGAAoG;AACpG,MAAM,WAAW,6BAA6B;IAC5C,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,oBAAY,0BAA0B;IACpC,uBAAuB,4BAA4B;IACnD,kBAAkB,uBAAuB;IACzC,yBAAyB,8BAA8B;IACvD,qBAAqB,0BAA0B;IAC/C,yBAAyB,8BAA8B;IACvD,mBAAmB,wBAAwB;IAC3C,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,oBAAoB,yBAAyB;IAC7C,yBAAyB,8BAA8B;IACvD,qBAAqB,0BAA0B;CAChD;AAiDD;;;GAGG;AACH,qBAAa,oCAAqC,S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gCAAgC,EAAE,MAAM,GAAG,oBAAoB,CAAC,EAC1E,MAAM,EAAE,0BAA0B,GACjC,IAAI;IAOP;;;;OAIG;IACH,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,6BAA6B,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;CAGjG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infrastructure-host.service.js","sourceRoot":"","sources":["../../../../../../src/services/environment/infrastructure-host.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAErF,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAE7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAO5D;;;GAGG;AACH,MAAM,CAAN,IAAY,0BAYX;AAZD,WAAY,0BAA0B;IACpC,iFAAmD,CAAA;IACnD,uEAAyC,CAAA;IACzC,qFAAuD,CAAA;IACvD,6EAA+C,CAAA;IAC/C,qFAAuD,CAAA;IACvD,yEAA2C,CAAA;IAC3C,+DAAiC,CAAA;IACjC,6DAA+B,CAAA;IAC/B,2EAA6C,CAAA;IAC7C,qFAAuD,CAAA;IACvD,6EAA+C,CAAA;AACjD,CAAC,EAZW,0BAA0B,KAA1B,0BAA0B,QAYrC;AAED,MAAM,6BAA6B,GAA2F;IAC5H,CAAC,0BAA0B,CAAC,uBAAuB,CAAC,EAAE;QACpD,OAAO,EAAE,gDAAgD;QACzD,WAAW,EAAE,qCAAqC;KACnD;IACD,CAAC,0BAA0B,CAAC,kBAAkB,CAAC,EAAE;QAC/C,OAAO,EAAE,kEAAkE;QAC3E,WAAW,EAAE,sCAAsC;KACpD;IACD,CAAC,0BAA0B,CAAC,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AgB,CAAC,CAAC;IACzG,CAAC;CACF","sourcesContent":["/**\n * infrastructure-host — the one question every shared-infrastructure action asks first: does THIS\n * application own the infrastructure of this environment, or does it run on another application's?\n *\n * Several applications share one platform per environment. One OWNS it — its Docker Compose project or\n * cluster, its backing services, its platform services — and the others declare that owner as their\n * `infrastructureHost` in `wildo.infra.<env>.config.ts`. A hosted application registers against the\n * host's running platform and writes its OWN runtime material; everything that renders, starts, stops,\n * recreates, wipes or initializes SHARED infrastructure belongs to the host.\n *\n * Before this existed, \"whoever ran the command\" owned the shared substrate. Every application rendered\n * its own `wildo-local` compose file with the same container names and its own `local_data`, so the last\n * application to start decided the containers' configuration, credentials and data (issue #50 is the\n * outage that produced, and the runtime lease it added only protects a session that is RUNNING).\n * Declaring the host makes ownership a fact of the repository rather than of timing.\n */\n\nimport { join } from 'path';\nimport { loadInfraEnvConfig, resolveAppLayout } from '@wildo-ai/platform-config-lib';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { EnvironmentRegistry } from '~wildo-cli/services/environment/environment-registry.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\n\nimport { describeCaughtError } from '@wildo-ai/saas-models';\n/** The resolved host of a hosted environment (absolute paths, produced by `loadInfraEnvConfig`). */\nexport interface EnvironmentInfrastructureHost {\n applicationRoot: string;\n infraConfigPath: string;\n}\n\n/**\n * The actions only an environment's infrastructure OWNER may perform. Each guard site names one, so the\n * refusal can say precisely what was refused and which host command does it instead.\n */\nexport enum SharedInfrastructureAction {\n RENDER_PLATFORM_COMPOSE = 'render-platform-compose',\n WRITE_PLATFORM_ENV = 'write-platform-env',\n CONVERGE_BACKING_SERVICES = 'converge-backing-services',\n STOP_BACKING_SERVICES = 'stop-backing-services',\n WIPE_BACKING_SERVICE_DATA = 'wipe-backing-service-data',\n INITIALIZE_PLATFORM = 'initialize-platform',\n START_PLATFORM = 'start-platform',\n STOP_PLATFORM = 'stop-platform',\n BOOTSTRAP_KUBERNETES = 'bootstrap-kubernetes',\n RENDER_PLATFORM_MANIFESTS = 'render-platform-manifests',\n ROTATE_SHARED_SECRETS = 'rotate-shared-secrets',\n}\n\nconst SHARED_INFRASTRUCTURE_ACTIONS: Readonly<Record<SharedInfrastructureAction, { refused: string; hostCommand: string }>> = {\n [SharedInfrastructureAction.RENDER_PLATFORM_COMPOSE]: {\n refused: 'render the shared platform Docker Compose file',\n hostCommand: 'wildo config sync --domain manifest',\n },\n [SharedInfrastructureAction.WRITE_PLATFORM_ENV]: {\n refused: 'write the shared platform environment file (.env.wildo-platform)',\n hostCommand: 'wildo config sync --domain env-files',\n },\n [SharedInfrastructureAction.CONVERGE_BACKING_SERVICES]: {\n refused: 'start or recreate the shared backing services',\n hostCommand: 'wildo local dev',\n },\n [SharedInfrastructureAction.STOP_BACKING_SERVICES]: {\n refused: 'stop the shared backing services',\n hostCommand: 'wildo local down',\n },\n [SharedInfrastructureAction.WIPE_BACKING_SERVICE_DATA]: {\n refused: 'wipe the shared backing-service data',\n hostCommand: 'wildo local reset',\n },\n [SharedInfrastructureAction.INITIALIZE_PLATFORM]: {\n refused: 'initialize the shared platform',\n hostCommand: 'wildo local init',\n },\n [SharedInfrastructureAction.START_PLATFORM]: {\n refused: 'start the shared platform services',\n hostCommand: 'wildo local dev',\n },\n [SharedInfrastructureAction.STOP_PLATFORM]: {\n refused: 'stop the shared platform services',\n hostCommand: 'wildo local down',\n },\n [SharedInfrastructureAction.BOOTSTRAP_KUBERNETES]: {\n refused: 'bootstrap the shared Kubernetes cluster',\n hostCommand: 'wildo setup',\n },\n [SharedInfrastructureAction.RENDER_PLATFORM_MANIFESTS]: {\n refused: 'render the shared Kubernetes manifests',\n hostCommand: 'wildo config sync --domain manifest',\n },\n [SharedInfrastructureAction.ROTATE_SHARED_SECRETS]: {\n refused: 'rotate the shared platform and backing-service secrets',\n hostCommand: 'wildo config sync --domain secrets --rotate-secrets',\n },\n};\n\n/**\n * A hosted application attempted an action that belongs to its infrastructure host. Names the host and\n * the command to run there, because the remedy is never \"retry here\".\n */\nexport class SharedInfrastructureOwnedByHostError extends Error {\n readonly host: EnvironmentInfrastructureHost;\n readonly action: SharedInfrastructureAction;\n\n constructor(envName: string, host: EnvironmentInfrastructureHost, action: SharedInfrastructureAction) {\n const { refused, hostCommand } = SHARED_INFRASTRUCTURE_ACTIONS[action];\n super(\n `This application runs on the infrastructure of ${host.applicationRoot} in environment '${envName}' `\n + `(declared by infrastructureHost), so it cannot ${refused} — that belongs to the host. Run it from the host application:\\n`\n + ` cd ${host.applicationRoot} && ${hostCommand}\\n`\n + 'If this environment no longer declares infrastructureHost, its generated state still describes the host: reconcile it '\n + 'first with `wildo local init` (or `wildo config sync`).',\n );\n this.name = 'SharedInfrastructureOwnedByHostError';\n this.host = host;\n this.action = action;\n }\n}\n\nexport class InfrastructureHost {\n /**\n * The host of `env`, or `null` when this application owns the environment's infrastructure.\n *\n * FAIL-CLOSED over the two persisted copies: a host named by EITHER the generated `config.json` or the\n * registry record wins. The two can disagree for a moment — `config.json` is rewritten by a reconcile,\n * the record by a refresh, and an operator may have added the link between the two — and the costs of\n * the two mistakes are not symmetric. Reading a hosted application as standalone recreates the host's\n * containers under the wrong configuration, which is an outage; reading a standalone one as hosted\n * refuses a command with a message that names the reconcile. So an ambiguity reads as hosted.\n *\n * Synchronous, because the guard sites are. Command ENTRY decisions, which run before any reconcile,\n * use {@link resolveAuthored} instead and read the authored descriptor itself.\n */\n static resolve(env: Pick<PlatformEnvironmentConfiguration, 'name' | 'infrastructureHost'>): EnvironmentInfrastructureHost | null {\n return env.infrastructureHost ?? InfrastructureHost.readPersistedHost(env.name);\n }\n\n /** {@link resolve} for a caller holding only the environment's name. */\n static resolveByName(envName: string): EnvironmentInfrastructureHost | null {\n return InfrastructureHost.readPersistedHost(envName);\n }\n\n /**\n * The host named by the PERSISTED copies (`config.json`, the registry record), or `null` when neither\n * names one — or when there is no targeted application scope to read them from at all.\n *\n * That last case returns `null` rather than throwing, and it is not an opening: a guard runs inside\n * lanes that have no application root (a CI render, a unit under test), and every path that turns an\n * environment into a HOSTED one also writes `infrastructureHost` onto the in-memory record the caller\n * passes to {@link resolve} — the seed, the authored refresh, the `config.json` hydration and setup. The\n * persisted copies are the second source, consulted to catch a record that has not been refreshed yet.\n */\n private static readPersistedHost(envName: string): EnvironmentInfrastructureHost | null {\n try {\n return EnvironmentRegistry.resolveInfrastructureHost(envName, EnvironmentPaths.resolveConfigDir(envName));\n } catch {\n return null;\n }\n }\n\n /**\n * For a command about to act on shared infrastructure: whose infrastructure is this, per the AUTHORED\n * descriptor when the application root is known and a descriptor exists — the authority, and the only\n * source that is current before any reconcile. The persisted copies are consulted only when there is no\n * descriptor to read (no targeted root, or an environment authored nowhere).\n *\n * An existing standalone descriptor therefore answers `null` even while a stale `config.json` still names\n * a host: the operator removed the link, and the command reconciles the persisted copies itself.\n */\n static async resolveForCommand(\n saasRoot: string | null | undefined,\n env: Pick<PlatformEnvironmentConfiguration, 'name' | 'infrastructureHost'>,\n ): Promise<EnvironmentInfrastructureHost | null> {\n if (saasRoot) {\n const loaded = await loadInfraEnvConfig(saasRoot, env.name);\n if (loaded !== null) return loaded.config.infrastructureHost ?? null;\n }\n return InfrastructureHost.resolve(env);\n }\n\n static isHosted(env: Pick<PlatformEnvironmentConfiguration, 'name' | 'infrastructureHost'>): boolean {\n return InfrastructureHost.resolve(env) !== null;\n }\n\n /**\n * The host as the AUTHORED descriptor declares it, resolved through the shared loader — the authority,\n * read before any generated artifact has been reconciled. `null` when the environment has no descriptor\n * or owns its infrastructure.\n */\n static async resolveAuthored(saasRoot: string, envName: string): Promise<EnvironmentInfrastructureHost | null> {\n const loaded = await loadInfraEnvConfig(saasRoot, envName);\n return loaded?.config.infrastructureHost ?? null;\n }\n\n /**\n * For a COMMAND whose whole purpose is shared infrastructure (`local up`, `local down`, `local reset`,\n * …): the refusal message to print when this environment is hosted, or `null` when it owns its\n * infrastructure. A descriptor that cannot be resolved (its host is not checked out) is a refusal too —\n * fail-closed, since \"cannot tell whose infrastructure this is\" is the one state in which acting on it\n * is least safe.\n */\n static async describeRefusal(\n saasRoot: string | null | undefined,\n env: Pick<PlatformEnvironmentConfiguration, 'name' | 'infrastructureHost'>,\n action: SharedInfrastructureAction,\n ): Promise<string | null> {\n try {\n const host = await InfrastructureHost.resolveForCommand(saasRoot, env);\n return host === null ? null : new SharedInfrastructureOwnedByHostError(env.name, host, action).message;\n } catch (error) {\n return describeCaughtError(error);\n }\n }\n\n /** Refuse a shared-infrastructure action for a hosted environment. A no-op for an owning one. */\n static assertOwnsSharedInfrastructure(\n env: Pick<PlatformEnvironmentConfiguration, 'name' | 'infrastructureHost'>,\n action: SharedInfrastructureAction,\n ): void {\n const host = InfrastructureHost.resolve(env);\n if (host !== null) {\n throw new SharedInfrastructureOwnedByHostError(env.name, host, action);\n }\n }\n\n /**\n * Where the host renders its Docker Compose project for `envName`. A hosted application INSPECTS the\n * shared containers through the host's file — the only one that describes them — and never through a\n * render of its own, which would carry its own `local_data` paths.\n */\n static resolveHostDockerComposeDir(host: EnvironmentInfrastructureHost, envName: string): string {\n return join(resolveAppLayout(host.applicationRoot).runtimeEnvironmentsHome, envName, 'docker-compose');\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"infrastructure-host.service.js","sourceRoot":"","sources":["../../../../src/services/environment/infrastructure-host.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAErF,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAE7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAO5D;;;GAGG;AACH,MAAM,CAAN,IAAY,0BAYX;AAZD,WAAY,0BAA0B;I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,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAED,iGAAiG;IACjG,MAAM,CAAC,8BAA8B,CACnC,GAA0E,EAC1E,MAAkC;QAElC,MAAM,IAAI,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,MAAM,IAAI,oCAAoC,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,2BAA2B,CAAC,IAAmC,EAAE,OAAe;QACrF,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,uBAAuB,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC;IACzG,CAAC;CACF","sourcesContent":["/**\n * infrastructure-host — the one question every shared-infrastructure action asks first: does THIS\n * application own the infrastructure of this environment, or does it run on another application's?\n *\n * Several applications share one platform per environment. One OWNS it — its Docker Compose project or\n * cluster, its backing services, its platform services — and the others declare that owner as their\n * `infrastructureHost` in `wildo.infra.<env>.config.ts`. A hosted application registers against the\n * host's running platform and writes its OWN runtime material; everything that renders, starts, stops,\n * recreates, wipes or initializes SHARED infrastructure belongs to the host.\n *\n * Before this existed, \"whoever ran the command\" owned the shared substrate. Every application rendered\n * its own `wildo-local` compose file with the same container names and its own `local_data`, so the last\n * application to start decided the containers' configuration, credentials and data (issue #50 is the\n * outage that produced, and the runtime lease it added only protects a session that is RUNNING).\n * Declaring the host makes ownership a fact of the repository rather than of timing.\n */\n\nimport { join } from 'path';\nimport { loadInfraEnvConfig, resolveAppLayout } from '@wildo-ai/platform-config-lib';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { EnvironmentRegistry } from '~wildo-cli/services/environment/environment-registry.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\n\nimport { describeCaughtError } from '@wildo-ai/saas-models';\n/** The resolved host of a hosted environment (absolute paths, produced by `loadInfraEnvConfig`). */\nexport interface EnvironmentInfrastructureHost {\n applicationRoot: string;\n infraConfigPath: string;\n}\n\n/**\n * The actions only an environment's infrastructure OWNER may perform. Each guard site names one, so the\n * refusal can say precisely what was refused and which host command does it instead.\n */\nexport enum SharedInfrastructureAction {\n RENDER_PLATFORM_COMPOSE = 'render-platform-compose',\n WRITE_PLATFORM_ENV = 'write-platform-env',\n CONVERGE_BACKING_SERVICES = 'converge-backing-services',\n STOP_BACKING_SERVICES = 'stop-backing-services',\n WIPE_BACKING_SERVICE_DATA = 'wipe-backing-service-data',\n INITIALIZE_PLATFORM = 'initialize-platform',\n START_PLATFORM = 'start-platform',\n STOP_PLATFORM = 'stop-platform',\n BOOTSTRAP_KUBERNETES = 'bootstrap-kubernetes',\n RENDER_PLATFORM_MANIFESTS = 'render-platform-manifests',\n ROTATE_SHARED_SECRETS = 'rotate-shared-secrets',\n}\n\nconst SHARED_INFRASTRUCTURE_ACTIONS: Readonly<Record<SharedInfrastructureAction, { refused: string; hostCommand: string }>> = {\n [SharedInfrastructureAction.RENDER_PLATFORM_COMPOSE]: {\n refused: 'render the shared platform Docker Compose file',\n hostCommand: 'wildo config sync --domain manifest',\n },\n [SharedInfrastructureAction.WRITE_PLATFORM_ENV]: {\n refused: 'write the shared platform environment file (.env.wildo-platform)',\n hostCommand: 'wildo config sync --domain env-files',\n },\n [SharedInfrastructureAction.CONVERGE_BACKING_SERVICES]: {\n refused: 'start or recreate the shared backing services',\n hostCommand: 'wildo local dev',\n },\n [SharedInfrastructureAction.STOP_BACKING_SERVICES]: {\n refused: 'stop the shared backing services',\n hostCommand: 'wildo local down',\n },\n [SharedInfrastructureAction.WIPE_BACKING_SERVICE_DATA]: {\n refused: 'wipe the shared backing-service data',\n hostCommand: 'wildo local reset',\n },\n [SharedInfrastructureAction.INITIALIZE_PLATFORM]: {\n refused: 'initialize the shared platform',\n hostCommand: 'wildo local init',\n },\n [SharedInfrastructureAction.START_PLATFORM]: {\n refused: 'start the shared platform services',\n hostCommand: 'wildo local dev',\n },\n [SharedInfrastructureAction.STOP_PLATFORM]: {\n refused: 'stop the shared platform services',\n hostCommand: 'wildo local down',\n },\n [SharedInfrastructureAction.BOOTSTRAP_KUBERNETES]: {\n refused: 'bootstrap the shared Kubernetes cluster',\n hostCommand: 'wildo setup',\n },\n [SharedInfrastructureAction.RENDER_PLATFORM_MANIFESTS]: {\n refused: 'render the shared Kubernetes manifests',\n hostCommand: 'wildo config sync --domain manifest',\n },\n [SharedInfrastructureAction.ROTATE_SHARED_SECRETS]: {\n refused: 'rotate the shared platform and backing-service secrets',\n hostCommand: 'wildo config sync --domain secrets --rotate-secrets',\n },\n};\n\n/**\n * A hosted application attempted an action that belongs to its infrastructure host. Names the host and\n * the command to run there, because the remedy is never \"retry here\".\n */\nexport class SharedInfrastructureOwnedByHostError extends Error {\n readonly host: EnvironmentInfrastructureHost;\n readonly action: SharedInfrastructureAction;\n\n constructor(envName: string, host: EnvironmentInfrastructureHost, action: SharedInfrastructureAction) {\n const { refused, hostCommand } = SHARED_INFRASTRUCTURE_ACTIONS[action];\n super(\n `This application runs on the infrastructure of ${host.applicationRoot} in environment '${envName}' `\n + `(declared by infrastructureHost), so it cannot ${refused} — that belongs to the host. Run it from the host application:\\n`\n + ` cd ${host.applicationRoot} && ${hostCommand}\\n`\n + 'If this environment no longer declares infrastructureHost, its generated state still describes the host: reconcile it '\n + 'first with `wildo local init` (or `wildo config sync`).',\n );\n this.name = 'SharedInfrastructureOwnedByHostError';\n this.host = host;\n this.action = action;\n }\n}\n\nexport class InfrastructureHost {\n /**\n * The host of `env`, or `null` when this application owns the environment's infrastructure.\n *\n * FAIL-CLOSED over the two persisted copies: a host named by EITHER the generated `config.json` or the\n * registry record wins. The two can disagree for a moment — `config.json` is rewritten by a reconcile,\n * the record by a refresh, and an operator may have added the link between the two — and the costs of\n * the two mistakes are not symmetric. Reading a hosted application as standalone recreates the host's\n * containers under the wrong configuration, which is an outage; reading a standalone one as hosted\n * refuses a command with a message that names the reconcile. So an ambiguity reads as hosted.\n *\n * Synchronous, because the guard sites are. Command ENTRY decisions, which run before any reconcile,\n * use {@link resolveAuthored} instead and read the authored descriptor itself.\n */\n static resolve(env: Pick<PlatformEnvironmentConfiguration, 'name' | 'infrastructureHost'>): EnvironmentInfrastructureHost | null {\n return env.infrastructureHost ?? InfrastructureHost.readPersistedHost(env.name);\n }\n\n /** {@link resolve} for a caller holding only the environment's name. */\n static resolveByName(envName: string): EnvironmentInfrastructureHost | null {\n return InfrastructureHost.readPersistedHost(envName);\n }\n\n /**\n * The host named by the PERSISTED copies (`config.json`, the registry record), or `null` when neither\n * names one — or when there is no targeted application scope to read them from at all.\n *\n * That last case returns `null` rather than throwing, and it is not an opening: a guard runs inside\n * lanes that have no application root (a CI render, a unit under test), and every path that turns an\n * environment into a HOSTED one also writes `infrastructureHost` onto the in-memory record the caller\n * passes to {@link resolve} — the seed, the authored refresh, the `config.json` hydration and setup. The\n * persisted copies are the second source, consulted to catch a record that has not been refreshed yet.\n */\n private static readPersistedHost(envName: string): EnvironmentInfrastructureHost | null {\n try {\n return EnvironmentRegistry.resolveInfrastructureHost(envName, EnvironmentPaths.resolveConfigDir(envName));\n } catch {\n return null;\n }\n }\n\n /**\n * For a command about to act on shared infrastructure: whose infrastructure is this, per the AUTHORED\n * descriptor when the application root is known and a descriptor exists — the authority, and the only\n * source that is current before any reconcile. The persisted copies are consulted only when there is no\n * descriptor to read (no targeted root, or an environment authored nowhere).\n *\n * An existing standalone descriptor therefore answers `null` even while a stale `config.json` still names\n * a host: the operator removed the link, and the command reconciles the persisted copies itself.\n */\n static async resolveForCommand(\n saasRoot: string | null | undefined,\n env: Pick<PlatformEnvironmentConfiguration, 'name' | 'infrastructureHost'>,\n ): Promise<EnvironmentInfrastructureHost | null> {\n if (saasRoot) {\n const loaded = await loadInfraEnvConfig(saasRoot, env.name);\n if (loaded !== null) return loaded.config.infrastructureHost ?? null;\n }\n return InfrastructureHost.resolve(env);\n }\n\n static isHosted(env: Pick<PlatformEnvironmentConfiguration, 'name' | 'infrastructureHost'>): boolean {\n return InfrastructureHost.resolve(env) !== null;\n }\n\n /**\n * The host as the AUTHORED descriptor declares it, resolved through the shared loader — the authority,\n * read before any generated artifact has been reconciled. `null` when the environment has no descriptor\n * or owns its infrastructure.\n */\n static async resolveAuthored(saasRoot: string, envName: string): Promise<EnvironmentInfrastructureHost | null> {\n const loaded = await loadInfraEnvConfig(saasRoot, envName);\n return loaded?.config.infrastructureHost ?? null;\n }\n\n /**\n * For a COMMAND whose whole purpose is shared infrastructure (`local up`, `local down`, `local reset`,\n * …): the refusal message to print when this environment is hosted, or `null` when it owns its\n * infrastructure. A descriptor that cannot be resolved (its host is not checked out) is a refusal too —\n * fail-closed, since \"cannot tell whose infrastructure this is\" is the one state in which acting on it\n * is least safe.\n */\n static async describeRefusal(\n saasRoot: string | null | undefined,\n env: Pick<PlatformEnvironmentConfiguration, 'name' | 'infrastructureHost'>,\n action: SharedInfrastructureAction,\n ): Promise<string | null> {\n try {\n const host = await InfrastructureHost.resolveForCommand(saasRoot, env);\n return host === null ? null : new SharedInfrastructureOwnedByHostError(env.name, host, action).message;\n } catch (error) {\n return describeCaughtError(error);\n }\n }\n\n /** Refuse a shared-infrastructure action for a hosted environment. A no-op for an owning one. */\n static assertOwnsSharedInfrastructure(\n env: Pick<PlatformEnvironmentConfiguration, 'name' | 'infrastructureHost'>,\n action: SharedInfrastructureAction,\n ): void {\n const host = InfrastructureHost.resolve(env);\n if (host !== null) {\n throw new SharedInfrastructureOwnedByHostError(env.name, host, action);\n }\n }\n\n /**\n * Where the host renders its Docker Compose project for `envName`. A hosted application INSPECTS the\n * shared containers through the host's file — the only one that describes them — and never through a\n * render of its own, which would carry its own `local_data` paths.\n */\n static resolveHostDockerComposeDir(host: EnvironmentInfrastructureHost, envName: string): string {\n return join(resolveAppLayout(host.applicationRoot).runtimeEnvironmentsHome, envName, 'docker-compose');\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-engine-change.utils.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-engine-change.utils.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/platform-engine-change.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,oBAAY,4BAA4B;IACtC,kGAAkG;IAClG,kBAAkB,uBAAuB;IACzC,yGAAyG;IACzG,yBAAyB,8BAA8B;IACvD,mCAAmC;IACnC,SAAS,cAAc;IACvB,uEAAuE;IACvE,2BAA2B,gCAAgC;IAC3D,kFAAkF;IAClF,0BAA0B,+BAA+B;IACzD,yEAAyE;IACzE,yBAAyB,8BAA8B;IACvD,0FAA0F;IAC1F,cAAc,mBAAmB;CAClC;AAED,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,iBAAiB,CAAC;IAChC,qGAAqG;IACrG,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;IAC3C;;;;;;OAMG;IACH,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;IAC3C,kGAAkG;IAClG,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iFAAiF;IACjF,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,yBAAyB,GAC/B,4BAA4B,CA6B9B;AAED,2FAA2F;AAC3F,eAAO,MAAM,+BAA+B,oCAAoC,CAAC;AAEjF;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,4BAA4B,EACtC,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IAAC,cAAc,CAAC,EAAE,cAAc,CAAA;CAAE,GAC3F,MAAM,GAAG,IAAI,CA8Bf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-engine-change.utils.js","sourceRoot":"","sources":["../../../../../../src/services/environment/platform-engine-change.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAN,IAAY,4BAeX;AAfD,WAAY,4BAA4B;IACtC,kGAAkG;IAClG,yEAAyC,CAAA;IACzC,yGAAyG;IACzG,uFAAuD,CAAA;IACvD,mCAAmC;IACnC,uDAAuB,CAAA;IACvB,uEAAuE;IACvE,2FAA2D,CAAA;IAC3D,kFAAkF;IAClF,yFAAyD,CAAA;IACzD,yEAAyE;IACzE,uFAAuD,CAAA;IACvD,0FAA0F;IAC1F,iEAAiC,CAAA;AACnC,CAAC,EAfW,4BAA4B,KAA5B,4BAA4B,QAevC;AAoBD;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAAgC;IAEhC,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAElG,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,4BAA4B,CAAC,kBAAkB,CAAC;IACzD,CAAC;IACD,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,4BAA4B,CAAC,yBAAyB,CAAC;IAChE,CAAC;IACD,IAAI,cAAc,KAAK,cAAc,EAAE,CAAC;QACtC,OAAO,4BAA4B,CAAC,SAAS,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,IAAI,YAAY,KAAK,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAC7C,OAAO,4BAA4B,CAAC,cAAc,CAAC;IACrD,CAAC;IAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;Q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CAAC","sourcesContent":["import { DatabaseEngine, WildoLocationType } from '@wildo-ai/platform-config-lib';\n\n/**\n * Deciding whether an AUTHORED platform database engine may replace the one an environment is\n * already running on.\n *\n * ## Why this needs a guard at all\n *\n * The platform engine became authorable so it could travel with the repository. That makes it\n * reviewable and reproducible — and it also makes it a one-line edit that silently re-points the\n * platform's own store. The flip is **fresh-install-only**: there is no Mongo↔PostgreSQL data\n * migration and none is planned, so applying a change to an environment that has already been\n * initialized does not migrate its data, it abandons it (registered applications, provisioned\n * credentials, the admin user).\n *\n * ## Why the two halves are not symmetric\n *\n * The failure modes point in opposite directions, so one rule cannot serve both:\n *\n * - **Applying** a change to a live environment is destructive and, for a remote one, unrecoverable\n * — there is no down-migration and no restore procedure written for it.\n * - **Ignoring** a change silently is the failure this codebase keeps re-learning: an operator\n * authors an engine, `wildo config sync` reports success, and nothing moved. A missing identity\n * field cannot fail loudly, so the wrong topology generates cleanly (see the\n * `hydrateEnvironmentFromConfig` contract note and the 2026-08-13 origin-mismatch incident).\n *\n * Local development is fresh-install-only by design and cheap to redo, so a divergence there is a\n * warning when nothing has been initialized and an explicit acknowledgement when something has.\n * Remote has real data and no procedure, so it REFUSES outright.\n *\n * ## Why the acknowledgement is its own flag and not `--force`\n *\n * `wildo config sync --force` deliberately does NOT authorize destructive work. That decoupling was\n * made after `--local --force` silently rotated `secrets.json` over a freshly-imported canonical\n * file (Fix M, 2026-04-21), and `--rotate-secrets` exists as the separate opt-in precisely so a\n * convenience flag can never carry a destructive meaning. An engine change is the same class of\n * operation and follows the same precedent.\n */\nexport enum PlatformEngineChangeDecision {\n /** The descriptor authors no engine — the backing-service inference owns it, nothing to guard. */\n NO_AUTHORED_ENGINE = 'no-authored-engine',\n /** No generated baseline yet: this DECLARES an engine for a new environment rather than changing one. */\n DECLARED_FOR_NEW_BASELINE = 'declared-for-new-baseline',\n /** Authored and baseline agree. */\n UNCHANGED = 'unchanged',\n /** Local, nothing initialized — cheap to redo, so warn and proceed. */\n ALLOWED_LOCAL_UNINITIALIZED = 'allowed-local-uninitialized',\n /** Local, initialized, and the operator explicitly acknowledged the data loss. */\n ALLOWED_LOCAL_ACKNOWLEDGED = 'allowed-local-acknowledged',\n /** Local, initialized, no acknowledgement — refuse and name the flag. */\n REFUSED_LOCAL_INITIALIZED = 'refused-local-initialized',\n /** Remote — refused unconditionally. There is no acknowledgement that makes this safe. */\n REFUSED_REMOTE = 'refused-remote',\n}\n\nexport interface PlatformEngineChangeInput {\n locationType: WildoLocationType;\n /** From the authored `wildo.infra.<env>.config.ts`; `undefined` when the descriptor authors none. */\n authoredEngine: DatabaseEngine | undefined;\n /**\n * The engine the environment is CURRENTLY on, read from its generated `config.json`.\n *\n * `undefined` means no generated baseline exists, which is a genuinely different situation from\n * \"the baseline says MongoDB\" — it is a new environment being declared, not an existing one being\n * re-pointed, and it must not be refused.\n */\n baselineEngine: DatabaseEngine | undefined;\n /** `platformInitialized` — whether INIT has ever run here, i.e. whether there is data to lose. */\n platformInitialized: boolean;\n /** The explicit per-run acknowledgement. Never `--force`; see the note above. */\n acknowledged: boolean;\n}\n\n/**\n * Pure decision. Kept free of registry, disk and logger access so the policy can be pinned directly\n * rather than through a command harness — the surrounding command owns loading and reporting.\n */\nexport function decidePlatformEngineChange(\n input: PlatformEngineChangeInput,\n): PlatformEngineChangeDecision {\n const { locationType, authoredEngine, baselineEngine, platformInitialized, acknowledged } = input;\n\n if (!authoredEngine) {\n return PlatformEngineChangeDecision.NO_AUTHORED_ENGINE;\n }\n if (!baselineEngine) {\n return PlatformEngineChangeDecision.DECLARED_FOR_NEW_BASELINE;\n }\n if (authoredEngine === baselineEngine) {\n return PlatformEngineChangeDecision.UNCHANGED;\n }\n\n /**\n * Remote is refused BEFORE the acknowledgement is consulted, and that ordering is the policy: a\n * remote engine change is not an authoring operation, so there is deliberately no flag that\n * permits it. Reordering these two checks would silently create one.\n */\n if (locationType !== WildoLocationType.LOCAL) {\n return PlatformEngineChangeDecision.REFUSED_REMOTE;\n }\n\n if (!platformInitialized) {\n return PlatformEngineChangeDecision.ALLOWED_LOCAL_UNINITIALIZED;\n }\n\n return acknowledged\n ? PlatformEngineChangeDecision.ALLOWED_LOCAL_ACKNOWLEDGED\n : PlatformEngineChangeDecision.REFUSED_LOCAL_INITIALIZED;\n}\n\n/** Flag name carried in the refusal message, so the remedy is never guessed from prose. */\nexport const PLATFORM_ENGINE_CHANGE_ACK_FLAG = '--accept-platform-engine-change';\n\n/**\n * Operator-facing explanation for a decision that stops or alters a sync. Returns `null` for the\n * decisions that need no words.\n */\nexport function describePlatformEngineChange(\n decision: PlatformEngineChangeDecision,\n input: { envName: string; authoredEngine?: DatabaseEngine; baselineEngine?: DatabaseEngine },\n): string | null {\n const { envName, authoredEngine, baselineEngine } = input;\n const move = `'${baselineEngine}' → '${authoredEngine}'`;\n\n switch (decision) {\n case PlatformEngineChangeDecision.NO_AUTHORED_ENGINE:\n case PlatformEngineChangeDecision.UNCHANGED:\n return null;\n case PlatformEngineChangeDecision.DECLARED_FOR_NEW_BASELINE:\n return `Environment '${envName}' declares platform database engine '${authoredEngine}'.`;\n case PlatformEngineChangeDecision.ALLOWED_LOCAL_UNINITIALIZED:\n return `Environment '${envName}' changes its platform database engine ${move}. `\n + 'The platform has never been initialized here, so there is nothing to lose; INIT will '\n + 'create it on the new engine.';\n case PlatformEngineChangeDecision.ALLOWED_LOCAL_ACKNOWLEDGED:\n return `Environment '${envName}' changes its platform database engine ${move}, acknowledged. `\n + 'The existing platform data on the previous engine is ABANDONED, not migrated: registered '\n + 'applications, provisioned credentials and the admin user are re-created by INIT.';\n case PlatformEngineChangeDecision.REFUSED_LOCAL_INITIALIZED:\n return `Environment '${envName}' would change its platform database engine ${move}, but the `\n + 'platform has already been initialized here. There is no Mongo/PostgreSQL data migration: '\n + 'the existing registered applications, provisioned credentials and admin user would be '\n + `abandoned. Re-run with ${PLATFORM_ENGINE_CHANGE_ACK_FLAG} to accept that, or revert the `\n + '`database` block in the authored infra descriptor.';\n case PlatformEngineChangeDecision.REFUSED_REMOTE:\n return `Environment '${envName}' would change its platform database engine ${move}, and it is `\n + 'a REMOTE environment. Changing a remote platform\\'s store is not an authoring operation: '\n + 'the flip is fresh-install-only, so there is no migration and no rollback, and no flag '\n + 'authorizes it here. Revert the `database` block in the authored infra descriptor.';\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"platform-engine-change.utils.js","sourceRoot":"","sources":["../../../../src/services/environment/platform-engine-change.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAN,IAAY,4BAeX;AAfD,WAAY,4BAA4B;IACtC,kGAAkG;IAClG,yEAAyC,CAAA;IACzC,yGAAyG;IACzG,uFAAuD,CAAA;IACvD,mCAAmC;IACnC,uDAAuB,CAAA;IACvB,uEAAuE;IACvE,2FAA2D,CAAA;IAC3D,kFAAkF;IAClF,yFAAyD,CAAA;IACzD,yEAAyE;IACzE,uFAAuD,CAAA;IACvD,0FAA0F;IAC1F,iEAAiC,CAAA;AACnC,CAAC,EAfW,4BAA4B,KAA5B,4BAA4B,QAevC;AAoBD;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAAgC;IAEhC,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAElG,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,4BAA4B,CAAC,kBAAkB,CAAC;IACzD,CAAC;IACD,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,4BAA4B,CAAC,yBAAyB,CAAC;IAChE,CAAC;IACD,IAAI,cAAc,KAAK,cAAc,EAAE,CAAC;QACtC,OAAO,4BAA4B,CAAC,SAAS,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,IAAI,YAAY,KAAK,iBAAiB,CAAC,KA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AAgB,OAAO,+CAA+C,IAAI,cAAc;kBAC3F,2FAA2F;kBAC3F,wFAAwF;kBACxF,mFAAmF,CAAC;IAC5F,CAAC;AACH,CAAC","sourcesContent":["import { DatabaseEngine, WildoLocationType } from '@wildo-ai/platform-config-lib';\n\n/**\n * Deciding whether an AUTHORED platform database engine may replace the one an environment is\n * already running on.\n *\n * ## Why this needs a guard at all\n *\n * The platform engine became authorable so it could travel with the repository. That makes it\n * reviewable and reproducible — and it also makes it a one-line edit that silently re-points the\n * platform's own store. The flip is **fresh-install-only**: there is no Mongo↔PostgreSQL data\n * migration and none is planned, so applying a change to an environment that has already been\n * initialized does not migrate its data, it abandons it (registered applications, provisioned\n * credentials, the admin user).\n *\n * ## Why the two halves are not symmetric\n *\n * The failure modes point in opposite directions, so one rule cannot serve both:\n *\n * - **Applying** a change to a live environment is destructive and, for a remote one, unrecoverable\n * — there is no down-migration and no restore procedure written for it.\n * - **Ignoring** a change silently is the failure this codebase keeps re-learning: an operator\n * authors an engine, `wildo config sync` reports success, and nothing moved. A missing identity\n * field cannot fail loudly, so the wrong topology generates cleanly (see the\n * `hydrateEnvironmentFromConfig` contract note and the 2026-08-13 origin-mismatch incident).\n *\n * Local development is fresh-install-only by design and cheap to redo, so a divergence there is a\n * warning when nothing has been initialized and an explicit acknowledgement when something has.\n * Remote has real data and no procedure, so it REFUSES outright.\n *\n * ## Why the acknowledgement is its own flag and not `--force`\n *\n * `wildo config sync --force` deliberately does NOT authorize destructive work. That decoupling was\n * made after `--local --force` silently rotated `secrets.json` over a freshly-imported canonical\n * file (Fix M, 2026-04-21), and `--rotate-secrets` exists as the separate opt-in precisely so a\n * convenience flag can never carry a destructive meaning. An engine change is the same class of\n * operation and follows the same precedent.\n */\nexport enum PlatformEngineChangeDecision {\n /** The descriptor authors no engine — the backing-service inference owns it, nothing to guard. */\n NO_AUTHORED_ENGINE = 'no-authored-engine',\n /** No generated baseline yet: this DECLARES an engine for a new environment rather than changing one. */\n DECLARED_FOR_NEW_BASELINE = 'declared-for-new-baseline',\n /** Authored and baseline agree. */\n UNCHANGED = 'unchanged',\n /** Local, nothing initialized — cheap to redo, so warn and proceed. */\n ALLOWED_LOCAL_UNINITIALIZED = 'allowed-local-uninitialized',\n /** Local, initialized, and the operator explicitly acknowledged the data loss. */\n ALLOWED_LOCAL_ACKNOWLEDGED = 'allowed-local-acknowledged',\n /** Local, initialized, no acknowledgement — refuse and name the flag. */\n REFUSED_LOCAL_INITIALIZED = 'refused-local-initialized',\n /** Remote — refused unconditionally. There is no acknowledgement that makes this safe. */\n REFUSED_REMOTE = 'refused-remote',\n}\n\nexport interface PlatformEngineChangeInput {\n locationType: WildoLocationType;\n /** From the authored `wildo.infra.<env>.config.ts`; `undefined` when the descriptor authors none. */\n authoredEngine: DatabaseEngine | undefined;\n /**\n * The engine the environment is CURRENTLY on, read from its generated `config.json`.\n *\n * `undefined` means no generated baseline exists, which is a genuinely different situation from\n * \"the baseline says MongoDB\" — it is a new environment being declared, not an existing one being\n * re-pointed, and it must not be refused.\n */\n baselineEngine: DatabaseEngine | undefined;\n /** `platformInitialized` — whether INIT has ever run here, i.e. whether there is data to lose. */\n platformInitialized: boolean;\n /** The explicit per-run acknowledgement. Never `--force`; see the note above. */\n acknowledged: boolean;\n}\n\n/**\n * Pure decision. Kept free of registry, disk and logger access so the policy can be pinned directly\n * rather than through a command harness — the surrounding command owns loading and reporting.\n */\nexport function decidePlatformEngineChange(\n input: PlatformEngineChangeInput,\n): PlatformEngineChangeDecision {\n const { locationType, authoredEngine, baselineEngine, platformInitialized, acknowledged } = input;\n\n if (!authoredEngine) {\n return PlatformEngineChangeDecision.NO_AUTHORED_ENGINE;\n }\n if (!baselineEngine) {\n return PlatformEngineChangeDecision.DECLARED_FOR_NEW_BASELINE;\n }\n if (authoredEngine === baselineEngine) {\n return PlatformEngineChangeDecision.UNCHANGED;\n }\n\n /**\n * Remote is refused BEFORE the acknowledgement is consulted, and that ordering is the policy: a\n * remote engine change is not an authoring operation, so there is deliberately no flag that\n * permits it. Reordering these two checks would silently create one.\n */\n if (locationType !== WildoLocationType.LOCAL) {\n return PlatformEngineChangeDecision.REFUSED_REMOTE;\n }\n\n if (!platformInitialized) {\n return PlatformEngineChangeDecision.ALLOWED_LOCAL_UNINITIALIZED;\n }\n\n return acknowledged\n ? PlatformEngineChangeDecision.ALLOWED_LOCAL_ACKNOWLEDGED\n : PlatformEngineChangeDecision.REFUSED_LOCAL_INITIALIZED;\n}\n\n/** Flag name carried in the refusal message, so the remedy is never guessed from prose. */\nexport const PLATFORM_ENGINE_CHANGE_ACK_FLAG = '--accept-platform-engine-change';\n\n/**\n * Operator-facing explanation for a decision that stops or alters a sync. Returns `null` for the\n * decisions that need no words.\n */\nexport function describePlatformEngineChange(\n decision: PlatformEngineChangeDecision,\n input: { envName: string; authoredEngine?: DatabaseEngine; baselineEngine?: DatabaseEngine },\n): string | null {\n const { envName, authoredEngine, baselineEngine } = input;\n const move = `'${baselineEngine}' → '${authoredEngine}'`;\n\n switch (decision) {\n case PlatformEngineChangeDecision.NO_AUTHORED_ENGINE:\n case PlatformEngineChangeDecision.UNCHANGED:\n return null;\n case PlatformEngineChangeDecision.DECLARED_FOR_NEW_BASELINE:\n return `Environment '${envName}' declares platform database engine '${authoredEngine}'.`;\n case PlatformEngineChangeDecision.ALLOWED_LOCAL_UNINITIALIZED:\n return `Environment '${envName}' changes its platform database engine ${move}. `\n + 'The platform has never been initialized here, so there is nothing to lose; INIT will '\n + 'create it on the new engine.';\n case PlatformEngineChangeDecision.ALLOWED_LOCAL_ACKNOWLEDGED:\n return `Environment '${envName}' changes its platform database engine ${move}, acknowledged. `\n + 'The existing platform data on the previous engine is ABANDONED, not migrated: registered '\n + 'applications, provisioned credentials and the admin user are re-created by INIT.';\n case PlatformEngineChangeDecision.REFUSED_LOCAL_INITIALIZED:\n return `Environment '${envName}' would change its platform database engine ${move}, but the `\n + 'platform has already been initialized here. There is no Mongo/PostgreSQL data migration: '\n + 'the existing registered applications, provisioned credentials and admin user would be '\n + `abandoned. Re-run with ${PLATFORM_ENGINE_CHANGE_ACK_FLAG} to accept that, or revert the `\n + '`database` block in the authored infra descriptor.';\n case PlatformEngineChangeDecision.REFUSED_REMOTE:\n return `Environment '${envName}' would change its platform database engine ${move}, and it is `\n + 'a REMOTE environment. Changing a remote platform\\'s store is not an authoring operation: '\n + 'the flip is fresh-install-only, so there is no migration and no rollback, and no flag '\n + 'authorizes it here. Revert the `database` block in the authored infra descriptor.';\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-runtime-state.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-runtime-state.service.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/platform-runtime-state.service.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,oBAAoB;IACnC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,qBAAa,2BAA2B;IACtC,OAAO,CAAC,MAAM,CAAC,cAAc;IAI7B,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAYnC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,oBAAoB;IAcnD,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAqBhE,MAAM,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO;IAIvD,MAAM,CAAC,uBAAuB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAWtD,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;CAaxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-runtime-state.service.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-runtime-state.service.js","sourceRoot":"","sources":["../../../../src/services/environment/plat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;YACV,mBAAmB,EAAE,KAAK;SAC3B,CAAC;QAEF,IAAI,OAAO,CAAC,qBAAqB,KAAK,SAAS,EAAE,CAAC;YAChD,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC;QACzC,CAAC;QAED,2BAA2B,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;CACF","sourcesContent":["import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from 'fs';\nimport { dirname } from 'path';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { EnvironmentRegistry } from '~wildo-cli/services/environment/environment-registry.service';\n\nexport interface PlatformRuntimeState {\n platformInitialized?: boolean;\n platformInitializedAt?: string;\n}\n\nexport class PlatformRuntimeStateService {\n private static resolveEnvName(envName?: string): string {\n return envName ?? EnvironmentRegistry.getCurrentName();\n }\n\n private static resolveStateFilePath(envName?: string): string | null {\n const saasRoot = EnvironmentRegistry.getSaasRoot();\n if (!saasRoot) {\n return null;\n }\n\n return EnvironmentPaths.resolveScopedPlatformRuntimeStatePath(\n saasRoot,\n PlatformRuntimeStateService.resolveEnvName(envName),\n );\n }\n\n static load(envName?: string): PlatformRuntimeState {\n const stateFile = PlatformRuntimeStateService.resolveStateFilePath(envName);\n if (!stateFile || !existsSync(stateFile)) {\n return {};\n }\n\n try {\n const raw = JSON.parse(readFileSync(stateFile, 'utf8')) as PlatformRuntimeState;\n return typeof raw === 'object' && raw !== null ? raw : {};\n } catch {\n return {};\n }\n }\n\n static save(state: PlatformRuntimeState, envName?: string): void {\n const stateFile = PlatformRuntimeStateService.resolveStateFilePath(envName);\n if (!stateFile) {\n return;\n }\n\n if (Object.keys(state).length === 0) {\n if (existsSync(stateFile)) {\n unlinkSync(stateFile);\n }\n return;\n }\n\n const stateDir = dirname(stateFile);\n if (!existsSync(stateDir)) {\n mkdirSync(stateDir, { recursive: true });\n }\n\n writeFileSync(stateFile, JSON.stringify(state, null, 2), 'utf8');\n }\n\n static isPlatformInitialized(envName?: string): boolean {\n return PlatformRuntimeStateService.load(envName).platformInitialized === true;\n }\n\n static markPlatformInitialized(envName?: string): void {\n PlatformRuntimeStateService.save(\n {\n ...PlatformRuntimeStateService.load(envName),\n platformInitialized: true,\n platformInitializedAt: new Date().toISOString(),\n },\n envName,\n );\n }\n\n static clearPlatformInitialized(envName?: string): void {\n const current = PlatformRuntimeStateService.load(envName);\n const next: PlatformRuntimeState = {\n ...current,\n platformInitialized: false,\n };\n\n if (current.platformInitializedAt !== undefined) {\n next.platformInitializedAt = undefined;\n }\n\n PlatformRuntimeStateService.save(next, envName);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-runtime.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-runtime.schemas.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/platform-runtime.schemas.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,cAAc,CAAC;AACxC,eAAO,MAAM,WAAW,YAAY,CAAC;AAUrC,OAAO,EAGL,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AAEvC,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AACpD,eAAO,MAAM,0BAA0B,WAAW,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IAAE,oBAAoB,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,sBAAsB,CAAA;CAAE,GAAG,OAAO,CAE9H;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,sBAAsB,CAAC;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,MAAM,CAMT;AAMD,eAAO,MAAM,yCAAyC,gBAAgB,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAExF;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,EAAE,CAEtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-runtime.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-runtime.schemas.js","sourceRoot":"","sources":["../../../../src/services/environment/platform-runtime.schemas.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;AACxC,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC;AAMrC,+EAA+E;AAC/E,6BAA6B;AAC7B,+EAA+E;AAE/E,OAAO,EACL,kCAAkC,EAClC,sCAAsC,EACtC,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AACpD,MAAM,CAAC,MAAM,0BAA0B,GAAG,QAAQ,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAyE;IACnH,OAAO,KAAK,CAAC,oBAAoB,IAAI,KAAK,CAAC,OAAO,KAAK,sBAAsB,CAAC,cAAc,CAAC;AAC/F,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAKvC;IACC,IAAI,2BAA2B,CAAC,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,GAAG,mBAAmB,IAAI,KAAK,CAAC,QAAQ,IAAI,0BAA0B,EAAE,CAAC;IAClF,CAAC;IACD,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,gBAAgB,CAAC;IACrD,OAAO,GAAG,sCAAsC,IAAI,kCAAkC,IAAI,mBAAmB,IAAI,GAAG,EAAE,CAAC;AACzH,CAAC;AAED,+EAA+E;AAC/E,+BAA+B;AAC/B,+EAA+E;AAE/E,MAAM,CAAC,MAAM,yCAAyC,GAAG,aAAa,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,6BAA6B,CAAC,GAAG,UAA6B;IAC5E,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE,kBAAkB,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,2BAA2B;IACzC,OAAO,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;AACxC,CAAC","sourcesContent":["export const DEFAULT_HOST = 'localhost';\nexport const LISTEN_HOST = '0.0.0.0';\n\n\n\n\n\n// ============================================================================\n// Docker Registry and Images\n// ============================================================================\n\nimport {\n FRAMEWORK_RELEASE_DOCKER_NAMESPACE,\n FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST,\n WildoDeploymentRuntime,\n} from '@wildo-ai/platform-config-lib';\n\nexport const PLATFORM_IMAGE_NAME = 'wildo-platform';\nexport const DEFAULT_PLATFORM_IMAGE_TAG = 'latest';\n\n/**\n * Whether the platform image a lane NAMES is one the framework checkout BUILDS, rather than the\n * published image a runtime PULLS.\n *\n * Exactly one lane builds: a framework developer on Docker Compose, where `wildo local up --rebuild`\n * produces `wildo-platform:<tag>` from the checkout's Dockerfile. Every Kubernetes lane pulls the\n * published image, and that is a decision rather than an accident of what renders (#969, decided\n * 2026-09-14):\n *\n * - a LOCAL framework developer runs the platform natively (`shouldRunPlatformServicesNatively`), so no\n * platform manifest renders and the question never arises;\n * - an app creator, local or remote, has no checkout to build from;\n * - a REMOTE framework developer used to get `<cluster registry>/wildo-platform:latest` — an image\n * nothing in the CLI pushes there, while `k8s-bootstrap` built the checkout and pushed it to the\n * LOCAL Kind registry, which no remote pod reads. The two halves named different images. The\n * alternative, running the developer's own build remotely, needs a push-to-operator-registry step\n * that does not exist (`fwk publish docker` pushes only to the framework's registry) and would make a\n * remote cluster run code no release contains. A remote cluster is a deployment target, so it runs\n * what was released.\n *\n * Consequence to know: a remote framework developer's cluster runs the platform at the CLI's framework\n * VERSION, which must therefore be a published one. A checkout ahead of the last release names a tag the\n * registry may not hold yet; pass an explicit image tag of a published build rather than restoring a\n * local-build branch here.\n */\nexport function platformImageIsBuiltLocally(input: { isFrameworkDeveloper: boolean; runtime: WildoDeploymentRuntime }): boolean {\n return input.isFrameworkDeveloper && input.runtime === WildoDeploymentRuntime.DOCKER_COMPOSE;\n}\n\n/**\n * The image reference every platform service (`platform-init`, `platform-apps-manager`,\n * `platform-crontabs-batches-manager`, `platform-module-registry`) is rendered with, for BOTH the compose\n * file and the Kubernetes manifests.\n *\n * Two answers, and they must not be collapsed (`platformImageIsBuiltLocally` decides which):\n *\n * - **locally built** (framework developer on Docker Compose) → the bare local name\n * `wildo-platform:<tag>`. That is what `wildo local up --rebuild` produces, and a bare name is what\n * keeps Docker from ever pulling it. Framework developers run the platform NATIVELY, so the compose\n * blocks naming this image are not even rendered for them — the value exists for the `--rebuild` lane.\n * - **published** (every other lane, including every Kubernetes lane) → the REGISTRY-QUALIFIED\n * reference `docker.io/wildoai/wildo-platform:<framework version>`. The image reaches a daemon or a\n * kubelet only because the runtime pulls a qualified ref. Until 2026-09-03 the compose app-creator lane\n * rendered the bare local name, which resolves to `docker.io/library/wildo-platform` — an image that does\n * not exist. The Kubernetes lane composed `<application registry>/wildo-platform:latest` until #349,\n * and a remote framework developer kept a variant of that until #969.\n *\n * The published tag is the framework VERSION, never `latest`: `fwk publish docker` pushes the immutable\n * `<version>` tag first and only then repoints aliases, so `<version>` is the one tag guaranteed to exist\n * for the framework a CLI was cut from. Registry host and namespace are the same locked constants the\n * publish lane asserts against (`FrameworkDockerPublishService.assertLockedDockerRegistryIdentity`), so the\n * two sides cannot name different registries.\n *\n * @param input.isFrameworkDeveloper - with `runtime`, selects the lane (see above).\n * @param input.runtime - the deployment runtime the reference is rendered for.\n * @param input.frameworkVersion - the version of the framework this CLI belongs to; becomes the tag of the\n * published image. Callers pass the CLI's own package version, which the version-sync lane keeps equal to\n * the framework version.\n * @param input.imageTag - an explicit tag override (`wildo local up --image-tag`, the `runInfraWrite` seam).\n * Wins in both lanes when supplied.\n */\nexport function resolvePlatformImageRef(input: {\n isFrameworkDeveloper: boolean;\n runtime: WildoDeploymentRuntime;\n frameworkVersion: string;\n imageTag?: string;\n}): string {\n if (platformImageIsBuiltLocally(input)) {\n return `${PLATFORM_IMAGE_NAME}:${input.imageTag ?? DEFAULT_PLATFORM_IMAGE_TAG}`;\n }\n const tag = input.imageTag ?? input.frameworkVersion;\n return `${FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST}/${FRAMEWORK_RELEASE_DOCKER_NAMESPACE}/${PLATFORM_IMAGE_NAME}:${tag}`;\n}\n\n// ============================================================================\n// Docker Compose Configuration\n// ============================================================================\n\nexport const DEFAULT_DOCKER_COMPOSE_LOCAL_PROJECT_NAME = 'wildo-local';\n\n/**\n * Build the argv for a Docker Compose convergence of the local stack.\n *\n * ## Why this is a function rather than four hand-written arrays\n *\n * EVERY application renders its local compose under the SAME project name\n * ({@link DEFAULT_DOCKER_COMPOSE_LOCAL_PROJECT_NAME}) while bind-mounting its\n * OWN `<app>/.wildo-saas/local_data/`. Compose therefore only touches the\n * services the CURRENT application declares — so converging app B leaves any\n * service that only app A declares running, still bound to app A's data dirs.\n *\n * Measured 2026-09-03: `wildo-mongodb` and `wildo-mongot` were serving\n * wonder-todos' data dirs while `wildo-postgresql`, `wildo-rabbitmq`,\n * `wildo-valkey` and `wildo-minio` had been recreated on wonder-crm's — because\n * wonder-crm is PostgreSQL-only and declares no mongodb service to recreate.\n * A stack whose halves answer for different applications is the failure this\n * flag prevents, and its visible symptom was 18 cron jobs targeting a RabbitMQ\n * vhost that existed only in the OTHER application's broker state.\n *\n * `local down` already passed `--remove-orphans` for the same reason. Having it\n * on one side only meant the mixed stack could be created and then had to be\n * noticed. Routing every converge through here means a fifth call site cannot\n * forget it — enforced by `compose-converge-args.test.ts`, which fails on any\n * raw `['up', '-d', …]` literal in this package.\n *\n * @param extraFlags - Additional compose flags/services (`--force-recreate`,\n * `--wait`, an explicit service list). Orphan reaping is appended regardless.\n */\nexport function buildLocalComposeConvergeArgs(...extraFlags: readonly string[]): string[] {\n return ['up', '-d', ...extraFlags, '--remove-orphans'];\n}\n\n/**\n * The PREPARATION half of a convergence: pull what is missing and (re)create every container, start\n * none. Orphans are reaped here for the same reason as {@link buildLocalComposeConvergeArgs}.\n *\n * Exists so the slow, unbounded part of a first converge — image pulls on a fresh machine — happens\n * before any readiness clock starts. The `up` that follows only STARTS containers, so a deadline\n * measured from it measures the services rather than the network.\n */\nexport function buildLocalComposeCreateArgs(): string[] {\n return ['create', '--remove-orphans'];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-bootstrap.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"runtime-bootstrap.service.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/runtime-bootstrap.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAuBH,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,2DAA2D,CAAC;AAQnH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAE5G;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,oEAAoE;IACpE,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2DAA2D;IAC3D,eAAe,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAC5B;;;OAGG;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;;;;;;OAWG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAiFrC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAsC3B;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA+B/B;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,2BAA2B;IAW1C;;;;;;;;;;;;OAYG;IACH;;;;;;;OAOG;mBACkB,4BAA4B;CAgDlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-bootstrap.service.js","sourceRoot":"","sources":["../../../../../../src/services/environment/runtime-bootstrap.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAEH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EACL,iCAAiC,EACjC,0CAA0C,EAC1C,0BAA0B,GAC3B,MAAM,6DAA6D,CAAC;AACrE,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,mCAAmC,GACpC,MAAM,wEAAwE,CAAC;AAEhF,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+DAA+D,CAAC;AACrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAiCvF,MAAM,YAAY,GAA2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;CACF","sourcesContent":["/**\n * runtime-bootstrap — headless self-healing pre-flight for `wildo local up`.\n *\n * Background. Before this service existed, the only paths that wrote the\n * Docker Compose runtime artifacts (`config.json`,\n * `docker-compose.wildo-platform.yml`, `.env.wildo-platform`) were:\n * 1. The interactive `wildo setup` flow (rejects `--non-interactive`).\n * 2. The post-bootstrap `wildo config sync --domain manifest` /\n * `wildo config sync` flow, which assumes the artifacts already exist\n * and additionally tries to reach apps-manager (circular: apps-manager\n * cannot start until the compose stack is up, but the compose stack\n * cannot render until config sync ran).\n *\n * That left the \"fresh clone of an existing app + `wildo local up`\" loop\n * stuck on hand-edited `config.json` / `.env.wildo-platform` files — exactly\n * the zero-touch greenfield experience the operator expects.\n *\n * What this service does. Right before `wildo local up` invokes\n * `ContextManager.resolveInfraContext` (which fail-loud-checks the compose\n * file presence), we:\n * - Re-load the authored `wildo.infra.<env>.config.ts` and rehydrate the\n * in-memory env state (`backingServices`, `serviceAuth`, `runtime`,\n * `runtimeEnvironment`, `database`, `publicDomain`, `kubernetes`,\n * `logging`) so the authored source-of-truth wins over a stale\n * `environments.json` snapshot.\n * - If `config.json` is missing, project the authored config through\n * {@link buildConfigJsonFromInfraEnvConfig} (the same projection\n * `wildo config sync --domain manifest` uses) and write it.\n * - For DOCKER_COMPOSE runtimes only, if the compose template render or\n * the `.env.wildo-platform` env file is missing, render them via the\n * same generators `runInfraWrite` calls during the interactive setup\n * flow.\n *\n * Single source of truth. The projection, rendering and env-file generation\n * are all delegated to the existing services — this file only orchestrates.\n * Result: artifacts produced here are byte-identical to the ones a later\n * `wildo config sync --domain manifest` (or interactive `wildo setup`) would\n * produce.\n *\n * Atlas / managed-Mongo guard. When the authored config cannot serve as a\n * `config.json` fallback (today: ATLAS-backed Mongo, which needs API\n * metadata not present in the authored descriptor), we surface the same\n * reason string used by `sync.command.ts` and abort — there is nothing\n * useful we can self-heal in that case.\n *\n * Secrets handling. We never ROTATE `secrets.json` here — rotation is\n * destructive and stays behind `wildo config sync --rotate-secrets`. We DO\n * provision missing framework-managed material (see\n * {@link SecretsProvisioning.ensureForEnvironment}), which is the additive\n * mirror image of everything else this pre-flight does: mint only what is\n * absent, never touch what exists. Without it, a material introduced after an\n * environment was set up never reaches that environment — which is exactly how\n * the immudb state-signing keypair stayed missing and left the audit store's\n * whole-server-substitution defense off. Operator-typed secrets still require\n * interactive authoring: if `secrets.json` is missing entirely, the\n * `.env.wildo-platform` step throws with a clear hint to run `wildo setup` (or\n * restore from a backup).\n *\n * Shared with `wildo config sync`. The authored-infra → generated-config\n * reconciliation primitives ({@link RuntimeBootstrap.refreshEnvFromAuthored}\n * + the config.json projection write) are ALSO the source of truth for\n * `config sync`, exposed via {@link RuntimeBootstrap.reconcileGeneratedConfigFromAuthored}.\n * The two callers differ ONLY in write policy:\n * - `local up` self-heal ({@link RuntimeBootstrap.ensureLocalRuntimeArtifacts})\n * writes config.json / compose ONLY when missing — an idempotent\n * pre-flight that must not churn `environments.json`'s `updatedAt` or the\n * compose file on every invocation.\n * - `config sync` reconcile ALWAYS regenerates config.json from the authored\n * descriptor — it is an explicit \"make authored infra the source of truth\"\n * command, so a stale-but-present config.json (e.g. a pre-`backingServices`\n * snapshot missing a newly-authored `immudb` service) is deterministically\n * rewritten before the compose / env-file steps read it.\n */\n\nimport { existsSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nimport {\n PUBLIC_DOMAIN_DEFAULTS,\n WildoDeploymentRuntime,\n WildoLocationType,\n} from '@wildo-ai/platform-config-lib';\n\nimport { FILE_NAMES } from '~wildo-cli/infrastructure/io/io.schemas';\nimport { FileUtils } from '~wildo-cli/infrastructure/io/file.utils';\nimport {\n buildConfigJsonFromInfraEnvConfig,\n getUnsupportedAuthoredConfigFallbackReason,\n loadAuthoredInfraEnvConfig,\n} from '~wildo-cli/services/environment/authored-infra-config.utils';\nimport {\n generateEnvWildoPlatform,\n renderDockerComposeTemplate,\n isComposeHostMountedArtifactMissing,\n} from '~wildo-cli/services/deployment/docker/docker-compose-generator.service';\nimport type { FrameworkManagedSecretMaterialRef } from '~wildo-cli/services/credentials/framework-managed-secrets';\nimport {\n SecretsProvisioning,\n SecretsProvisioningStatus,\n} from '~wildo-cli/services/credentials/secrets-provisioning.service';\nimport { EnvironmentLifecycle } from '~wildo-cli/services/environment/environment-lifecycle.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\n\n/**\n * Summary of what the runtime-bootstrap pre-flight wrote on disk during this\n * invocation. Returned to call sites so they can decide whether to log a\n * \"self-healed N artifacts\" line and so tests can assert on the exact\n * deltas without inspecting the filesystem twice.\n */\nexport interface RuntimeBootstrapResult {\n /** Authored env state was re-projected onto `environments.json`. */\n refreshedEnvState: boolean;\n /** `config.json` was missing and has just been written. */\n wroteConfigJson: boolean;\n /**\n * Docker Compose template was written — because it was missing, or because newly\n * provisioned secret material made the existing render stale.\n */\n wroteDockerCompose: boolean;\n /**\n * `.env.wildo-platform` was written — because it was missing, or because newly\n * provisioned secret material made the existing file stale.\n */\n wroteEnvFile: boolean;\n /**\n * Framework-managed credential materials that were absent from `secrets.json` and have\n * just been minted (empty on a fully provisioned environment). Non-empty means the\n * compose render + platform env file were regenerated to carry the new material.\n */\n mintedSecretMaterials: FrameworkManagedSecretMaterialRef[];\n}\n\nconst NO_OP_RESULT: RuntimeBootstrapResult = {\n refreshedEnvState: false,\n wroteConfigJson: false,\n wroteDockerCompose: false,\n wroteEnvFile: false,\n mintedSecretMaterials: [],\n};\n\n/**\n * Pre-flight ensures the runtime artifacts `wildo local up` depends on\n * exist on disk for the given environment, generating them from the\n * authored `wildo.infra.<env>.config.ts` when missing. See file header\n * for the full rationale.\n *\n * Pre-conditions:\n * - `env` is the in-memory environment from `ctx.activeEnv` (already\n * seeded by `ExistingAppBootstrapService`).\n * - `saasRoot` is the resolved targeted-app declaration root.\n *\n * Post-conditions on success:\n * - In-memory env state mirrors the authored infra descriptor.\n * - `config.json` exists in the env's resolved config dir.\n * - For DOCKER_COMPOSE runtimes, the compose render and\n * `.env.wildo-platform` exist in the env's docker-compose dir.\n *\n * Throws when the authored descriptor is missing (the operator must\n * author or restore one) or when secrets are required and absent.\n */\nexport interface RuntimeBootstrapInput {\n env: PlatformEnvironmentConfiguration;\n saasRoot: string;\n /**\n * Framework checkout root — required only for `DOCKER_COMPOSE` runtimes\n * because the compose template render needs to locate the Handlebars\n * template directory under the framework repo. Pass `null` if not\n * available; for K8s envs this preflight does not need it.\n */\n frameworkPath: string | null;\n isFrameworkDeveloper: boolean;\n log: Logger;\n}\n\n/**\n * Outcome of {@link RuntimeBootstrap.reconcileGeneratedConfigFromAuthored}.\n * A TS enum (not a literal-string union) so callers get autocomplete +\n * refactor-safety when branching on the result.\n */\nexport enum RuntimeConfigReconcileStatus {\n /** Env-state + `config.json` were regenerated from the authored descriptor. */\n RECONCILED = 'reconciled',\n /** Env is not LOCAL — remote/CI keep their generated / reconstructed config.json. */\n SKIPPED_NON_LOCAL = 'skipped-non-local',\n /** No authored `wildo.infra.<env>.config.ts` exists to reconcile from. */\n NO_AUTHORED_CONFIG = 'no-authored-config',\n /**\n * Authored descriptor cannot fully serve as the config.json source of truth\n * (today: Atlas-backed Mongo, whose generated config.json carries API\n * metadata + external endpoints the authored descriptor omits). The existing\n * generated config.json is left untouched.\n */\n SKIPPED_UNSUPPORTED = 'skipped-unsupported',\n}\n\nexport type RuntimeConfigReconcileResult =\n | {\n status: RuntimeConfigReconcileStatus.RECONCILED;\n /**\n * True when the persisted env-registry snapshot actually changed\n * (conservative diff) — false when the env was already current and only\n * `config.json` was rewritten. (config.json is unconditionally rewritten\n * for RECONCILED, so there is no separate flag for it.)\n */\n refreshedEnvState: boolean;\n }\n | { status: RuntimeConfigReconcileStatus.SKIPPED_NON_LOCAL }\n | { status: RuntimeConfigReconcileStatus.NO_AUTHORED_CONFIG }\n | { status: RuntimeConfigReconcileStatus.SKIPPED_UNSUPPORTED; reason: string };\n\nexport class RuntimeBootstrap {\n /**\n * Reconcile the two generated INPUTS that `wildo config sync` (and the\n * compose / env-file renderers it drives) read as the source of truth for\n * backing services / ports / sources:\n * - the persisted env-registry snapshot (`environments.json`), refreshed\n * in place via {@link RuntimeBootstrap.refreshEnvFromAuthored}; and\n * - the generated `config.json`, ALWAYS rewritten from the authored\n * `wildo.infra.<env>.config.ts` projection.\n *\n * Root fix for the stale-config-json bug: `config sync` used to read a\n * generated `config.json` (and `environments.json`) that it never refreshed\n * from the authored descriptor, so an authored change (e.g. adding an\n * `immudb` backing service) never reached the generated docker-compose.\n * Calling this BEFORE any sync domain consumes those inputs makes the\n * authored `.ts` the deterministic source of truth every run.\n *\n * Unlike {@link RuntimeBootstrap.ensureLocalRuntimeArtifacts} (the `local up`\n * self-heal) this does NOT render the compose / env-file artifacts — it only\n * refreshes their inputs. It also does NOT touch remote/CI environments,\n * which legitimately reconstruct `config.json` from env vars / a sibling\n * secrets repo (see the LOCAL guard below and the Atlas carve-out).\n *\n * Fail-soft by contract: returns a status the caller inspects; never throws\n * for the \"no authored descriptor\" or \"Atlas\" cases. It DOES surface a throw\n * from {@link loadAuthoredInfraEnvConfig} (broken / env-mismatched `.ts`) so\n * the caller can decide — `config sync` treats authored-load/schema failures\n * as fatal and does not run later domains against an old snapshot. Logging is intentionally the\n * caller's concern (it emits status-specific messages off the returned\n * result), so no `log` is taken here.\n */\n static async reconcileGeneratedConfigFromAuthored(input: {\n env: PlatformEnvironmentConfiguration;\n saasRoot: string;\n }): Promise<RuntimeConfigReconcileResult> {\n const { env, saasRoot } = input;\n\n if (env.locationType !== WildoLocationType.LOCAL) {\n return { status: RuntimeConfigReconcileStatus.SKIPPED_NON_LOCAL };\n }\n\n const loaded = await loadAuthoredInfraEnvConfig(env.name, saasRoot);\n if (!loaded) {\n return { status: RuntimeConfigReconcileStatus.NO_AUTHORED_CONFIG };\n }\n\n const fallbackReason = getUnsupportedAuthoredConfigFallbackReason(\n env.name,\n loaded.path,\n loaded.config,\n );\n if (fallbackReason) {\n return { status: RuntimeConfigReconcileStatus.SKIPPED_UNSUPPORTED, reason: fallbackReason };\n }\n\n const refreshedEnvState = RuntimeBootstrap.refreshEnvFromAuthored(env, loaded.config);\n RuntimeBootstrap.writeConfigJsonFromAuthored(env, loaded.config);\n\n return {\n status: RuntimeConfigReconcileStatus.RECONCILED,\n refreshedEnvState,\n };\n }\n\n static async ensureLocalRuntimeArtifacts(\n input: RuntimeBootstrapInput,\n ): Promise<RuntimeBootstrapResult> {\n const { env, saasRoot, frameworkPath, isFrameworkDeveloper, log } = input;\n\n if (env.locationType !== WildoLocationType.LOCAL) {\n return NO_OP_RESULT;\n }\n\n const loaded = await loadAuthoredInfraEnvConfig(env.name, saasRoot);\n if (!loaded) {\n throw new Error(\n `Cannot bootstrap runtime artifacts for '${env.name}': no authored infra descriptor found.\\n`\n + ` Expected: <saasRoot>/infrastructure/${env.name}/wildo.infra.${env.name === 'local' ? 'local' : 'remote'}.config.ts`,\n );\n }\n\n const fallbackReason = getUnsupportedAuthoredConfigFallbackReason(\n env.name,\n loaded.path,\n loaded.config,\n );\n if (fallbackReason) {\n throw new Error(`${fallbackReason}\\n Run 'wildo setup' to author '${env.name}' interactively.`);\n }\n\n const refreshedEnvState = RuntimeBootstrap.refreshEnvFromAuthored(env, loaded.config);\n\n const wroteConfigJson = RuntimeBootstrap.ensureConfigJson(env, loaded.config, log);\n\n // Mint any framework-managed credential material this environment predates, BEFORE\n // the compose render / env-file generation read `secrets.json` — those artifacts\n // project the material (e.g. the immudb `--signingKey` mount), so provisioning after\n // them would leave the freshly minted key stranded until the next command.\n const mintedSecretMaterials = RuntimeBootstrap.provisionFrameworkManagedSecrets(env, log);\n\n let wroteDockerCompose = false;\n let wroteEnvFile = false;\n\n // A HOSTED environment renders no compose project and no `.env.wildo-platform`: both are its host's,\n // and a render here would describe the host's containers over this application's `local_data`.\n if (env.runtime === WildoDeploymentRuntime.DOCKER_COMPOSE && loaded.config.infrastructureHost === undefined) {\n const composeArtifacts = await RuntimeBootstrap.ensureDockerComposeArtifacts(\n env,\n frameworkPath,\n isFrameworkDeveloper,\n log,\n // Newly minted material invalidates any existing render: the compose file gates\n // the immudb `--signingKey` block on the key file it materializes from\n // secrets.json, and `.env.wildo-platform` carries generated service credentials.\n // \"Write only when missing\" would otherwise leave the environment provisioned on\n // paper but still running the degraded artifacts.\n //\n // A MISSING HOST-MOUNTED ARTIFACT forces the render for the same reason, and it is the case\n // the mint condition above cannot see. The render materializes files that compose\n // BIND-MOUNTS, but it is skipped whenever the compose file already exists — and a data reset\n // deletes those files while leaving the compose file untouched. Docker then creates a\n // DIRECTORY at each missing mount source instead of failing, so the container starts and\n // dies on something that reads nothing like a mounting problem.\n //\n // Observed 2026-08-22 on the first cold start after a full `local_data` reset:\n // `wildo local dev` failed at `container wildo-immudb is unhealthy`, because immudb found a\n // directory where its `--signingKey` file belongs. Nothing had been newly minted — the key\n // lives in the authored `secrets.json`, which survives a data reset — so no condition here\n // forced the re-render that would have written it back.\n mintedSecretMaterials.length > 0\n || isComposeHostMountedArtifactMissing(env, EnvironmentPaths.resolveScopedLocalDataDir(saasRoot)),\n );\n wroteDockerCompose = composeArtifacts.wroteDockerCompose;\n wroteEnvFile = composeArtifacts.wroteEnvFile;\n }\n\n return {\n refreshedEnvState,\n wroteConfigJson,\n wroteDockerCompose,\n wroteEnvFile,\n mintedSecretMaterials,\n };\n }\n\n /**\n * Additive `secrets.json` self-heal: mint every framework-managed credential material\n * the environment is missing and persist it. Returns the minted material refs so the\n * caller can invalidate the derived artifacts that project them.\n *\n * Fail-soft. A missing/unreadable `secrets.json` is NOT handled here — the downstream\n * `.env.wildo-platform` step already fails with the actionable \"run `wildo setup`\"\n * message, and pre-empting it with a second error would only bury that guidance.\n */\n private static provisionFrameworkManagedSecrets(\n env: PlatformEnvironmentConfiguration,\n log: Logger,\n ): FrameworkManagedSecretMaterialRef[] {\n const outcome = SecretsProvisioning.ensureForEnvironment(env.name);\n if (outcome.status !== SecretsProvisioningStatus.PROVISIONED) {\n return [];\n }\n\n log.info(\n ` Provisioned ${outcome.mintedRefs.length} missing framework-managed secret material(s) for '${env.name}': `\n + `${outcome.mintedRefs.join(', ')}.`,\n );\n return outcome.mintedRefs;\n }\n\n /**\n * Rehydrate the in-memory env from the authored infra descriptor so a\n * stale `environments.json` cannot mask a fresh authored change. We\n * mutate in place AND persist via {@link EnvironmentLifecycle.updateEnvironmentState}\n * so subsequent reads (compose generator, env-vars builder, address\n * resolver) all see the same source-of-truth.\n *\n * Conservative diff. We only persist when at least one tracked field\n * actually changed — re-running `wildo local up` against a fully synced\n * state must remain a no-op so we don't churn `environments.json`'s\n * `updatedAt` on every invocation.\n */\n private static refreshEnvFromAuthored(\n env: PlatformEnvironmentConfiguration,\n authored: import('@wildo-ai/platform-config-lib').WildoInfraEnvConfig,\n ): boolean {\n const seededRuntime = authored.runtime ?? env.runtime;\n const seededRuntimeEnvironment = authored.runtimeEnvironment ?? env.runtimeEnvironment;\n const seededPublicDomain = authored.publicDomain\n ?? env.publicDomain\n ?? (seededRuntime === WildoDeploymentRuntime.KUBERNETES\n ? PUBLIC_DOMAIN_DEFAULTS.LOCAL_K8S\n : PUBLIC_DOMAIN_DEFAULTS.LOCAL_COMPOSE);\n\n const next: PlatformEnvironmentConfiguration = {\n ...env,\n runtime: seededRuntime,\n runtimeEnvironment: seededRuntimeEnvironment,\n publicDomain: seededPublicDomain,\n /**\n * Always defined on the authored descriptor — its transform resolves the `locationType`\n * default — so there is no `?? env.` fallback to write here, unlike `runtime` above. Paired\n * with the `diffSelector` entry, per the rule stated there.\n */\n localDataStorage: authored.localDataStorage,\n /**\n * The platform's database engine, when the environment AUTHORS one.\n *\n * `database` is only optional on the authored descriptor — every environment that does not\n * declare it keeps the engine it already had, which is what preserves the behaviour of every\n * environment created before the field existed. It is REQUIRED on the registry record, so the\n * fallback is `env.database` rather than `undefined`.\n *\n * This matters more than the other fields here because of an asymmetry in the two consumers\n * of the choice: `needsLocalMongoDB` / `needsLocalPostgreSQL` resolve the PLATFORM half via\n * `getDatabaseChoice(env.name)`, i.e. from the PERSISTED registry, while taking the\n * `backingServices` half from the in-memory env they are handed. So the container-rendering\n * decisions read this record, not the caller's snapshot — an authored engine that never\n * lands here is invisible to compose, to the K8s catalog, and to `local_data` pre-creation,\n * while the env-var builders (which read `config.json`) would already have moved.\n */\n database: authored.database ?? env.database,\n // Omission is authoritative: an environment that stops naming a host owns its infrastructure again.\n infrastructureHost: authored.infrastructureHost,\n // Authored `kubernetes` carries `{ namespace, ingressClass? }` but\n // the CLI runtime shape (`PlatformEnvironmentKubernetesConfig`) is\n // `{ namespace, imageRegistry? }`. The runtime `imageRegistry` is\n // computed at setup-time (see `environment-setup.service.ts` →\n // `KIND_CLUSTER_DEFAULTS.REGISTRY_PORT`) and has no authored\n // counterpart, so we only project `namespace` and preserve the\n // existing `imageRegistry` from the in-memory env state. Authored\n // `ingressClass` is not mirrored: authored and persisted config accept\n // only the Traefik controller installed by Wildo. The manifest renderer\n // uses that canonical supported class rather than a runtime override.\n kubernetes: authored.kubernetes\n ? {\n namespace: authored.kubernetes.namespace,\n imageRegistry: env.kubernetes?.imageRegistry,\n }\n : env.kubernetes,\n serviceHosts: authored.serviceHosts ?? env.serviceHosts,\n cdn: authored.cdn ?? env.cdn,\n backingServices: authored.backingServices ?? env.backingServices,\n // Omission is authoritative: never resurrect a removed policy from the registry cache.\n serviceAuth: authored.serviceAuth,\n logging: authored.logging ?? env.logging,\n observability: authored.observability ?? env.observability,\n providerSelection: authored.providerSelection ?? env.providerSelection,\n };\n\n const changed = JSON.stringify(RuntimeBootstrap.diffSelector(env))\n !== JSON.stringify(RuntimeBootstrap.diffSelector(next));\n\n if (!changed) {\n return false;\n }\n\n Object.assign(env, next);\n EnvironmentLifecycle.updateEnvironmentState(env);\n EnvironmentUtils.invalidateCache();\n return true;\n }\n\n /**\n * Selects only the fields {@link refreshEnvFromAuthored} mutates so the\n * change-detection JSON diff stays narrow and stable (avoids false\n * positives from `updatedAt` / `setupStatus` churn).\n */\n private static diffSelector(env: PlatformEnvironmentConfiguration): Record<string, unknown> {\n return {\n runtime: env.runtime,\n runtimeEnvironment: env.runtimeEnvironment,\n publicDomain: env.publicDomain,\n /**\n * Paired with the `localDataStorage` projection in {@link refreshEnvFromAuthored}. Flipping\n * an environment's storage mode is a ONE-LINE authored edit and frequently the only one in\n * its change, so omitting it here is precisely the \"copied but not diffed\" case the rule\n * above describes: the refresh would return `false` and the new mode would never reach the\n * environment or the compose file rendered from it.\n */\n localDataStorage: env.localDataStorage,\n /**\n * Every field this projects must ALSO be part of what `refreshEnvFromAuthored` DETECTS, not\n * merely part of what it copies. A field that is copied but not diffed makes a change\n * touching only that field read as unchanged, so the refresh returns `false` and the authored\n * value never reaches the environment at all. Add to both lists, or to neither.\n */\n serviceHosts: env.serviceHosts,\n cdn: env.cdn,\n kubernetes: env.kubernetes,\n /**\n * Paired with the `database` projection in {@link refreshEnvFromAuthored} — the rule above is\n * not advisory. An authored engine flip is frequently the ONLY edit in its change (it is one\n * line), so omitting it here would make precisely the change this field exists to express\n * diff as unchanged, return `false`, and never reach `updateEnvironmentState`.\n */\n database: env.database,\n infrastructureHost: env.infrastructureHost,\n backingServices: env.backingServices,\n serviceAuth: env.serviceAuth,\n logging: env.logging,\n observability: env.observability,\n providerSelection: env.providerSelection,\n };\n }\n\n /**\n * Write `config.json` from the authored infra descriptor when missing\n * (idempotent self-heal for `local up`).\n *\n * Delegates the actual projection + write to\n * {@link RuntimeBootstrap.writeConfigJsonFromAuthored} so the only-if-missing\n * self-heal and the always-regenerate `config sync` reconcile share ONE\n * projection — the file this produces is byte-identical to what\n * `wildo config sync` writes.\n */\n private static ensureConfigJson(\n env: PlatformEnvironmentConfiguration,\n authored: import('@wildo-ai/platform-config-lib').WildoInfraEnvConfig,\n log: Logger,\n ): boolean {\n const configPath = join(EnvironmentPaths.resolveConfigDir(env.name), FILE_NAMES.CONFIG_JSON);\n if (existsSync(configPath)) {\n /*\n * \"Only when missing\" has ONE exception: the environment's infrastructure OWNER changed. Adding or\n * removing `infrastructureHost` changes where every backing service is and which application may\n * touch it, so a `config.json` still describing the previous owner would steer the next render,\n * readiness probe and registration at the wrong substrate. Everything else keeps the existing file.\n */\n const persistedHost = EnvironmentUtils.loadConfigJson(env.name)?.infrastructureHost;\n if (JSON.stringify(persistedHost ?? null) === JSON.stringify(authored.infrastructureHost ?? null)) {\n return false;\n }\n RuntimeBootstrap.writeConfigJsonFromAuthored(env, authored);\n log.info(\n authored.infrastructureHost\n ? ` Rewrote ${FILE_NAMES.CONFIG_JSON}: this environment now runs on the infrastructure of ${authored.infrastructureHost.applicationRoot}.`\n : ` Rewrote ${FILE_NAMES.CONFIG_JSON}: this environment now owns its infrastructure.`,\n );\n return true;\n }\n\n RuntimeBootstrap.writeConfigJsonFromAuthored(env, authored);\n log.info(` Self-healed missing ${FILE_NAMES.CONFIG_JSON} from authored infra descriptor.`);\n return true;\n }\n\n /**\n * Project the authored infra descriptor into the persisted `config.json`\n * shape and write it UNCONDITIONALLY (overwriting any existing file),\n * invalidating the config cache so the next read returns the fresh shape.\n *\n * Uses the shared {@link buildConfigJsonFromInfraEnvConfig} projection — the\n * single source of truth also used by the `local up` self-heal and the\n * `loadConfigForSync` authored fallback. Callers own the write-policy\n * decision (only-if-missing vs. always); this helper just performs the write.\n */\n private static writeConfigJsonFromAuthored(\n env: PlatformEnvironmentConfiguration,\n authored: import('@wildo-ai/platform-config-lib').WildoInfraEnvConfig,\n ): void {\n const configDir = EnvironmentPaths.resolveConfigDir(env.name);\n const projected = buildConfigJsonFromInfraEnvConfig(authored);\n FileUtils.ensureDirectoryExists(configDir);\n writeFileSync(join(configDir, FILE_NAMES.CONFIG_JSON), `${JSON.stringify(projected, null, 2)}\\n`);\n EnvironmentUtils.invalidateCache();\n }\n\n /**\n * Ensure the Docker Compose runtime artifacts exist:\n * - `docker-compose.wildo-platform.yml` (template render)\n * - `.env.wildo-platform` (infra credentials env file)\n *\n * Both delegate to the same generators that `runInfraWrite` calls in the\n * interactive setup flow, so the rendered artifacts match exactly.\n *\n * `.env.wildo-platform` requires `secrets.json`; we surface a hint when\n * absent so the operator knows the next step is `wildo setup` (or restore\n * from a known-good `secrets.json` backup) rather than re-running\n * `wildo local up` until something gives.\n */\n /**\n * @param secretMaterialChanged - True when this run minted framework-managed credential\n * material. Both artifacts PROJECT `secrets.json` (the compose immudb service gates\n * its `--signingKey` mount on the materialized signing key; `.env.wildo-platform`\n * carries generated service credentials), so a present-but-pre-provisioning artifact\n * is stale and must be re-rendered rather than left alone by the normal\n * \"write only when missing\" policy.\n */\n private static async ensureDockerComposeArtifacts(\n env: PlatformEnvironmentConfiguration,\n frameworkPath: string | null,\n isFrameworkDeveloper: boolean,\n log: Logger,\n secretMaterialChanged: boolean,\n ): Promise<{ wroteDockerCompose: boolean; wroteEnvFile: boolean }> {\n const composeDir = EnvironmentPaths.resolveDockerComposeDir(env.name);\n const composePath = join(composeDir, FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM);\n const envFilePath = join(composeDir, FILE_NAMES.ENV_WILDO_PLATFORM);\n\n let wroteDockerCompose = false;\n if (!existsSync(composePath) || secretMaterialChanged) {\n if (!frameworkPath) {\n throw new Error(\n `Cannot self-heal missing ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM} for '${env.name}': no framework path available.\\n`\n + ` The compose template lives under the framework checkout. Re-run with a framework path configured, or run 'wildo config sync --domain manifest' from a workspace that has one.`,\n );\n }\n await renderDockerComposeTemplate(env, frameworkPath, isFrameworkDeveloper);\n log.info(\n secretMaterialChanged\n ? ` Re-rendered ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM} to carry newly provisioned secret material.`\n : ` Self-healed missing ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM} from authored infra descriptor.`,\n );\n wroteDockerCompose = true;\n }\n\n let wroteEnvFile = false;\n if (!existsSync(envFilePath) || secretMaterialChanged) {\n const credentials = EnvironmentUtils.loadSecretsJson(env.name);\n if (!credentials) {\n throw new Error(\n `Cannot self-heal missing ${FILE_NAMES.ENV_WILDO_PLATFORM} for '${env.name}': secrets.json is missing or unreadable.\\n`\n + ` Run 'wildo setup' to author secrets interactively, or restore a known-good secrets.json backup.`,\n );\n }\n generateEnvWildoPlatform(env, isFrameworkDeveloper, credentials);\n log.info(\n secretMaterialChanged\n ? ` Re-generated ${FILE_NAMES.ENV_WILDO_PLATFORM} to carry newly provisioned secret material.`\n : ` Self-healed missing ${FILE_NAMES.ENV_WILDO_PLATFORM} from authored infra descriptor + secrets.json.`,\n );\n wroteEnvFile = true;\n }\n\n return { wroteDockerCompose, wroteEnvFile };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"runtime-bootstrap.service.js","sourceRoot":"","sources":["../../../../src/services/environment/runtime-bootstrap.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAEH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EACL,iCAAiC,EACjC,0CAA0C,EAC1C,0BAA0B,GAC3B,MAAM,6DAA6D,CAAC;AACrE,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,mCAAmC,GACpC,MAAM,wEAAwE,CAAC;AAEhF,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,8DAA8D,CA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BAAkB,8CAA8C;gBAC/F,CAAC,CAAC,yBAAyB,UAAU,CAAC,kBAAkB,iDAAiD,CAC5G,CAAC;YACF,YAAY,GAAG,IAAI,CAAC;QACtB,CAAC;QAED,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,CAAC;IAC9C,CAAC;CACF","sourcesContent":["/**\n * runtime-bootstrap — headless self-healing pre-flight for `wildo local up`.\n *\n * Background. Before this service existed, the only paths that wrote the\n * Docker Compose runtime artifacts (`config.json`,\n * `docker-compose.wildo-platform.yml`, `.env.wildo-platform`) were:\n * 1. The interactive `wildo setup` flow (rejects `--non-interactive`).\n * 2. The post-bootstrap `wildo config sync --domain manifest` /\n * `wildo config sync` flow, which assumes the artifacts already exist\n * and additionally tries to reach apps-manager (circular: apps-manager\n * cannot start until the compose stack is up, but the compose stack\n * cannot render until config sync ran).\n *\n * That left the \"fresh clone of an existing app + `wildo local up`\" loop\n * stuck on hand-edited `config.json` / `.env.wildo-platform` files — exactly\n * the zero-touch greenfield experience the operator expects.\n *\n * What this service does. Right before `wildo local up` invokes\n * `ContextManager.resolveInfraContext` (which fail-loud-checks the compose\n * file presence), we:\n * - Re-load the authored `wildo.infra.<env>.config.ts` and rehydrate the\n * in-memory env state (`backingServices`, `serviceAuth`, `runtime`,\n * `runtimeEnvironment`, `database`, `publicDomain`, `kubernetes`,\n * `logging`) so the authored source-of-truth wins over a stale\n * `environments.json` snapshot.\n * - If `config.json` is missing, project the authored config through\n * {@link buildConfigJsonFromInfraEnvConfig} (the same projection\n * `wildo config sync --domain manifest` uses) and write it.\n * - For DOCKER_COMPOSE runtimes only, if the compose template render or\n * the `.env.wildo-platform` env file is missing, render them via the\n * same generators `runInfraWrite` calls during the interactive setup\n * flow.\n *\n * Single source of truth. The projection, rendering and env-file generation\n * are all delegated to the existing services — this file only orchestrates.\n * Result: artifacts produced here are byte-identical to the ones a later\n * `wildo config sync --domain manifest` (or interactive `wildo setup`) would\n * produce.\n *\n * Atlas / managed-Mongo guard. When the authored config cannot serve as a\n * `config.json` fallback (today: ATLAS-backed Mongo, which needs API\n * metadata not present in the authored descriptor), we surface the same\n * reason string used by `sync.command.ts` and abort — there is nothing\n * useful we can self-heal in that case.\n *\n * Secrets handling. We never ROTATE `secrets.json` here — rotation is\n * destructive and stays behind `wildo config sync --rotate-secrets`. We DO\n * provision missing framework-managed material (see\n * {@link SecretsProvisioning.ensureForEnvironment}), which is the additive\n * mirror image of everything else this pre-flight does: mint only what is\n * absent, never touch what exists. Without it, a material introduced after an\n * environment was set up never reaches that environment — which is exactly how\n * the immudb state-signing keypair stayed missing and left the audit store's\n * whole-server-substitution defense off. Operator-typed secrets still require\n * interactive authoring: if `secrets.json` is missing entirely, the\n * `.env.wildo-platform` step throws with a clear hint to run `wildo setup` (or\n * restore from a backup).\n *\n * Shared with `wildo config sync`. The authored-infra → generated-config\n * reconciliation primitives ({@link RuntimeBootstrap.refreshEnvFromAuthored}\n * + the config.json projection write) are ALSO the source of truth for\n * `config sync`, exposed via {@link RuntimeBootstrap.reconcileGeneratedConfigFromAuthored}.\n * The two callers differ ONLY in write policy:\n * - `local up` self-heal ({@link RuntimeBootstrap.ensureLocalRuntimeArtifacts})\n * writes config.json / compose ONLY when missing — an idempotent\n * pre-flight that must not churn `environments.json`'s `updatedAt` or the\n * compose file on every invocation.\n * - `config sync` reconcile ALWAYS regenerates config.json from the authored\n * descriptor — it is an explicit \"make authored infra the source of truth\"\n * command, so a stale-but-present config.json (e.g. a pre-`backingServices`\n * snapshot missing a newly-authored `immudb` service) is deterministically\n * rewritten before the compose / env-file steps read it.\n */\n\nimport { existsSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nimport {\n PUBLIC_DOMAIN_DEFAULTS,\n WildoDeploymentRuntime,\n WildoLocationType,\n} from '@wildo-ai/platform-config-lib';\n\nimport { FILE_NAMES } from '~wildo-cli/infrastructure/io/io.schemas';\nimport { FileUtils } from '~wildo-cli/infrastructure/io/file.utils';\nimport {\n buildConfigJsonFromInfraEnvConfig,\n getUnsupportedAuthoredConfigFallbackReason,\n loadAuthoredInfraEnvConfig,\n} from '~wildo-cli/services/environment/authored-infra-config.utils';\nimport {\n generateEnvWildoPlatform,\n renderDockerComposeTemplate,\n isComposeHostMountedArtifactMissing,\n} from '~wildo-cli/services/deployment/docker/docker-compose-generator.service';\nimport type { FrameworkManagedSecretMaterialRef } from '~wildo-cli/services/credentials/framework-managed-secrets';\nimport {\n SecretsProvisioning,\n SecretsProvisioningStatus,\n} from '~wildo-cli/services/credentials/secrets-provisioning.service';\nimport { EnvironmentLifecycle } from '~wildo-cli/services/environment/environment-lifecycle.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\n\n/**\n * Summary of what the runtime-bootstrap pre-flight wrote on disk during this\n * invocation. Returned to call sites so they can decide whether to log a\n * \"self-healed N artifacts\" line and so tests can assert on the exact\n * deltas without inspecting the filesystem twice.\n */\nexport interface RuntimeBootstrapResult {\n /** Authored env state was re-projected onto `environments.json`. */\n refreshedEnvState: boolean;\n /** `config.json` was missing and has just been written. */\n wroteConfigJson: boolean;\n /**\n * Docker Compose template was written — because it was missing, or because newly\n * provisioned secret material made the existing render stale.\n */\n wroteDockerCompose: boolean;\n /**\n * `.env.wildo-platform` was written — because it was missing, or because newly\n * provisioned secret material made the existing file stale.\n */\n wroteEnvFile: boolean;\n /**\n * Framework-managed credential materials that were absent from `secrets.json` and have\n * just been minted (empty on a fully provisioned environment). Non-empty means the\n * compose render + platform env file were regenerated to carry the new material.\n */\n mintedSecretMaterials: FrameworkManagedSecretMaterialRef[];\n}\n\nconst NO_OP_RESULT: RuntimeBootstrapResult = {\n refreshedEnvState: false,\n wroteConfigJson: false,\n wroteDockerCompose: false,\n wroteEnvFile: false,\n mintedSecretMaterials: [],\n};\n\n/**\n * Pre-flight ensures the runtime artifacts `wildo local up` depends on\n * exist on disk for the given environment, generating them from the\n * authored `wildo.infra.<env>.config.ts` when missing. See file header\n * for the full rationale.\n *\n * Pre-conditions:\n * - `env` is the in-memory environment from `ctx.activeEnv` (already\n * seeded by `ExistingAppBootstrapService`).\n * - `saasRoot` is the resolved targeted-app declaration root.\n *\n * Post-conditions on success:\n * - In-memory env state mirrors the authored infra descriptor.\n * - `config.json` exists in the env's resolved config dir.\n * - For DOCKER_COMPOSE runtimes, the compose render and\n * `.env.wildo-platform` exist in the env's docker-compose dir.\n *\n * Throws when the authored descriptor is missing (the operator must\n * author or restore one) or when secrets are required and absent.\n */\nexport interface RuntimeBootstrapInput {\n env: PlatformEnvironmentConfiguration;\n saasRoot: string;\n /**\n * Framework checkout root — required only for `DOCKER_COMPOSE` runtimes\n * because the compose template render needs to locate the Handlebars\n * template directory under the framework repo. Pass `null` if not\n * available; for K8s envs this preflight does not need it.\n */\n frameworkPath: string | null;\n isFrameworkDeveloper: boolean;\n log: Logger;\n}\n\n/**\n * Outcome of {@link RuntimeBootstrap.reconcileGeneratedConfigFromAuthored}.\n * A TS enum (not a literal-string union) so callers get autocomplete +\n * refactor-safety when branching on the result.\n */\nexport enum RuntimeConfigReconcileStatus {\n /** Env-state + `config.json` were regenerated from the authored descriptor. */\n RECONCILED = 'reconciled',\n /** Env is not LOCAL — remote/CI keep their generated / reconstructed config.json. */\n SKIPPED_NON_LOCAL = 'skipped-non-local',\n /** No authored `wildo.infra.<env>.config.ts` exists to reconcile from. */\n NO_AUTHORED_CONFIG = 'no-authored-config',\n /**\n * Authored descriptor cannot fully serve as the config.json source of truth\n * (today: Atlas-backed Mongo, whose generated config.json carries API\n * metadata + external endpoints the authored descriptor omits). The existing\n * generated config.json is left untouched.\n */\n SKIPPED_UNSUPPORTED = 'skipped-unsupported',\n}\n\nexport type RuntimeConfigReconcileResult =\n | {\n status: RuntimeConfigReconcileStatus.RECONCILED;\n /**\n * True when the persisted env-registry snapshot actually changed\n * (conservative diff) — false when the env was already current and only\n * `config.json` was rewritten. (config.json is unconditionally rewritten\n * for RECONCILED, so there is no separate flag for it.)\n */\n refreshedEnvState: boolean;\n }\n | { status: RuntimeConfigReconcileStatus.SKIPPED_NON_LOCAL }\n | { status: RuntimeConfigReconcileStatus.NO_AUTHORED_CONFIG }\n | { status: RuntimeConfigReconcileStatus.SKIPPED_UNSUPPORTED; reason: string };\n\nexport class RuntimeBootstrap {\n /**\n * Reconcile the two generated INPUTS that `wildo config sync` (and the\n * compose / env-file renderers it drives) read as the source of truth for\n * backing services / ports / sources:\n * - the persisted env-registry snapshot (`environments.json`), refreshed\n * in place via {@link RuntimeBootstrap.refreshEnvFromAuthored}; and\n * - the generated `config.json`, ALWAYS rewritten from the authored\n * `wildo.infra.<env>.config.ts` projection.\n *\n * Root fix for the stale-config-json bug: `config sync` used to read a\n * generated `config.json` (and `environments.json`) that it never refreshed\n * from the authored descriptor, so an authored change (e.g. adding an\n * `immudb` backing service) never reached the generated docker-compose.\n * Calling this BEFORE any sync domain consumes those inputs makes the\n * authored `.ts` the deterministic source of truth every run.\n *\n * Unlike {@link RuntimeBootstrap.ensureLocalRuntimeArtifacts} (the `local up`\n * self-heal) this does NOT render the compose / env-file artifacts — it only\n * refreshes their inputs. It also does NOT touch remote/CI environments,\n * which legitimately reconstruct `config.json` from env vars / a sibling\n * secrets repo (see the LOCAL guard below and the Atlas carve-out).\n *\n * Fail-soft by contract: returns a status the caller inspects; never throws\n * for the \"no authored descriptor\" or \"Atlas\" cases. It DOES surface a throw\n * from {@link loadAuthoredInfraEnvConfig} (broken / env-mismatched `.ts`) so\n * the caller can decide — `config sync` treats authored-load/schema failures\n * as fatal and does not run later domains against an old snapshot. Logging is intentionally the\n * caller's concern (it emits status-specific messages off the returned\n * result), so no `log` is taken here.\n */\n static async reconcileGeneratedConfigFromAuthored(input: {\n env: PlatformEnvironmentConfiguration;\n saasRoot: string;\n }): Promise<RuntimeConfigReconcileResult> {\n const { env, saasRoot } = input;\n\n if (env.locationType !== WildoLocationType.LOCAL) {\n return { status: RuntimeConfigReconcileStatus.SKIPPED_NON_LOCAL };\n }\n\n const loaded = await loadAuthoredInfraEnvConfig(env.name, saasRoot);\n if (!loaded) {\n return { status: RuntimeConfigReconcileStatus.NO_AUTHORED_CONFIG };\n }\n\n const fallbackReason = getUnsupportedAuthoredConfigFallbackReason(\n env.name,\n loaded.path,\n loaded.config,\n );\n if (fallbackReason) {\n return { status: RuntimeConfigReconcileStatus.SKIPPED_UNSUPPORTED, reason: fallbackReason };\n }\n\n const refreshedEnvState = RuntimeBootstrap.refreshEnvFromAuthored(env, loaded.config);\n RuntimeBootstrap.writeConfigJsonFromAuthored(env, loaded.config);\n\n return {\n status: RuntimeConfigReconcileStatus.RECONCILED,\n refreshedEnvState,\n };\n }\n\n static async ensureLocalRuntimeArtifacts(\n input: RuntimeBootstrapInput,\n ): Promise<RuntimeBootstrapResult> {\n const { env, saasRoot, frameworkPath, isFrameworkDeveloper, log } = input;\n\n if (env.locationType !== WildoLocationType.LOCAL) {\n return NO_OP_RESULT;\n }\n\n const loaded = await loadAuthoredInfraEnvConfig(env.name, saasRoot);\n if (!loaded) {\n throw new Error(\n `Cannot bootstrap runtime artifacts for '${env.name}': no authored infra descriptor found.\\n`\n + ` Expected: <saasRoot>/infrastructure/${env.name}/wildo.infra.${env.name === 'local' ? 'local' : 'remote'}.config.ts`,\n );\n }\n\n const fallbackReason = getUnsupportedAuthoredConfigFallbackReason(\n env.name,\n loaded.path,\n loaded.config,\n );\n if (fallbackReason) {\n throw new Error(`${fallbackReason}\\n Run 'wildo setup' to author '${env.name}' interactively.`);\n }\n\n const refreshedEnvState = RuntimeBootstrap.refreshEnvFromAuthored(env, loaded.config);\n\n const wroteConfigJson = RuntimeBootstrap.ensureConfigJson(env, loaded.config, log);\n\n // Mint any framework-managed credential material this environment predates, BEFORE\n // the compose render / env-file generation read `secrets.json` — those artifacts\n // project the material (e.g. the immudb `--signingKey` mount), so provisioning after\n // them would leave the freshly minted key stranded until the next command.\n const mintedSecretMaterials = RuntimeBootstrap.provisionFrameworkManagedSecrets(env, log);\n\n let wroteDockerCompose = false;\n let wroteEnvFile = false;\n\n // A HOSTED environment renders no compose project and no `.env.wildo-platform`: both are its host's,\n // and a render here would describe the host's containers over this application's `local_data`.\n if (env.runtime === WildoDeploymentRuntime.DOCKER_COMPOSE && loaded.config.infrastructureHost === undefined) {\n const composeArtifacts = await RuntimeBootstrap.ensureDockerComposeArtifacts(\n env,\n frameworkPath,\n isFrameworkDeveloper,\n log,\n // Newly minted material invalidates any existing render: the compose file gates\n // the immudb `--signingKey` block on the key file it materializes from\n // secrets.json, and `.env.wildo-platform` carries generated service credentials.\n // \"Write only when missing\" would otherwise leave the environment provisioned on\n // paper but still running the degraded artifacts.\n //\n // A MISSING HOST-MOUNTED ARTIFACT forces the render for the same reason, and it is the case\n // the mint condition above cannot see. The render materializes files that compose\n // BIND-MOUNTS, but it is skipped whenever the compose file already exists — and a data reset\n // deletes those files while leaving the compose file untouched. Docker then creates a\n // DIRECTORY at each missing mount source instead of failing, so the container starts and\n // dies on something that reads nothing like a mounting problem.\n //\n // Observed 2026-08-22 on the first cold start after a full `local_data` reset:\n // `wildo local dev` failed at `container wildo-immudb is unhealthy`, because immudb found a\n // directory where its `--signingKey` file belongs. Nothing had been newly minted — the key\n // lives in the authored `secrets.json`, which survives a data reset — so no condition here\n // forced the re-render that would have written it back.\n mintedSecretMaterials.length > 0\n || isComposeHostMountedArtifactMissing(env, EnvironmentPaths.resolveScopedLocalDataDir(saasRoot)),\n );\n wroteDockerCompose = composeArtifacts.wroteDockerCompose;\n wroteEnvFile = composeArtifacts.wroteEnvFile;\n }\n\n return {\n refreshedEnvState,\n wroteConfigJson,\n wroteDockerCompose,\n wroteEnvFile,\n mintedSecretMaterials,\n };\n }\n\n /**\n * Additive `secrets.json` self-heal: mint every framework-managed credential material\n * the environment is missing and persist it. Returns the minted material refs so the\n * caller can invalidate the derived artifacts that project them.\n *\n * Fail-soft. A missing/unreadable `secrets.json` is NOT handled here — the downstream\n * `.env.wildo-platform` step already fails with the actionable \"run `wildo setup`\"\n * message, and pre-empting it with a second error would only bury that guidance.\n */\n private static provisionFrameworkManagedSecrets(\n env: PlatformEnvironmentConfiguration,\n log: Logger,\n ): FrameworkManagedSecretMaterialRef[] {\n const outcome = SecretsProvisioning.ensureForEnvironment(env.name);\n if (outcome.status !== SecretsProvisioningStatus.PROVISIONED) {\n return [];\n }\n\n log.info(\n ` Provisioned ${outcome.mintedRefs.length} missing framework-managed secret material(s) for '${env.name}': `\n + `${outcome.mintedRefs.join(', ')}.`,\n );\n return outcome.mintedRefs;\n }\n\n /**\n * Rehydrate the in-memory env from the authored infra descriptor so a\n * stale `environments.json` cannot mask a fresh authored change. We\n * mutate in place AND persist via {@link EnvironmentLifecycle.updateEnvironmentState}\n * so subsequent reads (compose generator, env-vars builder, address\n * resolver) all see the same source-of-truth.\n *\n * Conservative diff. We only persist when at least one tracked field\n * actually changed — re-running `wildo local up` against a fully synced\n * state must remain a no-op so we don't churn `environments.json`'s\n * `updatedAt` on every invocation.\n */\n private static refreshEnvFromAuthored(\n env: PlatformEnvironmentConfiguration,\n authored: import('@wildo-ai/platform-config-lib').WildoInfraEnvConfig,\n ): boolean {\n const seededRuntime = authored.runtime ?? env.runtime;\n const seededRuntimeEnvironment = authored.runtimeEnvironment ?? env.runtimeEnvironment;\n const seededPublicDomain = authored.publicDomain\n ?? env.publicDomain\n ?? (seededRuntime === WildoDeploymentRuntime.KUBERNETES\n ? PUBLIC_DOMAIN_DEFAULTS.LOCAL_K8S\n : PUBLIC_DOMAIN_DEFAULTS.LOCAL_COMPOSE);\n\n const next: PlatformEnvironmentConfiguration = {\n ...env,\n runtime: seededRuntime,\n runtimeEnvironment: seededRuntimeEnvironment,\n publicDomain: seededPublicDomain,\n /**\n * Always defined on the authored descriptor — its transform resolves the `locationType`\n * default — so there is no `?? env.` fallback to write here, unlike `runtime` above. Paired\n * with the `diffSelector` entry, per the rule stated there.\n */\n localDataStorage: authored.localDataStorage,\n /**\n * The platform's database engine, when the environment AUTHORS one.\n *\n * `database` is only optional on the authored descriptor — every environment that does not\n * declare it keeps the engine it already had, which is what preserves the behaviour of every\n * environment created before the field existed. It is REQUIRED on the registry record, so the\n * fallback is `env.database` rather than `undefined`.\n *\n * This matters more than the other fields here because of an asymmetry in the two consumers\n * of the choice: `needsLocalMongoDB` / `needsLocalPostgreSQL` resolve the PLATFORM half via\n * `getDatabaseChoice(env.name)`, i.e. from the PERSISTED registry, while taking the\n * `backingServices` half from the in-memory env they are handed. So the container-rendering\n * decisions read this record, not the caller's snapshot — an authored engine that never\n * lands here is invisible to compose, to the K8s catalog, and to `local_data` pre-creation,\n * while the env-var builders (which read `config.json`) would already have moved.\n */\n database: authored.database ?? env.database,\n // Omission is authoritative: an environment that stops naming a host owns its infrastructure again.\n infrastructureHost: authored.infrastructureHost,\n // Authored `kubernetes` carries `{ namespace, ingressClass? }` but\n // the CLI runtime shape (`PlatformEnvironmentKubernetesConfig`) is\n // `{ namespace, imageRegistry? }`. The runtime `imageRegistry` is\n // computed at setup-time (see `environment-setup.service.ts` →\n // `KIND_CLUSTER_DEFAULTS.REGISTRY_PORT`) and has no authored\n // counterpart, so we only project `namespace` and preserve the\n // existing `imageRegistry` from the in-memory env state. Authored\n // `ingressClass` is not mirrored: authored and persisted config accept\n // only the Traefik controller installed by Wildo. The manifest renderer\n // uses that canonical supported class rather than a runtime override.\n kubernetes: authored.kubernetes\n ? {\n namespace: authored.kubernetes.namespace,\n imageRegistry: env.kubernetes?.imageRegistry,\n }\n : env.kubernetes,\n serviceHosts: authored.serviceHosts ?? env.serviceHosts,\n cdn: authored.cdn ?? env.cdn,\n backingServices: authored.backingServices ?? env.backingServices,\n // Omission is authoritative: never resurrect a removed policy from the registry cache.\n serviceAuth: authored.serviceAuth,\n logging: authored.logging ?? env.logging,\n observability: authored.observability ?? env.observability,\n providerSelection: authored.providerSelection ?? env.providerSelection,\n };\n\n const changed = JSON.stringify(RuntimeBootstrap.diffSelector(env))\n !== JSON.stringify(RuntimeBootstrap.diffSelector(next));\n\n if (!changed) {\n return false;\n }\n\n Object.assign(env, next);\n EnvironmentLifecycle.updateEnvironmentState(env);\n EnvironmentUtils.invalidateCache();\n return true;\n }\n\n /**\n * Selects only the fields {@link refreshEnvFromAuthored} mutates so the\n * change-detection JSON diff stays narrow and stable (avoids false\n * positives from `updatedAt` / `setupStatus` churn).\n */\n private static diffSelector(env: PlatformEnvironmentConfiguration): Record<string, unknown> {\n return {\n runtime: env.runtime,\n runtimeEnvironment: env.runtimeEnvironment,\n publicDomain: env.publicDomain,\n /**\n * Paired with the `localDataStorage` projection in {@link refreshEnvFromAuthored}. Flipping\n * an environment's storage mode is a ONE-LINE authored edit and frequently the only one in\n * its change, so omitting it here is precisely the \"copied but not diffed\" case the rule\n * above describes: the refresh would return `false` and the new mode would never reach the\n * environment or the compose file rendered from it.\n */\n localDataStorage: env.localDataStorage,\n /**\n * Every field this projects must ALSO be part of what `refreshEnvFromAuthored` DETECTS, not\n * merely part of what it copies. A field that is copied but not diffed makes a change\n * touching only that field read as unchanged, so the refresh returns `false` and the authored\n * value never reaches the environment at all. Add to both lists, or to neither.\n */\n serviceHosts: env.serviceHosts,\n cdn: env.cdn,\n kubernetes: env.kubernetes,\n /**\n * Paired with the `database` projection in {@link refreshEnvFromAuthored} — the rule above is\n * not advisory. An authored engine flip is frequently the ONLY edit in its change (it is one\n * line), so omitting it here would make precisely the change this field exists to express\n * diff as unchanged, return `false`, and never reach `updateEnvironmentState`.\n */\n database: env.database,\n infrastructureHost: env.infrastructureHost,\n backingServices: env.backingServices,\n serviceAuth: env.serviceAuth,\n logging: env.logging,\n observability: env.observability,\n providerSelection: env.providerSelection,\n };\n }\n\n /**\n * Write `config.json` from the authored infra descriptor when missing\n * (idempotent self-heal for `local up`).\n *\n * Delegates the actual projection + write to\n * {@link RuntimeBootstrap.writeConfigJsonFromAuthored} so the only-if-missing\n * self-heal and the always-regenerate `config sync` reconcile share ONE\n * projection — the file this produces is byte-identical to what\n * `wildo config sync` writes.\n */\n private static ensureConfigJson(\n env: PlatformEnvironmentConfiguration,\n authored: import('@wildo-ai/platform-config-lib').WildoInfraEnvConfig,\n log: Logger,\n ): boolean {\n const configPath = join(EnvironmentPaths.resolveConfigDir(env.name), FILE_NAMES.CONFIG_JSON);\n if (existsSync(configPath)) {\n /*\n * \"Only when missing\" has ONE exception: the environment's infrastructure OWNER changed. Adding or\n * removing `infrastructureHost` changes where every backing service is and which application may\n * touch it, so a `config.json` still describing the previous owner would steer the next render,\n * readiness probe and registration at the wrong substrate. Everything else keeps the existing file.\n */\n const persistedHost = EnvironmentUtils.loadConfigJson(env.name)?.infrastructureHost;\n if (JSON.stringify(persistedHost ?? null) === JSON.stringify(authored.infrastructureHost ?? null)) {\n return false;\n }\n RuntimeBootstrap.writeConfigJsonFromAuthored(env, authored);\n log.info(\n authored.infrastructureHost\n ? ` Rewrote ${FILE_NAMES.CONFIG_JSON}: this environment now runs on the infrastructure of ${authored.infrastructureHost.applicationRoot}.`\n : ` Rewrote ${FILE_NAMES.CONFIG_JSON}: this environment now owns its infrastructure.`,\n );\n return true;\n }\n\n RuntimeBootstrap.writeConfigJsonFromAuthored(env, authored);\n log.info(` Self-healed missing ${FILE_NAMES.CONFIG_JSON} from authored infra descriptor.`);\n return true;\n }\n\n /**\n * Project the authored infra descriptor into the persisted `config.json`\n * shape and write it UNCONDITIONALLY (overwriting any existing file),\n * invalidating the config cache so the next read returns the fresh shape.\n *\n * Uses the shared {@link buildConfigJsonFromInfraEnvConfig} projection — the\n * single source of truth also used by the `local up` self-heal and the\n * `loadConfigForSync` authored fallback. Callers own the write-policy\n * decision (only-if-missing vs. always); this helper just performs the write.\n */\n private static writeConfigJsonFromAuthored(\n env: PlatformEnvironmentConfiguration,\n authored: import('@wildo-ai/platform-config-lib').WildoInfraEnvConfig,\n ): void {\n const configDir = EnvironmentPaths.resolveConfigDir(env.name);\n const projected = buildConfigJsonFromInfraEnvConfig(authored);\n FileUtils.ensureDirectoryExists(configDir);\n writeFileSync(join(configDir, FILE_NAMES.CONFIG_JSON), `${JSON.stringify(projected, null, 2)}\\n`);\n EnvironmentUtils.invalidateCache();\n }\n\n /**\n * Ensure the Docker Compose runtime artifacts exist:\n * - `docker-compose.wildo-platform.yml` (template render)\n * - `.env.wildo-platform` (infra credentials env file)\n *\n * Both delegate to the same generators that `runInfraWrite` calls in the\n * interactive setup flow, so the rendered artifacts match exactly.\n *\n * `.env.wildo-platform` requires `secrets.json`; we surface a hint when\n * absent so the operator knows the next step is `wildo setup` (or restore\n * from a known-good `secrets.json` backup) rather than re-running\n * `wildo local up` until something gives.\n */\n /**\n * @param secretMaterialChanged - True when this run minted framework-managed credential\n * material. Both artifacts PROJECT `secrets.json` (the compose immudb service gates\n * its `--signingKey` mount on the materialized signing key; `.env.wildo-platform`\n * carries generated service credentials), so a present-but-pre-provisioning artifact\n * is stale and must be re-rendered rather than left alone by the normal\n * \"write only when missing\" policy.\n */\n private static async ensureDockerComposeArtifacts(\n env: PlatformEnvironmentConfiguration,\n frameworkPath: string | null,\n isFrameworkDeveloper: boolean,\n log: Logger,\n secretMaterialChanged: boolean,\n ): Promise<{ wroteDockerCompose: boolean; wroteEnvFile: boolean }> {\n const composeDir = EnvironmentPaths.resolveDockerComposeDir(env.name);\n const composePath = join(composeDir, FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM);\n const envFilePath = join(composeDir, FILE_NAMES.ENV_WILDO_PLATFORM);\n\n let wroteDockerCompose = false;\n if (!existsSync(composePath) || secretMaterialChanged) {\n if (!frameworkPath) {\n throw new Error(\n `Cannot self-heal missing ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM} for '${env.name}': no framework path available.\\n`\n + ` The compose template lives under the framework checkout. Re-run with a framework path configured, or run 'wildo config sync --domain manifest' from a workspace that has one.`,\n );\n }\n await renderDockerComposeTemplate(env, frameworkPath, isFrameworkDeveloper);\n log.info(\n secretMaterialChanged\n ? ` Re-rendered ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM} to carry newly provisioned secret material.`\n : ` Self-healed missing ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM} from authored infra descriptor.`,\n );\n wroteDockerCompose = true;\n }\n\n let wroteEnvFile = false;\n if (!existsSync(envFilePath) || secretMaterialChanged) {\n const credentials = EnvironmentUtils.loadSecretsJson(env.name);\n if (!credentials) {\n throw new Error(\n `Cannot self-heal missing ${FILE_NAMES.ENV_WILDO_PLATFORM} for '${env.name}': secrets.json is missing or unreadable.\\n`\n + ` Run 'wildo setup' to author secrets interactively, or restore a known-good secrets.json backup.`,\n );\n }\n generateEnvWildoPlatform(env, isFrameworkDeveloper, credentials);\n log.info(\n secretMaterialChanged\n ? ` Re-generated ${FILE_NAMES.ENV_WILDO_PLATFORM} to carry newly provisioned secret material.`\n : ` Self-healed missing ${FILE_NAMES.ENV_WILDO_PLATFORM} from authored infra descriptor + secrets.json.`,\n );\n wroteEnvFile = true;\n }\n\n return { wroteDockerCompose, wroteEnvFile };\n }\n}\n"]}
|