@rikalabs/akter 0.1.0-alpha.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/CHANGELOG.md +15 -0
- package/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +116 -0
- package/dist/actor/codecs.d.ts +77 -0
- package/dist/actor/codecs.js +87 -0
- package/dist/actor/connections.d.ts +34 -0
- package/dist/actor/connections.js +145 -0
- package/dist/actor/definition.d.ts +893 -0
- package/dist/actor/definition.js +147 -0
- package/dist/actor/descriptor.d.ts +172 -0
- package/dist/actor/descriptor.js +367 -0
- package/dist/actor/handles.d.ts +77 -0
- package/dist/actor/handles.js +265 -0
- package/dist/actor/jobs.d.ts +10 -0
- package/dist/actor/jobs.js +137 -0
- package/dist/actor/layers.d.ts +41 -0
- package/dist/actor/layers.js +177 -0
- package/dist/actor/reads.d.ts +47 -0
- package/dist/actor/reads.js +224 -0
- package/dist/actor/served.d.ts +120 -0
- package/dist/actor/served.js +72 -0
- package/dist/actor/turns.d.ts +13 -0
- package/dist/actor/turns.js +332 -0
- package/dist/actor/workflows.d.ts +16 -0
- package/dist/actor/workflows.js +37 -0
- package/dist/client/calls.d.ts +47 -0
- package/dist/client/calls.js +425 -0
- package/dist/client/clock.d.ts +56 -0
- package/dist/client/clock.js +119 -0
- package/dist/client/fleet-page.d.ts +15 -0
- package/dist/client/fleet-page.js +13 -0
- package/dist/client/fleet.d.ts +29 -0
- package/dist/client/fleet.js +51 -0
- package/dist/client/index.d.ts +17 -0
- package/dist/client/index.js +6 -0
- package/dist/client/make.d.ts +157 -0
- package/dist/client/make.js +221 -0
- package/dist/client/offline/queue.d.ts +118 -0
- package/dist/client/offline/queue.js +292 -0
- package/dist/client/offline/store.d.ts +74 -0
- package/dist/client/offline/store.js +78 -0
- package/dist/client/optimistic.d.ts +57 -0
- package/dist/client/optimistic.js +136 -0
- package/dist/client/report.d.ts +2 -0
- package/dist/client/report.js +8 -0
- package/dist/client/sessions/connection.d.ts +118 -0
- package/dist/client/sessions/connection.js +162 -0
- package/dist/client/sessions/feed.d.ts +42 -0
- package/dist/client/sessions/feed.js +43 -0
- package/dist/client/sessions/sse.d.ts +47 -0
- package/dist/client/sessions/sse.js +112 -0
- package/dist/client/sessions/stream.d.ts +28 -0
- package/dist/client/sessions/stream.js +35 -0
- package/dist/client/sessions/watch.d.ts +34 -0
- package/dist/client/sessions/watch.js +40 -0
- package/dist/client/transport.d.ts +37 -0
- package/dist/client/transport.js +66 -0
- package/dist/contexts/command.d.ts +132 -0
- package/dist/contexts/command.js +20 -0
- package/dist/contexts/connection.d.ts +68 -0
- package/dist/contexts/connection.js +0 -0
- package/dist/contexts/job.d.ts +49 -0
- package/dist/contexts/job.js +0 -0
- package/dist/contexts/workflow.d.ts +147 -0
- package/dist/contexts/workflow.js +22 -0
- package/dist/errors/actor.d.ts +200 -0
- package/dist/errors/actor.js +271 -0
- package/dist/errors/content.d.ts +19 -0
- package/dist/errors/content.js +14 -0
- package/dist/errors/database.d.ts +22 -0
- package/dist/errors/database.js +23 -0
- package/dist/errors/events.d.ts +17 -0
- package/dist/errors/events.js +14 -0
- package/dist/errors/subscription.d.ts +12 -0
- package/dist/errors/subscription.js +8 -0
- package/dist/errors/workflow.d.ts +28 -0
- package/dist/errors/workflow.js +17 -0
- package/dist/handles/actors.d.ts +17 -0
- package/dist/handles/actors.js +7 -0
- package/dist/handles/content.d.ts +59 -0
- package/dist/handles/content.js +36 -0
- package/dist/handles/intents.d.ts +164 -0
- package/dist/handles/intents.js +214 -0
- package/dist/handles/run.d.ts +31 -0
- package/dist/handles/run.js +21 -0
- package/dist/handles/workflow.d.ts +27 -0
- package/dist/handles/workflow.js +23 -0
- package/dist/identity/caller.d.ts +105 -0
- package/dist/identity/caller.js +68 -0
- package/dist/identity/child.d.ts +18 -0
- package/dist/identity/child.js +39 -0
- package/dist/identity/command.d.ts +19 -0
- package/dist/identity/command.js +21 -0
- package/dist/identity/connection.d.ts +24 -0
- package/dist/identity/connection.js +29 -0
- package/dist/identity/content.d.ts +18 -0
- package/dist/identity/content.js +12 -0
- package/dist/identity/digest.d.ts +4 -0
- package/dist/identity/digest.js +5 -0
- package/dist/identity/execution.d.ts +32 -0
- package/dist/identity/execution.js +63 -0
- package/dist/identity/mint.d.ts +51 -0
- package/dist/identity/mint.js +76 -0
- package/dist/identity/version.d.ts +2 -0
- package/dist/identity/version.js +3 -0
- package/dist/index.d.ts +159 -0
- package/dist/index.js +97 -0
- package/dist/members/blob.d.ts +43 -0
- package/dist/members/blob.js +29 -0
- package/dist/members/command.d.ts +109 -0
- package/dist/members/command.js +61 -0
- package/dist/members/connection.d.ts +55 -0
- package/dist/members/connection.js +49 -0
- package/dist/members/event.d.ts +36 -0
- package/dist/members/event.js +24 -0
- package/dist/members/job.d.ts +157 -0
- package/dist/members/job.js +67 -0
- package/dist/members/payload.d.ts +93 -0
- package/dist/members/payload.js +145 -0
- package/dist/members/reducer.d.ts +64 -0
- package/dist/members/reducer.js +27 -0
- package/dist/members/stream.d.ts +36 -0
- package/dist/members/stream.js +14 -0
- package/dist/members/subscription.d.ts +182 -0
- package/dist/members/subscription.js +91 -0
- package/dist/members/workflow.d.ts +99 -0
- package/dist/members/workflow.js +2 -0
- package/dist/policies/access.d.ts +35 -0
- package/dist/policies/access.js +6 -0
- package/dist/policies/command.d.ts +127 -0
- package/dist/policies/command.js +45 -0
- package/dist/policies/job.d.ts +28 -0
- package/dist/policies/job.js +60 -0
- package/dist/policies/schedules.d.ts +33 -0
- package/dist/policies/schedules.js +131 -0
- package/dist/protocol/frames.d.ts +66 -0
- package/dist/protocol/frames.js +55 -0
- package/dist/protocol/inspection.d.ts +807 -0
- package/dist/protocol/inspection.js +243 -0
- package/dist/protocol/wire.d.ts +184 -0
- package/dist/protocol/wire.js +150 -0
- package/dist/runtime/actors.d.ts +155 -0
- package/dist/runtime/actors.js +4 -0
- package/dist/runtime/admission.d.ts +34 -0
- package/dist/runtime/admission.js +72 -0
- package/dist/runtime/adoption/backfill.d.ts +27 -0
- package/dist/runtime/adoption/backfill.js +144 -0
- package/dist/runtime/adoption/enforce.d.ts +55 -0
- package/dist/runtime/adoption/enforce.js +241 -0
- package/dist/runtime/adoption/observe.d.ts +43 -0
- package/dist/runtime/adoption/observe.js +139 -0
- package/dist/runtime/adoption/plan.d.ts +45 -0
- package/dist/runtime/adoption/plan.js +192 -0
- package/dist/runtime/adoption/startup.d.ts +32 -0
- package/dist/runtime/adoption/startup.js +76 -0
- package/dist/runtime/adoption/status.d.ts +23 -0
- package/dist/runtime/adoption/status.js +47 -0
- package/dist/runtime/adoption/target.d.ts +33 -0
- package/dist/runtime/adoption/target.js +49 -0
- package/dist/runtime/connections/holder.d.ts +221 -0
- package/dist/runtime/connections/holder.js +816 -0
- package/dist/runtime/connections/owner.d.ts +263 -0
- package/dist/runtime/connections/owner.js +896 -0
- package/dist/runtime/connections/protocol.d.ts +441 -0
- package/dist/runtime/connections/protocol.js +222 -0
- package/dist/runtime/connections/reads.d.ts +24 -0
- package/dist/runtime/connections/reads.js +19 -0
- package/dist/runtime/connections/streams.d.ts +62 -0
- package/dist/runtime/connections/streams.js +128 -0
- package/dist/runtime/connections/transport.d.ts +40 -0
- package/dist/runtime/connections/transport.js +68 -0
- package/dist/runtime/connections/watch.d.ts +52 -0
- package/dist/runtime/connections/watch.js +159 -0
- package/dist/runtime/content/grant.d.ts +34 -0
- package/dist/runtime/content/grant.js +58 -0
- package/dist/runtime/content/store.d.ts +63 -0
- package/dist/runtime/content/store.js +294 -0
- package/dist/runtime/cron/key.d.ts +2 -0
- package/dist/runtime/cron/key.js +2 -0
- package/dist/runtime/cron/schedule.d.ts +69 -0
- package/dist/runtime/cron/schedule.js +144 -0
- package/dist/runtime/database/bounded.d.ts +43 -0
- package/dist/runtime/database/bounded.js +108 -0
- package/dist/runtime/database/connection.d.ts +8 -0
- package/dist/runtime/database/connection.js +18 -0
- package/dist/runtime/database/coordination.d.ts +19 -0
- package/dist/runtime/database/coordination.js +72 -0
- package/dist/runtime/database/flock.d.ts +10 -0
- package/dist/runtime/database/flock.js +60 -0
- package/dist/runtime/database/gate.d.ts +26 -0
- package/dist/runtime/database/gate.js +54 -0
- package/dist/runtime/database/keepalive.d.ts +11 -0
- package/dist/runtime/database/keepalive.js +22 -0
- package/dist/runtime/database/migrations.d.ts +177 -0
- package/dist/runtime/database/migrations.js +1018 -0
- package/dist/runtime/database/neki/migrations.d.ts +31 -0
- package/dist/runtime/database/neki/migrations.js +276 -0
- package/dist/runtime/database/neki/session.d.ts +23 -0
- package/dist/runtime/database/neki/session.js +31 -0
- package/dist/runtime/database/pglite.d.ts +21 -0
- package/dist/runtime/database/pglite.js +74 -0
- package/dist/runtime/database/replica.d.ts +41 -0
- package/dist/runtime/database/replica.js +51 -0
- package/dist/runtime/database/shards.d.ts +21 -0
- package/dist/runtime/database/shards.js +37 -0
- package/dist/runtime/database/snapshot.d.ts +7 -0
- package/dist/runtime/database/snapshot.js +7 -0
- package/dist/runtime/database/tenancy.d.ts +69 -0
- package/dist/runtime/database/tenancy.js +145 -0
- package/dist/runtime/database/transient.d.ts +10 -0
- package/dist/runtime/database/transient.js +25 -0
- package/dist/runtime/drain.d.ts +132 -0
- package/dist/runtime/drain.js +109 -0
- package/dist/runtime/entity/mailbox.d.ts +86 -0
- package/dist/runtime/entity/mailbox.js +121 -0
- package/dist/runtime/entity/register.d.ts +424 -0
- package/dist/runtime/entity/register.js +669 -0
- package/dist/runtime/events/append.d.ts +192 -0
- package/dist/runtime/events/append.js +128 -0
- package/dist/runtime/events/cursor.d.ts +2 -0
- package/dist/runtime/events/cursor.js +5 -0
- package/dist/runtime/events/replay.d.ts +20 -0
- package/dist/runtime/events/replay.js +45 -0
- package/dist/runtime/feeds.d.ts +26 -0
- package/dist/runtime/feeds.js +100 -0
- package/dist/runtime/fleet/checks.d.ts +17 -0
- package/dist/runtime/fleet/checks.js +106 -0
- package/dist/runtime/fleet/maintainer.d.ts +38 -0
- package/dist/runtime/fleet/maintainer.js +383 -0
- package/dist/runtime/fleet/pgoutput.d.ts +41 -0
- package/dist/runtime/fleet/pgoutput.js +102 -0
- package/dist/runtime/fleet/setup.d.ts +36 -0
- package/dist/runtime/fleet/setup.js +58 -0
- package/dist/runtime/fleet/subscribe.d.ts +42 -0
- package/dist/runtime/fleet/subscribe.js +147 -0
- package/dist/runtime/index.d.ts +66 -0
- package/dist/runtime/index.js +37 -0
- package/dist/runtime/inspector/http.d.ts +19 -0
- package/dist/runtime/inspector/http.js +36 -0
- package/dist/runtime/inspector/layer.d.ts +46 -0
- package/dist/runtime/inspector/layer.js +180 -0
- package/dist/runtime/inspector/queries.d.ts +711 -0
- package/dist/runtime/inspector/queries.js +494 -0
- package/dist/runtime/jobs/attempt.d.ts +254 -0
- package/dist/runtime/jobs/attempt.js +413 -0
- package/dist/runtime/jobs/isolation.d.ts +20 -0
- package/dist/runtime/jobs/isolation.js +10 -0
- package/dist/runtime/jobs/progress.d.ts +95 -0
- package/dist/runtime/jobs/progress.js +144 -0
- package/dist/runtime/layer.d.ts +260 -0
- package/dist/runtime/layer.js +876 -0
- package/dist/runtime/members.d.ts +381 -0
- package/dist/runtime/members.js +8 -0
- package/dist/runtime/operators/audit.d.ts +64 -0
- package/dist/runtime/operators/audit.js +56 -0
- package/dist/runtime/operators/auth.d.ts +29 -0
- package/dist/runtime/operators/auth.js +42 -0
- package/dist/runtime/operators/export.d.ts +68 -0
- package/dist/runtime/operators/export.js +137 -0
- package/dist/runtime/operators/grants.d.ts +45 -0
- package/dist/runtime/operators/grants.js +40 -0
- package/dist/runtime/operators/repair.d.ts +206 -0
- package/dist/runtime/operators/repair.js +226 -0
- package/dist/runtime/operators/routes.d.ts +35 -0
- package/dist/runtime/operators/routes.js +190 -0
- package/dist/runtime/operators/seed.d.ts +123 -0
- package/dist/runtime/operators/seed.js +123 -0
- package/dist/runtime/payloads/versions.d.ts +65 -0
- package/dist/runtime/payloads/versions.js +240 -0
- package/dist/runtime/peering/authority.d.ts +42 -0
- package/dist/runtime/peering/authority.js +132 -0
- package/dist/runtime/peering/credentials.d.ts +21 -0
- package/dist/runtime/peering/credentials.js +13 -0
- package/dist/runtime/peering/transport.d.ts +51 -0
- package/dist/runtime/peering/transport.js +175 -0
- package/dist/runtime/queries.d.ts +18 -0
- package/dist/runtime/queries.js +169 -0
- package/dist/runtime/readiness.d.ts +36 -0
- package/dist/runtime/readiness.js +44 -0
- package/dist/runtime/registration.d.ts +58 -0
- package/dist/runtime/registration.js +186 -0
- package/dist/runtime/request.d.ts +158 -0
- package/dist/runtime/request.js +102 -0
- package/dist/runtime/retry.d.ts +8 -0
- package/dist/runtime/retry.js +11 -0
- package/dist/runtime/runner.d.ts +93 -0
- package/dist/runtime/runner.js +122 -0
- package/dist/runtime/storage/codec.d.ts +39 -0
- package/dist/runtime/storage/codec.js +41 -0
- package/dist/runtime/storage/generation.d.ts +69 -0
- package/dist/runtime/storage/generation.js +49 -0
- package/dist/runtime/storage/placements.d.ts +15 -0
- package/dist/runtime/storage/placements.js +38 -0
- package/dist/runtime/storage/platform.d.ts +6 -0
- package/dist/runtime/storage/platform.js +9 -0
- package/dist/runtime/storage/retention.d.ts +73 -0
- package/dist/runtime/storage/retention.js +158 -0
- package/dist/runtime/subscriptions/identity.d.ts +31 -0
- package/dist/runtime/subscriptions/identity.js +45 -0
- package/dist/runtime/subscriptions/relay.d.ts +175 -0
- package/dist/runtime/subscriptions/relay.js +763 -0
- package/dist/runtime/subscriptions/storage.d.ts +40 -0
- package/dist/runtime/subscriptions/storage.js +98 -0
- package/dist/runtime/sweeps.d.ts +39 -0
- package/dist/runtime/sweeps.js +54 -0
- package/dist/runtime/telemetry/defects.d.ts +57 -0
- package/dist/runtime/telemetry/defects.js +43 -0
- package/dist/runtime/telemetry/metrics.d.ts +52 -0
- package/dist/runtime/telemetry/metrics.js +138 -0
- package/dist/runtime/telemetry/routes.d.ts +19 -0
- package/dist/runtime/telemetry/routes.js +18 -0
- package/dist/runtime/telemetry/sampler.d.ts +26 -0
- package/dist/runtime/telemetry/sampler.js +101 -0
- package/dist/runtime/telemetry/spans.d.ts +38 -0
- package/dist/runtime/telemetry/spans.js +44 -0
- package/dist/runtime/telemetry/usage.d.ts +52 -0
- package/dist/runtime/telemetry/usage.js +30 -0
- package/dist/runtime/topology/admission.d.ts +13 -0
- package/dist/runtime/topology/admission.js +36 -0
- package/dist/runtime/topology/locks.d.ts +56 -0
- package/dist/runtime/topology/locks.js +81 -0
- package/dist/runtime/topology/messages.d.ts +15 -0
- package/dist/runtime/topology/messages.js +32 -0
- package/dist/runtime/turn/admission.d.ts +22 -0
- package/dist/runtime/turn/admission.js +41 -0
- package/dist/runtime/turn/blobs.d.ts +38 -0
- package/dist/runtime/turn/blobs.js +215 -0
- package/dist/runtime/turn/execute.d.ts +208 -0
- package/dist/runtime/turn/execute.js +972 -0
- package/dist/runtime/turn/group.d.ts +165 -0
- package/dist/runtime/turn/group.js +326 -0
- package/dist/runtime/turn/hooks.d.ts +44 -0
- package/dist/runtime/turn/hooks.js +28 -0
- package/dist/runtime/turn/outbox.d.ts +159 -0
- package/dist/runtime/turn/outbox.js +269 -0
- package/dist/runtime/turn/pipeline.d.ts +68 -0
- package/dist/runtime/turn/pipeline.js +83 -0
- package/dist/runtime/turn/receipt.d.ts +81 -0
- package/dist/runtime/turn/receipt.js +32 -0
- package/dist/runtime/turn/relay.d.ts +179 -0
- package/dist/runtime/turn/relay.js +685 -0
- package/dist/runtime/turn/rows.d.ts +43 -0
- package/dist/runtime/turn/rows.js +592 -0
- package/dist/runtime/workflows/compatibility.d.ts +125 -0
- package/dist/runtime/workflows/compatibility.js +285 -0
- package/dist/runtime/workflows/engine.d.ts +107 -0
- package/dist/runtime/workflows/engine.js +826 -0
- package/dist/runtime/workflows/manifest.d.ts +34 -0
- package/dist/runtime/workflows/manifest.js +39 -0
- package/dist/runtime/workflows/steps.d.ts +33 -0
- package/dist/runtime/workflows/steps.js +152 -0
- package/dist/serve/api.d.ts +99 -0
- package/dist/serve/api.js +403 -0
- package/dist/serve/assertion/binding.d.ts +41 -0
- package/dist/serve/assertion/binding.js +92 -0
- package/dist/serve/assertion/verify.d.ts +93 -0
- package/dist/serve/assertion/verify.js +189 -0
- package/dist/serve/auth.d.ts +200 -0
- package/dist/serve/auth.js +92 -0
- package/dist/serve/clock.d.ts +10 -0
- package/dist/serve/clock.js +25 -0
- package/dist/serve/jwt.d.ts +65 -0
- package/dist/serve/jwt.js +202 -0
- package/dist/serve/layer.d.ts +98 -0
- package/dist/serve/layer.js +809 -0
- package/dist/serve/mcp/endpoint.d.ts +39 -0
- package/dist/serve/mcp/endpoint.js +187 -0
- package/dist/serve/mcp/tools.d.ts +37 -0
- package/dist/serve/mcp/tools.js +125 -0
- package/dist/serve/origin.d.ts +6 -0
- package/dist/serve/origin.js +21 -0
- package/dist/serve/sessions/feed.d.ts +79 -0
- package/dist/serve/sessions/feed.js +115 -0
- package/dist/serve/sessions/socket.d.ts +56 -0
- package/dist/serve/sessions/socket.js +212 -0
- package/dist/serve/sessions/sse.d.ts +27 -0
- package/dist/serve/sessions/sse.js +26 -0
- package/dist/serve/sessions/stream.d.ts +9 -0
- package/dist/serve/sessions/stream.js +9 -0
- package/dist/serve/sessions/watch.d.ts +12 -0
- package/dist/serve/sessions/watch.js +11 -0
- package/dist/serve/wire.d.ts +16 -0
- package/dist/serve/wire.js +50 -0
- package/dist/state/blob.d.ts +71 -0
- package/dist/state/blob.js +0 -0
- package/dist/state/migration.d.ts +53 -0
- package/dist/state/migration.js +29 -0
- package/dist/tables/fleet.d.ts +170 -0
- package/dist/tables/fleet.js +214 -0
- package/dist/tables/owned.d.ts +250 -0
- package/dist/tables/owned.js +233 -0
- package/dist/testing/actor-test.d.ts +360 -0
- package/dist/testing/actor-test.js +337 -0
- package/dist/testing/cluster.d.ts +93 -0
- package/dist/testing/cluster.js +296 -0
- package/dist/testing/conformance/access.d.ts +5 -0
- package/dist/testing/conformance/access.js +531 -0
- package/dist/testing/conformance/admission.d.ts +11 -0
- package/dist/testing/conformance/admission.js +182 -0
- package/dist/testing/conformance/adoption.d.ts +2 -0
- package/dist/testing/conformance/adoption.js +1019 -0
- package/dist/testing/conformance/assertions.d.ts +202 -0
- package/dist/testing/conformance/assertions.js +849 -0
- package/dist/testing/conformance/batches.d.ts +41 -0
- package/dist/testing/conformance/batches.js +388 -0
- package/dist/testing/conformance/blobs.d.ts +14 -0
- package/dist/testing/conformance/blobs.js +405 -0
- package/dist/testing/conformance/capacity.d.ts +8 -0
- package/dist/testing/conformance/capacity.js +433 -0
- package/dist/testing/conformance/client.d.ts +5 -0
- package/dist/testing/conformance/client.js +719 -0
- package/dist/testing/conformance/cold-serve.d.ts +16 -0
- package/dist/testing/conformance/cold-serve.js +254 -0
- package/dist/testing/conformance/connections/actors.d.ts +1143 -0
- package/dist/testing/conformance/connections/actors.js +180 -0
- package/dist/testing/conformance/connections/harness.d.ts +1754 -0
- package/dist/testing/conformance/connections/harness.js +142 -0
- package/dist/testing/conformance/connections/holders.d.ts +4 -0
- package/dist/testing/conformance/connections/holders.js +165 -0
- package/dist/testing/conformance/connections/lifecycle.d.ts +4 -0
- package/dist/testing/conformance/connections/lifecycle.js +113 -0
- package/dist/testing/conformance/connections/limits.d.ts +4 -0
- package/dist/testing/conformance/connections/limits.js +127 -0
- package/dist/testing/conformance/connections/reauthorization.d.ts +4 -0
- package/dist/testing/conformance/connections/reauthorization.js +170 -0
- package/dist/testing/conformance/connections/resync.d.ts +4 -0
- package/dist/testing/conformance/connections/resync.js +360 -0
- package/dist/testing/conformance/connections/takeover.d.ts +4 -0
- package/dist/testing/conformance/connections/takeover.js +287 -0
- package/dist/testing/conformance/connections.d.ts +4 -0
- package/dist/testing/conformance/connections.js +15 -0
- package/dist/testing/conformance/content-blobs.d.ts +16 -0
- package/dist/testing/conformance/content-blobs.js +534 -0
- package/dist/testing/conformance/counter.d.ts +16 -0
- package/dist/testing/conformance/counter.js +813 -0
- package/dist/testing/conformance/cron.d.ts +5 -0
- package/dist/testing/conformance/cron.js +665 -0
- package/dist/testing/conformance/drain.d.ts +26 -0
- package/dist/testing/conformance/drain.js +540 -0
- package/dist/testing/conformance/effect-control.d.ts +38 -0
- package/dist/testing/conformance/effect-control.js +1059 -0
- package/dist/testing/conformance/effects.d.ts +23 -0
- package/dist/testing/conformance/effects.js +432 -0
- package/dist/testing/conformance/events.d.ts +28 -0
- package/dist/testing/conformance/events.js +335 -0
- package/dist/testing/conformance/export.d.ts +2 -0
- package/dist/testing/conformance/export.js +368 -0
- package/dist/testing/conformance/fleet.d.ts +444 -0
- package/dist/testing/conformance/fleet.js +1009 -0
- package/dist/testing/conformance/groups.d.ts +7 -0
- package/dist/testing/conformance/groups.js +353 -0
- package/dist/testing/conformance/heap.d.ts +3 -0
- package/dist/testing/conformance/heap.js +149 -0
- package/dist/testing/conformance/http.d.ts +2809 -0
- package/dist/testing/conformance/http.js +1234 -0
- package/dist/testing/conformance/inspection-views.d.ts +8 -0
- package/dist/testing/conformance/inspection-views.js +272 -0
- package/dist/testing/conformance/inspector.d.ts +7 -0
- package/dist/testing/conformance/inspector.js +650 -0
- package/dist/testing/conformance/mint.d.ts +58 -0
- package/dist/testing/conformance/mint.js +692 -0
- package/dist/testing/conformance/multi-runner.d.ts +8 -0
- package/dist/testing/conformance/multi-runner.js +403 -0
- package/dist/testing/conformance/neki/plan.d.ts +19 -0
- package/dist/testing/conformance/neki/plan.js +30 -0
- package/dist/testing/conformance/observability.d.ts +3 -0
- package/dist/testing/conformance/observability.js +343 -0
- package/dist/testing/conformance/offline.d.ts +4 -0
- package/dist/testing/conformance/offline.js +474 -0
- package/dist/testing/conformance/operator-harness.d.ts +57 -0
- package/dist/testing/conformance/operator-harness.js +78 -0
- package/dist/testing/conformance/operator.d.ts +3 -0
- package/dist/testing/conformance/operator.js +379 -0
- package/dist/testing/conformance/outbox-cross-shard.d.ts +14 -0
- package/dist/testing/conformance/outbox-cross-shard.js +160 -0
- package/dist/testing/conformance/outbox.d.ts +36 -0
- package/dist/testing/conformance/outbox.js +437 -0
- package/dist/testing/conformance/payload-migrations.d.ts +3 -0
- package/dist/testing/conformance/payload-migrations.js +612 -0
- package/dist/testing/conformance/pipeline.d.ts +3 -0
- package/dist/testing/conformance/pipeline.js +1040 -0
- package/dist/testing/conformance/placement.d.ts +22 -0
- package/dist/testing/conformance/placement.js +539 -0
- package/dist/testing/conformance/platform.d.ts +40 -0
- package/dist/testing/conformance/platform.js +101 -0
- package/dist/testing/conformance/progress.d.ts +39 -0
- package/dist/testing/conformance/progress.js +666 -0
- package/dist/testing/conformance/properties.d.ts +6 -0
- package/dist/testing/conformance/properties.js +295 -0
- package/dist/testing/conformance/protocols.d.ts +4 -0
- package/dist/testing/conformance/protocols.js +618 -0
- package/dist/testing/conformance/provider/advertise.d.ts +21 -0
- package/dist/testing/conformance/provider/advertise.js +44 -0
- package/dist/testing/conformance/read-your-writes.d.ts +20 -0
- package/dist/testing/conformance/read-your-writes.js +192 -0
- package/dist/testing/conformance/reducers.d.ts +8 -0
- package/dist/testing/conformance/reducers.js +258 -0
- package/dist/testing/conformance/relay.d.ts +42 -0
- package/dist/testing/conformance/relay.js +1115 -0
- package/dist/testing/conformance/restore.d.ts +43 -0
- package/dist/testing/conformance/restore.js +341 -0
- package/dist/testing/conformance/retention.d.ts +14 -0
- package/dist/testing/conformance/retention.js +463 -0
- package/dist/testing/conformance/rls.d.ts +24 -0
- package/dist/testing/conformance/rls.js +576 -0
- package/dist/testing/conformance/simulation.d.ts +31 -0
- package/dist/testing/conformance/simulation.js +167 -0
- package/dist/testing/conformance/single-shard.d.ts +2 -0
- package/dist/testing/conformance/single-shard.js +125 -0
- package/dist/testing/conformance/singleton.d.ts +3 -0
- package/dist/testing/conformance/singleton.js +293 -0
- package/dist/testing/conformance/statements.d.ts +60 -0
- package/dist/testing/conformance/statements.js +108 -0
- package/dist/testing/conformance/streams.d.ts +7 -0
- package/dist/testing/conformance/streams.js +280 -0
- package/dist/testing/conformance/subscriptions/access.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/access.js +98 -0
- package/dist/testing/conformance/subscriptions/actors.d.ts +4910 -0
- package/dist/testing/conformance/subscriptions/actors.js +372 -0
- package/dist/testing/conformance/subscriptions/cluster.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/cluster.js +89 -0
- package/dist/testing/conformance/subscriptions/delivery.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/delivery.js +253 -0
- package/dist/testing/conformance/subscriptions/deploys.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/deploys.js +162 -0
- package/dist/testing/conformance/subscriptions/epochs.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/epochs.js +169 -0
- package/dist/testing/conformance/subscriptions/failures.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/failures.js +108 -0
- package/dist/testing/conformance/subscriptions/feeds.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/feeds.js +218 -0
- package/dist/testing/conformance/subscriptions/harness.d.ts +124 -0
- package/dist/testing/conformance/subscriptions/harness.js +143 -0
- package/dist/testing/conformance/subscriptions/operator.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/operator.js +128 -0
- package/dist/testing/conformance/subscriptions/retention.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/retention.js +288 -0
- package/dist/testing/conformance/subscriptions/routing.d.ts +4 -0
- package/dist/testing/conformance/subscriptions/routing.js +179 -0
- package/dist/testing/conformance/subscriptions.d.ts +4 -0
- package/dist/testing/conformance/subscriptions.js +19 -0
- package/dist/testing/conformance/tables.d.ts +125 -0
- package/dist/testing/conformance/tables.js +664 -0
- package/dist/testing/conformance/transports/actors.d.ts +1907 -0
- package/dist/testing/conformance/transports/actors.js +163 -0
- package/dist/testing/conformance/transports/client.d.ts +3 -0
- package/dist/testing/conformance/transports/client.js +237 -0
- package/dist/testing/conformance/transports/feeds.d.ts +3 -0
- package/dist/testing/conformance/transports/feeds.js +232 -0
- package/dist/testing/conformance/transports/harness.d.ts +93 -0
- package/dist/testing/conformance/transports/harness.js +84 -0
- package/dist/testing/conformance/transports/streams.d.ts +3 -0
- package/dist/testing/conformance/transports/streams.js +96 -0
- package/dist/testing/conformance/transports/websocket.d.ts +3 -0
- package/dist/testing/conformance/transports/websocket.js +384 -0
- package/dist/testing/conformance/transports/wire.d.ts +141 -0
- package/dist/testing/conformance/transports/wire.js +204 -0
- package/dist/testing/conformance/transports.d.ts +3 -0
- package/dist/testing/conformance/transports.js +11 -0
- package/dist/testing/conformance/watch.d.ts +59 -0
- package/dist/testing/conformance/watch.js +879 -0
- package/dist/testing/conformance/workflow-engine.d.ts +97 -0
- package/dist/testing/conformance/workflow-engine.js +253 -0
- package/dist/testing/conformance/workflow-versions.d.ts +3 -0
- package/dist/testing/conformance/workflow-versions.js +545 -0
- package/dist/testing/conformance/workflows/access.d.ts +4 -0
- package/dist/testing/conformance/workflows/access.js +147 -0
- package/dist/testing/conformance/workflows/actors.d.ts +2317 -0
- package/dist/testing/conformance/workflows/actors.js +305 -0
- package/dist/testing/conformance/workflows/basics.d.ts +4 -0
- package/dist/testing/conformance/workflows/basics.js +144 -0
- package/dist/testing/conformance/workflows/engine.d.ts +4 -0
- package/dist/testing/conformance/workflows/engine.js +80 -0
- package/dist/testing/conformance/workflows/guards.d.ts +4 -0
- package/dist/testing/conformance/workflows/guards.js +172 -0
- package/dist/testing/conformance/workflows/harness.d.ts +14 -0
- package/dist/testing/conformance/workflows/harness.js +44 -0
- package/dist/testing/conformance/workflows/recovery.d.ts +4 -0
- package/dist/testing/conformance/workflows/recovery.js +181 -0
- package/dist/testing/conformance/workflows/starts.d.ts +4 -0
- package/dist/testing/conformance/workflows/starts.js +57 -0
- package/dist/testing/conformance/workflows/suspension.d.ts +4 -0
- package/dist/testing/conformance/workflows/suspension.js +106 -0
- package/dist/testing/conformance/workflows/waits.d.ts +4 -0
- package/dist/testing/conformance/workflows/waits.js +284 -0
- package/dist/testing/conformance/workflows.d.ts +4 -0
- package/dist/testing/conformance/workflows.js +19 -0
- package/dist/testing/conformance.d.ts +330 -0
- package/dist/testing/conformance.js +364 -0
- package/dist/testing/database.d.ts +31 -0
- package/dist/testing/database.js +70 -0
- package/dist/testing/foundation.d.ts +41 -0
- package/dist/testing/foundation.js +517 -0
- package/dist/testing/index.d.ts +20 -0
- package/dist/testing/index.js +12 -0
- package/dist/testing/property.d.ts +40 -0
- package/dist/testing/property.js +95 -0
- package/dist/testing/simulate-cluster.d.ts +112 -0
- package/dist/testing/simulate-cluster.js +257 -0
- package/dist/testing/simulate.d.ts +90 -0
- package/dist/testing/simulate.js +127 -0
- package/package.json +1 -0
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
import { Cause, Crypto, Effect, Exit, Layer, ManagedRuntime, Option, Schedule, Schema, } from "effect";
|
|
2
|
+
import { SqlClient } from "effect/sql";
|
|
3
|
+
import { Actor } from "../../index.js";
|
|
4
|
+
import { acceptWorkflows, checkWorkflows, declaredOf, } from "../../runtime/workflows/compatibility.js";
|
|
5
|
+
import { manifestOf, toJson } from "../../runtime/workflows/manifest.js";
|
|
6
|
+
import { ActorTest } from "../actor-test.js";
|
|
7
|
+
import { ActorCluster } from "../cluster.js";
|
|
8
|
+
/** One deployment of the `Versioned` actor type: reserve, sleep, then label. */
|
|
9
|
+
const deployment = (variant) => {
|
|
10
|
+
const Order = Actor.workflow("Order", {
|
|
11
|
+
payload: { id: variant.id ?? Schema.String },
|
|
12
|
+
success: Schema.String,
|
|
13
|
+
key: ({ id }) => id,
|
|
14
|
+
versions: variant.versions ?? {},
|
|
15
|
+
});
|
|
16
|
+
const Reserve = Order.step("reserve", {
|
|
17
|
+
payload: Schema.String,
|
|
18
|
+
success: variant.reserve ?? Schema.String,
|
|
19
|
+
});
|
|
20
|
+
const Pause = Order.sleep("pause");
|
|
21
|
+
const label = variant.label === undefined ? "label" : variant.label;
|
|
22
|
+
const Label = label === null
|
|
23
|
+
? undefined
|
|
24
|
+
: Order.step(label, { payload: Schema.String, success: variant.labelled ?? Schema.String });
|
|
25
|
+
const Rest = variant.rest === true ? Order.sleep("rest") : undefined;
|
|
26
|
+
if (variant.extra !== undefined)
|
|
27
|
+
Order.step(variant.extra, { payload: Schema.String, success: Schema.String });
|
|
28
|
+
const Versioned = Actor.make("Versioned", { key: Schema.String, api: { Order } });
|
|
29
|
+
const layer = Versioned.toLayer(Effect.succeed({
|
|
30
|
+
Order: Effect.fnUntraced(function* (input) {
|
|
31
|
+
const wf = yield* Versioned.Workflow;
|
|
32
|
+
const reserved = yield* Reserve.run(input.id, (id) => Effect.succeed(`r-${id}`));
|
|
33
|
+
yield* Pause("1 minute");
|
|
34
|
+
const fraud = yield* wf.version("fraud");
|
|
35
|
+
const labelled = Label === undefined
|
|
36
|
+
? reserved
|
|
37
|
+
: yield* Label.run(reserved, (value) => Effect.succeed(`${value}:${label}`));
|
|
38
|
+
if (Rest !== undefined)
|
|
39
|
+
yield* Rest("1 minute");
|
|
40
|
+
return `${labelled}:v${fraud}`;
|
|
41
|
+
}),
|
|
42
|
+
}));
|
|
43
|
+
return {
|
|
44
|
+
Versioned,
|
|
45
|
+
Order,
|
|
46
|
+
layer,
|
|
47
|
+
start: (id) => Versioned.get(id).pipe(Effect.flatMap((handle) => handle.Order({ id })), Effect.map((run) => run.executionId)),
|
|
48
|
+
result: (executionId) => Versioned.run(Order, executionId).pipe(Effect.flatMap((run) => run.result)),
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
const Base = deployment({});
|
|
52
|
+
const BaseAgain = deployment({});
|
|
53
|
+
const Removed = deployment({ label: null });
|
|
54
|
+
const Renamed = deployment({ label: "label-v2" });
|
|
55
|
+
const Audited = deployment({ extra: "audit" });
|
|
56
|
+
const Retyped = deployment({ reserve: Schema.NonEmptyString });
|
|
57
|
+
const Reinput = deployment({ id: Schema.NonEmptyString });
|
|
58
|
+
const Marked = deployment({ versions: { fraud: { current: 1, min: 0 } } });
|
|
59
|
+
const MarkedNext = deployment({ versions: { fraud: { current: 2, min: 1 } } });
|
|
60
|
+
const MarkedLater = deployment({ versions: { fraud: { current: 3, min: 2 } } });
|
|
61
|
+
const Rested = deployment({ rest: true });
|
|
62
|
+
const MarkedCurrent = deployment({ versions: { fraud: { current: 2, min: 0 } } });
|
|
63
|
+
const BriefRun = Actor.workflow("Run", { success: Schema.String });
|
|
64
|
+
/** Keeps finished executions for `keep`, against the cases' 60-second retry window. */
|
|
65
|
+
const brief = (keep) => {
|
|
66
|
+
const Brief = Actor.make("Brief", {
|
|
67
|
+
key: Schema.String,
|
|
68
|
+
api: { Run: BriefRun },
|
|
69
|
+
policy: { keepWorkflows: keep },
|
|
70
|
+
});
|
|
71
|
+
return Brief.toLayer(Effect.succeed({ Run: () => Effect.succeed("ran") }));
|
|
72
|
+
};
|
|
73
|
+
const RestedRelabelled = deployment({ rest: true, labelled: Schema.NonEmptyString });
|
|
74
|
+
const Probe = Actor.command("Probe");
|
|
75
|
+
const Unworkflowed = Actor.make("Versioned", { key: Schema.String, api: { Probe } });
|
|
76
|
+
const UnworkflowedLive = Unworkflowed.toLayer(Effect.succeed({ Probe: () => Effect.void }));
|
|
77
|
+
/** Runs `body` on a fresh runtime of `actors` against `database`, then stops it. */
|
|
78
|
+
/** Every deployment of a case serves the same tenant, as one application would. */
|
|
79
|
+
const TENANT = "5f0c1e2a-7b3d-4c8e-9a61-2d4f6b8e0c13";
|
|
80
|
+
const deploy = (database, actors, body) => Effect.gen(function* () {
|
|
81
|
+
const crypto = yield* Crypto.Crypto;
|
|
82
|
+
const runtime = yield* Effect.acquireRelease(Effect.sync(() => ManagedRuntime.make(actors.pipe(Layer.provideMerge(ActorTest.layer({
|
|
83
|
+
database,
|
|
84
|
+
retryWindowMs: 60_000,
|
|
85
|
+
})), Layer.provideMerge(Layer.succeed(Crypto.Crypto, crypto))))), (runtime) => Effect.promise(() => runtime.dispose()));
|
|
86
|
+
return yield* Effect.promise(() => runtime.runPromiseExit(body.pipe(Actor.tenant(TENANT)))).pipe(Effect.flatten);
|
|
87
|
+
}).pipe(Effect.scoped);
|
|
88
|
+
/** The startup failure of a runtime of `actors`, pretty-printed; dies if it starts. */
|
|
89
|
+
const refusal = (database, actors) => deploy(database, actors, Effect.void).pipe(Effect.exit, Effect.flatMap((exit) => Exit.isFailure(exit)
|
|
90
|
+
? Effect.succeed(Cause.pretty(exit.cause))
|
|
91
|
+
: Effect.die(new Error("The deployment started"))));
|
|
92
|
+
const status = (executionId) => Effect.gen(function* () {
|
|
93
|
+
const sql = yield* SqlClient.SqlClient;
|
|
94
|
+
const rows = yield* sql `SELECT status FROM actor_workflow_executions
|
|
95
|
+
WHERE execution_id = ${executionId}`;
|
|
96
|
+
return rows[0]?.status;
|
|
97
|
+
}).pipe(Effect.orDie);
|
|
98
|
+
const suspended = (executionId) => status(executionId).pipe(Effect.repeat({
|
|
99
|
+
schedule: Schedule.spaced("25 millis"),
|
|
100
|
+
until: (held) => held === "suspended",
|
|
101
|
+
}), Effect.timeoutOrElse({
|
|
102
|
+
duration: "30 seconds",
|
|
103
|
+
orElse: () => Effect.die(new Error("Timed out waiting for the execution to suspend")),
|
|
104
|
+
}), Effect.asVoid);
|
|
105
|
+
/** Starts `id` and returns its execution id once it sleeps. */
|
|
106
|
+
const sleeping = (target, id) => Effect.gen(function* () {
|
|
107
|
+
const executionId = yield* target.start(id);
|
|
108
|
+
yield* suspended(executionId);
|
|
109
|
+
return executionId;
|
|
110
|
+
});
|
|
111
|
+
/** Past the sleep and any recovery timer a runner that could not resume it armed. */
|
|
112
|
+
const finish = (target, executionId) => Effect.gen(function* () {
|
|
113
|
+
yield* ActorTest.use((test) => test.advance("2 minutes"));
|
|
114
|
+
return yield* target.result(executionId);
|
|
115
|
+
});
|
|
116
|
+
const manifests = Effect.gen(function* () {
|
|
117
|
+
const sql = yield* SqlClient.SqlClient;
|
|
118
|
+
return yield* sql `
|
|
119
|
+
SELECT manifest_hash, accepted_at_ms::text AS accepted_at_ms FROM actor_workflow_manifests
|
|
120
|
+
WHERE actor_type = 'Versioned' ORDER BY accepted_at_ms`;
|
|
121
|
+
}).pipe(Effect.orDie);
|
|
122
|
+
const hashOf = (target) => manifestOf("Versioned", target.Order).pipe(Effect.map(({ hash }) => hash));
|
|
123
|
+
const on = (runner, effect) => ActorCluster.use((cluster) => cluster.on(runner)(effect));
|
|
124
|
+
/**
|
|
125
|
+
* A rolling deploy on two runners: runner 0 serves `next`, runner 1 still
|
|
126
|
+
* serves `old`. An execution `next` started resumes on `old`, which leaves
|
|
127
|
+
* it suspended, and then on `next` again, which finishes it.
|
|
128
|
+
*/
|
|
129
|
+
const rollingDeploy = (options) => ({
|
|
130
|
+
requiresIndependentConnections: true,
|
|
131
|
+
timeoutMs: 150_000,
|
|
132
|
+
name: options.name,
|
|
133
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
134
|
+
const { old, next } = options;
|
|
135
|
+
const database = yield* environment.freshDatabase;
|
|
136
|
+
const context = yield* Layer.build(ActorTest.cluster({
|
|
137
|
+
database,
|
|
138
|
+
runners: 2,
|
|
139
|
+
shardLockExpiration: "3 seconds",
|
|
140
|
+
actors: Layer.empty,
|
|
141
|
+
runnerActors: (runner) => (runner === 0 ? next.layer : old.layer),
|
|
142
|
+
}));
|
|
143
|
+
yield* Effect.gen(function* () {
|
|
144
|
+
const cluster = yield* ActorCluster;
|
|
145
|
+
yield* cluster.ready;
|
|
146
|
+
let id = "";
|
|
147
|
+
for (let candidate = 0; id === ""; candidate++) {
|
|
148
|
+
const ref = (yield* on(0, next.Versioned.get(`rolling-${candidate}`))).ref;
|
|
149
|
+
if ((yield* cluster.owner(ref)) === 0)
|
|
150
|
+
id = `rolling-${candidate}`;
|
|
151
|
+
}
|
|
152
|
+
const executionId = yield* on(0, sleeping(next, id));
|
|
153
|
+
const ref = (yield* on(0, next.Versioned.get(id))).ref;
|
|
154
|
+
yield* cluster.kill(0);
|
|
155
|
+
yield* cluster.ready;
|
|
156
|
+
yield* on(1, Effect.gen(function* () {
|
|
157
|
+
const test = yield* ActorTest;
|
|
158
|
+
yield* test.advance("61 seconds");
|
|
159
|
+
yield* test.receiptsFor(ref, "$workflow/resume").pipe(Effect.repeat({
|
|
160
|
+
schedule: Schedule.spaced("50 millis"),
|
|
161
|
+
until: (count) => count > 0,
|
|
162
|
+
}), Effect.timeoutOrElse({
|
|
163
|
+
duration: "30 seconds",
|
|
164
|
+
orElse: () => Effect.die(new Error("The older runner never received the resume")),
|
|
165
|
+
}));
|
|
166
|
+
yield* Effect.sleep("500 millis");
|
|
167
|
+
expect(yield* status(executionId)).toBe("suspended");
|
|
168
|
+
}));
|
|
169
|
+
yield* cluster.restart(0);
|
|
170
|
+
yield* cluster.kill(1);
|
|
171
|
+
yield* cluster.ready;
|
|
172
|
+
expect(yield* on(0, finish(next, executionId))).toBe(options.result(id));
|
|
173
|
+
}).pipe(Effect.provideContext(context));
|
|
174
|
+
})),
|
|
175
|
+
});
|
|
176
|
+
/** Workflow-version cases: executions suspend on runners that lack their steps or marker range and resume on a compatible one, and startup refuses retention below the retry window. */
|
|
177
|
+
export const workflowVersionsConformance = [
|
|
178
|
+
rollingDeploy({
|
|
179
|
+
name: "workflow versions: suspends an execution with an unregistered step on an older runner and resumes it on a compatible runner (rolling deploy)",
|
|
180
|
+
old: Base,
|
|
181
|
+
next: Audited,
|
|
182
|
+
result: (id) => `r-${id}:label:v0`,
|
|
183
|
+
}),
|
|
184
|
+
rollingDeploy({
|
|
185
|
+
name: "workflow versions: suspends an execution whose marker is outside an older runner's min..current and resumes it on a compatible runner (rolling deploy)",
|
|
186
|
+
old: Marked,
|
|
187
|
+
next: MarkedCurrent,
|
|
188
|
+
result: (id) => `r-${id}:label:v2`,
|
|
189
|
+
}),
|
|
190
|
+
{
|
|
191
|
+
name: "workflows: refuses startup when keepWorkflows is below the retry window",
|
|
192
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
193
|
+
expect(yield* refusal(yield* environment.freshDatabase, brief("59 seconds"))).toContain("Actor Brief keepWorkflows is shorter than the retry window");
|
|
194
|
+
expect(yield* deploy(yield* environment.freshDatabase, brief("60 seconds"), Effect.void)).toBe(undefined);
|
|
195
|
+
})),
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
requiresIndependentConnections: true,
|
|
199
|
+
name: "workflow versions: records markers at start and reads 0 for executions older than the marker, across a restart",
|
|
200
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
201
|
+
const database = yield* environment.freshDatabase;
|
|
202
|
+
const old = yield* deploy(database, Base.layer, sleeping(Base, "old"));
|
|
203
|
+
yield* deploy(database, Marked.layer, Effect.gen(function* () {
|
|
204
|
+
const fresh = yield* sleeping(Marked, "fresh");
|
|
205
|
+
const sql = yield* SqlClient.SqlClient;
|
|
206
|
+
const markers = yield* sql `SELECT version FROM actor_workflow_step
|
|
207
|
+
WHERE execution_id = ${fresh} AND kind = 'version' AND step = 'fraud'`.pipe(Effect.orDie);
|
|
208
|
+
expect(markers).toEqual([{ version: 1 }]);
|
|
209
|
+
expect(yield* finish(Marked, old)).toBe("r-old:label:v0");
|
|
210
|
+
expect(yield* Marked.result(fresh)).toBe("r-fresh:label:v1");
|
|
211
|
+
}));
|
|
212
|
+
})),
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
requiresIndependentConnections: true,
|
|
216
|
+
name: "workflow versions: refuses startup when a step in an open execution's start manifest is removed or renamed",
|
|
217
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
218
|
+
const database = yield* environment.freshDatabase;
|
|
219
|
+
const open = yield* deploy(database, Base.layer, sleeping(Base, "o"));
|
|
220
|
+
const removed = yield* refusal(database, Removed.layer);
|
|
221
|
+
expect(removed).toContain("deploy refused");
|
|
222
|
+
expect(removed).toContain(`Versioned/Order step "label" removed 1 open execution`);
|
|
223
|
+
expect(yield* refusal(database, Renamed.layer)).toContain(`step "label" removed`);
|
|
224
|
+
expect(yield* deploy(database, Base.layer, finish(Base, open))).toBe("r-o:label:v0");
|
|
225
|
+
yield* deploy(database, Removed.layer, Effect.void);
|
|
226
|
+
})),
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
requiresIndependentConnections: true,
|
|
230
|
+
name: "workflow versions: refuses startup when a marker leaves min..current",
|
|
231
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
232
|
+
const database = yield* environment.freshDatabase;
|
|
233
|
+
yield* deploy(database, Marked.layer, sleeping(Marked, "o"));
|
|
234
|
+
expect(yield* refusal(database, MarkedLater.layer)).toContain(`Versioned/Order marker "fraud" 1 outside 2..3 1 open execution`);
|
|
235
|
+
expect(yield* refusal(database, Base.layer)).toContain(`marker "fraud" removed`);
|
|
236
|
+
})),
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
requiresIndependentConnections: true,
|
|
240
|
+
name: "workflow versions: refuses startup when min rises above 0 while an execution predates the marker",
|
|
241
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
242
|
+
const database = yield* environment.freshDatabase;
|
|
243
|
+
yield* deploy(database, Base.layer, sleeping(Base, "o"));
|
|
244
|
+
expect(yield* refusal(database, MarkedNext.layer)).toContain(`marker "fraud" min 1 > 0 for executions that predate it 1 open execution`);
|
|
245
|
+
yield* deploy(database, Marked.layer, Effect.void);
|
|
246
|
+
})),
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
requiresIndependentConnections: true,
|
|
250
|
+
name: "workflow versions: refuses startup when a workflow member is removed",
|
|
251
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
252
|
+
const database = yield* environment.freshDatabase;
|
|
253
|
+
yield* deploy(database, Base.layer, sleeping(Base, "o"));
|
|
254
|
+
expect(yield* refusal(database, UnworkflowedLive)).toContain("Versioned/Order workflow removed 1 open execution");
|
|
255
|
+
})),
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
requiresIndependentConnections: true,
|
|
259
|
+
name: "workflow versions: refuses startup when a recorded step's result schema changes",
|
|
260
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
261
|
+
const database = yield* environment.freshDatabase;
|
|
262
|
+
yield* deploy(database, Base.layer, sleeping(Base, "o"));
|
|
263
|
+
expect(yield* refusal(database, Retyped.layer)).toContain(`step "reserve" result schema changed 1 open execution`);
|
|
264
|
+
})),
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
requiresIndependentConnections: true,
|
|
268
|
+
name: "workflow versions: refuses startup when the workflow payload schema changes",
|
|
269
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
270
|
+
const database = yield* environment.freshDatabase;
|
|
271
|
+
yield* deploy(database, Base.layer, sleeping(Base, "o"));
|
|
272
|
+
expect(yield* refusal(database, Reinput.layer)).toContain(`payload schema changed 1 open execution`);
|
|
273
|
+
})),
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
requiresIndependentConnections: true,
|
|
277
|
+
name: "workflow versions: refuses startup when an open execution's start manifest is missing",
|
|
278
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
279
|
+
const database = yield* environment.freshDatabase;
|
|
280
|
+
const open = yield* deploy(database, Base.layer, Effect.gen(function* () {
|
|
281
|
+
const executionId = yield* sleeping(Base, "o");
|
|
282
|
+
const sql = yield* SqlClient.SqlClient;
|
|
283
|
+
yield* sql `DELETE FROM actor_workflow_manifests WHERE actor_type = 'Versioned'`.pipe(Effect.orDie);
|
|
284
|
+
return executionId;
|
|
285
|
+
}));
|
|
286
|
+
expect(yield* refusal(database, Audited.layer)).toContain(`start manifest missing 1 open execution`);
|
|
287
|
+
expect(yield* deploy(database, Base.layer, Effect.gen(function* () {
|
|
288
|
+
expect(yield* checkWorkflows([Base.Versioned])).toEqual([]);
|
|
289
|
+
return yield* finish(Base, open);
|
|
290
|
+
}))).toBe("r-o:label:v0");
|
|
291
|
+
})),
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
requiresIndependentConnections: true,
|
|
295
|
+
name: "workflow versions: accepts renaming a step's TypeScript value without changing its name, and skips the full check when the manifest is unchanged",
|
|
296
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
297
|
+
const database = yield* environment.freshDatabase;
|
|
298
|
+
const open = yield* deploy(database, Base.layer, sleeping(Base, "o"));
|
|
299
|
+
const before = yield* deploy(database, Base.layer, manifests);
|
|
300
|
+
yield* deploy(database, BaseAgain.layer, Effect.gen(function* () {
|
|
301
|
+
expect(yield* manifests).toEqual(before);
|
|
302
|
+
expect(yield* acceptWorkflows(declaredOf(BaseAgain.Versioned)).pipe(Effect.orDie)).toEqual({ checked: false, incompatibilities: [], retained: true });
|
|
303
|
+
expect(yield* finish(BaseAgain, open)).toBe("r-o:label:v0");
|
|
304
|
+
}));
|
|
305
|
+
})),
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
requiresIndependentConnections: true,
|
|
309
|
+
name: "workflow versions: an unchanged startup still checks executions an older runner started since",
|
|
310
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
311
|
+
const database = yield* environment.freshDatabase;
|
|
312
|
+
yield* deploy(database, Base.layer, Effect.void);
|
|
313
|
+
yield* deploy(database, Removed.layer, Effect.void);
|
|
314
|
+
yield* deploy(database, Removed.layer, Effect.gen(function* () {
|
|
315
|
+
const executionId = yield* sleeping(Removed, "o");
|
|
316
|
+
const sql = yield* SqlClient.SqlClient;
|
|
317
|
+
const { manifest, hash } = yield* manifestOf("Versioned", Base.Order);
|
|
318
|
+
yield* sql `INSERT INTO actor_workflow_manifests
|
|
319
|
+
(actor_type, workflow, manifest_hash, manifest, accepted_at_ms)
|
|
320
|
+
VALUES ('Versioned', 'Order', ${hash}, ${toJson(manifest)}::jsonb, 0)
|
|
321
|
+
ON CONFLICT DO NOTHING`.pipe(Effect.orDie);
|
|
322
|
+
yield* sql `UPDATE actor_workflow_executions SET manifest_hash = ${hash}
|
|
323
|
+
WHERE execution_id = ${executionId}`.pipe(Effect.orDie);
|
|
324
|
+
}));
|
|
325
|
+
expect(yield* refusal(database, Removed.layer)).toContain(`Versioned/Order step "label" removed 1 open execution`);
|
|
326
|
+
})),
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
requiresIndependentConnections: true,
|
|
330
|
+
name: "workflow versions: a step a newer deployment settles under its changed result schema doesn't strand the execution",
|
|
331
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
332
|
+
const database = yield* environment.freshDatabase;
|
|
333
|
+
const open = yield* deploy(database, Rested.layer, sleeping(Rested, "o"));
|
|
334
|
+
yield* deploy(database, RestedRelabelled.layer, Effect.gen(function* () {
|
|
335
|
+
const sql = yield* SqlClient.SqlClient;
|
|
336
|
+
yield* ActorTest.use((test) => test.advance("2 minutes"));
|
|
337
|
+
yield* sql `SELECT x.manifest_hash
|
|
338
|
+
FROM actor_workflow_executions x JOIN actor_workflow_step s
|
|
339
|
+
ON s.routing_key = x.routing_key AND s.execution_id = x.execution_id
|
|
340
|
+
WHERE x.execution_id = ${open} AND s.step = 'label' AND s.exit IS NOT NULL`.pipe(Effect.repeat({
|
|
341
|
+
schedule: Schedule.spaced("25 millis"),
|
|
342
|
+
until: (rows) => rows.length > 0,
|
|
343
|
+
}), Effect.timeoutOrElse({
|
|
344
|
+
duration: "30 seconds",
|
|
345
|
+
orElse: () => Effect.die(new Error("Timed out waiting for the label step")),
|
|
346
|
+
}), Effect.orDie);
|
|
347
|
+
yield* suspended(open);
|
|
348
|
+
}));
|
|
349
|
+
expect(yield* deploy(database, RestedRelabelled.layer, Effect.gen(function* () {
|
|
350
|
+
const sql = yield* SqlClient.SqlClient;
|
|
351
|
+
const [row] = yield* sql `SELECT manifest_hash
|
|
352
|
+
FROM actor_workflow_executions WHERE execution_id = ${open}`.pipe(Effect.orDie);
|
|
353
|
+
expect(row?.manifest_hash).toBe(yield* hashOf(RestedRelabelled));
|
|
354
|
+
expect(yield* checkWorkflows([RestedRelabelled.Versioned])).toEqual([]);
|
|
355
|
+
expect((yield* checkWorkflows([Rested.Versioned])).map(({ problem }) => problem)).toEqual([`step "label" result schema changed`]);
|
|
356
|
+
yield* ActorTest.use((test) => test.advance("2 minutes"));
|
|
357
|
+
return yield* finish(RestedRelabelled, open);
|
|
358
|
+
}))).toBe("r-o:label:v0");
|
|
359
|
+
})),
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
requiresIndependentConnections: true,
|
|
363
|
+
name: "workflow versions: refuses a rollback that strands newer executions",
|
|
364
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
365
|
+
const database = yield* environment.freshDatabase;
|
|
366
|
+
yield* deploy(database, Marked.layer, Effect.void);
|
|
367
|
+
const open = yield* deploy(database, MarkedNext.layer, sleeping(MarkedNext, "o"));
|
|
368
|
+
expect(yield* refusal(database, Marked.layer)).toContain(`marker "fraud" 2 outside 0..1 1 open execution`);
|
|
369
|
+
expect(yield* deploy(database, MarkedNext.layer, finish(MarkedNext, open))).toBe("r-o:label:v2");
|
|
370
|
+
yield* deploy(database, Marked.layer, Effect.void);
|
|
371
|
+
const accepted = yield* deploy(database, Marked.layer, manifests);
|
|
372
|
+
expect(accepted.at(-1)?.manifest_hash).toBe(yield* hashOf(Marked));
|
|
373
|
+
})),
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
requiresIndependentConnections: true,
|
|
377
|
+
name: "workflow versions: a runner lacking a start-manifest step leaves the execution suspended for a runner that has it",
|
|
378
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
379
|
+
const database = yield* environment.freshDatabase;
|
|
380
|
+
const open = yield* deploy(database, Base.layer, Effect.gen(function* () {
|
|
381
|
+
const executionId = yield* sleeping(Base, "o");
|
|
382
|
+
const sql = yield* SqlClient.SqlClient;
|
|
383
|
+
const { manifest, hash } = yield* manifestOf("Versioned", Audited.Order);
|
|
384
|
+
yield* sql `INSERT INTO actor_workflow_manifests
|
|
385
|
+
(actor_type, workflow, manifest_hash, manifest, accepted_at_ms)
|
|
386
|
+
VALUES ('Versioned', 'Order', ${hash}, ${toJson(manifest)}::jsonb, 0)`.pipe(Effect.orDie);
|
|
387
|
+
yield* sql `UPDATE actor_workflow_executions SET manifest_hash = ${hash}
|
|
388
|
+
WHERE execution_id = ${executionId}`.pipe(Effect.orDie);
|
|
389
|
+
yield* ActorTest.use((test) => test.advance("61 seconds"));
|
|
390
|
+
yield* Effect.sleep("200 millis");
|
|
391
|
+
expect(yield* status(executionId)).toBe("suspended");
|
|
392
|
+
const polled = yield* (yield* Base.Versioned.run(Base.Order, executionId)).poll;
|
|
393
|
+
expect(Option.isSome(polled) && polled.value._tag).toBe("Suspended");
|
|
394
|
+
return executionId;
|
|
395
|
+
}));
|
|
396
|
+
expect(yield* deploy(database, Audited.layer, finish(Audited, open))).toBe("r-o:label:v0");
|
|
397
|
+
})),
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
requiresIndependentConnections: true,
|
|
401
|
+
name: "workflow versions: a runner of an older deployment leaves an execution a newer deployment started with a changed result schema suspended",
|
|
402
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
403
|
+
const database = yield* environment.freshDatabase;
|
|
404
|
+
const open = yield* deploy(database, Base.layer, Effect.gen(function* () {
|
|
405
|
+
const executionId = yield* sleeping(Base, "o");
|
|
406
|
+
const sql = yield* SqlClient.SqlClient;
|
|
407
|
+
const { manifest, hash } = yield* manifestOf("Versioned", Retyped.Order);
|
|
408
|
+
yield* sql `INSERT INTO actor_workflow_manifests
|
|
409
|
+
(actor_type, workflow, manifest_hash, manifest, accepted_at_ms)
|
|
410
|
+
SELECT 'Versioned', 'Order', ${hash}, ${toJson(manifest)}::jsonb, max(accepted_at_ms) + 1
|
|
411
|
+
FROM actor_workflow_manifests WHERE actor_type = 'Versioned'`.pipe(Effect.orDie);
|
|
412
|
+
yield* sql `UPDATE actor_workflow_executions SET manifest_hash = ${hash}
|
|
413
|
+
WHERE execution_id = ${executionId}`.pipe(Effect.orDie);
|
|
414
|
+
yield* ActorTest.use((test) => test.advance("61 seconds"));
|
|
415
|
+
yield* Effect.sleep("200 millis");
|
|
416
|
+
expect(yield* status(executionId)).toBe("suspended");
|
|
417
|
+
return executionId;
|
|
418
|
+
}));
|
|
419
|
+
expect(yield* deploy(database, Retyped.layer, finish(Retyped, open))).toBe("r-o:label:v0");
|
|
420
|
+
})),
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
requiresIndependentConnections: true,
|
|
424
|
+
name: "workflow versions: a runner of an older deployment doesn't settle a step a newer deployment's start manifest retyped, even before it ran",
|
|
425
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
426
|
+
const database = yield* environment.freshDatabase;
|
|
427
|
+
const newer = yield* hashOf(RestedRelabelled);
|
|
428
|
+
const open = yield* deploy(database, Rested.layer, Effect.gen(function* () {
|
|
429
|
+
const executionId = yield* sleeping(Rested, "o");
|
|
430
|
+
const sql = yield* SqlClient.SqlClient;
|
|
431
|
+
const { manifest } = yield* manifestOf("Versioned", RestedRelabelled.Order);
|
|
432
|
+
yield* sql `INSERT INTO actor_workflow_manifests
|
|
433
|
+
(actor_type, workflow, manifest_hash, manifest, accepted_at_ms)
|
|
434
|
+
SELECT 'Versioned', 'Order', ${newer}, ${toJson(manifest)}::jsonb, max(accepted_at_ms) + 1
|
|
435
|
+
FROM actor_workflow_manifests WHERE actor_type = 'Versioned'`.pipe(Effect.orDie);
|
|
436
|
+
yield* sql `UPDATE actor_workflow_executions SET manifest_hash = ${newer}
|
|
437
|
+
WHERE execution_id = ${executionId}`.pipe(Effect.orDie);
|
|
438
|
+
yield* ActorTest.use((test) => test.advance("61 seconds"));
|
|
439
|
+
yield* Effect.sleep("200 millis");
|
|
440
|
+
expect(yield* status(executionId)).toBe("suspended");
|
|
441
|
+
const [row] = yield* sql `SELECT
|
|
442
|
+
x.manifest_hash, (SELECT count(*)::int FROM actor_workflow_step s
|
|
443
|
+
WHERE s.execution_id = x.execution_id AND s.step = 'label') AS label
|
|
444
|
+
FROM actor_workflow_executions x WHERE x.execution_id = ${executionId}`.pipe(Effect.orDie);
|
|
445
|
+
expect(row).toEqual({ manifest_hash: newer, label: 0 });
|
|
446
|
+
return executionId;
|
|
447
|
+
}));
|
|
448
|
+
expect(yield* deploy(database, RestedRelabelled.layer, Effect.gen(function* () {
|
|
449
|
+
const sql = yield* SqlClient.SqlClient;
|
|
450
|
+
yield* ActorTest.use((test) => test.advance("2 minutes"));
|
|
451
|
+
yield* sql `SELECT 1 FROM actor_workflow_step
|
|
452
|
+
WHERE execution_id = ${open} AND step = 'label' AND exit IS NOT NULL`.pipe(Effect.repeat({
|
|
453
|
+
schedule: Schedule.spaced("25 millis"),
|
|
454
|
+
until: (rows) => rows.length > 0,
|
|
455
|
+
}), Effect.timeoutOrElse({
|
|
456
|
+
duration: "30 seconds",
|
|
457
|
+
orElse: () => Effect.die(new Error("Timed out waiting for the label step")),
|
|
458
|
+
}), Effect.orDie);
|
|
459
|
+
yield* suspended(open);
|
|
460
|
+
return yield* finish(RestedRelabelled, open);
|
|
461
|
+
}))).toBe("r-o:label:v0");
|
|
462
|
+
})),
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
requiresIndependentConnections: true,
|
|
466
|
+
name: "workflow versions: a start restores its start manifest when retention pruned it under a still-serving runner",
|
|
467
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
468
|
+
const database = yield* environment.freshDatabase;
|
|
469
|
+
const base = yield* hashOf(Base);
|
|
470
|
+
yield* deploy(database, Base.layer, Effect.gen(function* () {
|
|
471
|
+
const sql = yield* SqlClient.SqlClient;
|
|
472
|
+
yield* sql `DELETE FROM actor_workflow_manifests WHERE actor_type = 'Versioned'`.pipe(Effect.orDie);
|
|
473
|
+
yield* sleeping(Base, "o");
|
|
474
|
+
expect(yield* manifests).toEqual([{ manifest_hash: base, accepted_at_ms: "0" }]);
|
|
475
|
+
}));
|
|
476
|
+
expect(yield* deploy(database, Audited.layer, checkWorkflows([Audited.Versioned]))).toEqual([]);
|
|
477
|
+
})),
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
requiresIndependentConnections: true,
|
|
481
|
+
name: "workflow versions: retention still prunes finished executions after an actor type drops its last workflow",
|
|
482
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
483
|
+
const database = yield* environment.freshDatabase;
|
|
484
|
+
yield* deploy(database, Base.layer, Effect.gen(function* () {
|
|
485
|
+
expect(yield* finish(Base, yield* sleeping(Base, "o"))).toBe("r-o:label:v0");
|
|
486
|
+
}));
|
|
487
|
+
const executions = Effect.gen(function* () {
|
|
488
|
+
const sql = yield* SqlClient.SqlClient;
|
|
489
|
+
const [row] = yield* sql `SELECT count(*)::integer AS count
|
|
490
|
+
FROM actor_workflow_executions WHERE actor_type = 'Versioned'`;
|
|
491
|
+
return row.count;
|
|
492
|
+
}).pipe(Effect.orDie);
|
|
493
|
+
for (const sweeps of [false, true])
|
|
494
|
+
yield* deploy(database, UnworkflowedLive, Effect.gen(function* () {
|
|
495
|
+
const test = yield* ActorTest;
|
|
496
|
+
expect(yield* executions).toBe(1);
|
|
497
|
+
if (!sweeps)
|
|
498
|
+
return;
|
|
499
|
+
yield* test.advance("8 days");
|
|
500
|
+
expect((yield* test.cleanup).workflows).toBe(1);
|
|
501
|
+
expect(yield* executions).toBe(0);
|
|
502
|
+
}));
|
|
503
|
+
})),
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
requiresIndependentConnections: true,
|
|
507
|
+
name: "workflow versions: retention keeps a manifest while an open execution started under it or it is the latest",
|
|
508
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
509
|
+
const database = yield* environment.freshDatabase;
|
|
510
|
+
const open = yield* deploy(database, Base.layer, sleeping(Base, "o"));
|
|
511
|
+
const base = yield* hashOf(Base);
|
|
512
|
+
const audited = yield* hashOf(Audited);
|
|
513
|
+
yield* deploy(database, Audited.layer, Effect.gen(function* () {
|
|
514
|
+
const test = yield* ActorTest;
|
|
515
|
+
yield* test.cleanup;
|
|
516
|
+
expect((yield* manifests).map((row) => row.manifest_hash)).toEqual([base, audited]);
|
|
517
|
+
expect(yield* finish(Audited, open)).toBe("r-o:label:v0");
|
|
518
|
+
yield* test.cleanup;
|
|
519
|
+
expect((yield* manifests).map((row) => row.manifest_hash)).toEqual([audited]);
|
|
520
|
+
}));
|
|
521
|
+
})),
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
requiresIndependentConnections: true,
|
|
525
|
+
name: "workflow versions: the deploy check compares every actor type in the database, read-only",
|
|
526
|
+
run: ({ expect, environment }) => environment.run(Effect.gen(function* () {
|
|
527
|
+
const database = yield* environment.freshDatabase;
|
|
528
|
+
yield* deploy(database, Base.layer, sleeping(Base, "o"));
|
|
529
|
+
yield* deploy(database, Base.layer, Effect.gen(function* () {
|
|
530
|
+
expect(yield* checkWorkflows([Base.Versioned]).pipe(Effect.orDie)).toEqual([]);
|
|
531
|
+
const removed = yield* checkWorkflows([Removed.Versioned]).pipe(Effect.orDie);
|
|
532
|
+
expect(removed.map(({ problem, open }) => ({ problem, open }))).toEqual([
|
|
533
|
+
{ problem: `step "label" removed`, open: 1 },
|
|
534
|
+
]);
|
|
535
|
+
const gone = yield* checkWorkflows([]).pipe(Effect.orDie);
|
|
536
|
+
expect(gone.map(({ actorType, problem }) => `${actorType}: ${problem}`)).toEqual([
|
|
537
|
+
"Versioned: actor type removed",
|
|
538
|
+
]);
|
|
539
|
+
expect((yield* manifests).map((row) => row.manifest_hash)).toEqual([
|
|
540
|
+
yield* hashOf(Base),
|
|
541
|
+
]);
|
|
542
|
+
}));
|
|
543
|
+
})),
|
|
544
|
+
},
|
|
545
|
+
];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ConformanceCase } from "../../conformance.ts";
|
|
2
|
+
import { type WorkflowsFixture } from "./actors.ts";
|
|
3
|
+
/** Tenant separation, routing keys, and caller attribution of workflows. */
|
|
4
|
+
export declare const workflowAccessConformance: ReadonlyArray<ConformanceCase<WorkflowsFixture>>;
|