@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.
- package/dist/src/commands/config/sync.command.d.ts.map +1 -1
- package/dist/src/commands/config/sync.command.js +1 -0
- package/dist/src/commands/config/sync.command.js.map +1 -1
- package/dist/src/commands/context/journey.command.d.ts.map +1 -1
- package/dist/src/commands/context/journey.command.js +8 -0
- package/dist/src/commands/context/journey.command.js.map +1 -1
- package/dist/src/commands/creation/drive.command.d.ts.map +1 -1
- package/dist/src/commands/creation/drive.command.js +2 -0
- package/dist/src/commands/creation/drive.command.js.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.js +8 -0
- package/dist/src/commands/fwk/publish-all.command.js.map +1 -1
- package/dist/src/commands/local/dev.command.d.ts +68 -0
- package/dist/src/commands/local/dev.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev.command.js +216 -8
- package/dist/src/commands/local/dev.command.js.map +1 -1
- package/dist/src/commands/local/doctor.command.d.ts +22 -9
- package/dist/src/commands/local/doctor.command.d.ts.map +1 -1
- package/dist/src/commands/local/doctor.command.js +45 -42
- package/dist/src/commands/local/doctor.command.js.map +1 -1
- package/dist/src/commands/providers/connect.command.d.ts.map +1 -1
- package/dist/src/commands/providers/connect.command.js +11 -1
- package/dist/src/commands/providers/connect.command.js.map +1 -1
- package/dist/src/commands/seal/currency.command.d.ts +13 -0
- package/dist/src/commands/seal/currency.command.d.ts.map +1 -0
- package/dist/src/commands/seal/currency.command.js +52 -0
- package/dist/src/commands/seal/currency.command.js.map +1 -0
- package/dist/src/commands/seal/seal-admin-door.utils.d.ts.map +1 -1
- package/dist/src/commands/seal/seal-admin-door.utils.js +2 -0
- package/dist/src/commands/seal/seal-admin-door.utils.js.map +1 -1
- package/dist/src/commands/seal/verify.command.d.ts +5 -0
- package/dist/src/commands/seal/verify.command.d.ts.map +1 -1
- package/dist/src/commands/seal/verify.command.js +26 -2
- package/dist/src/commands/seal/verify.command.js.map +1 -1
- package/dist/src/services/application/content-guardrail-classifier.service.d.ts +19 -0
- package/dist/src/services/application/content-guardrail-classifier.service.d.ts.map +1 -1
- package/dist/src/services/application/content-guardrail-classifier.service.js +75 -11
- package/dist/src/services/application/content-guardrail-classifier.service.js.map +1 -1
- package/dist/src/services/application/local-provider-doubles.service.d.ts +98 -0
- package/dist/src/services/application/local-provider-doubles.service.d.ts.map +1 -0
- package/dist/src/services/application/local-provider-doubles.service.js +214 -0
- package/dist/src/services/application/local-provider-doubles.service.js.map +1 -0
- package/dist/src/services/application/system-of-record-simulators.service.d.ts +21 -2
- package/dist/src/services/application/system-of-record-simulators.service.d.ts.map +1 -1
- package/dist/src/services/application/system-of-record-simulators.service.js +21 -12
- package/dist/src/services/application/system-of-record-simulators.service.js.map +1 -1
- package/dist/src/services/companion/creation-drive.service.d.ts +32 -2
- package/dist/src/services/companion/creation-drive.service.d.ts.map +1 -1
- package/dist/src/services/companion/creation-drive.service.js +61 -4
- package/dist/src/services/companion/creation-drive.service.js.map +1 -1
- package/dist/src/services/credentials/credentials.schemas.d.ts +6 -0
- package/dist/src/services/credentials/credentials.schemas.d.ts.map +1 -1
- package/dist/src/services/credentials/credentials.schemas.js +7 -1
- package/dist/src/services/credentials/credentials.schemas.js.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.js +11 -3
- package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
- package/dist/src/services/data-services/data-services.schemas.d.ts +9 -0
- package/dist/src/services/data-services/data-services.schemas.d.ts.map +1 -1
- package/dist/src/services/data-services/data-services.schemas.js +9 -0
- package/dist/src/services/data-services/data-services.schemas.js.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js +7 -2
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
- package/dist/src/services/deployment/local-dev-session-lease.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-session-lease.service.js +22 -1
- package/dist/src/services/deployment/local-dev-session-lease.service.js.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.js +1 -0
- package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
- package/dist/src/services/environment/authored-infra-member-authority.d.ts.map +1 -1
- package/dist/src/services/environment/authored-infra-member-authority.js +5 -0
- package/dist/src/services/environment/authored-infra-member-authority.js.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.js +6 -3
- package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.d.ts +6 -0
- package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.js +24 -1
- package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
- package/dist/src/services/environment/environment-hydration.utils.d.ts.map +1 -1
- package/dist/src/services/environment/environment-hydration.utils.js +1 -0
- package/dist/src/services/environment/environment-hydration.utils.js.map +1 -1
- package/dist/src/services/environment/environment.schemas.d.ts +7 -1
- package/dist/src/services/environment/environment.schemas.d.ts.map +1 -1
- package/dist/src/services/environment/environment.schemas.js.map +1 -1
- package/dist/src/services/environment/runtime-bootstrap.service.d.ts +2 -0
- package/dist/src/services/environment/runtime-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/environment/runtime-bootstrap.service.js +4 -0
- package/dist/src/services/environment/runtime-bootstrap.service.js.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.d.ts +13 -0
- package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.js +24 -7
- package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
- package/dist/src/services/registry/provider-connect.service.d.ts +57 -1
- package/dist/src/services/registry/provider-connect.service.d.ts.map +1 -1
- package/dist/src/services/registry/provider-connect.service.js +63 -2
- package/dist/src/services/registry/provider-connect.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +18 -18
- package/scripts/app-dependency-alignment/propagated-engine-overrides.json +1 -1
- package/wildo-framework.info.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.command.js","sourceRoot":"","sources":["../../../../src/commands/local/dev.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAqB,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAW,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAsC,MAAM,6DAA6D,CAAC;AACrI,OAAO,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,wEAAwE,CAAC;AAEvH,OAAO,EAAE,+BAA+B,EAAE,MAAM,oEAAoE,CAAC;AACrH,O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AC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC/B,cAAc,CAAC,GAAG,EAAE;gBAClB,IAAI,QAAQ,CAAC,iBAAiB,KAAK,KAAK;oBAAE,MAAM,EAAE,CAAC;YACrD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/**\n * `wildo local dev` — start everything needed for local development.\n *\n * This is the canonical \"one command, please\" entry point for daily dev work.\n * It owns the full local-dev orchestration so the operator does not have to\n * juggle \"did I start the platform?\", \"is the infra container stack up?\",\n * \"are there orphan tsc-watch processes from last night's session?\" — those\n * questions are answered (and acted on) automatically.\n *\n * # What it does, in order\n *\n * 1. **Exclusive ownership + stale-process cleanup.** Atomically claims the\n * app generation (and, when applicable, the shared framework generation)\n * before it can stop or replace anything. It then reaps only prior local\n * dev process trees whose argv contains an exact selected root path.\n *\n * 2. **Preflight diagnostic.** Runs the Docker-daemon probe plus the shared\n * `wildo local doctor` PRECONDITIONS — Compose plugin version, generated\n * provider-runtime modules, orphaned dev watchers\n * (`services/deployment/local-precondition-checks.service.ts`, which\n * documents the fresh-install failure each one closes). A blocking\n * failure aborts BEFORE any process spawn so the operator sees one\n * precise fix line instead of a cryptic crash minutes later, deep inside\n * the app process. `--skip-doctor` bypasses the step.\n *\n * Doctor's RUNTIME probes (container health, loopback binding,\n * Mongo/Valkey auth, stale credentials) deliberately stay out: they\n * describe a stack this command has not started yet, and step 3 below\n * gates on Compose readiness anyway. Run `wildo local doctor` for those.\n *\n * 3. **Local infrastructure ready.** Self-heal the local runtime artifacts\n * (config.json + the docker-compose manifest + `.env.wildo-platform`)\n * from the authored `wildo.infra.<env>.config.ts` via the same\n * `RuntimeBootstrap.ensureLocalRuntimeArtifacts` preflight `wildo local\n * up` runs — `config.json` written when missing or when its bytes differ\n * from the authored projection (#2311), the compose manifest and\n * `.env.wildo-platform` rendered on every run and written when their content differs — then, if\n * `docker compose ps` shows none of our containers running, bring them\n * up, then block on Compose readiness. Without the preflight a fresh clone (the generated tree is\n * gitignored) hard-fails with \"Docker Compose file not found\".\n * `.env.wildo-platform` still requires `secrets.json`, which only\n * `wildo setup` (or `wildo setup --non-interactive`) mints.\n *\n * 4. **Platform initialization + readiness** (framework-dev mode only).\n * Run the registered, idempotent apps-manager INIT lifecycle against the\n * mounted database, then spawn root `pnpm dev` and wait for apps-manager,\n * crontabs-batches-manager, and module-registry `/health/ready`.\n *\n * 5. **Application registration + materialization.** Reconcile the authored\n * app by stable slug through apps-manager, fetch its current credentials,\n * persist the database-minted application id, and emit every backend,\n * companion, frontend, worker, and minion env target.\n *\n * 6. **App dev stack.** Only after steps 1–5 succeed, spawn `pnpm dev`\n * from the SaaS app root —\n * backend-api + companion + main-app + website + technical-doc + the\n * marketing-scrapper minion + the my-node-worker worker.\n *\n * The worker was added on 2026-09-08 (#426). Until then no local stack\n * started one, so the backend-to-worker chain — the advertised way to move\n * work off the request path — had never run anywhere, and its failure modes\n * would have been discovered by an application author rather than by us.\n *\n * # Output\n *\n * All combined stdout/stderr is tee'd to\n * `<saasRoot>/.wildo-saas/logs/dev-<YYYYMMDD-HHMMSS>.log`. The directory\n * is app-owned (gitignored by the app's `.wildo-saas/`) so logs survive\n * Ctrl-C and can be inspected after a crash. The console still shows\n * the live stream — the tee is an additive capture, not a redirect.\n *\n * Before opening a run's log, the logs of earlier runs are compressed to\n * `.log.gz` and kept 90 days, then expired (`local-dev-log-retention.service.ts`).\n * They are the host archive the assurance evidence collector reads, which reads\n * the compressed form too.\n *\n * # Signals\n *\n * Ctrl-C in this terminal terminates each owned process tree, waits for every\n * child `close` event (the stdout/stderr drain barrier), and only then closes\n * the combined log. The stale-cleanup step at the start of the next invocation\n * remains the recovery path for an unclean parent-process death.\n *\n * # Why \"local dev\" and not \"dev start\"\n *\n * `wildo dev start` exists today but deliberately does NOT start the\n * platform side (`platform-runtime-policy.service.ts::shouldCliStartPlatformServicesNatively`\n * returns false). We don't break that contract — `dev start` remains the\n * app-only orchestrator; `local dev` is the everything orchestrator that\n * additionally owns the platform stack in framework-dev mode.\n *\n * `local dev` lives in `CommandCategory.Local` next to `local up` /\n * `local down` / `local doctor` / `local reset` so the \"everything\n * happening on this machine for this app\" surface is one coherent group,\n * keyed off the SaaS app workspace (NOT the framework checkout). This is\n * the right shape: every SaaS app needs a \"start everything\" verb, not\n * just the dogfood example app. The retired `wildo fwk wt-dev` command\n * (and `scripts/wt/dev.sh`, and the `/wt-dev` slash command) hard-coded\n * Wonder Todos as the target — wrong shape, replaced by this command.\n */\n\nimport chalk from 'chalk';\nimport { execFileSync, execSync, spawn, type ChildProcess } from 'child_process';\nimport { existsSync, mkdirSync, createWriteStream } from 'fs';\nimport { join, resolve } from 'path';\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { WildoDeploymentRuntime, WildoLocationType, WorkspaceScope } from '@wildo-ai/platform-config-lib';\nimport { ContextManager } from '~wildo-cli/services/context/context-manager.service';\nimport { InfrastructureHost, type EnvironmentInfrastructureHost } from '~wildo-cli/services/environment/infrastructure-host.service';\nimport { DockerUtils } from '~wildo-cli/services/deployment/docker/docker.service';\nimport { DockerComposeReadinessService } from '~wildo-cli/services/deployment/docker/docker-compose-readiness.service';\nimport type { BackingServiceHealthWatch } from '~wildo-cli/services/deployment/docker/backing-service-health-watch';\nimport { createBackingServiceHealthWatch } from '~wildo-cli/services/deployment/docker/backing-service-health-watch';\nimport { RuntimeBootstrap } from '~wildo-cli/services/environment/runtime-bootstrap.service';\nimport * as PlatformLifecycle from '~wildo-cli/services/deployment/platform-lifecycle.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { ApplicationRuntimeBootstrapService } from '~wildo-cli/services/application/application-runtime-bootstrap.service';\nimport { LocalRuntimeProcessCleanupService } from '~wildo-cli/services/deployment/local-runtime-process-cleanup.service';\nimport { collectLocalPreconditionChecks } from '~wildo-cli/services/deployment/local-precondition-checks.service';\nimport { CODING_AGENT_SELECTION_ENV_VAR } from '~wildo-cli/services/coding-agents/coding-agent-login.service';\nimport { regenerateUnusableProviderRuntimeModules } from '~wildo-cli/services/application/provider-runtime-sync.service';\nimport {\n DevSchemaDriftOutcome,\n reconcileDevelopmentSchemaDrift,\n} from '~wildo-cli/services/application/dev-schema-drift.service';\nimport { LocalPreconditionCheckStatus } from '~wildo-cli/services/deployment/local-precondition-checks.schemas';\nimport { LocalDevSessionLeaseService, type LocalDevSessionLease,\n SharedPlatformAccess,\n SharedPlatformIntent,\n decideSharedPlatformAccess,\n} from '~wildo-cli/services/deployment/local-dev-session-lease.service';\nimport { SpawnUtils } from '~wildo-cli/infrastructure/process/spawn.utils';\nimport {\n createLocalDevShutdownCoordinator,\n LocalDevShutdownCauseKind,\n type LocalDevShutdownCause,\n} from '~wildo-cli/services/deployment/local-dev-shutdown-coordinator';\nimport { createLocalDevObserverLifecycle, type LocalDevObserverLifecycle } from '~wildo-cli/services/deployment/local-dev-observer-lifecycle';\nimport { LOCAL_DEV_LOG_RETENTION_DAYS, retainLocalDevLogs } from '~wildo-cli/services/deployment/local-dev-log-retention.service';\nimport {\n LocalDevConsoleRendering,\n LocalDevOutputFlowController,\n LocalDevOutputBoundary,\n LocalDevOutputSink,\n LocalDevOutputStream,\n resolveLocalDevConsoleRendering,\n} from '~wildo-cli/services/deployment/local-dev-output-boundary';\n\ninterface SpawnedTree {\n readonly label: string;\n readonly child: ChildProcess;\n readonly exit: Promise<number>;\n readonly affectsStackLifetime: boolean;\n}\n\n/**\n * Shared prefix for the two shutdown causes raised by a lost session lease —\n * the callback that observes the loss, and the branch that acts on it after the\n * coordinator exists. One constant so the operator sees the same sentence\n * whichever of the two wins the race.\n */\nconst LOCAL_DEV_OWNERSHIP_LOST_REASON = 'local development ownership was taken by another session';\n\nexport default class LocalDevCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'local dev',\n description:\n 'Start everything for local development — preflight doctor, kill stale processes, ensure infra, start platform (framework-dev only) + app, tee logs to .wildo-saas/logs/',\n category: CommandCategory.Local,\n minimumScope: WorkspaceScope.SAAS_APP,\n unavailabilityMessage: '`wildo local dev` requires a SaaS app workspace (a directory containing wildo.saas.config.ts).',\n flags: {\n 'skip-doctor': {\n type: 'boolean',\n description: 'Skip the preflight `local doctor` check. Useful when iterating on the orchestrator itself.',\n default: false,\n },\n 'skip-platform': {\n type: 'boolean',\n description: 'Do not start the platform stack even in framework-dev mode (assume it is already running in another terminal).',\n default: false,\n },\n 'kill-only': {\n type: 'boolean',\n description: 'Run the stale-process cleanup step and exit. Does NOT start any process.',\n default: false,\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const devSessionStartedAtMs = Date.now();\n const saasRoot = ctx.cliContext.resolvedHomes.app.declarationRoot;\n if (!saasRoot) {\n ctx.log.error('No targeted app root detected. Navigate to a directory containing wildo.saas.config.ts.');\n return { success: false };\n }\n\n const env = ctx.activeEnv;\n if (!env) {\n ctx.log.error('No active environment. Run `wildo init` first.');\n return { success: false };\n }\n if (env.locationType === WildoLocationType.REMOTE) {\n ctx.log.error('`wildo local dev` is for LOCAL environments only.');\n return { success: false };\n }\n if (env.runtime === WildoDeploymentRuntime.KUBERNETES) {\n ctx.log.error(\n 'K8s orchestration via `wildo local dev` is not implemented yet. Use `wildo dev start` for the app side and start platform pods via your K8s tooling.',\n );\n return { success: false };\n }\n\n // Console log presentation is owned by the authored `logging` infra aspect\n // (`wildo.infra.<env>.config.ts` → `LOG_FORMATTED_CONSOLE_ERRORS`), the same\n // authority `LoggerService` reads at boot. The dev CLI must not add a second,\n // unconfigurable formatter on top of it: an operator who authored\n // `formattedConsoleErrors: false` for a machine-shaped stream keeps seeing\n // that stream in the terminal. The `dev-*.log` capture stays raw JSON either way.\n const consoleRendering = resolveLocalDevConsoleRendering(env.logging?.formattedConsoleErrors);\n\n const frameworkPath = ctx.cliContext.resolvedHomes.framework.repositoryRoot;\n const isFrameworkDeveloper = ctx.preferences?.isFrameworkDeveloper ?? false;\n /*\n * The companion selects its coding agent from `WILDO_CODING_AGENT` (a host decision). A machine\n * that chose one at `wildo init`/`setup` records it as a preference; exporting it here is what makes\n * every process this command starts — the companion among them — dispatch to that agent. An\n * explicit `WILDO_CODING_AGENT` in the operator's shell still wins (#1637).\n */\n const codingAgentPreference = ctx.preferences?.defaults?.codingAgent;\n if (codingAgentPreference && !process.env[CODING_AGENT_SELECTION_ENV_VAR]?.trim()) {\n process.env[CODING_AGENT_SELECTION_ENV_VAR] = codingAgentPreference;\n }\n const skipPlatform = ctx.flags.skipPlatform === true || ctx.flags['skip-platform'] === true;\n const skipDoctor = ctx.flags.skipDoctor === true || ctx.flags['skip-doctor'] === true;\n const killOnly = ctx.flags.killOnly === true || ctx.flags['kill-only'] === true;\n /*\n * Whose infrastructure is this? Read from the AUTHORED descriptor, before any generated artifact is\n * reconciled — a hosted application must never start the platform or converge the shared containers,\n * and deciding that from a stale `config.json` is how the host's containers get recreated.\n */\n let hostedBy: EnvironmentInfrastructureHost | null;\n try {\n hostedBy = await InfrastructureHost.resolveAuthored(saasRoot, env.name);\n } catch (error) {\n ctx.log.error(` Cannot resolve this environment's infrastructure: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n const willStartPlatform = !!frameworkPath && isFrameworkDeveloper && !skipPlatform && hostedBy === null;\n\n ctx.log.info(chalk.cyan('\\n wildo local dev — preparing local development stack\\n'));\n\n let sessionLease: LocalDevSessionLease | null = null;\n let leaseCompromise: Error | null = null;\n let requestShutdown: ((signal: NodeJS.Signals, cause: LocalDevShutdownCause) => Promise<void>) | null = null;\n let readinessAbort: AbortController | null = null;\n // Declared out here, not inside the try, because the `finally` reaps it:\n // its interval would otherwise outlive an early return and hold the\n // event loop open.\n let backingServiceHealthWatch: BackingServiceHealthWatch | null = null;\n let sigintHandler: (() => void) | null = null;\n let sigtermHandler: (() => void) | null = null;\n if (!killOnly) {\n try {\n // Ownership precedes every mutating operation below. A contender must\n // never stop platform services or clean the incumbent's processes\n // before discovering that another session owns this generation.\n sessionLease = LocalDevSessionLeaseService.acquire({\n saasRoot,\n frameworkRoot: frameworkPath,\n ownsPlatform: willStartPlatform,\n onCompromised: (error) => {\n leaseCompromise = error;\n ctx.log.error(` Local development ownership was compromised: ${ErrorUtils.extractErrorMessage(error)}`);\n if (requestShutdown) {\n void requestShutdown('SIGTERM', {\n kind: LocalDevShutdownCauseKind.INTERNAL_FAILURE,\n description: `${LOCAL_DEV_OWNERSHIP_LOST_REASON}: ${ErrorUtils.extractErrorMessage(error)}`,\n });\n }\n },\n });\n } catch (error) {\n ctx.log.error(` Cannot start local development: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n }\n\n try {\n // ─── Step 1: stale-process cleanup ────────────────────────────────\n if (willStartPlatform) {\n // `local reinit` and older lifecycle commands may have started tracked\n // native services directly. Stop those first so the graph-supervised root\n // `pnpm dev` tree remains the sole long-running owner of platform ports.\n try {\n await PlatformLifecycle.stop(env, ctx.log);\n } catch (error) {\n ctx.log.warn(` Could not stop a previously tracked platform lifecycle: ${ErrorUtils.extractErrorMessage(error)}`);\n }\n if (leaseCompromise) return { success: false };\n }\n // An attached app invocation (`--skip-platform`) does not own the shared\n // framework generation. Scoping cleanup to the app root still reaps this\n // app's prior supervisors/runtimes, but cannot select a framework watcher or\n // platform process merely because its argv contains the framework root.\n const cleanupRoots = [saasRoot, ...(willStartPlatform && frameworkPath ? [frameworkPath] : [])];\n let killed: number;\n try {\n killed = await LocalRuntimeProcessCleanupService.stop(cleanupRoots, ctx.log);\n } catch (error) {\n ctx.log.error(` Local process ownership could not be established: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n if (leaseCompromise) return { success: false };\n if (killed > 0) {\n ctx.log.info(` ${chalk.dim(`Killed ${killed} stale process(es) from prior session.`)}\\n`);\n }\n\n if (killOnly) {\n ctx.log.success(' --kill-only complete; no processes started.\\n');\n return { success: true };\n }\n\n // ─── Step 1.5: regenerate provider-runtime modules nobody generated, a reader would refuse, or the declaration has moved past ───\n // Derived from configuration, so a missing, refused or outdated one is repaired rather than refused — see\n // `regenerateUnusableProviderRuntimeModules`. This is what makes \"restart with `wildo local dev`\" apply a provider\n // added to `wildo.saas.config.ts`. Best-effort: the preflight below still reports\n // anything this could not produce, with its own fix.\n try {\n const repair = await regenerateUnusableProviderRuntimeModules(ctx.log, saasRoot, env.name, {\n frameworkPath: ctx.cliContext.resolvedHomes.framework.repositoryRoot ?? null,\n });\n if (repair.missingBefore.length > 0) {\n const repaired = repair.missingBefore.length - repair.missingAfter.length;\n ctx.log.info(` Regenerated ${repaired} of ${repair.missingBefore.length} missing provider-runtime module(s) for environment '${env.name}'.`);\n }\n if (repair.libraryDeclaredIn.length > 0) {\n // The install is the operator's (#2111 review F1). Until the library is installed discovery cannot list its facets,\n // so this start cannot regenerate the modules to include them. Once it is installed, a facet list that leaves it\n // out is behind the declaration, and the next start regenerates it; `wildo config sync` does the same at once,\n // which is the remedy the shipped knowledge names for the backend's \"no facet\" refusal.\n ctx.log.warn(` Declared the system-of-record facet library on ${repair.libraryDeclaredIn.join(', ')}. Run \\`pnpm install\\`, then \\`wildo -y config sync --local --domain env-files\\` to list its facets in the provider-runtime modules, before the backend can read a vendor facet.`);\n }\n if (repair.behindBefore.length > 0) {\n const regenerated = repair.behindBefore.length - repair.behindAfter.length;\n ctx.log.info(\n ` Regenerated ${regenerated} of ${repair.behindBefore.length} provider-runtime artifact(s) the configuration has moved past, for`\n + ` environment '${env.name}': ${repair.behindBefore.map((artifact) => `${artifact.relativePath} (${artifact.differingFields.join(', ')})`).join(', ')}.`,\n );\n }\n if (repair.refusedBefore.length > 0) {\n const repaired = repair.refusedBefore.length - repair.refusedAfter.length;\n ctx.log.info(\n ` Regenerated ${repaired} of ${repair.refusedBefore.length} provider-runtime artifact(s) generated before the framework changed what`\n + ` their readers require, for environment '${env.name}': ${repair.refusedBefore.map((artifact) => artifact.relativePath).join(', ')}.`,\n );\n }\n } catch (error) {\n ctx.log.warn(` Could not check the provider-runtime modules before start: ${ErrorUtils.extractErrorMessage(error)}`);\n }\n\n // ─── Step 2: preflight preconditions (fatal on any `fail`, not only Docker) ───\n if (!skipDoctor) {\n const doctorOk = await this.runPreflightDoctorChecks(ctx);\n if (!doctorOk) {\n ctx.log.error(\n ' Preflight checks failed. See the diagnostic output above; re-run `wildo local doctor` for the full list. Use `--skip-doctor` to bypass.\\n',\n );\n return { success: false };\n }\n }\n\n // ─── Step 3: ensure infrastructure containers ready ───────────────\n // Bootstrap the local runtime artifacts FIRST — `resolveInfraContext` below throws outright\n // when the docker-compose file is absent, and on a fresh checkout (the generated tree is\n // gitignored) NOTHING has rendered it yet. This is the \"delegate to the same code path as\n // `wildo local up`\" this command's docblock promises: `local up` self-heals config.json + the\n // compose manifest + `.env.wildo-platform` from the authored `wildo.infra.<env>.config.ts`\n // (`bootstrapLocalRuntimeArtifacts` → `RuntimeBootstrap.ensureLocalRuntimeArtifacts`), while\n // `local dev` used to skip straight to `docker compose up -d` and hard-fail with\n // \"Docker Compose file not found … Run 'wildo local up'\". That made `local dev` a\n // second-class citizen on any tree that had never run `local up` — a fresh clone, and every\n // unattended/CI VM. Same self-heal, same write policy: `config.json` is written when missing or when\n // it differs from the authored projection, and the compose artifacts are rendered on every run and written\n // when their content differs, so an edited descriptor, secret or template reaches this run (#2311).\n //\n // NOTE the one artifact this canNOT conjure: `.env.wildo-platform` needs `secrets.json`, which\n // only `wildo setup` mints (`wildo setup --non-interactive` for a headless lane). The error\n // raised there says so explicitly.\n const bootstrapped = await this.bootstrapLocalRuntimeArtifacts(ctx, env, saasRoot, frameworkPath, isFrameworkDeveloper);\n if (!bootstrapped) {\n return { success: false };\n }\n if (leaseCompromise) return { success: false };\n\n let infraCtx: ReturnType<typeof ContextManager.resolveInfraContext>;\n try {\n infraCtx = ContextManager.resolveInfraContext(env.name);\n } catch (error) {\n // For a hosted environment this names the host and the command that renders its project.\n ctx.log.error(` ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n let infraRunning = false;\n try {\n const out = DockerUtils.runDockerCompose(infraCtx, ['ps', '-q']);\n infraRunning = out.trim().length > 0;\n } catch {\n infraRunning = false;\n }\n /*\n * ATTACH, never converge, when another session owns the shared platform (issue #50). The\n * backing containers carry shared names, so `docker compose up` from THIS app's generated\n * compose RECREATES them under this app's config — swapping the substrate out from under every\n * process of the owning session (measured 2026-08-25: mongo re-advertised its replica set under\n * the container hostname and valkey re-seeded ACLs; the whole running stack lost its\n * databases). `--skip-platform` skips the platform NODE services but used to walk straight into\n * this convergence. Read-only verification is the only thing an attaching session may do.\n */\n /*\n * Two different reasons to attach rather than converge, and they are not the same question.\n * A HOSTED application's infrastructure belongs to its host whether or not a host session is live;\n * a shared platform owned by another `wildo local dev` session is #1126's decision, which only\n * applies when this application owns its own infrastructure.\n */\n const platformAccess = hostedBy === null\n ? decideSharedPlatformAccess({\n frameworkRoot: frameworkPath,\n saasRoot,\n intent: SharedPlatformIntent.CONVERGE,\n infraRunning,\n })\n : null;\n if (platformAccess?.access === SharedPlatformAccess.REFUSE) {\n ctx.log.error(` ${platformAccess.message}`);\n return { success: false };\n }\n if (hostedBy !== null) {\n /*\n * A HOSTED application always attaches: the containers and the platform are its host's, whether\n * or not a host session is live right now. It verifies, never converges — and refuses to start\n * anything, because the only process that may is the host's.\n */\n if (!infraRunning) {\n ctx.log.error(\n ` This application runs on the infrastructure of ${hostedBy.applicationRoot}, and that infrastructure is not `\n + `running. Start it from the host first: cd ${hostedBy.applicationRoot} && wildo local dev`,\n );\n return { success: false };\n }\n ctx.log.info(\n chalk.cyan(` Attaching to the infrastructure of ${hostedBy.applicationRoot}; infrastructure convergence and the platform `\n + 'lifecycle are the host\\'s.\\n'),\n );\n } else if (platformAccess?.access === SharedPlatformAccess.ATTACH) {\n ctx.log.info(chalk.cyan(` ${platformAccess.message}\\n`));\n } else {\n ctx.log.info(\n infraRunning\n ? ' Local infrastructure is running; verifying readiness...\\n'\n : chalk.cyan(' Local infrastructure is not running. Starting it and waiting for readiness...\\n'),\n );\n try {\n await DockerComposeReadinessService.startAndWait(infraCtx, ctx.log);\n ctx.log.success(' Infrastructure containers are ready.\\n');\n } catch (error) {\n ctx.log.error(` Failed to make infrastructure ready: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n\n // Readiness above is a statement about ONE INSTANT. A backing service\n // can die at any point afterwards and, when its container outlives the\n // service it provides, Docker's `restart:` policy cannot reach it and\n // its healthcheck is wired to nothing — so it stays dead, silently,\n // until the next converge. Measured 2026-09-17: 3.8 hours with malware\n // scanning absent in front of a live application, reported by nothing.\n //\n // Read-only, and started ONLY on the branch that converged the stack:\n // the ATTACH and hosted-by paths declare the platform lifecycle to be\n // the host session's, and two sessions warning about one container is\n // how a warning becomes noise the reader learns to skip.\n backingServiceHealthWatch = createBackingServiceHealthWatch({ infraCtx, log: ctx.log });\n backingServiceHealthWatch.start();\n }\n if (leaseCompromise) return { success: false };\n\n // ─── Step 3.5: reconcile injected framework snapshots (framework-dev only) ───\n // Close the startup-drift window BEFORE any app process spawns. When the\n // engine is consumed from a local checkout via pnpm `file:` injected deps,\n // a new engine dist file added since the last reconcile (e.g. by a parallel\n // session while this stack was down) is absent from the app's hard-linked\n // snapshot until something re-materializes it — and a bare consumer (Astro\n // website, Docusaurus) that boots against the hole hard-exits and, through\n // pnpm's parallel bail, tears the whole stack down. Reconciling here (a\n // millisecond hard-link mirror, no pnpm) guarantees backend-api / website\n // start against a coherent snapshot at t=0. sync-engine.sh performs its own\n // compile-ready-gated reconcile once running; this is the pre-spawn belt.\n // Best-effort: a failure here never blocks dev startup — the sync daemon\n // retries. Only meaningful in framework-dev mode (published-package installs\n // have no injected snapshot to drift).\n //\n // Gate on framework-dev mode ONLY — NOT on `willStartPlatform`. The app stack\n // is started unconditionally below, so it needs a coherent snapshot even when\n // `--skip-platform` is passed (platform already running in another terminal);\n // tying this to the platform flag would silently reintroduce the snapshot drift\n // window for that common flow.\n if (frameworkPath && isFrameworkDeveloper) {\n this.reconcileInjectedSnapshots(ctx, frameworkPath, saasRoot);\n }\n\n // ─── Step 4: prepare log capture ──────────────────────────────────\n const logsDir = join(saasRoot, '.wildo-saas', 'logs');\n mkdirSync(logsDir, { recursive: true });\n // Compress the logs of earlier runs and expire compressed ones past the retention window, BEFORE this\n // run's log exists — so the only logs touched are those of runs that have ended. Best-effort: it reports\n // and never blocks the start (see `local-dev-log-retention.service.ts`).\n const retention = await retainLocalDevLogs(logsDir);\n if (retention.compressed.length > 0 || retention.expired.length > 0) {\n ctx.log.info(` Run logs: ${retention.compressed.length} compressed, ${retention.expired.length} expired (kept ${LOCAL_DEV_LOG_RETENTION_DAYS} days)`);\n }\n for (const failure of retention.failed) ctx.log.warn(` Run log ${failure.name} left as it was: ${failure.reason}`);\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19); // 2026-05-21T09-00-00\n const logFile = join(logsDir, `dev-${timestamp}.log`);\n const logStream = createWriteStream(logFile, { flags: 'a' });\n ctx.log.info(` Logging combined output to ${chalk.dim(logFile)}\\n`);\n\n // ─── Step 5: initialize platform, then start its child tree ──────\n const children: SpawnedTree[] = [];\n\n if (willStartPlatform && frameworkPath) {\n try {\n await PlatformLifecycle.initialize(env, { frameworkPath, skipInit: false }, ctx.log);\n } catch (error) {\n ctx.log.error(` Platform initialization failed: ${ErrorUtils.extractErrorMessage(error)}`);\n await this.closeLogStream(logStream);\n return { success: false };\n }\n\n ctx.log.info(chalk.cyan(' Starting platform stack (apps-manager + crontabs-batches-manager + module-registry)...\\n'));\n children.push(this.spawnTree('platform', frameworkPath, logStream, chalk.blue, consoleRendering));\n } else if (frameworkPath && isFrameworkDeveloper) {\n ctx.log.info(chalk.yellow(' --skip-platform: platform stack NOT started by this command (expected to be already running).\\n'));\n }\n\n let shuttingDown = false;\n let diagnosticsLifecycle: LocalDevObserverLifecycle | null = null;\n let memoryGuardLifecycle: LocalDevObserverLifecycle | null = null;\n const shutdown = createLocalDevShutdownCoordinator({\n getTrees: () => children,\n terminateTree: async (pid, signal) => {\n await SpawnUtils.terminateProcessTree(pid, {\n gracefulSignal: signal,\n forceSignal: 'SIGKILL',\n timeoutMs: 10_000,\n pollIntervalMs: 100,\n });\n },\n closeOutput: () => this.closeLogStream(logStream),\n onShutdownStarted: (signal, cause) => {\n shuttingDown = true;\n readinessAbort?.abort();\n diagnosticsLifecycle?.stop();\n memoryGuardLifecycle?.stop();\n backingServiceHealthWatch?.stop();\n // Name the TRIGGER, not the signal forwarded to the children. Every\n // teardown used to announce itself as \"Received SIGTERM\", so a stack\n // that stopped itself was indistinguishable from one another process\n // had killed.\n ctx.log.info(chalk.yellow(\n cause.kind === LocalDevShutdownCauseKind.OPERATING_SYSTEM_SIGNAL\n ? `\\n Received ${signal}. Shutting down child trees...\\n`\n : `\\n Shutting down child trees — ${cause.description}\\n`,\n ));\n },\n onTreeTerminationStarted: ({ label, child }, signal) => {\n ctx.log.info(` sending ${signal} to ${label} (pid ${child.pid})`);\n },\n onTreeTerminationFailed: ({ label }, error) => {\n ctx.log.warn(` ${label} teardown failed: ${ErrorUtils.extractErrorMessage(error)}`);\n },\n });\n requestShutdown = shutdown;\n if (leaseCompromise) {\n await shutdown('SIGTERM', { kind: LocalDevShutdownCauseKind.INTERNAL_FAILURE, description: LOCAL_DEV_OWNERSHIP_LOST_REASON });\n return { success: false };\n }\n sigintHandler = () => {\n void shutdown('SIGINT', { kind: LocalDevShutdownCauseKind.OPERATING_SYSTEM_SIGNAL });\n };\n sigtermHandler = () => {\n void shutdown('SIGTERM', { kind: LocalDevShutdownCauseKind.OPERATING_SYSTEM_SIGNAL });\n };\n process.once('SIGINT', sigintHandler);\n process.once('SIGTERM', sigtermHandler);\n\n // Start the read-only observer before the platform-readiness barrier. This\n // is the phase most likely to appear \"stuck\" when a framework producer or\n // runtime gate is unhealthy, so starting it after registered-app bootstrap\n // would hide the causal facts until they were no longer needed. Its own\n // exit remains non-fatal, while every early-return shutdown below reaps it.\n if (frameworkPath && isFrameworkDeveloper) {\n diagnosticsLifecycle = createLocalDevObserverLifecycle({\n spawn: () => this.spawnDiagnosticsObserver(frameworkPath, saasRoot, logStream, consoleRendering),\n onGenerationStarted: (generation) => children.push(generation),\n onGenerationEnded: (generation) => {\n const index = children.indexOf(generation);\n if (index >= 0) children.splice(index, 1);\n },\n onRestartScheduled: ({ consecutiveFailures, delayMs }) => {\n ctx.log.warn(\n ` Diagnostics observer unavailable; retry ${consecutiveFailures} in ${Math.round(delayMs / 1000)}s. The development stack continues.`,\n );\n },\n });\n diagnosticsLifecycle.start();\n\n // The machine-wide memory guard (`scripts/dev-orchestrator/dev-memory-guard.mjs`). On a long\n // session the dev stack is steady while Claude Code sessions orphaned by a paused or reloaded\n // VS Code keep running headless with their test runs, until macOS's compressor fills and it\n // starts killing apps (measured 2026-11-06). The guard reaps only trees whose parent is gone\n // AND whose output reaches nobody, never anything under this stack. Several stacks share one\n // active guard through its lock; the others stand by, so this generation never exits on its\n // own and the lifecycle never loops. Non-fatal like the observer above.\n memoryGuardLifecycle = createLocalDevObserverLifecycle({\n spawn: () => this.spawnMemoryGuard(frameworkPath, logStream, consoleRendering),\n onGenerationStarted: (generation) => children.push(generation),\n onGenerationEnded: (generation) => {\n const index = children.indexOf(generation);\n if (index >= 0) children.splice(index, 1);\n },\n onRestartScheduled: ({ consecutiveFailures, delayMs }) => {\n ctx.log.warn(\n ` Memory guard unavailable; retry ${consecutiveFailures} in ${Math.round(delayMs / 1000)}s. The development stack continues.`,\n );\n },\n });\n memoryGuardLifecycle.start();\n }\n\n // ─── Step 6: platform readiness + registered app bootstrap ────────\n //\n // Both audiences. For a framework developer the platform is the child tree started in step 5;\n // for an application creator it is the platform CONTAINERS step 3 converged, answering the\n // same `/health/ready` contract on the same published ports. Until 2026-09-06 this step also\n // required `isFrameworkDeveloper`, so an app-creator `local dev` started application processes\n // that had never been registered and had no `.env`.\n if (frameworkPath) {\n const platformTree = children.find((tree) => tree.label === 'platform');\n readinessAbort = new AbortController();\n if (shuttingDown) readinessAbort.abort();\n if (platformTree) {\n void platformTree.exit.then(() => readinessAbort.abort());\n }\n\n try {\n await PlatformLifecycle.waitForPlatformServicesReady(env, ctx.log, {\n // A platform generation owned by this command must not surface an\n // append-only runtime log left by a prior session. When attaching\n // with --skip-platform, the other owner's older log remains valid\n // evidence and no lower bound is asserted.\n diagnosticEvidenceSinceMs: willStartPlatform ? devSessionStartedAtMs : undefined,\n signal: readinessAbort.signal,\n });\n if (shuttingDown) {\n // A shutdown is already in flight, so the coordinator returns its\n // existing promise and this cause is never reported. Stated anyway:\n // the type requires it, and a future reordering that made this the\n // FIRST call must not silently inherit a wrong reason.\n await shutdown('SIGTERM', {\n kind: LocalDevShutdownCauseKind.INTERNAL_FAILURE,\n description: 'shutdown requested while waiting for platform readiness',\n });\n return { success: false };\n }\n\n const credentials = EnvironmentUtils.loadSecretsJson(env.name);\n if (!credentials) {\n throw new Error(`No secrets for '${env.name}'. Run 'wildo setup' first.`);\n }\n await ApplicationRuntimeBootstrapService.initialize({\n env,\n credentials,\n frameworkPath,\n saasRoot,\n isFrameworkDeveloper,\n log: ctx.log,\n });\n } catch (error) {\n readinessAbort.abort();\n ctx.log.error(` Registered local bootstrap failed: ${ErrorUtils.extractErrorMessage(error)}`);\n await shutdown('SIGTERM', {\n kind: LocalDevShutdownCauseKind.INTERNAL_FAILURE,\n description: `registered local bootstrap failed: ${ErrorUtils.extractErrorMessage(error)}`,\n });\n return { success: false };\n }\n }\n\n // ─── Step 6.5: reconcile the application's PostgreSQL schema with its model ───\n //\n // HERE, and not earlier or later, for three reasons: infrastructure is up (so the database is\n // reachable), the platform has finished bootstrapping (so the application's database exists and\n // is seeded), and the app processes have NOT started — which is the whole point. A migration\n // applied after the backend booted would have been applied behind a process that already read\n // the schema; applied before it, the backend simply comes up correct.\n //\n // Advisory by construction: the service never throws for a drift decision, and only the two\n // outcomes that mean \"a human must read something\" stop the start. Every other outcome —\n // in sync, not adopted, a stale or unavailable model — proceeds, because a diagnostic that can\n // refuse to start a stack over its own uncertainty is worse than the crash it replaces.\n try {\n const drift = await reconcileDevelopmentSchemaDrift({\n ctx,\n saasRoot,\n envName: env.name,\n appliedBy: `wildo local dev:${process.pid}`,\n log: (message) => ctx.log.info(message),\n });\n if (drift.message) {\n const stops = drift.outcome === DevSchemaDriftOutcome.REFUSED\n || drift.outcome === DevSchemaDriftOutcome.GENERATED_NEEDS_REVIEW;\n if (stops) {\n ctx.log.error(` ${drift.message}`);\n // The backend would fail its physical-schema gate seconds from now with a message that\n // names neither the migration nor the command. Stopping here says both.\n await shutdown('SIGTERM', {\n kind: LocalDevShutdownCauseKind.INTERNAL_FAILURE,\n description: `application schema drift needs a human: ${drift.outcome}`,\n });\n return { success: false };\n }\n ctx.log.info(chalk.yellow(` ${drift.message}`));\n }\n } catch (error) {\n // A DEFECT in the check itself, never a drift verdict. Report and continue: the boot gate\n // remains the backstop, and a broken diagnostic must not be why a stack cannot start.\n ctx.log.warn(` Schema-drift check failed to run (continuing): ${ErrorUtils.extractErrorMessage(error)}`);\n }\n\n // ─── Step 7: app processes may start only after bootstrap ─────────\n ctx.log.info(chalk.cyan(` Starting app stack from ${chalk.dim(saasRoot)}...\\n`));\n children.push(this.spawnTree('app', saasRoot, logStream, chalk.green, consoleRendering));\n\n // ─── Step 8: wait for any child to exit, then propagate exit ──────\n const exitCode = await Promise.race(children.filter((tree) => tree.affectsStackLifetime).map((tree) => tree.exit));\n await shutdown('SIGTERM', {\n kind: LocalDevShutdownCauseKind.MANAGED_PROCESS_EXIT,\n description: `a managed process tree exited (code ${exitCode}); tearing down the rest of the stack`,\n });\n\n return { success: exitCode === 0 };\n } finally {\n // The GUARANTEE, distinct from the stop inside the shutdown coordinator.\n // That one runs first so the watch cannot warn about containers while the\n // stack is deliberately being torn down; this one runs on EVERY exit,\n // including the early `return { success: false }` paths between the\n // converge and the child spawn. Its interval would otherwise hold the\n // event loop open and `wildo local dev` would hang instead of exiting.\n // `stop()` is idempotent, so both firing is free.\n backingServiceHealthWatch?.stop();\n if (sigintHandler) process.removeListener('SIGINT', sigintHandler);\n if (sigtermHandler) process.removeListener('SIGTERM', sigtermHandler);\n await sessionLease?.release();\n }\n }\n\n // ────────────────────────────────────────────────────────────────────\n // Helpers\n // ────────────────────────────────────────────────────────────────────\n\n /**\n * Self-heal the local runtime artifacts (config.json, the docker-compose manifest, and\n * `.env.wildo-platform`) from the authored `wildo.infra.<env>.config.ts` before anything reads\n * them. Mirrors `local up`'s preflight of the same name — deliberately the SAME\n * `RuntimeBootstrap.ensureLocalRuntimeArtifacts` entry point rather than a parallel\n * implementation, so the two commands can never drift on write policy.\n *\n * Returns `true` on success, `false` on a logged failure (the caller short-circuits with\n * `success: false`), so a missing `secrets.json` with no `.env.wildo-platform` surfaces as its own actionable\n * message (\"Run 'wildo setup'\") instead of the downstream \"Docker Compose file not found\". With the env file\n * present, the preflight warns and leaves both compose artifacts as they are.\n */\n private async bootstrapLocalRuntimeArtifacts(\n ctx: CommandContext,\n env: NonNullable<CommandContext['activeEnv']>,\n saasRoot: string,\n frameworkPath: string | null,\n isFrameworkDeveloper: boolean,\n ): Promise<boolean> {\n try {\n await RuntimeBootstrap.ensureLocalRuntimeArtifacts({\n env,\n saasRoot,\n frameworkPath,\n isFrameworkDeveloper,\n log: ctx.log,\n });\n return true;\n } catch (err) {\n ctx.log.error(`Failed to bootstrap local runtime artifacts: ${ErrorUtils.extractErrorMessage(err)}`);\n return false;\n }\n }\n\n /**\n * The `local doctor` PRECONDITIONS, run inline before this command spawns or\n * stops anything.\n *\n * The precondition SET comes from `collectLocalPreconditionChecks` — the\n * same function `wildo local doctor` calls — so the two surfaces cannot\n * disagree. This used to be a lone `docker info` while the command docblock\n * promised \"the same checks as `wildo local doctor`\"; the three fresh-install\n * failures that motivated those checks all landed in the gap between the\n * claim and the code.\n *\n * Still run inline rather than by shelling out to `wildo local doctor`: the\n * exit decision has to be tied to SPECIFIC checks (a stale Valkey ACL must\n * not block a startup), and a shell-out would flatten every result into one\n * process exit code. Doctor's RUNTIME probes stay out for the reason given\n * in this command's docblock, step 2.\n *\n * A `fail` aborts (the run cannot succeed); a `warn` is printed and\n * continues (recoverable, and for orphaned watchers step 1 reaped them\n * moments ago). `--skip-doctor` bypasses the whole step, unchanged.\n */\n private async runPreflightDoctorChecks(ctx: CommandContext): Promise<boolean> {\n let blocked = false;\n try {\n execSync('docker info', { stdio: 'pipe' });\n ctx.log.info(' ✓ Docker daemon reachable');\n } catch {\n ctx.log.error(' ✗ Docker daemon is not reachable.');\n ctx.log.error(' fix: Launch Docker Desktop: `open -a Docker`. Then retry.');\n blocked = true;\n }\n\n const results = await collectLocalPreconditionChecks({\n saasRoot: ctx.cliContext.resolvedHomes.app.declarationRoot,\n frameworkPath: ctx.cliContext.resolvedHomes.framework.repositoryRoot,\n isFrameworkDeveloper: ctx.preferences?.isFrameworkDeveloper ?? false,\n codingAgentPreference: ctx.preferences?.defaults?.codingAgent,\n });\n for (const result of results) {\n const detail = result.detail ? ` (${result.detail})` : '';\n if (result.status === LocalPreconditionCheckStatus.PASS) {\n ctx.log.info(` ✓ ${result.name}${detail}`);\n continue;\n }\n if (result.status === LocalPreconditionCheckStatus.WARN) {\n ctx.log.warn(` ⚠ ${result.name}${detail}`);\n } else {\n ctx.log.error(` ✗ ${result.name}${detail}`);\n blocked = true;\n }\n if (result.fix) {\n ctx.log.info(` ${chalk.dim('fix:')} ${result.fix}`);\n }\n }\n\n return !blocked;\n }\n\n /**\n * Hard-link any missing/drifted framework dist file into the app's pnpm\n * `file:`-injected snapshots BEFORE spawning the app stack, so no consumer\n * boots against a snapshot that is missing a newly-added engine file.\n *\n * Delegates to `scripts/dev-orchestrator/dev-wonder-sync-inputs.mjs\n * --reconcile-injected` in the framework checkout — the same file-level\n * reconciler `sync-engine.sh` uses, which converges added/drifted files in\n * milliseconds without a `pnpm install` (and therefore without the\n * partial-materialization / pnpm-11 `--force` hazards). Best-effort: any\n * failure is logged and swallowed so it never blocks `wildo local dev`; the\n * backgrounded sync daemon repairs on its own compile-ready-gated pass.\n */\n private reconcileInjectedSnapshots(ctx: CommandContext, frameworkPath: string, saasRoot: string): void {\n const script = join(frameworkPath, 'scripts', 'dev-orchestrator', 'dev-wonder-sync-inputs.mjs');\n if (!existsSync(script)) {\n // Not a monorepo-checkout layout (or the script moved) — nothing to reconcile.\n return;\n }\n\n ctx.log.info(' Reconciling injected framework snapshots before app start...');\n try {\n // execFileSync (no shell) so app/framework paths never pass through `/bin/sh`\n // interpolation, and a `timeout` upper-bounds the preflight — a hung\n // filesystem must not block `wildo local dev` forever. A timeout throws, which\n // the catch below turns into the same best-effort warning as any other failure.\n const out = execFileSync(process.execPath, [script, '--framework-root', frameworkPath, '--wonder-root', saasRoot, '--reconcile-injected'], {\n encoding: 'utf-8',\n stdio: 'pipe',\n timeout: 60_000,\n });\n const linked = out.split('\\n').filter((line) => line.includes('Reconciled') || line.includes('already mirror'));\n if (linked.length > 0) {\n ctx.log.info(` ${chalk.dim(linked.join('\\n '))}`);\n }\n ctx.log.success(' ✓ Injected snapshots coherent\\n');\n } catch (error) {\n // A reconcile failure at preflight (e.g. a brand-new engine package with no\n // injected root yet, needing pnpm) must NOT block startup — the sync daemon\n // will escalate. Surface it as a warning with the reconciler's own message.\n const detail =\n error instanceof Error && 'stderr' in error && (error as { stderr?: Buffer }).stderr\n ? (error as { stderr: Buffer }).stderr.toString().trim()\n : ErrorUtils.extractErrorMessage(error);\n ctx.log.warn(\n ` ⚠ Snapshot reconcile did not fully converge (continuing; sync daemon will retry):\\n ${chalk.dim(detail.split('\\n').join('\\n '))}\\n`,\n );\n }\n }\n\n private spawnTree(\n label: string,\n cwd: string,\n logStream: NodeJS.WritableStream,\n color: (s: string) => string,\n consoleRendering: LocalDevConsoleRendering,\n ): SpawnedTree {\n const child = spawn('pnpm', ['dev'], {\n cwd,\n env: { ...process.env, FORCE_COLOR: '1' },\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: SpawnUtils.shouldUseProcessGroups(),\n });\n\n return this.observeChild({\n label,\n child,\n logStream,\n color,\n consoleRendering,\n affectsStackLifetime: true,\n });\n }\n\n private spawnDiagnosticsObserver(\n frameworkRoot: string,\n appRoot: string,\n logStream: NodeJS.WritableStream,\n consoleRendering: LocalDevConsoleRendering,\n ): SpawnedTree | null {\n const scriptPath = join(frameworkRoot, 'scripts/dev-orchestrator/local-dev-status.mjs');\n if (!existsSync(scriptPath)) {\n return null;\n }\n const child = spawn(process.execPath, [scriptPath, '--framework-root', frameworkRoot, '--app-root', appRoot, '--watch', '--changes-only'], {\n cwd: frameworkRoot,\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: SpawnUtils.shouldUseProcessGroups(),\n });\n\n return this.observeChild({\n label: 'diagnostics',\n child,\n logStream,\n color: chalk.magenta,\n consoleRendering,\n affectsStackLifetime: false,\n });\n }\n\n /**\n * Starts the framework checkout's memory guard in watch mode: reap disconnected orphans and sample\n * memory every five minutes, printing only reaps and pressure warnings. Absent from an installed\n * CLI (the script is not staged), in which case nothing is started.\n */\n private spawnMemoryGuard(\n frameworkRoot: string,\n logStream: NodeJS.WritableStream,\n consoleRendering: LocalDevConsoleRendering,\n ): SpawnedTree | null {\n const scriptPath = join(frameworkRoot, 'scripts/dev-orchestrator/dev-memory-guard.mjs');\n if (!existsSync(scriptPath)) {\n return null;\n }\n const child = spawn(process.execPath, [scriptPath, '--watch', '300', '--reap', '--sample', '--quiet', '--exit-with-parent'], {\n cwd: frameworkRoot,\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: SpawnUtils.shouldUseProcessGroups(),\n });\n\n return this.observeChild({\n label: 'memory-guard',\n child,\n logStream,\n color: chalk.gray,\n consoleRendering,\n affectsStackLifetime: false,\n });\n }\n\n private observeChild({\n label,\n child,\n logStream,\n color,\n consoleRendering,\n affectsStackLifetime,\n }: {\n label: string;\n child: ChildProcess;\n logStream: NodeJS.WritableStream;\n color: (text: string) => string;\n consoleRendering: LocalDevConsoleRendering;\n affectsStackLifetime: boolean;\n }): SpawnedTree {\n const prefix = color(`[${label}] `);\n const outputBoundary = new LocalDevOutputBoundary({\n label,\n consolePrefix: prefix,\n consoleRendering,\n writeConsole: (text) => process.stdout.write(text),\n writeCapture: (text) => logStream.write(text),\n });\n const outputFlow = new LocalDevOutputFlowController({\n pauseSources: () => {\n child.stdout?.pause();\n child.stderr?.pause();\n },\n resumeSources: () => {\n child.stdout?.resume();\n child.stderr?.resume();\n },\n waitForDrain: (sink) => this.waitForWritableDrain(sink === LocalDevOutputSink.CONSOLE ? process.stdout : logStream),\n });\n child.stdout?.on('data', (chunk: Buffer) => {\n outputFlow.accept(outputBoundary.push(LocalDevOutputStream.STDOUT, chunk));\n });\n child.stderr?.on('data', (chunk: Buffer) => {\n outputFlow.accept(outputBoundary.push(LocalDevOutputStream.STDERR, chunk));\n });\n child.stdout?.once('end', () => {\n outputFlow.accept(outputBoundary.end(LocalDevOutputStream.STDOUT));\n });\n child.stderr?.once('end', () => {\n outputFlow.accept(outputBoundary.end(LocalDevOutputStream.STDERR));\n });\n\n const exit = new Promise<number>((resolveExit) => {\n let settled = false;\n const settle = (code: number): void => {\n if (settled) return;\n settled = true;\n resolveExit(code);\n };\n // `close` fires only after the stdio streams close. Settling on `exit`\n // could let the parent end the capture file while the child's final\n // buffered line was still waiting to be decoded and framed.\n child.once('close', (code, signal) => {\n outputFlow.accept(outputBoundary.end(LocalDevOutputStream.STDOUT));\n outputFlow.accept(outputBoundary.end(LocalDevOutputStream.STDERR));\n void outputFlow.waitForIdle().then(() => {\n const suffix = affectsStackLifetime ? '' : '; development stack continues';\n process.stdout.write(chalk.dim(` ${label} exited (code=${code ?? 'null'}, signal=${signal ?? 'null'}${suffix})\\n`));\n settle(code ?? (signal ? 130 : 1));\n });\n });\n child.once('error', (error) => {\n outputFlow.accept(outputBoundary.end(LocalDevOutputStream.STDOUT));\n outputFlow.accept(outputBoundary.end(LocalDevOutputStream.STDERR));\n void outputFlow.waitForIdle().then(() => {\n process.stderr.write(` ${label} failed to spawn: ${error.message}\\n`);\n settle(1);\n });\n });\n });\n\n return { label, child, exit, affectsStackLifetime };\n }\n\n private closeLogStream(logStream: NodeJS.WritableStream): Promise<void> {\n return new Promise((resolveClose, rejectClose) => {\n logStream.once('finish', resolveClose);\n logStream.once('error', rejectClose);\n logStream.end();\n });\n }\n\n private waitForWritableDrain(stream: NodeJS.WritableStream): Promise<void> {\n const writable = stream as NodeJS.WritableStream & { writableNeedDrain?: boolean };\n if (writable.writableNeedDrain === false) return Promise.resolve();\n return new Promise((resolveDrain) => {\n let settled = false;\n const settle = (): void => {\n if (settled) return;\n settled = true;\n writable.removeListener('drain', settle);\n writable.removeListener('close', settle);\n writable.removeListener('error', settle);\n resolveDrain();\n };\n writable.once('drain', settle);\n writable.once('close', settle);\n writable.once('error', settle);\n queueMicrotask(() => {\n if (writable.writableNeedDrain === false) settle();\n });\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dev.command.js","sourceRoot":"","sources":["../../../../src/commands/local/dev.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8GG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAqB,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAW,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA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,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBACzC,QAAQ,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBACzC,QAAQ,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBACzC,YAAY,EAAE,CAAC;YACjB,CAAC,CAAC;YACF,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC/B,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC/B,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC/B,cAAc,CAAC,GAAG,EAAE;gBAClB,IAAI,QAAQ,CAAC,iBAAiB,KAAK,KAAK;oBAAE,MAAM,EAAE,CAAC;YACrD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/**\n * `wildo local dev` — start everything needed for local development.\n *\n * This is the canonical \"one command, please\" entry point for daily dev work.\n * It owns the full local-dev orchestration so the operator does not have to\n * juggle \"did I start the platform?\", \"is the infra container stack up?\",\n * \"are there orphan tsc-watch processes from last night's session?\" — those\n * questions are answered (and acted on) automatically.\n *\n * # What it does, in order\n *\n * 1. **Exclusive ownership + stale-process cleanup.** Atomically claims the\n * app generation (and, when applicable, the shared framework generation)\n * before it can stop or replace anything. It then reaps only prior local\n * dev process trees whose argv contains an exact selected root path.\n *\n * 2. **Preflight diagnostic.** Runs the Docker-daemon probe plus the shared\n * `wildo local doctor` PRECONDITIONS — Compose plugin version, generated\n * provider-runtime modules, orphaned dev watchers\n * (`services/deployment/local-precondition-checks.service.ts`, which\n * documents the fresh-install failure each one closes). A blocking\n * failure aborts BEFORE any process spawn so the operator sees one\n * precise fix line instead of a cryptic crash minutes later, deep inside\n * the app process. `--skip-doctor` bypasses the step.\n *\n * Doctor's RUNTIME probes (container health, loopback binding,\n * Mongo/Valkey auth, stale credentials) deliberately stay out: they\n * describe a stack this command has not started yet, and step 3 below\n * gates on Compose readiness anyway. Run `wildo local doctor` for those.\n *\n * 3. **Local infrastructure ready.** Self-heal the local runtime artifacts\n * (config.json + the docker-compose manifest + `.env.wildo-platform`)\n * from the authored `wildo.infra.<env>.config.ts` via the same\n * `RuntimeBootstrap.ensureLocalRuntimeArtifacts` preflight `wildo local\n * up` runs — `config.json` written when missing or when its bytes differ\n * from the authored projection (#2311), the compose manifest and\n * `.env.wildo-platform` rendered on every run and written when their content differs — then, if\n * `docker compose ps` shows none of our containers running, bring them\n * up, then block on Compose readiness. Without the preflight a fresh clone (the generated tree is\n * gitignored) hard-fails with \"Docker Compose file not found\".\n * `.env.wildo-platform` still requires `secrets.json`, which only\n * `wildo setup` (or `wildo setup --non-interactive`) mints.\n *\n * 4. **Platform initialization + readiness** (framework-dev mode only).\n * Run the registered, idempotent apps-manager INIT lifecycle against the\n * mounted database, then spawn root `pnpm dev` and wait for apps-manager,\n * crontabs-batches-manager, and module-registry `/health/ready`.\n *\n * 5. **Application registration + materialization.** Reconcile the authored\n * app by stable slug through apps-manager, fetch its current credentials,\n * persist the database-minted application id, and emit every backend,\n * companion, frontend, worker, and minion env target.\n *\n * 6. **App dev stack.** Only after steps 1–5 succeed, spawn `pnpm dev`\n * from the SaaS app root —\n * backend-api + companion + main-app + website + technical-doc + the\n * marketing-scrapper minion + the my-node-worker worker.\n *\n * The worker was added on 2026-09-08 (#426). Until then no local stack\n * started one, so the backend-to-worker chain — the advertised way to move\n * work off the request path — had never run anywhere, and its failure modes\n * would have been discovered by an application author rather than by us.\n *\n * # `--serve-built`: the same stack, without the development fleet (#3696)\n *\n * Steps 1–6 are unchanged; only the two trees differ. Instead of each root's `pnpm dev` (about thirty framework\n * `tsc-watch` processes, a watcher per application package, the dev companion, the workbench and three dev servers),\n * each tree runs `scripts/dev-orchestrator/dev-serve-built.mjs`, which starts the built runtimes through their own\n * `dev:run` with the compile-status gate turned off: the three platform services, then the application's backend,\n * minions and Node workers. `--serve-frontend` adds the interactive frontend's Vite server, for scenarios that drive\n * the browser. The diagnostics observer and the memory guard are not started (both are about the development fleet).\n * It is what the live-stack e2e lanes boot after CI has built every dist: on a 2-vCPU hosted runner the development\n * fleet ran it out of memory, and on the QA VM it spent the first minutes recompiling what CI had just built.\n *\n * # Output\n *\n * All combined stdout/stderr is tee'd to\n * `<saasRoot>/.wildo-saas/logs/dev-<YYYYMMDD-HHMMSS>.log`. The directory\n * is app-owned (gitignored by the app's `.wildo-saas/`) so logs survive\n * Ctrl-C and can be inspected after a crash. The console still shows\n * the live stream — the tee is an additive capture, not a redirect.\n *\n * Before opening a run's log, the logs of earlier runs are compressed to\n * `.log.gz` and kept 90 days, then expired (`local-dev-log-retention.service.ts`).\n * They are the host archive the assurance evidence collector reads, which reads\n * the compressed form too.\n *\n * # Signals\n *\n * Ctrl-C in this terminal terminates each owned process tree, waits for every\n * child `close` event (the stdout/stderr drain barrier), and only then closes\n * the combined log. The stale-cleanup step at the start of the next invocation\n * remains the recovery path for an unclean parent-process death.\n *\n * # Why \"local dev\" and not \"dev start\"\n *\n * `wildo dev start` exists today but deliberately does NOT start the\n * platform side (`platform-runtime-policy.service.ts::shouldCliStartPlatformServicesNatively`\n * returns false). We don't break that contract — `dev start` remains the\n * app-only orchestrator; `local dev` is the everything orchestrator that\n * additionally owns the platform stack in framework-dev mode.\n *\n * `local dev` lives in `CommandCategory.Local` next to `local up` /\n * `local down` / `local doctor` / `local reset` so the \"everything\n * happening on this machine for this app\" surface is one coherent group,\n * keyed off the SaaS app workspace (NOT the framework checkout). This is\n * the right shape: every SaaS app needs a \"start everything\" verb, not\n * just the dogfood example app. The retired `wildo fwk wt-dev` command\n * (and `scripts/wt/dev.sh`, and the `/wt-dev` slash command) hard-coded\n * Wonder Todos as the target — wrong shape, replaced by this command.\n */\n\nimport chalk from 'chalk';\nimport { execFileSync, execSync, spawn, type ChildProcess } from 'child_process';\nimport { existsSync, mkdirSync, createWriteStream } from 'fs';\nimport { join, resolve } from 'path';\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { AppFrontendType, loadSaasConfig, WildoDeploymentRuntime, WildoLocationType, WorkspaceScope } from '@wildo-ai/platform-config-lib';\nimport { ContextManager } from '~wildo-cli/services/context/context-manager.service';\nimport { InfrastructureHost, type EnvironmentInfrastructureHost } from '~wildo-cli/services/environment/infrastructure-host.service';\nimport { DockerUtils } from '~wildo-cli/services/deployment/docker/docker.service';\nimport { DockerComposeReadinessService } from '~wildo-cli/services/deployment/docker/docker-compose-readiness.service';\nimport type { BackingServiceHealthWatch } from '~wildo-cli/services/deployment/docker/backing-service-health-watch';\nimport { createBackingServiceHealthWatch } from '~wildo-cli/services/deployment/docker/backing-service-health-watch';\nimport { RuntimeBootstrap } from '~wildo-cli/services/environment/runtime-bootstrap.service';\nimport * as PlatformLifecycle from '~wildo-cli/services/deployment/platform-lifecycle.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { ApplicationRuntimeBootstrapService } from '~wildo-cli/services/application/application-runtime-bootstrap.service';\nimport { LocalRuntimeProcessCleanupService } from '~wildo-cli/services/deployment/local-runtime-process-cleanup.service';\nimport { collectLocalPreconditionChecks } from '~wildo-cli/services/deployment/local-precondition-checks.service';\nimport { CODING_AGENT_SELECTION_ENV_VAR } from '~wildo-cli/services/coding-agents/coding-agent-login.service';\nimport { regenerateUnusableProviderRuntimeModules } from '~wildo-cli/services/application/provider-runtime-sync.service';\nimport {\n DevSchemaDriftOutcome,\n reconcileDevelopmentSchemaDrift,\n} from '~wildo-cli/services/application/dev-schema-drift.service';\nimport { LocalPreconditionCheckStatus } from '~wildo-cli/services/deployment/local-precondition-checks.schemas';\nimport { LocalDevSessionLeaseService, type LocalDevSessionLease,\n SharedPlatformAccess,\n SharedPlatformIntent,\n decideSharedPlatformAccess,\n} from '~wildo-cli/services/deployment/local-dev-session-lease.service';\nimport { SpawnUtils } from '~wildo-cli/infrastructure/process/spawn.utils';\nimport {\n createLocalDevShutdownCoordinator,\n LocalDevShutdownCauseKind,\n type LocalDevShutdownCause,\n} from '~wildo-cli/services/deployment/local-dev-shutdown-coordinator';\nimport { createLocalDevObserverLifecycle, type LocalDevObserverLifecycle } from '~wildo-cli/services/deployment/local-dev-observer-lifecycle';\nimport {\n isLoopbackPortAnswering,\n LocalProviderDoubleEvent,\n planLocalProviderDoubles,\n resolveLocalProviderDoubleLaunch,\n superviseLocalProviderDouble,\n type LocalProviderDoubleLaunch,\n type LocalProviderDoubleSupervisor,\n} from '~wildo-cli/services/application/local-provider-doubles.service';\nimport { EnvironmentProviderEnvReadingKind, readEnvironmentProviderEnv } from '~wildo-cli/services/application/content-guardrail-classifier.service';\nimport { LOCAL_DEV_LOG_RETENTION_DAYS, retainLocalDevLogs } from '~wildo-cli/services/deployment/local-dev-log-retention.service';\nimport {\n LocalDevConsoleRendering,\n LocalDevOutputFlowController,\n LocalDevOutputBoundary,\n LocalDevOutputSink,\n LocalDevOutputStream,\n resolveLocalDevConsoleRendering,\n} from '~wildo-cli/services/deployment/local-dev-output-boundary';\n\ninterface SpawnedTree {\n readonly label: string;\n readonly child: ChildProcess;\n readonly exit: Promise<number>;\n readonly affectsStackLifetime: boolean;\n}\n\n/**\n * Shared prefix for the two shutdown causes raised by a lost session lease —\n * the callback that observes the loss, and the branch that acts on it after the\n * coordinator exists. One constant so the operator sees the same sentence\n * whichever of the two wins the race.\n */\nconst LOCAL_DEV_OWNERSHIP_LOST_REASON = 'local development ownership was taken by another session';\n\n/** The process one tree of the stack runs: a command and its arguments, spawned in the tree's root. */\nexport interface LocalDevTreeCommand {\n readonly command: string;\n readonly args: readonly string[];\n}\n\n/** The development fleet: each root's own `pnpm dev` (compile watchers, dev servers, supervised runtimes). */\nexport const DEVELOPMENT_TREE_COMMAND: LocalDevTreeCommand = { command: 'pnpm', args: ['dev'] };\n\n/**\n * The two trees `--serve-built` runs through `scripts/dev-orchestrator/dev-serve-built.mjs`. The values are that\n * script's `--tree` vocabulary (`ServedTree` there); a test holds the two to the same members.\n */\nexport enum ServedTreeKind {\n /** The framework root's platform services, each from its built dist. */\n PLATFORM = 'platform',\n /** The application's runtimes (backend, minions, Node workers) from their dists, and on request its interactive frontend. */\n APP = 'app',\n}\n\n/** Where the served-stack script lives, relative to the framework checkout. */\nexport const SERVED_STACK_SCRIPT_PATH = 'scripts/dev-orchestrator/dev-serve-built.mjs';\n\n/**\n * The command a served tree runs instead of `pnpm dev` (#3696): the built runtimes of that tree and nothing that\n * compiles. The script derives WHICH runtimes from the trees' own declarations (the framework root's `dev:run`\n * targets, the application members that declare a `dev:run`) and refuses, before starting anything, a runtime whose\n * dist was never built.\n */\nexport function servedTreeCommand(input: {\n readonly frameworkRoot: string;\n readonly tree: ServedTreeKind;\n readonly appRoot?: string;\n readonly frontendPaths?: readonly string[];\n}): LocalDevTreeCommand {\n const args = [join(input.frameworkRoot, SERVED_STACK_SCRIPT_PATH), '--framework-root', input.frameworkRoot, '--tree', input.tree];\n if (input.tree === ServedTreeKind.APP) {\n if (!input.appRoot) throw new Error('A served application tree needs the application root.');\n args.push('--app-root', input.appRoot);\n for (const frontendPath of input.frontendPaths ?? []) args.push('--frontend', frontendPath);\n }\n return { command: process.execPath, args };\n}\n\n/**\n * Why a `--serve-built` / `--serve-frontend` request cannot be honoured, or `null` when it can.\n *\n * Serving built processes is a FRAMEWORK-DEVELOPER mode: the platform services run from the framework checkout's\n * dists and the application runtimes through the framework's runtime supervisor. An application creator's platform\n * is already the published containers, with no watcher fleet to leave out, so the mode has nothing to change there\n * and refusing says so instead of quietly starting the development fleet.\n */\nexport function refuseServedStackRequest(input: {\n readonly serveBuilt: boolean;\n readonly serveFrontend: boolean;\n readonly frameworkPath: string | null | undefined;\n readonly isFrameworkDeveloper: boolean;\n}): string | null {\n if (input.serveFrontend && !input.serveBuilt) {\n return '--serve-frontend only applies with --serve-built: the development stack already runs every frontend.';\n }\n if (input.serveBuilt && (!input.frameworkPath || !input.isFrameworkDeveloper)) {\n return (\n '--serve-built needs a framework checkout in framework-developer mode: it serves the platform and the application ' +\n 'runtimes from the checkout\\'s built dists. An application-creator stack already runs the published platform images.'\n );\n }\n return null;\n}\n\nexport default class LocalDevCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'local dev',\n description:\n 'Start everything for local development — preflight doctor, kill stale processes, ensure infra, start platform (framework-dev only) + app, tee logs to .wildo-saas/logs/',\n category: CommandCategory.Local,\n minimumScope: WorkspaceScope.SAAS_APP,\n unavailabilityMessage: '`wildo local dev` requires a SaaS app workspace (a directory containing wildo.saas.config.ts).',\n flags: {\n 'skip-doctor': {\n type: 'boolean',\n description: 'Skip the preflight `local doctor` check. Useful when iterating on the orchestrator itself.',\n default: false,\n },\n 'skip-platform': {\n type: 'boolean',\n description: 'Do not start the platform stack even in framework-dev mode (assume it is already running in another terminal).',\n default: false,\n },\n 'kill-only': {\n type: 'boolean',\n description: 'Run the stale-process cleanup step and exit. Does NOT start any process.',\n default: false,\n },\n 'serve-built': {\n type: 'boolean',\n description:\n 'Serve the BUILT stack: the platform services and the application runtimes from their dists, with no compile watcher, companion or dev server. For a live-stack e2e lane, after a full build (framework-dev mode only).',\n default: false,\n },\n 'serve-frontend': {\n type: 'boolean',\n description: 'With --serve-built, also run the interactive frontend\\'s Vite server, for scenarios that drive the browser.',\n default: false,\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const devSessionStartedAtMs = Date.now();\n const saasRoot = ctx.cliContext.resolvedHomes.app.declarationRoot;\n if (!saasRoot) {\n ctx.log.error('No targeted app root detected. Navigate to a directory containing wildo.saas.config.ts.');\n return { success: false };\n }\n\n const env = ctx.activeEnv;\n if (!env) {\n ctx.log.error('No active environment. Run `wildo init` first.');\n return { success: false };\n }\n if (env.locationType === WildoLocationType.REMOTE) {\n ctx.log.error('`wildo local dev` is for LOCAL environments only.');\n return { success: false };\n }\n if (env.runtime === WildoDeploymentRuntime.KUBERNETES) {\n ctx.log.error(\n 'K8s orchestration via `wildo local dev` is not implemented yet. Use `wildo dev start` for the app side and start platform pods via your K8s tooling.',\n );\n return { success: false };\n }\n\n // Console log presentation is owned by the authored `logging` infra aspect\n // (`wildo.infra.<env>.config.ts` → `LOG_FORMATTED_CONSOLE_ERRORS`), the same\n // authority `LoggerService` reads at boot. The dev CLI must not add a second,\n // unconfigurable formatter on top of it: an operator who authored\n // `formattedConsoleErrors: false` for a machine-shaped stream keeps seeing\n // that stream in the terminal. The `dev-*.log` capture stays raw JSON either way.\n const consoleRendering = resolveLocalDevConsoleRendering(env.logging?.formattedConsoleErrors);\n\n const frameworkPath = ctx.cliContext.resolvedHomes.framework.repositoryRoot;\n const isFrameworkDeveloper = ctx.preferences?.isFrameworkDeveloper ?? false;\n /*\n * The companion selects its coding agent from `WILDO_CODING_AGENT` (a host decision). A machine\n * that chose one at `wildo init`/`setup` records it as a preference; exporting it here is what makes\n * every process this command starts — the companion among them — dispatch to that agent. An\n * explicit `WILDO_CODING_AGENT` in the operator's shell still wins (#1637).\n */\n const codingAgentPreference = ctx.preferences?.defaults?.codingAgent;\n if (codingAgentPreference && !process.env[CODING_AGENT_SELECTION_ENV_VAR]?.trim()) {\n process.env[CODING_AGENT_SELECTION_ENV_VAR] = codingAgentPreference;\n }\n const skipPlatform = ctx.flags.skipPlatform === true || ctx.flags['skip-platform'] === true;\n const skipDoctor = ctx.flags.skipDoctor === true || ctx.flags['skip-doctor'] === true;\n const killOnly = ctx.flags.killOnly === true || ctx.flags['kill-only'] === true;\n const serveBuilt = ctx.flags.serveBuilt === true || ctx.flags['serve-built'] === true;\n const serveFrontend = ctx.flags.serveFrontend === true || ctx.flags['serve-frontend'] === true;\n const servedStackRefusal = refuseServedStackRequest({ serveBuilt, serveFrontend, frameworkPath, isFrameworkDeveloper });\n if (servedStackRefusal) {\n ctx.log.error(` ${servedStackRefusal}`);\n return { success: false };\n }\n /*\n * Whose infrastructure is this? Read from the AUTHORED descriptor, before any generated artifact is\n * reconciled — a hosted application must never start the platform or converge the shared containers,\n * and deciding that from a stale `config.json` is how the host's containers get recreated.\n */\n let hostedBy: EnvironmentInfrastructureHost | null;\n try {\n hostedBy = await InfrastructureHost.resolveAuthored(saasRoot, env.name);\n } catch (error) {\n ctx.log.error(` Cannot resolve this environment's infrastructure: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n const willStartPlatform = !!frameworkPath && isFrameworkDeveloper && !skipPlatform && hostedBy === null;\n\n ctx.log.info(chalk.cyan('\\n wildo local dev — preparing local development stack\\n'));\n\n let sessionLease: LocalDevSessionLease | null = null;\n let leaseCompromise: Error | null = null;\n let requestShutdown: ((signal: NodeJS.Signals, cause: LocalDevShutdownCause) => Promise<void>) | null = null;\n let readinessAbort: AbortController | null = null;\n // Declared out here, not inside the try, because the `finally` reaps it:\n // its interval would otherwise outlive an early return and hold the\n // event loop open.\n let backingServiceHealthWatch: BackingServiceHealthWatch | null = null;\n let sigintHandler: (() => void) | null = null;\n let sigtermHandler: (() => void) | null = null;\n if (!killOnly) {\n try {\n // Ownership precedes every mutating operation below. A contender must\n // never stop platform services or clean the incumbent's processes\n // before discovering that another session owns this generation.\n sessionLease = LocalDevSessionLeaseService.acquire({\n saasRoot,\n frameworkRoot: frameworkPath,\n ownsPlatform: willStartPlatform,\n onCompromised: (error) => {\n leaseCompromise = error;\n ctx.log.error(` Local development ownership was compromised: ${ErrorUtils.extractErrorMessage(error)}`);\n if (requestShutdown) {\n void requestShutdown('SIGTERM', {\n kind: LocalDevShutdownCauseKind.INTERNAL_FAILURE,\n description: `${LOCAL_DEV_OWNERSHIP_LOST_REASON}: ${ErrorUtils.extractErrorMessage(error)}`,\n });\n }\n },\n });\n } catch (error) {\n ctx.log.error(` Cannot start local development: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n }\n\n try {\n // ─── Step 1: stale-process cleanup ────────────────────────────────\n if (willStartPlatform) {\n // `local reinit` and older lifecycle commands may have started tracked\n // native services directly. Stop those first so the graph-supervised root\n // `pnpm dev` tree remains the sole long-running owner of platform ports.\n try {\n await PlatformLifecycle.stop(env, ctx.log);\n } catch (error) {\n ctx.log.warn(` Could not stop a previously tracked platform lifecycle: ${ErrorUtils.extractErrorMessage(error)}`);\n }\n if (leaseCompromise) return { success: false };\n }\n // An attached app invocation (`--skip-platform`) does not own the shared\n // framework generation. Scoping cleanup to the app root still reaps this\n // app's prior supervisors/runtimes, but cannot select a framework watcher or\n // platform process merely because its argv contains the framework root.\n const cleanupRoots = [saasRoot, ...(willStartPlatform && frameworkPath ? [frameworkPath] : [])];\n let killed: number;\n try {\n killed = await LocalRuntimeProcessCleanupService.stop(cleanupRoots, ctx.log);\n } catch (error) {\n ctx.log.error(` Local process ownership could not be established: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n if (leaseCompromise) return { success: false };\n if (killed > 0) {\n ctx.log.info(` ${chalk.dim(`Killed ${killed} stale process(es) from prior session.`)}\\n`);\n }\n\n if (killOnly) {\n ctx.log.success(' --kill-only complete; no processes started.\\n');\n return { success: true };\n }\n\n // ─── Step 1.5: regenerate provider-runtime modules nobody generated, a reader would refuse, or the declaration has moved past ───\n // Derived from configuration, so a missing, refused or outdated one is repaired rather than refused — see\n // `regenerateUnusableProviderRuntimeModules`. This is what makes \"restart with `wildo local dev`\" apply a provider\n // added to `wildo.saas.config.ts`. Best-effort: the preflight below still reports\n // anything this could not produce, with its own fix.\n try {\n const repair = await regenerateUnusableProviderRuntimeModules(ctx.log, saasRoot, env.name, {\n frameworkPath: ctx.cliContext.resolvedHomes.framework.repositoryRoot ?? null,\n });\n if (repair.missingBefore.length > 0) {\n const repaired = repair.missingBefore.length - repair.missingAfter.length;\n ctx.log.info(` Regenerated ${repaired} of ${repair.missingBefore.length} missing provider-runtime module(s) for environment '${env.name}'.`);\n }\n if (repair.libraryDeclaredIn.length > 0) {\n // The install is the operator's (#2111 review F1). Until the library is installed discovery cannot list its facets,\n // so this start cannot regenerate the modules to include them. Once it is installed, a facet list that leaves it\n // out is behind the declaration, and the next start regenerates it; `wildo config sync` does the same at once,\n // which is the remedy the shipped knowledge names for the backend's \"no facet\" refusal.\n ctx.log.warn(` Declared the system-of-record facet library on ${repair.libraryDeclaredIn.join(', ')}. Run \\`pnpm install\\`, then \\`wildo -y config sync --local --domain env-files\\` to list its facets in the provider-runtime modules, before the backend can read a vendor facet.`);\n }\n if (repair.behindBefore.length > 0) {\n const regenerated = repair.behindBefore.length - repair.behindAfter.length;\n ctx.log.info(\n ` Regenerated ${regenerated} of ${repair.behindBefore.length} provider-runtime artifact(s) the configuration has moved past, for`\n + ` environment '${env.name}': ${repair.behindBefore.map((artifact) => `${artifact.relativePath} (${artifact.differingFields.join(', ')})`).join(', ')}.`,\n );\n }\n if (repair.refusedBefore.length > 0) {\n const repaired = repair.refusedBefore.length - repair.refusedAfter.length;\n ctx.log.info(\n ` Regenerated ${repaired} of ${repair.refusedBefore.length} provider-runtime artifact(s) generated before the framework changed what`\n + ` their readers require, for environment '${env.name}': ${repair.refusedBefore.map((artifact) => artifact.relativePath).join(', ')}.`,\n );\n }\n } catch (error) {\n ctx.log.warn(` Could not check the provider-runtime modules before start: ${ErrorUtils.extractErrorMessage(error)}`);\n }\n\n // ─── Step 2: preflight preconditions (fatal on any `fail`, not only Docker) ───\n if (!skipDoctor) {\n const doctorOk = await this.runPreflightDoctorChecks(ctx);\n if (!doctorOk) {\n ctx.log.error(\n ' Preflight checks failed. See the diagnostic output above; re-run `wildo local doctor` for the full list. Use `--skip-doctor` to bypass.\\n',\n );\n return { success: false };\n }\n }\n\n // ─── Step 3: ensure infrastructure containers ready ───────────────\n // Bootstrap the local runtime artifacts FIRST — `resolveInfraContext` below throws outright\n // when the docker-compose file is absent, and on a fresh checkout (the generated tree is\n // gitignored) NOTHING has rendered it yet. This is the \"delegate to the same code path as\n // `wildo local up`\" this command's docblock promises: `local up` self-heals config.json + the\n // compose manifest + `.env.wildo-platform` from the authored `wildo.infra.<env>.config.ts`\n // (`bootstrapLocalRuntimeArtifacts` → `RuntimeBootstrap.ensureLocalRuntimeArtifacts`), while\n // `local dev` used to skip straight to `docker compose up -d` and hard-fail with\n // \"Docker Compose file not found … Run 'wildo local up'\". That made `local dev` a\n // second-class citizen on any tree that had never run `local up` — a fresh clone, and every\n // unattended/CI VM. Same self-heal, same write policy: `config.json` is written when missing or when\n // it differs from the authored projection, and the compose artifacts are rendered on every run and written\n // when their content differs, so an edited descriptor, secret or template reaches this run (#2311).\n //\n // NOTE the one artifact this canNOT conjure: `.env.wildo-platform` needs `secrets.json`, which\n // only `wildo setup` mints (`wildo setup --non-interactive` for a headless lane). The error\n // raised there says so explicitly.\n const bootstrapped = await this.bootstrapLocalRuntimeArtifacts(ctx, env, saasRoot, frameworkPath, isFrameworkDeveloper);\n if (!bootstrapped) {\n return { success: false };\n }\n if (leaseCompromise) return { success: false };\n\n let infraCtx: ReturnType<typeof ContextManager.resolveInfraContext>;\n try {\n infraCtx = ContextManager.resolveInfraContext(env.name);\n } catch (error) {\n // For a hosted environment this names the host and the command that renders its project.\n ctx.log.error(` ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n let infraRunning = false;\n try {\n const out = DockerUtils.runDockerCompose(infraCtx, ['ps', '-q']);\n infraRunning = out.trim().length > 0;\n } catch {\n infraRunning = false;\n }\n /*\n * ATTACH, never converge, when another session owns the shared platform (issue #50). The\n * backing containers carry shared names, so `docker compose up` from THIS app's generated\n * compose RECREATES them under this app's config — swapping the substrate out from under every\n * process of the owning session (measured 2026-08-25: mongo re-advertised its replica set under\n * the container hostname and valkey re-seeded ACLs; the whole running stack lost its\n * databases). `--skip-platform` skips the platform NODE services but used to walk straight into\n * this convergence. Read-only verification is the only thing an attaching session may do.\n */\n /*\n * Two different reasons to attach rather than converge, and they are not the same question.\n * A HOSTED application's infrastructure belongs to its host whether or not a host session is live;\n * a shared platform owned by another `wildo local dev` session is #1126's decision, which only\n * applies when this application owns its own infrastructure.\n */\n const platformAccess = hostedBy === null\n ? decideSharedPlatformAccess({\n frameworkRoot: frameworkPath,\n saasRoot,\n intent: SharedPlatformIntent.CONVERGE,\n infraRunning,\n })\n : null;\n if (platformAccess?.access === SharedPlatformAccess.REFUSE) {\n ctx.log.error(` ${platformAccess.message}`);\n return { success: false };\n }\n if (hostedBy !== null) {\n /*\n * A HOSTED application always attaches: the containers and the platform are its host's, whether\n * or not a host session is live right now. It verifies, never converges — and refuses to start\n * anything, because the only process that may is the host's.\n */\n if (!infraRunning) {\n ctx.log.error(\n ` This application runs on the infrastructure of ${hostedBy.applicationRoot}, and that infrastructure is not `\n + `running. Start it from the host first: cd ${hostedBy.applicationRoot} && wildo local dev`,\n );\n return { success: false };\n }\n ctx.log.info(\n chalk.cyan(` Attaching to the infrastructure of ${hostedBy.applicationRoot}; infrastructure convergence and the platform `\n + 'lifecycle are the host\\'s.\\n'),\n );\n } else if (platformAccess?.access === SharedPlatformAccess.ATTACH) {\n ctx.log.info(chalk.cyan(` ${platformAccess.message}\\n`));\n } else {\n ctx.log.info(\n infraRunning\n ? ' Local infrastructure is running; verifying readiness...\\n'\n : chalk.cyan(' Local infrastructure is not running. Starting it and waiting for readiness...\\n'),\n );\n try {\n await DockerComposeReadinessService.startAndWait(infraCtx, ctx.log);\n ctx.log.success(' Infrastructure containers are ready.\\n');\n } catch (error) {\n ctx.log.error(` Failed to make infrastructure ready: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n\n // Readiness above is a statement about ONE INSTANT. A backing service\n // can die at any point afterwards and, when its container outlives the\n // service it provides, Docker's `restart:` policy cannot reach it and\n // its healthcheck is wired to nothing — so it stays dead, silently,\n // until the next converge. Measured 2026-09-17: 3.8 hours with malware\n // scanning absent in front of a live application, reported by nothing.\n //\n // Read-only, and started ONLY on the branch that converged the stack:\n // the ATTACH and hosted-by paths declare the platform lifecycle to be\n // the host session's, and two sessions warning about one container is\n // how a warning becomes noise the reader learns to skip.\n backingServiceHealthWatch = createBackingServiceHealthWatch({ infraCtx, log: ctx.log });\n backingServiceHealthWatch.start();\n }\n if (leaseCompromise) return { success: false };\n\n // ─── Step 3.5: reconcile injected framework snapshots (framework-dev only) ───\n // Close the startup-drift window BEFORE any app process spawns. When the\n // engine is consumed from a local checkout via pnpm `file:` injected deps,\n // a new engine dist file added since the last reconcile (e.g. by a parallel\n // session while this stack was down) is absent from the app's hard-linked\n // snapshot until something re-materializes it — and a bare consumer (Astro\n // website, Docusaurus) that boots against the hole hard-exits and, through\n // pnpm's parallel bail, tears the whole stack down. Reconciling here (a\n // millisecond hard-link mirror, no pnpm) guarantees backend-api / website\n // start against a coherent snapshot at t=0. sync-engine.sh performs its own\n // compile-ready-gated reconcile once running; this is the pre-spawn belt.\n // Best-effort: a failure here never blocks dev startup — the sync daemon\n // retries. Only meaningful in framework-dev mode (published-package installs\n // have no injected snapshot to drift).\n //\n // Gate on framework-dev mode ONLY — NOT on `willStartPlatform`. The app stack\n // is started unconditionally below, so it needs a coherent snapshot even when\n // `--skip-platform` is passed (platform already running in another terminal);\n // tying this to the platform flag would silently reintroduce the snapshot drift\n // window for that common flow.\n if (frameworkPath && isFrameworkDeveloper) {\n this.reconcileInjectedSnapshots(ctx, frameworkPath, saasRoot);\n }\n\n // ─── Step 4: prepare log capture ──────────────────────────────────\n const logsDir = join(saasRoot, '.wildo-saas', 'logs');\n mkdirSync(logsDir, { recursive: true });\n // Compress the logs of earlier runs and expire compressed ones past the retention window, BEFORE this\n // run's log exists — so the only logs touched are those of runs that have ended. Best-effort: it reports\n // and never blocks the start (see `local-dev-log-retention.service.ts`).\n const retention = await retainLocalDevLogs(logsDir);\n if (retention.compressed.length > 0 || retention.expired.length > 0) {\n ctx.log.info(` Run logs: ${retention.compressed.length} compressed, ${retention.expired.length} expired (kept ${LOCAL_DEV_LOG_RETENTION_DAYS} days)`);\n }\n for (const failure of retention.failed) ctx.log.warn(` Run log ${failure.name} left as it was: ${failure.reason}`);\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19); // 2026-05-21T09-00-00\n const logFile = join(logsDir, `dev-${timestamp}.log`);\n const logStream = createWriteStream(logFile, { flags: 'a' });\n ctx.log.info(` Logging combined output to ${chalk.dim(logFile)}\\n`);\n\n // ─── Step 5: initialize platform, then start its child tree ──────\n const children: SpawnedTree[] = [];\n\n if (willStartPlatform && frameworkPath) {\n try {\n await PlatformLifecycle.initialize(env, { frameworkPath, skipInit: false }, ctx.log);\n } catch (error) {\n ctx.log.error(` Platform initialization failed: ${ErrorUtils.extractErrorMessage(error)}`);\n await this.closeLogStream(logStream);\n return { success: false };\n }\n\n ctx.log.info(\n chalk.cyan(\n serveBuilt\n ? ' Serving the built platform services (no compile watchers)...\\n'\n : ' Starting platform stack (apps-manager + crontabs-batches-manager + module-registry)...\\n',\n ),\n );\n children.push(\n this.spawnTree(\n 'platform',\n frameworkPath,\n serveBuilt ? servedTreeCommand({ frameworkRoot: frameworkPath, tree: ServedTreeKind.PLATFORM }) : DEVELOPMENT_TREE_COMMAND,\n logStream,\n chalk.blue,\n consoleRendering,\n ),\n );\n } else if (frameworkPath && isFrameworkDeveloper) {\n ctx.log.info(chalk.yellow(' --skip-platform: platform stack NOT started by this command (expected to be already running).\\n'));\n }\n\n let shuttingDown = false;\n let diagnosticsLifecycle: LocalDevObserverLifecycle | null = null;\n let memoryGuardLifecycle: LocalDevObserverLifecycle | null = null;\n const providerDoubleSupervisors: LocalProviderDoubleSupervisor[] = [];\n const shutdown = createLocalDevShutdownCoordinator({\n getTrees: () => children,\n terminateTree: async (pid, signal) => {\n await SpawnUtils.terminateProcessTree(pid, {\n gracefulSignal: signal,\n forceSignal: 'SIGKILL',\n timeoutMs: 10_000,\n pollIntervalMs: 100,\n });\n },\n closeOutput: () => this.closeLogStream(logStream),\n onShutdownStarted: (signal, cause) => {\n shuttingDown = true;\n readinessAbort?.abort();\n diagnosticsLifecycle?.stop();\n memoryGuardLifecycle?.stop();\n for (const supervisor of providerDoubleSupervisors) supervisor.stop();\n backingServiceHealthWatch?.stop();\n // Name the TRIGGER, not the signal forwarded to the children. Every\n // teardown used to announce itself as \"Received SIGTERM\", so a stack\n // that stopped itself was indistinguishable from one another process\n // had killed.\n ctx.log.info(chalk.yellow(\n cause.kind === LocalDevShutdownCauseKind.OPERATING_SYSTEM_SIGNAL\n ? `\\n Received ${signal}. Shutting down child trees...\\n`\n : `\\n Shutting down child trees — ${cause.description}\\n`,\n ));\n },\n onTreeTerminationStarted: ({ label, child }, signal) => {\n ctx.log.info(` sending ${signal} to ${label} (pid ${child.pid})`);\n },\n onTreeTerminationFailed: ({ label }, error) => {\n ctx.log.warn(` ${label} teardown failed: ${ErrorUtils.extractErrorMessage(error)}`);\n },\n });\n requestShutdown = shutdown;\n if (leaseCompromise) {\n await shutdown('SIGTERM', { kind: LocalDevShutdownCauseKind.INTERNAL_FAILURE, description: LOCAL_DEV_OWNERSHIP_LOST_REASON });\n return { success: false };\n }\n sigintHandler = () => {\n void shutdown('SIGINT', { kind: LocalDevShutdownCauseKind.OPERATING_SYSTEM_SIGNAL });\n };\n sigtermHandler = () => {\n void shutdown('SIGTERM', { kind: LocalDevShutdownCauseKind.OPERATING_SYSTEM_SIGNAL });\n };\n process.once('SIGINT', sigintHandler);\n process.once('SIGTERM', sigtermHandler);\n\n // Start the read-only observer before the platform-readiness barrier. This\n // is the phase most likely to appear \"stuck\" when a framework producer or\n // runtime gate is unhealthy, so starting it after registered-app bootstrap\n // would hide the causal facts until they were no longer needed. Its own\n // exit remains non-fatal, while every early-return shutdown below reaps it.\n // Not for a served stack: the observer reports compile status and watcher facts, which nothing in that mode\n // produces (every runtime would read as blocked by a missing compile status), and the memory guard reaps\n // orphaned development sessions on a developer's machine, which a CI VM does not have.\n if (frameworkPath && isFrameworkDeveloper && !serveBuilt) {\n diagnosticsLifecycle = createLocalDevObserverLifecycle({\n spawn: () => this.spawnDiagnosticsObserver(frameworkPath, saasRoot, logStream, consoleRendering),\n onGenerationStarted: (generation) => children.push(generation),\n onGenerationEnded: (generation) => {\n const index = children.indexOf(generation);\n if (index >= 0) children.splice(index, 1);\n },\n onRestartScheduled: ({ consecutiveFailures, delayMs }) => {\n ctx.log.warn(\n ` Diagnostics observer unavailable; retry ${consecutiveFailures} in ${Math.round(delayMs / 1000)}s. The development stack continues.`,\n );\n },\n });\n diagnosticsLifecycle.start();\n\n // The machine-wide memory guard (`scripts/dev-orchestrator/dev-memory-guard.mjs`). On a long\n // session the dev stack is steady while Claude Code sessions orphaned by a paused or reloaded\n // VS Code keep running headless with their test runs, until macOS's compressor fills and it\n // starts killing apps (measured 2026-11-06). The guard reaps only trees whose parent is gone\n // AND whose output reaches nobody, never anything under this stack. Several stacks share one\n // active guard through its lock; the others stand by, so this generation never exits on its\n // own and the lifecycle never loops. Non-fatal like the observer above.\n memoryGuardLifecycle = createLocalDevObserverLifecycle({\n spawn: () => this.spawnMemoryGuard(frameworkPath, logStream, consoleRendering),\n onGenerationStarted: (generation) => children.push(generation),\n onGenerationEnded: (generation) => {\n const index = children.indexOf(generation);\n if (index >= 0) children.splice(index, 1);\n },\n onRestartScheduled: ({ consecutiveFailures, delayMs }) => {\n ctx.log.warn(\n ` Memory guard unavailable; retry ${consecutiveFailures} in ${Math.round(delayMs / 1000)}s. The development stack continues.`,\n );\n },\n });\n memoryGuardLifecycle.start();\n }\n\n // ─── Step 6: platform readiness + registered app bootstrap ────────\n //\n // Both audiences. For a framework developer the platform is the child tree started in step 5;\n // for an application creator it is the platform CONTAINERS step 3 converged, answering the\n // same `/health/ready` contract on the same published ports. Until 2026-09-06 this step also\n // required `isFrameworkDeveloper`, so an app-creator `local dev` started application processes\n // that had never been registered and had no `.env`.\n if (frameworkPath) {\n const platformTree = children.find((tree) => tree.label === 'platform');\n readinessAbort = new AbortController();\n if (shuttingDown) readinessAbort.abort();\n if (platformTree) {\n void platformTree.exit.then(() => readinessAbort.abort());\n }\n\n try {\n await PlatformLifecycle.waitForPlatformServicesReady(env, ctx.log, {\n // A platform generation owned by this command must not surface an\n // append-only runtime log left by a prior session. When attaching\n // with --skip-platform, the other owner's older log remains valid\n // evidence and no lower bound is asserted.\n diagnosticEvidenceSinceMs: willStartPlatform ? devSessionStartedAtMs : undefined,\n signal: readinessAbort.signal,\n });\n if (shuttingDown) {\n // A shutdown is already in flight, so the coordinator returns its\n // existing promise and this cause is never reported. Stated anyway:\n // the type requires it, and a future reordering that made this the\n // FIRST call must not silently inherit a wrong reason.\n await shutdown('SIGTERM', {\n kind: LocalDevShutdownCauseKind.INTERNAL_FAILURE,\n description: 'shutdown requested while waiting for platform readiness',\n });\n return { success: false };\n }\n\n const credentials = EnvironmentUtils.loadSecretsJson(env.name);\n if (!credentials) {\n throw new Error(`No secrets for '${env.name}'. Run 'wildo setup' first.`);\n }\n await ApplicationRuntimeBootstrapService.initialize({\n env,\n credentials,\n frameworkPath,\n saasRoot,\n isFrameworkDeveloper,\n log: ctx.log,\n });\n } catch (error) {\n readinessAbort.abort();\n ctx.log.error(` Registered local bootstrap failed: ${ErrorUtils.extractErrorMessage(error)}`);\n await shutdown('SIGTERM', {\n kind: LocalDevShutdownCauseKind.INTERNAL_FAILURE,\n description: `registered local bootstrap failed: ${ErrorUtils.extractErrorMessage(error)}`,\n });\n return { success: false };\n }\n }\n\n // ─── Step 6.5: reconcile the application's PostgreSQL schema with its model ───\n //\n // HERE, and not earlier or later, for three reasons: infrastructure is up (so the database is\n // reachable), the platform has finished bootstrapping (so the application's database exists and\n // is seeded), and the app processes have NOT started — which is the whole point. A migration\n // applied after the backend booted would have been applied behind a process that already read\n // the schema; applied before it, the backend simply comes up correct.\n //\n // Advisory by construction: the service never throws for a drift decision, and only the two\n // outcomes that mean \"a human must read something\" stop the start. Every other outcome —\n // in sync, not adopted, a stale or unavailable model — proceeds, because a diagnostic that can\n // refuse to start a stack over its own uncertainty is worse than the crash it replaces.\n try {\n const drift = await reconcileDevelopmentSchemaDrift({\n ctx,\n saasRoot,\n envName: env.name,\n appliedBy: `wildo local dev:${process.pid}`,\n log: (message) => ctx.log.info(message),\n });\n if (drift.message) {\n const stops = drift.outcome === DevSchemaDriftOutcome.REFUSED\n || drift.outcome === DevSchemaDriftOutcome.GENERATED_NEEDS_REVIEW;\n if (stops) {\n ctx.log.error(` ${drift.message}`);\n // The backend would fail its physical-schema gate seconds from now with a message that\n // names neither the migration nor the command. Stopping here says both.\n await shutdown('SIGTERM', {\n kind: LocalDevShutdownCauseKind.INTERNAL_FAILURE,\n description: `application schema drift needs a human: ${drift.outcome}`,\n });\n return { success: false };\n }\n ctx.log.info(chalk.yellow(` ${drift.message}`));\n }\n } catch (error) {\n // A DEFECT in the check itself, never a drift verdict. Report and continue: the boot gate\n // remains the backstop, and a broken diagnostic must not be why a stack cannot start.\n ctx.log.warn(` Schema-drift check failed to run (continuing): ${ErrorUtils.extractErrorMessage(error)}`);\n }\n\n // ─── Step 6.75: the local doubles the application's secrets point at ───\n //\n // Both audiences, and before the app processes, so a guarded agent's first turn finds its classifier. A provider\n // whose LOCAL host slot names this machine is served by a simulators double; until this step that double was\n // started by hand and was gone after every reboot, so every guarded agent reply was withheld as\n // OUTPUT_NOT_MODERATED. Non-fatal like the observers: a double that cannot start is reported and the stack runs.\n if (!shuttingDown) {\n await this.startLocalProviderDoubles({\n ctx,\n envName: env.name,\n saasRoot,\n frameworkRoot: frameworkPath ?? null,\n logStream,\n consoleRendering,\n children,\n supervisors: providerDoubleSupervisors,\n });\n }\n\n // ─── Step 7: app processes may start only after bootstrap ─────────\n let appTreeCommand = DEVELOPMENT_TREE_COMMAND;\n if (serveBuilt && frameworkPath) {\n let frontendPaths: string[] = [];\n if (serveFrontend) {\n try {\n frontendPaths = await this.interactiveFrontendPaths(saasRoot);\n if (frontendPaths.length === 0) {\n throw new Error('wildo.saas.config.ts declares no service with frontendType SAAS_APP, so there is no frontend to serve');\n }\n } catch (error) {\n ctx.log.error(` Cannot read the application's interactive frontends: ${ErrorUtils.extractErrorMessage(error)}`);\n await shutdown('SIGTERM', {\n kind: LocalDevShutdownCauseKind.INTERNAL_FAILURE,\n description: 'the interactive frontends to serve could not be read',\n });\n return { success: false };\n }\n }\n appTreeCommand = servedTreeCommand({ frameworkRoot: frameworkPath, tree: ServedTreeKind.APP, appRoot: saasRoot, frontendPaths });\n ctx.log.info(chalk.cyan(` Serving the built app stack from ${chalk.dim(saasRoot)} (no compile watchers)...\\n`));\n } else {\n ctx.log.info(chalk.cyan(` Starting app stack from ${chalk.dim(saasRoot)}...\\n`));\n }\n children.push(this.spawnTree('app', saasRoot, appTreeCommand, logStream, chalk.green, consoleRendering));\n\n // ─── Step 8: wait for any child to exit, then propagate exit ──────\n const exitCode = await Promise.race(children.filter((tree) => tree.affectsStackLifetime).map((tree) => tree.exit));\n await shutdown('SIGTERM', {\n kind: LocalDevShutdownCauseKind.MANAGED_PROCESS_EXIT,\n description: `a managed process tree exited (code ${exitCode}); tearing down the rest of the stack`,\n });\n\n return { success: exitCode === 0 };\n } finally {\n // The GUARANTEE, distinct from the stop inside the shutdown coordinator.\n // That one runs first so the watch cannot warn about containers while the\n // stack is deliberately being torn down; this one runs on EVERY exit,\n // including the early `return { success: false }` paths between the\n // converge and the child spawn. Its interval would otherwise hold the\n // event loop open and `wildo local dev` would hang instead of exiting.\n // `stop()` is idempotent, so both firing is free.\n backingServiceHealthWatch?.stop();\n if (sigintHandler) process.removeListener('SIGINT', sigintHandler);\n if (sigtermHandler) process.removeListener('SIGTERM', sigtermHandler);\n await sessionLease?.release();\n }\n }\n\n // ────────────────────────────────────────────────────────────────────\n // Helpers\n // ────────────────────────────────────────────────────────────────────\n\n /**\n * Self-heal the local runtime artifacts (config.json, the docker-compose manifest, and\n * `.env.wildo-platform`) from the authored `wildo.infra.<env>.config.ts` before anything reads\n * them. Mirrors `local up`'s preflight of the same name — deliberately the SAME\n * `RuntimeBootstrap.ensureLocalRuntimeArtifacts` entry point rather than a parallel\n * implementation, so the two commands can never drift on write policy.\n *\n * Returns `true` on success, `false` on a logged failure (the caller short-circuits with\n * `success: false`), so a missing `secrets.json` with no `.env.wildo-platform` surfaces as its own actionable\n * message (\"Run 'wildo setup'\") instead of the downstream \"Docker Compose file not found\". With the env file\n * present, the preflight warns and leaves both compose artifacts as they are.\n */\n private async bootstrapLocalRuntimeArtifacts(\n ctx: CommandContext,\n env: NonNullable<CommandContext['activeEnv']>,\n saasRoot: string,\n frameworkPath: string | null,\n isFrameworkDeveloper: boolean,\n ): Promise<boolean> {\n try {\n await RuntimeBootstrap.ensureLocalRuntimeArtifacts({\n env,\n saasRoot,\n frameworkPath,\n isFrameworkDeveloper,\n log: ctx.log,\n });\n return true;\n } catch (err) {\n ctx.log.error(`Failed to bootstrap local runtime artifacts: ${ErrorUtils.extractErrorMessage(err)}`);\n return false;\n }\n }\n\n /**\n * The `local doctor` PRECONDITIONS, run inline before this command spawns or\n * stops anything.\n *\n * The precondition SET comes from `collectLocalPreconditionChecks` — the\n * same function `wildo local doctor` calls — so the two surfaces cannot\n * disagree. This used to be a lone `docker info` while the command docblock\n * promised \"the same checks as `wildo local doctor`\"; the three fresh-install\n * failures that motivated those checks all landed in the gap between the\n * claim and the code.\n *\n * Still run inline rather than by shelling out to `wildo local doctor`: the\n * exit decision has to be tied to SPECIFIC checks (a stale Valkey ACL must\n * not block a startup), and a shell-out would flatten every result into one\n * process exit code. Doctor's RUNTIME probes stay out for the reason given\n * in this command's docblock, step 2.\n *\n * A `fail` aborts (the run cannot succeed); a `warn` is printed and\n * continues (recoverable, and for orphaned watchers step 1 reaped them\n * moments ago). `--skip-doctor` bypasses the whole step, unchanged.\n */\n private async runPreflightDoctorChecks(ctx: CommandContext): Promise<boolean> {\n let blocked = false;\n try {\n execSync('docker info', { stdio: 'pipe' });\n ctx.log.info(' ✓ Docker daemon reachable');\n } catch {\n ctx.log.error(' ✗ Docker daemon is not reachable.');\n ctx.log.error(' fix: Launch Docker Desktop: `open -a Docker`. Then retry.');\n blocked = true;\n }\n\n const results = await collectLocalPreconditionChecks({\n saasRoot: ctx.cliContext.resolvedHomes.app.declarationRoot,\n frameworkPath: ctx.cliContext.resolvedHomes.framework.repositoryRoot,\n isFrameworkDeveloper: ctx.preferences?.isFrameworkDeveloper ?? false,\n codingAgentPreference: ctx.preferences?.defaults?.codingAgent,\n });\n for (const result of results) {\n const detail = result.detail ? ` (${result.detail})` : '';\n if (result.status === LocalPreconditionCheckStatus.PASS) {\n ctx.log.info(` ✓ ${result.name}${detail}`);\n continue;\n }\n if (result.status === LocalPreconditionCheckStatus.WARN) {\n ctx.log.warn(` ⚠ ${result.name}${detail}`);\n } else {\n ctx.log.error(` ✗ ${result.name}${detail}`);\n blocked = true;\n }\n if (result.fix) {\n ctx.log.info(` ${chalk.dim('fix:')} ${result.fix}`);\n }\n }\n\n return !blocked;\n }\n\n /**\n * Hard-link any missing/drifted framework dist file into the app's pnpm\n * `file:`-injected snapshots BEFORE spawning the app stack, so no consumer\n * boots against a snapshot that is missing a newly-added engine file.\n *\n * Delegates to `scripts/dev-orchestrator/dev-wonder-sync-inputs.mjs\n * --reconcile-injected` in the framework checkout — the same file-level\n * reconciler `sync-engine.sh` uses, which converges added/drifted files in\n * milliseconds without a `pnpm install` (and therefore without the\n * partial-materialization / pnpm-11 `--force` hazards). Best-effort: any\n * failure is logged and swallowed so it never blocks `wildo local dev`; the\n * backgrounded sync daemon repairs on its own compile-ready-gated pass.\n */\n private reconcileInjectedSnapshots(ctx: CommandContext, frameworkPath: string, saasRoot: string): void {\n const script = join(frameworkPath, 'scripts', 'dev-orchestrator', 'dev-wonder-sync-inputs.mjs');\n if (!existsSync(script)) {\n // Not a monorepo-checkout layout (or the script moved) — nothing to reconcile.\n return;\n }\n\n ctx.log.info(' Reconciling injected framework snapshots before app start...');\n try {\n // execFileSync (no shell) so app/framework paths never pass through `/bin/sh`\n // interpolation, and a `timeout` upper-bounds the preflight — a hung\n // filesystem must not block `wildo local dev` forever. A timeout throws, which\n // the catch below turns into the same best-effort warning as any other failure.\n const out = execFileSync(process.execPath, [script, '--framework-root', frameworkPath, '--wonder-root', saasRoot, '--reconcile-injected'], {\n encoding: 'utf-8',\n stdio: 'pipe',\n timeout: 60_000,\n });\n const linked = out.split('\\n').filter((line) => line.includes('Reconciled') || line.includes('already mirror'));\n if (linked.length > 0) {\n ctx.log.info(` ${chalk.dim(linked.join('\\n '))}`);\n }\n ctx.log.success(' ✓ Injected snapshots coherent\\n');\n } catch (error) {\n // A reconcile failure at preflight (e.g. a brand-new engine package with no\n // injected root yet, needing pnpm) must NOT block startup — the sync daemon\n // will escalate. Surface it as a warning with the reconciler's own message.\n const detail =\n error instanceof Error && 'stderr' in error && (error as { stderr?: Buffer }).stderr\n ? (error as { stderr: Buffer }).stderr.toString().trim()\n : ErrorUtils.extractErrorMessage(error);\n ctx.log.warn(\n ` ⚠ Snapshot reconcile did not fully converge (continuing; sync daemon will retry):\\n ${chalk.dim(detail.split('\\n').join('\\n '))}\\n`,\n );\n }\n }\n\n /**\n * The paths of the application's interactive (`SAAS_APP`) frontends, as `wildo.saas.config.ts` declares them —\n * what `--serve-frontend` asks the served app tree to run a dev server for.\n */\n private async interactiveFrontendPaths(saasRoot: string): Promise<string[]> {\n const saasConfig = await loadSaasConfig(join(saasRoot, 'wildo.saas.config.ts'));\n return Object.values(saasConfig.services ?? {})\n .filter((service) => service.frontendType === AppFrontendType.SAAS_APP)\n .map((service) => service.path);\n }\n\n private spawnTree(\n label: string,\n cwd: string,\n treeCommand: LocalDevTreeCommand,\n logStream: NodeJS.WritableStream,\n color: (s: string) => string,\n consoleRendering: LocalDevConsoleRendering,\n ): SpawnedTree {\n const child = spawn(treeCommand.command, [...treeCommand.args], {\n cwd,\n env: { ...process.env, FORCE_COLOR: '1' },\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: SpawnUtils.shouldUseProcessGroups(),\n });\n\n return this.observeChild({\n label,\n child,\n logStream,\n color,\n consoleRendering,\n affectsStackLifetime: true,\n });\n }\n\n private spawnDiagnosticsObserver(\n frameworkRoot: string,\n appRoot: string,\n logStream: NodeJS.WritableStream,\n consoleRendering: LocalDevConsoleRendering,\n ): SpawnedTree | null {\n const scriptPath = join(frameworkRoot, 'scripts/dev-orchestrator/local-dev-status.mjs');\n if (!existsSync(scriptPath)) {\n return null;\n }\n const child = spawn(process.execPath, [scriptPath, '--framework-root', frameworkRoot, '--app-root', appRoot, '--watch', '--changes-only'], {\n cwd: frameworkRoot,\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: SpawnUtils.shouldUseProcessGroups(),\n });\n\n return this.observeChild({\n label: 'diagnostics',\n child,\n logStream,\n color: chalk.magenta,\n consoleRendering,\n affectsStackLifetime: false,\n });\n }\n\n /**\n * Keep every local double the environment's `providerEnv` points a provider at served for as long as this stack runs\n * (`local-provider-doubles.service.ts`): a port another process already serves is watched, and this stack's double\n * is started the moment it stops answering. A double whose simulators cannot be found is reported once with the remedy\n * and what is lost without it; nothing here stops the stack.\n */\n private async startLocalProviderDoubles(input: {\n ctx: CommandContext;\n envName: string;\n saasRoot: string;\n frameworkRoot: string | null;\n logStream: NodeJS.WritableStream;\n consoleRendering: LocalDevConsoleRendering;\n children: SpawnedTree[];\n supervisors: LocalProviderDoubleSupervisor[];\n }): Promise<void> {\n const { ctx } = input;\n let secretsPath: string;\n try {\n secretsPath = join(EnvironmentUtils.resolveSecretsDir(input.envName), 'secrets.json');\n } catch {\n return;\n }\n const reading = readEnvironmentProviderEnv(secretsPath);\n if (reading.kind !== EnvironmentProviderEnvReadingKind.READ) return;\n for (const planned of planLocalProviderDoubles(reading.providerEnv)) {\n const { definition, port } = planned;\n let launch: LocalProviderDoubleLaunch;\n try {\n launch = resolveLocalProviderDoubleLaunch({ saasRoot: input.saasRoot, frameworkRoot: input.frameworkRoot, planned });\n } catch (error) {\n if (await isLoopbackPortAnswering(port)) continue;\n ctx.log.warn(\n ` ${definition.providerRef}: ${definition.hostEnvVarName} points at 127.0.0.1:${port}, and its local double cannot be started: `\n + `${ErrorUtils.extractErrorMessage(error)} Until something answers there, ${definition.withoutIt}.`,\n );\n continue;\n }\n input.supervisors.push(superviseLocalProviderDouble({\n port,\n start: () => this.observeChild({\n label: `double:${definition.providerRef}`,\n child: spawn(launch.command, launch.args, {\n cwd: launch.cwd,\n env: launch.env,\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: SpawnUtils.shouldUseProcessGroups(),\n }),\n logStream: input.logStream,\n color: chalk.gray,\n consoleRendering: input.consoleRendering,\n affectsStackLifetime: false,\n }),\n onStarted: (generation) => input.children.push(generation),\n onEnded: (generation) => {\n const index = input.children.indexOf(generation);\n if (index >= 0) input.children.splice(index, 1);\n },\n onEvent: (event, { exitCode, consecutiveFailures }) => {\n if (event === LocalProviderDoubleEvent.SERVED_ELSEWHERE) {\n ctx.log.info(` ${definition.providerRef}: 127.0.0.1:${port} is already served; this stack starts its double if that stops.`);\n } else if (event === LocalProviderDoubleEvent.STARTING) {\n ctx.log.info(chalk.cyan(` Starting the ${definition.providerRef} double on 127.0.0.1:${port} (${definition.hostEnvVarName}).`));\n } else if (consecutiveFailures > 1) {\n // A single exit is usually another stack winning the port, which the next probe sees; repeated ones are not.\n ctx.log.warn(\n ` The ${definition.providerRef} double exited (code ${exitCode}) ${consecutiveFailures} times in a row; it is retried while`\n + ` nothing answers on 127.0.0.1:${port}. Until it answers, ${definition.withoutIt}.`,\n );\n }\n },\n }));\n }\n }\n\n /**\n * Starts the framework checkout's memory guard in watch mode: reap disconnected orphans and sample\n * memory every five minutes, printing only reaps and pressure warnings. Absent from an installed\n * CLI (the script is not staged), in which case nothing is started.\n */\n private spawnMemoryGuard(\n frameworkRoot: string,\n logStream: NodeJS.WritableStream,\n consoleRendering: LocalDevConsoleRendering,\n ): SpawnedTree | null {\n const scriptPath = join(frameworkRoot, 'scripts/dev-orchestrator/dev-memory-guard.mjs');\n if (!existsSync(scriptPath)) {\n return null;\n }\n const child = spawn(process.execPath, [scriptPath, '--watch', '300', '--reap', '--sample', '--quiet', '--exit-with-parent'], {\n cwd: frameworkRoot,\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: SpawnUtils.shouldUseProcessGroups(),\n });\n\n return this.observeChild({\n label: 'memory-guard',\n child,\n logStream,\n color: chalk.gray,\n consoleRendering,\n affectsStackLifetime: false,\n });\n }\n\n private observeChild({\n label,\n child,\n logStream,\n color,\n consoleRendering,\n affectsStackLifetime,\n }: {\n label: string;\n child: ChildProcess;\n logStream: NodeJS.WritableStream;\n color: (text: string) => string;\n consoleRendering: LocalDevConsoleRendering;\n affectsStackLifetime: boolean;\n }): SpawnedTree {\n const prefix = color(`[${label}] `);\n const outputBoundary = new LocalDevOutputBoundary({\n label,\n consolePrefix: prefix,\n consoleRendering,\n writeConsole: (text) => process.stdout.write(text),\n writeCapture: (text) => logStream.write(text),\n });\n const outputFlow = new LocalDevOutputFlowController({\n pauseSources: () => {\n child.stdout?.pause();\n child.stderr?.pause();\n },\n resumeSources: () => {\n child.stdout?.resume();\n child.stderr?.resume();\n },\n waitForDrain: (sink) => this.waitForWritableDrain(sink === LocalDevOutputSink.CONSOLE ? process.stdout : logStream),\n });\n child.stdout?.on('data', (chunk: Buffer) => {\n outputFlow.accept(outputBoundary.push(LocalDevOutputStream.STDOUT, chunk));\n });\n child.stderr?.on('data', (chunk: Buffer) => {\n outputFlow.accept(outputBoundary.push(LocalDevOutputStream.STDERR, chunk));\n });\n child.stdout?.once('end', () => {\n outputFlow.accept(outputBoundary.end(LocalDevOutputStream.STDOUT));\n });\n child.stderr?.once('end', () => {\n outputFlow.accept(outputBoundary.end(LocalDevOutputStream.STDERR));\n });\n\n const exit = new Promise<number>((resolveExit) => {\n let settled = false;\n const settle = (code: number): void => {\n if (settled) return;\n settled = true;\n resolveExit(code);\n };\n // `close` fires only after the stdio streams close. Settling on `exit`\n // could let the parent end the capture file while the child's final\n // buffered line was still waiting to be decoded and framed.\n child.once('close', (code, signal) => {\n outputFlow.accept(outputBoundary.end(LocalDevOutputStream.STDOUT));\n outputFlow.accept(outputBoundary.end(LocalDevOutputStream.STDERR));\n void outputFlow.waitForIdle().then(() => {\n const suffix = affectsStackLifetime ? '' : '; development stack continues';\n process.stdout.write(chalk.dim(` ${label} exited (code=${code ?? 'null'}, signal=${signal ?? 'null'}${suffix})\\n`));\n settle(code ?? (signal ? 130 : 1));\n });\n });\n child.once('error', (error) => {\n outputFlow.accept(outputBoundary.end(LocalDevOutputStream.STDOUT));\n outputFlow.accept(outputBoundary.end(LocalDevOutputStream.STDERR));\n void outputFlow.waitForIdle().then(() => {\n process.stderr.write(` ${label} failed to spawn: ${error.message}\\n`);\n settle(1);\n });\n });\n });\n\n return { label, child, exit, affectsStackLifetime };\n }\n\n private closeLogStream(logStream: NodeJS.WritableStream): Promise<void> {\n return new Promise((resolveClose, rejectClose) => {\n logStream.once('finish', resolveClose);\n logStream.once('error', rejectClose);\n logStream.end();\n });\n }\n\n private waitForWritableDrain(stream: NodeJS.WritableStream): Promise<void> {\n const writable = stream as NodeJS.WritableStream & { writableNeedDrain?: boolean };\n if (writable.writableNeedDrain === false) return Promise.resolve();\n return new Promise((resolveDrain) => {\n let settled = false;\n const settle = (): void => {\n if (settled) return;\n settled = true;\n writable.removeListener('drain', settle);\n writable.removeListener('close', settle);\n writable.removeListener('error', settle);\n resolveDrain();\n };\n writable.once('drain', settle);\n writable.once('close', settle);\n writable.once('error', settle);\n queueMicrotask(() => {\n if (writable.writableNeedDrain === false) settle();\n });\n });\n }\n}\n"]}
|
|
@@ -56,15 +56,17 @@
|
|
|
56
56
|
* into the platform `.env` files; confirms creds match what the
|
|
57
57
|
* container actually has.
|
|
58
58
|
* 5. Valkey admin auth — same.
|
|
59
|
-
* 6. **
|
|
60
|
-
* and Valkey ACL entries
|
|
61
|
-
*
|
|
62
|
-
* `wildo_platform` database drops
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
59
|
+
* 6. **Application users** — enumerate Mongo `admin.system.users`
|
|
60
|
+
* and Valkey ACL entries that the platform does not own, and LIST them.
|
|
61
|
+
* Leftovers of a removed application persist across `local up`/`local
|
|
62
|
+
* down` cycles and across `wildo_platform` database drops, and can
|
|
63
|
+
* surface as `WRONGPASS` or `Authentication failed`. But every
|
|
64
|
+
* registered application has users of its own here too, and the
|
|
65
|
+
* doctor reads no registration, so it cannot tell a leftover from a
|
|
66
|
+
* live one: the check is informational and suggests no deletion
|
|
67
|
+
* (#3704 — it used to WARN on every healthy stack and print a command
|
|
68
|
+
* that would drop the running application's own user and the mongot
|
|
69
|
+
* sync user).
|
|
68
70
|
* 7. Platform services HTTP — apps-manager (5151), crontabs-batches-
|
|
69
71
|
* manager (5152) `/health` responses.
|
|
70
72
|
* 8. Companion semantic readiness — companion (4341) `/health/ready` if the active
|
|
@@ -86,6 +88,17 @@
|
|
|
86
88
|
*/
|
|
87
89
|
import { BaseCommand } from '../../kernel/base-command';
|
|
88
90
|
import type { CommandMeta, CommandContext, CommandResult } from '../../kernel/types';
|
|
91
|
+
import { type LocalPreconditionCheckResult } from '../../services/deployment/local-precondition-checks.schemas';
|
|
92
|
+
/**
|
|
93
|
+
* The doctor's report of the users in a platform data service that the platform does not own (#3704).
|
|
94
|
+
*
|
|
95
|
+
* Informational on purpose. Each registered application has users of its own in these services, and the doctor reads no
|
|
96
|
+
* registration, so it cannot tell a live application's user from a leftover of a removed one. It used to WARN on every
|
|
97
|
+
* healthy stack and print a command dropping each user — including the running application's own and the mongot sync
|
|
98
|
+
* user, which would have broken the application and search — with the platform admin password inline, which `--json`
|
|
99
|
+
* output then carried into a CI artifact. So: no status above PASS, no suggested deletion, no credential.
|
|
100
|
+
*/
|
|
101
|
+
export declare function describeApplicationDataServiceUsers(name: string, users: readonly string[]): LocalPreconditionCheckResult;
|
|
89
102
|
export default class LocalDoctorCommand extends BaseCommand {
|
|
90
103
|
readonly meta: CommandMeta;
|
|
91
104
|
run(ctx: CommandContext): Promise<CommandResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/local/doctor.command.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"doctor.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/local/doctor.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuFG;AAOH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAK7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA8B1F,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,kEAAkE,CAAC;AAe1E;;;;;;;;GAQG;AACH,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,4BAA4B,CASxH;AAsCD,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,WAAW;IACzD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAWxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAqNtD;;;OAGG;YACW,sBAAsB;IAMpC;;;;OAIG;YACW,+BAA+B;IA0C7C;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;YACW,wBAAwB;IA+BtC,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,qBAAqB;IAgD7B,OAAO,CAAC,qBAAqB;IA4B7B,OAAO,CAAC,oBAAoB;IAkC5B,OAAO,CAAC,UAAU;IA8ClB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,OAAO,CAAC,aAAa;IAsCrB,OAAO,CAAC,WAAW;IA0DnB;;;;;;;;OAQG;YACW,SAAS;IA0CvB;;;;;;;;OAQG;IACH,OAAO,CAAC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