@smthrs/engine-store 0.0.0-stage → 1.0.0-rc.4
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 +247 -0
- package/LICENSE +21 -0
- package/README.md +146 -2
- package/dist/cjs/ArtifactGc.d.ts +235 -0
- package/dist/cjs/ArtifactGc.d.ts.map +1 -0
- package/dist/cjs/ArtifactGc.js +183 -0
- package/dist/cjs/ArtifactGc.js.map +7 -0
- package/dist/cjs/ArtifactSync.d.ts +164 -0
- package/dist/cjs/ArtifactSync.d.ts.map +1 -0
- package/dist/cjs/ArtifactSync.js +144 -0
- package/dist/cjs/ArtifactSync.js.map +7 -0
- package/dist/cjs/CacheSync.d.ts +112 -0
- package/dist/cjs/CacheSync.d.ts.map +1 -0
- package/dist/cjs/CacheSync.js +64 -0
- package/dist/cjs/CacheSync.js.map +7 -0
- package/dist/cjs/DeferredClockFold.d.ts +354 -0
- package/dist/cjs/DeferredClockFold.d.ts.map +1 -0
- package/dist/cjs/DeferredClockFold.js +335 -0
- package/dist/cjs/DeferredClockFold.js.map +7 -0
- package/dist/cjs/DisasterRecovery.d.ts +431 -0
- package/dist/cjs/DisasterRecovery.d.ts.map +1 -0
- package/dist/cjs/DisasterRecovery.js +453 -0
- package/dist/cjs/DisasterRecovery.js.map +7 -0
- package/dist/cjs/DurableEngineState.d.ts +776 -0
- package/dist/cjs/DurableEngineState.d.ts.map +1 -0
- package/dist/cjs/DurableEngineState.js +1536 -0
- package/dist/cjs/DurableEngineState.js.map +7 -0
- package/dist/cjs/EngineStore.d.ts +158 -0
- package/dist/cjs/EngineStore.d.ts.map +1 -0
- package/dist/cjs/EngineStore.js +398 -0
- package/dist/cjs/EngineStore.js.map +7 -0
- package/dist/cjs/EngineStoreMetrics.d.ts +276 -0
- package/dist/cjs/EngineStoreMetrics.d.ts.map +1 -0
- package/dist/cjs/EngineStoreMetrics.js +135 -0
- package/dist/cjs/EngineStoreMetrics.js.map +7 -0
- package/dist/cjs/Errors.d.ts +22 -0
- package/dist/cjs/Errors.d.ts.map +1 -0
- package/dist/cjs/Errors.js +39 -0
- package/dist/cjs/Errors.js.map +7 -0
- package/dist/cjs/EventTypes.d.ts +27 -0
- package/dist/cjs/EventTypes.d.ts.map +1 -0
- package/dist/cjs/EventTypes.js +37 -0
- package/dist/cjs/EventTypes.js.map +7 -0
- package/dist/cjs/ExecutionFacts.d.ts +59 -0
- package/dist/cjs/ExecutionFacts.d.ts.map +1 -0
- package/dist/cjs/ExecutionFacts.js +123 -0
- package/dist/cjs/ExecutionFacts.js.map +7 -0
- package/dist/cjs/ExecutionSnapshot.d.ts +117 -0
- package/dist/cjs/ExecutionSnapshot.d.ts.map +1 -0
- package/dist/cjs/ExecutionSnapshot.js +111 -0
- package/dist/cjs/ExecutionSnapshot.js.map +7 -0
- package/dist/cjs/Inconsistency.d.ts +154 -0
- package/dist/cjs/Inconsistency.d.ts.map +1 -0
- package/dist/cjs/Inconsistency.js +135 -0
- package/dist/cjs/Inconsistency.js.map +7 -0
- package/dist/cjs/Migrations.d.ts +56 -0
- package/dist/cjs/Migrations.d.ts.map +1 -0
- package/dist/cjs/Migrations.js +78 -0
- package/dist/cjs/Migrations.js.map +7 -0
- package/dist/cjs/OwnerIdentity.d.ts +91 -0
- package/dist/cjs/OwnerIdentity.d.ts.map +1 -0
- package/dist/cjs/OwnerIdentity.js +65 -0
- package/dist/cjs/OwnerIdentity.js.map +7 -0
- package/dist/cjs/PlanInputStore.d.ts +110 -0
- package/dist/cjs/PlanInputStore.d.ts.map +1 -0
- package/dist/cjs/PlanInputStore.js +224 -0
- package/dist/cjs/PlanInputStore.js.map +7 -0
- package/dist/cjs/PlanMergeStore.d.ts +113 -0
- package/dist/cjs/PlanMergeStore.d.ts.map +1 -0
- package/dist/cjs/PlanMergeStore.js +255 -0
- package/dist/cjs/PlanMergeStore.js.map +7 -0
- package/dist/cjs/PlanScheduler.d.ts +363 -0
- package/dist/cjs/PlanScheduler.d.ts.map +1 -0
- package/dist/cjs/PlanScheduler.js +1090 -0
- package/dist/cjs/PlanScheduler.js.map +7 -0
- package/dist/cjs/Reconciliation.d.ts +175 -0
- package/dist/cjs/Reconciliation.d.ts.map +1 -0
- package/dist/cjs/Reconciliation.js +119 -0
- package/dist/cjs/Reconciliation.js.map +7 -0
- package/dist/cjs/ReplayOnly.d.ts +91 -0
- package/dist/cjs/ReplayOnly.d.ts.map +1 -0
- package/dist/cjs/ReplayOnly.js +52 -0
- package/dist/cjs/ReplayOnly.js.map +7 -0
- package/dist/cjs/Retention.d.ts +113 -0
- package/dist/cjs/Retention.d.ts.map +1 -0
- package/dist/cjs/Retention.js +99 -0
- package/dist/cjs/Retention.js.map +7 -0
- package/dist/cjs/RunCatalogRead.d.ts +17 -0
- package/dist/cjs/RunCatalogRead.d.ts.map +1 -0
- package/dist/cjs/RunCatalogRead.js +33 -0
- package/dist/cjs/RunCatalogRead.js.map +7 -0
- package/dist/cjs/RunChangeFeed.d.ts +75 -0
- package/dist/cjs/RunChangeFeed.d.ts.map +1 -0
- package/dist/cjs/RunChangeFeed.js +96 -0
- package/dist/cjs/RunChangeFeed.js.map +7 -0
- package/dist/cjs/RunState.d.ts +116 -0
- package/dist/cjs/RunState.d.ts.map +1 -0
- package/dist/cjs/RunState.js +76 -0
- package/dist/cjs/RunState.js.map +7 -0
- package/dist/cjs/Selection.d.ts +495 -0
- package/dist/cjs/Selection.d.ts.map +1 -0
- package/dist/cjs/Selection.js +288 -0
- package/dist/cjs/Selection.js.map +7 -0
- package/dist/cjs/SelectionStore.d.ts +141 -0
- package/dist/cjs/SelectionStore.d.ts.map +1 -0
- package/dist/cjs/SelectionStore.js +229 -0
- package/dist/cjs/SelectionStore.js.map +7 -0
- package/dist/cjs/StepBoundary.d.ts +501 -0
- package/dist/cjs/StepBoundary.d.ts.map +1 -0
- package/dist/cjs/StepBoundary.js +619 -0
- package/dist/cjs/StepBoundary.js.map +7 -0
- package/dist/cjs/StepCacheFold.d.ts +148 -0
- package/dist/cjs/StepCacheFold.d.ts.map +1 -0
- package/dist/cjs/StepCacheFold.js +131 -0
- package/dist/cjs/StepCacheFold.js.map +7 -0
- package/dist/cjs/StepSandbox.d.ts +78 -0
- package/dist/cjs/StepSandbox.d.ts.map +1 -0
- package/dist/cjs/StepSandbox.js +75 -0
- package/dist/cjs/StepSandbox.js.map +7 -0
- package/dist/cjs/WakeBus.d.ts +116 -0
- package/dist/cjs/WakeBus.d.ts.map +1 -0
- package/dist/cjs/WakeBus.js +89 -0
- package/dist/cjs/WakeBus.js.map +7 -0
- package/dist/cjs/WorkspaceSandbox.d.ts +619 -0
- package/dist/cjs/WorkspaceSandbox.d.ts.map +1 -0
- package/dist/cjs/WorkspaceSandbox.js +711 -0
- package/dist/cjs/WorkspaceSandbox.js.map +7 -0
- package/dist/cjs/index.d.ts +157 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +95 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/internal/ActionPersistence.d.ts +276 -0
- package/dist/cjs/internal/ActionPersistence.d.ts.map +1 -0
- package/dist/cjs/internal/ActionPersistence.js +1395 -0
- package/dist/cjs/internal/ActionPersistence.js.map +7 -0
- package/dist/cjs/internal/ArtifactRoots.d.ts +38 -0
- package/dist/cjs/internal/ArtifactRoots.d.ts.map +1 -0
- package/dist/cjs/internal/ArtifactRoots.js +89 -0
- package/dist/cjs/internal/ArtifactRoots.js.map +7 -0
- package/dist/cjs/internal/AttemptAdmission.d.ts +53 -0
- package/dist/cjs/internal/AttemptAdmission.d.ts.map +1 -0
- package/dist/cjs/internal/AttemptAdmission.js +52 -0
- package/dist/cjs/internal/AttemptAdmission.js.map +7 -0
- package/dist/cjs/internal/AttemptLifecycle.d.ts +245 -0
- package/dist/cjs/internal/AttemptLifecycle.d.ts.map +1 -0
- package/dist/cjs/internal/AttemptLifecycle.js +112 -0
- package/dist/cjs/internal/AttemptLifecycle.js.map +7 -0
- package/dist/cjs/internal/AttemptProbe.d.ts +53 -0
- package/dist/cjs/internal/AttemptProbe.d.ts.map +1 -0
- package/dist/cjs/internal/AttemptProbe.js +66 -0
- package/dist/cjs/internal/AttemptProbe.js.map +7 -0
- package/dist/cjs/internal/CacheAdmission.d.ts +79 -0
- package/dist/cjs/internal/CacheAdmission.d.ts.map +1 -0
- package/dist/cjs/internal/CacheAdmission.js +71 -0
- package/dist/cjs/internal/CacheAdmission.js.map +7 -0
- package/dist/cjs/internal/CacheAgeHistory.d.ts +27 -0
- package/dist/cjs/internal/CacheAgeHistory.d.ts.map +1 -0
- package/dist/cjs/internal/CacheAgeHistory.js +61 -0
- package/dist/cjs/internal/CacheAgeHistory.js.map +7 -0
- package/dist/cjs/internal/CacheAgeVerdicts.d.ts +15 -0
- package/dist/cjs/internal/CacheAgeVerdicts.d.ts.map +1 -0
- package/dist/cjs/internal/CacheAgeVerdicts.js +73 -0
- package/dist/cjs/internal/CacheAgeVerdicts.js.map +7 -0
- package/dist/cjs/internal/CacheOutputPolicy.d.ts +24 -0
- package/dist/cjs/internal/CacheOutputPolicy.d.ts.map +1 -0
- package/dist/cjs/internal/CacheOutputPolicy.js +75 -0
- package/dist/cjs/internal/CacheOutputPolicy.js.map +7 -0
- package/dist/cjs/internal/CachePublication.d.ts +97 -0
- package/dist/cjs/internal/CachePublication.d.ts.map +1 -0
- package/dist/cjs/internal/CachePublication.js +80 -0
- package/dist/cjs/internal/CachePublication.js.map +7 -0
- package/dist/cjs/internal/CallFacts.d.ts +15 -0
- package/dist/cjs/internal/CallFacts.d.ts.map +1 -0
- package/dist/cjs/internal/CallFacts.js +97 -0
- package/dist/cjs/internal/CallFacts.js.map +7 -0
- package/dist/cjs/internal/CopiedRecord.d.ts +61 -0
- package/dist/cjs/internal/CopiedRecord.d.ts.map +1 -0
- package/dist/cjs/internal/CopiedRecord.js +134 -0
- package/dist/cjs/internal/CopiedRecord.js.map +7 -0
- package/dist/cjs/internal/DeferredPersistence.d.ts +108 -0
- package/dist/cjs/internal/DeferredPersistence.d.ts.map +1 -0
- package/dist/cjs/internal/DeferredPersistence.js +270 -0
- package/dist/cjs/internal/DeferredPersistence.js.map +7 -0
- package/dist/cjs/internal/EffectRecords.d.ts +92 -0
- package/dist/cjs/internal/EffectRecords.d.ts.map +1 -0
- package/dist/cjs/internal/EffectRecords.js +63 -0
- package/dist/cjs/internal/EffectRecords.js.map +7 -0
- package/dist/cjs/internal/EngineJj.d.ts +30 -0
- package/dist/cjs/internal/EngineJj.d.ts.map +1 -0
- package/dist/cjs/internal/EngineJj.js +42 -0
- package/dist/cjs/internal/EngineJj.js.map +7 -0
- package/dist/cjs/internal/EngineStateSchema.d.ts +68 -0
- package/dist/cjs/internal/EngineStateSchema.d.ts.map +1 -0
- package/dist/cjs/internal/EngineStateSchema.js +58 -0
- package/dist/cjs/internal/EngineStateSchema.js.map +7 -0
- package/dist/cjs/internal/ExecutionSnapshotRead.d.ts +162 -0
- package/dist/cjs/internal/ExecutionSnapshotRead.d.ts.map +1 -0
- package/dist/cjs/internal/ExecutionSnapshotRead.js +201 -0
- package/dist/cjs/internal/ExecutionSnapshotRead.js.map +7 -0
- package/dist/cjs/internal/ExecutionSnapshotRelations.d.ts +39 -0
- package/dist/cjs/internal/ExecutionSnapshotRelations.d.ts.map +1 -0
- package/dist/cjs/internal/ExecutionSnapshotRelations.js +105 -0
- package/dist/cjs/internal/ExecutionSnapshotRelations.js.map +7 -0
- package/dist/cjs/internal/ExitEncoding.d.ts +180 -0
- package/dist/cjs/internal/ExitEncoding.d.ts.map +1 -0
- package/dist/cjs/internal/ExitEncoding.js +236 -0
- package/dist/cjs/internal/ExitEncoding.js.map +7 -0
- package/dist/cjs/internal/FileBoundarySnapshot.d.ts +14 -0
- package/dist/cjs/internal/FileBoundarySnapshot.d.ts.map +1 -0
- package/dist/cjs/internal/FileBoundarySnapshot.js +51 -0
- package/dist/cjs/internal/FileBoundarySnapshot.js.map +7 -0
- package/dist/cjs/internal/FileEnumeration.d.ts +127 -0
- package/dist/cjs/internal/FileEnumeration.d.ts.map +1 -0
- package/dist/cjs/internal/FileEnumeration.js +194 -0
- package/dist/cjs/internal/FileEnumeration.js.map +7 -0
- package/dist/cjs/internal/HostReflection.d.ts +80 -0
- package/dist/cjs/internal/HostReflection.d.ts.map +1 -0
- package/dist/cjs/internal/HostReflection.js +43 -0
- package/dist/cjs/internal/HostReflection.js.map +7 -0
- package/dist/cjs/internal/JournalRecords.d.ts +325 -0
- package/dist/cjs/internal/JournalRecords.d.ts.map +1 -0
- package/dist/cjs/internal/JournalRecords.js +122 -0
- package/dist/cjs/internal/JournalRecords.js.map +7 -0
- package/dist/cjs/internal/NodeJournal.d.ts +157 -0
- package/dist/cjs/internal/NodeJournal.d.ts.map +1 -0
- package/dist/cjs/internal/NodeJournal.js +192 -0
- package/dist/cjs/internal/NodeJournal.js.map +7 -0
- package/dist/cjs/internal/Ordering.d.ts +14 -0
- package/dist/cjs/internal/Ordering.d.ts.map +1 -0
- package/dist/cjs/internal/Ordering.js +25 -0
- package/dist/cjs/internal/Ordering.js.map +7 -0
- package/dist/cjs/internal/PlanInputs.d.ts +14 -0
- package/dist/cjs/internal/PlanInputs.d.ts.map +1 -0
- package/dist/cjs/internal/PlanInputs.js +78 -0
- package/dist/cjs/internal/PlanInputs.js.map +7 -0
- package/dist/cjs/internal/PlanMerges.d.ts +178 -0
- package/dist/cjs/internal/PlanMerges.d.ts.map +1 -0
- package/dist/cjs/internal/PlanMerges.js +125 -0
- package/dist/cjs/internal/PlanMerges.js.map +7 -0
- package/dist/cjs/internal/ProvenanceSlot.d.ts +30 -0
- package/dist/cjs/internal/ProvenanceSlot.d.ts.map +1 -0
- package/dist/cjs/internal/ProvenanceSlot.js +53 -0
- package/dist/cjs/internal/ProvenanceSlot.js.map +7 -0
- package/dist/cjs/internal/ResultEnvelope.d.ts +88 -0
- package/dist/cjs/internal/ResultEnvelope.d.ts.map +1 -0
- package/dist/cjs/internal/ResultEnvelope.js +90 -0
- package/dist/cjs/internal/ResultEnvelope.js.map +7 -0
- package/dist/cjs/internal/RetentionOps.d.ts +414 -0
- package/dist/cjs/internal/RetentionOps.d.ts.map +1 -0
- package/dist/cjs/internal/RetentionOps.js +354 -0
- package/dist/cjs/internal/RetentionOps.js.map +7 -0
- package/dist/cjs/internal/RunCatalogOps.d.ts +118 -0
- package/dist/cjs/internal/RunCatalogOps.d.ts.map +1 -0
- package/dist/cjs/internal/RunCatalogOps.js +85 -0
- package/dist/cjs/internal/RunCatalogOps.js.map +7 -0
- package/dist/cjs/internal/RunCoordinator.d.ts +78 -0
- package/dist/cjs/internal/RunCoordinator.d.ts.map +1 -0
- package/dist/cjs/internal/RunCoordinator.js +123 -0
- package/dist/cjs/internal/RunCoordinator.js.map +7 -0
- package/dist/cjs/internal/RunDriver.d.ts +192 -0
- package/dist/cjs/internal/RunDriver.d.ts.map +1 -0
- package/dist/cjs/internal/RunDriver.js +1586 -0
- package/dist/cjs/internal/RunDriver.js.map +7 -0
- package/dist/cjs/internal/RunLifecycle.d.ts +22 -0
- package/dist/cjs/internal/RunLifecycle.d.ts.map +1 -0
- package/dist/cjs/internal/RunLifecycle.js +63 -0
- package/dist/cjs/internal/RunLifecycle.js.map +7 -0
- package/dist/cjs/internal/RunListing.d.ts +78 -0
- package/dist/cjs/internal/RunListing.d.ts.map +1 -0
- package/dist/cjs/internal/RunListing.js +171 -0
- package/dist/cjs/internal/RunListing.js.map +7 -0
- package/dist/cjs/internal/RunListingError.d.ts +35 -0
- package/dist/cjs/internal/RunListingError.d.ts.map +1 -0
- package/dist/cjs/internal/RunListingError.js +47 -0
- package/dist/cjs/internal/RunListingError.js.map +7 -0
- package/dist/cjs/internal/RuntimeGraph.d.ts +73 -0
- package/dist/cjs/internal/RuntimeGraph.d.ts.map +1 -0
- package/dist/cjs/internal/RuntimeGraph.js +180 -0
- package/dist/cjs/internal/RuntimeGraph.js.map +7 -0
- package/dist/cjs/internal/SandboxedExecution.d.ts +80 -0
- package/dist/cjs/internal/SandboxedExecution.d.ts.map +1 -0
- package/dist/cjs/internal/SandboxedExecution.js +104 -0
- package/dist/cjs/internal/SandboxedExecution.js.map +7 -0
- package/dist/cjs/internal/StateTransaction.d.ts +44 -0
- package/dist/cjs/internal/StateTransaction.d.ts.map +1 -0
- package/dist/cjs/internal/StateTransaction.js +52 -0
- package/dist/cjs/internal/StateTransaction.js.map +7 -0
- package/dist/cjs/internal/StepFacts.d.ts +14 -0
- package/dist/cjs/internal/StepFacts.d.ts.map +1 -0
- package/dist/cjs/internal/StepFacts.js +58 -0
- package/dist/cjs/internal/StepFacts.js.map +7 -0
- package/dist/cjs/internal/TypedEvents.d.ts +14 -0
- package/dist/cjs/internal/TypedEvents.d.ts.map +1 -0
- package/dist/cjs/internal/TypedEvents.js +37 -0
- package/dist/cjs/internal/TypedEvents.js.map +7 -0
- package/dist/cjs/migrations/0001_initial.d.ts +17 -0
- package/dist/cjs/migrations/0001_initial.d.ts.map +1 -0
- package/dist/cjs/migrations/0001_initial.js +61 -0
- package/dist/cjs/migrations/0001_initial.js.map +7 -0
- package/dist/cjs/migrations/0002_selection_store.d.ts +15 -0
- package/dist/cjs/migrations/0002_selection_store.d.ts.map +1 -0
- package/dist/cjs/migrations/0002_selection_store.js +56 -0
- package/dist/cjs/migrations/0002_selection_store.js.map +7 -0
- package/dist/cjs/migrations/0003_plan_inputs.d.ts +13 -0
- package/dist/cjs/migrations/0003_plan_inputs.d.ts.map +1 -0
- package/dist/cjs/migrations/0003_plan_inputs.js +90 -0
- package/dist/cjs/migrations/0003_plan_inputs.js.map +7 -0
- package/dist/cjs/migrations/0004_plan_environment.d.ts +14 -0
- package/dist/cjs/migrations/0004_plan_environment.d.ts.map +1 -0
- package/dist/cjs/migrations/0004_plan_environment.js +56 -0
- package/dist/cjs/migrations/0004_plan_environment.js.map +7 -0
- package/dist/cjs/migrations/0005_plan_merges.d.ts +14 -0
- package/dist/cjs/migrations/0005_plan_merges.d.ts.map +1 -0
- package/dist/cjs/migrations/0005_plan_merges.js +82 -0
- package/dist/cjs/migrations/0005_plan_merges.js.map +7 -0
- package/dist/cjs/migrations/0006_execution_listing.d.ts +15 -0
- package/dist/cjs/migrations/0006_execution_listing.d.ts.map +1 -0
- package/dist/cjs/migrations/0006_execution_listing.js +101 -0
- package/dist/cjs/migrations/0006_execution_listing.js.map +7 -0
- package/dist/cjs/migrations/0007_run_parent_sequence.d.ts +15 -0
- package/dist/cjs/migrations/0007_run_parent_sequence.d.ts.map +1 -0
- package/dist/cjs/migrations/0007_run_parent_sequence.js +40 -0
- package/dist/cjs/migrations/0007_run_parent_sequence.js.map +7 -0
- package/dist/cjs/migrations/0008_deferred_consumption.d.ts +16 -0
- package/dist/cjs/migrations/0008_deferred_consumption.d.ts.map +1 -0
- package/dist/cjs/migrations/0008_deferred_consumption.js +45 -0
- package/dist/cjs/migrations/0008_deferred_consumption.js.map +7 -0
- package/dist/cjs/migrations/0009_deferred_clock_facts.d.ts +24 -0
- package/dist/cjs/migrations/0009_deferred_clock_facts.d.ts.map +1 -0
- package/dist/cjs/migrations/0009_deferred_clock_facts.js +141 -0
- package/dist/cjs/migrations/0009_deferred_clock_facts.js.map +7 -0
- package/dist/cjs/migrations/0010_pending_cancellation.d.ts +15 -0
- package/dist/cjs/migrations/0010_pending_cancellation.d.ts.map +1 -0
- package/dist/cjs/migrations/0010_pending_cancellation.js +41 -0
- package/dist/cjs/migrations/0010_pending_cancellation.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/test/TestStores.d.ts +89 -0
- package/dist/cjs/test/TestStores.d.ts.map +1 -0
- package/dist/cjs/test/TestStores.js +98 -0
- package/dist/cjs/test/TestStores.js.map +7 -0
- package/dist/esm/ArtifactGc.d.ts +235 -0
- package/dist/esm/ArtifactGc.d.ts.map +1 -0
- package/dist/esm/ArtifactGc.js +268 -0
- package/dist/esm/ArtifactGc.js.map +1 -0
- package/dist/esm/ArtifactSync.d.ts +164 -0
- package/dist/esm/ArtifactSync.d.ts.map +1 -0
- package/dist/esm/ArtifactSync.js +176 -0
- package/dist/esm/ArtifactSync.js.map +1 -0
- package/dist/esm/CacheSync.d.ts +112 -0
- package/dist/esm/CacheSync.d.ts.map +1 -0
- package/dist/esm/CacheSync.js +94 -0
- package/dist/esm/CacheSync.js.map +1 -0
- package/dist/esm/DeferredClockFold.d.ts +354 -0
- package/dist/esm/DeferredClockFold.d.ts.map +1 -0
- package/dist/esm/DeferredClockFold.js +472 -0
- package/dist/esm/DeferredClockFold.js.map +1 -0
- package/dist/esm/DisasterRecovery.d.ts +431 -0
- package/dist/esm/DisasterRecovery.d.ts.map +1 -0
- package/dist/esm/DisasterRecovery.js +523 -0
- package/dist/esm/DisasterRecovery.js.map +1 -0
- package/dist/esm/DurableEngineState.d.ts +776 -0
- package/dist/esm/DurableEngineState.d.ts.map +1 -0
- package/dist/esm/DurableEngineState.js +1648 -0
- package/dist/esm/DurableEngineState.js.map +1 -0
- package/dist/esm/EngineStore.d.ts +158 -0
- package/dist/esm/EngineStore.d.ts.map +1 -0
- package/dist/esm/EngineStore.js +403 -0
- package/dist/esm/EngineStore.js.map +1 -0
- package/dist/esm/EngineStoreMetrics.d.ts +276 -0
- package/dist/esm/EngineStoreMetrics.d.ts.map +1 -0
- package/dist/esm/EngineStoreMetrics.js +260 -0
- package/dist/esm/EngineStoreMetrics.js.map +1 -0
- package/dist/esm/Errors.d.ts +22 -0
- package/dist/esm/Errors.d.ts.map +1 -0
- package/dist/esm/Errors.js +22 -0
- package/dist/esm/Errors.js.map +1 -0
- package/dist/esm/EventTypes.d.ts +27 -0
- package/dist/esm/EventTypes.d.ts.map +1 -0
- package/dist/esm/EventTypes.js +27 -0
- package/dist/esm/EventTypes.js.map +1 -0
- package/dist/esm/ExecutionFacts.d.ts +59 -0
- package/dist/esm/ExecutionFacts.d.ts.map +1 -0
- package/dist/esm/ExecutionFacts.js +96 -0
- package/dist/esm/ExecutionFacts.js.map +1 -0
- package/dist/esm/ExecutionSnapshot.d.ts +117 -0
- package/dist/esm/ExecutionSnapshot.d.ts.map +1 -0
- package/dist/esm/ExecutionSnapshot.js +95 -0
- package/dist/esm/ExecutionSnapshot.js.map +1 -0
- package/dist/esm/Inconsistency.d.ts +154 -0
- package/dist/esm/Inconsistency.d.ts.map +1 -0
- package/dist/esm/Inconsistency.js +133 -0
- package/dist/esm/Inconsistency.js.map +1 -0
- package/dist/esm/Migrations.d.ts +56 -0
- package/dist/esm/Migrations.d.ts.map +1 -0
- package/dist/esm/Migrations.js +91 -0
- package/dist/esm/Migrations.js.map +1 -0
- package/dist/esm/OwnerIdentity.d.ts +91 -0
- package/dist/esm/OwnerIdentity.d.ts.map +1 -0
- package/dist/esm/OwnerIdentity.js +99 -0
- package/dist/esm/OwnerIdentity.js.map +1 -0
- package/dist/esm/PlanInputStore.d.ts +110 -0
- package/dist/esm/PlanInputStore.d.ts.map +1 -0
- package/dist/esm/PlanInputStore.js +207 -0
- package/dist/esm/PlanInputStore.js.map +1 -0
- package/dist/esm/PlanMergeStore.d.ts +113 -0
- package/dist/esm/PlanMergeStore.d.ts.map +1 -0
- package/dist/esm/PlanMergeStore.js +244 -0
- package/dist/esm/PlanMergeStore.js.map +1 -0
- package/dist/esm/PlanScheduler.d.ts +363 -0
- package/dist/esm/PlanScheduler.d.ts.map +1 -0
- package/dist/esm/PlanScheduler.js +1321 -0
- package/dist/esm/PlanScheduler.js.map +1 -0
- package/dist/esm/Reconciliation.d.ts +175 -0
- package/dist/esm/Reconciliation.d.ts.map +1 -0
- package/dist/esm/Reconciliation.js +175 -0
- package/dist/esm/Reconciliation.js.map +1 -0
- package/dist/esm/ReplayOnly.d.ts +91 -0
- package/dist/esm/ReplayOnly.d.ts.map +1 -0
- package/dist/esm/ReplayOnly.js +59 -0
- package/dist/esm/ReplayOnly.js.map +1 -0
- package/dist/esm/Retention.d.ts +113 -0
- package/dist/esm/Retention.d.ts.map +1 -0
- package/dist/esm/Retention.js +139 -0
- package/dist/esm/Retention.js.map +1 -0
- package/dist/esm/RunCatalogRead.d.ts +17 -0
- package/dist/esm/RunCatalogRead.d.ts.map +1 -0
- package/dist/esm/RunCatalogRead.js +17 -0
- package/dist/esm/RunCatalogRead.js.map +1 -0
- package/dist/esm/RunChangeFeed.d.ts +75 -0
- package/dist/esm/RunChangeFeed.d.ts.map +1 -0
- package/dist/esm/RunChangeFeed.js +81 -0
- package/dist/esm/RunChangeFeed.js.map +1 -0
- package/dist/esm/RunState.d.ts +116 -0
- package/dist/esm/RunState.d.ts.map +1 -0
- package/dist/esm/RunState.js +109 -0
- package/dist/esm/RunState.js.map +1 -0
- package/dist/esm/Selection.d.ts +495 -0
- package/dist/esm/Selection.d.ts.map +1 -0
- package/dist/esm/Selection.js +482 -0
- package/dist/esm/Selection.js.map +1 -0
- package/dist/esm/SelectionStore.d.ts +141 -0
- package/dist/esm/SelectionStore.d.ts.map +1 -0
- package/dist/esm/SelectionStore.js +215 -0
- package/dist/esm/SelectionStore.js.map +1 -0
- package/dist/esm/StepBoundary.d.ts +501 -0
- package/dist/esm/StepBoundary.d.ts.map +1 -0
- package/dist/esm/StepBoundary.js +919 -0
- package/dist/esm/StepBoundary.js.map +1 -0
- package/dist/esm/StepCacheFold.d.ts +148 -0
- package/dist/esm/StepCacheFold.d.ts.map +1 -0
- package/dist/esm/StepCacheFold.js +201 -0
- package/dist/esm/StepCacheFold.js.map +1 -0
- package/dist/esm/StepSandbox.d.ts +78 -0
- package/dist/esm/StepSandbox.d.ts.map +1 -0
- package/dist/esm/StepSandbox.js +70 -0
- package/dist/esm/StepSandbox.js.map +1 -0
- package/dist/esm/WakeBus.d.ts +116 -0
- package/dist/esm/WakeBus.d.ts.map +1 -0
- package/dist/esm/WakeBus.js +121 -0
- package/dist/esm/WakeBus.js.map +1 -0
- package/dist/esm/WorkspaceSandbox.d.ts +619 -0
- package/dist/esm/WorkspaceSandbox.d.ts.map +1 -0
- package/dist/esm/WorkspaceSandbox.js +985 -0
- package/dist/esm/WorkspaceSandbox.js.map +1 -0
- package/dist/esm/index.d.ts +157 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +157 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/ActionPersistence.d.ts +276 -0
- package/dist/esm/internal/ActionPersistence.d.ts.map +1 -0
- package/dist/esm/internal/ActionPersistence.js +2306 -0
- package/dist/esm/internal/ActionPersistence.js.map +1 -0
- package/dist/esm/internal/ArtifactRoots.d.ts +38 -0
- package/dist/esm/internal/ArtifactRoots.d.ts.map +1 -0
- package/dist/esm/internal/ArtifactRoots.js +76 -0
- package/dist/esm/internal/ArtifactRoots.js.map +1 -0
- package/dist/esm/internal/AttemptAdmission.d.ts +53 -0
- package/dist/esm/internal/AttemptAdmission.d.ts.map +1 -0
- package/dist/esm/internal/AttemptAdmission.js +52 -0
- package/dist/esm/internal/AttemptAdmission.js.map +1 -0
- package/dist/esm/internal/AttemptLifecycle.d.ts +245 -0
- package/dist/esm/internal/AttemptLifecycle.d.ts.map +1 -0
- package/dist/esm/internal/AttemptLifecycle.js +104 -0
- package/dist/esm/internal/AttemptLifecycle.js.map +1 -0
- package/dist/esm/internal/AttemptProbe.d.ts +53 -0
- package/dist/esm/internal/AttemptProbe.d.ts.map +1 -0
- package/dist/esm/internal/AttemptProbe.js +83 -0
- package/dist/esm/internal/AttemptProbe.js.map +1 -0
- package/dist/esm/internal/CacheAdmission.d.ts +79 -0
- package/dist/esm/internal/CacheAdmission.d.ts.map +1 -0
- package/dist/esm/internal/CacheAdmission.js +72 -0
- package/dist/esm/internal/CacheAdmission.js.map +1 -0
- package/dist/esm/internal/CacheAgeHistory.d.ts +27 -0
- package/dist/esm/internal/CacheAgeHistory.d.ts.map +1 -0
- package/dist/esm/internal/CacheAgeHistory.js +49 -0
- package/dist/esm/internal/CacheAgeHistory.js.map +1 -0
- package/dist/esm/internal/CacheAgeVerdicts.d.ts +15 -0
- package/dist/esm/internal/CacheAgeVerdicts.d.ts.map +1 -0
- package/dist/esm/internal/CacheAgeVerdicts.js +54 -0
- package/dist/esm/internal/CacheAgeVerdicts.js.map +1 -0
- package/dist/esm/internal/CacheOutputPolicy.d.ts +24 -0
- package/dist/esm/internal/CacheOutputPolicy.d.ts.map +1 -0
- package/dist/esm/internal/CacheOutputPolicy.js +73 -0
- package/dist/esm/internal/CacheOutputPolicy.js.map +1 -0
- package/dist/esm/internal/CachePublication.d.ts +97 -0
- package/dist/esm/internal/CachePublication.d.ts.map +1 -0
- package/dist/esm/internal/CachePublication.js +116 -0
- package/dist/esm/internal/CachePublication.js.map +1 -0
- package/dist/esm/internal/CallFacts.d.ts +15 -0
- package/dist/esm/internal/CallFacts.d.ts.map +1 -0
- package/dist/esm/internal/CallFacts.js +83 -0
- package/dist/esm/internal/CallFacts.js.map +1 -0
- package/dist/esm/internal/CopiedRecord.d.ts +61 -0
- package/dist/esm/internal/CopiedRecord.d.ts.map +1 -0
- package/dist/esm/internal/CopiedRecord.js +165 -0
- package/dist/esm/internal/CopiedRecord.js.map +1 -0
- package/dist/esm/internal/DeferredPersistence.d.ts +108 -0
- package/dist/esm/internal/DeferredPersistence.d.ts.map +1 -0
- package/dist/esm/internal/DeferredPersistence.js +240 -0
- package/dist/esm/internal/DeferredPersistence.js.map +1 -0
- package/dist/esm/internal/EffectRecords.d.ts +92 -0
- package/dist/esm/internal/EffectRecords.d.ts.map +1 -0
- package/dist/esm/internal/EffectRecords.js +94 -0
- package/dist/esm/internal/EffectRecords.js.map +1 -0
- package/dist/esm/internal/EngineJj.d.ts +30 -0
- package/dist/esm/internal/EngineJj.d.ts.map +1 -0
- package/dist/esm/internal/EngineJj.js +29 -0
- package/dist/esm/internal/EngineJj.js.map +1 -0
- package/dist/esm/internal/EngineStateSchema.d.ts +68 -0
- package/dist/esm/internal/EngineStateSchema.d.ts.map +1 -0
- package/dist/esm/internal/EngineStateSchema.js +53 -0
- package/dist/esm/internal/EngineStateSchema.js.map +1 -0
- package/dist/esm/internal/ExecutionSnapshotRead.d.ts +162 -0
- package/dist/esm/internal/ExecutionSnapshotRead.d.ts.map +1 -0
- package/dist/esm/internal/ExecutionSnapshotRead.js +218 -0
- package/dist/esm/internal/ExecutionSnapshotRead.js.map +1 -0
- package/dist/esm/internal/ExecutionSnapshotRelations.d.ts +39 -0
- package/dist/esm/internal/ExecutionSnapshotRelations.d.ts.map +1 -0
- package/dist/esm/internal/ExecutionSnapshotRelations.js +81 -0
- package/dist/esm/internal/ExecutionSnapshotRelations.js.map +1 -0
- package/dist/esm/internal/ExitEncoding.d.ts +180 -0
- package/dist/esm/internal/ExitEncoding.d.ts.map +1 -0
- package/dist/esm/internal/ExitEncoding.js +361 -0
- package/dist/esm/internal/ExitEncoding.js.map +1 -0
- package/dist/esm/internal/FileBoundarySnapshot.d.ts +14 -0
- package/dist/esm/internal/FileBoundarySnapshot.d.ts.map +1 -0
- package/dist/esm/internal/FileBoundarySnapshot.js +29 -0
- package/dist/esm/internal/FileBoundarySnapshot.js.map +1 -0
- package/dist/esm/internal/FileEnumeration.d.ts +127 -0
- package/dist/esm/internal/FileEnumeration.d.ts.map +1 -0
- package/dist/esm/internal/FileEnumeration.js +236 -0
- package/dist/esm/internal/FileEnumeration.js.map +1 -0
- package/dist/esm/internal/HostReflection.d.ts +80 -0
- package/dist/esm/internal/HostReflection.d.ts.map +1 -0
- package/dist/esm/internal/HostReflection.js +98 -0
- package/dist/esm/internal/HostReflection.js.map +1 -0
- package/dist/esm/internal/JournalRecords.d.ts +325 -0
- package/dist/esm/internal/JournalRecords.d.ts.map +1 -0
- package/dist/esm/internal/JournalRecords.js +306 -0
- package/dist/esm/internal/JournalRecords.js.map +1 -0
- package/dist/esm/internal/NodeJournal.d.ts +157 -0
- package/dist/esm/internal/NodeJournal.d.ts.map +1 -0
- package/dist/esm/internal/NodeJournal.js +298 -0
- package/dist/esm/internal/NodeJournal.js.map +1 -0
- package/dist/esm/internal/Ordering.d.ts +14 -0
- package/dist/esm/internal/Ordering.d.ts.map +1 -0
- package/dist/esm/internal/Ordering.js +14 -0
- package/dist/esm/internal/Ordering.js.map +1 -0
- package/dist/esm/internal/PlanInputs.d.ts +14 -0
- package/dist/esm/internal/PlanInputs.d.ts.map +1 -0
- package/dist/esm/internal/PlanInputs.js +57 -0
- package/dist/esm/internal/PlanInputs.js.map +1 -0
- package/dist/esm/internal/PlanMerges.d.ts +178 -0
- package/dist/esm/internal/PlanMerges.d.ts.map +1 -0
- package/dist/esm/internal/PlanMerges.js +113 -0
- package/dist/esm/internal/PlanMerges.js.map +1 -0
- package/dist/esm/internal/ProvenanceSlot.d.ts +30 -0
- package/dist/esm/internal/ProvenanceSlot.d.ts.map +1 -0
- package/dist/esm/internal/ProvenanceSlot.js +39 -0
- package/dist/esm/internal/ProvenanceSlot.js.map +1 -0
- package/dist/esm/internal/ResultEnvelope.d.ts +88 -0
- package/dist/esm/internal/ResultEnvelope.d.ts.map +1 -0
- package/dist/esm/internal/ResultEnvelope.js +83 -0
- package/dist/esm/internal/ResultEnvelope.js.map +1 -0
- package/dist/esm/internal/RetentionOps.d.ts +414 -0
- package/dist/esm/internal/RetentionOps.d.ts.map +1 -0
- package/dist/esm/internal/RetentionOps.js +576 -0
- package/dist/esm/internal/RetentionOps.js.map +1 -0
- package/dist/esm/internal/RunCatalogOps.d.ts +118 -0
- package/dist/esm/internal/RunCatalogOps.d.ts.map +1 -0
- package/dist/esm/internal/RunCatalogOps.js +120 -0
- package/dist/esm/internal/RunCatalogOps.js.map +1 -0
- package/dist/esm/internal/RunCoordinator.d.ts +78 -0
- package/dist/esm/internal/RunCoordinator.d.ts.map +1 -0
- package/dist/esm/internal/RunCoordinator.js +115 -0
- package/dist/esm/internal/RunCoordinator.js.map +1 -0
- package/dist/esm/internal/RunDriver.d.ts +192 -0
- package/dist/esm/internal/RunDriver.d.ts.map +1 -0
- package/dist/esm/internal/RunDriver.js +2334 -0
- package/dist/esm/internal/RunDriver.js.map +1 -0
- package/dist/esm/internal/RunLifecycle.d.ts +22 -0
- package/dist/esm/internal/RunLifecycle.d.ts.map +1 -0
- package/dist/esm/internal/RunLifecycle.js +49 -0
- package/dist/esm/internal/RunLifecycle.js.map +1 -0
- package/dist/esm/internal/RunListing.d.ts +78 -0
- package/dist/esm/internal/RunListing.d.ts.map +1 -0
- package/dist/esm/internal/RunListing.js +146 -0
- package/dist/esm/internal/RunListing.js.map +1 -0
- package/dist/esm/internal/RunListingError.d.ts +35 -0
- package/dist/esm/internal/RunListingError.d.ts.map +1 -0
- package/dist/esm/internal/RunListingError.js +27 -0
- package/dist/esm/internal/RunListingError.js.map +1 -0
- package/dist/esm/internal/RuntimeGraph.d.ts +73 -0
- package/dist/esm/internal/RuntimeGraph.d.ts.map +1 -0
- package/dist/esm/internal/RuntimeGraph.js +182 -0
- package/dist/esm/internal/RuntimeGraph.js.map +1 -0
- package/dist/esm/internal/SandboxedExecution.d.ts +80 -0
- package/dist/esm/internal/SandboxedExecution.d.ts.map +1 -0
- package/dist/esm/internal/SandboxedExecution.js +107 -0
- package/dist/esm/internal/SandboxedExecution.js.map +1 -0
- package/dist/esm/internal/StateTransaction.d.ts +44 -0
- package/dist/esm/internal/StateTransaction.d.ts.map +1 -0
- package/dist/esm/internal/StateTransaction.js +54 -0
- package/dist/esm/internal/StateTransaction.js.map +1 -0
- package/dist/esm/internal/StepFacts.d.ts +14 -0
- package/dist/esm/internal/StepFacts.d.ts.map +1 -0
- package/dist/esm/internal/StepFacts.js +35 -0
- package/dist/esm/internal/StepFacts.js.map +1 -0
- package/dist/esm/internal/TypedEvents.d.ts +14 -0
- package/dist/esm/internal/TypedEvents.d.ts.map +1 -0
- package/dist/esm/internal/TypedEvents.js +14 -0
- package/dist/esm/internal/TypedEvents.js.map +1 -0
- package/dist/esm/migrations/0001_initial.d.ts +17 -0
- package/dist/esm/migrations/0001_initial.d.ts.map +1 -0
- package/dist/esm/migrations/0001_initial.js +41 -0
- package/dist/esm/migrations/0001_initial.js.map +1 -0
- package/dist/esm/migrations/0002_selection_store.d.ts +15 -0
- package/dist/esm/migrations/0002_selection_store.d.ts.map +1 -0
- package/dist/esm/migrations/0002_selection_store.js +34 -0
- package/dist/esm/migrations/0002_selection_store.js.map +1 -0
- package/dist/esm/migrations/0003_plan_inputs.d.ts +13 -0
- package/dist/esm/migrations/0003_plan_inputs.d.ts.map +1 -0
- package/dist/esm/migrations/0003_plan_inputs.js +70 -0
- package/dist/esm/migrations/0003_plan_inputs.js.map +1 -0
- package/dist/esm/migrations/0004_plan_environment.d.ts +14 -0
- package/dist/esm/migrations/0004_plan_environment.d.ts.map +1 -0
- package/dist/esm/migrations/0004_plan_environment.js +33 -0
- package/dist/esm/migrations/0004_plan_environment.js.map +1 -0
- package/dist/esm/migrations/0005_plan_merges.d.ts +14 -0
- package/dist/esm/migrations/0005_plan_merges.d.ts.map +1 -0
- package/dist/esm/migrations/0005_plan_merges.js +59 -0
- package/dist/esm/migrations/0005_plan_merges.js.map +1 -0
- package/dist/esm/migrations/0006_execution_listing.d.ts +15 -0
- package/dist/esm/migrations/0006_execution_listing.d.ts.map +1 -0
- package/dist/esm/migrations/0006_execution_listing.js +81 -0
- package/dist/esm/migrations/0006_execution_listing.js.map +1 -0
- package/dist/esm/migrations/0007_run_parent_sequence.d.ts +15 -0
- package/dist/esm/migrations/0007_run_parent_sequence.d.ts.map +1 -0
- package/dist/esm/migrations/0007_run_parent_sequence.js +18 -0
- package/dist/esm/migrations/0007_run_parent_sequence.js.map +1 -0
- package/dist/esm/migrations/0008_deferred_consumption.d.ts +16 -0
- package/dist/esm/migrations/0008_deferred_consumption.d.ts.map +1 -0
- package/dist/esm/migrations/0008_deferred_consumption.js +24 -0
- package/dist/esm/migrations/0008_deferred_consumption.js.map +1 -0
- package/dist/esm/migrations/0009_deferred_clock_facts.d.ts +24 -0
- package/dist/esm/migrations/0009_deferred_clock_facts.d.ts.map +1 -0
- package/dist/esm/migrations/0009_deferred_clock_facts.js +127 -0
- package/dist/esm/migrations/0009_deferred_clock_facts.js.map +1 -0
- package/dist/esm/migrations/0010_pending_cancellation.d.ts +15 -0
- package/dist/esm/migrations/0010_pending_cancellation.d.ts.map +1 -0
- package/dist/esm/migrations/0010_pending_cancellation.js +19 -0
- package/dist/esm/migrations/0010_pending_cancellation.js.map +1 -0
- package/dist/esm/test/TestStores.d.ts +89 -0
- package/dist/esm/test/TestStores.d.ts.map +1 -0
- package/dist/esm/test/TestStores.js +103 -0
- package/dist/esm/test/TestStores.js.map +1 -0
- package/docs/README.md +113 -0
- package/docs/api.md +1494 -0
- package/docs/concepts/attempts-and-replay.md +149 -0
- package/docs/concepts/cache-admission.md +265 -0
- package/docs/concepts/call-facts.md +86 -0
- package/docs/concepts/durable-waits.md +175 -0
- package/docs/concepts/execution-facts.md +90 -0
- package/docs/concepts/ownership-and-fencing.md +128 -0
- package/docs/concepts/step-boundaries.md +148 -0
- package/docs/concepts/workspace-transactions.md +199 -0
- package/docs/event-types.md +14 -0
- package/docs/guides/back-up-and-restore.md +164 -0
- package/docs/guides/collect-unreferenced-artifacts.md +128 -0
- package/docs/guides/compose-a-durable-engine.md +146 -0
- package/docs/guides/coordinate-two-processes.md +120 -0
- package/docs/guides/defer-work-with-selection.md +171 -0
- package/docs/guides/delete-old-run-history.md +154 -0
- package/docs/guides/drive-a-plan.md +314 -0
- package/docs/guides/observe-engine-metrics.md +98 -0
- package/docs/guides/observe-executions.md +187 -0
- package/docs/guides/reclaim-runs-from-a-dead-host.md +133 -0
- package/docs/guides/share-a-cache-across-machines.md +134 -0
- package/docs/guides/testing.md +123 -0
- package/docs/installation.md +102 -0
- package/docs/quickstart.md +215 -0
- package/docs/troubleshooting.md +347 -0
- package/package.json +438 -3
- package/src/ArtifactGc.ts +408 -0
- package/src/ArtifactSync.ts +278 -0
- package/src/CacheSync.ts +131 -0
- package/src/DeferredClockFold.ts +586 -0
- package/src/DisasterRecovery.ts +888 -0
- package/src/DurableEngineState.ts +2656 -0
- package/src/EngineStore.ts +656 -0
- package/src/EngineStoreMetrics.ts +331 -0
- package/src/Errors.ts +28 -0
- package/src/EventTypes.ts +27 -0
- package/src/ExecutionFacts.ts +125 -0
- package/src/ExecutionSnapshot.ts +186 -0
- package/src/Inconsistency.ts +253 -0
- package/src/Migrations.ts +95 -0
- package/src/OwnerIdentity.ts +125 -0
- package/src/PlanInputStore.ts +292 -0
- package/src/PlanMergeStore.ts +330 -0
- package/src/PlanScheduler.ts +1806 -0
- package/src/Reconciliation.ts +224 -0
- package/src/ReplayOnly.ts +95 -0
- package/src/Retention.ts +214 -0
- package/src/RunCatalogRead.ts +27 -0
- package/src/RunChangeFeed.ts +125 -0
- package/src/RunState.ts +137 -0
- package/src/Selection.ts +683 -0
- package/src/SelectionStore.ts +353 -0
- package/src/StepBoundary.ts +1165 -0
- package/src/StepCacheFold.ts +244 -0
- package/src/StepSandbox.ts +110 -0
- package/src/WakeBus.ts +167 -0
- package/src/WorkspaceSandbox.ts +1604 -0
- package/src/index.ts +185 -0
- package/src/internal/ActionPersistence.ts +2687 -0
- package/src/internal/ArtifactRoots.ts +92 -0
- package/src/internal/AttemptAdmission.ts +76 -0
- package/src/internal/AttemptLifecycle.ts +163 -0
- package/src/internal/AttemptProbe.ts +90 -0
- package/src/internal/CacheAdmission.ts +133 -0
- package/src/internal/CacheAgeHistory.ts +58 -0
- package/src/internal/CacheAgeVerdicts.ts +61 -0
- package/src/internal/CacheOutputPolicy.ts +82 -0
- package/src/internal/CachePublication.ts +153 -0
- package/src/internal/CallFacts.ts +87 -0
- package/src/internal/CopiedRecord.ts +201 -0
- package/src/internal/DeferredPersistence.ts +459 -0
- package/src/internal/EffectRecords.ts +136 -0
- package/src/internal/EngineJj.ts +30 -0
- package/src/internal/EngineStateSchema.ts +92 -0
- package/src/internal/ExecutionSnapshotRead.ts +300 -0
- package/src/internal/ExecutionSnapshotRelations.ts +121 -0
- package/src/internal/ExitEncoding.ts +453 -0
- package/src/internal/FileBoundarySnapshot.ts +39 -0
- package/src/internal/FileEnumeration.ts +334 -0
- package/src/internal/HostReflection.ts +128 -0
- package/src/internal/JournalRecords.ts +396 -0
- package/src/internal/NodeJournal.ts +340 -0
- package/src/internal/Ordering.ts +14 -0
- package/src/internal/PlanInputs.ts +62 -0
- package/src/internal/PlanMerges.ts +123 -0
- package/src/internal/ProvenanceSlot.ts +52 -0
- package/src/internal/ResultEnvelope.ts +118 -0
- package/src/internal/RetentionOps.ts +865 -0
- package/src/internal/RunCatalogOps.ts +174 -0
- package/src/internal/RunCoordinator.ts +215 -0
- package/src/internal/RunDriver.ts +3154 -0
- package/src/internal/RunLifecycle.ts +53 -0
- package/src/internal/RunListing.ts +210 -0
- package/src/internal/RunListingError.ts +37 -0
- package/src/internal/RuntimeGraph.ts +253 -0
- package/src/internal/SandboxedExecution.ts +165 -0
- package/src/internal/StateTransaction.ts +71 -0
- package/src/internal/StepFacts.ts +36 -0
- package/src/internal/TypedEvents.ts +29 -0
- package/src/migrations/0001_initial.ts +51 -0
- package/src/migrations/0002_selection_store.ts +38 -0
- package/src/migrations/0003_plan_inputs.ts +75 -0
- package/src/migrations/0004_plan_environment.ts +34 -0
- package/src/migrations/0005_plan_merges.ts +60 -0
- package/src/migrations/0006_execution_listing.ts +86 -0
- package/src/migrations/0007_run_parent_sequence.ts +19 -0
- package/src/migrations/0008_deferred_consumption.ts +27 -0
- package/src/migrations/0009_deferred_clock_facts.ts +163 -0
- package/src/migrations/0010_pending_cancellation.ts +20 -0
- package/src/test/TestStores.ts +145 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard metric definitions for the engine-store hot paths.
|
|
3
|
+
*
|
|
4
|
+
* This module only defines the metric handles, following the shape of
|
|
5
|
+
* `RunStoreMetrics` and Effect's `ClusterMetrics`. The dispatch seam
|
|
6
|
+
* (`internal/ActionPersistence`), the plan scheduler, the workspace sandbox,
|
|
7
|
+
* and the run driver update them as outcomes are decided. No exporter ships in
|
|
8
|
+
* this package; provide one — for example `@smthrs/observability` — and
|
|
9
|
+
* these series appear in it.
|
|
10
|
+
*
|
|
11
|
+
* Counters over an effect's exit are keyed by {@link ExitTag} records, so an
|
|
12
|
+
* update is a lookup rather than a branch, and durations land in
|
|
13
|
+
* `Metric.timer` histograms through Effect's own `Effect.trackDuration`. The
|
|
14
|
+
* same exit observation annotates the operation span with its outcome; none of
|
|
15
|
+
* the instrumentation combinators alters the instrumented effect's result or
|
|
16
|
+
* cause.
|
|
17
|
+
*
|
|
18
|
+
* @since 0.1.0
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import * as Cause from "effect/Cause"
|
|
22
|
+
import type * as Duration from "effect/Duration"
|
|
23
|
+
import * as Effect from "effect/Effect"
|
|
24
|
+
import type * as Exit from "effect/Exit"
|
|
25
|
+
import * as Metric from "effect/Metric"
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* How an instrumented effect exited: `Success`, `Failure` (any non-interrupt
|
|
29
|
+
* cause), or `Interrupt` (an interrupt-only cause — in this store that is the
|
|
30
|
+
* fencing self-interruption as well as caller cancellation).
|
|
31
|
+
*
|
|
32
|
+
* @category models
|
|
33
|
+
* @since 0.1.0
|
|
34
|
+
*/
|
|
35
|
+
export type ExitTag = "Success" | "Failure" | "Interrupt"
|
|
36
|
+
|
|
37
|
+
/** Rewrites an outcome tag (`HeartbeatFresh`) as an attribute value (`heartbeat_fresh`). */
|
|
38
|
+
const attributeValue = (tag: string): string => tag.replace(/(?<=[a-z0-9])(?=[A-Z])/g, "_").toLowerCase()
|
|
39
|
+
|
|
40
|
+
/** Builds the tag-keyed record of attributed counter views for one operation. */
|
|
41
|
+
const byOutcome = <const Tags extends ReadonlyArray<string>>(
|
|
42
|
+
metric: Metric.Metric<number, Metric.CounterState<number>>,
|
|
43
|
+
attributes: Readonly<Record<string, string>>,
|
|
44
|
+
tags: Tags
|
|
45
|
+
): { readonly [Tag in Tags[number]]: Metric.Metric<number, Metric.CounterState<number>> } =>
|
|
46
|
+
Object.fromEntries(
|
|
47
|
+
tags.map((tag) => [tag, Metric.withAttributes(metric, { ...attributes, outcome: attributeValue(tag) })])
|
|
48
|
+
) as { [Tag in Tags[number]]: Metric.Metric<number, Metric.CounterState<number>> }
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Classifies an exit for an {@link ExitTag}-keyed counter record.
|
|
52
|
+
*
|
|
53
|
+
* @category accessors
|
|
54
|
+
* @since 0.1.0
|
|
55
|
+
*/
|
|
56
|
+
export const exitTag = <A, E>(exit: Exit.Exit<A, E>): ExitTag =>
|
|
57
|
+
exit._tag === "Success" ? "Success" : Cause.hasInterruptsOnly(exit.cause) ? "Interrupt" : "Failure"
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Observes an effect with a duration timer and an exit-outcome counter.
|
|
61
|
+
*
|
|
62
|
+
* Composes Effect's own `Effect.trackDuration` (monotonic clock, records on
|
|
63
|
+
* success, failure, and interruption alike) with an `Effect.onExit` counter
|
|
64
|
+
* update and current-span annotation, so the instrumented effect's exit —
|
|
65
|
+
* value, cause, and interruption — propagates byte-identically. This is the
|
|
66
|
+
* dual-instrument shape production Effect services use for hot-path
|
|
67
|
+
* operations.
|
|
68
|
+
*
|
|
69
|
+
* @category combinators
|
|
70
|
+
* @since 0.1.0
|
|
71
|
+
*/
|
|
72
|
+
export const observe = (instruments: {
|
|
73
|
+
readonly timer: Metric.Histogram<Duration.Duration>
|
|
74
|
+
readonly counter: { readonly [Tag in ExitTag]: Metric.Metric<number, Metric.CounterState<number>> }
|
|
75
|
+
}) =>
|
|
76
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>
|
|
77
|
+
effect.pipe(
|
|
78
|
+
Effect.trackDuration(instruments.timer),
|
|
79
|
+
Effect.onExit((exit) => {
|
|
80
|
+
const tag = exitTag(exit)
|
|
81
|
+
return Effect.annotateCurrentSpan({ outcome: attributeValue(tag) }).pipe(
|
|
82
|
+
Effect.andThen(Metric.update(instruments.counter[tag], 1))
|
|
83
|
+
)
|
|
84
|
+
})
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
const exitTags = ["Success", "Failure", "Interrupt"] as const
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Counter over durable action dispatches through
|
|
91
|
+
* `internal/ActionPersistence`, dimensioned by exit `outcome` (`success`,
|
|
92
|
+
* `failure`, or `interrupt`). A cache-served replay and a fresh execution
|
|
93
|
+
* both count: the dispatch is the unit the engine retries and fences.
|
|
94
|
+
*
|
|
95
|
+
* @category metrics
|
|
96
|
+
* @since 0.1.0
|
|
97
|
+
*/
|
|
98
|
+
export const dispatches = Metric.counter("flows_engine_dispatches", {
|
|
99
|
+
description: "Durable action dispatches by exit outcome"
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Latency histogram over durable action dispatches, from admission through
|
|
104
|
+
* settlement (cache verification, execution, copy-back, and the terminal
|
|
105
|
+
* row included).
|
|
106
|
+
*
|
|
107
|
+
* @category metrics
|
|
108
|
+
* @since 0.1.0
|
|
109
|
+
*/
|
|
110
|
+
export const dispatchDuration = Metric.timer("flows_engine_dispatch_duration", {
|
|
111
|
+
description: "Durable action dispatch duration"
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* `dispatches` views keyed by {@link ExitTag}.
|
|
116
|
+
*
|
|
117
|
+
* @category metrics
|
|
118
|
+
* @since 0.1.0
|
|
119
|
+
*/
|
|
120
|
+
export const dispatch = byOutcome(dispatches, {}, exitTags)
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Counter over scheduler admission passes that launched work. The
|
|
124
|
+
* completion-driven scheduler re-computes the ready set after every terminal
|
|
125
|
+
* event; only a pass that admits at least one node counts, so the series
|
|
126
|
+
* reads as "how many times the scheduler opened dispatch permits", not as
|
|
127
|
+
* event-loop noise.
|
|
128
|
+
*
|
|
129
|
+
* @category metrics
|
|
130
|
+
* @since 0.1.0
|
|
131
|
+
*/
|
|
132
|
+
export const schedulerAdmissions = Metric.counter("flows_engine_scheduler_admissions", {
|
|
133
|
+
description: "Plan scheduler admission passes that launched at least one dispatch"
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Latency histogram over one scheduler dispatch, admission through terminal
|
|
138
|
+
* event: measurement, keying, the durable-action seam, and every rebase turn
|
|
139
|
+
* of the same node's loop land in a single observation.
|
|
140
|
+
*
|
|
141
|
+
* @category metrics
|
|
142
|
+
* @since 0.1.0
|
|
143
|
+
*/
|
|
144
|
+
export const schedulerDispatchDuration = Metric.timer("flows_engine_scheduler_dispatch_duration", {
|
|
145
|
+
description: "Duration of one scheduler dispatch, admission through terminal event"
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Counter over plan node settlements, dimensioned by the scheduler `outcome`
|
|
150
|
+
* (`built`, `clean`, `failed`, `skipped`, or `deferred`) — the per-node
|
|
151
|
+
* evaluation vocabulary `PlanScheduler` journals.
|
|
152
|
+
*
|
|
153
|
+
* @category metrics
|
|
154
|
+
* @since 0.1.0
|
|
155
|
+
*/
|
|
156
|
+
export const schedulerNodes = Metric.counter("flows_engine_scheduler_nodes", {
|
|
157
|
+
description: "Plan node settlements by evaluation outcome"
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* `schedulerNodes` views keyed by `PlanScheduler.Outcome`.
|
|
162
|
+
*
|
|
163
|
+
* @category metrics
|
|
164
|
+
* @since 0.1.0
|
|
165
|
+
*/
|
|
166
|
+
export const node = byOutcome(
|
|
167
|
+
schedulerNodes,
|
|
168
|
+
{},
|
|
169
|
+
["built", "clean", "failed", "skipped", "deferred"] as const
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Counter over isolated workspace executions (`WorkspaceSandbox.execute`),
|
|
174
|
+
* dimensioned by exit `outcome`. An `Invalidated` verdict is a `success`
|
|
175
|
+
* exit — the transaction ran and answered; the verdict itself is journaled.
|
|
176
|
+
*
|
|
177
|
+
* @category metrics
|
|
178
|
+
* @since 0.1.0
|
|
179
|
+
*/
|
|
180
|
+
export const sandboxExecutions = Metric.counter("flows_engine_sandbox_executions", {
|
|
181
|
+
description: "Isolated workspace executions by exit outcome"
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* `sandboxExecutions` views keyed by {@link ExitTag}.
|
|
186
|
+
*
|
|
187
|
+
* @category metrics
|
|
188
|
+
* @since 0.1.0
|
|
189
|
+
*/
|
|
190
|
+
export const sandboxExecution = byOutcome(sandboxExecutions, {}, exitTags)
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Latency histogram over isolated workspace executions.
|
|
194
|
+
*
|
|
195
|
+
* @category metrics
|
|
196
|
+
* @since 0.1.0
|
|
197
|
+
*/
|
|
198
|
+
export const sandboxExecutionDuration = Metric.timer("flows_engine_sandbox_execution_duration", {
|
|
199
|
+
description: "Isolated workspace execution duration"
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Counter over sandbox materializations (`WorkspaceSandbox.materialize` —
|
|
204
|
+
* the one host write), dimensioned by exit `outcome`.
|
|
205
|
+
*
|
|
206
|
+
* @category metrics
|
|
207
|
+
* @since 0.1.0
|
|
208
|
+
*/
|
|
209
|
+
export const sandboxMaterializations = Metric.counter("flows_engine_sandbox_materializations", {
|
|
210
|
+
description: "Sandbox copy-back materializations by exit outcome"
|
|
211
|
+
})
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* `sandboxMaterializations` views keyed by {@link ExitTag}.
|
|
215
|
+
*
|
|
216
|
+
* @category metrics
|
|
217
|
+
* @since 0.1.0
|
|
218
|
+
*/
|
|
219
|
+
export const materialization = byOutcome(sandboxMaterializations, {}, exitTags)
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Latency histogram over sandbox materializations.
|
|
223
|
+
*
|
|
224
|
+
* @category metrics
|
|
225
|
+
* @since 0.1.0
|
|
226
|
+
*/
|
|
227
|
+
export const materializationDuration = Metric.timer("flows_engine_sandbox_materialization_duration", {
|
|
228
|
+
description: "Sandbox copy-back materialization duration"
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Counter over copy-back compare-and-set refusals: the preflight found host
|
|
233
|
+
* state that moved after the transaction's base snapshot. The engine answers
|
|
234
|
+
* one with a rebase or a conflict strategy, so the rate is contention
|
|
235
|
+
* evidence, not an error rate.
|
|
236
|
+
*
|
|
237
|
+
* @category metrics
|
|
238
|
+
* @since 0.1.0
|
|
239
|
+
*/
|
|
240
|
+
export const materializationConflicts = Metric.counter("flows_engine_sandbox_conflicts", {
|
|
241
|
+
description: "Sandbox copy-back compare-and-set refusals"
|
|
242
|
+
})
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Counter over step-boundary settlements at the dispatch seam, dimensioned by
|
|
246
|
+
* `outcome`: `clean` evidence, an `expected`-mode `deviation`, or a hard
|
|
247
|
+
* `violation` (undeclared write, missing declared output, surviving declared
|
|
248
|
+
* removal), with `refused` for a host that could not settle at all.
|
|
249
|
+
*
|
|
250
|
+
* @category metrics
|
|
251
|
+
* @since 0.1.0
|
|
252
|
+
*/
|
|
253
|
+
export const boundarySettlements = Metric.counter("flows_engine_boundary_settlements", {
|
|
254
|
+
description: "Step boundary settlements by outcome"
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* `boundarySettlements` views keyed by settlement classification.
|
|
259
|
+
*
|
|
260
|
+
* @category metrics
|
|
261
|
+
* @since 0.1.0
|
|
262
|
+
*/
|
|
263
|
+
export const boundarySettlement = byOutcome(
|
|
264
|
+
boundarySettlements,
|
|
265
|
+
{},
|
|
266
|
+
["Clean", "Deviation", "Violation", "Refused"] as const
|
|
267
|
+
)
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Counter over the EFFECTIVE step-boundary cache decisions at the dispatch
|
|
271
|
+
* seam, dimensioned by `outcome`. `flows_step_cache_lookups` counts raw row
|
|
272
|
+
* presence at `CacheStore.get`; this series records what the dispatch
|
|
273
|
+
* actually did with the row after read-set verification and output
|
|
274
|
+
* materialization — `verified_hit` served the cached result, and every other
|
|
275
|
+
* outcome fell through to a real execution (`miss` no row,
|
|
276
|
+
* `unverifiable_evidence` a row whose recorded evidence cannot justify reuse,
|
|
277
|
+
* `unmeasurable` a host that could not re-measure the read set,
|
|
278
|
+
* `stale_read_set` a measured mismatch, `replay_failed` verified evidence the
|
|
279
|
+
* host could not re-materialize). Each decision is counted where it takes
|
|
280
|
+
* effect: `verified_hit` as the cached result is returned, a fall-through
|
|
281
|
+
* outcome as the dispatch proceeds past its refusal handling — so a
|
|
282
|
+
* cache-consulting dispatch that fails or is fenced out mid-decision (a
|
|
283
|
+
* journal failure on the provenance emit, a strict corruption verdict)
|
|
284
|
+
* records no decision, and its exit lands in {@link dispatches}. At most one
|
|
285
|
+
* decision is counted per cache-consulting dispatch.
|
|
286
|
+
*
|
|
287
|
+
* @category metrics
|
|
288
|
+
* @since 0.1.0
|
|
289
|
+
*/
|
|
290
|
+
export const stepCacheDecisions = Metric.counter("flows_engine_step_cache_decisions", {
|
|
291
|
+
description: "Effective step-boundary cache decisions at the dispatch seam"
|
|
292
|
+
})
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* `stepCacheDecisions` views keyed by decision.
|
|
296
|
+
*
|
|
297
|
+
* @category metrics
|
|
298
|
+
* @since 0.1.0
|
|
299
|
+
*/
|
|
300
|
+
export const stepCacheDecision = byOutcome(
|
|
301
|
+
stepCacheDecisions,
|
|
302
|
+
{},
|
|
303
|
+
["VerifiedHit", "Miss", "UnverifiableEvidence", "Unmeasurable", "StaleReadSet", "ReplayFailed"] as const
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Counter over the run driver's claim-and-activate decisions, dimensioned by
|
|
308
|
+
* `outcome`. These are the engine-level decisions taken BEFORE or AFTER the
|
|
309
|
+
* store-level compare-and-swaps `RunStoreMetrics` counts: a `terminal` or
|
|
310
|
+
* `heartbeat_fresh` refusal never reaches the store, `steal_refused_owner_alive`
|
|
311
|
+
* is the liveness probe declining, and `claim_lost`/`activation_lost` are the
|
|
312
|
+
* driver observing a lost store CAS.
|
|
313
|
+
*
|
|
314
|
+
* @category metrics
|
|
315
|
+
* @since 0.1.0
|
|
316
|
+
*/
|
|
317
|
+
export const claims = Metric.counter("flows_engine_claims", {
|
|
318
|
+
description: "Run driver claim-and-activate decisions by outcome"
|
|
319
|
+
})
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* `claims` views keyed by driver decision.
|
|
323
|
+
*
|
|
324
|
+
* @category metrics
|
|
325
|
+
* @since 0.1.0
|
|
326
|
+
*/
|
|
327
|
+
export const claim = byOutcome(
|
|
328
|
+
claims,
|
|
329
|
+
{},
|
|
330
|
+
["Activated", "Terminal", "HeartbeatFresh", "StealRefusedOwnerAlive", "ClaimLost", "ActivationLost"] as const
|
|
331
|
+
)
|
package/src/Errors.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The public, stable error contract of `@smthrs/engine-store`.
|
|
3
|
+
*
|
|
4
|
+
* Every error here carries a `code` literal that is part of the public API:
|
|
5
|
+
* consumers may switch on `code` (or `_tag`) and the strings will not change
|
|
6
|
+
* without a major version. The classes themselves are declared next to the
|
|
7
|
+
* logic that raises them (`internal/ActionPersistence.ts`,
|
|
8
|
+
* `@smthrs/flow/Action`, and `@smthrs/flow/FlowRuntime`); this module is the
|
|
9
|
+
* barrel-exported surface so that `internal/` never has to be imported by
|
|
10
|
+
* consumers.
|
|
11
|
+
*
|
|
12
|
+
* Related documentation: `docs/troubleshooting.md` names every code and
|
|
13
|
+
* what to change; `docs/api.md` carries the schemas.
|
|
14
|
+
*
|
|
15
|
+
* @since 0.1.0
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export { IrreversibleRetryRequiresIdempotencyKey } from "@smthrs/flow/Action"
|
|
19
|
+
export { FlowCycleDetected } from "@smthrs/flow/FlowRuntime"
|
|
20
|
+
export {
|
|
21
|
+
AttemptAdmissionRejected,
|
|
22
|
+
AttemptEvidenceQuarantined,
|
|
23
|
+
AttemptSuspended,
|
|
24
|
+
CacheConflictDetected,
|
|
25
|
+
CacheCorruptionDetected
|
|
26
|
+
} from "./internal/ActionPersistence.ts"
|
|
27
|
+
export { RetentionError, RetentionErrorCode } from "./internal/RetentionOps.ts"
|
|
28
|
+
export { RunCatalogError, RunCatalogErrorCode } from "./internal/RunCatalogOps.ts"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable engine journal record names shared with replay consumers.
|
|
3
|
+
*
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Persisted event types and the child-spawn effect kind. Writers and readers
|
|
9
|
+
* share these identities; changing a value requires migrating stored history.
|
|
10
|
+
* `childSpawnKind` names the effect inside a boundary, not its event type.
|
|
11
|
+
*
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category constants
|
|
14
|
+
*/
|
|
15
|
+
export const EventTypes = {
|
|
16
|
+
runDecision: "flows.engine.run-decision",
|
|
17
|
+
attemptStarted: "flows.engine.attempt-started",
|
|
18
|
+
attemptFinished: "flows.engine.attempt-finished",
|
|
19
|
+
snapshotIdentified: "flows.engine.snapshot-identified",
|
|
20
|
+
planRecorded: "flows.engine.plan-recorded",
|
|
21
|
+
subgraphAppended: "flows.engine.subgraph-appended",
|
|
22
|
+
deferredCompleted: "flows.engine.deferred-completed",
|
|
23
|
+
deferredConsumed: "flows.engine.deferred-consumed",
|
|
24
|
+
clockScheduled: "flows.engine.clock-scheduled",
|
|
25
|
+
clockCompleted: "flows.engine.clock-completed",
|
|
26
|
+
childSpawnKind: "flows/engine-store/child-spawn"
|
|
27
|
+
} as const
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/** Native lifecycle facts captured using the owning store transaction.
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as Sha256 from "@smthrs/crypto/Sha256"
|
|
6
|
+
import { FlowEngine } from "@smthrs/engine"
|
|
7
|
+
import { DurableDeferred } from "@smthrs/flow"
|
|
8
|
+
import { ExecutionFact, type Journal, Redaction } from "@smthrs/journal"
|
|
9
|
+
import type { RunStore } from "@smthrs/run-store"
|
|
10
|
+
import { Effect, Option, Schema } from "effect"
|
|
11
|
+
import type * as DurableEngineState from "./DurableEngineState.ts"
|
|
12
|
+
import * as JournalRecords from "./internal/JournalRecords.ts"
|
|
13
|
+
import * as StateTransaction from "./internal/StateTransaction.ts"
|
|
14
|
+
|
|
15
|
+
/** Captured native services; never substitute an ambient control journal.
|
|
16
|
+
* @category models
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
*/
|
|
19
|
+
export interface Options {
|
|
20
|
+
readonly runs: RunStore.Service
|
|
21
|
+
readonly state: Pick<DurableEngineState.Service, "waiting" | "runParents" | "transaction">
|
|
22
|
+
readonly journal: Journal.Service
|
|
23
|
+
readonly sourceId: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Read the semantic subset shared with ExecutionSnapshot inside its caller's transaction.
|
|
27
|
+
* @category queries
|
|
28
|
+
* @since 1.0.0
|
|
29
|
+
*/
|
|
30
|
+
export const observe = (
|
|
31
|
+
row: RunStore.RunRow,
|
|
32
|
+
state: Pick<Options["state"], "waiting" | "runParents">
|
|
33
|
+
): Effect.Effect<ExecutionFact.Observation, Schema.SchemaError> =>
|
|
34
|
+
Effect.gen(function*() {
|
|
35
|
+
const waiting = yield* state.waiting(row.runId)
|
|
36
|
+
const parents = row.parentRunId === null ? yield* state.runParents(row.runId) : []
|
|
37
|
+
const firstParent = [...parents].sort((a, b) => a.seq - b.seq || a.parentId.localeCompare(b.parentId))[0]
|
|
38
|
+
const encoded = yield* Schema.decodeUnknownEffect(
|
|
39
|
+
Schema.fromJsonString(
|
|
40
|
+
Schema.Struct({
|
|
41
|
+
flowName: Schema.NonEmptyString,
|
|
42
|
+
onParentExit: Schema.optional(Schema.Literals(["cancel", "detach"]))
|
|
43
|
+
})
|
|
44
|
+
)
|
|
45
|
+
)(row.stateJson)
|
|
46
|
+
let point: string | null = null
|
|
47
|
+
if (Option.isSome(waiting) && waiting.value.token !== null) {
|
|
48
|
+
try {
|
|
49
|
+
const { deferredName } = DurableDeferred.TokenParsed.fromString(waiting.value.token)
|
|
50
|
+
if (deferredName.startsWith("WaitFor/")) {
|
|
51
|
+
point = deferredName.slice("WaitFor/".length)
|
|
52
|
+
}
|
|
53
|
+
} catch { /* An opaque plugin token remains an operational address only. */ }
|
|
54
|
+
}
|
|
55
|
+
return yield* Schema.decodeUnknownEffect(ExecutionFact.Observation)({
|
|
56
|
+
executionId: row.runId,
|
|
57
|
+
flowName: encoded.flowName,
|
|
58
|
+
status: row.status,
|
|
59
|
+
createdAtMs: row.createdAtMs,
|
|
60
|
+
startedAtMs: row.startedAtMs,
|
|
61
|
+
finishedAtMs: row.finishedAtMs,
|
|
62
|
+
parentRunId: row.parentRunId ?? firstParent?.parentId ?? null,
|
|
63
|
+
lineageId: row.lineageId ?? row.runId,
|
|
64
|
+
roundOrdinal: row.roundOrdinal ?? 0,
|
|
65
|
+
cancelRequestedAtMs: row.cancelRequestedAtMs,
|
|
66
|
+
treeVersion: 1,
|
|
67
|
+
parentPolicy: encoded.onParentExit ?? "cancel",
|
|
68
|
+
waiting: Option.isNone(waiting) ? null : {
|
|
69
|
+
reason: waiting.value.reason,
|
|
70
|
+
wakeAtMs: waiting.value.wakeAt,
|
|
71
|
+
tokenDigest: waiting.value.token === null ? null : Sha256.digestSync(waiting.value.token),
|
|
72
|
+
point,
|
|
73
|
+
request: waiting.value.request === undefined ? null : Redaction.redact(waiting.value.request)
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
/** Fact admission and cancellation intent share the same native writer transaction.
|
|
79
|
+
* @category constructors
|
|
80
|
+
* @since 1.0.0
|
|
81
|
+
*/
|
|
82
|
+
export const make = (options: Options) => {
|
|
83
|
+
const transactState = StateTransaction.make(options.state, options.journal)
|
|
84
|
+
const fact = (executionId: string, baseline: "created" | "legacy" = "legacy") =>
|
|
85
|
+
options.runs.get(executionId).pipe(
|
|
86
|
+
Effect.flatMap((row) => observe(row, options.state)),
|
|
87
|
+
Effect.map((observation) => ({ version: 1 as const, baseline, observation })),
|
|
88
|
+
// Invalid semantic metadata must not prevent the driver's existing
|
|
89
|
+
// corruption/invalid-round path from settling the run. Record a named
|
|
90
|
+
// coverage failure; never normalize a bad ordinal or invent ancestry.
|
|
91
|
+
Effect.catchTag("SchemaError", () =>
|
|
92
|
+
Effect.succeed({ version: 1 as const, unavailable: "invalid-observation" as const }))
|
|
93
|
+
)
|
|
94
|
+
const cancelled = (executionId: string) =>
|
|
95
|
+
Effect.gen(function*() {
|
|
96
|
+
const executionFact = yield* fact(executionId)
|
|
97
|
+
yield* options.journal.emitDurableUnfenced(JournalRecords.runDecision({
|
|
98
|
+
runId: executionId,
|
|
99
|
+
lineageId: FlowEngine.Lineage.root(executionId),
|
|
100
|
+
sourceId: options.sourceId
|
|
101
|
+
}, { decision: "cancel-requested", executionFact }))
|
|
102
|
+
})
|
|
103
|
+
const requestCancel = (executionId: string, at: number) =>
|
|
104
|
+
transactState(Effect.gen(function*() {
|
|
105
|
+
const outcome = yield* options.runs.requestCancel(executionId, at)
|
|
106
|
+
if (outcome._tag === "CancelRequested") yield* cancelled(executionId)
|
|
107
|
+
return outcome
|
|
108
|
+
}))
|
|
109
|
+
const requestCancelLineage = (executionId: string, at: number) =>
|
|
110
|
+
transactState(Effect.gen(function*() {
|
|
111
|
+
const before = yield* options.runs.lineage(executionId)
|
|
112
|
+
const outcome = yield* options.runs.requestCancelLineage(executionId, at)
|
|
113
|
+
if (outcome._tag === "CancelRequested") {
|
|
114
|
+
// The set update excludes terminal/already-requested rows. Record exactly
|
|
115
|
+
// the rows it changed, not a guessed terminal cancellation timestamp.
|
|
116
|
+
for (const row of before) {
|
|
117
|
+
if (row.cancelRequestedAtMs === null && !["completed", "failed", "cancelled"].includes(row.status)) {
|
|
118
|
+
yield* cancelled(row.runId)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return outcome
|
|
123
|
+
}))
|
|
124
|
+
return { fact, requestCancel, requestCancelLineage }
|
|
125
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Revisioned, round-scoped engine observations.
|
|
3
|
+
*
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as Dialect from "@smthrs/database/Dialect"
|
|
8
|
+
import type { RunStoreError } from "@smthrs/run-store/RunStore"
|
|
9
|
+
import { Context, Effect, Layer, Schema } from "effect"
|
|
10
|
+
import * as SqlClient from "effect/unstable/sql/SqlClient"
|
|
11
|
+
import * as Read from "./internal/ExecutionSnapshotRead.ts"
|
|
12
|
+
import * as Relations from "./internal/ExecutionSnapshotRelations.ts"
|
|
13
|
+
|
|
14
|
+
export type { RelatedOptions, RelatedPage } from "./internal/ExecutionSnapshotRelations.ts"
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Engine database identity and observed watermark.
|
|
18
|
+
*
|
|
19
|
+
* @category models
|
|
20
|
+
* @since 1.0.0
|
|
21
|
+
*/
|
|
22
|
+
export type Position = Read.Position
|
|
23
|
+
/**
|
|
24
|
+
* An authoritative execution row.
|
|
25
|
+
*
|
|
26
|
+
* @category models
|
|
27
|
+
* @since 1.0.0
|
|
28
|
+
*/
|
|
29
|
+
export type Observed = Read.Observed
|
|
30
|
+
/**
|
|
31
|
+
* A structured durable wait.
|
|
32
|
+
*
|
|
33
|
+
* @category models
|
|
34
|
+
* @since 1.0.0
|
|
35
|
+
*/
|
|
36
|
+
export type Waiting = Read.Waiting
|
|
37
|
+
/**
|
|
38
|
+
* Absence is explicit; deleted distinguishes retained deletion evidence.
|
|
39
|
+
*
|
|
40
|
+
* @category models
|
|
41
|
+
* @since 1.0.0
|
|
42
|
+
*/
|
|
43
|
+
export interface Missing extends Position {
|
|
44
|
+
readonly _tag: "Missing"
|
|
45
|
+
readonly runId: string
|
|
46
|
+
readonly deleted: boolean
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* One requested execution observation.
|
|
50
|
+
*
|
|
51
|
+
* @category models
|
|
52
|
+
* @since 1.0.0
|
|
53
|
+
*/
|
|
54
|
+
export type Snapshot = Observed | Missing
|
|
55
|
+
/**
|
|
56
|
+
* Coherent observations in request order, including duplicates.
|
|
57
|
+
*
|
|
58
|
+
* @category models
|
|
59
|
+
* @since 1.0.0
|
|
60
|
+
*/
|
|
61
|
+
export interface Batch extends Position {
|
|
62
|
+
readonly snapshots: ReadonlyArray<Snapshot>
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Maximum IDs admitted by one read.
|
|
66
|
+
*
|
|
67
|
+
* @category constants
|
|
68
|
+
* @since 1.0.0
|
|
69
|
+
*/
|
|
70
|
+
export const maximumBatchSize = 200
|
|
71
|
+
/**
|
|
72
|
+
* Reserves a deferred SQLite / repeatable-read PostgreSQL read transaction
|
|
73
|
+
* without the durable writer's admission lock. An existing transaction is
|
|
74
|
+
* reused with its caller-selected isolation.
|
|
75
|
+
* The supplied effect must contain observations only.
|
|
76
|
+
*
|
|
77
|
+
* @category constructors
|
|
78
|
+
* @since 1.0.0
|
|
79
|
+
*/
|
|
80
|
+
export const withReadTransaction = Read.transaction
|
|
81
|
+
/**
|
|
82
|
+
* Engine observation operations.
|
|
83
|
+
*
|
|
84
|
+
* @category models
|
|
85
|
+
* @since 1.0.0
|
|
86
|
+
*/
|
|
87
|
+
export interface Service {
|
|
88
|
+
readonly read: (runIds: ReadonlyArray<string>) => Effect.Effect<Batch, RunStoreError>
|
|
89
|
+
readonly related: (options: Relations.RelatedOptions) => Effect.Effect<Relations.RelatedPage, RunStoreError>
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Engine observation service.
|
|
93
|
+
*
|
|
94
|
+
* @category services
|
|
95
|
+
* @since 1.0.0
|
|
96
|
+
*/
|
|
97
|
+
export class ExecutionSnapshot extends Context.Service<ExecutionSnapshot, Service>()(
|
|
98
|
+
"@smthrs/engine-store/ExecutionSnapshot"
|
|
99
|
+
) {}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Guard for applying observations and tombstones to a source-bound projection.
|
|
103
|
+
* Source replacement requires an explicit rebuild, never a revision comparison.
|
|
104
|
+
* @category guards
|
|
105
|
+
* @since 1.0.0
|
|
106
|
+
*/
|
|
107
|
+
export const isNewer = (incoming: Position, current: Position): boolean =>
|
|
108
|
+
incoming.source === current.source && incoming.revision > current.revision
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Constructs the SQL read port; migrations must already be applied.
|
|
112
|
+
*
|
|
113
|
+
* @category constructors
|
|
114
|
+
* @since 1.0.0
|
|
115
|
+
*/
|
|
116
|
+
export const make = (): Effect.Effect<Service, never, SqlClient.SqlClient> =>
|
|
117
|
+
Effect.gen(function*() {
|
|
118
|
+
const sql = yield* SqlClient.SqlClient
|
|
119
|
+
const read: Service["read"] = (runIds) =>
|
|
120
|
+
Read.boundary(
|
|
121
|
+
"ExecutionSnapshot.read",
|
|
122
|
+
Effect.gen(function*() {
|
|
123
|
+
const ids = yield* Read.decode(
|
|
124
|
+
Schema.Array(Read.Identifier).check(Schema.isMaxLength(maximumBatchSize)),
|
|
125
|
+
runIds
|
|
126
|
+
)
|
|
127
|
+
const batch = yield* Read.transaction(
|
|
128
|
+
sql,
|
|
129
|
+
Effect.gen(function*() {
|
|
130
|
+
const at = yield* Read.position(sql)
|
|
131
|
+
if (ids.length === 0) return { ...at, snapshots: [] }
|
|
132
|
+
const rows = yield* Dialect.query(
|
|
133
|
+
sql,
|
|
134
|
+
`SELECT ${Read.selectColumns} FROM flows_runs r
|
|
135
|
+
LEFT JOIN flows_run_changes c ON c.run_id = r.run_id
|
|
136
|
+
WHERE r.run_id IN (${ids.map(() => "?").join(",")})`,
|
|
137
|
+
ids
|
|
138
|
+
)
|
|
139
|
+
const snapshots = new Map<string, Snapshot>()
|
|
140
|
+
for (const row of rows) {
|
|
141
|
+
const value = yield* Read.observed(row, at)
|
|
142
|
+
snapshots.set(value.runId, value)
|
|
143
|
+
}
|
|
144
|
+
const changes = yield* Dialect.query<{ run_id: string; revision: number; deleted: number }>(
|
|
145
|
+
sql,
|
|
146
|
+
`SELECT run_id, revision, deleted FROM flows_run_changes WHERE run_id IN (${
|
|
147
|
+
ids.map(() => "?").join(",")
|
|
148
|
+
})`,
|
|
149
|
+
ids
|
|
150
|
+
)
|
|
151
|
+
for (const change of changes) {
|
|
152
|
+
if (snapshots.has(change.run_id)) continue
|
|
153
|
+
const revision = yield* Read.decode(
|
|
154
|
+
Read.Natural.check(Schema.isGreaterThan(0), Schema.isLessThanOrEqualTo(at.revision)),
|
|
155
|
+
change.revision
|
|
156
|
+
)
|
|
157
|
+
yield* Read.decode(Schema.Literal(1), change.deleted)
|
|
158
|
+
snapshots.set(change.run_id, {
|
|
159
|
+
_tag: "Missing",
|
|
160
|
+
runId: change.run_id,
|
|
161
|
+
source: at.source,
|
|
162
|
+
revision,
|
|
163
|
+
deleted: true
|
|
164
|
+
})
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
...at,
|
|
168
|
+
snapshots: ids.map((runId): Snapshot =>
|
|
169
|
+
snapshots.get(runId) ?? { _tag: "Missing", runId, ...at, deleted: false }
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
})
|
|
173
|
+
)
|
|
174
|
+
return yield* Read.coherentBatch(ids, batch)
|
|
175
|
+
})
|
|
176
|
+
)
|
|
177
|
+
return { read, related: Relations.make(sql, read) }
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Provides the SQL observation port.
|
|
182
|
+
*
|
|
183
|
+
* @category layers
|
|
184
|
+
* @since 1.0.0
|
|
185
|
+
*/
|
|
186
|
+
export const layer: Layer.Layer<ExecutionSnapshot, never, SqlClient.SqlClient> = Layer.effect(ExecutionSnapshot)(make())
|