@wildo-ai/wildo-cli 1.1.12 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/src/commands/config/sync.command.d.ts.map +1 -1
  2. package/dist/src/commands/config/sync.command.js +1 -0
  3. package/dist/src/commands/config/sync.command.js.map +1 -1
  4. package/dist/src/commands/context/journey.command.d.ts.map +1 -1
  5. package/dist/src/commands/context/journey.command.js +8 -0
  6. package/dist/src/commands/context/journey.command.js.map +1 -1
  7. package/dist/src/commands/creation/drive.command.d.ts.map +1 -1
  8. package/dist/src/commands/creation/drive.command.js +2 -0
  9. package/dist/src/commands/creation/drive.command.js.map +1 -1
  10. package/dist/src/commands/fwk/publish-all.command.d.ts.map +1 -1
  11. package/dist/src/commands/fwk/publish-all.command.js +8 -0
  12. package/dist/src/commands/fwk/publish-all.command.js.map +1 -1
  13. package/dist/src/commands/local/dev.command.d.ts +68 -0
  14. package/dist/src/commands/local/dev.command.d.ts.map +1 -1
  15. package/dist/src/commands/local/dev.command.js +216 -8
  16. package/dist/src/commands/local/dev.command.js.map +1 -1
  17. package/dist/src/commands/local/doctor.command.d.ts +22 -9
  18. package/dist/src/commands/local/doctor.command.d.ts.map +1 -1
  19. package/dist/src/commands/local/doctor.command.js +45 -42
  20. package/dist/src/commands/local/doctor.command.js.map +1 -1
  21. package/dist/src/commands/providers/connect.command.d.ts.map +1 -1
  22. package/dist/src/commands/providers/connect.command.js +11 -1
  23. package/dist/src/commands/providers/connect.command.js.map +1 -1
  24. package/dist/src/commands/seal/currency.command.d.ts +13 -0
  25. package/dist/src/commands/seal/currency.command.d.ts.map +1 -0
  26. package/dist/src/commands/seal/currency.command.js +52 -0
  27. package/dist/src/commands/seal/currency.command.js.map +1 -0
  28. package/dist/src/commands/seal/seal-admin-door.utils.d.ts.map +1 -1
  29. package/dist/src/commands/seal/seal-admin-door.utils.js +2 -0
  30. package/dist/src/commands/seal/seal-admin-door.utils.js.map +1 -1
  31. package/dist/src/commands/seal/verify.command.d.ts +5 -0
  32. package/dist/src/commands/seal/verify.command.d.ts.map +1 -1
  33. package/dist/src/commands/seal/verify.command.js +26 -2
  34. package/dist/src/commands/seal/verify.command.js.map +1 -1
  35. package/dist/src/services/application/content-guardrail-classifier.service.d.ts +19 -0
  36. package/dist/src/services/application/content-guardrail-classifier.service.d.ts.map +1 -1
  37. package/dist/src/services/application/content-guardrail-classifier.service.js +75 -11
  38. package/dist/src/services/application/content-guardrail-classifier.service.js.map +1 -1
  39. package/dist/src/services/application/local-provider-doubles.service.d.ts +98 -0
  40. package/dist/src/services/application/local-provider-doubles.service.d.ts.map +1 -0
  41. package/dist/src/services/application/local-provider-doubles.service.js +214 -0
  42. package/dist/src/services/application/local-provider-doubles.service.js.map +1 -0
  43. package/dist/src/services/application/system-of-record-simulators.service.d.ts +21 -2
  44. package/dist/src/services/application/system-of-record-simulators.service.d.ts.map +1 -1
  45. package/dist/src/services/application/system-of-record-simulators.service.js +21 -12
  46. package/dist/src/services/application/system-of-record-simulators.service.js.map +1 -1
  47. package/dist/src/services/companion/creation-drive.service.d.ts +32 -2
  48. package/dist/src/services/companion/creation-drive.service.d.ts.map +1 -1
  49. package/dist/src/services/companion/creation-drive.service.js +61 -4
  50. package/dist/src/services/companion/creation-drive.service.js.map +1 -1
  51. package/dist/src/services/credentials/credentials.schemas.d.ts +6 -0
  52. package/dist/src/services/credentials/credentials.schemas.d.ts.map +1 -1
  53. package/dist/src/services/credentials/credentials.schemas.js +7 -1
  54. package/dist/src/services/credentials/credentials.schemas.js.map +1 -1
  55. package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
  56. package/dist/src/services/credentials/provider-env-vars.utils.js +11 -3
  57. package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
  58. package/dist/src/services/data-services/data-services.schemas.d.ts +9 -0
  59. package/dist/src/services/data-services/data-services.schemas.d.ts.map +1 -1
  60. package/dist/src/services/data-services/data-services.schemas.js +9 -0
  61. package/dist/src/services/data-services/data-services.schemas.js.map +1 -1
  62. package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
  63. package/dist/src/services/deployment/docker/docker-compose-generator.service.js +7 -2
  64. package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
  65. package/dist/src/services/deployment/local-dev-session-lease.service.d.ts.map +1 -1
  66. package/dist/src/services/deployment/local-dev-session-lease.service.js +22 -1
  67. package/dist/src/services/deployment/local-dev-session-lease.service.js.map +1 -1
  68. package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
  69. package/dist/src/services/environment/authored-infra-config.utils.js +1 -0
  70. package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
  71. package/dist/src/services/environment/authored-infra-member-authority.d.ts.map +1 -1
  72. package/dist/src/services/environment/authored-infra-member-authority.js +5 -0
  73. package/dist/src/services/environment/authored-infra-member-authority.js.map +1 -1
  74. package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
  75. package/dist/src/services/environment/env-configuration-generator.service.js +6 -3
  76. package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
  77. package/dist/src/services/environment/env-vars-builder.service.d.ts +6 -0
  78. package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
  79. package/dist/src/services/environment/env-vars-builder.service.js +24 -1
  80. package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
  81. package/dist/src/services/environment/environment-hydration.utils.d.ts.map +1 -1
  82. package/dist/src/services/environment/environment-hydration.utils.js +1 -0
  83. package/dist/src/services/environment/environment-hydration.utils.js.map +1 -1
  84. package/dist/src/services/environment/environment.schemas.d.ts +7 -1
  85. package/dist/src/services/environment/environment.schemas.d.ts.map +1 -1
  86. package/dist/src/services/environment/environment.schemas.js.map +1 -1
  87. package/dist/src/services/environment/runtime-bootstrap.service.d.ts +2 -0
  88. package/dist/src/services/environment/runtime-bootstrap.service.d.ts.map +1 -1
  89. package/dist/src/services/environment/runtime-bootstrap.service.js +4 -0
  90. package/dist/src/services/environment/runtime-bootstrap.service.js.map +1 -1
  91. package/dist/src/services/framework/framework-docker-publish.service.d.ts +13 -0
  92. package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
  93. package/dist/src/services/framework/framework-docker-publish.service.js +24 -7
  94. package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
  95. package/dist/src/services/registry/provider-connect.service.d.ts +57 -1
  96. package/dist/src/services/registry/provider-connect.service.d.ts.map +1 -1
  97. package/dist/src/services/registry/provider-connect.service.js +63 -2
  98. package/dist/src/services/registry/provider-connect.service.js.map +1 -1
  99. package/dist/tsconfig.build.tsbuildinfo +1 -1
  100. package/package.json +18 -18
  101. package/scripts/app-dependency-alignment/propagated-engine-overrides.json +1 -1
  102. package/wildo-framework.info.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"environment-hydration.utils.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/environment-hydration.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAOH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AACjG,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAE5G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,gCAAgC,EACrC,MAAM,EAAE,qBAAqB,GAC5B,gCAAgC,CA2GlC"}
1
+ {"version":3,"file":"environment-hydration.utils.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/environment-hydration.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAOH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AACjG,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAE5G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,gCAAgC,EACrC,MAAM,EAAE,qBAAqB,GAC5B,gCAAgC,CA4GlC"}
@@ -187,6 +187,7 @@ export function hydrateEnvironmentFromConfig(env, config) {
187
187
  observability: config.observability,
188
188
  providerSelection: config.providerSelection,
189
189
  email: config.email,
190
+ agentContentGuardrails: config.agentContentGuardrails,
190
191
  // Local-only (#2519); the local `config.json` is the authored projection, so its absence is the descriptor's.
191
192
  ownershipDnsStandIn: config.ownershipDnsStandIn,
192
193
  /** The snapshot is authoritative, including absence: a removed block stops the platform's Vault (#2933). */
@@ -1 +1 @@
1
- {"version":3,"file":"environment-hydration.utils.js","sourceRoot":"","sources":["../../../../src/services/environment/environment-hydration.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AAIvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,4BAA4B,CAC1C,GAAqC,EACrC,MAA6B;IAE7B,MAAM,iBAAiB,GACrB,CAAC,MAAM,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,sBAAsB,CAAC,UAAU;WAClE,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,YAAY,CAAC,KAAK,iBAAiB,CAAC,KAAK,CAAC;IAEnE,OAAO;QACL,GAAG,GAAG;QACN;;;;WAIG;QACH,YAAY,EAAE,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,YAAY;QAC7C,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO;QACtC,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,IAA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QAC/B,8FAA8F;QAC9F,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;QAC3C,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,8GAA8G;QAC9G,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;QAC/C,4GAA4G;QAC5G,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;KACpD,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Reconciling an in-memory environment registry record against the persisted\n * `config.json` snapshot — the environment's on-disk source of truth.\n *\n * ## Why this is a shared service and not a helper inside one command\n *\n * This function used to be module-private to `commands/config/sync.command.ts`. The\n * hydration itself was correct; being unreachable was the defect. Three code paths\n * generate an application's runtime topology from an environment record, and only the\n * one that owned this function reconciled first:\n *\n * | Entry point | Reconciled |\n * |---|---|\n * | `wildo config sync` | yes — it declared this function |\n * | `wildo local dev` (`commands/dev/start.command.ts`) | NO |\n * | `ApplicationRuntimeBootstrapService.initialize` | NO |\n *\n * Both of the unreconciled paths already LOADED `config.json` for other reasons and\n * then read identity fields off the un-reconciled registry record anyway, so the fact\n * they needed was in memory and was ignored.\n *\n * What that cost, on 2026-08-13: an environment authored a local edge scheme that `wildo config\n * sync` reconciled and wrote into the frontend env plus `APPLICATION_RUNTIME_ENDPOINTS`. A later\n * `wildo local dev` regenerated the SAME surfaces without reconciling, so the field read\n * `undefined` and every generated URL fell back to the default — while the dev server, which reads\n * `app/.env`, kept serving what a developer had put there by hand. The browser then sent an\n * `Origin` the backend was not configured to expect, and AUTH-10 (`_validateFrontendAppOrigin`)\n * refused every `POST /auth/identify` with a 403. Login was completely broken, and nothing in any\n * log named the cause.\n *\n * That incident had TWO causes and this file only fixed one. The second — `app/.env` being a file\n * nothing generated, because the frontend sink was `.env.example` and Vite's `loadEnv` never reads\n * it — was closed on 2026-08-15: `env-configuration-generator.service.ts` now writes `.env`\n * alongside `.env.example`, as every other service kind already did. So even an unreconciled\n * regeneration can no longer leave the runtime reading a hand-written file, and a developer who\n * needs a local override uses `.env.local`, which Vite prefers and nothing generates.\n *\n * It resurfaced on 2026-08-15 in its simplest form — a machine with no `app/.env` at all, failing\n * as `Missing required environment variable: VITE_API_BASE_URL` from deep inside `initializeApp`\n * rather than as anything naming setup.\n *\n * (The specific field has since been removed; the reconciliation gap it exposed has not, and\n * applies to every field the registry persists.)\n *\n * The generalisable shape: a registry record is a lossy CACHE of `config.json`, so any\n * caller that reads an identity field off it without reconciling first is reading a\n * value that may predate the last authoring change. Reconcile at every entry point that\n * generates from an environment, and keep this function importable so a new entry point\n * can reuse it instead of re-deriving one field at a time.\n *\n * @see `.claude/rules/invariant-call-site-enumeration.md` — a policy expressed as a\n * module-private helper enumerates as \"1/1 applied\" and is wrong at every site that\n * cannot name it.\n */\n\nimport {\n WildoDeploymentRuntime,\n WildoLocationType,\n K8S_LOCAL_DEFAULTS,\n} from '@wildo-ai/platform-config-lib';\nimport type { PlatformEnvConfigJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\n\n/**\n * Re-apply a parsed `config.json` snapshot onto an in-memory environment\n * registry record.\n *\n * **Slice 3 deep-review M-4 (2026-04-13) — partial-merge contract.**\n *\n * `PlatformEnvironmentConfiguration` is a deliberately NARROWER projection\n * than `PlatformEnvConfigJson`. It only mirrors the registry-relevant\n * subset of `config.json`; the following persisted fields are intentionally\n * NOT round-tripped through the registry and are instead read directly\n * from `config.json` at the call sites that consume them:\n *\n * - `infrastructure.storage` (provider, useSsl, bucket) — read by\n * `env-vars-builder` to emit `STORAGE_BUCKET` / `STORAGE_USE_SSL`.\n * - `infrastructure.postgresql` (database, sslMode) — read by the\n * postgresql container generator and `env-vars-builder`.\n * - `atlas` — read by the Atlas integration helpers.\n * - `externalServices` / `externalEndpoints` — read by the\n * remote-managed-services hand-off.\n *\n * The registry only owns runtime-mutable identity + lifecycle state\n * (location, runtime, paths, kubernetes overlay, remoteProvider,\n * backingServices snapshot, serviceAuth snapshot, logging snapshot,\n * setupStatus, timestamps). Adding a field here would mean adding it to\n * `PlatformEnvironmentConfiguration` AND ensuring every consumer prefers\n * the registry value over the persisted JSON — currently the pattern is\n * the inverse (consumers read JSON, registry caches a runtime subset),\n * which keeps `config.json` as the single source of truth on disk.\n *\n * If a future consumer needs registry access to one of the\n * NOT-round-tripped fields, add it to `PlatformEnvironmentConfiguration`\n * first, then thread it here, then audit every existing consumer to make\n * sure the dual-source-of-truth doesn't drift.\n */\nexport function hydrateEnvironmentFromConfig(\n env: PlatformEnvironmentConfiguration,\n config: PlatformEnvConfigJson,\n): PlatformEnvironmentConfiguration {\n const isLocalKubernetes =\n (config.runtime ?? env.runtime) === WildoDeploymentRuntime.KUBERNETES\n && (config.type ?? env.locationType) === WildoLocationType.LOCAL;\n\n return {\n ...env,\n /*\n * The descriptor always states both (`runtime` is required, `locationType` resolved by its transform), and\n * `loadConfigForSync` lays them over a persisted copy (#2310), so `config.json` carries the descriptor's answer. The\n * record's value is only a fallback for a file read without one. `config.json` calls the location `type`.\n */\n locationType: config.type ?? env.locationType,\n runtime: config.runtime ?? env.runtime,\n runtimeEnvironment: config.runtimeEnvironment ?? env.runtimeEnvironment,\n /**\n * Persisted `config.json` wins, the registry record is the fallback, and BOTH may legitimately\n * be absent on an environment provisioned before this field existed. Absence is not a hole:\n * `resolveLocalDataStorage` derives the answer from `locationType`, so nothing downstream ever\n * sees `undefined` and no re-sync is required to get a correct one.\n */\n localDataStorage: config.localDataStorage ?? env.localDataStorage,\n /** Same precedence as `localDataStorage`; absence on both sides means `FULL` (#2303). */\n serviceProfile: config.serviceProfile ?? env.serviceProfile,\n /**\n * The platform's database engine — persisted `config.json` WINS whenever it carries one.\n *\n * This field was the one member of the registry record with no path from authored config: it\n * was written only by the interactive setup prompt, straight into `environments.json`, while\n * `config.json` carried its own copy built from the authored descriptor. Two writers, two\n * stores, no reconciliation — precisely the dual-source-of-truth this function's contract note\n * warns about, and the reason the engine could not be reproduced on another machine.\n *\n * Projecting it here makes `config.json` the single authority and the registry the cache it\n * already claims to be, matching the source-of-truth ordering used by `backingServices`,\n * `logging` directly below. Token policy additionally treats absence as authoritative.\n *\n * The `?? env.database` fallback is NOT redundant, and an earlier revision of this comment\n * argued the opposite: `database` is REQUIRED on `PlatformEnvConfigJson`, therefore a parsed\n * config always carries one, therefore projecting it unconditionally is honest. That reasoning\n * is derived from the TYPE and is falsified by the CALLERS — `loadConfigJson` returns a value\n * read off disk, and `wildo dev start` hydrates with whatever it got. Projecting\n * unconditionally wrote `undefined` over a field the registry record REQUIRES, which is worse\n * than any stale value: `getDatabaseChoice` then falls through to its `MONGODB` default, so a\n * PostgreSQL platform silently reads as Mongo at exactly the sites that decide which containers\n * render. Caught by `start.command.test.ts`, whose fixture omits the field.\n *\n * The fallback costs nothing where the reasoning above DOES hold — a well-formed config.json\n * always wins, which is what `prefers the config.json database engine…` pins.\n */\n database: config.database ?? env.database,\n /*\n * Omission is authoritative, deliberately unlike `database` above: `database` is REQUIRED on the\n * record, so a missing value must not overwrite it, whereas an absent `infrastructureHost` IS the\n * answer — this application owns its infrastructure. Falling back to `env.infrastructureHost` would\n * keep a removed host alive and keep refusing shared-infrastructure actions the application now owns.\n */\n infrastructureHost: config.infrastructureHost,\n publicDomain: config.publicDomain ?? env.publicDomain,\n // Every field here is projected EXPLICITLY, and that is the whole contract: a field omitted from\n // this list silently keeps the persisted environment on its previous value while the authored\n // config says otherwise. That divergence surfaces nowhere until something downstream reads the\n // stale value and behaves in a way no log explains.\n //\n // Members the descriptor alone decides (`AuthoredInfraMemberAuthority.DESCRIPTOR`) take `config.json`'s value,\n // ABSENCE included (#2310). Every `config.json` a generator reads carries the descriptor's answer for them: the local\n // lane rewrites the file from the descriptor, and `ConfigSyncCommand.loadConfigForSync` lays the descriptor over a\n // persisted remote copy (`overlayAuthoredInfraMembers`). Falling back to the registry record brought a removed\n // value back, because the record is a cache saved whole from an earlier sync; `hydrateInfraPostureFromEnv` then\n // read it first. `authored-infra-member-authority.test.ts` pins that every such member that is also a registry\n // field is hydrated this way.\n serviceHosts: config.serviceHosts,\n cdn: config.cdn,\n kubernetes: config.kubernetes\n ? {\n ...config.kubernetes,\n imageRegistry: config.remoteProvider?.registryEndpoint ?? env.kubernetes?.imageRegistry,\n }\n : isLocalKubernetes\n ? {\n namespace: env.kubernetes?.namespace ?? K8S_LOCAL_DEFAULTS.NAMESPACE,\n imageRegistry: env.kubernetes?.imageRegistry,\n }\n : env.kubernetes,\n remoteProvider: config.remoteProvider ?? env.remoteProvider,\n /**\n * config.json is the source of truth for the persisted backing-services\n * snapshot (it was synced from `wildo.infra.<env>.config.ts` at\n * `wildo config sync` time). Always prefer it over the in-memory env\n * state, which may be a stale registry entry from before the last sync.\n */\n backingServices: config.backingServices ?? env.backingServices,\n /**\n * The snapshot is authoritative, including absence. Falling back to a registry policy after\n * its authored block was removed would resend that old value as an explicit policy update.\n */\n serviceAuth: config.serviceAuth,\n // The posture blocks: descriptor-decided, absence included (see `serviceHosts` above, #2310).\n logging: config.logging,\n observability: config.observability,\n providerSelection: config.providerSelection,\n email: config.email,\n // Local-only (#2519); the local `config.json` is the authored projection, so its absence is the descriptor's.\n ownershipDnsStandIn: config.ownershipDnsStandIn,\n /** The snapshot is authoritative, including absence: a removed block stops the platform's Vault (#2933). */\n platformKeyManagement: config.platformKeyManagement,\n };\n}\n"]}
1
+ {"version":3,"file":"environment-hydration.utils.js","sourceRoot":"","sources":["../../../../src/services/environment/environment-hydration.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AAIvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,4BAA4B,CAC1C,GA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AC,UAAU,EAAE,aAAa;aACxF;YACH,CAAC,CAAC,iBAAiB;gBACjB,CAAC,CAAC;oBACE,SAAS,EAAE,GAAG,CAAC,UAAU,EAAE,SAAS,IAAI,kBAAkB,CAAC,SAAS;oBACpE,aAAa,EAAE,GAAG,CAAC,UAAU,EAAE,aAAa;iBAC7C;gBACH,CAAC,CAAC,GAAG,CAAC,UAAU;QACpB,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,GAAG,CAAC,cAAc;QAC3D;;;;;WAKG;QACH,eAAe,EAAE,MAAM,CAAC,eAAe,IAAI,GAAG,CAAC,eAAe;QAC9D;;;WAGG;QACH,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,8FAA8F;QAC9F,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;QAC3C,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,sBAAsB,EAAE,MAAM,CAAC,sBAAsB;QACrD,8GAA8G;QAC9G,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;QAC/C,4GAA4G;QAC5G,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;KACpD,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Reconciling an in-memory environment registry record against the persisted\n * `config.json` snapshot — the environment's on-disk source of truth.\n *\n * ## Why this is a shared service and not a helper inside one command\n *\n * This function used to be module-private to `commands/config/sync.command.ts`. The\n * hydration itself was correct; being unreachable was the defect. Three code paths\n * generate an application's runtime topology from an environment record, and only the\n * one that owned this function reconciled first:\n *\n * | Entry point | Reconciled |\n * |---|---|\n * | `wildo config sync` | yes — it declared this function |\n * | `wildo local dev` (`commands/dev/start.command.ts`) | NO |\n * | `ApplicationRuntimeBootstrapService.initialize` | NO |\n *\n * Both of the unreconciled paths already LOADED `config.json` for other reasons and\n * then read identity fields off the un-reconciled registry record anyway, so the fact\n * they needed was in memory and was ignored.\n *\n * What that cost, on 2026-08-13: an environment authored a local edge scheme that `wildo config\n * sync` reconciled and wrote into the frontend env plus `APPLICATION_RUNTIME_ENDPOINTS`. A later\n * `wildo local dev` regenerated the SAME surfaces without reconciling, so the field read\n * `undefined` and every generated URL fell back to the default — while the dev server, which reads\n * `app/.env`, kept serving what a developer had put there by hand. The browser then sent an\n * `Origin` the backend was not configured to expect, and AUTH-10 (`_validateFrontendAppOrigin`)\n * refused every `POST /auth/identify` with a 403. Login was completely broken, and nothing in any\n * log named the cause.\n *\n * That incident had TWO causes and this file only fixed one. The second — `app/.env` being a file\n * nothing generated, because the frontend sink was `.env.example` and Vite's `loadEnv` never reads\n * it — was closed on 2026-08-15: `env-configuration-generator.service.ts` now writes `.env`\n * alongside `.env.example`, as every other service kind already did. So even an unreconciled\n * regeneration can no longer leave the runtime reading a hand-written file, and a developer who\n * needs a local override uses `.env.local`, which Vite prefers and nothing generates.\n *\n * It resurfaced on 2026-08-15 in its simplest form — a machine with no `app/.env` at all, failing\n * as `Missing required environment variable: VITE_API_BASE_URL` from deep inside `initializeApp`\n * rather than as anything naming setup.\n *\n * (The specific field has since been removed; the reconciliation gap it exposed has not, and\n * applies to every field the registry persists.)\n *\n * The generalisable shape: a registry record is a lossy CACHE of `config.json`, so any\n * caller that reads an identity field off it without reconciling first is reading a\n * value that may predate the last authoring change. Reconcile at every entry point that\n * generates from an environment, and keep this function importable so a new entry point\n * can reuse it instead of re-deriving one field at a time.\n *\n * @see `.claude/rules/invariant-call-site-enumeration.md` — a policy expressed as a\n * module-private helper enumerates as \"1/1 applied\" and is wrong at every site that\n * cannot name it.\n */\n\nimport {\n WildoDeploymentRuntime,\n WildoLocationType,\n K8S_LOCAL_DEFAULTS,\n} from '@wildo-ai/platform-config-lib';\nimport type { PlatformEnvConfigJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\n\n/**\n * Re-apply a parsed `config.json` snapshot onto an in-memory environment\n * registry record.\n *\n * **Slice 3 deep-review M-4 (2026-04-13) — partial-merge contract.**\n *\n * `PlatformEnvironmentConfiguration` is a deliberately NARROWER projection\n * than `PlatformEnvConfigJson`. It only mirrors the registry-relevant\n * subset of `config.json`; the following persisted fields are intentionally\n * NOT round-tripped through the registry and are instead read directly\n * from `config.json` at the call sites that consume them:\n *\n * - `infrastructure.storage` (provider, useSsl, bucket) — read by\n * `env-vars-builder` to emit `STORAGE_BUCKET` / `STORAGE_USE_SSL`.\n * - `infrastructure.postgresql` (database, sslMode) — read by the\n * postgresql container generator and `env-vars-builder`.\n * - `atlas` — read by the Atlas integration helpers.\n * - `externalServices` / `externalEndpoints` — read by the\n * remote-managed-services hand-off.\n *\n * The registry only owns runtime-mutable identity + lifecycle state\n * (location, runtime, paths, kubernetes overlay, remoteProvider,\n * backingServices snapshot, serviceAuth snapshot, logging snapshot,\n * setupStatus, timestamps). Adding a field here would mean adding it to\n * `PlatformEnvironmentConfiguration` AND ensuring every consumer prefers\n * the registry value over the persisted JSON — currently the pattern is\n * the inverse (consumers read JSON, registry caches a runtime subset),\n * which keeps `config.json` as the single source of truth on disk.\n *\n * If a future consumer needs registry access to one of the\n * NOT-round-tripped fields, add it to `PlatformEnvironmentConfiguration`\n * first, then thread it here, then audit every existing consumer to make\n * sure the dual-source-of-truth doesn't drift.\n */\nexport function hydrateEnvironmentFromConfig(\n env: PlatformEnvironmentConfiguration,\n config: PlatformEnvConfigJson,\n): PlatformEnvironmentConfiguration {\n const isLocalKubernetes =\n (config.runtime ?? env.runtime) === WildoDeploymentRuntime.KUBERNETES\n && (config.type ?? env.locationType) === WildoLocationType.LOCAL;\n\n return {\n ...env,\n /*\n * The descriptor always states both (`runtime` is required, `locationType` resolved by its transform), and\n * `loadConfigForSync` lays them over a persisted copy (#2310), so `config.json` carries the descriptor's answer. The\n * record's value is only a fallback for a file read without one. `config.json` calls the location `type`.\n */\n locationType: config.type ?? env.locationType,\n runtime: config.runtime ?? env.runtime,\n runtimeEnvironment: config.runtimeEnvironment ?? env.runtimeEnvironment,\n /**\n * Persisted `config.json` wins, the registry record is the fallback, and BOTH may legitimately\n * be absent on an environment provisioned before this field existed. Absence is not a hole:\n * `resolveLocalDataStorage` derives the answer from `locationType`, so nothing downstream ever\n * sees `undefined` and no re-sync is required to get a correct one.\n */\n localDataStorage: config.localDataStorage ?? env.localDataStorage,\n /** Same precedence as `localDataStorage`; absence on both sides means `FULL` (#2303). */\n serviceProfile: config.serviceProfile ?? env.serviceProfile,\n /**\n * The platform's database engine — persisted `config.json` WINS whenever it carries one.\n *\n * This field was the one member of the registry record with no path from authored config: it\n * was written only by the interactive setup prompt, straight into `environments.json`, while\n * `config.json` carried its own copy built from the authored descriptor. Two writers, two\n * stores, no reconciliation — precisely the dual-source-of-truth this function's contract note\n * warns about, and the reason the engine could not be reproduced on another machine.\n *\n * Projecting it here makes `config.json` the single authority and the registry the cache it\n * already claims to be, matching the source-of-truth ordering used by `backingServices`,\n * `logging` directly below. Token policy additionally treats absence as authoritative.\n *\n * The `?? env.database` fallback is NOT redundant, and an earlier revision of this comment\n * argued the opposite: `database` is REQUIRED on `PlatformEnvConfigJson`, therefore a parsed\n * config always carries one, therefore projecting it unconditionally is honest. That reasoning\n * is derived from the TYPE and is falsified by the CALLERS — `loadConfigJson` returns a value\n * read off disk, and `wildo dev start` hydrates with whatever it got. Projecting\n * unconditionally wrote `undefined` over a field the registry record REQUIRES, which is worse\n * than any stale value: `getDatabaseChoice` then falls through to its `MONGODB` default, so a\n * PostgreSQL platform silently reads as Mongo at exactly the sites that decide which containers\n * render. Caught by `start.command.test.ts`, whose fixture omits the field.\n *\n * The fallback costs nothing where the reasoning above DOES hold — a well-formed config.json\n * always wins, which is what `prefers the config.json database engine…` pins.\n */\n database: config.database ?? env.database,\n /*\n * Omission is authoritative, deliberately unlike `database` above: `database` is REQUIRED on the\n * record, so a missing value must not overwrite it, whereas an absent `infrastructureHost` IS the\n * answer — this application owns its infrastructure. Falling back to `env.infrastructureHost` would\n * keep a removed host alive and keep refusing shared-infrastructure actions the application now owns.\n */\n infrastructureHost: config.infrastructureHost,\n publicDomain: config.publicDomain ?? env.publicDomain,\n // Every field here is projected EXPLICITLY, and that is the whole contract: a field omitted from\n // this list silently keeps the persisted environment on its previous value while the authored\n // config says otherwise. That divergence surfaces nowhere until something downstream reads the\n // stale value and behaves in a way no log explains.\n //\n // Members the descriptor alone decides (`AuthoredInfraMemberAuthority.DESCRIPTOR`) take `config.json`'s value,\n // ABSENCE included (#2310). Every `config.json` a generator reads carries the descriptor's answer for them: the local\n // lane rewrites the file from the descriptor, and `ConfigSyncCommand.loadConfigForSync` lays the descriptor over a\n // persisted remote copy (`overlayAuthoredInfraMembers`). Falling back to the registry record brought a removed\n // value back, because the record is a cache saved whole from an earlier sync; `hydrateInfraPostureFromEnv` then\n // read it first. `authored-infra-member-authority.test.ts` pins that every such member that is also a registry\n // field is hydrated this way.\n serviceHosts: config.serviceHosts,\n cdn: config.cdn,\n kubernetes: config.kubernetes\n ? {\n ...config.kubernetes,\n imageRegistry: config.remoteProvider?.registryEndpoint ?? env.kubernetes?.imageRegistry,\n }\n : isLocalKubernetes\n ? {\n namespace: env.kubernetes?.namespace ?? K8S_LOCAL_DEFAULTS.NAMESPACE,\n imageRegistry: env.kubernetes?.imageRegistry,\n }\n : env.kubernetes,\n remoteProvider: config.remoteProvider ?? env.remoteProvider,\n /**\n * config.json is the source of truth for the persisted backing-services\n * snapshot (it was synced from `wildo.infra.<env>.config.ts` at\n * `wildo config sync` time). Always prefer it over the in-memory env\n * state, which may be a stale registry entry from before the last sync.\n */\n backingServices: config.backingServices ?? env.backingServices,\n /**\n * The snapshot is authoritative, including absence. Falling back to a registry policy after\n * its authored block was removed would resend that old value as an explicit policy update.\n */\n serviceAuth: config.serviceAuth,\n // The posture blocks: descriptor-decided, absence included (see `serviceHosts` above, #2310).\n logging: config.logging,\n observability: config.observability,\n providerSelection: config.providerSelection,\n email: config.email,\n agentContentGuardrails: config.agentContentGuardrails,\n // Local-only (#2519); the local `config.json` is the authored projection, so its absence is the descriptor's.\n ownershipDnsStandIn: config.ownershipDnsStandIn,\n /** The snapshot is authoritative, including absence: a removed block stops the platform's Vault (#2933). */\n platformKeyManagement: config.platformKeyManagement,\n };\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { PlatformDatabaseChoice } from '../../services/data-services/data-services.schemas';
2
2
  import { type BackingServicesEnvConfig, type WildoCdnConfig, type WildoAuthConfig, type WildoDeploymentRuntime, type WildoLocationType, type WildoLocalDataStorage, type EnvironmentServiceProfile, type WildoLoggingConfig, type WildoPlatformKeyManagementConfig, type WildoObservabilityConfig, type WildoInfraEmailConfig, type WildoOwnershipDnsStandInConfig, type WildoProviderSelectionOverrides, type WildoRemoteProvider } from '@wildo-ai/platform-config-lib';
3
- import type { RuntimeEnvironment } from '@wildo-ai/saas-models';
3
+ import type { EnvironmentAgentContentGuardrails, RuntimeEnvironment } from '@wildo-ai/saas-models';
4
4
  export declare enum PlatformEnvOperatingSystem {
5
5
  WINDOWS = "windows",
6
6
  MACOS = "macos",
@@ -188,6 +188,12 @@ export interface PlatformEnvironmentConfiguration {
188
188
  * `resolveInboundEmailConfig`. When omitted, the backend configuration's `email.inbound` applies unchanged.
189
189
  */
190
190
  email?: WildoInfraEmailConfig;
191
+ /**
192
+ * What this environment does with the agents' classifier-backed content guardrails where no classifier offers them,
193
+ * mirrored from `wildo.infra.<env>.config.ts`. Threaded to the backend via `env-vars-builder`
194
+ * (`WILDO_AGENT_CONTENT_GUARDRAILS`). When omitted, such an agent refuses every turn.
195
+ */
196
+ agentContentGuardrails?: EnvironmentAgentContentGuardrails;
191
197
  /**
192
198
  * LOCAL-ONLY ownership-DNS stand-in mirrored from `wildo.infra.local.config.ts` (#2519). Threaded to the backend via
193
199
  * `env-vars-builder` (`WILDO_OWNERSHIP_DNS_STAND_IN_URL`); consumed by `DnsTxtLookupBackendService`. When omitted,
@@ -1 +1 @@
1
- {"version":3,"file":"environment.schemas.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/environment.schemas.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAC;AACjG,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,gCAAgC,EACrC,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGhE,oBAAY,0BAA0B;IACpC,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,oBAAY,WAAW;IACrB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB;AAGD;;;;GAIG;AACH,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,cAAc,mBAAmB;IACjC,SAAS,cAAc;IACvB,UAAU,eAAe;CAC1B;AAED,oBAAY,yBAAyB;IACnC,MAAM,WAAW;IACjB,cAAc,mBAAmB;IACjC,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb;;;;;;OAMG;IACH,IAAI,SAAS;CACd;AAED,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,mCAAmC;IAClD,SAAS,EAAE,MAAM,CAAC;IACl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C;IAC7B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"environment.schemas.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/environment.schemas.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAC;AACjG,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,gCAAgC,EACrC,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,iCAAiC,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGnG,oBAAY,0BAA0B;IACpC,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,oBAAY,WAAW;IACrB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB;AAGD;;;;GAIG;AACH,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,cAAc,mBAAmB;IACjC,SAAS,cAAc;IACvB,UAAU,eAAe;CAC1B;AAED,oBAAY,yBAAyB;IACnC,MAAM,WAAW;IACjB,cAAc,mBAAmB;IACjC,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,IAAI,SAAS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;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAMD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IAWzB;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"environment.schemas.js","sourceRoot":"","sources":["../../../../src/services/environment/environment.schemas.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAG/E,OAAO,EACL,wBAAwB,GAezB,MAAM,+BAA+B,CAAC;AAIvC,MAAM,CAAN,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,iDAAmB,CAAA;IACnB,6CAAe,CAAA;IACf,6CAAe,CAAA;AACjB,CAAC,EAJW,0BAA0B,KAA1B,0BAA0B,QAIrC;AAED,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,0CAA2B,CAAA;IAC3B,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;AACnB,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAGD;;;;GAIG;AACH,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,gDAAiC,CAAA;IACjC,sCAAuB,CAAA;IACvB,wCAAyB,CAAA;AAC3B,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED,MAAM,CAAN,IAAY,yBAqBX;AArBD,WAAY,yBAAyB;IACnC,8CAAiB,CAAA;IACjB,8DAAiC,CAAA;IACjC,gDAAmB,CAAA;IACnB,0CAAa,CAAA;IACb,0CAAa,CAAA;IACb,wCAAW,CAAA;IACX,0CAAa,CAAA;IACb,wCAAW,CAAA;IACX,0CAAa,CAAA;IACb,gDAAmB,CAAA;IACnB,8CAAiB,CAAA;IACjB,0CAAa,CAAA;IACb;;;;;;OAMG;IACH,0CAAa,CAAA;AACf,CAAC,EArBW,yBAAyB,KAAzB,yBAAyB,QAqBpC;AAwKD,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACrD,OAAO,wBAAwB,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AACrD,CAAC","sourcesContent":["\n\n// ============================================================================\n// Environment State\n// ============================================================================\n\nimport { PlatformDatabaseChoice } from '~wildo-cli/services/data-services/data-services.schemas';\nimport {\n WildoEnvironmentIdSchema,\n type BackingServicesEnvConfig,\n type WildoCdnConfig,\n type WildoAuthConfig,\n type WildoDeploymentRuntime,\n type WildoLocationType,\n type WildoLocalDataStorage,\n type EnvironmentServiceProfile,\n type WildoLoggingConfig,\n type WildoPlatformKeyManagementConfig,\n type WildoObservabilityConfig,\n type WildoInfraEmailConfig,\n type WildoOwnershipDnsStandInConfig,\n type WildoProviderSelectionOverrides,\n type WildoRemoteProvider,\n} from '@wildo-ai/platform-config-lib';\nimport type { RuntimeEnvironment } from '@wildo-ai/saas-models';\n\n\nexport enum PlatformEnvOperatingSystem {\n WINDOWS = 'windows',\n MACOS = 'macos',\n LINUX = 'linux',\n}\n\nexport enum SetupStatus {\n NOT_STARTED = 'not-started',\n IN_PROGRESS = 'in-progress',\n COMPLETED = 'completed',\n FAILED = 'failed',\n}\n\n\n/**\n * Groups tool requirements by deployment runtime.\n * Used by `init --check` to only verify tools relevant to the user's chosen runtime.\n * K8s tools are NEVER checked unless the user explicitly opted into a K8s runtime.\n */\nexport enum ToolProfile {\n CORE = 'core',\n DOCKER_COMPOSE = 'docker-compose',\n K8S_LOCAL = 'k8s-local',\n K8S_REMOTE = 'k8s-remote',\n}\n\nexport enum PlatformEnv_Utility_Tools {\n DOCKER = 'docker',\n DOCKER_COMPOSE = 'docker-compose',\n KUBECTL = 'kubectl',\n HELM = 'helm',\n NODE = 'node',\n NPM = 'npm',\n PNPM = 'pnpm',\n GIT = 'git',\n CURL = 'curl',\n OPENSSL = 'openssl',\n PYTHON = 'python',\n KIND = 'kind',\n /**\n * GNU Make ≥4 — FRAMEWORK-DEVELOPER tool (not needed to run a Wildo app). Required to build\n * `redis-memory-server`, which the engine's real-Redis integration tests use: unlike MongoDB,\n * Redis ships no prebuilt test binaries, so `redis-memory-server` compiles redis from source and\n * its build aborts on GNU Make < 4 (\"GNU Make version is too old\"). macOS ships 3.81 → devs must\n * install a newer make. Surfaced as OPTIONAL by the tools check so it never blocks an app dev.\n */\n MAKE = 'make',\n}\n\nexport interface RemoteProviderConfig extends WildoRemoteProvider {\n clusterEndpoint?: string;\n}\n\n/**\n * Per-environment operational state.\n * Historically stored in a machine-global registry; the active migration keeps\n * runtime state under the scoped `.wildo-saas` home.\n *\n * Design invariant: NO secrets, NO duplication with config.json/secrets.json.\n * - `secretsPath` / `configPath` / `infraPath` point to where those files live\n * - `runtime` → operational source of truth (no need to parse config.json)\n * - `runtimeEnvironment` → optional operational source of truth for app runtime\n * semantics when deployment environment ids stay generic\n * - Credentials, connection URLs → read from secrets.json via secretsPath\n * - Generated infra files (Docker Compose, K8s) → at infraPath\n * - `remoteProvider` → only set for locationType === REMOTE\n */\nexport interface PlatformEnvironmentKubernetesConfig {\n namespace: string;\n imageRegistry?: string;\n}\n\nexport interface PlatformEnvironmentConfiguration {\n name: string;\n locationType: WildoLocationType;\n runtime: WildoDeploymentRuntime;\n runtimeEnvironment?: RuntimeEnvironment;\n /**\n * Authored `localDataStorage` mirrored from `wildo.infra.<env>.config.ts` — whether the\n * self-hosted backing services of a DOCKER_COMPOSE environment keep their data in a Docker named\n * volume or bind-mounted onto `<saas-root>/.wildo-saas/local_data/<service>/`.\n *\n * OPTIONAL on purpose, and no consumer may read it directly: everything goes through\n * {@link resolveLocalDataStorage}, which falls back to `resolveDefaultLocalDataStorage(\n * env.locationType)`. An environment record built by a path that does not yet mirror this field\n * — a test fixture, a registry entry written before it existed — therefore gets the correct\n * default rather than `undefined`, which in a boolean template context would silently render the\n * REMOTE shape onto a developer's machine.\n */\n localDataStorage?: WildoLocalDataStorage;\n /**\n * Authored `serviceProfile` mirrored from `wildo.infra.<env>.config.ts` (#2303): which optional backing\n * services (ClamAV, immudb, mongot) the environment runs. OPTIONAL for the same reason as `localDataStorage`;\n * absence means `FULL`, read through `environmentServiceProfileOmits`, never as a bare `=== SMALL` check.\n */\n serviceProfile?: EnvironmentServiceProfile;\n os: PlatformEnvOperatingSystem;\n secretsPath: string;\n configPath: string;\n infraPath: string;\n database: PlatformDatabaseChoice;\n /**\n * Public domain that browsers and external clients use to reach this\n * deployment (mirrored from `WildoInfraEnvConfig.publicDomain`).\n * Applies to BOTH `KUBERNETES` and `DOCKER_COMPOSE` runtimes — for\n * compose-without-reverse-proxy this is `'localhost'`. Required —\n * the schema enforces explicit authoring upstream so a hand-edited\n * config can't drop it silently.\n */\n publicDomain: string;\n /**\n * Per-service public subdomain map mirrored from\n * `wildo.infra.<env>.config.ts > serviceHosts` (`<serviceKey> → subdomain\n * chain`, `''` = apex). Threaded through `hydrateEnvironmentFromConfig` /\n * `refreshEnvFromAuthored`; consumed by the K8s application endpoint builder\n * (`buildK8sApplicationRuntimeEndpoints`) and the ingress generator via\n * `buildServicePublicHost`. Absent keys fall back to `<serviceKey>.<publicDomain>`.\n */\n serviceHosts?: Record<string, string>;\n /**\n * Per-service CDN publish config mirrored from\n * `wildo.infra.<env>.config.ts > cdn` (`<serviceKey> → {enabled, bucket?,\n * bucketPrefix?, vendor}`). Threaded through the same hydrate / refresh path\n * as `serviceHosts`. Consumed by the app-deploy builders in\n * `AppBootstrapService` (`buildApplicationIngressRoutes` +\n * `buildApplicationFrontendDeployTargets`): a service with an `enabled` entry\n * is dropped from the nginx Deployment/Service + ingress/compose route (its\n * host is served off-cluster by a CDN), while STAYING in\n * `runtime.endPoints.publicUrl`. Absent/`enabled:false` → nginx-pod-served.\n */\n cdn?: Record<string, WildoCdnConfig>;\n kubernetes?: PlatformEnvironmentKubernetesConfig;\n /**\n * The application whose infrastructure this environment runs on, mirrored from\n * `wildo.infra.<env>.config.ts > infrastructureHost` as RESOLVED by `loadInfraEnvConfig` (absolute\n * paths). Absent means this application owns its infrastructure. Omission is authoritative: an\n * environment that stops declaring a host owns its infrastructure again, so neither the refresh nor the\n * hydration resurrects a host from the registry cache.\n */\n infrastructureHost?: { applicationRoot: string; infraConfigPath: string };\n setupStatus: SetupStatus;\n setupCompletedAt?: string;\n remoteProvider?: RemoteProviderConfig;\n /**\n * Authored backing-services snapshot mirrored from\n * `wildo.infra.<env>.config.ts` — the source of truth for per-service\n * host/port/name/vhost/endpoint/bucket/database overrides. The CLI\n * threads this into `ServiceAddressResolver.fromEnvironment`, the\n * docker-compose generator (port mappings), and `env-vars-builder`\n * (database/vhost/endpoint env keys). Missing fields fall back to\n * catalog defaults; missing services keep the catalog topology entirely.\n */\n backingServices?: BackingServicesEnvConfig;\n /**\n * Authored `serviceAuth` policy mirrored from `wildo.infra.<env>.config.ts`.\n * Threaded into every apps-manager init request (`AdminAppInitializeRequest.\n * serviceAuth`) so the lifecycle service can seed\n * `Wildo_Application_Config.jwt.{accessTokenExpirationMinutes,\n * refreshTokenExpirationDays}` from the operator's authored values\n * instead of a hardcoded constant. When omitted at parse time, apps-manager\n * falls back to `WildoAuthConfigSchema` defaults (15 min / 30 days as of\n * Auth-hardening Slice A Step 5 on 2026-04-13; pre-Slice-A the\n * access-token default was 60 min). Algorithm selection is intentionally\n * not authored at this layer.\n */\n serviceAuth?: WildoAuthConfig;\n /**\n * Authored logging posture mirrored from `wildo.infra.<env>.config.ts`\n * (Slice 3.5). Threaded through to every long-running platform/application\n * process by `env-vars-builder` (`LOG_LEVEL` /\n * `LOG_FORMATTED_CONSOLE_ERRORS`); consumed by\n * `LoggerService.loadConfiguration` in `saas-backend-lib`. When omitted,\n * LoggerService keeps its built-in defaults (level `debug`, pino-pretty\n * auto-detect by `APPLICATION_ENV`).\n */\n logging?: WildoLoggingConfig;\n observability?: WildoObservabilityConfig;\n /**\n * Authored per-environment external-provider selection override mirrored\n * from `wildo.infra.<env>.config.ts`. Threaded to the backend via\n * `env-vars-builder` (`WILDO_PROVIDER_SELECTION_OVERRIDES`); consumed by\n * `ExternalProvidersRegistryBackendService`. When omitted, the app-wide\n * `wildo.saas.config.ts` selection applies unchanged.\n */\n providerSelection?: WildoProviderSelectionOverrides;\n /**\n * Authored per-environment email values mirrored from `wildo.infra.<env>.config.ts` — today the shared receiving\n * domain. Threaded to the backend via `env-vars-builder` (`WILDO_INBOUND_EMAIL_SHARED_DOMAIN`); consumed through\n * `resolveInboundEmailConfig`. When omitted, the backend configuration's `email.inbound` applies unchanged.\n */\n email?: WildoInfraEmailConfig;\n /**\n * LOCAL-ONLY ownership-DNS stand-in mirrored from `wildo.infra.local.config.ts` (#2519). Threaded to the backend via\n * `env-vars-builder` (`WILDO_OWNERSHIP_DNS_STAND_IN_URL`); consumed by `DnsTxtLookupBackendService`. When omitted,\n * every domain-ownership challenge asks public DNS.\n */\n ownershipDnsStandIn?: WildoOwnershipDnsStandInConfig;\n /**\n * Where the platform keeps the keys it holds for applications, mirrored from `wildo.infra.<env>.config.ts` (#2933).\n * Decides whether both lanes run a self-hosted OpenBao (`selfHostsPlatformKeyVault`) and what apps-manager's env\n * names as its Vault.\n */\n platformKeyManagement?: WildoPlatformKeyManagementConfig;\n createdAt: string;\n updatedAt: string;\n}\n\n\nexport interface PlatformEnvironmentsState {\n version: number;\n /** Scoped active environment selector persisted under `.wildo-saas/state`. */\n currentEnvironment: string;\n environments: Record<string, PlatformEnvironmentConfiguration>;\n}\n\nexport function parsePlatformEnvironmentId(name: string): string {\n return WildoEnvironmentIdSchema.parse(name.trim());\n}\n\n\n// ============================================================================\n// Utility tools\n// ============================================================================\nexport interface ToolCheck {\n name: string;\n installed: boolean;\n version?: string;\n meetsMinimum: boolean;\n minimumVersion: string;\n running?: boolean;\n error?: string;\n}\n\nexport interface PreflightResult {\n os: PlatformEnvOperatingSystem;\n tools: Record<PlatformEnv_Utility_Tools, ToolCheck>;\n allPassed: boolean;\n missingTools: string[];\n outdatedTools: string[];\n}\n\n// ---------------------------------------------------------------------------\n// Setup orchestration types (moved from platform-commands.dto.ts)\n// ---------------------------------------------------------------------------\n\nexport interface SetupResult {\n success: boolean;\n adminPassword?: string;\n}\n\n/**\n * Inputs to {@link runEnvSetup} (`wildo setup`).\n *\n * - `force` — reconfigure an already-COMPLETED environment (re-authors secrets).\n * - `nonInteractive` — headless bootstrap: every answer is DERIVED from the\n * registered environment + `WILDO_INIT_ADMIN_*` seeds, all credentials\n * generated, provider keys omitted. See `runEnvSetup`'s docblock.\n *\n * NOTE: there is deliberately no `skipProviders` opt-out. The interactive\n * provider step is already fully optional (each key prompt is \"press Enter to\n * skip\"), and `nonInteractive` already omits providers entirely — a dedicated\n * flag would be a redundant second door with no capability of its own.\n */\nexport interface EnvSetupInput {\n force?: boolean;\n nonInteractive?: boolean;\n /*\n * ANSWERS for the six steps, so setup is scriptable without `--non-interactive`.\n *\n * `--non-interactive` DERIVES every answer (paths from the registration, runtime from the authored\n * infra config, provider keys as `{}`); these OVERRIDE one step each and leave the rest alone. The\n * difference matters most for provider keys, where deriving means \"none\" — a headless setup used to\n * produce an environment with no third-party credentials at all.\n *\n * Each is optional and absent means \"ask, or derive\" exactly as before.\n */\n /**\n * Override the machine preference for THIS environment.\n *\n * It decides the PLATFORM LANE — a framework developer runs the platform services natively from the\n * checkout, everyone else runs them as containers of the published image — so a machine whose\n * stored preference is wrong for one environment had no way to say so. Deliberately NOT offered on\n * `wildo init`: there the skeleton mode is derived from CONTAINMENT, because `file:` framework links\n * only resolve inside the checkout, and an override would scaffold an application that cannot build.\n */\n frameworkDeveloper?: boolean;\n /**\n * Whether to seed the provider keys captured in `~/.wildo/local-defaults.json` — a `LocalDefaultsMode`\n * value. Empty or absent: the machine preference, else ADOPT.\n */\n providerKeyDefaults?: string;\n secretsPath?: string;\n configPath?: string;\n infraPath?: string;\n runtime?: string;\n database?: string;\n}\n"]}
1
+ {"version":3,"file":"environment.schemas.js","sourceRoot":"","sources":["../../../../src/services/environment/environment.schemas.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAG/E,OAAO,EACL,wBAAwB,GAezB,MAAM,+BAA+B,CAAC;AAIvC,MAAM,CAAN,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,iDAAmB,CAAA;IACnB,6CAAe,CAAA;IACf,6CAAe,CAAA;AACjB,CAAC,EAJW,0BAA0B,KAA1B,0BAA0B,QAIrC;AAED,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,0CAA2B,CAAA;IAC3B,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;AACnB,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAGD;;;;GAIG;AACH,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,gDAAiC,CAAA;IACjC,sCAAuB,CAAA;IACvB,wCAAyB,CAAA;AAC3B,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED,MAAM,CAAN,IAAY,yBAqBX;AArBD,WAAY,yBAAyB;IACnC,8CAAiB,CAAA;IACjB,8DAAiC,CAAA;IACjC,gDAAmB,CAAA;IACnB,0CAAa,CAAA;IACb,0CAAa,CAAA;IACb,wCAAW,CAAA;IACX,0CAAa,CAAA;IACb,wCAAW,CAAA;IACX,0CAAa,CAAA;IACb,gDAAmB,CAAA;IACnB,8CAAiB,CAAA;IACjB,0CAAa,CAAA;IACb;;;;;;OAMG;IACH,0CAAa,CAAA;AACf,CAAC,EArBW,yBAAyB,KAAzB,yBAAyB,QAqBpC;AA8KD,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACrD,OAAO,wBAAwB,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AACrD,CAAC","sourcesContent":["\n\n// ============================================================================\n// Environment State\n// ============================================================================\n\nimport { PlatformDatabaseChoice } from '~wildo-cli/services/data-services/data-services.schemas';\nimport {\n WildoEnvironmentIdSchema,\n type BackingServicesEnvConfig,\n type WildoCdnConfig,\n type WildoAuthConfig,\n type WildoDeploymentRuntime,\n type WildoLocationType,\n type WildoLocalDataStorage,\n type EnvironmentServiceProfile,\n type WildoLoggingConfig,\n type WildoPlatformKeyManagementConfig,\n type WildoObservabilityConfig,\n type WildoInfraEmailConfig,\n type WildoOwnershipDnsStandInConfig,\n type WildoProviderSelectionOverrides,\n type WildoRemoteProvider,\n} from '@wildo-ai/platform-config-lib';\nimport type { EnvironmentAgentContentGuardrails, RuntimeEnvironment } from '@wildo-ai/saas-models';\n\n\nexport enum PlatformEnvOperatingSystem {\n WINDOWS = 'windows',\n MACOS = 'macos',\n LINUX = 'linux',\n}\n\nexport enum SetupStatus {\n NOT_STARTED = 'not-started',\n IN_PROGRESS = 'in-progress',\n COMPLETED = 'completed',\n FAILED = 'failed',\n}\n\n\n/**\n * Groups tool requirements by deployment runtime.\n * Used by `init --check` to only verify tools relevant to the user's chosen runtime.\n * K8s tools are NEVER checked unless the user explicitly opted into a K8s runtime.\n */\nexport enum ToolProfile {\n CORE = 'core',\n DOCKER_COMPOSE = 'docker-compose',\n K8S_LOCAL = 'k8s-local',\n K8S_REMOTE = 'k8s-remote',\n}\n\nexport enum PlatformEnv_Utility_Tools {\n DOCKER = 'docker',\n DOCKER_COMPOSE = 'docker-compose',\n KUBECTL = 'kubectl',\n HELM = 'helm',\n NODE = 'node',\n NPM = 'npm',\n PNPM = 'pnpm',\n GIT = 'git',\n CURL = 'curl',\n OPENSSL = 'openssl',\n PYTHON = 'python',\n KIND = 'kind',\n /**\n * GNU Make ≥4 — FRAMEWORK-DEVELOPER tool (not needed to run a Wildo app). Required to build\n * `redis-memory-server`, which the engine's real-Redis integration tests use: unlike MongoDB,\n * Redis ships no prebuilt test binaries, so `redis-memory-server` compiles redis from source and\n * its build aborts on GNU Make < 4 (\"GNU Make version is too old\"). macOS ships 3.81 → devs must\n * install a newer make. Surfaced as OPTIONAL by the tools check so it never blocks an app dev.\n */\n MAKE = 'make',\n}\n\nexport interface RemoteProviderConfig extends WildoRemoteProvider {\n clusterEndpoint?: string;\n}\n\n/**\n * Per-environment operational state.\n * Historically stored in a machine-global registry; the active migration keeps\n * runtime state under the scoped `.wildo-saas` home.\n *\n * Design invariant: NO secrets, NO duplication with config.json/secrets.json.\n * - `secretsPath` / `configPath` / `infraPath` point to where those files live\n * - `runtime` → operational source of truth (no need to parse config.json)\n * - `runtimeEnvironment` → optional operational source of truth for app runtime\n * semantics when deployment environment ids stay generic\n * - Credentials, connection URLs → read from secrets.json via secretsPath\n * - Generated infra files (Docker Compose, K8s) → at infraPath\n * - `remoteProvider` → only set for locationType === REMOTE\n */\nexport interface PlatformEnvironmentKubernetesConfig {\n namespace: string;\n imageRegistry?: string;\n}\n\nexport interface PlatformEnvironmentConfiguration {\n name: string;\n locationType: WildoLocationType;\n runtime: WildoDeploymentRuntime;\n runtimeEnvironment?: RuntimeEnvironment;\n /**\n * Authored `localDataStorage` mirrored from `wildo.infra.<env>.config.ts` — whether the\n * self-hosted backing services of a DOCKER_COMPOSE environment keep their data in a Docker named\n * volume or bind-mounted onto `<saas-root>/.wildo-saas/local_data/<service>/`.\n *\n * OPTIONAL on purpose, and no consumer may read it directly: everything goes through\n * {@link resolveLocalDataStorage}, which falls back to `resolveDefaultLocalDataStorage(\n * env.locationType)`. An environment record built by a path that does not yet mirror this field\n * — a test fixture, a registry entry written before it existed — therefore gets the correct\n * default rather than `undefined`, which in a boolean template context would silently render the\n * REMOTE shape onto a developer's machine.\n */\n localDataStorage?: WildoLocalDataStorage;\n /**\n * Authored `serviceProfile` mirrored from `wildo.infra.<env>.config.ts` (#2303): which optional backing\n * services (ClamAV, immudb, mongot) the environment runs. OPTIONAL for the same reason as `localDataStorage`;\n * absence means `FULL`, read through `environmentServiceProfileOmits`, never as a bare `=== SMALL` check.\n */\n serviceProfile?: EnvironmentServiceProfile;\n os: PlatformEnvOperatingSystem;\n secretsPath: string;\n configPath: string;\n infraPath: string;\n database: PlatformDatabaseChoice;\n /**\n * Public domain that browsers and external clients use to reach this\n * deployment (mirrored from `WildoInfraEnvConfig.publicDomain`).\n * Applies to BOTH `KUBERNETES` and `DOCKER_COMPOSE` runtimes — for\n * compose-without-reverse-proxy this is `'localhost'`. Required —\n * the schema enforces explicit authoring upstream so a hand-edited\n * config can't drop it silently.\n */\n publicDomain: string;\n /**\n * Per-service public subdomain map mirrored from\n * `wildo.infra.<env>.config.ts > serviceHosts` (`<serviceKey> → subdomain\n * chain`, `''` = apex). Threaded through `hydrateEnvironmentFromConfig` /\n * `refreshEnvFromAuthored`; consumed by the K8s application endpoint builder\n * (`buildK8sApplicationRuntimeEndpoints`) and the ingress generator via\n * `buildServicePublicHost`. Absent keys fall back to `<serviceKey>.<publicDomain>`.\n */\n serviceHosts?: Record<string, string>;\n /**\n * Per-service CDN publish config mirrored from\n * `wildo.infra.<env>.config.ts > cdn` (`<serviceKey> → {enabled, bucket?,\n * bucketPrefix?, vendor}`). Threaded through the same hydrate / refresh path\n * as `serviceHosts`. Consumed by the app-deploy builders in\n * `AppBootstrapService` (`buildApplicationIngressRoutes` +\n * `buildApplicationFrontendDeployTargets`): a service with an `enabled` entry\n * is dropped from the nginx Deployment/Service + ingress/compose route (its\n * host is served off-cluster by a CDN), while STAYING in\n * `runtime.endPoints.publicUrl`. Absent/`enabled:false` → nginx-pod-served.\n */\n cdn?: Record<string, WildoCdnConfig>;\n kubernetes?: PlatformEnvironmentKubernetesConfig;\n /**\n * The application whose infrastructure this environment runs on, mirrored from\n * `wildo.infra.<env>.config.ts > infrastructureHost` as RESOLVED by `loadInfraEnvConfig` (absolute\n * paths). Absent means this application owns its infrastructure. Omission is authoritative: an\n * environment that stops declaring a host owns its infrastructure again, so neither the refresh nor the\n * hydration resurrects a host from the registry cache.\n */\n infrastructureHost?: { applicationRoot: string; infraConfigPath: string };\n setupStatus: SetupStatus;\n setupCompletedAt?: string;\n remoteProvider?: RemoteProviderConfig;\n /**\n * Authored backing-services snapshot mirrored from\n * `wildo.infra.<env>.config.ts` — the source of truth for per-service\n * host/port/name/vhost/endpoint/bucket/database overrides. The CLI\n * threads this into `ServiceAddressResolver.fromEnvironment`, the\n * docker-compose generator (port mappings), and `env-vars-builder`\n * (database/vhost/endpoint env keys). Missing fields fall back to\n * catalog defaults; missing services keep the catalog topology entirely.\n */\n backingServices?: BackingServicesEnvConfig;\n /**\n * Authored `serviceAuth` policy mirrored from `wildo.infra.<env>.config.ts`.\n * Threaded into every apps-manager init request (`AdminAppInitializeRequest.\n * serviceAuth`) so the lifecycle service can seed\n * `Wildo_Application_Config.jwt.{accessTokenExpirationMinutes,\n * refreshTokenExpirationDays}` from the operator's authored values\n * instead of a hardcoded constant. When omitted at parse time, apps-manager\n * falls back to `WildoAuthConfigSchema` defaults (15 min / 30 days as of\n * Auth-hardening Slice A Step 5 on 2026-04-13; pre-Slice-A the\n * access-token default was 60 min). Algorithm selection is intentionally\n * not authored at this layer.\n */\n serviceAuth?: WildoAuthConfig;\n /**\n * Authored logging posture mirrored from `wildo.infra.<env>.config.ts`\n * (Slice 3.5). Threaded through to every long-running platform/application\n * process by `env-vars-builder` (`LOG_LEVEL` /\n * `LOG_FORMATTED_CONSOLE_ERRORS`); consumed by\n * `LoggerService.loadConfiguration` in `saas-backend-lib`. When omitted,\n * LoggerService keeps its built-in defaults (level `debug`, pino-pretty\n * auto-detect by `APPLICATION_ENV`).\n */\n logging?: WildoLoggingConfig;\n observability?: WildoObservabilityConfig;\n /**\n * Authored per-environment external-provider selection override mirrored\n * from `wildo.infra.<env>.config.ts`. Threaded to the backend via\n * `env-vars-builder` (`WILDO_PROVIDER_SELECTION_OVERRIDES`); consumed by\n * `ExternalProvidersRegistryBackendService`. When omitted, the app-wide\n * `wildo.saas.config.ts` selection applies unchanged.\n */\n providerSelection?: WildoProviderSelectionOverrides;\n /**\n * Authored per-environment email values mirrored from `wildo.infra.<env>.config.ts` — today the shared receiving\n * domain. Threaded to the backend via `env-vars-builder` (`WILDO_INBOUND_EMAIL_SHARED_DOMAIN`); consumed through\n * `resolveInboundEmailConfig`. When omitted, the backend configuration's `email.inbound` applies unchanged.\n */\n email?: WildoInfraEmailConfig;\n /**\n * What this environment does with the agents' classifier-backed content guardrails where no classifier offers them,\n * mirrored from `wildo.infra.<env>.config.ts`. Threaded to the backend via `env-vars-builder`\n * (`WILDO_AGENT_CONTENT_GUARDRAILS`). When omitted, such an agent refuses every turn.\n */\n agentContentGuardrails?: EnvironmentAgentContentGuardrails;\n /**\n * LOCAL-ONLY ownership-DNS stand-in mirrored from `wildo.infra.local.config.ts` (#2519). Threaded to the backend via\n * `env-vars-builder` (`WILDO_OWNERSHIP_DNS_STAND_IN_URL`); consumed by `DnsTxtLookupBackendService`. When omitted,\n * every domain-ownership challenge asks public DNS.\n */\n ownershipDnsStandIn?: WildoOwnershipDnsStandInConfig;\n /**\n * Where the platform keeps the keys it holds for applications, mirrored from `wildo.infra.<env>.config.ts` (#2933).\n * Decides whether both lanes run a self-hosted OpenBao (`selfHostsPlatformKeyVault`) and what apps-manager's env\n * names as its Vault.\n */\n platformKeyManagement?: WildoPlatformKeyManagementConfig;\n createdAt: string;\n updatedAt: string;\n}\n\n\nexport interface PlatformEnvironmentsState {\n version: number;\n /** Scoped active environment selector persisted under `.wildo-saas/state`. */\n currentEnvironment: string;\n environments: Record<string, PlatformEnvironmentConfiguration>;\n}\n\nexport function parsePlatformEnvironmentId(name: string): string {\n return WildoEnvironmentIdSchema.parse(name.trim());\n}\n\n\n// ============================================================================\n// Utility tools\n// ============================================================================\nexport interface ToolCheck {\n name: string;\n installed: boolean;\n version?: string;\n meetsMinimum: boolean;\n minimumVersion: string;\n running?: boolean;\n error?: string;\n}\n\nexport interface PreflightResult {\n os: PlatformEnvOperatingSystem;\n tools: Record<PlatformEnv_Utility_Tools, ToolCheck>;\n allPassed: boolean;\n missingTools: string[];\n outdatedTools: string[];\n}\n\n// ---------------------------------------------------------------------------\n// Setup orchestration types (moved from platform-commands.dto.ts)\n// ---------------------------------------------------------------------------\n\nexport interface SetupResult {\n success: boolean;\n adminPassword?: string;\n}\n\n/**\n * Inputs to {@link runEnvSetup} (`wildo setup`).\n *\n * - `force` — reconfigure an already-COMPLETED environment (re-authors secrets).\n * - `nonInteractive` — headless bootstrap: every answer is DERIVED from the\n * registered environment + `WILDO_INIT_ADMIN_*` seeds, all credentials\n * generated, provider keys omitted. See `runEnvSetup`'s docblock.\n *\n * NOTE: there is deliberately no `skipProviders` opt-out. The interactive\n * provider step is already fully optional (each key prompt is \"press Enter to\n * skip\"), and `nonInteractive` already omits providers entirely — a dedicated\n * flag would be a redundant second door with no capability of its own.\n */\nexport interface EnvSetupInput {\n force?: boolean;\n nonInteractive?: boolean;\n /*\n * ANSWERS for the six steps, so setup is scriptable without `--non-interactive`.\n *\n * `--non-interactive` DERIVES every answer (paths from the registration, runtime from the authored\n * infra config, provider keys as `{}`); these OVERRIDE one step each and leave the rest alone. The\n * difference matters most for provider keys, where deriving means \"none\" — a headless setup used to\n * produce an environment with no third-party credentials at all.\n *\n * Each is optional and absent means \"ask, or derive\" exactly as before.\n */\n /**\n * Override the machine preference for THIS environment.\n *\n * It decides the PLATFORM LANE — a framework developer runs the platform services natively from the\n * checkout, everyone else runs them as containers of the published image — so a machine whose\n * stored preference is wrong for one environment had no way to say so. Deliberately NOT offered on\n * `wildo init`: there the skeleton mode is derived from CONTAINMENT, because `file:` framework links\n * only resolve inside the checkout, and an override would scaffold an application that cannot build.\n */\n frameworkDeveloper?: boolean;\n /**\n * Whether to seed the provider keys captured in `~/.wildo/local-defaults.json` — a `LocalDefaultsMode`\n * value. Empty or absent: the machine preference, else ADOPT.\n */\n providerKeyDefaults?: string;\n secretsPath?: string;\n configPath?: string;\n infraPath?: string;\n runtime?: string;\n database?: string;\n}\n"]}
@@ -241,6 +241,8 @@ export declare class RuntimeBootstrap {
241
241
  * next render, readiness probe and registration at the wrong substrate.
242
242
  * - `email`, the shared receiving domain, projected into `WILDO_INBOUND_EMAIL_SHARED_DOMAIN`: a stale copy keeps
243
243
  * routing mail to a domain the descriptor no longer names.
244
+ * - `agentContentGuardrails`, projected into `WILDO_AGENT_CONTENT_GUARDRAILS`: a stale copy keeps running agents
245
+ * unguarded after the descriptor stopped saying so, or, removed, keeps refusing after it started.
244
246
  * - `ownershipDnsStandIn`, projected into `WILDO_OWNERSHIP_DNS_STAND_IN_URL` (local-only, #2519): a stale copy keeps
245
247
  * answering domain-ownership challenges from a double the descriptor no longer names, or, removed from the
246
248
  * descriptor, keeps verifying domains against one at all.
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-bootstrap.service.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/runtime-bootstrap.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AAwBH,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,2DAA2D,CAAC;AAQnH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAE5G;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,oEAAoE;IACpE,iBAAiB,EAAE,OAAO,CAAC;IAC3B,6GAA6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OAAO,CAAC,sBAAsB,CAAC;IA8DlC;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,gCAAgC;IAgB/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAgGrC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IA2C3B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA8C/B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,MAAM,CAAC,2BAA2B;IAe1C;;;;;;;;;;;;;;;;;;;;;OAqBG;mBACkB,4BAA4B;CAuElD"}
1
+ {"version":3,"file":"runtime-bootstrap.service.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/runtime-bootstrap.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AAwBH,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,2DAA2D,CAAC;AAQnH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAE5G;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,oEAAoE;IACpE,iBAAiB,EAAE,OAAO,CAAC;IAC3B,6GAA6G;IAC7G,eAAe,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAC5B,0HAA0H;IAC1H,YAAY,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,qBAAqB,EAAE,iCAAiC,EAAE,CAAC;CAC5D;AAWD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,gCAAgC,CAAC;IACtC,QAAQ,EAAE,MAA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C,gBAAgB;IA8C/B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,MAAM,CAAC,2BAA2B;IAe1C;;;;;;;;;;;;;;;;;;;;;OAqBG;mBACkB,4BAA4B;CAuElD"}
@@ -255,6 +255,8 @@ export class RuntimeBootstrap {
255
255
  * next render, readiness probe and registration at the wrong substrate.
256
256
  * - `email`, the shared receiving domain, projected into `WILDO_INBOUND_EMAIL_SHARED_DOMAIN`: a stale copy keeps
257
257
  * routing mail to a domain the descriptor no longer names.
258
+ * - `agentContentGuardrails`, projected into `WILDO_AGENT_CONTENT_GUARDRAILS`: a stale copy keeps running agents
259
+ * unguarded after the descriptor stopped saying so, or, removed, keeps refusing after it started.
258
260
  * - `ownershipDnsStandIn`, projected into `WILDO_OWNERSHIP_DNS_STAND_IN_URL` (local-only, #2519): a stale copy keeps
259
261
  * answering domain-ownership challenges from a double the descriptor no longer names, or, removed from the
260
262
  * descriptor, keeps verifying domains against one at all.
@@ -359,6 +361,7 @@ export class RuntimeBootstrap {
359
361
  observability: authored.observability,
360
362
  providerSelection: authored.providerSelection,
361
363
  email: authored.email,
364
+ agentContentGuardrails: authored.agentContentGuardrails,
362
365
  ownershipDnsStandIn: authored.ownershipDnsStandIn,
363
366
  platformKeyManagement: authored.platformKeyManagement,
364
367
  };
@@ -415,6 +418,7 @@ export class RuntimeBootstrap {
415
418
  observability: env.observability,
416
419
  providerSelection: env.providerSelection,
417
420
  email: env.email,
421
+ agentContentGuardrails: env.agentContentGuardrails,
418
422
  ownershipDnsStandIn: env.ownershipDnsStandIn,
419
423
  platformKeyManagement: env.platformKeyManagement,
420
424
  };
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-bootstrap.service.js","sourceRoot":"","sources":["../../../../src/services/environment/runtime-bootstrap.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AAEH,OAAO,EAAE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AG,CAAC,IAAI,CACN,UAAU,UAAU,CAAC,kBAAkB,4EAA4E,CACpH,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,YAAY,GAAG,wBAAwB,CAAC,GAAG,EAAE,oBAAoB,EAAE,WAAW,CAAC,CAAC;YAChF,IAAI,YAAY,EAAE,CAAC;gBACjB,GAAG,CAAC,IAAI,CACN,cAAc;oBACZ,CAAC,CAAC,kBAAkB,UAAU,CAAC,kBAAkB,8BAA8B;oBAC/E,CAAC,CAAC,yBAAyB,UAAU,CAAC,kBAAkB,iDAAiD,CAC5G,CAAC;YACJ,CAAC;QACH,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`, `observability`, `providerSelection`, `email`, …) so the\n * authored source-of-truth wins over a stale `environments.json` snapshot.\n * - Project the authored config through {@link buildConfigJsonFromInfraEnvConfig} (the same projection\n * `wildo config sync` writes) and write `config.json` when the file is missing or its bytes differ from the\n * projection (#2311). Identical bytes write nothing.\n * - For DOCKER_COMPOSE runtimes only, render the compose template and the `.env.wildo-platform` env file on every\n * run, and write each only when its content differs from the file on disk (#2311). Comparing what the inputs\n * PRODUCE is the one check that is total over them (`config.json`, `secrets.json`, the framework templates, the\n * application's configuration), so an edit to any of them reaches the next start. Same generators\n * `runInfraWrite` calls during the interactive setup 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, a missing\n * `.env.wildo-platform` throws with a clear hint to run `wildo setup` (or restore\n * from a backup), and existing compose artifacts are left as they are with a warning\n * rather than re-rendered without the material they project.\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 when it is missing or differs from the projection, and the compose artifacts when missing\n * or when their inputs changed — an idempotent pre-flight that must not churn `environments.json`'s `updatedAt`\n * or the compose file on an unchanged descriptor.\n * - `config sync` reconcile ALWAYS brings config.json to the authored\n * projection — 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. Identical bytes are\n * not rewritten, so its mtime moves only when its content does.\n */\n\nimport { existsSync, readFileSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nimport {\n PUBLIC_DOMAIN_DEFAULTS,\n WildoDeploymentRuntime,\n WildoLocationType,\n type WildoInfraEnvConfig,\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 serializeConfigJson,\n getUnsupportedAuthoredConfigFallbackReason,\n loadAuthoredInfraEnvConfig,\n} from '~wildo-cli/services/environment/authored-infra-config.utils';\nimport {\n generateEnvWildoPlatform,\n renderDockerComposeTemplate,\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 { PlatformEnvConfigJson } from '~wildo-cli/services/credentials/credentials.schemas';\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 written: it was missing, or its bytes differed from the authored projection (#2311). */\n wroteConfigJson: boolean;\n /**\n * Docker Compose template was written: it was missing, or its rendered content differed from the file on disk\n * because one of its inputs changed (#2311). The files it bind-mounts are re-materialized on every run either way.\n */\n wroteDockerCompose: boolean;\n /** `.env.wildo-platform` was written: it was missing, or its generated content differed from the file on disk (#2311). */\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). The compose render and the platform env file then\n * differ from what is on disk wherever they project that material, so they are rewritten with it.\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/**\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, and re-deriving\n * each from its input when that input changed (#2311). See file header for\n * 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 brought current. (For RECONCILED config.json always\n * ends up as the authored projection, written only when its bytes differ,\n * 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\n/** A kept `config.json`'s top-level members, for naming what changed; unreadable reads as empty (it is rewritten). */\nfunction parseConfigJsonOrEmpty(bytes: string): Record<string, unknown> {\n try {\n const parsed: unknown = JSON.parse(bytes);\n return parsed !== null && typeof parsed === 'object' ? parsed as Record<string, unknown> : {};\n } catch {\n return {};\n }\n}\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 brought to the authored\n * `wildo.infra.<env>.config.ts` projection (written only when its bytes differ).\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 // Rendered on every run, newly minted secret material and a `local_data` reset included: the\n // comparison of the rendered content sees every input, and the render re-materializes the files\n // compose bind-mounts (the immudb signing key, the mongot password) each time (#2311).\n log,\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 * compose step refuses a MISSING `.env.wildo-platform` with the actionable \"run `wildo setup`\"\n * message (and leaves existing artifacts alone with a warning), and pre-empting it with a\n * 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 * For some members OMISSION from the descriptor is authoritative: removed there, they are cleared from the record\n * too, so hydration cannot bring a removed value back. Each is read by what the same command renders next, so a\n * stale copy acts on the wrong target:\n *\n * - `infrastructureHost`, the environment's infrastructure OWNER: a copy describing the previous owner steers the\n * next render, readiness probe and registration at the wrong substrate.\n * - `email`, the shared receiving domain, projected into `WILDO_INBOUND_EMAIL_SHARED_DOMAIN`: a stale copy keeps\n * routing mail to a domain the descriptor no longer names.\n * - `ownershipDnsStandIn`, projected into `WILDO_OWNERSHIP_DNS_STAND_IN_URL` (local-only, #2519): a stale copy keeps\n * answering domain-ownership challenges from a double the descriptor no longer names, or, removed from the\n * descriptor, keeps verifying domains against one at all.\n * - `logging`, `observability`, `providerSelection`, projected into `LOG_LEVEL`, the `OTEL_*` variables and\n * `WILDO_PROVIDER_SELECTION_OVERRIDES`: a stale copy keeps a level, an exporter or a provider choice the\n * descriptor no longer makes.\n * - `serviceHosts`, the per-service subdomains projected into `WILDO_SERVICE_HOSTS` (and, on a remote lane, into\n * `APPLICATION_RUNTIME_ENDPOINTS`): a stale copy addresses a service at a host the descriptor no longer gives it.\n * - `platformKeyManagement` (#2933), projected into apps-manager's `PLATFORM_KEY_VAULT_*` and deciding whether the\n * platform runs its own OpenBao: a stale copy keeps apps-manager pointed at a Vault the descriptor no longer names.\n * - `serviceAuth`, the service-to-service policy: a removed policy must stop applying.\n *\n * REMOVAL matters as much as change, because hydration (`hydrateEnvironmentFromConfig`, `loadInfraHydratedConfig`)\n * falls back from one copy to the other: a field one copy still holds comes back. A new authored member that an\n * `.env` builder reads, and that only the descriptor decides, joins this set. Every writer of these registry fields\n * derives them from the descriptor (this method; `wildo setup` seeds `logging` from it; the CI path builds its record\n * from `config.json`), which is what makes omission authoritative safe.\n *\n * The set used to be a hand-kept constant, `CONFIG_JSON_FIELDS_TRACKING_AUTHORED`, which also decided when\n * `config.json` was rewritten. That is how #2311 happened: a kept `config.json` was rewritten only when one of those\n * members diverged, so every other member the `.env` builders read (`backingServices`, `publicDomain`, …) kept its\n * value from the last `wildo config sync`. `ensureConfigJson` now compares the whole projection, the constant had no\n * reader left, and it was removed (it had already missed `serviceAuth`).\n *\n * Both mechanisms are local-only. A REMOTE environment gets the same answer another way (#2310):\n * `ConfigSyncCommand.loadConfigForSync` lays every member the descriptor decides over its persisted `config.json`\n * (`overlayAuthoredInfraMembers`, driven by `AUTHORED_INFRA_MEMBER_AUTHORITY`), and `hydrateEnvironmentFromConfig`\n * then takes those members from that `config.json`, absence included, so this record's copy cannot win either.\n */\n private static refreshEnvFromAuthored(\n env: PlatformEnvironmentConfiguration,\n authored: 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 /** Always defined on the authored descriptor (its transform resolves `FULL`). Paired with `diffSelector` (#2303). */\n serviceProfile: authored.serviceProfile,\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 // Omission is authoritative; see the posture blocks below.\n serviceHosts: authored.serviceHosts,\n // Omission is authoritative (#2310): a CDN entry removed from the descriptor must return its route to the ingress.\n cdn: authored.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 /*\n * Omission is authoritative for these members (the method's JSDoc says why, per member): removing a log level,\n * an exporter, a provider choice, the receiving-domain override or a service host from the infra config must\n * stop it. Falling back to `env` kept the registry's copy (this record IS the registry's cached object, saved\n * whole by the next update), and hydration's `config.x ?? env.x` then brought it back into every `.env`, through\n * `wildo config sync` as well as `wildo local dev`. Every writer of these fields derives them from the authored\n * descriptor (`wildo setup` seeds them from it), so `undefined` here means \"not authored\", never \"not known\".\n */\n logging: authored.logging,\n observability: authored.observability,\n providerSelection: authored.providerSelection,\n email: authored.email,\n ownershipDnsStandIn: authored.ownershipDnsStandIn,\n platformKeyManagement: authored.platformKeyManagement,\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 /** Paired with the `serviceProfile` projection above: a profile flip is often a one-line change (#2303). */\n serviceProfile: env.serviceProfile,\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 email: env.email,\n ownershipDnsStandIn: env.ownershipDnsStandIn,\n platformKeyManagement: env.platformKeyManagement,\n };\n }\n\n /**\n * Write `config.json` from the authored infra descriptor when it is missing or its bytes differ from the projection\n * (idempotent self-heal for `local up` / `local dev`).\n *\n * Keyed on the WHOLE projection (#2311). `config.json` is a cache of the descriptor: `wildo config sync` overwrites a\n * local one with this same projection every time, so a file that differs from it is stale by definition, whichever\n * member differs. Keying on a hand-kept list of members left every other one (`backingServices`, `publicDomain`, …)\n * at its last-synced value, read by the `.env` builders and preferred by hydration. Identical bytes write nothing,\n * so an unchanged descriptor churns nothing. Members only `wildo setup` writes (`externalServices`, `externalEndpoints`,\n * `atlas`) go with the first rewrite, as with `config sync`: on a LOCAL environment `externalServices` names only\n * the self-hosted providers (every reader tests for a non-default one), `externalEndpoints` and `atlas` are Atlas-only,\n * and Atlas is refused locally (`getUnsupportedAuthoredConfigFallbackReason`).\n */\n private static ensureConfigJson(\n env: PlatformEnvironmentConfiguration,\n authored: WildoInfraEnvConfig,\n log: Logger,\n ): boolean {\n const configPath = join(EnvironmentPaths.resolveConfigDir(env.name), FILE_NAMES.CONFIG_JSON);\n if (existsSync(configPath)) {\n const projected = buildConfigJsonFromInfraEnvConfig(authored);\n const current = readFileSync(configPath, 'utf8');\n if (current === serializeConfigJson(projected)) {\n return false;\n }\n const persisted = parseConfigJsonOrEmpty(current);\n const diverged = [...new Set([...Object.keys(persisted), ...Object.keys(projected)])].filter(\n (field) => JSON.stringify(persisted[field] ?? null) !== JSON.stringify((projected as Record<string, unknown>)[field] ?? null),\n );\n RuntimeBootstrap.writeConfigJsonFromAuthored(env, authored);\n if (diverged.includes('infrastructureHost')) {\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 }\n if (diverged.includes('email')) {\n const sharedDomain = authored.email?.inbound?.sharedDomain;\n log.info(\n sharedDomain\n ? ` Rewrote ${FILE_NAMES.CONFIG_JSON}: this environment now receives email at ${sharedDomain}.`\n : ` Rewrote ${FILE_NAMES.CONFIG_JSON}: this environment now receives email at the backend configuration's shared domain.`,\n );\n }\n const otherFields = diverged.filter((field) => field !== 'infrastructureHost' && field !== 'email');\n if (otherFields.length > 0) {\n log.info(` Rewrote ${FILE_NAMES.CONFIG_JSON}: the authored ${otherFields.join(', ')} changed.`);\n } else if (diverged.length === 0) {\n log.info(` Rewrote ${FILE_NAMES.CONFIG_JSON} to the authored projection (its layout differed).`);\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, invalidating the config cache so the next read\n * 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 (missing or bytes differ, vs. always).\n *\n * Identical bytes are NOT rewritten, even for an \"always\" caller (`wildo config sync`, `wildo dev start`), so the\n * file's mtime moves only when its content does and nothing that dates artifacts reads a change that did not happen\n * (#2311). The compose artifacts derived from it compare their own rendered content, so they do not depend on this.\n */\n private static writeConfigJsonFromAuthored(\n env: PlatformEnvironmentConfiguration,\n authored: WildoInfraEnvConfig,\n ): void {\n const configDir = EnvironmentPaths.resolveConfigDir(env.name);\n const projected = buildConfigJsonFromInfraEnvConfig(authored);\n FileUtils.ensureDirectoryExists(configDir);\n const configPath = join(configDir, FILE_NAMES.CONFIG_JSON);\n const bytes = serializeConfigJson(projected);\n if (!existsSync(configPath) || readFileSync(configPath, 'utf8') !== bytes) {\n writeFileSync(configPath, bytes);\n }\n EnvironmentUtils.invalidateCache();\n }\n\n /**\n * Ensure the Docker Compose runtime artifacts exist and are current:\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 * Both are rendered on EVERY run, and each generator writes only when its content differs from the file on disk\n * (#2311). That is total over their inputs by construction. The previous triggers were each keyed on ONE input and\n * missed the rest: \"missing\", \"this run minted secret material\" (blind to a hand edit of `secrets.json`), \"older\n * than `config.json`\" (blind to `secrets.json` and to the framework template), and a predicate for one bind-mounted\n * file (blind to the mongot password beside it). Rejected: an mtime check over a list of inputs, because the list is\n * what rots (the render also reads the application's minion and worker configuration, and the template directory).\n *\n * Without a framework path (no framework checkout to render the template from) an EXISTING compose file is left as\n * it is and said so: refusing would stop `wildo local dev` on a file that may well be current, and the remedy,\n * `wildo config sync --domain manifest` from a workspace with a framework path, needs nothing this run holds. A\n * MISSING one still refuses, because `docker compose up` cannot run without it. When `secrets.json` cannot be read,\n * both EXISTING artifacts are left alone with a warning (re-rendering them would drop the material they project),\n * and a missing `.env.wildo-platform` refuses.\n */\n private static async ensureDockerComposeArtifacts(\n env: PlatformEnvironmentConfiguration,\n frameworkPath: string | null,\n isFrameworkDeveloper: boolean,\n log: Logger,\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 // Captured before rendering, so the log can say whether a file was re-derived or created.\n const composeExisted = existsSync(composePath);\n const envFileExisted = existsSync(envFilePath);\n\n // Read ONCE, before either artifact: the compose render projects the same material (the immudb signing key and\n // admin password, the mongot sync-source password), and a render without it is a degraded file, not a current one.\n const credentials = EnvironmentUtils.loadSecretsJson(env.name);\n\n let wroteDockerCompose = false;\n if (!frameworkPath) {\n if (!composeExisted) {\n throw new Error(\n `Cannot render ${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 log.warn(\n ` Left ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM} as it is: no framework path to render it from, so it may not `\n + `reflect a recent change. Run 'wildo config sync --domain manifest' from a workspace that has one.`,\n );\n } else if (!credentials && composeExisted) {\n // Rendering now would drop the immudb `--signingKey` block, its admin password and the mongot service, and\n // write that degraded file over a working one (or refuse, for a self-hosted OpenBao). Leave it, as the env\n // file below is left.\n log.warn(\n ` Left ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM} as it is: secrets.json is missing or unreadable, so it cannot be checked.`,\n );\n } else {\n wroteDockerCompose = await renderDockerComposeTemplate(env, frameworkPath, isFrameworkDeveloper);\n if (wroteDockerCompose) {\n log.info(\n composeExisted\n ? ` Re-rendered ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM}: one of its inputs changed.`\n : ` Self-healed missing ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM} from authored infra descriptor.`,\n );\n }\n }\n\n let wroteEnvFile = false;\n if (!credentials) {\n if (!envFileExisted) {\n throw new Error(\n `Cannot generate ${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 log.warn(\n ` Left ${FILE_NAMES.ENV_WILDO_PLATFORM} as it is: secrets.json is missing or unreadable, so it cannot be checked.`,\n );\n } else {\n wroteEnvFile = generateEnvWildoPlatform(env, isFrameworkDeveloper, credentials);\n if (wroteEnvFile) {\n log.info(\n envFileExisted\n ? ` Re-generated ${FILE_NAMES.ENV_WILDO_PLATFORM}: one of its inputs changed.`\n : ` Self-healed missing ${FILE_NAMES.ENV_WILDO_PLATFORM} from authored infra descriptor + secrets.json.`,\n );\n }\n }\n\n return { wroteDockerCompose, wroteEnvFile };\n }\n}\n"]}
1
+ {"version":3,"file":"runtime-bootstrap.service.js","sourceRoot":"","sources":["../../../../src/services/environment/runtime-bootstrap.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,KAAK,CAAC;QACzB,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,MAAM,IAAI,KAAK,CACb,mBAAmB,UAAU,CAAC,kBAAkB,SAAS,GAAG,CAAC,IAAI,6CAA6C;sBAC5G,mGAAmG,CACtG,CAAC;YACJ,CAAC;YACD,GAAG,CAAC,IAAI,CACN,UAAU,UAAU,CAAC,kBAAkB,4EAA4E,CACpH,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,YAAY,GAAG,wBAAwB,CAAC,GAAG,EAAE,oBAAoB,EAAE,WAAW,CAAC,CAAC;YAChF,IAAI,YAAY,EAAE,CAAC;gBACjB,GAAG,CAAC,IAAI,CACN,cAAc;oBACZ,CAAC,CAAC,kBAAkB,UAAU,CAAC,kBAAkB,8BAA8B;oBAC/E,CAAC,CAAC,yBAAyB,UAAU,CAAC,kBAAkB,iDAAiD,CAC5G,CAAC;YACJ,CAAC;QACH,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`, `observability`, `providerSelection`, `email`, …) so the\n * authored source-of-truth wins over a stale `environments.json` snapshot.\n * - Project the authored config through {@link buildConfigJsonFromInfraEnvConfig} (the same projection\n * `wildo config sync` writes) and write `config.json` when the file is missing or its bytes differ from the\n * projection (#2311). Identical bytes write nothing.\n * - For DOCKER_COMPOSE runtimes only, render the compose template and the `.env.wildo-platform` env file on every\n * run, and write each only when its content differs from the file on disk (#2311). Comparing what the inputs\n * PRODUCE is the one check that is total over them (`config.json`, `secrets.json`, the framework templates, the\n * application's configuration), so an edit to any of them reaches the next start. Same generators\n * `runInfraWrite` calls during the interactive setup 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, a missing\n * `.env.wildo-platform` throws with a clear hint to run `wildo setup` (or restore\n * from a backup), and existing compose artifacts are left as they are with a warning\n * rather than re-rendered without the material they project.\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 when it is missing or differs from the projection, and the compose artifacts when missing\n * or when their inputs changed — an idempotent pre-flight that must not churn `environments.json`'s `updatedAt`\n * or the compose file on an unchanged descriptor.\n * - `config sync` reconcile ALWAYS brings config.json to the authored\n * projection — 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. Identical bytes are\n * not rewritten, so its mtime moves only when its content does.\n */\n\nimport { existsSync, readFileSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nimport {\n PUBLIC_DOMAIN_DEFAULTS,\n WildoDeploymentRuntime,\n WildoLocationType,\n type WildoInfraEnvConfig,\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 serializeConfigJson,\n getUnsupportedAuthoredConfigFallbackReason,\n loadAuthoredInfraEnvConfig,\n} from '~wildo-cli/services/environment/authored-infra-config.utils';\nimport {\n generateEnvWildoPlatform,\n renderDockerComposeTemplate,\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 { PlatformEnvConfigJson } from '~wildo-cli/services/credentials/credentials.schemas';\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 written: it was missing, or its bytes differed from the authored projection (#2311). */\n wroteConfigJson: boolean;\n /**\n * Docker Compose template was written: it was missing, or its rendered content differed from the file on disk\n * because one of its inputs changed (#2311). The files it bind-mounts are re-materialized on every run either way.\n */\n wroteDockerCompose: boolean;\n /** `.env.wildo-platform` was written: it was missing, or its generated content differed from the file on disk (#2311). */\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). The compose render and the platform env file then\n * differ from what is on disk wherever they project that material, so they are rewritten with it.\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/**\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, and re-deriving\n * each from its input when that input changed (#2311). See file header for\n * 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 brought current. (For RECONCILED config.json always\n * ends up as the authored projection, written only when its bytes differ,\n * 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\n/** A kept `config.json`'s top-level members, for naming what changed; unreadable reads as empty (it is rewritten). */\nfunction parseConfigJsonOrEmpty(bytes: string): Record<string, unknown> {\n try {\n const parsed: unknown = JSON.parse(bytes);\n return parsed !== null && typeof parsed === 'object' ? parsed as Record<string, unknown> : {};\n } catch {\n return {};\n }\n}\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 brought to the authored\n * `wildo.infra.<env>.config.ts` projection (written only when its bytes differ).\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 // Rendered on every run, newly minted secret material and a `local_data` reset included: the\n // comparison of the rendered content sees every input, and the render re-materializes the files\n // compose bind-mounts (the immudb signing key, the mongot password) each time (#2311).\n log,\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 * compose step refuses a MISSING `.env.wildo-platform` with the actionable \"run `wildo setup`\"\n * message (and leaves existing artifacts alone with a warning), and pre-empting it with a\n * 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 * For some members OMISSION from the descriptor is authoritative: removed there, they are cleared from the record\n * too, so hydration cannot bring a removed value back. Each is read by what the same command renders next, so a\n * stale copy acts on the wrong target:\n *\n * - `infrastructureHost`, the environment's infrastructure OWNER: a copy describing the previous owner steers the\n * next render, readiness probe and registration at the wrong substrate.\n * - `email`, the shared receiving domain, projected into `WILDO_INBOUND_EMAIL_SHARED_DOMAIN`: a stale copy keeps\n * routing mail to a domain the descriptor no longer names.\n * - `agentContentGuardrails`, projected into `WILDO_AGENT_CONTENT_GUARDRAILS`: a stale copy keeps running agents\n * unguarded after the descriptor stopped saying so, or, removed, keeps refusing after it started.\n * - `ownershipDnsStandIn`, projected into `WILDO_OWNERSHIP_DNS_STAND_IN_URL` (local-only, #2519): a stale copy keeps\n * answering domain-ownership challenges from a double the descriptor no longer names, or, removed from the\n * descriptor, keeps verifying domains against one at all.\n * - `logging`, `observability`, `providerSelection`, projected into `LOG_LEVEL`, the `OTEL_*` variables and\n * `WILDO_PROVIDER_SELECTION_OVERRIDES`: a stale copy keeps a level, an exporter or a provider choice the\n * descriptor no longer makes.\n * - `serviceHosts`, the per-service subdomains projected into `WILDO_SERVICE_HOSTS` (and, on a remote lane, into\n * `APPLICATION_RUNTIME_ENDPOINTS`): a stale copy addresses a service at a host the descriptor no longer gives it.\n * - `platformKeyManagement` (#2933), projected into apps-manager's `PLATFORM_KEY_VAULT_*` and deciding whether the\n * platform runs its own OpenBao: a stale copy keeps apps-manager pointed at a Vault the descriptor no longer names.\n * - `serviceAuth`, the service-to-service policy: a removed policy must stop applying.\n *\n * REMOVAL matters as much as change, because hydration (`hydrateEnvironmentFromConfig`, `loadInfraHydratedConfig`)\n * falls back from one copy to the other: a field one copy still holds comes back. A new authored member that an\n * `.env` builder reads, and that only the descriptor decides, joins this set. Every writer of these registry fields\n * derives them from the descriptor (this method; `wildo setup` seeds `logging` from it; the CI path builds its record\n * from `config.json`), which is what makes omission authoritative safe.\n *\n * The set used to be a hand-kept constant, `CONFIG_JSON_FIELDS_TRACKING_AUTHORED`, which also decided when\n * `config.json` was rewritten. That is how #2311 happened: a kept `config.json` was rewritten only when one of those\n * members diverged, so every other member the `.env` builders read (`backingServices`, `publicDomain`, …) kept its\n * value from the last `wildo config sync`. `ensureConfigJson` now compares the whole projection, the constant had no\n * reader left, and it was removed (it had already missed `serviceAuth`).\n *\n * Both mechanisms are local-only. A REMOTE environment gets the same answer another way (#2310):\n * `ConfigSyncCommand.loadConfigForSync` lays every member the descriptor decides over its persisted `config.json`\n * (`overlayAuthoredInfraMembers`, driven by `AUTHORED_INFRA_MEMBER_AUTHORITY`), and `hydrateEnvironmentFromConfig`\n * then takes those members from that `config.json`, absence included, so this record's copy cannot win either.\n */\n private static refreshEnvFromAuthored(\n env: PlatformEnvironmentConfiguration,\n authored: 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 /** Always defined on the authored descriptor (its transform resolves `FULL`). Paired with `diffSelector` (#2303). */\n serviceProfile: authored.serviceProfile,\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 // Omission is authoritative; see the posture blocks below.\n serviceHosts: authored.serviceHosts,\n // Omission is authoritative (#2310): a CDN entry removed from the descriptor must return its route to the ingress.\n cdn: authored.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 /*\n * Omission is authoritative for these members (the method's JSDoc says why, per member): removing a log level,\n * an exporter, a provider choice, the receiving-domain override or a service host from the infra config must\n * stop it. Falling back to `env` kept the registry's copy (this record IS the registry's cached object, saved\n * whole by the next update), and hydration's `config.x ?? env.x` then brought it back into every `.env`, through\n * `wildo config sync` as well as `wildo local dev`. Every writer of these fields derives them from the authored\n * descriptor (`wildo setup` seeds them from it), so `undefined` here means \"not authored\", never \"not known\".\n */\n logging: authored.logging,\n observability: authored.observability,\n providerSelection: authored.providerSelection,\n email: authored.email,\n agentContentGuardrails: authored.agentContentGuardrails,\n ownershipDnsStandIn: authored.ownershipDnsStandIn,\n platformKeyManagement: authored.platformKeyManagement,\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 /** Paired with the `serviceProfile` projection above: a profile flip is often a one-line change (#2303). */\n serviceProfile: env.serviceProfile,\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 email: env.email,\n agentContentGuardrails: env.agentContentGuardrails,\n ownershipDnsStandIn: env.ownershipDnsStandIn,\n platformKeyManagement: env.platformKeyManagement,\n };\n }\n\n /**\n * Write `config.json` from the authored infra descriptor when it is missing or its bytes differ from the projection\n * (idempotent self-heal for `local up` / `local dev`).\n *\n * Keyed on the WHOLE projection (#2311). `config.json` is a cache of the descriptor: `wildo config sync` overwrites a\n * local one with this same projection every time, so a file that differs from it is stale by definition, whichever\n * member differs. Keying on a hand-kept list of members left every other one (`backingServices`, `publicDomain`, …)\n * at its last-synced value, read by the `.env` builders and preferred by hydration. Identical bytes write nothing,\n * so an unchanged descriptor churns nothing. Members only `wildo setup` writes (`externalServices`, `externalEndpoints`,\n * `atlas`) go with the first rewrite, as with `config sync`: on a LOCAL environment `externalServices` names only\n * the self-hosted providers (every reader tests for a non-default one), `externalEndpoints` and `atlas` are Atlas-only,\n * and Atlas is refused locally (`getUnsupportedAuthoredConfigFallbackReason`).\n */\n private static ensureConfigJson(\n env: PlatformEnvironmentConfiguration,\n authored: WildoInfraEnvConfig,\n log: Logger,\n ): boolean {\n const configPath = join(EnvironmentPaths.resolveConfigDir(env.name), FILE_NAMES.CONFIG_JSON);\n if (existsSync(configPath)) {\n const projected = buildConfigJsonFromInfraEnvConfig(authored);\n const current = readFileSync(configPath, 'utf8');\n if (current === serializeConfigJson(projected)) {\n return false;\n }\n const persisted = parseConfigJsonOrEmpty(current);\n const diverged = [...new Set([...Object.keys(persisted), ...Object.keys(projected)])].filter(\n (field) => JSON.stringify(persisted[field] ?? null) !== JSON.stringify((projected as Record<string, unknown>)[field] ?? null),\n );\n RuntimeBootstrap.writeConfigJsonFromAuthored(env, authored);\n if (diverged.includes('infrastructureHost')) {\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 }\n if (diverged.includes('email')) {\n const sharedDomain = authored.email?.inbound?.sharedDomain;\n log.info(\n sharedDomain\n ? ` Rewrote ${FILE_NAMES.CONFIG_JSON}: this environment now receives email at ${sharedDomain}.`\n : ` Rewrote ${FILE_NAMES.CONFIG_JSON}: this environment now receives email at the backend configuration's shared domain.`,\n );\n }\n const otherFields = diverged.filter((field) => field !== 'infrastructureHost' && field !== 'email');\n if (otherFields.length > 0) {\n log.info(` Rewrote ${FILE_NAMES.CONFIG_JSON}: the authored ${otherFields.join(', ')} changed.`);\n } else if (diverged.length === 0) {\n log.info(` Rewrote ${FILE_NAMES.CONFIG_JSON} to the authored projection (its layout differed).`);\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, invalidating the config cache so the next read\n * 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 (missing or bytes differ, vs. always).\n *\n * Identical bytes are NOT rewritten, even for an \"always\" caller (`wildo config sync`, `wildo dev start`), so the\n * file's mtime moves only when its content does and nothing that dates artifacts reads a change that did not happen\n * (#2311). The compose artifacts derived from it compare their own rendered content, so they do not depend on this.\n */\n private static writeConfigJsonFromAuthored(\n env: PlatformEnvironmentConfiguration,\n authored: WildoInfraEnvConfig,\n ): void {\n const configDir = EnvironmentPaths.resolveConfigDir(env.name);\n const projected = buildConfigJsonFromInfraEnvConfig(authored);\n FileUtils.ensureDirectoryExists(configDir);\n const configPath = join(configDir, FILE_NAMES.CONFIG_JSON);\n const bytes = serializeConfigJson(projected);\n if (!existsSync(configPath) || readFileSync(configPath, 'utf8') !== bytes) {\n writeFileSync(configPath, bytes);\n }\n EnvironmentUtils.invalidateCache();\n }\n\n /**\n * Ensure the Docker Compose runtime artifacts exist and are current:\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 * Both are rendered on EVERY run, and each generator writes only when its content differs from the file on disk\n * (#2311). That is total over their inputs by construction. The previous triggers were each keyed on ONE input and\n * missed the rest: \"missing\", \"this run minted secret material\" (blind to a hand edit of `secrets.json`), \"older\n * than `config.json`\" (blind to `secrets.json` and to the framework template), and a predicate for one bind-mounted\n * file (blind to the mongot password beside it). Rejected: an mtime check over a list of inputs, because the list is\n * what rots (the render also reads the application's minion and worker configuration, and the template directory).\n *\n * Without a framework path (no framework checkout to render the template from) an EXISTING compose file is left as\n * it is and said so: refusing would stop `wildo local dev` on a file that may well be current, and the remedy,\n * `wildo config sync --domain manifest` from a workspace with a framework path, needs nothing this run holds. A\n * MISSING one still refuses, because `docker compose up` cannot run without it. When `secrets.json` cannot be read,\n * both EXISTING artifacts are left alone with a warning (re-rendering them would drop the material they project),\n * and a missing `.env.wildo-platform` refuses.\n */\n private static async ensureDockerComposeArtifacts(\n env: PlatformEnvironmentConfiguration,\n frameworkPath: string | null,\n isFrameworkDeveloper: boolean,\n log: Logger,\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 // Captured before rendering, so the log can say whether a file was re-derived or created.\n const composeExisted = existsSync(composePath);\n const envFileExisted = existsSync(envFilePath);\n\n // Read ONCE, before either artifact: the compose render projects the same material (the immudb signing key and\n // admin password, the mongot sync-source password), and a render without it is a degraded file, not a current one.\n const credentials = EnvironmentUtils.loadSecretsJson(env.name);\n\n let wroteDockerCompose = false;\n if (!frameworkPath) {\n if (!composeExisted) {\n throw new Error(\n `Cannot render ${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 log.warn(\n ` Left ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM} as it is: no framework path to render it from, so it may not `\n + `reflect a recent change. Run 'wildo config sync --domain manifest' from a workspace that has one.`,\n );\n } else if (!credentials && composeExisted) {\n // Rendering now would drop the immudb `--signingKey` block, its admin password and the mongot service, and\n // write that degraded file over a working one (or refuse, for a self-hosted OpenBao). Leave it, as the env\n // file below is left.\n log.warn(\n ` Left ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM} as it is: secrets.json is missing or unreadable, so it cannot be checked.`,\n );\n } else {\n wroteDockerCompose = await renderDockerComposeTemplate(env, frameworkPath, isFrameworkDeveloper);\n if (wroteDockerCompose) {\n log.info(\n composeExisted\n ? ` Re-rendered ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM}: one of its inputs changed.`\n : ` Self-healed missing ${FILE_NAMES.DOCKER_COMPOSE_WILDO_PLATFORM} from authored infra descriptor.`,\n );\n }\n }\n\n let wroteEnvFile = false;\n if (!credentials) {\n if (!envFileExisted) {\n throw new Error(\n `Cannot generate ${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 log.warn(\n ` Left ${FILE_NAMES.ENV_WILDO_PLATFORM} as it is: secrets.json is missing or unreadable, so it cannot be checked.`,\n );\n } else {\n wroteEnvFile = generateEnvWildoPlatform(env, isFrameworkDeveloper, credentials);\n if (wroteEnvFile) {\n log.info(\n envFileExisted\n ? ` Re-generated ${FILE_NAMES.ENV_WILDO_PLATFORM}: one of its inputs changed.`\n : ` Self-healed missing ${FILE_NAMES.ENV_WILDO_PLATFORM} from authored infra descriptor + secrets.json.`,\n );\n }\n }\n\n return { wroteDockerCompose, wroteEnvFile };\n }\n}\n"]}
@@ -95,6 +95,19 @@ export interface FrameworkDockerPublishResult {
95
95
  export declare const FRAMEWORK_DOCKER_IMAGE_PLATFORMS: readonly ["linux/amd64", "linux/arm64"];
96
96
  export declare class FrameworkDockerPublishService {
97
97
  static publishImages(options?: FrameworkDockerPublishOptions): Promise<FrameworkDockerPublishResult>;
98
+ /**
99
+ * Log the Docker CLI in to the framework's registry with `docker.publishToken` from the framework secrets file.
100
+ *
101
+ * Every step that WRITES to the registry calls it itself: the image push, and moving the `latest` alias
102
+ * (`wildo fwk publish all` step 8). A resumed release (`--skipDocker`) skips the push, so an alias move that relied
103
+ * on the push's login ran unauthenticated: on a developer machine an earlier `docker login` hid that, and on a fresh
104
+ * CI runner Docker Hub answered 401 (framework-release run 43278280537, 2026-11-12, #3063).
105
+ *
106
+ * @param frameworkRoot the framework checkout whose secrets file and release config are read
107
+ */
108
+ static loginToRegistry(frameworkRoot: string): Promise<void>;
109
+ /** The login itself; `docker` gives the registry host, and the namespace used as the username when the secrets name none. */
110
+ private static loginWithFrameworkSecrets;
98
111
  private static loadFrameworkConfigOrThrow;
99
112
  private static resolveBuildContract;
100
113
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"framework-docker-publish.service.d.ts","sourceRoot":"","sources":["../../../../src/services/framework/framework-docker-publish.service.ts"],"names":[],"mappings":"AAiBA,iIAAiI;AACjI,eAAO,MAAM,8BAA8B,sCAAsC,CAAC;AAClF,eAAO,MAAM,6BAA6B,qCAAqC,CAAC;A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CAAkC;IAajD;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAmBlC;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAWtF,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAalC,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAItC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAOhC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAe7B,OAAO,CAAC,MAAM,CAAC,gBAAgB;CAShC"}
1
+ {"version":3,"file":"framework-docker-publish.service.d.ts","sourceRoot":"","sources":["../../../../src/services/framework/framework-docker-publish.service.ts"],"names":[],"mappings":"AAiBA,iIAAiI;AACjI,eAAO,MAAM,8BAA8B,sCAAsC,CAAC;AAClF,eAAO,MAAM,6BAA6B,qCAAqC,CAAC;AAChF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,qCAAqC,CAAC;AAChF,kGAAkG;AAClG,eAAO,MAAM,4BAA4B,oCAAoC,CAAC;AAE9E;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,mDAAoD,CAAC;AAalG;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,4BAA4B,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE,CAgBzH;AAED,MAAM,WAAW,6BAA6B;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,kCAAkC;IACjD,SAAS,EAAE,MAA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ertDockerReady();
153
- const secrets = FrameworkReleaseService.loadFrameworkDockerSecrets(resolvedFrameworkRoot);
154
- const publishToken = secrets?.publishToken ?? null;
155
- if (!publishToken) {
156
- throw new Error(`Docker publish requires docker.publishToken in ${FrameworkReleaseService.resolveFrameworkSecretsPath(resolvedFrameworkRoot)}.`);
157
- }
158
- const publishUsername = secrets?.publishUsername ?? frameworkConfig.publish.docker.namespace;
159
- FrameworkDockerPublishService.runDockerLogin(frameworkConfig.publish.docker.registryHost, publishUsername, publishToken);
153
+ FrameworkDockerPublishService.loginWithFrameworkSecrets(resolvedFrameworkRoot, frameworkConfig.publish.docker);
160
154
  for (const target of result.targets) {
161
155
  const configuredTarget = selectedTargets.find((image) => image.imageName === target.imageName);
162
156
  if (!configuredTarget) {
@@ -218,6 +212,29 @@ export class FrameworkDockerPublishService {
218
212
  }
219
213
  return result;
220
214
  }
215
+ /**
216
+ * Log the Docker CLI in to the framework's registry with `docker.publishToken` from the framework secrets file.
217
+ *
218
+ * Every step that WRITES to the registry calls it itself: the image push, and moving the `latest` alias
219
+ * (`wildo fwk publish all` step 8). A resumed release (`--skipDocker`) skips the push, so an alias move that relied
220
+ * on the push's login ran unauthenticated: on a developer machine an earlier `docker login` hid that, and on a fresh
221
+ * CI runner Docker Hub answered 401 (framework-release run 43278280537, 2026-11-12, #3063).
222
+ *
223
+ * @param frameworkRoot the framework checkout whose secrets file and release config are read
224
+ */
225
+ static async loginToRegistry(frameworkRoot) {
226
+ const frameworkConfig = await FrameworkDockerPublishService.loadFrameworkConfigOrThrow(frameworkRoot);
227
+ FrameworkDockerPublishService.loginWithFrameworkSecrets(frameworkRoot, frameworkConfig.publish.docker);
228
+ }
229
+ /** The login itself; `docker` gives the registry host, and the namespace used as the username when the secrets name none. */
230
+ static loginWithFrameworkSecrets(frameworkRoot, docker) {
231
+ const secrets = FrameworkReleaseService.loadFrameworkDockerSecrets(frameworkRoot);
232
+ const publishToken = secrets?.publishToken ?? null;
233
+ if (!publishToken) {
234
+ throw new Error(`Docker publish requires docker.publishToken in ${FrameworkReleaseService.resolveFrameworkSecretsPath(frameworkRoot)}.`);
235
+ }
236
+ FrameworkDockerPublishService.runDockerLogin(docker.registryHost, secrets?.publishUsername ?? docker.namespace, publishToken);
237
+ }
221
238
  static async loadFrameworkConfigOrThrow(frameworkRoot) {
222
239
  const frameworkConfig = await FrameworkReleaseService.loadFrameworkConfig(frameworkRoot);
223
240
  if (!frameworkConfig) {