@rikalabs/akter 0.1.0-alpha.0 → 0.1.0-alpha.3
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 +46 -3
- package/README.md +2 -2
- package/dist/actor/definition.d.ts +13 -9
- package/dist/actor/descriptor.d.ts +2 -2
- package/dist/actor/descriptor.js +4 -4
- package/dist/client/calls.js +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/errors/actor.d.ts +12 -42
- package/dist/errors/actor.js +13 -42
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/members/payload.d.ts +1 -1
- package/dist/protocol/inspection.d.ts +221 -1
- package/dist/protocol/inspection.js +151 -2
- package/dist/protocol/wire.d.ts +6 -49
- package/dist/protocol/wire.js +1 -10
- package/dist/runtime/actors.d.ts +3 -0
- package/dist/runtime/adoption/backfill.js +1 -1
- package/dist/runtime/adoption/enforce.js +2 -2
- package/dist/runtime/adoption/observe.js +1 -1
- package/dist/runtime/adoption/plan.d.ts +1 -1
- package/dist/runtime/adoption/startup.js +1 -1
- package/dist/runtime/adoption/status.d.ts +1 -1
- package/dist/runtime/app.d.ts +65 -0
- package/dist/runtime/app.js +38 -0
- package/dist/runtime/connections/holder.d.ts +11 -1
- package/dist/runtime/connections/holder.js +8 -4
- package/dist/runtime/connections/streams.d.ts +4 -4
- package/dist/runtime/content/store.js +15 -11
- package/dist/runtime/database/bounded.d.ts +4 -18
- package/dist/runtime/database/bounded.js +36 -22
- package/dist/runtime/database/coordination.d.ts +12 -3
- package/dist/runtime/database/coordination.js +29 -36
- package/dist/runtime/database/migrations.d.ts +61 -29
- package/dist/runtime/database/migrations.js +375 -139
- package/dist/runtime/database/replica.d.ts +4 -1
- package/dist/runtime/database/replica.js +4 -1
- package/dist/runtime/database/schema.d.ts +13 -0
- package/dist/runtime/database/schema.js +13 -0
- package/dist/runtime/database/shards.d.ts +31 -13
- package/dist/runtime/database/shards.js +38 -26
- package/dist/runtime/entity/register.d.ts +8 -1
- package/dist/runtime/entity/register.js +58 -7
- package/dist/runtime/fleet/checks.js +4 -4
- package/dist/runtime/fleet/maintainer.d.ts +1 -1
- package/dist/runtime/fleet/maintainer.js +1 -1
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/inspector/layer.d.ts +20 -0
- package/dist/runtime/inspector/layer.js +224 -5
- package/dist/runtime/inspector/queries.d.ts +54 -8
- package/dist/runtime/inspector/queries.js +84 -15
- package/dist/runtime/layer.d.ts +48 -39
- package/dist/runtime/layer.js +124 -56
- package/dist/runtime/operators/audit.d.ts +3 -0
- package/dist/runtime/operators/audit.js +6 -2
- package/dist/runtime/operators/repair.js +30 -10
- package/dist/runtime/operators/seed.js +4 -2
- package/dist/runtime/payloads/versions.d.ts +4 -4
- package/dist/runtime/payloads/versions.js +24 -15
- package/dist/runtime/queries.js +4 -2
- package/dist/runtime/registration.d.ts +5 -2
- package/dist/runtime/registration.js +3 -3
- package/dist/runtime/runner.d.ts +12 -0
- package/dist/runtime/runner.js +12 -0
- package/dist/runtime/storage/codec.d.ts +19 -7
- package/dist/runtime/storage/codec.js +23 -7
- package/dist/runtime/storage/placements.d.ts +6 -1
- package/dist/runtime/storage/placements.js +98 -6
- package/dist/runtime/storage/retention.d.ts +6 -0
- package/dist/runtime/storage/retention.js +25 -13
- package/dist/runtime/subscriptions/relay.js +47 -44
- package/dist/runtime/subscriptions/storage.d.ts +3 -2
- package/dist/runtime/subscriptions/storage.js +9 -6
- package/dist/runtime/telemetry/live.d.ts +255 -0
- package/dist/runtime/telemetry/live.js +540 -0
- package/dist/runtime/telemetry/metrics.d.ts +2 -0
- package/dist/runtime/telemetry/metrics.js +4 -1
- package/dist/runtime/telemetry/sampler.js +33 -13
- package/dist/runtime/telemetry/spans.d.ts +1 -1
- package/dist/runtime/telemetry/spans.js +1 -1
- package/dist/runtime/topology/locks.d.ts +6 -3
- package/dist/runtime/topology/locks.js +27 -4
- package/dist/runtime/turn/execute.d.ts +2 -0
- package/dist/runtime/turn/execute.js +5 -2
- package/dist/runtime/turn/pipeline.d.ts +5 -12
- package/dist/runtime/turn/pipeline.js +11 -11
- package/dist/runtime/turn/relay.d.ts +13 -3
- package/dist/runtime/turn/relay.js +27 -14
- package/dist/runtime/turn/rows.js +4 -4
- package/dist/runtime/workflows/compatibility.d.ts +1 -1
- package/dist/runtime/workflows/compatibility.js +85 -31
- package/dist/runtime/workflows/engine.js +20 -17
- package/dist/serve/layer.js +3 -2
- package/dist/tables/owned.d.ts +1 -1
- package/dist/tables/owned.js +1 -1
- package/dist/testing/actor-test.d.ts +2 -24
- package/dist/testing/actor-test.js +1 -27
- package/dist/testing/index.d.ts +0 -12
- package/dist/testing/index.js +0 -6
- package/package.json +1 -1
- package/dist/runtime/database/neki/migrations.d.ts +0 -31
- package/dist/runtime/database/neki/migrations.js +0 -276
- package/dist/runtime/database/neki/session.d.ts +0 -23
- package/dist/runtime/database/neki/session.js +0 -31
- package/dist/testing/cluster.d.ts +0 -93
- package/dist/testing/cluster.js +0 -296
- package/dist/testing/conformance/access.d.ts +0 -5
- package/dist/testing/conformance/access.js +0 -531
- package/dist/testing/conformance/admission.d.ts +0 -11
- package/dist/testing/conformance/admission.js +0 -182
- package/dist/testing/conformance/adoption.d.ts +0 -2
- package/dist/testing/conformance/adoption.js +0 -1019
- package/dist/testing/conformance/assertions.d.ts +0 -202
- package/dist/testing/conformance/assertions.js +0 -849
- package/dist/testing/conformance/batches.d.ts +0 -41
- package/dist/testing/conformance/batches.js +0 -388
- package/dist/testing/conformance/blobs.d.ts +0 -14
- package/dist/testing/conformance/blobs.js +0 -405
- package/dist/testing/conformance/capacity.d.ts +0 -8
- package/dist/testing/conformance/capacity.js +0 -433
- package/dist/testing/conformance/client.d.ts +0 -5
- package/dist/testing/conformance/client.js +0 -719
- package/dist/testing/conformance/cold-serve.d.ts +0 -16
- package/dist/testing/conformance/cold-serve.js +0 -254
- package/dist/testing/conformance/connections/actors.d.ts +0 -1143
- package/dist/testing/conformance/connections/actors.js +0 -180
- package/dist/testing/conformance/connections/harness.d.ts +0 -1754
- package/dist/testing/conformance/connections/harness.js +0 -142
- package/dist/testing/conformance/connections/holders.d.ts +0 -4
- package/dist/testing/conformance/connections/holders.js +0 -165
- package/dist/testing/conformance/connections/lifecycle.d.ts +0 -4
- package/dist/testing/conformance/connections/lifecycle.js +0 -113
- package/dist/testing/conformance/connections/limits.d.ts +0 -4
- package/dist/testing/conformance/connections/limits.js +0 -127
- package/dist/testing/conformance/connections/reauthorization.d.ts +0 -4
- package/dist/testing/conformance/connections/reauthorization.js +0 -170
- package/dist/testing/conformance/connections/resync.d.ts +0 -4
- package/dist/testing/conformance/connections/resync.js +0 -360
- package/dist/testing/conformance/connections/takeover.d.ts +0 -4
- package/dist/testing/conformance/connections/takeover.js +0 -287
- package/dist/testing/conformance/connections.d.ts +0 -4
- package/dist/testing/conformance/connections.js +0 -15
- package/dist/testing/conformance/content-blobs.d.ts +0 -16
- package/dist/testing/conformance/content-blobs.js +0 -534
- package/dist/testing/conformance/counter.d.ts +0 -16
- package/dist/testing/conformance/counter.js +0 -813
- package/dist/testing/conformance/cron.d.ts +0 -5
- package/dist/testing/conformance/cron.js +0 -665
- package/dist/testing/conformance/drain.d.ts +0 -26
- package/dist/testing/conformance/drain.js +0 -540
- package/dist/testing/conformance/effect-control.d.ts +0 -38
- package/dist/testing/conformance/effect-control.js +0 -1059
- package/dist/testing/conformance/effects.d.ts +0 -23
- package/dist/testing/conformance/effects.js +0 -432
- package/dist/testing/conformance/events.d.ts +0 -28
- package/dist/testing/conformance/events.js +0 -335
- package/dist/testing/conformance/export.d.ts +0 -2
- package/dist/testing/conformance/export.js +0 -368
- package/dist/testing/conformance/fleet.d.ts +0 -444
- package/dist/testing/conformance/fleet.js +0 -1009
- package/dist/testing/conformance/groups.d.ts +0 -7
- package/dist/testing/conformance/groups.js +0 -353
- package/dist/testing/conformance/heap.d.ts +0 -3
- package/dist/testing/conformance/heap.js +0 -149
- package/dist/testing/conformance/http.d.ts +0 -2809
- package/dist/testing/conformance/http.js +0 -1234
- package/dist/testing/conformance/inspection-views.d.ts +0 -8
- package/dist/testing/conformance/inspection-views.js +0 -272
- package/dist/testing/conformance/inspector.d.ts +0 -7
- package/dist/testing/conformance/inspector.js +0 -650
- package/dist/testing/conformance/mint.d.ts +0 -58
- package/dist/testing/conformance/mint.js +0 -692
- package/dist/testing/conformance/multi-runner.d.ts +0 -8
- package/dist/testing/conformance/multi-runner.js +0 -403
- package/dist/testing/conformance/neki/plan.d.ts +0 -19
- package/dist/testing/conformance/neki/plan.js +0 -30
- package/dist/testing/conformance/observability.d.ts +0 -3
- package/dist/testing/conformance/observability.js +0 -343
- package/dist/testing/conformance/offline.d.ts +0 -4
- package/dist/testing/conformance/offline.js +0 -474
- package/dist/testing/conformance/operator-harness.d.ts +0 -57
- package/dist/testing/conformance/operator-harness.js +0 -78
- package/dist/testing/conformance/operator.d.ts +0 -3
- package/dist/testing/conformance/operator.js +0 -379
- package/dist/testing/conformance/outbox-cross-shard.d.ts +0 -14
- package/dist/testing/conformance/outbox-cross-shard.js +0 -160
- package/dist/testing/conformance/outbox.d.ts +0 -36
- package/dist/testing/conformance/outbox.js +0 -437
- package/dist/testing/conformance/payload-migrations.d.ts +0 -3
- package/dist/testing/conformance/payload-migrations.js +0 -612
- package/dist/testing/conformance/pipeline.d.ts +0 -3
- package/dist/testing/conformance/pipeline.js +0 -1040
- package/dist/testing/conformance/placement.d.ts +0 -22
- package/dist/testing/conformance/placement.js +0 -539
- package/dist/testing/conformance/platform.d.ts +0 -40
- package/dist/testing/conformance/platform.js +0 -101
- package/dist/testing/conformance/progress.d.ts +0 -39
- package/dist/testing/conformance/progress.js +0 -666
- package/dist/testing/conformance/properties.d.ts +0 -6
- package/dist/testing/conformance/properties.js +0 -295
- package/dist/testing/conformance/protocols.d.ts +0 -4
- package/dist/testing/conformance/protocols.js +0 -618
- package/dist/testing/conformance/provider/advertise.d.ts +0 -21
- package/dist/testing/conformance/provider/advertise.js +0 -44
- package/dist/testing/conformance/read-your-writes.d.ts +0 -20
- package/dist/testing/conformance/read-your-writes.js +0 -192
- package/dist/testing/conformance/reducers.d.ts +0 -8
- package/dist/testing/conformance/reducers.js +0 -258
- package/dist/testing/conformance/relay.d.ts +0 -42
- package/dist/testing/conformance/relay.js +0 -1115
- package/dist/testing/conformance/restore.d.ts +0 -43
- package/dist/testing/conformance/restore.js +0 -341
- package/dist/testing/conformance/retention.d.ts +0 -14
- package/dist/testing/conformance/retention.js +0 -463
- package/dist/testing/conformance/rls.d.ts +0 -24
- package/dist/testing/conformance/rls.js +0 -576
- package/dist/testing/conformance/simulation.d.ts +0 -31
- package/dist/testing/conformance/simulation.js +0 -167
- package/dist/testing/conformance/single-shard.d.ts +0 -2
- package/dist/testing/conformance/single-shard.js +0 -125
- package/dist/testing/conformance/singleton.d.ts +0 -3
- package/dist/testing/conformance/singleton.js +0 -293
- package/dist/testing/conformance/statements.d.ts +0 -60
- package/dist/testing/conformance/statements.js +0 -108
- package/dist/testing/conformance/streams.d.ts +0 -7
- package/dist/testing/conformance/streams.js +0 -280
- package/dist/testing/conformance/subscriptions/access.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/access.js +0 -98
- package/dist/testing/conformance/subscriptions/actors.d.ts +0 -4910
- package/dist/testing/conformance/subscriptions/actors.js +0 -372
- package/dist/testing/conformance/subscriptions/cluster.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/cluster.js +0 -89
- package/dist/testing/conformance/subscriptions/delivery.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/delivery.js +0 -253
- package/dist/testing/conformance/subscriptions/deploys.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/deploys.js +0 -162
- package/dist/testing/conformance/subscriptions/epochs.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/epochs.js +0 -169
- package/dist/testing/conformance/subscriptions/failures.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/failures.js +0 -108
- package/dist/testing/conformance/subscriptions/feeds.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/feeds.js +0 -218
- package/dist/testing/conformance/subscriptions/harness.d.ts +0 -124
- package/dist/testing/conformance/subscriptions/harness.js +0 -143
- package/dist/testing/conformance/subscriptions/operator.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/operator.js +0 -128
- package/dist/testing/conformance/subscriptions/retention.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/retention.js +0 -288
- package/dist/testing/conformance/subscriptions/routing.d.ts +0 -4
- package/dist/testing/conformance/subscriptions/routing.js +0 -179
- package/dist/testing/conformance/subscriptions.d.ts +0 -4
- package/dist/testing/conformance/subscriptions.js +0 -19
- package/dist/testing/conformance/tables.d.ts +0 -125
- package/dist/testing/conformance/tables.js +0 -664
- package/dist/testing/conformance/transports/actors.d.ts +0 -1907
- package/dist/testing/conformance/transports/actors.js +0 -163
- package/dist/testing/conformance/transports/client.d.ts +0 -3
- package/dist/testing/conformance/transports/client.js +0 -237
- package/dist/testing/conformance/transports/feeds.d.ts +0 -3
- package/dist/testing/conformance/transports/feeds.js +0 -232
- package/dist/testing/conformance/transports/harness.d.ts +0 -93
- package/dist/testing/conformance/transports/harness.js +0 -84
- package/dist/testing/conformance/transports/streams.d.ts +0 -3
- package/dist/testing/conformance/transports/streams.js +0 -96
- package/dist/testing/conformance/transports/websocket.d.ts +0 -3
- package/dist/testing/conformance/transports/websocket.js +0 -384
- package/dist/testing/conformance/transports/wire.d.ts +0 -141
- package/dist/testing/conformance/transports/wire.js +0 -204
- package/dist/testing/conformance/transports.d.ts +0 -3
- package/dist/testing/conformance/transports.js +0 -11
- package/dist/testing/conformance/watch.d.ts +0 -59
- package/dist/testing/conformance/watch.js +0 -879
- package/dist/testing/conformance/workflow-engine.d.ts +0 -97
- package/dist/testing/conformance/workflow-engine.js +0 -253
- package/dist/testing/conformance/workflow-versions.d.ts +0 -3
- package/dist/testing/conformance/workflow-versions.js +0 -545
- package/dist/testing/conformance/workflows/access.d.ts +0 -4
- package/dist/testing/conformance/workflows/access.js +0 -147
- package/dist/testing/conformance/workflows/actors.d.ts +0 -2317
- package/dist/testing/conformance/workflows/actors.js +0 -305
- package/dist/testing/conformance/workflows/basics.d.ts +0 -4
- package/dist/testing/conformance/workflows/basics.js +0 -144
- package/dist/testing/conformance/workflows/engine.d.ts +0 -4
- package/dist/testing/conformance/workflows/engine.js +0 -80
- package/dist/testing/conformance/workflows/guards.d.ts +0 -4
- package/dist/testing/conformance/workflows/guards.js +0 -172
- package/dist/testing/conformance/workflows/harness.d.ts +0 -14
- package/dist/testing/conformance/workflows/harness.js +0 -44
- package/dist/testing/conformance/workflows/recovery.d.ts +0 -4
- package/dist/testing/conformance/workflows/recovery.js +0 -181
- package/dist/testing/conformance/workflows/starts.d.ts +0 -4
- package/dist/testing/conformance/workflows/starts.js +0 -57
- package/dist/testing/conformance/workflows/suspension.d.ts +0 -4
- package/dist/testing/conformance/workflows/suspension.js +0 -106
- package/dist/testing/conformance/workflows/waits.d.ts +0 -4
- package/dist/testing/conformance/workflows/waits.js +0 -284
- package/dist/testing/conformance/workflows.d.ts +0 -4
- package/dist/testing/conformance/workflows.js +0 -19
- package/dist/testing/conformance.d.ts +0 -330
- package/dist/testing/conformance.js +0 -364
- package/dist/testing/foundation.d.ts +0 -41
- package/dist/testing/foundation.js +0 -517
- package/dist/testing/simulate-cluster.d.ts +0 -112
- package/dist/testing/simulate-cluster.js +0 -257
- package/dist/testing/simulate.d.ts +0 -90
- package/dist/testing/simulate.js +0 -127
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
import { Effect, Layer, Logger, ManagedRuntime, Option } from "effect";
|
|
2
|
-
import { constVoid } from "effect/Function";
|
|
3
|
-
import { Statement } from "effect/sql";
|
|
4
|
-
import { User } from "../index.js";
|
|
5
|
-
import { principal } from "../identity/caller.js";
|
|
6
|
-
import { ContentHooks, TurnHooks, } from "../runtime/turn/hooks.js";
|
|
7
|
-
import { NekiTurnSessions } from "../runtime/database/neki/session.js";
|
|
8
|
-
import { ActorTest } from "./actor-test.js";
|
|
9
|
-
import { accessConformance, accessSuite } from "./conformance/access.js";
|
|
10
|
-
import { admissionConformance, admissionSuite } from "./conformance/admission.js";
|
|
11
|
-
import { adoptionConformance } from "./conformance/adoption.js";
|
|
12
|
-
import { assertionsConformance, assertionsSuite, edgeConformance, } from "./conformance/assertions.js";
|
|
13
|
-
import { batchesConformance, batchesSuite } from "./conformance/batches.js";
|
|
14
|
-
import { blobsConformance, blobsSuite } from "./conformance/blobs.js";
|
|
15
|
-
import { capacityConformance } from "./conformance/capacity.js";
|
|
16
|
-
import { clientConformance, clientSuite } from "./conformance/client.js";
|
|
17
|
-
import { coldServeConformance, coldServeEdgeConformance, coldServeSuite, } from "./conformance/cold-serve.js";
|
|
18
|
-
import { connectionsConformance } from "./conformance/connections.js";
|
|
19
|
-
import { connectionsSuite } from "./conformance/connections/actors.js";
|
|
20
|
-
import { contentConformance, contentSuite } from "./conformance/content-blobs.js";
|
|
21
|
-
import { counterConformance, counterSuite } from "./conformance/counter.js";
|
|
22
|
-
import { cronClusterConformance, cronConformance } from "./conformance/cron.js";
|
|
23
|
-
import { drainConformance, drainSuite } from "./conformance/drain.js";
|
|
24
|
-
import { effectControlClusterConformance, effectControlConformance, effectControlSuite, } from "./conformance/effect-control.js";
|
|
25
|
-
import { effectsConformance, effectsSuite } from "./conformance/effects.js";
|
|
26
|
-
import { eventsConformance, eventsSuite } from "./conformance/events.js";
|
|
27
|
-
import { exportConformance } from "./conformance/export.js";
|
|
28
|
-
import { fleetConformance, fleetSuite } from "./conformance/fleet.js";
|
|
29
|
-
import { heapConformance } from "./conformance/heap.js";
|
|
30
|
-
import { httpConformance, httpSuite } from "./conformance/http.js";
|
|
31
|
-
import { inspectionViewsConformance, inspectionViewsSuite } from "./conformance/inspection-views.js";
|
|
32
|
-
import { inspectorConformance, inspectorSuite } from "./conformance/inspector.js";
|
|
33
|
-
import { mintConformance, mintSuite } from "./conformance/mint.js";
|
|
34
|
-
import { multiRunnerConformance } from "./conformance/multi-runner.js";
|
|
35
|
-
import { observabilityConformance } from "./conformance/observability.js";
|
|
36
|
-
import { offlineConformance, offlineSuite } from "./conformance/offline.js";
|
|
37
|
-
import { operatorConformance } from "./conformance/operator.js";
|
|
38
|
-
import { crossShardOutboxConformance, crossShardSuite } from "./conformance/outbox-cross-shard.js";
|
|
39
|
-
import { outboxConformance, outboxSuite } from "./conformance/outbox.js";
|
|
40
|
-
import { payloadMigrationsConformance } from "./conformance/payload-migrations.js";
|
|
41
|
-
import { pipelineConformance } from "./conformance/pipeline.js";
|
|
42
|
-
import { groupsConformance } from "./conformance/groups.js";
|
|
43
|
-
import { placementConformance, placementSuite } from "./conformance/placement.js";
|
|
44
|
-
import { progressConformance, progressDeliveryConformance, progressSuite, } from "./conformance/progress.js";
|
|
45
|
-
import { propertiesConformance, propertiesSuite } from "./conformance/properties.js";
|
|
46
|
-
import { protocolsConformance, protocolsSuite } from "./conformance/protocols.js";
|
|
47
|
-
import { readYourWritesConformance, readYourWritesSuite } from "./conformance/read-your-writes.js";
|
|
48
|
-
import { reducerConformance, reducerSuite } from "./conformance/reducers.js";
|
|
49
|
-
import { relayClusterConformance, relayConformance, relaySuite } from "./conformance/relay.js";
|
|
50
|
-
import { restoreConformance, restoreSuite } from "./conformance/restore.js";
|
|
51
|
-
import { retentionConformance, retentionSuite } from "./conformance/retention.js";
|
|
52
|
-
import { rlsConformance } from "./conformance/rls.js";
|
|
53
|
-
import { simulationConformance } from "./conformance/simulation.js";
|
|
54
|
-
import { singleShardConformance } from "./conformance/single-shard.js";
|
|
55
|
-
import { singletonConformance } from "./conformance/singleton.js";
|
|
56
|
-
import { streamsConformance, streamsSuite } from "./conformance/streams.js";
|
|
57
|
-
import { subscriptionsConformance } from "./conformance/subscriptions.js";
|
|
58
|
-
import { subscriptionsSuite } from "./conformance/subscriptions/actors.js";
|
|
59
|
-
import { subscriptionsClusterConformance } from "./conformance/subscriptions/cluster.js";
|
|
60
|
-
import { subscriptionsRetentionConformance } from "./conformance/subscriptions/retention.js";
|
|
61
|
-
import { tablesConformance, tablesSuite } from "./conformance/tables.js";
|
|
62
|
-
import { transportsConformance } from "./conformance/transports.js";
|
|
63
|
-
import { transportsSuite } from "./conformance/transports/actors.js";
|
|
64
|
-
import { watchConformance, watchSuite } from "./conformance/watch.js";
|
|
65
|
-
import { workflowVersionsConformance } from "./conformance/workflow-versions.js";
|
|
66
|
-
import { workflowsConformance } from "./conformance/workflows.js";
|
|
67
|
-
import { workflowsSuite } from "./conformance/workflows/actors.js";
|
|
68
|
-
import { foundationConformance, foundationSuite } from "./foundation.js";
|
|
69
|
-
const group = (suite, cases, requires) => ({
|
|
70
|
-
suite,
|
|
71
|
-
cases: requires === undefined ? cases : cases.map((each) => ({ ...each, ...requires })),
|
|
72
|
-
});
|
|
73
|
-
/** Every case of the group opens a fresh database or a snapshot. */
|
|
74
|
-
const freshDatabases = { requiresFreshDatabase: true };
|
|
75
|
-
/** Cases whose own actors, if any, they build into their own runtimes or clusters. */
|
|
76
|
-
const standalone = {};
|
|
77
|
-
/**
|
|
78
|
-
* Every suite in the registry. The single-shard case checks the routing of
|
|
79
|
-
* every statement the framework issues, so it needs every feature's actors
|
|
80
|
-
* registered, as a deployment of all of them would.
|
|
81
|
-
*/
|
|
82
|
-
const everySuite = {
|
|
83
|
-
get uses() {
|
|
84
|
-
return [...new Set(allGroups.map((group) => conformanceGroups[group].suite))].filter((suite) => suite !== everySuite);
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
/**
|
|
88
|
-
* Every conformance case, grouped by the file that owns it, with the suite
|
|
89
|
-
* that owns its actors. `describeConformance` runs a subset through `groups`,
|
|
90
|
-
* so a group can run in its own Vitest file and worker; `conformance` is
|
|
91
|
-
* their union and the order within a group is kept.
|
|
92
|
-
*/
|
|
93
|
-
export const conformanceGroups = {
|
|
94
|
-
foundation: group(foundationSuite, foundationConformance),
|
|
95
|
-
access: group(accessSuite, accessConformance, freshDatabases),
|
|
96
|
-
admission: group(admissionSuite, admissionConformance),
|
|
97
|
-
http: group(httpSuite, httpConformance),
|
|
98
|
-
protocols: group(protocolsSuite, protocolsConformance),
|
|
99
|
-
assertions: group(assertionsSuite, assertionsConformance),
|
|
100
|
-
edge: group(assertionsSuite, edgeConformance),
|
|
101
|
-
coldServeEdge: group(coldServeSuite, coldServeEdgeConformance),
|
|
102
|
-
client: group(clientSuite, clientConformance),
|
|
103
|
-
offline: group(offlineSuite, offlineConformance),
|
|
104
|
-
capacity: group(standalone, capacityConformance, freshDatabases),
|
|
105
|
-
heap: group(standalone, heapConformance, freshDatabases),
|
|
106
|
-
events: group(eventsSuite, eventsConformance),
|
|
107
|
-
reducer: group(reducerSuite, reducerConformance),
|
|
108
|
-
outbox: group(outboxSuite, outboxConformance),
|
|
109
|
-
tables: group(tablesSuite, tablesConformance),
|
|
110
|
-
effects: group(effectsSuite, effectsConformance),
|
|
111
|
-
progress: group(progressSuite, progressConformance),
|
|
112
|
-
multiRunner: group(standalone, multiRunnerConformance, freshDatabases),
|
|
113
|
-
simulation: group(standalone, simulationConformance, freshDatabases),
|
|
114
|
-
drain: group(drainSuite, drainConformance),
|
|
115
|
-
pipeline: group(standalone, pipelineConformance, freshDatabases),
|
|
116
|
-
batches: group(batchesSuite, batchesConformance),
|
|
117
|
-
groups: group(standalone, groupsConformance, freshDatabases),
|
|
118
|
-
relay: group(relaySuite, relayConformance),
|
|
119
|
-
relayCluster: group(relaySuite, relayClusterConformance, freshDatabases),
|
|
120
|
-
effectControl: group(effectControlSuite, effectControlConformance),
|
|
121
|
-
effectControlCluster: group(effectControlSuite, effectControlClusterConformance),
|
|
122
|
-
singleton: group(standalone, singletonConformance, freshDatabases),
|
|
123
|
-
cron: group(standalone, cronConformance, freshDatabases),
|
|
124
|
-
cronCluster: group(standalone, cronClusterConformance, freshDatabases),
|
|
125
|
-
blobs: group(blobsSuite, blobsConformance),
|
|
126
|
-
inspectionViews: group(inspectionViewsSuite, inspectionViewsConformance),
|
|
127
|
-
inspector: group(inspectorSuite, inspectorConformance),
|
|
128
|
-
rls: group(standalone, rlsConformance, freshDatabases),
|
|
129
|
-
retention: group(retentionSuite, retentionConformance),
|
|
130
|
-
restore: group(restoreSuite, restoreConformance, freshDatabases),
|
|
131
|
-
workflows: group(workflowsSuite, workflowsConformance),
|
|
132
|
-
connections: group(connectionsSuite, connectionsConformance),
|
|
133
|
-
streams: group(streamsSuite, streamsConformance),
|
|
134
|
-
progressDelivery: group(progressSuite, progressDeliveryConformance),
|
|
135
|
-
transports: group(transportsSuite, transportsConformance),
|
|
136
|
-
workflowVersions: group(standalone, workflowVersionsConformance, freshDatabases),
|
|
137
|
-
payloadMigrations: group(standalone, payloadMigrationsConformance, freshDatabases),
|
|
138
|
-
subscriptions: group(subscriptionsSuite, subscriptionsConformance),
|
|
139
|
-
subscriptionsRetention: group(subscriptionsSuite, subscriptionsRetentionConformance),
|
|
140
|
-
subscriptionsCluster: group(subscriptionsSuite, subscriptionsClusterConformance, freshDatabases),
|
|
141
|
-
content: group(contentSuite, contentConformance),
|
|
142
|
-
counter: group(counterSuite, counterConformance),
|
|
143
|
-
properties: group(propertiesSuite, propertiesConformance),
|
|
144
|
-
mint: group(mintSuite, mintConformance),
|
|
145
|
-
readYourWrites: group(readYourWritesSuite, readYourWritesConformance),
|
|
146
|
-
observability: group(standalone, observabilityConformance, freshDatabases),
|
|
147
|
-
operator: group(standalone, operatorConformance, freshDatabases),
|
|
148
|
-
export: group(standalone, exportConformance, freshDatabases),
|
|
149
|
-
coldServe: group(coldServeSuite, coldServeConformance),
|
|
150
|
-
placement: group(placementSuite, placementConformance),
|
|
151
|
-
watch: group(watchSuite, watchConformance),
|
|
152
|
-
adoption: group(standalone, adoptionConformance),
|
|
153
|
-
singleShard: group(everySuite, singleShardConformance),
|
|
154
|
-
crossShardOutbox: group(crossShardSuite, crossShardOutboxConformance),
|
|
155
|
-
fleet: group(fleetSuite, fleetConformance),
|
|
156
|
-
};
|
|
157
|
-
const allGroups = Object.keys(conformanceGroups);
|
|
158
|
-
/**
|
|
159
|
-
* The shared durable-turn conformance cases. Cases flagged
|
|
160
|
-
* `requiresIndependentConnections` need real Postgres: a second database
|
|
161
|
-
* connection to read committed state while a turn holds its transaction open
|
|
162
|
-
* or to take a competing row lock, or a database outside the JavaScript heap
|
|
163
|
-
* they measure. They never run on single-connection backends such as PGlite.
|
|
164
|
-
*/
|
|
165
|
-
export const conformance = allGroups.flatMap((name) => conformanceGroups[name].cases);
|
|
166
|
-
/** The capabilities `conformanceCase` requires, in a fixed order. */
|
|
167
|
-
export const requirementsOf = (conformanceCase) => [
|
|
168
|
-
...(conformanceCase.requiresIndependentConnections === true
|
|
169
|
-
? ["independentConnections"]
|
|
170
|
-
: []),
|
|
171
|
-
...(conformanceCase.requiresReplica === true ? ["replica"] : []),
|
|
172
|
-
...(conformanceCase.requiresEdge === true ? ["edge"] : []),
|
|
173
|
-
...(conformanceCase.requiresNeki === true ? ["neki"] : []),
|
|
174
|
-
...(conformanceCase.requiresLogicalDecoding === true ? ["logicalDecoding"] : []),
|
|
175
|
-
...(conformanceCase.requiresFreshDatabase === true ? ["freshDatabase"] : []),
|
|
176
|
-
];
|
|
177
|
-
/** The capabilities `backend` provides. */
|
|
178
|
-
export const capabilitiesOf = (backend) => new Set([
|
|
179
|
-
...(backend.independentConnections ? ["independentConnections"] : []),
|
|
180
|
-
...(backend.hasReplica === true ? ["replica"] : []),
|
|
181
|
-
...(backend.edge === undefined ? [] : ["edge"]),
|
|
182
|
-
...(backend.neki === true ? ["neki"] : []),
|
|
183
|
-
...(backend.logicalDecoding === true ? ["logicalDecoding"] : []),
|
|
184
|
-
...(backend.freshDatabases ? ["freshDatabase"] : []),
|
|
185
|
-
]);
|
|
186
|
-
/** `suites` and every suite they use, each once, dependencies first. */
|
|
187
|
-
const withDependencies = (suites) => {
|
|
188
|
-
const ordered = [];
|
|
189
|
-
const visit = (suite) => {
|
|
190
|
-
if (ordered.includes(suite))
|
|
191
|
-
return;
|
|
192
|
-
for (const used of suite.uses ?? [])
|
|
193
|
-
visit(used);
|
|
194
|
-
ordered.push(suite);
|
|
195
|
-
};
|
|
196
|
-
for (const suite of suites)
|
|
197
|
-
visit(suite);
|
|
198
|
-
return ordered;
|
|
199
|
-
};
|
|
200
|
-
/**
|
|
201
|
-
* Registers the named groups' cases, or every group's, against `backend`.
|
|
202
|
-
* Only the selected groups' suites, and the suites they use, build their
|
|
203
|
-
* actors and fixtures. The same case names run on every backend; a case
|
|
204
|
-
* whose requirements the backend lacks is reported through `registrar.skip`.
|
|
205
|
-
*
|
|
206
|
-
* Each case runs under the registrar's abort signal: a timed-out or
|
|
207
|
-
* cancelled case is interrupted, its finalizers run, and the next case waits
|
|
208
|
-
* for them, then restarts a runtime the case left stopped and starts with
|
|
209
|
-
* open test authorization.
|
|
210
|
-
*/
|
|
211
|
-
export const describeConformance = (options) => registerConformance({
|
|
212
|
-
...options,
|
|
213
|
-
selected: (options.groups ?? allGroups).map((group) => conformanceGroups[group]),
|
|
214
|
-
});
|
|
215
|
-
/** How long the next case waits for an interrupted case's finalizers before it starts anyway. */
|
|
216
|
-
const SETTLE_TIMEOUT = "20 seconds";
|
|
217
|
-
/** Registers `selected` groups; `describeConformance` passes registry groups, tests pass their own. */
|
|
218
|
-
export const registerConformance = (options) => {
|
|
219
|
-
const { name, backend, registrar, selected } = options;
|
|
220
|
-
const suites = withDependencies(selected.map(({ suite }) => suite));
|
|
221
|
-
const fixtures = new Map(suites.map((suite) => [suite, suite.fixture?.()]));
|
|
222
|
-
const fixtureOf = (suite) => {
|
|
223
|
-
if (!fixtures.has(suite))
|
|
224
|
-
throw new Error("A conformance case read the fixture of a suite its own suite does not use");
|
|
225
|
-
return fixtures.get(suite);
|
|
226
|
-
};
|
|
227
|
-
const access = { allowed: true, denied: new Set(), revoked: new Set() };
|
|
228
|
-
const turnHooks = suites.flatMap((suite) => suite.turn?.(fixtureOf(suite)) ?? []);
|
|
229
|
-
const contentHooks = suites.flatMap((suite) => suite.content?.(fixtureOf(suite)) ?? []);
|
|
230
|
-
const loggers = suites.flatMap((suite) => suite.logger?.(fixtureOf(suite)) ?? []);
|
|
231
|
-
let live = Layer.empty;
|
|
232
|
-
for (const suite of suites)
|
|
233
|
-
if (suite.layer !== undefined)
|
|
234
|
-
live = Layer.merge(live, suite.layer(fixtureOf(suite)));
|
|
235
|
-
const capabilities = capabilitiesOf(backend);
|
|
236
|
-
let store;
|
|
237
|
-
let current;
|
|
238
|
-
const opened = () => {
|
|
239
|
-
if (store === undefined)
|
|
240
|
-
throw new Error("Conformance environment is not open");
|
|
241
|
-
return store;
|
|
242
|
-
};
|
|
243
|
-
const environment = {
|
|
244
|
-
run: (effect) => {
|
|
245
|
-
if (current === undefined)
|
|
246
|
-
return Promise.reject(new Error("Conformance environment is stopped"));
|
|
247
|
-
return current.runPromise(Effect.scoped(effect));
|
|
248
|
-
},
|
|
249
|
-
build: (overrides) => ManagedRuntime.make(live.pipe(Layer.provideMerge(ActorTest.layer({
|
|
250
|
-
database: overrides?.database ?? opened().database,
|
|
251
|
-
maxConnections: 6,
|
|
252
|
-
admission: overrides?.admission,
|
|
253
|
-
replica: overrides?.replica,
|
|
254
|
-
as: User.make({ subject: "alice" }),
|
|
255
|
-
authorize: (request) => Effect.sync(() => access.allowed &&
|
|
256
|
-
!access.denied.has(request.command) &&
|
|
257
|
-
Option.match(principal(request.caller), {
|
|
258
|
-
onNone: () => true,
|
|
259
|
-
onSome: ({ subject }) => !access.revoked.has(subject),
|
|
260
|
-
})),
|
|
261
|
-
retryWindowMs: overrides?.retryWindowMs ?? 60_000,
|
|
262
|
-
content: overrides?.content,
|
|
263
|
-
}).pipe(Layer.provide(Layer.mergeAll(Layer.succeed(TurnHooks, {
|
|
264
|
-
at: (point, request) => Effect.forEach(turnHooks, (hook) => hook(point, request), { discard: true }),
|
|
265
|
-
}), Layer.succeed(ContentHooks, {
|
|
266
|
-
at: (point) => Effect.forEach(contentHooks, (hook) => hook(point), { discard: true }),
|
|
267
|
-
}), Layer.succeed(NekiTurnSessions, backend.neki === true), overrides?.observe === undefined
|
|
268
|
-
? Layer.empty
|
|
269
|
-
: Layer.succeed(Statement.CurrentTransformer, (statement) => Effect.sync(() => {
|
|
270
|
-
overrides.observe(statement);
|
|
271
|
-
return statement;
|
|
272
|
-
})))))), Layer.provideMerge(backend.services), Layer.provide(Logger.layer(loggers, { mergeWithExisting: true })), Layer.orDie)),
|
|
273
|
-
stop: Effect.suspend(() => {
|
|
274
|
-
const previous = current;
|
|
275
|
-
current = undefined;
|
|
276
|
-
return previous === undefined ? Effect.void : Effect.promise(() => previous.dispose());
|
|
277
|
-
}),
|
|
278
|
-
restart: Effect.suspend(() => Effect.andThen(environment.stop, () => Effect.promise(() => {
|
|
279
|
-
current = environment.build();
|
|
280
|
-
return current.runPromise(Effect.void);
|
|
281
|
-
}))),
|
|
282
|
-
freshDatabase: Effect.suspend(() => opened().freshDatabase),
|
|
283
|
-
snapshot: Effect.suspend(() => {
|
|
284
|
-
if (current !== undefined)
|
|
285
|
-
return Effect.die(new Error("A snapshot needs the conformance runtime stopped"));
|
|
286
|
-
return opened().copy(opened().database);
|
|
287
|
-
}),
|
|
288
|
-
get connect() {
|
|
289
|
-
return store?.connect;
|
|
290
|
-
},
|
|
291
|
-
get replica() {
|
|
292
|
-
return store?.replica;
|
|
293
|
-
},
|
|
294
|
-
httpServer: backend.httpServer,
|
|
295
|
-
get edge() {
|
|
296
|
-
return backend.edge;
|
|
297
|
-
},
|
|
298
|
-
};
|
|
299
|
-
/** The environment one case sees: its runs end with its signal, and only a declared case opens databases. */
|
|
300
|
-
const environmentFor = (conformanceCase, signal) => {
|
|
301
|
-
const undeclared = Effect.die(new Error(`Conformance case "${conformanceCase.name}" opens a fresh database or snapshot without declaring requiresFreshDatabase`));
|
|
302
|
-
return {
|
|
303
|
-
run: (effect) => {
|
|
304
|
-
if (current === undefined)
|
|
305
|
-
return Promise.reject(new Error("Conformance environment is stopped"));
|
|
306
|
-
return current.runPromise(Effect.scoped(effect), { signal });
|
|
307
|
-
},
|
|
308
|
-
build: environment.build,
|
|
309
|
-
stop: environment.stop,
|
|
310
|
-
restart: environment.restart,
|
|
311
|
-
freshDatabase: conformanceCase.requiresFreshDatabase === true ? environment.freshDatabase : undeclared,
|
|
312
|
-
snapshot: conformanceCase.requiresFreshDatabase === true ? environment.snapshot : undeclared,
|
|
313
|
-
get connect() {
|
|
314
|
-
return environment.connect;
|
|
315
|
-
},
|
|
316
|
-
get replica() {
|
|
317
|
-
return environment.replica;
|
|
318
|
-
},
|
|
319
|
-
httpServer: environment.httpServer,
|
|
320
|
-
get edge() {
|
|
321
|
-
return environment.edge;
|
|
322
|
-
},
|
|
323
|
-
};
|
|
324
|
-
};
|
|
325
|
-
let previousCase = Promise.resolve();
|
|
326
|
-
registrar.describe(name, () => {
|
|
327
|
-
registrar.beforeAll(() => Effect.runPromise(Effect.gen(function* () {
|
|
328
|
-
store = yield* Effect.promise(() => backend.open());
|
|
329
|
-
yield* environment.restart;
|
|
330
|
-
})), 30_000);
|
|
331
|
-
registrar.afterAll(() => previousCase.then(constVoid, constVoid).then(() => Effect.runPromise(Effect.gen(function* () {
|
|
332
|
-
yield* environment.stop;
|
|
333
|
-
if (store !== undefined)
|
|
334
|
-
yield* store.close;
|
|
335
|
-
store = undefined;
|
|
336
|
-
}))));
|
|
337
|
-
for (const { suite, cases } of selected)
|
|
338
|
-
for (const conformanceCase of cases) {
|
|
339
|
-
if (requirementsOf(conformanceCase).some((required) => !capabilities.has(required))) {
|
|
340
|
-
registrar.skip(conformanceCase.name);
|
|
341
|
-
continue;
|
|
342
|
-
}
|
|
343
|
-
registrar.it(conformanceCase.name, ({ signal }) => {
|
|
344
|
-
const settled = Effect.runPromise(Effect.promise(() => previousCase.then(constVoid, constVoid)).pipe(Effect.timeoutOption(SETTLE_TIMEOUT)));
|
|
345
|
-
const running = settled
|
|
346
|
-
.then(() => {
|
|
347
|
-
access.allowed = true;
|
|
348
|
-
access.denied.clear();
|
|
349
|
-
access.revoked.clear();
|
|
350
|
-
return Effect.runPromise(Effect.suspend(() => (current === undefined ? environment.restart : Effect.void)));
|
|
351
|
-
})
|
|
352
|
-
.then(() => conformanceCase.run({
|
|
353
|
-
expect: registrar.expect,
|
|
354
|
-
environment: environmentFor(conformanceCase, signal),
|
|
355
|
-
fixture: fixtureOf(suite),
|
|
356
|
-
access,
|
|
357
|
-
fixtureOf,
|
|
358
|
-
}));
|
|
359
|
-
previousCase = running;
|
|
360
|
-
return running;
|
|
361
|
-
}, conformanceCase.timeoutMs);
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Effect, Layer, Logger } from "effect";
|
|
2
|
-
import type { ConformanceCase } from "./conformance.ts";
|
|
3
|
-
import type { ConformanceSuite } from "./conformance.ts";
|
|
4
|
-
export interface RecordedDefect {
|
|
5
|
-
readonly actor: string;
|
|
6
|
-
readonly id: string;
|
|
7
|
-
readonly command: string;
|
|
8
|
-
readonly cause: string;
|
|
9
|
-
}
|
|
10
|
-
/** The annotations of a `Delivery timed out` warning. */
|
|
11
|
-
export interface RecordedTimeout {
|
|
12
|
-
readonly actor: unknown;
|
|
13
|
-
readonly id: unknown;
|
|
14
|
-
readonly commandId: unknown;
|
|
15
|
-
readonly activation: unknown;
|
|
16
|
-
readonly turnSessions: unknown;
|
|
17
|
-
readonly restarting: unknown;
|
|
18
|
-
}
|
|
19
|
-
export interface FoundationFixture {
|
|
20
|
-
creates: number;
|
|
21
|
-
privateRuns: number;
|
|
22
|
-
slowIds: Array<string>;
|
|
23
|
-
slowFirst: Effect.Effect<void>;
|
|
24
|
-
deliveryRuns: number;
|
|
25
|
-
deliveryHold: Effect.Effect<void>;
|
|
26
|
-
defects: Array<RecordedDefect>;
|
|
27
|
-
/** Each `Delivery timed out` warning the runtime logged. */
|
|
28
|
-
timeouts: Array<RecordedTimeout>;
|
|
29
|
-
}
|
|
30
|
-
export declare const foundationFixture: () => FoundationFixture;
|
|
31
|
-
/**
|
|
32
|
-
* Captures the runtime's deterministic-defect log records, which replace the
|
|
33
|
-
* removed defect hook, and the diagnostics of each delivery that timed out.
|
|
34
|
-
*/
|
|
35
|
-
export declare const defectRecorder: (fixture: FoundationFixture) => Logger.Logger<unknown, void>;
|
|
36
|
-
/** Handlers for the foundation actors; `fixture` supplies the observable state cases assert on. */
|
|
37
|
-
export declare const foundationLayer: (fixture: FoundationFixture) => Layer.Layer<never, never, import("./index.ts").InternalActors>;
|
|
38
|
-
/** Identity, admission, receipts, state migration, and blob cases every backend must pass. A receipt retry may wait for PGlite's busy connection, so its delivery deadline covers that wait as well as the RPC reply. */
|
|
39
|
-
export declare const foundationConformance: ReadonlyArray<ConformanceCase<FoundationFixture>>;
|
|
40
|
-
/** Foundation actors; its logger records deterministic defects and delivery timeouts for the cases to read. */
|
|
41
|
-
export declare const foundationSuite: ConformanceSuite<FoundationFixture>;
|