@mysten-incubation/devstack 0.1.1 → 0.2.0
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/README.md +6 -3
- package/dashboard-ui/assets/grpc-a4usE3Nk.js +3 -0
- package/dashboard-ui/assets/index-B82Bh84P.css +1 -0
- package/dashboard-ui/assets/index-CRYJ4pru.js +1277 -0
- package/dashboard-ui/index.html +2 -2
- package/dist/api/define-capabilities.d.mts +1 -20
- package/dist/api/define-capabilities.mjs +15 -22
- package/dist/api/define-capabilities.mjs.map +1 -1
- package/dist/api/define-devstack-with.d.mts +7 -1
- package/dist/api/define-devstack-with.mjs.map +1 -1
- package/dist/api/define-devstack.mjs.map +1 -1
- package/dist/api/define-plugin.d.mts +2 -1
- package/dist/api/inference-network.d.mts +31 -17
- package/dist/api/inference-network.mjs +40 -43
- package/dist/api/inference-network.mjs.map +1 -1
- package/dist/api/load-config.mjs +88 -0
- package/dist/api/load-config.mjs.map +1 -0
- package/dist/api/mode-narrowed-factory.d.mts +1 -1
- package/dist/api/mode-narrowed-factory.mjs.map +1 -1
- package/dist/api/run-stack-internal.mjs +202 -0
- package/dist/api/run-stack-internal.mjs.map +1 -0
- package/dist/api/run-stack.d.mts +82 -31
- package/dist/api/run-stack.mjs +22 -141
- package/dist/api/run-stack.mjs.map +1 -1
- package/dist/build-integrations/dapp-kit/index.d.mts +61 -0
- package/dist/build-integrations/dapp-kit/index.mjs +58 -0
- package/dist/build-integrations/dapp-kit/index.mjs.map +1 -0
- package/dist/build-integrations/playwright/config.d.mts +1 -30
- package/dist/build-integrations/playwright/config.mjs +1 -27
- package/dist/build-integrations/playwright/config.mjs.map +1 -1
- package/dist/build-integrations/playwright/errors.d.mts +4 -7
- package/dist/build-integrations/playwright/errors.mjs.map +1 -1
- package/dist/build-integrations/playwright/global-setup.d.mts +42 -71
- package/dist/build-integrations/playwright/global-setup.mjs +142 -218
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -1
- package/dist/build-integrations/playwright/index.d.mts +2 -2
- package/dist/build-integrations/playwright/index.mjs +2 -2
- package/dist/build-integrations/playwright/stack-context.d.mts +3 -1
- package/dist/build-integrations/playwright/stack-context.mjs +4 -2
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -1
- package/dist/build-integrations/playwright/wallet-context.mjs +44 -19
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -1
- package/dist/build-integrations/runtime/conventional-routes.mjs.map +1 -1
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -1
- package/dist/build-integrations/runtime/discover.d.mts +6 -4
- package/dist/build-integrations/runtime/discover.mjs +15 -4
- package/dist/build-integrations/runtime/discover.mjs.map +1 -1
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -1
- package/dist/build-integrations/runtime/errors.mjs.map +1 -1
- package/dist/build-integrations/runtime/read-stack-context.mjs +3 -3
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/resolve-discovery-env.d.mts +23 -7
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs +25 -12
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs.map +1 -1
- package/dist/build-integrations/runtime/stack-context.d.mts +2 -2
- package/dist/build-integrations/vite/index.d.mts +84 -19
- package/dist/build-integrations/vite/index.mjs +203 -28
- package/dist/build-integrations/vite/index.mjs.map +1 -1
- package/dist/build-integrations/vitest/config.d.mts +20 -2
- package/dist/build-integrations/vitest/config.mjs +16 -4
- package/dist/build-integrations/vitest/config.mjs.map +1 -1
- package/dist/build-integrations/vitest/env.d.mts +18 -10
- package/dist/build-integrations/vitest/env.mjs +11 -10
- package/dist/build-integrations/vitest/env.mjs.map +1 -1
- package/dist/build-integrations/vitest/errors.d.mts +7 -11
- package/dist/build-integrations/vitest/errors.mjs +3 -4
- package/dist/build-integrations/vitest/errors.mjs.map +1 -1
- package/dist/build-integrations/vitest/global-setup.d.mts +35 -0
- package/dist/build-integrations/vitest/global-setup.mjs +156 -0
- package/dist/build-integrations/vitest/global-setup.mjs.map +1 -0
- package/dist/build-integrations/vitest/index.d.mts +3 -2
- package/dist/build-integrations/vitest/index.mjs +3 -2
- package/dist/build-integrations/vitest/setup.mjs +2 -2
- package/dist/build-integrations/vitest/setup.mjs.map +1 -1
- package/dist/build-integrations/vitest/stack-context.d.mts +5 -3
- package/dist/build-integrations/vitest/stack-context.mjs +3 -2
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -1
- package/dist/cli/bail.mjs.map +1 -1
- package/dist/cli/doctor-probes.mjs +1 -3
- package/dist/cli/doctor-probes.mjs.map +1 -1
- package/dist/cli/main.d.mts +23 -1
- package/dist/cli/main.mjs +63 -8
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/prune-direct.mjs.map +1 -1
- package/dist/cli/snapshot-reader.mjs.map +1 -1
- package/dist/cli/up-lifecycle.mjs.map +1 -1
- package/dist/cli/wirings/apply.mjs +28 -21
- package/dist/cli/wirings/apply.mjs.map +1 -1
- package/dist/cli/wirings/codegen.mjs +108 -0
- package/dist/cli/wirings/codegen.mjs.map +1 -0
- package/dist/cli/wirings/config-loader.mjs +12 -62
- package/dist/cli/wirings/config-loader.mjs.map +1 -1
- package/dist/cli/wirings/dump-ids.mjs +86 -0
- package/dist/cli/wirings/dump-ids.mjs.map +1 -0
- package/dist/cli/wirings/engine-command.mjs +1 -1
- package/dist/cli/wirings/engine-command.mjs.map +1 -1
- package/dist/cli/wirings/identity.mjs +2 -2
- package/dist/cli/wirings/identity.mjs.map +1 -1
- package/dist/cli/wirings/provide-file-system.mjs.map +1 -1
- package/dist/cli/wirings/read-devstack-version.mjs +17 -0
- package/dist/cli/wirings/read-devstack-version.mjs.map +1 -0
- package/dist/cli/wirings/snapshot.mjs +27 -34
- package/dist/cli/wirings/snapshot.mjs.map +1 -1
- package/dist/cli/wirings/up-ipc.mjs +147 -0
- package/dist/cli/wirings/up-ipc.mjs.map +1 -0
- package/dist/cli/wirings/up.mjs +218 -198
- package/dist/cli/wirings/up.mjs.map +1 -1
- package/dist/cli/wirings/wipe.mjs +1 -1
- package/dist/cli/wirings/wipe.mjs.map +1 -1
- package/dist/contracts/chain-probe.d.mts +1 -1
- package/dist/contracts/chain-probe.mjs +1 -1
- package/dist/contracts/chain-probe.mjs.map +1 -1
- package/dist/contracts/codegenable.d.mts +60 -6
- package/dist/contracts/codegenable.mjs +28 -0
- package/dist/contracts/codegenable.mjs.map +1 -0
- package/dist/contracts/config-bindings.mjs +162 -0
- package/dist/contracts/config-bindings.mjs.map +1 -0
- package/dist/contracts/container-runtime.d.mts +23 -17
- package/dist/contracts/plugin-expander.mjs.map +1 -1
- package/dist/contracts/snapshotable.d.mts +5 -7
- package/dist/contracts/wallet-protocol.d.mts +2 -5
- package/dist/contracts/wallet-protocol.mjs +2 -5
- package/dist/contracts/wallet-protocol.mjs.map +1 -1
- package/dist/index.d.mts +21 -26
- package/dist/index.mjs +8 -9
- package/dist/orchestrators/boot.d.mts +28 -0
- package/dist/orchestrators/boot.mjs +440 -0
- package/dist/orchestrators/boot.mjs.map +1 -0
- package/dist/orchestrators/codegen/bindings.d.mts +13 -1
- package/dist/orchestrators/codegen/bindings.mjs +23 -9
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -1
- package/dist/orchestrators/codegen/config-runtime.mjs +208 -0
- package/dist/orchestrators/codegen/config-runtime.mjs.map +1 -0
- package/dist/orchestrators/codegen/emit.mjs +1 -1
- package/dist/orchestrators/codegen/emit.mjs.map +1 -1
- package/dist/orchestrators/codegen/errors.mjs +21 -1
- package/dist/orchestrators/codegen/errors.mjs.map +1 -1
- package/dist/orchestrators/codegen/format.mjs +2 -0
- package/dist/orchestrators/codegen/format.mjs.map +1 -1
- package/dist/orchestrators/codegen/gitignore.mjs +30 -11
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -1
- package/dist/orchestrators/codegen/id-config.mjs +107 -0
- package/dist/orchestrators/codegen/id-config.mjs.map +1 -0
- package/dist/orchestrators/codegen/output-location.mjs +23 -32
- package/dist/orchestrators/codegen/output-location.mjs.map +1 -1
- package/dist/orchestrators/codegen/paths.mjs +8 -1
- package/dist/orchestrators/codegen/paths.mjs.map +1 -1
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -1
- package/dist/orchestrators/codegen/service.mjs +286 -58
- package/dist/orchestrators/codegen/service.mjs.map +1 -1
- package/dist/orchestrators/layers.mjs +31 -0
- package/dist/orchestrators/layers.mjs.map +1 -0
- package/dist/orchestrators/lifecycle-prune/errors.mjs.map +1 -1
- package/dist/orchestrators/lifecycle-prune/index.mjs +8 -10
- package/dist/orchestrators/lifecycle-prune/index.mjs.map +1 -1
- package/dist/orchestrators/network-options.d.mts +52 -0
- package/dist/orchestrators/network-options.mjs +43 -0
- package/dist/orchestrators/network-options.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs.map +1 -1
- package/dist/orchestrators/router/cors.mjs.map +1 -1
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -1
- package/dist/orchestrators/router/errors.mjs.map +1 -1
- package/dist/orchestrators/router/file-provider.mjs.map +1 -1
- package/dist/orchestrators/router/hostname.mjs.map +1 -1
- package/dist/orchestrators/router/profile.mjs +1 -1
- package/dist/orchestrators/router/profile.mjs.map +1 -1
- package/dist/orchestrators/router/service.d.mts +2 -2
- package/dist/orchestrators/router/service.mjs +12 -27
- package/dist/orchestrators/router/service.mjs.map +1 -1
- package/dist/orchestrators/router/traefik-container.mjs +1 -1
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -1
- package/dist/orchestrators/snapshot/capture.mjs +171 -195
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -1
- package/dist/orchestrators/snapshot/descriptor.d.mts +1 -1
- package/dist/orchestrators/snapshot/descriptor.mjs +53 -11
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -1
- package/dist/orchestrators/snapshot/identity-guard.mjs +3 -5
- package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -1
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs +32 -101
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -1
- package/dist/orchestrators/snapshot/index.mjs +1 -4
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -1
- package/dist/orchestrators/snapshot/interrupted-restore.mjs +116 -0
- package/dist/orchestrators/snapshot/interrupted-restore.mjs.map +1 -0
- package/dist/orchestrators/snapshot/phase-error.mjs.map +1 -1
- package/dist/orchestrators/snapshot/prune.mjs +40 -31
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -1
- package/dist/orchestrators/snapshot/restore.mjs +221 -196
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -1
- package/dist/orchestrators/snapshot/service.mjs +72 -62
- package/dist/orchestrators/snapshot/service.mjs.map +1 -1
- package/dist/orchestrators/snapshot/wipe.mjs +67 -56
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -1
- package/dist/plugins/account/codegen.mjs +3 -0
- package/dist/plugins/account/codegen.mjs.map +1 -1
- package/dist/plugins/account/errors.d.mts +2 -2
- package/dist/plugins/account/errors.mjs +1 -4
- package/dist/plugins/account/errors.mjs.map +1 -1
- package/dist/plugins/account/funding.mjs +3 -27
- package/dist/plugins/account/funding.mjs.map +1 -1
- package/dist/plugins/account/index.d.mts +3 -8
- package/dist/plugins/account/index.mjs +71 -35
- package/dist/plugins/account/index.mjs.map +1 -1
- package/dist/plugins/account/keypair.d.mts +8 -7
- package/dist/plugins/account/keypair.mjs +5 -18
- package/dist/plugins/account/keypair.mjs.map +1 -1
- package/dist/plugins/account/lease.mjs.map +1 -1
- package/dist/plugins/account/registry.d.mts +1 -46
- package/dist/plugins/account/registry.mjs.map +1 -1
- package/dist/plugins/account/service.d.mts +43 -34
- package/dist/plugins/account/service.mjs +9 -54
- package/dist/plugins/account/service.mjs.map +1 -1
- package/dist/plugins/account/snapshot.mjs.map +1 -1
- package/dist/plugins/account/variants/ephemeral.mjs.map +1 -1
- package/dist/plugins/account/variants/impersonate.mjs.map +1 -1
- package/dist/plugins/account/variants/signer.mjs.map +1 -1
- package/dist/plugins/action/discriminator.mjs.map +1 -1
- package/dist/plugins/action/errors.mjs +1 -4
- package/dist/plugins/action/errors.mjs.map +1 -1
- package/dist/plugins/action/execute.mjs +3 -4
- package/dist/plugins/action/execute.mjs.map +1 -1
- package/dist/plugins/action/index.d.mts +2 -2
- package/dist/plugins/action/index.mjs +7 -11
- package/dist/plugins/action/index.mjs.map +1 -1
- package/dist/plugins/action/service.d.mts +5 -7
- package/dist/plugins/action/service.mjs +2 -16
- package/dist/plugins/action/service.mjs.map +1 -1
- package/dist/plugins/coin/address-resolution.mjs.map +1 -1
- package/dist/plugins/coin/codegen.mjs +97 -16
- package/dist/plugins/coin/codegen.mjs.map +1 -1
- package/dist/plugins/coin/discovery.mjs.map +1 -1
- package/dist/plugins/coin/errors.mjs +1 -4
- package/dist/plugins/coin/errors.mjs.map +1 -1
- package/dist/plugins/coin/index.d.mts +4 -34
- package/dist/plugins/coin/index.mjs +47 -28
- package/dist/plugins/coin/index.mjs.map +1 -1
- package/dist/plugins/coin/metadata.d.mts +1 -0
- package/dist/plugins/coin/metadata.mjs +8 -9
- package/dist/plugins/coin/metadata.mjs.map +1 -1
- package/dist/plugins/coin/mint.mjs +7 -21
- package/dist/plugins/coin/mint.mjs.map +1 -1
- package/dist/plugins/coin/registry.mjs +33 -20
- package/dist/plugins/coin/registry.mjs.map +1 -1
- package/dist/plugins/coin/service.d.mts +1 -1
- package/dist/plugins/coin/service.mjs +1 -8
- package/dist/plugins/coin/service.mjs.map +1 -1
- package/dist/plugins/coin/snapshot.mjs.map +1 -1
- package/dist/plugins/coin/type-strings.mjs.map +1 -1
- package/dist/plugins/dashboard/domain.mjs +106 -167
- package/dist/plugins/dashboard/domain.mjs.map +1 -1
- package/dist/plugins/dashboard/index.mjs +13 -13
- package/dist/plugins/dashboard/index.mjs.map +1 -1
- package/dist/plugins/dashboard/origin-policy.mjs +3 -3
- package/dist/plugins/dashboard/origin-policy.mjs.map +1 -1
- package/dist/plugins/dashboard/routable.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/builder.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/enums.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/root.mjs +23 -44
- package/dist/plugins/dashboard/schema/root.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/types.mjs +37 -91
- package/dist/plugins/dashboard/schema/types.mjs.map +1 -1
- package/dist/plugins/dashboard/schema.mjs.map +1 -1
- package/dist/plugins/dashboard/server.mjs.map +1 -1
- package/dist/plugins/deepbook/codegen.d.mts +12 -11
- package/dist/plugins/deepbook/codegen.mjs +108 -11
- package/dist/plugins/deepbook/codegen.mjs.map +1 -1
- package/dist/plugins/deepbook/deploy.mjs +7 -14
- package/dist/plugins/deepbook/deploy.mjs.map +1 -1
- package/dist/plugins/deepbook/errors.mjs +4 -2
- package/dist/plugins/deepbook/errors.mjs.map +1 -1
- package/dist/plugins/deepbook/faucet-strategy.mjs +4 -10
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/deepbook/hash.mjs.map +1 -1
- package/dist/plugins/deepbook/index.d.mts +38 -34
- package/dist/plugins/deepbook/index.mjs +133 -64
- package/dist/plugins/deepbook/index.mjs.map +1 -1
- package/dist/plugins/deepbook/plugin-key.mjs.map +1 -1
- package/dist/plugins/deepbook/pyth/index.mjs +4 -8
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -1
- package/dist/plugins/deepbook/snapshot.mjs +0 -1
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -1
- package/dist/plugins/deepbook/type-strings.mjs.map +1 -1
- package/dist/plugins/deepbook/types.d.mts +2 -1
- package/dist/plugins/deepbook/types.mjs.map +1 -1
- package/dist/plugins/faucet/dispatcher.d.mts +3 -3
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -1
- package/dist/plugins/faucet/errors.mjs.map +1 -1
- package/dist/plugins/faucet/http.mjs +2 -10
- package/dist/plugins/faucet/http.mjs.map +1 -1
- package/dist/plugins/faucet/index.mjs +0 -1
- package/dist/plugins/faucet/index.mjs.map +1 -1
- package/dist/plugins/host-service/errors.d.mts +1 -3
- package/dist/plugins/host-service/errors.mjs +1 -2
- package/dist/plugins/host-service/errors.mjs.map +1 -1
- package/dist/plugins/host-service/index.d.mts +1 -2
- package/dist/plugins/host-service/index.mjs +11 -11
- package/dist/plugins/host-service/index.mjs.map +1 -1
- package/dist/plugins/host-service/routable.mjs.map +1 -1
- package/dist/plugins/host-service/service.mjs +13 -13
- package/dist/plugins/host-service/service.mjs.map +1 -1
- package/dist/plugins/internal/acquire-on-chain-artifact.mjs.map +1 -1
- package/dist/plugins/internal/codegen-helpers.mjs +2 -0
- package/dist/plugins/internal/codegen-helpers.mjs.map +1 -1
- package/dist/plugins/internal/funding-failure-error.mjs.map +1 -1
- package/dist/plugins/{postgres → internal/postgres-sidecar}/connection.mjs +1 -1
- package/dist/plugins/internal/postgres-sidecar/connection.mjs.map +1 -0
- package/dist/plugins/{postgres → internal/postgres-sidecar}/db-ensure.mjs +30 -16
- package/dist/plugins/internal/postgres-sidecar/db-ensure.mjs.map +1 -0
- package/dist/plugins/internal/postgres-sidecar/errors.mjs +21 -0
- package/dist/plugins/internal/postgres-sidecar/errors.mjs.map +1 -0
- package/dist/{substrate/runtime/scoped-multimap → plugins/internal/postgres-sidecar}/index.mjs +1 -0
- package/dist/plugins/internal/postgres-sidecar/service.mjs +121 -0
- package/dist/plugins/internal/postgres-sidecar/service.mjs.map +1 -0
- package/dist/plugins/package/build.mjs +2 -2
- package/dist/plugins/package/build.mjs.map +1 -1
- package/dist/plugins/package/codegen.d.mts +7 -14
- package/dist/plugins/package/codegen.mjs +187 -59
- package/dist/plugins/package/codegen.mjs.map +1 -1
- package/dist/plugins/package/dep-resolution.mjs +51 -3
- package/dist/plugins/package/dep-resolution.mjs.map +1 -1
- package/dist/plugins/package/errors.mjs +1 -4
- package/dist/plugins/package/errors.mjs.map +1 -1
- package/dist/plugins/package/git-source.d.mts +18 -0
- package/dist/plugins/package/git-source.mjs +119 -0
- package/dist/plugins/package/git-source.mjs.map +1 -0
- package/dist/plugins/package/index.d.mts +28 -19
- package/dist/plugins/package/index.mjs +107 -32
- package/dist/plugins/package/index.mjs.map +1 -1
- package/dist/plugins/package/mode-known.mjs +2 -2
- package/dist/plugins/package/mode-known.mjs.map +1 -1
- package/dist/plugins/package/mode-local.mjs +18 -35
- package/dist/plugins/package/mode-local.mjs.map +1 -1
- package/dist/plugins/package/publish-executor.mjs +13 -8
- package/dist/plugins/package/publish-executor.mjs.map +1 -1
- package/dist/plugins/package/publish-output.d.mts +1 -11
- package/dist/plugins/package/publish-output.mjs +1 -9
- package/dist/plugins/package/publish-output.mjs.map +1 -1
- package/dist/plugins/package/registry.d.mts +1 -1
- package/dist/plugins/package/registry.mjs +26 -14
- package/dist/plugins/package/registry.mjs.map +1 -1
- package/dist/plugins/package/service.mjs.map +1 -1
- package/dist/plugins/package/snapshot.mjs.map +1 -1
- package/dist/plugins/router-entrypoints.mjs +1 -3
- package/dist/plugins/router-entrypoints.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +1 -2
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +1 -6
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -1
- package/dist/plugins/seal/codegen.d.mts +1 -5
- package/dist/plugins/seal/codegen.mjs +83 -12
- package/dist/plugins/seal/codegen.mjs.map +1 -1
- package/dist/plugins/seal/config-render.mjs +2 -6
- package/dist/plugins/seal/config-render.mjs.map +1 -1
- package/dist/plugins/seal/deploy.mjs +18 -29
- package/dist/plugins/seal/deploy.mjs.map +1 -1
- package/dist/plugins/seal/errors.d.mts +4 -5
- package/dist/plugins/seal/errors.mjs +1 -8
- package/dist/plugins/seal/errors.mjs.map +1 -1
- package/dist/plugins/seal/index.d.mts +7 -28
- package/dist/plugins/seal/index.mjs +69 -47
- package/dist/plugins/seal/index.mjs.map +1 -1
- package/dist/plugins/seal/key-manager.mjs.map +1 -1
- package/dist/plugins/seal/key-server.mjs +1 -6
- package/dist/plugins/seal/key-server.mjs.map +1 -1
- package/dist/plugins/seal/keygen.mjs +2 -3
- package/dist/plugins/seal/keygen.mjs.map +1 -1
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -1
- package/dist/plugins/seal/mode/live.mjs +1 -1
- package/dist/plugins/seal/mode/live.mjs.map +1 -1
- package/dist/plugins/seal/mode/local-keygen.mjs +4 -10
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -1
- package/dist/plugins/seal/plugin-key.mjs.map +1 -1
- package/dist/plugins/seal/registry-publish.mjs.map +1 -1
- package/dist/plugins/seal/routable.mjs.map +1 -1
- package/dist/plugins/seal/service.mjs.map +1 -1
- package/dist/plugins/seal/snapshot.mjs +1 -2
- package/dist/plugins/seal/snapshot.mjs.map +1 -1
- package/dist/plugins/sui/auto-tick.mjs +5 -5
- package/dist/plugins/sui/auto-tick.mjs.map +1 -1
- package/dist/plugins/sui/chain-build-container.mjs +2 -2
- package/dist/plugins/sui/chain-build-container.mjs.map +1 -1
- package/dist/plugins/sui/chain-probe.mjs +4 -4
- package/dist/plugins/sui/chain-probe.mjs.map +1 -1
- package/dist/plugins/sui/codegen.d.mts +9 -7
- package/dist/plugins/sui/codegen.mjs +49 -46
- package/dist/plugins/sui/codegen.mjs.map +1 -1
- package/dist/plugins/sui/errors.d.mts +1 -1
- package/dist/plugins/sui/errors.mjs +1 -9
- package/dist/plugins/sui/errors.mjs.map +1 -1
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.d.mts +1 -1
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.mjs +3 -7
- package/dist/plugins/sui/exec/index.mjs.map +1 -0
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.mjs +1 -1
- package/dist/plugins/sui/exec/sign-and-dispatch.mjs.map +1 -0
- package/dist/plugins/sui/fork-faucet-strategy.mjs +2 -6
- package/dist/plugins/sui/fork-faucet-strategy.mjs.map +1 -1
- package/dist/plugins/sui/fork-orchestration.mjs +13 -23
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -1
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -1
- package/dist/plugins/sui/index.d.mts +34 -83
- package/dist/plugins/sui/index.mjs +200 -68
- package/dist/plugins/sui/index.mjs.map +1 -1
- package/dist/{substrate/runtime/sui-ledger → plugins/sui/ledger}/object-ref.mjs +1 -1
- package/dist/plugins/sui/ledger/object-ref.mjs.map +1 -0
- package/dist/plugins/sui/local-faucet-strategy.mjs +1 -5
- package/dist/plugins/sui/local-faucet-strategy.mjs.map +1 -1
- package/dist/plugins/sui/log-attrs.mjs +11 -0
- package/dist/plugins/sui/log-attrs.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +4 -12
- package/dist/plugins/sui/mode/external.mjs.map +1 -1
- package/dist/plugins/sui/mode/fork.mjs +19 -16
- package/dist/plugins/sui/mode/fork.mjs.map +1 -1
- package/dist/plugins/sui/mode/live.mjs +4 -17
- package/dist/plugins/sui/mode/live.mjs.map +1 -1
- package/dist/plugins/sui/mode/local.d.mts +1 -0
- package/dist/plugins/sui/mode/local.mjs +203 -61
- package/dist/plugins/sui/mode/local.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared-boot.mjs +18 -23
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared.d.mts +6 -7
- package/dist/plugins/sui/mode/shared.mjs.map +1 -1
- package/dist/plugins/sui/mode/spec.d.mts +23 -6
- package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.mjs +28 -30
- package/dist/plugins/sui/move/index.mjs.map +1 -0
- package/dist/plugins/sui/move-summary-runner.mjs +8 -4
- package/dist/plugins/sui/move-summary-runner.mjs.map +1 -1
- package/dist/{substrate/network.d.mts → plugins/sui/network-config.d.mts} +11 -10
- package/dist/plugins/sui/network-resolver.d.mts +6 -6
- package/dist/plugins/sui/routable.mjs.map +1 -1
- package/dist/plugins/sui/service.mjs +10 -6
- package/dist/plugins/sui/service.mjs.map +1 -1
- package/dist/plugins/sui/snapshot.mjs +10 -5
- package/dist/plugins/sui/snapshot.mjs.map +1 -1
- package/dist/plugins/wallet/codegen.d.mts +8 -6
- package/dist/plugins/wallet/codegen.mjs +4 -10
- package/dist/plugins/wallet/codegen.mjs.map +1 -1
- package/dist/plugins/wallet/errors.mjs +1 -4
- package/dist/plugins/wallet/errors.mjs.map +1 -1
- package/dist/plugins/wallet/index.d.mts +3 -6
- package/dist/plugins/wallet/index.mjs +16 -21
- package/dist/plugins/wallet/index.mjs.map +1 -1
- package/dist/plugins/wallet/origin-policy.mjs +3 -3
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -1
- package/dist/plugins/wallet/pairing.mjs +6 -24
- package/dist/plugins/wallet/pairing.mjs.map +1 -1
- package/dist/plugins/wallet/protocol.mjs.map +1 -1
- package/dist/plugins/wallet/routable.mjs.map +1 -1
- package/dist/plugins/wallet/server.mjs +17 -24
- package/dist/plugins/wallet/server.mjs.map +1 -1
- package/dist/plugins/wallet/service.d.mts +2 -2
- package/dist/plugins/wallet/service.mjs +4 -15
- package/dist/plugins/wallet/service.mjs.map +1 -1
- package/dist/plugins/wallet/snapshot.mjs.map +1 -1
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +1 -5
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/walrus/codegen.d.mts +2 -13
- package/dist/plugins/walrus/codegen.mjs +93 -28
- package/dist/plugins/walrus/codegen.mjs.map +1 -1
- package/dist/plugins/walrus/deploy-paths.mjs +2 -3
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -1
- package/dist/plugins/walrus/deploy.mjs +26 -19
- package/dist/plugins/walrus/deploy.mjs.map +1 -1
- package/dist/plugins/walrus/errors.mjs +1 -8
- package/dist/plugins/walrus/errors.mjs.map +1 -1
- package/dist/plugins/walrus/faucet-strategy.mjs +15 -1
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/walrus/index.d.mts +13 -44
- package/dist/plugins/walrus/index.mjs +119 -122
- package/dist/plugins/walrus/index.mjs.map +1 -1
- package/dist/plugins/walrus/mode/known-deploy.mjs +6 -6
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -1
- package/dist/plugins/walrus/mode/local-cluster.d.mts +2 -2
- package/dist/plugins/walrus/mode/local-cluster.mjs +2 -10
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -1
- package/dist/plugins/walrus/plugin-key.mjs.map +1 -1
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -1
- package/dist/plugins/walrus/routable.mjs.map +1 -1
- package/dist/plugins/walrus/service.mjs.map +1 -1
- package/dist/plugins/walrus/snapshot.mjs +3 -3
- package/dist/plugins/walrus/snapshot.mjs.map +1 -1
- package/dist/plugins/walrus/storage-nodes.mjs +53 -14
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -1
- package/dist/plugins/walrus/wal-swap.mjs +4 -8
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -1
- package/dist/primitives/artifact-publisher.mjs.map +1 -1
- package/dist/primitives/cache.d.mts +1 -1
- package/dist/runtime/docker/client.mjs +47 -3
- package/dist/runtime/docker/client.mjs.map +1 -1
- package/dist/runtime/docker/container.mjs +37 -57
- package/dist/runtime/docker/container.mjs.map +1 -1
- package/dist/runtime/docker/errors.mjs.map +1 -1
- package/dist/runtime/docker/exec.mjs +2 -2
- package/dist/runtime/docker/exec.mjs.map +1 -1
- package/dist/runtime/docker/image.mjs +10 -11
- package/dist/runtime/docker/image.mjs.map +1 -1
- package/dist/runtime/docker/index.mjs +0 -1
- package/dist/runtime/docker/inspect-and-decode.mjs.map +1 -1
- package/dist/runtime/docker/inventory.mjs +9 -9
- package/dist/runtime/docker/inventory.mjs.map +1 -1
- package/dist/runtime/docker/labels.mjs +12 -1
- package/dist/runtime/docker/labels.mjs.map +1 -1
- package/dist/runtime/docker/network.mjs +6 -6
- package/dist/runtime/docker/network.mjs.map +1 -1
- package/dist/runtime/docker/render-run-args.mjs.map +1 -1
- package/dist/runtime/docker/service.mjs +31 -45
- package/dist/runtime/docker/service.mjs.map +1 -1
- package/dist/runtime/docker/sweep.mjs +14 -64
- package/dist/runtime/docker/sweep.mjs.map +1 -1
- package/dist/runtime/docker/volume.mjs +1 -1
- package/dist/runtime/docker/volume.mjs.map +1 -1
- package/dist/runtime/docker/wrap.mjs +14 -2
- package/dist/runtime/docker/wrap.mjs.map +1 -1
- package/dist/substrate/brand.d.mts +2 -5
- package/dist/substrate/brand.mjs +3 -2
- package/dist/substrate/brand.mjs.map +1 -1
- package/dist/substrate/cross-process.mjs +2 -16
- package/dist/substrate/cross-process.mjs.map +1 -1
- package/dist/substrate/event-time.mjs +0 -2
- package/dist/substrate/event-time.mjs.map +1 -1
- package/dist/substrate/events.d.mts +46 -16
- package/dist/substrate/identity.d.mts +11 -5
- package/dist/substrate/manifest.d.mts +33 -26
- package/dist/substrate/manifest.mjs +8 -3
- package/dist/substrate/manifest.mjs.map +1 -1
- package/dist/substrate/options.d.mts +33 -4
- package/dist/substrate/plugin-ctx.d.mts +70 -0
- package/dist/substrate/plugin-ctx.mjs +66 -0
- package/dist/substrate/plugin-ctx.mjs.map +1 -0
- package/dist/substrate/plugin.d.mts +46 -38
- package/dist/substrate/plugin.mjs +13 -9
- package/dist/substrate/plugin.mjs.map +1 -1
- package/dist/substrate/projection.d.mts +1 -1
- package/dist/substrate/runtime/atomic-write.mjs +3 -4
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -1
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -1
- package/dist/substrate/runtime/cache/service.mjs +50 -20
- package/dist/substrate/runtime/cache/service.mjs.map +1 -1
- package/dist/substrate/runtime/config-validation.mjs.map +1 -1
- package/dist/substrate/runtime/control-plane/domain.mjs +34 -12
- package/dist/substrate/runtime/control-plane/domain.mjs.map +1 -1
- package/dist/substrate/runtime/control-plane/service.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +14 -17
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/index.mjs +0 -2
- package/dist/substrate/runtime/cross-process/live-clock.mjs +1 -1
- package/dist/substrate/runtime/cross-process/live-clock.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/liveness.mjs +11 -18
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs +2 -2
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/roster.mjs +17 -127
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/self-pid.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +29 -28
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -1
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -1
- package/dist/substrate/runtime/errors.mjs +1 -13
- package/dist/substrate/runtime/errors.mjs.map +1 -1
- package/dist/substrate/runtime/format-unknown-error.mjs.map +1 -1
- package/dist/substrate/runtime/host-bind-mount-owner.mjs.map +1 -1
- package/dist/substrate/runtime/host-gateway.mjs.map +1 -1
- package/dist/substrate/runtime/host-tree-tar/index.mjs +15 -163
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -1
- package/dist/substrate/runtime/http-probe.d.mts +1 -3
- package/dist/substrate/runtime/http-probe.mjs.map +1 -1
- package/dist/substrate/runtime/index.mjs +1 -6
- package/dist/substrate/runtime/lease-broker/service.mjs +5 -23
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +3 -3
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/graph-input-id.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/graph-input-id.mjs +133 -0
- package/dist/substrate/runtime/lifecycle/graph-input-id.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/index.mjs +2 -2
- package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +22 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs +2 -15
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +29 -25
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +0 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -1
- package/dist/substrate/runtime/managed-container.d.mts +5 -1
- package/dist/substrate/runtime/managed-container.mjs +8 -10
- package/dist/substrate/runtime/managed-container.mjs.map +1 -1
- package/dist/substrate/runtime/manifest/manifest.mjs +8 -30
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -1
- package/dist/substrate/runtime/mode-errors.d.mts +1 -2
- package/dist/substrate/runtime/mode-errors.mjs.map +1 -1
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +1 -11
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -1
- package/dist/substrate/runtime/observability/ignore-with-log.mjs.map +1 -1
- package/dist/substrate/runtime/observability/index.d.mts +1 -1
- package/dist/substrate/runtime/observability/index.mjs +4 -6
- package/dist/substrate/runtime/observability/log-attrs.mjs +46 -0
- package/dist/substrate/runtime/observability/log-attrs.mjs.map +1 -0
- package/dist/substrate/runtime/observability/log-store.mjs.map +1 -1
- package/dist/substrate/runtime/observability/logger.mjs +3 -3
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -1
- package/dist/substrate/runtime/observability/output-truncate.mjs.map +1 -1
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -1
- package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -1
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -1
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +2 -2
- package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -1
- package/dist/substrate/runtime/passthrough-or-wrap.mjs.map +1 -1
- package/dist/substrate/runtime/paths.mjs +27 -9
- package/dist/substrate/runtime/paths.mjs.map +1 -1
- package/dist/substrate/runtime/phase-preserving-produce.mjs.map +1 -1
- package/dist/substrate/runtime/port-broker/service.mjs +10 -27
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/probes.d.mts +2 -3
- package/dist/substrate/runtime/probes.mjs.map +1 -1
- package/dist/substrate/runtime/process-supervisor.mjs.map +1 -1
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -1
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -1
- package/dist/substrate/runtime/projection/update.mjs +87 -11
- package/dist/substrate/runtime/projection/update.mjs.map +1 -1
- package/dist/substrate/runtime/random-suffix.mjs.map +1 -1
- package/dist/substrate/runtime/reconcile/fs-plan.mjs +146 -0
- package/dist/substrate/runtime/reconcile/fs-plan.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/graph.mjs +19 -0
- package/dist/substrate/runtime/reconcile/graph.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/index.mjs +5 -0
- package/dist/substrate/runtime/reconcile/label.mjs +41 -0
- package/dist/substrate/runtime/reconcile/label.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/spec.mjs +15 -0
- package/dist/substrate/runtime/reconcile/spec.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +2 -3
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -1
- package/dist/substrate/runtime/routed-url.mjs.map +1 -1
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -1
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -1
- package/dist/substrate/runtime/stage-and-swap/index.mjs +49 -12
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/service.mjs +29 -17
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -1
- package/dist/substrate/runtime/subnet-broker.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/acquire-node.mjs +188 -56
- package/dist/substrate/runtime/supervisor/acquire-node.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/background-tasks.mjs +79 -65
- package/dist/substrate/runtime/supervisor/background-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/command-loop.mjs +82 -23
- package/dist/substrate/runtime/supervisor/command-loop.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs +16 -0
- package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/errors.mjs +11 -2
- package/dist/substrate/runtime/supervisor/errors.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/index.mjs +2 -0
- package/dist/substrate/runtime/supervisor/shutdown.mjs +6 -6
- package/dist/substrate/runtime/supervisor/shutdown.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs +60 -70
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/state.d.mts +1 -1
- package/dist/substrate/runtime/supervisor/state.mjs +1 -1
- package/dist/substrate/runtime/supervisor/state.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/teardown.mjs +10 -9
- package/dist/substrate/runtime/supervisor/teardown.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/wiring.mjs +6 -20
- package/dist/substrate/runtime/supervisor/wiring.mjs.map +1 -1
- package/dist/substrate/runtime/tar/reader.mjs +216 -0
- package/dist/substrate/runtime/tar/reader.mjs.map +1 -0
- package/dist/substrate/runtime/typed-env.mjs.map +1 -1
- package/dist/substrate/versioned-doc-schema.mjs.map +1 -1
- package/dist/substrate/versioned-doc-sync.mjs +5 -5
- package/dist/substrate/versioned-doc-sync.mjs.map +1 -1
- package/dist/surfaces/cli/command-tree.mjs +49 -7
- package/dist/surfaces/cli/command-tree.mjs.map +1 -1
- package/dist/surfaces/cli/commands/config.mjs +1 -1
- package/dist/surfaces/cli/commands/config.mjs.map +1 -1
- package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -1
- package/dist/surfaces/cli/commands/confirm.mjs.map +1 -1
- package/dist/surfaces/cli/commands/doctor.mjs +1 -1
- package/dist/surfaces/cli/commands/doctor.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune-picker-entry.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune.mjs +1 -1
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -1
- package/dist/surfaces/cli/commands/snapshot.mjs +1 -1
- package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -1
- package/dist/surfaces/cli/commands/status.mjs +1 -1
- package/dist/surfaces/cli/commands/status.mjs.map +1 -1
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -1
- package/dist/surfaces/cli/commands/wipe.mjs +3 -4
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -1
- package/dist/surfaces/cli/envelope.mjs.map +1 -1
- package/dist/surfaces/cli/errors.mjs.map +1 -1
- package/dist/surfaces/cli/flags.mjs.map +1 -1
- package/dist/surfaces/cli/index.mjs +45 -14
- package/dist/surfaces/cli/index.mjs.map +1 -1
- package/dist/surfaces/cli/output.mjs.map +1 -1
- package/dist/surfaces/cli/sysexits.mjs.map +1 -1
- package/dist/surfaces/tui/app.mjs +0 -21
- package/dist/surfaces/tui/app.mjs.map +1 -1
- package/dist/surfaces/tui/dashboard.mjs +0 -48
- package/dist/surfaces/tui/dashboard.mjs.map +1 -1
- package/dist/surfaces/tui/display-derivation.mjs +80 -16
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -1
- package/dist/surfaces/tui/errors.mjs.map +1 -1
- package/dist/surfaces/tui/event-log.mjs +0 -9
- package/dist/surfaces/tui/event-log.mjs.map +1 -1
- package/dist/surfaces/tui/heartbeat.mjs.map +1 -1
- package/dist/surfaces/tui/index.mjs +2 -2
- package/dist/surfaces/tui/index.mjs.map +1 -1
- package/dist/surfaces/tui/input.mjs.map +1 -1
- package/dist/surfaces/tui/mode-detect.mjs.map +1 -1
- package/dist/surfaces/tui/mount-ink.mjs.map +1 -1
- package/dist/surfaces/tui/plain-renderer.mjs +26 -19
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -1
- package/dist/surfaces/tui/resource-table.mjs +8 -10
- package/dist/surfaces/tui/resource-table.mjs.map +1 -1
- package/images/postgres/Dockerfile +0 -1
- package/images/sui/Dockerfile +27 -54
- package/images/sui/entrypoint.sh +17 -179
- package/package.json +23 -15
- package/dashboard-ui/assets/index-Bmi1UtAg.js +0 -1356
- package/dashboard-ui/assets/index-D5EShVt4.js +0 -3
- package/dashboard-ui/assets/index-Deml9drg.css +0 -1
- package/dist/api/plugin-errors.d.mts +0 -7
- package/dist/api/plugin-errors.mjs +0 -10
- package/dist/api/plugin-errors.mjs.map +0 -1
- package/dist/cli/wirings/build-verb-layers.mjs +0 -42
- package/dist/cli/wirings/build-verb-layers.mjs.map +0 -1
- package/dist/contracts/capability-decl.d.mts +0 -40
- package/dist/orchestrators/built-in-plugin-layers.mjs +0 -54
- package/dist/orchestrators/built-in-plugin-layers.mjs.map +0 -1
- package/dist/orchestrators/run.mjs +0 -91
- package/dist/orchestrators/run.mjs.map +0 -1
- package/dist/orchestrators/runtime-composition.d.mts +0 -10
- package/dist/orchestrators/runtime-composition.mjs +0 -252
- package/dist/orchestrators/runtime-composition.mjs.map +0 -1
- package/dist/orchestrators/snapshot/capture-command.d.mts +0 -1
- package/dist/orchestrators/snapshot/capture-command.mjs +0 -25
- package/dist/orchestrators/snapshot/capture-command.mjs.map +0 -1
- package/dist/orchestrators/snapshot/pending-marker.mjs +0 -99
- package/dist/orchestrators/snapshot/pending-marker.mjs.map +0 -1
- package/dist/orchestrators/snapshot/recover-pending.mjs +0 -223
- package/dist/orchestrators/snapshot/recover-pending.mjs.map +0 -1
- package/dist/orchestrators/snapshot/state-document.d.mts +0 -1
- package/dist/orchestrators/snapshot/state-document.mjs +0 -58
- package/dist/orchestrators/snapshot/state-document.mjs.map +0 -1
- package/dist/plugins/account/spans.mjs +0 -16
- package/dist/plugins/account/spans.mjs.map +0 -1
- package/dist/plugins/account/variants/env.mjs +0 -24
- package/dist/plugins/account/variants/env.mjs.map +0 -1
- package/dist/plugins/account/variants/inline.mjs +0 -13
- package/dist/plugins/account/variants/inline.mjs.map +0 -1
- package/dist/plugins/account/variants/keystore.mjs +0 -91
- package/dist/plugins/account/variants/keystore.mjs.map +0 -1
- package/dist/plugins/action/spans.mjs +0 -11
- package/dist/plugins/action/spans.mjs.map +0 -1
- package/dist/plugins/coin/spans.mjs +0 -20
- package/dist/plugins/coin/spans.mjs.map +0 -1
- package/dist/plugins/deepbook/spans.mjs +0 -18
- package/dist/plugins/deepbook/spans.mjs.map +0 -1
- package/dist/plugins/faucet/spans.mjs +0 -12
- package/dist/plugins/faucet/spans.mjs.map +0 -1
- package/dist/plugins/package/spans.mjs +0 -14
- package/dist/plugins/package/spans.mjs.map +0 -1
- package/dist/plugins/postgres/codegen.mjs +0 -42
- package/dist/plugins/postgres/codegen.mjs.map +0 -1
- package/dist/plugins/postgres/connection.d.mts +0 -33
- package/dist/plugins/postgres/connection.mjs.map +0 -1
- package/dist/plugins/postgres/db-ensure.mjs.map +0 -1
- package/dist/plugins/postgres/errors.d.mts +0 -60
- package/dist/plugins/postgres/errors.mjs +0 -29
- package/dist/plugins/postgres/errors.mjs.map +0 -1
- package/dist/plugins/postgres/index.d.mts +0 -37
- package/dist/plugins/postgres/index.mjs +0 -68
- package/dist/plugins/postgres/index.mjs.map +0 -1
- package/dist/plugins/postgres/routable.mjs +0 -33
- package/dist/plugins/postgres/routable.mjs.map +0 -1
- package/dist/plugins/postgres/service.d.mts +0 -50
- package/dist/plugins/postgres/service.mjs +0 -179
- package/dist/plugins/postgres/service.mjs.map +0 -1
- package/dist/plugins/postgres/snapshot.mjs +0 -32
- package/dist/plugins/postgres/snapshot.mjs.map +0 -1
- package/dist/plugins/postgres/spans.mjs +0 -11
- package/dist/plugins/postgres/spans.mjs.map +0 -1
- package/dist/plugins/seal/spans.mjs +0 -18
- package/dist/plugins/seal/spans.mjs.map +0 -1
- package/dist/plugins/sui/spans.mjs +0 -17
- package/dist/plugins/sui/spans.mjs.map +0 -1
- package/dist/plugins/wallet/spans.mjs +0 -22
- package/dist/plugins/wallet/spans.mjs.map +0 -1
- package/dist/plugins/walrus/registry-publish.d.mts +0 -24
- package/dist/plugins/walrus/spans.mjs +0 -18
- package/dist/plugins/walrus/spans.mjs.map +0 -1
- package/dist/runtime/docker/logs.d.mts +0 -1
- package/dist/runtime/docker/logs.mjs +0 -34
- package/dist/runtime/docker/logs.mjs.map +0 -1
- package/dist/substrate/runtime/artifact-publisher/index.mjs +0 -86
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +0 -1
- package/dist/substrate/runtime/capability-sinks/index.d.mts +0 -1
- package/dist/substrate/runtime/capability-sinks/index.mjs +0 -3
- package/dist/substrate/runtime/capability-sinks/layer.d.mts +0 -1
- package/dist/substrate/runtime/capability-sinks/layer.mjs +0 -31
- package/dist/substrate/runtime/capability-sinks/layer.mjs.map +0 -1
- package/dist/substrate/runtime/capability-sinks/service.d.mts +0 -95
- package/dist/substrate/runtime/capability-sinks/service.mjs +0 -69
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +0 -1
- package/dist/substrate/runtime/cross-process/lock.d.mts +0 -1
- package/dist/substrate/runtime/cross-process/lock.mjs +0 -23
- package/dist/substrate/runtime/cross-process/lock.mjs.map +0 -1
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +0 -113
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +0 -1
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +0 -31
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +0 -1
- package/dist/substrate/runtime/observability/formatter-registry.d.mts +0 -1
- package/dist/substrate/runtime/observability/formatter-registry.mjs +0 -48
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +0 -1
- package/dist/substrate/runtime/observability/span-store.d.mts +0 -1
- package/dist/substrate/runtime/observability/span-store.mjs +0 -110
- package/dist/substrate/runtime/observability/span-store.mjs.map +0 -1
- package/dist/substrate/runtime/observability/spans.d.mts +0 -1
- package/dist/substrate/runtime/observability/spans.mjs +0 -87
- package/dist/substrate/runtime/observability/spans.mjs.map +0 -1
- package/dist/substrate/runtime/projection/index.mjs +0 -4
- package/dist/substrate/runtime/projection/persisted.mjs +0 -213
- package/dist/substrate/runtime/projection/persisted.mjs.map +0 -1
- package/dist/substrate/runtime/scoped-multimap/service.mjs +0 -52
- package/dist/substrate/runtime/scoped-multimap/service.mjs.map +0 -1
- package/dist/substrate/runtime/scoped-ref-map/index.mjs +0 -2
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +0 -83
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +0 -1
- package/dist/substrate/runtime/state-store/index.mjs +0 -3
- package/dist/substrate/runtime/state-store/schema.d.mts +0 -1
- package/dist/substrate/runtime/state-store/schema.mjs +0 -41
- package/dist/substrate/runtime/state-store/schema.mjs.map +0 -1
- package/dist/substrate/runtime/state-store/service.d.mts +0 -1
- package/dist/substrate/runtime/state-store/service.mjs +0 -145
- package/dist/substrate/runtime/state-store/service.mjs.map +0 -1
- package/dist/substrate/runtime/sui-execute/index.mjs.map +0 -1
- package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs.map +0 -1
- package/dist/substrate/runtime/sui-ledger/object-ref.mjs.map +0 -1
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +0 -1
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs +0 -151
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs.map +0 -1
- package/dist/substrate/state-store.d.mts +0 -1
- /package/dist/orchestrators/{snapshot/pending-marker.d.mts → codegen/id-config.d.mts} +0 -0
- /package/dist/orchestrators/snapshot/{recover-pending.d.mts → interrupted-restore.d.mts} +0 -0
- /package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.d.mts +0 -0
- /package/dist/plugins/{postgres/snapshot.d.mts → sui/ledger/object-ref.d.mts} +0 -0
- /package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.d.mts +0 -0
- /package/dist/substrate/runtime/{state-store/index.d.mts → reconcile/graph.d.mts} +0 -0
- /package/dist/substrate/runtime/{cross-process/snapshot-reservation.d.mts → supervisor/contribution-dispatcher.d.mts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prune.mjs","names":[],"sources":["../../../src/orchestrators/snapshot/prune.ts"],"sourcesContent":["// Prune — label-scoped orphan sweep.\n//\n// Architecture § 4: the L3 prune orchestrator sweeps committed snapshot\n// byproduct images and snapshot-catalog directories whose meta document\n// is missing (partial artifacts) or unreadable. Stack-wide registry\n// pruning (engine resources / stack roster) is a sibling orchestrator and\n// lives elsewhere; this file is scoped to snapshot-adjacent artifacts.\n//\n// Image sweep scope (load-bearing): committed snapshot images are stamped\n// at `docker commit` time with `{managed, app, stack, role:\n// SNAPSHOT_IMAGE_ROLE}` (see `runtime/docker/container.ts`). Prune scopes\n// its sweep to THAT role so it reaps only snapshot byproducts. Plugin\n// BUILD images share `{managed, app, stack}` but carry the source\n// plugin's real role (or none) — never `SNAPSHOT_IMAGE_ROLE` — so the\n// sweep can NEVER untag a live stack's build images and force a silent\n// rebuild. Prune holds
|
|
1
|
+
{"version":3,"file":"prune.mjs","names":[],"sources":["../../../src/orchestrators/snapshot/prune.ts"],"sourcesContent":["// Prune — label-scoped orphan sweep.\n//\n// Architecture § 4: the L3 prune orchestrator sweeps committed snapshot\n// byproduct images and snapshot-catalog directories whose meta document\n// is missing (partial artifacts) or unreadable. Stack-wide registry\n// pruning (engine resources / stack roster) is a sibling orchestrator and\n// lives elsewhere; this file is scoped to snapshot-adjacent artifacts.\n//\n// Image sweep scope (load-bearing): committed snapshot images are stamped\n// at `docker commit` time with `{managed, app, stack, role:\n// SNAPSHOT_IMAGE_ROLE}` (see `runtime/docker/container.ts`). Prune scopes\n// its sweep to THAT role so it reaps only snapshot byproducts. Plugin\n// BUILD images share `{managed, app, stack}` but carry the source\n// plugin's real role (or none) — never `SNAPSHOT_IMAGE_ROLE` — so the\n// sweep can NEVER untag a live stack's build images and force a silent\n// rebuild. Prune holds `stack.lock` only briefly (not stack liveness)\n// and is CLI-exposed, so this scoping is what keeps it safe against a\n// running stack.\n\nimport { Effect, FileSystem, Schema } from 'effect';\n\nimport type { ContainerRuntime } from '../../contracts/container-runtime.ts';\nimport { SNAPSHOT_IMAGE_ROLE } from '../../runtime/docker/container.ts';\nimport { appName, stackName } from '../../substrate/brand.ts';\nimport {\n\tlabelScope,\n\treconcileLabel,\n\treconcileSpec,\n\ttype ReconcileFsOp,\n} from '../../substrate/runtime/reconcile/index.ts';\nimport { decodeJsonText } from '../../substrate/runtime/runtime-decode.ts';\nimport { SnapshotMetadataSchema, type SnapshotMetadata } from './descriptor.ts';\nimport { makePhaseFailer } from './phase-error.ts';\nimport { SNAPSHOTS_DIR_NAME } from './wipe.ts';\n\n// -----------------------------------------------------------------------------\n// Errors\n// -----------------------------------------------------------------------------\n\nexport class PrunePhaseError extends Schema.TaggedErrorClass<PrunePhaseError>()(\n\t'SnapshotPrunePhaseError',\n\t{\n\t\tphase: Schema.Literals(['enumerate-catalog', 'read-meta', 'sweep-images', 'sweep-directories']),\n\t\tdetail: Schema.String,\n\t\tcause: Schema.optional(Schema.Defect),\n\t},\n) {}\n\nconst failPhase = makePhaseFailer(PrunePhaseError);\n\n// -----------------------------------------------------------------------------\n// Inputs\n// -----------------------------------------------------------------------------\n\nexport interface PruneInputs {\n\t/** Stack root containing the `snapshots/` catalog. */\n\treadonly stackRoot: string;\n\t/** App/stack scope for the committed-snapshot-image sweep. Prune\n\t * narrows this to `role: SNAPSHOT_IMAGE_ROLE` before removing images,\n\t * so only this stack's snapshot byproducts are swept — never its\n\t * build images, never a sibling stack. */\n\treadonly imageLabelFilter: { readonly app: string; readonly stack: string };\n\treadonly runtime: ContainerRuntime;\n}\n\nexport interface PruneResult {\n\treadonly inspected: number;\n\treadonly reaped: ReadonlyArray<{\n\t\treadonly id: string;\n\t\t/** Reason the artifact was reaped. Currently only `'abandoned'`\n\t\t * (partial artifact with no readable meta document). */\n\t\treadonly classification: 'abandoned';\n\t}>;\n\t/** Count of committed snapshot byproduct images removed (those stamped\n\t * with `role: SNAPSHOT_IMAGE_ROLE` in this app/stack). Build images\n\t * are never included. */\n\treadonly imagesSwept: number;\n}\n\n// -----------------------------------------------------------------------------\n// Helpers\n// -----------------------------------------------------------------------------\n\nconst readMetaOpt = (\n\tdir: string,\n): Effect.Effect<SnapshotMetadata | null, PrunePhaseError, FileSystem.FileSystem> =>\n\tEffect.gen(function* () {\n\t\tconst fs = yield* FileSystem.FileSystem;\n\t\tconst path = `${dir}/meta.json`;\n\t\tconst exists = yield* fs.exists(path).pipe(Effect.catch(() => Effect.succeed(false)));\n\t\tif (!exists) return null;\n\t\tconst text = yield* fs\n\t\t\t.readFileString(path)\n\t\t\t.pipe(Effect.catch(failPhase('read-meta', `read ${path} failed`)));\n\t\treturn yield* decodeJsonText(SnapshotMetadataSchema, text, {\n\t\t\tsource: path,\n\t\t\tmkError: () => null,\n\t\t}).pipe(Effect.catch(() => Effect.succeed(null)));\n\t});\n\n// -----------------------------------------------------------------------------\n// Top-level prune\n// -----------------------------------------------------------------------------\n\n/**\n * Walk the snapshot catalog and reap partial artifacts (entries whose\n * `meta.json` is missing or unparseable). Concurrent sweeps over the\n * same catalog are not supported (caller holds `stack.lock`).\n *\n * Also removes committed snapshot byproduct images via the runtime\n * adapter's label-filtered image cleanup, scoped to `role:\n * SNAPSHOT_IMAGE_ROLE` so build images are never touched.\n *\n * Routed through the unified reconcile: a flat LABEL-scope spec narrowed\n * to `role: SNAPSHOT_IMAGE_ROLE`, carrying NO container target (prune\n * mutates no containers — `target: 'running'` is the label-scope no-op\n * container target) and an `fsPlan` of two ops — `reap-meta-missing`\n * (catalog GC) then `reap-images` (byproduct image sweep). Prune never\n * touches the live deploy cache — only the snapshot byproducts (the image\n * GC); the `PruneResult` shape carries `reaped` + `imagesSwept`.\n */\nexport const runPrune = (\n\tinputs: PruneInputs,\n): Effect.Effect<PruneResult, PrunePhaseError, FileSystem.FileSystem> =>\n\tEffect.gen(function* () {\n\t\tconst catalogDir = `${inputs.stackRoot}/${SNAPSHOTS_DIR_NAME}`;\n\n\t\t// Catalog GC — reap partial artifacts (no readable meta). The\n\t\t// `isMetaMissing` classifier is prune's projection: a\n\t\t// `readMetaOpt` read+decode lifted to a predicate.\n\t\tconst reapMetaMissing: ReconcileFsOp<PrunePhaseError> = {\n\t\t\top: 'reap-meta-missing',\n\t\t\tcatalogDir,\n\t\t\tisMetaMissing: (dir) => readMetaOpt(dir).pipe(Effect.map((meta) => meta === null)),\n\t\t\tonReaddirError: failPhase('enumerate-catalog', `readdir ${catalogDir} failed`),\n\t\t\tonRemoveError: failPhase('sweep-directories', `remove catalog entry failed`),\n\t\t};\n\n\t\t// Byproduct image sweep — architecture § Decision §8. The\n\t\t// `role: SNAPSHOT_IMAGE_ROLE` narrowing (carried on the label tuple)\n\t\t// distinguishes these byproducts from the live stack's build images\n\t\t// (which share `{app, stack}` but carry a different role / no role) —\n\t\t// without it, prune would untag build images and force silent\n\t\t// rebuilds.\n\t\tconst reapImages: ReconcileFsOp<PrunePhaseError> = {\n\t\t\top: 'reap-images',\n\t\t\tonError: failPhase('sweep-images', `image sweep failed`),\n\t\t};\n\n\t\tconst result = yield* reconcileLabel(\n\t\t\treconcileSpec<PrunePhaseError>({\n\t\t\t\t// No container target — prune mutates no containers. Label-scope\n\t\t\t\t// only sweeps containers/networks/volumes when `target` is\n\t\t\t\t// `absent`; `running` leaves them untouched.\n\t\t\t\ttarget: 'running',\n\t\t\t\tscope: labelScope({\n\t\t\t\t\tapp: appName(inputs.imageLabelFilter.app),\n\t\t\t\t\tstack: stackName(inputs.imageLabelFilter.stack),\n\t\t\t\t\trole: SNAPSHOT_IMAGE_ROLE,\n\t\t\t\t}),\n\t\t\t\tdirection: 'drain',\n\t\t\t\tfsPlan: { ops: [reapMetaMissing, reapImages] },\n\t\t\t}),\n\t\t\t{ runtime: inputs.runtime },\n\t\t);\n\n\t\treturn {\n\t\t\tinspected: result.inspected,\n\t\t\treaped: result.reapedIds.map((id) => ({ id, classification: 'abandoned' as const })),\n\t\t\timagesSwept: result.imagesSwept,\n\t\t} satisfies PruneResult;\n\t});\n"],"mappings":";;;;;;;;;;;AAuCA,IAAa,kBAAb,cAAqC,OAAO,iBAAkC,CAAC,CAC9E,2BACA;CACC,OAAO,OAAO,SAAS;EAAC;EAAqB;EAAa;EAAgB;CAAmB,CAAC;CAC9F,QAAQ,OAAO;CACf,OAAO,OAAO,SAAS,OAAO,MAAM;AACrC,CACD,CAAC,CAAC,CAAC;AAEH,MAAM,YAAY,gBAAgB,eAAe;AAmCjD,MAAM,eACL,QAEA,OAAO,IAAI,aAAa;CACvB,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,OAAO,GAAG,IAAI;CAEpB,IAAI,EAAC,OADiB,GAAG,OAAO,IAAI,CAAC,CAAC,KAAK,OAAO,YAAY,OAAO,QAAQ,KAAK,CAAC,CAAC,IACvE,OAAO;CAIpB,OAAO,OAAO,eAAe,wBAAwB,OAHjC,GAClB,eAAe,IAAI,CAAC,CACpB,KAAK,OAAO,MAAM,UAAU,aAAa,QAAQ,KAAK,QAAQ,CAAC,CAAC,GACP;EAC1D,QAAQ;EACR,eAAe;CAChB,CAAC,CAAC,CAAC,KAAK,OAAO,YAAY,OAAO,QAAQ,IAAI,CAAC,CAAC;AACjD,CAAC;;;;;;;;;;;;;;;;;;AAuBF,MAAa,YACZ,WAEA,OAAO,IAAI,aAAa;CACvB,MAAM,aAAa,GAAG,OAAO,UAAU,GAAG;CAK1C,MAAM,kBAAkD;EACvD,IAAI;EACJ;EACA,gBAAgB,QAAQ,YAAY,GAAG,CAAC,CAAC,KAAK,OAAO,KAAK,SAAS,SAAS,IAAI,CAAC;EACjF,gBAAgB,UAAU,qBAAqB,WAAW,WAAW,QAAQ;EAC7E,eAAe,UAAU,qBAAqB,6BAA6B;CAC5E;CAQA,MAAM,aAA6C;EAClD,IAAI;EACJ,SAAS,UAAU,gBAAgB,oBAAoB;CACxD;CAEA,MAAM,SAAS,OAAO,eACrB,cAA+B;EAI9B,QAAQ;EACR,OAAO,WAAW;GACjB,KAAK,QAAQ,OAAO,iBAAiB,GAAG;GACxC,OAAO,UAAU,OAAO,iBAAiB,KAAK;GAC9C,MAAM;EACP,CAAC;EACD,WAAW;EACX,QAAQ,EAAE,KAAK,CAAC,iBAAiB,UAAU,EAAE;CAC9C,CAAC,GACD,EAAE,SAAS,OAAO,QAAQ,CAC3B;CAEA,OAAO;EACN,WAAW,OAAO;EAClB,QAAQ,OAAO,UAAU,KAAK,QAAQ;GAAE;GAAI,gBAAgB;EAAqB,EAAE;EACnF,aAAa,OAAO;CACrB;AACD,CAAC"}
|
|
@@ -3,16 +3,18 @@ import { runtimeControlLockPathForStackRoot } from "../../substrate/runtime/cros
|
|
|
3
3
|
import { COMMAND_CHANNEL_COMMANDS_FILE_NAME, COMMAND_CHANNEL_EVENTS_FILE_NAME } from "../../substrate/runtime/cross-process/command-channel/channel.mjs";
|
|
4
4
|
import "../../substrate/runtime/cross-process/command-channel/index.mjs";
|
|
5
5
|
import { mintRandomSuffix } from "../../substrate/runtime/random-suffix.mjs";
|
|
6
|
+
import { finishTarReader, makeTarReaderState, processTarChunk, skipEntry, stopScan } from "../../substrate/runtime/tar/reader.mjs";
|
|
6
7
|
import { HostTreeTarError, untarHostTree, validateHostTreeTarEntries } from "../../substrate/runtime/host-tree-tar/index.mjs";
|
|
7
|
-
import { ContributionDocSchema,
|
|
8
|
+
import { ContributionDocSchema, SnapshotLayout, SnapshotMetadataSchema, containerImagesBundlePath, contributionPath, deployCacheSubtreeRelPaths, isRestorableContainerImageName, isSafeSnapshotPathSegment, isSafeSnapshotRelativePath, parseSnapshotId } from "./descriptor.mjs";
|
|
9
|
+
import "../../substrate/runtime/stage-and-swap/index.mjs";
|
|
10
|
+
import { executeFsPlan } from "../../substrate/runtime/reconcile/fs-plan.mjs";
|
|
11
|
+
import "../../substrate/runtime/reconcile/index.mjs";
|
|
8
12
|
import { makePhaseFailer } from "./phase-error.mjs";
|
|
9
13
|
import { CACHE_DIR_NAME, SNAPSHOTS_DIR_NAME } from "./wipe.mjs";
|
|
10
14
|
import { readImageBundleTags, verifyImageBundleTags } from "./image-bundle-tags.mjs";
|
|
11
15
|
import { verifyArtifactIntegrity } from "./integrity.mjs";
|
|
12
|
-
import { mergeContributions, runIdentityGuard, runRuntimeIdentityGuard } from "./identity-guard.mjs";
|
|
13
|
-
import {
|
|
14
|
-
import { RESTORE_PENDING_FILE_NAME, RestorePendingDocumentSchema, makePendingMarkerDocument, pendingMarkerPath, removePendingMarker, rewritePendingMarkerContainers, writePendingMarker } from "./pending-marker.mjs";
|
|
15
|
-
import { stageAndSwap } from "../../substrate/runtime/stage-and-swap/index.mjs";
|
|
16
|
+
import { mergeContributions, requireIdentity, runIdentityGuard, runRuntimeIdentityGuard } from "./identity-guard.mjs";
|
|
17
|
+
import { clearRestoreSentinel, writeRestoreSentinel } from "./interrupted-restore.mjs";
|
|
16
18
|
import { Effect, Exit, FileSystem, Schema, Stream } from "effect";
|
|
17
19
|
//#region src/orchestrators/snapshot/restore.ts
|
|
18
20
|
/** Tagged failure during a restore step. Phase discriminates the
|
|
@@ -22,22 +24,20 @@ var RestorePhaseError = class extends Schema.TaggedErrorClass()("SnapshotRestore
|
|
|
22
24
|
"read-meta",
|
|
23
25
|
"meta-corrupt",
|
|
24
26
|
"meta-absent",
|
|
25
|
-
"read-state",
|
|
26
27
|
"read-contribution",
|
|
27
28
|
"read-integrity",
|
|
28
29
|
"verify-integrity",
|
|
29
30
|
"preflight",
|
|
31
|
+
"cache-missing",
|
|
30
32
|
"pre-restore-hook",
|
|
31
33
|
"untar-host-tree",
|
|
32
34
|
"load-image",
|
|
33
35
|
"retag-image",
|
|
34
|
-
"expand-state",
|
|
35
36
|
"post-restore-hook",
|
|
36
37
|
"pre-cleanup",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"missing-subtree-fatal"
|
|
38
|
+
"resume",
|
|
39
|
+
"missing-subtree-fatal",
|
|
40
|
+
"graph-input-mismatch"
|
|
41
41
|
]),
|
|
42
42
|
plugin: Schema.optional(Schema.String),
|
|
43
43
|
detail: Schema.String,
|
|
@@ -55,15 +55,6 @@ const failImageBundleTagScan = (phase, plugin) => (cause) => Effect.fail(new Res
|
|
|
55
55
|
detail: cause.detail,
|
|
56
56
|
cause
|
|
57
57
|
}));
|
|
58
|
-
/** Project a `SnapshotStateDocumentError` onto a `RestorePhaseError`,
|
|
59
|
-
* branching by `kind` so a phase classifier never inspects message
|
|
60
|
-
* substrings. */
|
|
61
|
-
const failStateDocument = (readPhase, writePhase, plugin) => (err) => Effect.fail(new RestorePhaseError({
|
|
62
|
-
phase: err.kind === "write" ? writePhase : readPhase,
|
|
63
|
-
plugin,
|
|
64
|
-
detail: err.detail,
|
|
65
|
-
cause: err.cause
|
|
66
|
-
}));
|
|
67
58
|
const readMeta = (artifactDir, expectedId) => Effect.gen(function* () {
|
|
68
59
|
const fs = yield* FileSystem.FileSystem;
|
|
69
60
|
const path = `${artifactDir}/${SnapshotLayout.metaFile}`;
|
|
@@ -90,7 +81,7 @@ const readMeta = (artifactDir, expectedId) => Effect.gen(function* () {
|
|
|
90
81
|
if (parsedId === null) return yield* failRestore("meta-corrupt", `meta.json contains an unsafe snapshot id: ${meta.id}`);
|
|
91
82
|
if (parsedId !== expectedId) return yield* failRestore("meta-corrupt", `meta.json id ${meta.id} does not match requested snapshot id ${expectedId}`);
|
|
92
83
|
return meta;
|
|
93
|
-
})
|
|
84
|
+
});
|
|
94
85
|
const verifyIntegrity = (artifactDir) => verifyArtifactIntegrity(artifactDir).pipe(Effect.catchTag("SnapshotIntegrityError", (err) => Effect.fail(new RestorePhaseError({
|
|
95
86
|
phase: err.kind === "missing" ? "read-integrity" : "verify-integrity",
|
|
96
87
|
detail: err.detail,
|
|
@@ -107,13 +98,6 @@ const removeCapturedContainers = (meta, runtime, runtimeIdentity) => Effect.gen(
|
|
|
107
98
|
plugin: captured.plugin,
|
|
108
99
|
role: captured.role
|
|
109
100
|
}).pipe(Effect.catch(failPhase("pre-cleanup", `remove managed containers for ${captured.plugin}/${captured.role} failed`, captured.plugin)));
|
|
110
|
-
}).pipe(Effect.withSpan("orchestrator.snapshot.restore.remove-containers"));
|
|
111
|
-
const stagedImageToPendingEntry = (image) => ({
|
|
112
|
-
plugin: image.captured.plugin,
|
|
113
|
-
role: image.captured.role,
|
|
114
|
-
targetImageName: image.captured.imageName,
|
|
115
|
-
stagedImageTag: image.stagedImageTag,
|
|
116
|
-
digest: image.stagedRef.digest
|
|
117
101
|
});
|
|
118
102
|
const loadedBundleTags = (bundle) => {
|
|
119
103
|
const tags = /* @__PURE__ */ new Set();
|
|
@@ -121,42 +105,6 @@ const loadedBundleTags = (bundle) => {
|
|
|
121
105
|
return tags;
|
|
122
106
|
};
|
|
123
107
|
const mintRestoreStagingTag = () => `devstack-snapshot:restore-${mintRandomSuffix(24)}`;
|
|
124
|
-
const mapMarkerIoError = (phase) => (err) => Effect.fail(new RestorePhaseError({
|
|
125
|
-
phase,
|
|
126
|
-
detail: err.detail,
|
|
127
|
-
cause: err.cause
|
|
128
|
-
}));
|
|
129
|
-
const writeRestorePendingMarker = (args) => {
|
|
130
|
-
if (args.stagedImages.length === 0) return Effect.void;
|
|
131
|
-
const doc = makePendingMarkerDocument({
|
|
132
|
-
meta: args.meta,
|
|
133
|
-
artifactDir: args.artifactDir,
|
|
134
|
-
containers: args.stagedImages.map(stagedImageToPendingEntry)
|
|
135
|
-
});
|
|
136
|
-
return writePendingMarker(args.runtimeRoot, doc).pipe(Effect.catchTag("SnapshotRestorePendingMarkerIoError", mapMarkerIoError("write-restore-pending")));
|
|
137
|
-
};
|
|
138
|
-
const rewriteRestorePendingMarker = (runtimeRoot, doc, stillPending) => writePendingMarker(runtimeRoot, rewritePendingMarkerContainers(doc, stillPending)).pipe(Effect.catchTag("SnapshotRestorePendingMarkerIoError", mapMarkerIoError("write-restore-pending")));
|
|
139
|
-
const clearRestorePendingMarker = (runtimeRoot) => removePendingMarker(runtimeRoot).pipe(Effect.catchTag("SnapshotRestorePendingMarkerIoError", mapMarkerIoError("clear-restore-pending")));
|
|
140
|
-
const readRestorePendingMarker = (runtimeRoot) => Effect.gen(function* () {
|
|
141
|
-
const fs = yield* FileSystem.FileSystem;
|
|
142
|
-
const path = pendingMarkerPath(runtimeRoot);
|
|
143
|
-
if (!(yield* fs.exists(path).pipe(Effect.catch(() => Effect.succeed(false))))) return null;
|
|
144
|
-
return yield* decodeUnknown(RestorePendingDocumentSchema, yield* parseJsonText(yield* fs.readFileString(path).pipe(Effect.catch(failPhase("read-restore-pending", `read ${RESTORE_PENDING_FILE_NAME}`))), {
|
|
145
|
-
source: path,
|
|
146
|
-
mkError: (issue) => new RestorePhaseError({
|
|
147
|
-
phase: "read-restore-pending",
|
|
148
|
-
detail: `${RESTORE_PENDING_FILE_NAME} is not valid JSON`,
|
|
149
|
-
cause: issue.cause
|
|
150
|
-
})
|
|
151
|
-
}), {
|
|
152
|
-
source: path,
|
|
153
|
-
mkError: (issue) => new RestorePhaseError({
|
|
154
|
-
phase: "read-restore-pending",
|
|
155
|
-
detail: `${RESTORE_PENDING_FILE_NAME} failed schema decode`,
|
|
156
|
-
cause: issue.cause
|
|
157
|
-
})
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
108
|
const requirePathSegment = (kind, value, plugin) => isSafeSnapshotPathSegment(value) ? Effect.void : failRestore("preflight", `unsafe snapshot ${kind} path segment: ${value}`, plugin);
|
|
161
109
|
const requireReadableNonEmptyFile = (path, phase, detail, plugin) => Effect.gen(function* () {
|
|
162
110
|
const fs = yield* FileSystem.FileSystem;
|
|
@@ -204,8 +152,6 @@ const preflightArtifact = (meta, artifactDir) => Effect.gen(function* () {
|
|
|
204
152
|
seenSnapshotTags.set(captured.snapshotTag, captured);
|
|
205
153
|
}
|
|
206
154
|
for (const pluginKey of meta.participants) yield* preflightContributionDoc(pluginKey, artifactDir);
|
|
207
|
-
const statePath = `${artifactDir}/${SnapshotLayout.stateFile}`;
|
|
208
|
-
if (yield* fs.exists(statePath).pipe(Effect.catch(() => Effect.succeed(false)))) yield* readSnapshotStateDocument(statePath).pipe(Effect.catchTag("SnapshotStateDocumentError", failStateDocument("read-state", "expand-state")));
|
|
209
155
|
if (meta.hostTreeIncluded) {
|
|
210
156
|
const tarPath = `${artifactDir}/${SnapshotLayout.hostTreeTar}`;
|
|
211
157
|
yield* requireReadableNonEmptyFile(tarPath, "untar-host-tree", "host-tree tar is required");
|
|
@@ -216,7 +162,7 @@ const preflightArtifact = (meta, artifactDir) => Effect.gen(function* () {
|
|
|
216
162
|
cause
|
|
217
163
|
})))).pipe(Effect.catch(failPhase("untar-host-tree", `host-tree tar entry validation failed`)));
|
|
218
164
|
}
|
|
219
|
-
})
|
|
165
|
+
});
|
|
220
166
|
const loadImageBundle = (tarPath, artifactDir, runtime, expectedSnapshotTags) => Effect.gen(function* () {
|
|
221
167
|
const fs = yield* FileSystem.FileSystem;
|
|
222
168
|
const fullTarPath = `${artifactDir}/${tarPath}`;
|
|
@@ -236,7 +182,7 @@ const loadImageBundle = (tarPath, artifactDir, runtime, expectedSnapshotTags) =>
|
|
|
236
182
|
refsByTag.set(ref.tag, ref);
|
|
237
183
|
}
|
|
238
184
|
return refsByTag;
|
|
239
|
-
})
|
|
185
|
+
});
|
|
240
186
|
const expectedSnapshotTagsByBundle = (containers) => {
|
|
241
187
|
const byBundle = /* @__PURE__ */ new Map();
|
|
242
188
|
for (const captured of containers) {
|
|
@@ -259,22 +205,24 @@ const stageLoadedImage = (captured, loadedRef, runtime, registerStagedImage) =>
|
|
|
259
205
|
yield* registerStagedImage(stagedImage);
|
|
260
206
|
yield* runtime.tagImage(loadedRef, stagedImageTag, { removeSourceAfterTag: true }).pipe(Effect.catch(failPhase("retag-image", `tag restored image ${captured.snapshotTag} as staging ref ${stagedImageTag} failed`, captured.plugin)));
|
|
261
207
|
return stagedImage;
|
|
262
|
-
})
|
|
208
|
+
});
|
|
263
209
|
const cleanupRestoreStagingImages = (runtime, images) => Effect.forEach(images, (image) => runtime.removeImage(image.stagedRef).pipe(Effect.catch((cause) => Effect.logWarning(`remove restore staging image ${image.stagedImageTag} failed during restore cleanup: ${String(cause)}`))), { concurrency: "unbounded" }).pipe(Effect.asVoid);
|
|
264
|
-
/** Promote each staged image to its recorded name
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
210
|
+
/** Promote each staged image to its recorded TARGET name. The target
|
|
211
|
+
* name is the original image name the supervisor used for the
|
|
212
|
+
* container, so leaving the staged image at that name lets the next
|
|
213
|
+
* boot's image-match adoption (`decideRunAction`) find it locally and
|
|
214
|
+
* `docker run` it — no scanner, no on-disk marker. A mid-loop failure
|
|
215
|
+
* promotes a prefix of the images; the inner staging-cleanup scope
|
|
216
|
+
* prunes the un-promoted staging refs, and a re-run of restore re-stages
|
|
217
|
+
* and re-promotes from the snapshot artifact. */
|
|
218
|
+
const promoteStagedImages = (images, runtime) => Effect.gen(function* () {
|
|
219
|
+
for (const image of images) {
|
|
220
|
+
const oldDigest = yield* runtime.inspectImageDigest(image.captured.imageName).pipe(Effect.catch(() => Effect.succeed(null)));
|
|
274
221
|
yield* runtime.tagImage(image.stagedRef, image.captured.imageName, { removeSourceAfterTag: true }).pipe(Effect.catch(failPhase("retag-image", `tag staged image ${image.stagedImageTag} as ${image.captured.imageName} failed`, image.captured.plugin)));
|
|
275
|
-
|
|
222
|
+
const newDigest = yield* runtime.inspectImageDigest(image.captured.imageName).pipe(Effect.catch(() => Effect.succeed(null)));
|
|
223
|
+
if (oldDigest !== null && oldDigest !== newDigest) yield* runtime.removeImage({ digest: oldDigest }).pipe(Effect.catch((cause) => Effect.logWarning(`GC of superseded image layer ${oldDigest} for ${image.captured.imageName} failed (best-effort): ${String(cause)}`)));
|
|
276
224
|
}
|
|
277
|
-
})
|
|
225
|
+
});
|
|
278
226
|
const restoreHostTree = (artifactDir, target) => Effect.gen(function* () {
|
|
279
227
|
const fs = yield* FileSystem.FileSystem;
|
|
280
228
|
const tarPath = `${artifactDir}/${SnapshotLayout.hostTreeTar}`;
|
|
@@ -289,150 +237,227 @@ const restoreHostTree = (artifactDir, target) => Effect.gen(function* () {
|
|
|
289
237
|
cause
|
|
290
238
|
})));
|
|
291
239
|
yield* Effect.scoped(untarHostTree(tarStream, { target })).pipe(Effect.catch(failPhase("untar-host-tree", `untar ${tarPath} to ${target} failed`)));
|
|
292
|
-
})
|
|
240
|
+
});
|
|
293
241
|
const LIVE_RESTORE_PRESERVED_PATHS = [
|
|
294
|
-
{
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
{
|
|
299
|
-
relativePath: COMMAND_CHANNEL_COMMANDS_FILE_NAME,
|
|
300
|
-
kind: "file"
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
relativePath: COMMAND_CHANNEL_EVENTS_FILE_NAME,
|
|
304
|
-
kind: "file"
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
relativePath: "roster.json",
|
|
308
|
-
kind: "file"
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
relativePath: "container-claims.json",
|
|
312
|
-
kind: "file"
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
relativePath: "snapshot.reservation",
|
|
316
|
-
kind: "file"
|
|
317
|
-
},
|
|
318
|
-
...DEPLOY_CACHE_NAMESPACES.map((namespace) => ({
|
|
319
|
-
relativePath: `${CACHE_DIR_NAME}/${namespace}`,
|
|
320
|
-
kind: "directory",
|
|
321
|
-
overwrite: false
|
|
322
|
-
}))
|
|
242
|
+
{ relativePath: SNAPSHOTS_DIR_NAME },
|
|
243
|
+
{ relativePath: COMMAND_CHANNEL_COMMANDS_FILE_NAME },
|
|
244
|
+
{ relativePath: COMMAND_CHANNEL_EVENTS_FILE_NAME },
|
|
245
|
+
{ relativePath: "roster.json" }
|
|
323
246
|
];
|
|
247
|
+
/** The deploy-cache subtree relPaths (`cache/<ns>`) the snapshot RECORDS as
|
|
248
|
+
* captured in its metadata. Capture tars a namespace only if it existed on disk
|
|
249
|
+
* (`missingTolerance: 'fine'`) and writes `meta.subtrees` AFTER a successful
|
|
250
|
+
* tar, so a relPath here means "this snapshot intended to carry this cache
|
|
251
|
+
* namespace". A disabled-plugin namespace (e.g. `cache/deepbook` in a
|
|
252
|
+
* deepbook-less stack) is simply absent from the list, so the preflight never
|
|
253
|
+
* over-requires it. */
|
|
254
|
+
const recordedDeployCacheRelPaths = (meta) => {
|
|
255
|
+
const expected = new Set(deployCacheSubtreeRelPaths(CACHE_DIR_NAME));
|
|
256
|
+
const recorded = [];
|
|
257
|
+
for (const subtree of meta.subtrees) if (expected.has(subtree.relPath)) recorded.push(subtree.relPath);
|
|
258
|
+
return recorded;
|
|
259
|
+
};
|
|
260
|
+
/** Stream the host-tree tar and collect which of `expectedRelPaths` physically
|
|
261
|
+
* appear as an entry prefix. An entry path `cache/<ns>/<chain>/<hash>.json`
|
|
262
|
+
* (or the bare `cache/<ns>/` directory) marks `cache/<ns>` present. Read-only:
|
|
263
|
+
* bodies are skipped, never buffered. */
|
|
264
|
+
const scanHostTreeCacheRelPaths = (artifactDir, expectedRelPaths) => Effect.gen(function* () {
|
|
265
|
+
const fs = yield* FileSystem.FileSystem;
|
|
266
|
+
const tarPath = `${artifactDir}/${SnapshotLayout.hostTreeTar}`;
|
|
267
|
+
const present = /* @__PURE__ */ new Set();
|
|
268
|
+
const state = makeTarReaderState();
|
|
269
|
+
const matchEntry = (entryPath) => {
|
|
270
|
+
for (const rel of expectedRelPaths) {
|
|
271
|
+
if (present.has(rel)) continue;
|
|
272
|
+
if (entryPath === rel || entryPath.startsWith(`${rel}/`)) present.add(rel);
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
const hooks = {
|
|
276
|
+
onEntry: (entry) => {
|
|
277
|
+
matchEntry(entry.path);
|
|
278
|
+
return present.size === expectedRelPaths.length ? stopScan() : skipEntry();
|
|
279
|
+
},
|
|
280
|
+
onExtendedError: (detail) => new RestorePhaseError({
|
|
281
|
+
phase: "cache-missing",
|
|
282
|
+
detail
|
|
283
|
+
})
|
|
284
|
+
};
|
|
285
|
+
const tarStream = fs.stream(tarPath).pipe(Stream.mapError((cause) => new RestorePhaseError({
|
|
286
|
+
phase: "cache-missing",
|
|
287
|
+
detail: `read host-tree tar failed at ${tarPath}`,
|
|
288
|
+
cause
|
|
289
|
+
})), Stream.takeWhile(() => !state.stopped));
|
|
290
|
+
yield* Stream.runForEach(tarStream, (chunk) => {
|
|
291
|
+
const error = processTarChunk(state, chunk, hooks);
|
|
292
|
+
return error === null ? Effect.void : Effect.fail(error);
|
|
293
|
+
});
|
|
294
|
+
const finalError = finishTarReader(state, (detail) => new RestorePhaseError({
|
|
295
|
+
phase: "cache-missing",
|
|
296
|
+
detail
|
|
297
|
+
}));
|
|
298
|
+
if (finalError !== null) return yield* Effect.fail(finalError);
|
|
299
|
+
return present;
|
|
300
|
+
});
|
|
324
301
|
/**
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
302
|
+
* The SNAPSHOT's host-tree `cache/<DEPLOY_CACHE_NAMESPACES>` is the SOLE source
|
|
303
|
+
* of the on-chain deploy/mint ids on restore (capture tars `cache/<ns>` into the
|
|
304
|
+
* artifact; restore untars it and does NOT preserve-from-live — see
|
|
305
|
+
* LIVE_RESTORE_PRESERVED_PATHS). So the cache check is against the SNAPSHOT, not
|
|
306
|
+
* the live stack — which is exactly what makes a CROSS-MACHINE restore work: a
|
|
307
|
+
* fresh runner has an empty live cache, and the snapshot supplies the ids.
|
|
328
308
|
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
* - Re-read contribution docs.
|
|
338
|
-
* - Load image bundles and stage verified snapshot tags.
|
|
339
|
-
* - Write a restore-pending marker into the staged root.
|
|
340
|
-
* 5. Atomic swap staging → runtime root, preserving live command /
|
|
341
|
-
* event channel files and other explicit runtime-control files.
|
|
342
|
-
* 6. Promote staged images to recorded refs, then remove captured
|
|
343
|
-
* managed containers by label. If this fails, the pending marker
|
|
344
|
-
* remains in the restored root for diagnosis/recovery.
|
|
345
|
-
* 7. Post-restore hooks.
|
|
309
|
+
* Refuse (fail-closed, BEFORE any mutation, matching the identity-guard posture)
|
|
310
|
+
* if the snapshot's cache is NOT self-contained: every deploy-cache namespace
|
|
311
|
+
* the metadata RECORDS as captured must be physically present in the host-tree
|
|
312
|
+
* tar. A partial loss (metadata claims `cache/<ns>` but the tar lacks it — a
|
|
313
|
+
* corrupted/tampered artifact) would let the post-restore boot re-deploy that
|
|
314
|
+
* namespace with FRESH ids and orphan its pre-snapshot objects. Requiring ALL
|
|
315
|
+
* recorded namespaces (not just ANY one) is the FIX over the prior "any one dir
|
|
316
|
+
* present" check, which passed a partial cache and re-minted the rest.
|
|
346
317
|
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
318
|
+
* A snapshot that records NO deploy-cache subtrees (a genuine pre-deploy /
|
|
319
|
+
* empty-stack capture) has nothing to verify and passes — there are no minted
|
|
320
|
+
* ids to lose. The matrix's hard-reset phase asserts the loud re-deploy on a
|
|
321
|
+
* post-restore live-cache wipe.
|
|
322
|
+
*/
|
|
323
|
+
const requireSnapshotDeployCache = (meta, artifactDir) => Effect.gen(function* () {
|
|
324
|
+
const recorded = recordedDeployCacheRelPaths(meta);
|
|
325
|
+
if (recorded.length === 0) return;
|
|
326
|
+
if (!meta.hostTreeIncluded) return yield* failRestore("cache-missing", `snapshot metadata records deploy-cache subtrees (${recorded.join(", ")}) but the artifact carries no host-tree tar. The snapshot's cache is the SOLE source of the on-chain deploy/mint ids restore reuses; restoring without it would let the next boot re-deploy with FRESH ids and orphan every pre-snapshot object. Refusing.`);
|
|
327
|
+
const present = yield* scanHostTreeCacheRelPaths(artifactDir, recorded);
|
|
328
|
+
const missing = recorded.filter((rel) => !present.has(rel));
|
|
329
|
+
if (missing.length > 0) return yield* failRestore("cache-missing", `snapshot host-tree is missing deploy-cache namespaces it recorded as captured (${missing.join(", ")}). The snapshot's cache is the SOLE source of the on-chain deploy/mint ids restore reuses; a partial cache would let the next boot re-deploy the missing namespaces with FRESH ids and orphan their pre-snapshot objects. Refusing.`);
|
|
330
|
+
});
|
|
331
|
+
const graphInputMismatchDetail = (snapshotGraphInputId, currentGraphInputId) => `snapshot graph input id ${snapshotGraphInputId} does not match current graph input id ${currentGraphInputId}; restoring may create inconsistent state`;
|
|
332
|
+
const checkGraphInputCompatibility = (meta, current, policy) => {
|
|
333
|
+
if (current === void 0) return Effect.void;
|
|
334
|
+
if (meta.graphInput.graphInputId === current.graphInputId) return Effect.void;
|
|
335
|
+
const detail = graphInputMismatchDetail(meta.graphInput.graphInputId, current.graphInputId);
|
|
336
|
+
if (policy === "block") return Effect.fail(new RestorePhaseError({
|
|
337
|
+
phase: "graph-input-mismatch",
|
|
338
|
+
detail
|
|
339
|
+
}));
|
|
340
|
+
return Effect.logWarning(detail);
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* Run the full restore. Routed through the unified reconcile as an
|
|
344
|
+
* ORDERED 4-step body — restore is NOT a single converge target
|
|
345
|
+
* but a destructive ordered pair around an fs swap:
|
|
346
|
+
*
|
|
347
|
+
* step0 — PRECONDITION: identity-guard, FAIL-CLOSED BEFORE ANY MUTATION.
|
|
348
|
+
* The runtime-identity guard + merged plugin-contribution guard
|
|
349
|
+
* complete BEFORE the first mutation (the docker load/tag inside
|
|
350
|
+
* the swap-tree build). On mismatch the sweep / load / tag spies
|
|
351
|
+
* stay EMPTY — zero mutations (restore.test `:214/:263`). Keep
|
|
352
|
+
* the pure meta read → guard → only then mutate ordering.
|
|
353
|
+
* step1 — fsPlan `swap-tree(untar)`: a single-op `ReconcileFsPlan` run
|
|
354
|
+
* through `executeFsPlan`, which publishes the new tree via the
|
|
355
|
+
* UNCHANGED `stageAndSwap`. The build untars the host-tree +
|
|
356
|
+
* loads/stages the committed image bundle into staging; the
|
|
357
|
+
* atomic swap preserves the RESTORE preserve list
|
|
358
|
+
* (`LIVE_RESTORE_PRESERVED_PATHS` — per-namespace live cache +
|
|
359
|
+
* control files, a restore-direction constant, NOT wipe's
|
|
360
|
+
* wholesale predicate). Promote staged
|
|
361
|
+
* images to their captured TARGET names is the swap step's
|
|
362
|
+
* docker tail.
|
|
363
|
+
* step2 R1 — HARD container removal (target = absent, label scope,
|
|
364
|
+
* policy-independent, unconditional, claim-bypassing) via
|
|
365
|
+
* `removeManagedContainers`. STRICTLY before R2. Never expressed
|
|
366
|
+
* as flip-image-and-let-decideRunAction-recreate (guardrail
|
|
367
|
+
* §3.6).
|
|
368
|
+
* step2 R2 — CONVERGE (recreate-from-fresh): NOT in `runRestore`. R1
|
|
369
|
+
* removed the containers, so the NEXT acquire (the live
|
|
370
|
+
* supervisor's `doSelectiveRestart`, itself routed through
|
|
371
|
+
* `reconcileGraph`, or the offline CLI's next-boot acquire) sees
|
|
372
|
+
* facts:null → fresh → creates from the RESTORED images. Verb is
|
|
373
|
+
* recreate-from-fresh, NOT adopt.
|
|
374
|
+
*
|
|
375
|
+
* Bracketed-atomic at the runtime-root level — external watchers never
|
|
376
|
+
* observe a half-restored tree. The caller holds `stack.lock` for the
|
|
377
|
+
* bounded snapshot window; restore supplies the runtime-control publish lock
|
|
378
|
+
* to the swap-tree op.
|
|
349
379
|
*/
|
|
350
380
|
const runRestore = (inputs) => Effect.gen(function* () {
|
|
351
|
-
yield* Effect.annotateCurrentSpan({
|
|
352
|
-
"devstack.snapshot.phase": "restore",
|
|
353
|
-
"devstack.snapshot.artifact": inputs.artifactDir
|
|
354
|
-
});
|
|
355
381
|
const meta = yield* readMeta(inputs.artifactDir, inputs.snapshotId);
|
|
356
382
|
yield* verifyIntegrity(inputs.artifactDir);
|
|
383
|
+
yield* checkGraphInputCompatibility(meta, inputs.currentGraphInput, inputs.graphInputMismatchPolicy);
|
|
357
384
|
yield* runRuntimeIdentityGuard({
|
|
358
385
|
app: meta.app,
|
|
359
386
|
stack: meta.stack,
|
|
360
387
|
network: meta.network
|
|
361
388
|
}, inputs.runtimeIdentity);
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
389
|
+
if (inputs.participants.length === 0) yield* requireIdentity(meta.identity, "snapshot");
|
|
390
|
+
else {
|
|
391
|
+
const liveContributions = [];
|
|
392
|
+
for (const participant of inputs.participants) {
|
|
393
|
+
const slice = yield* participant.liveIdentity;
|
|
394
|
+
liveContributions.push({
|
|
395
|
+
plugin: participant.plugin,
|
|
396
|
+
slice
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
const live = yield* mergeContributions(liveContributions);
|
|
400
|
+
yield* runIdentityGuard(meta.identity, live);
|
|
369
401
|
}
|
|
370
|
-
|
|
371
|
-
yield* runIdentityGuard(meta.identity, live);
|
|
402
|
+
yield* requireSnapshotDeployCache(meta, inputs.artifactDir);
|
|
372
403
|
for (const participant of inputs.participants) if (participant.preRestore) yield* participant.preRestore.pipe(Effect.catch(failPhase("pre-restore-hook", `preRestore failed`, participant.plugin)));
|
|
373
404
|
yield* preflightArtifact(meta, inputs.artifactDir);
|
|
374
405
|
yield* Effect.scoped(Effect.gen(function* () {
|
|
375
406
|
const stagedImages = [];
|
|
376
407
|
let recoveryHandoffComplete = false;
|
|
377
408
|
yield* Effect.addFinalizer((exit) => Exit.isFailure(exit) && !recoveryHandoffComplete ? cleanupRestoreStagingImages(inputs.runtime, stagedImages) : Effect.void);
|
|
378
|
-
|
|
409
|
+
const swapBuild = Effect.gen(function* () {
|
|
410
|
+
if (meta.hostTreeIncluded) yield* restoreHostTree(inputs.artifactDir, inputs.runtimeStagingPath);
|
|
411
|
+
const fs = yield* FileSystem.FileSystem;
|
|
412
|
+
for (const pluginKey of meta.participants) {
|
|
413
|
+
const path = `${inputs.artifactDir}/${contributionPath(pluginKey)}`;
|
|
414
|
+
if (!(yield* fs.exists(path).pipe(Effect.catch(() => Effect.succeed(false))))) return yield* Effect.fail(new RestorePhaseError({
|
|
415
|
+
phase: "read-contribution",
|
|
416
|
+
plugin: pluginKey,
|
|
417
|
+
detail: `contribution doc absent at ${path}`
|
|
418
|
+
}));
|
|
419
|
+
}
|
|
420
|
+
const expectedTagsByBundle = expectedSnapshotTagsByBundle(meta.containers);
|
|
421
|
+
const loadedRefsBySnapshotTag = /* @__PURE__ */ new Map();
|
|
422
|
+
for (const [tarPath, expectedTags] of expectedTagsByBundle) {
|
|
423
|
+
const loadedRefs = yield* loadImageBundle(tarPath, inputs.artifactDir, inputs.runtime, expectedTags);
|
|
424
|
+
for (const [tag, ref] of loadedRefs) loadedRefsBySnapshotTag.set(tag, ref);
|
|
425
|
+
}
|
|
426
|
+
for (const captured of meta.containers) {
|
|
427
|
+
const loadedRef = loadedRefsBySnapshotTag.get(captured.snapshotTag);
|
|
428
|
+
if (loadedRef === void 0) return yield* failRestore("load-image", `container image bundle did not return loaded ref for ${captured.snapshotTag}`, captured.plugin);
|
|
429
|
+
yield* stageLoadedImage(captured, loadedRef, inputs.runtime, (image) => Effect.sync(() => {
|
|
430
|
+
stagedImages.push(image);
|
|
431
|
+
}));
|
|
432
|
+
}
|
|
433
|
+
yield* writeRestoreSentinel(inputs.runtimeStagingPath, {
|
|
434
|
+
snapshotId: inputs.snapshotId,
|
|
435
|
+
artifactDir: inputs.artifactDir
|
|
436
|
+
});
|
|
437
|
+
return stagedImages;
|
|
438
|
+
});
|
|
439
|
+
yield* executeFsPlan({ ops: [{
|
|
440
|
+
op: "swap-tree",
|
|
379
441
|
targetPath: inputs.runtimeStackRoot,
|
|
380
442
|
stagingPath: inputs.runtimeStagingPath,
|
|
381
443
|
backupPath: inputs.runtimeBackupPath,
|
|
444
|
+
buildEffect: swapBuild,
|
|
382
445
|
preserveFromTarget: LIVE_RESTORE_PRESERVED_PATHS,
|
|
383
446
|
publishLockPath: runtimeControlLockPathForStackRoot(inputs.runtimeStackRoot),
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
const path = `${inputs.artifactDir}/${contributionPath(pluginKey)}`;
|
|
394
|
-
if (!(yield* fs.exists(path).pipe(Effect.catch(() => Effect.succeed(false))))) return yield* Effect.fail(new RestorePhaseError({
|
|
395
|
-
phase: "read-contribution",
|
|
396
|
-
plugin: pluginKey,
|
|
397
|
-
detail: `contribution doc absent at ${path}`
|
|
398
|
-
}));
|
|
399
|
-
}
|
|
400
|
-
const expectedTagsByBundle = expectedSnapshotTagsByBundle(meta.containers);
|
|
401
|
-
const loadedRefsBySnapshotTag = /* @__PURE__ */ new Map();
|
|
402
|
-
for (const [tarPath, expectedTags] of expectedTagsByBundle) {
|
|
403
|
-
const loadedRefs = yield* loadImageBundle(tarPath, inputs.artifactDir, inputs.runtime, expectedTags);
|
|
404
|
-
for (const [tag, ref] of loadedRefs) loadedRefsBySnapshotTag.set(tag, ref);
|
|
405
|
-
}
|
|
406
|
-
for (const captured of meta.containers) {
|
|
407
|
-
const loadedRef = loadedRefsBySnapshotTag.get(captured.snapshotTag);
|
|
408
|
-
if (loadedRef === void 0) return yield* failRestore("load-image", `container image bundle did not return loaded ref for ${captured.snapshotTag}`, captured.plugin);
|
|
409
|
-
yield* stageLoadedImage(captured, loadedRef, inputs.runtime, (image) => Effect.sync(() => {
|
|
410
|
-
stagedImages.push(image);
|
|
411
|
-
}));
|
|
412
|
-
}
|
|
413
|
-
yield* writeRestorePendingMarker({
|
|
414
|
-
runtimeRoot: inputs.runtimeStagingPath,
|
|
415
|
-
meta,
|
|
416
|
-
artifactDir: inputs.artifactDir,
|
|
417
|
-
stagedImages
|
|
418
|
-
});
|
|
419
|
-
return stagedImages;
|
|
420
|
-
})
|
|
421
|
-
});
|
|
422
|
-
if (stagedImages.length > 0) {
|
|
423
|
-
const pendingDocAfterSwap = yield* readRestorePendingMarker(inputs.runtimeStackRoot);
|
|
424
|
-
yield* Effect.uninterruptible(Effect.gen(function* () {
|
|
425
|
-
yield* promoteStagedImages(stagedImages, inputs.runtime, inputs.runtimeStackRoot, pendingDocAfterSwap);
|
|
426
|
-
yield* removeCapturedContainers(meta, inputs.runtime, inputs.runtimeIdentity);
|
|
427
|
-
yield* clearRestorePendingMarker(inputs.runtimeStackRoot);
|
|
428
|
-
recoveryHandoffComplete = true;
|
|
429
|
-
}));
|
|
430
|
-
} else recoveryHandoffComplete = true;
|
|
447
|
+
onSwapError: (cause) => Effect.fail(cause)
|
|
448
|
+
}] });
|
|
449
|
+
if (stagedImages.length > 0) yield* Effect.uninterruptible(Effect.gen(function* () {
|
|
450
|
+
yield* promoteStagedImages(stagedImages, inputs.runtime);
|
|
451
|
+
yield* removeCapturedContainers(meta, inputs.runtime, inputs.runtimeIdentity);
|
|
452
|
+
recoveryHandoffComplete = true;
|
|
453
|
+
}));
|
|
454
|
+
else recoveryHandoffComplete = true;
|
|
455
|
+
yield* clearRestoreSentinel(inputs.runtimeStackRoot);
|
|
431
456
|
}));
|
|
432
457
|
for (const participant of inputs.participants) if (participant.postRestore) yield* participant.postRestore.pipe(Effect.catch(failPhase("post-restore-hook", `postRestore failed`, participant.plugin)));
|
|
433
458
|
return meta;
|
|
434
|
-
})
|
|
459
|
+
});
|
|
435
460
|
//#endregion
|
|
436
|
-
export { RestorePhaseError, runRestore };
|
|
461
|
+
export { RestorePhaseError, graphInputMismatchDetail, runRestore };
|
|
437
462
|
|
|
438
463
|
//# sourceMappingURL=restore.mjs.map
|