bootstrap — Architecture
The @mnemose/bootstrap package is the single source of truth for Mnemose deployment topology and the shared bootstrap planning/execution engine used by the CLI, gateway, and command handlers during tenant and cloud-project onboarding.
Responsibilities
- Define the
CoreManifest— tenant IDs, Pub/Sub topic + subscription names, and the required core kernel entries (diagnostics, operations) for an environment - Export
coreManifestForEnv(env)returning the manifest fordevelopment,staging, orproduction - Provide
assessCoreHealth(manifest, rows)— a pure function (no DB, no I/O) that compares the manifest’s expected kernel entries against the enrolled kernel rows, returning a per-kernel health status used by the gatewayplatformCoreresolver and the Fleet UI - Provide bootstrap plan + execution helpers (
createBootstrapOrganizationPlan,createBootstrapCloudProjectPlan,createBootstrapLocalPlan, and theirexecute*counterparts) that translateBootstrapOrganization/BootstrapCloudProjectcommands into WIF/IAM/resource steps
Key Components
| File | Role |
|---|---|
src/core-manifest.ts | CoreManifest type, coreManifestForEnv(), and the dev/staging/production manifest constants |
src/core-health.ts | assessCoreHealth() pure function and CoreHealth / CoreKernelStatus result types |
src/index.ts | Re-exports manifest + health, and hosts the bootstrap planning/execution helpers |
Dependencies
@mnemose/cloud-adapters— GCP IAM/resource ports used by the bootstrap executors@mnemose/db—bootstrapStatestable andDbClientfor persisting bootstrap run status@mnemose/domain—BootstrapOrganizationCommand,BootstrapCloudProjectCommandschemasgoogle-auth-library— ADC-based GCP credential resolution
Data Flow
CLI / gateway / command handler ↓ coreManifestForEnv(env) → CoreManifest (tenant IDs, topics, kernels) ↓ assessCoreHealth(manifest, agent_kernels rows) → CoreHealth ↓ createBootstrap*Plan(command) → plan ↓ execute*Plan(plan) → WIF pool/provider creation, IAM bindings, state persistenceThe manifest is consumed by Pulumi (infra/), the compose-bootstrap script (scripts/compose-bootstrap.mjs), the gateway platformCore resolver, and the Fleet UI. Changing the manifest requires updating every downstream consumer — see docs/architecture.md.