@smthrs/engine-store 0.0.0-stage → 1.0.0-rc.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 +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 +199 -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 +1584 -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 +298 -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 +3152 -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,175 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Durable waits"
|
|
3
|
+
description: "How a parked run survives a restart: durable deferreds and clocks, the waiting taxonomy, the sweeps that re-drive stranded runs, and the wake bus that makes the common case fast."
|
|
4
|
+
sidebar:
|
|
5
|
+
order: 5
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
A flow that waits is the hard case for durability. The process holding the
|
|
9
|
+
timer can die, the completion can arrive while nothing is listening, and the run
|
|
10
|
+
can be left parked with no one scheduled to wake it. `DurableEngineState` is the
|
|
11
|
+
state that makes waiting survive all three.
|
|
12
|
+
|
|
13
|
+
## Two durable primitives
|
|
14
|
+
|
|
15
|
+
A **deferred** is addressed by flow name, execution id, and deferred name. It is
|
|
16
|
+
completed once, first writer wins, and its `exit` is the value the resumed run
|
|
17
|
+
receives.
|
|
18
|
+
|
|
19
|
+
A **clock** is addressed the same way and carries an absolute `dueAtMs`.
|
|
20
|
+
Scheduling is first writer wins and fenced against the active run owner, so a
|
|
21
|
+
process that no longer owns a run cannot arm a timer against it.
|
|
22
|
+
|
|
23
|
+
Both report outcome unions rather than booleans, so a caller can tell a fresh
|
|
24
|
+
write from an idempotent repeat:
|
|
25
|
+
|
|
26
|
+
| Call | Outcomes |
|
|
27
|
+
| ------------------ | ---------------------------------------------- |
|
|
28
|
+
| `completeDeferred` | `Completed` or `Existing` |
|
|
29
|
+
| `scheduleClock` | `Scheduled` or `Existing` |
|
|
30
|
+
| `completeClock` | `Completed`, `AlreadyCompleted`, or `NotFound` |
|
|
31
|
+
| `park` | `Parked` or `NotFound` |
|
|
32
|
+
| `wake` | `Woken`, `NotWaiting`, or `NotFound` |
|
|
33
|
+
|
|
34
|
+
A successful mutation means the row is durable. Callers may therefore journal
|
|
35
|
+
and schedule a wake only after the mutation returns.
|
|
36
|
+
|
|
37
|
+
The additive [state event schemas](https://journal.smithers.sh/concepts/state-event-authority/)
|
|
38
|
+
describe execution, deferred and clock history with explicit lineage. Existing
|
|
39
|
+
writers retain their bytes and these stores remain authoritative. A retained
|
|
40
|
+
attempt-history projection cannot replace deferred, clock or ownership state.
|
|
41
|
+
|
|
42
|
+
## The waiting taxonomy
|
|
43
|
+
|
|
44
|
+
A run that suspends parks first. The driver writes a `Waiting` payload with a
|
|
45
|
+
`reason`, an optional `wakeAt`, and an optional `token`:
|
|
46
|
+
|
|
47
|
+
- reason `timer`, with the earliest pending clock deadline as `wakeAt`, when a
|
|
48
|
+
durable clock is outstanding.
|
|
49
|
+
- reason `event` otherwise.
|
|
50
|
+
- reason `released` for a run interrupt-released by shutdown or a lapsed lease;
|
|
51
|
+
its `interrupt-released` decision records which as `cause`.
|
|
52
|
+
- reason `quarantine` for a run parked on corrupt attempt evidence.
|
|
53
|
+
|
|
54
|
+
Every resume clears the payload when the run re-enters `running`. Because the
|
|
55
|
+
driver populates the taxonomy on the execution path rather than only through the
|
|
56
|
+
store API, `waitingRuns` and the waiting-row partial index match real
|
|
57
|
+
suspensions.
|
|
58
|
+
|
|
59
|
+
`WaitingRunsFilter` narrows a sweep to actionable rows by `reason`,
|
|
60
|
+
`dueBeforeMs`, and a `cancelRequested` predicate over the run row, so a sweeper
|
|
61
|
+
fetches only what it can act on instead of scanning every parked run.
|
|
62
|
+
|
|
63
|
+
## Three sweeps, on the heartbeat cadence
|
|
64
|
+
|
|
65
|
+
The driver re-drives three durable shapes periodically, and each one re-enters
|
|
66
|
+
the ordinary claim, steal, and activate path:
|
|
67
|
+
|
|
68
|
+
1. Parked runs whose cancellation was durably requested.
|
|
69
|
+
2. Runs parked with reason `released`, left by a shutdown that interrupted them.
|
|
70
|
+
3. Stale `running` rows left by a hard-killed owner.
|
|
71
|
+
`staleRunningRuns(staleBeforeMs, limit?)` lists runs whose heartbeat froze
|
|
72
|
+
before the horizon, with that heartbeat, oldest first, so a capped sweep drains a mass
|
|
73
|
+
owner death across ticks rather than waking every stale run in every driver
|
|
74
|
+
on every tick.
|
|
75
|
+
|
|
76
|
+
Registration does its own recovery: `pendingClocks(scope)` re-arms outstanding
|
|
77
|
+
timers and `completedDeferreds(flowName)` recovers unconsumed completions. Both exclude rows
|
|
78
|
+
whose run has settled, so a restart arms timers for runs that can still make
|
|
79
|
+
progress and for no others. Before serving a persisted deferred result, the
|
|
80
|
+
engine marks it consumed. Later registration sweeps leave that completion out,
|
|
81
|
+
so a run parked on a subsequent approval, timer, or deferred stays parked. The
|
|
82
|
+
original result remains available for replay. Migration 0008 starts existing
|
|
83
|
+
completions as unconsumed, allowing recovery after an upgrade.
|
|
84
|
+
|
|
85
|
+
One corrupt row costs its own row and nothing else. Every list read
|
|
86
|
+
(`dueClocks`, `pendingClocks`, `completedDeferreds`, `waitingRuns`,
|
|
87
|
+
`runParents`, and `runChildren`) skips a row that will not decode and logs a
|
|
88
|
+
storage-integrity warning naming its primary key, so a single unreadable row
|
|
89
|
+
cannot stop a registration, a timer sweep, or a cancellation cascade. The point
|
|
90
|
+
reads `deferred`, `clock`, and `waiting` still fail on such a row: they answer a
|
|
91
|
+
question about one row, and reporting "no row" for a completion or deadline that
|
|
92
|
+
is durably recorded but unreadable would re-run work whose side effects already
|
|
93
|
+
ran.
|
|
94
|
+
|
|
95
|
+
A wake for a flow the sweeping process has not registered is not dropped
|
|
96
|
+
silently. The driver logs a once-per-run structured warning naming the run id
|
|
97
|
+
and the flow, and leaves the durable waiting row parked, so any process that
|
|
98
|
+
does register the flow still reclaims the run.
|
|
99
|
+
|
|
100
|
+
## Cancellation is observed, not just recorded
|
|
101
|
+
|
|
102
|
+
While a run executes, the driver polls `cancel_requested_at_ms` on the heartbeat
|
|
103
|
+
cadence and cancels the run, interrupting the flow fiber, when another process
|
|
104
|
+
called `RunStore.requestCancel`. A terminal transition additionally asserts
|
|
105
|
+
`{ cancelRequested: "absent" }` inside the ownership compare-and-swap, so a
|
|
106
|
+
request that races past the last poll turns finalize into a cancellation rather
|
|
107
|
+
than a `completed` or `failed` write.
|
|
108
|
+
|
|
109
|
+
`completeRunClocks(executionId, completedAtMs)` closes every uncompleted clock
|
|
110
|
+
row of one run in a single statement, inside the terminal transaction. A run
|
|
111
|
+
that settled has no future, so a timer firing against it could only schedule a
|
|
112
|
+
resume nothing will drive.
|
|
113
|
+
|
|
114
|
+
## Retrying a clock that failed to fire
|
|
115
|
+
|
|
116
|
+
A durable clock whose fire fails transiently is redispatched with capped
|
|
117
|
+
exponential backoff rather than being lost until process restart. The policy is
|
|
118
|
+
`EngineStore.Options.clockFireRetryPolicy`, defaulting to exponential from 100ms
|
|
119
|
+
capped at 30s, forever. It is the same option shape as the engine's
|
|
120
|
+
`suspendedRetryPolicy`: the built-in behavior is the default, and a deployment
|
|
121
|
+
that wants a different backoff supplies one rather than patching the store.
|
|
122
|
+
|
|
123
|
+
## The wake bus makes the common case fast
|
|
124
|
+
|
|
125
|
+
Polling is correct and slow. `WakeBus` is an in-process, edge-triggered bus:
|
|
126
|
+
`wake(executionId)` resumes every waiter parked on that execution, `awaitWake`
|
|
127
|
+
parks until the next one, and `waiters` reports the current count for tests and
|
|
128
|
+
diagnostics.
|
|
129
|
+
|
|
130
|
+
Nothing about it is durable, and that is the design. A wake with no waiters is
|
|
131
|
+
dropped, and the polling fallback covers the run. Registration is removed when
|
|
132
|
+
a waiting fiber is interrupted, including scope closure and losing a race
|
|
133
|
+
against the polling sleep, so an abandoned wait leaks nothing. Cross-process
|
|
134
|
+
delivery stays store-driven.
|
|
135
|
+
|
|
136
|
+
An engine composition resolves the bus optionally. Provide `WakeBus.layer` to
|
|
137
|
+
share one bus between the engine and your own wake sources; provide nothing and
|
|
138
|
+
the composition builds a private one. `WakeBus.layerNoop()` drops every wake,
|
|
139
|
+
which is what a test asserting the polling fallback provides.
|
|
140
|
+
|
|
141
|
+
## The run DAG
|
|
142
|
+
|
|
143
|
+
`DurableEngineState` also owns the parent edges between runs, because a run
|
|
144
|
+
row's `state_json` carries only the first creating parent and a diamond gives a
|
|
145
|
+
run a second one.
|
|
146
|
+
|
|
147
|
+
`recordRunParent(childId, parentId)` is first writer wins per pair, and the
|
|
148
|
+
cycle check runs inside the same write transaction as the insert: the edge is
|
|
149
|
+
inserted, the child's ancestor chain is walked over the durable edges, and on a
|
|
150
|
+
hit the transaction rolls back and the call fails with `RunParentCycleError`. A
|
|
151
|
+
rejected edge therefore leaves no durable trace, and of two concurrent writers
|
|
152
|
+
whose edges jointly close a cycle exactly one fails. The driver maps that error
|
|
153
|
+
to `FlowCycleDetected`.
|
|
154
|
+
|
|
155
|
+
`transaction(effect)` runs several store operations atomically. The driver wraps
|
|
156
|
+
the parent-edge record and the run-row creation it guards in one, so a crash
|
|
157
|
+
between them cannot leave a durable orphan edge for a run that was never
|
|
158
|
+
created. Serialized write transactions are a documented requirement of the
|
|
159
|
+
`DurableWriter.write` contract, not a SQLite artifact: a Postgres-backed
|
|
160
|
+
implementation must use `SERIALIZABLE`.
|
|
161
|
+
|
|
162
|
+
`runParents(childId)` and `runChildren(parentId)` list the edges oldest first.
|
|
163
|
+
The child direction is the only instance-independent way to find the runs a
|
|
164
|
+
cancelled parent linked to itself, so cancellation cascade reads it rather than
|
|
165
|
+
an in-process map. `removeRunParentsForRun(runId)` deletes every edge naming a
|
|
166
|
+
run as child or parent; an `AFTER DELETE` trigger on `flows_runs` prunes the
|
|
167
|
+
same edges in the same transaction, so a lane that never calls the hook still
|
|
168
|
+
cannot leave ghost edges.
|
|
169
|
+
|
|
170
|
+
## Related
|
|
171
|
+
|
|
172
|
+
- [Coordinate two processes](../guides/coordinate-two-processes.md): sharing a
|
|
173
|
+
wake bus and following a workspace's runs.
|
|
174
|
+
- [Ownership and fencing](./ownership-and-fencing.md): why parking and clock
|
|
175
|
+
scheduling take an owner.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Native lifecycle observations
|
|
2
|
+
|
|
3
|
+
The native driver records `executionFact: { version: 1, baseline, observation }`
|
|
4
|
+
in its authoritative `flows.engine.run-decision` and `flows.engine.interrupted`
|
|
5
|
+
records. This is a producer contract implemented by `RunDriver`, separate from
|
|
6
|
+
the generic `EngineEvent` schema vocabulary. Adding a schema alone does not
|
|
7
|
+
migrate a writer.
|
|
8
|
+
|
|
9
|
+
An observation contains the execution ID, flow name, lifecycle status, creation,
|
|
10
|
+
start and finish timestamps, effective parent, trampoline lineage and ordinal,
|
|
11
|
+
actual cancellation-request timestamp, and waiting reason/deadline/token digest.
|
|
12
|
+
Ownership, claims, heartbeats and cancellation acknowledger identity remain
|
|
13
|
+
operational store state; a heartbeat does not invalidate a semantic observation.
|
|
14
|
+
The existing encoded `state` on run decisions remains unchanged.
|
|
15
|
+
|
|
16
|
+
A wait's `tokenDigest` is SHA-256 of the exact opaque token, or null when absent.
|
|
17
|
+
The protected native waiting row remains execution authority for resolving the
|
|
18
|
+
wait. The event contains a comparison commitment, **not a replayable resolver
|
|
19
|
+
credential**. The journal redactor is not bypassed. Other application strings
|
|
20
|
+
that the redactor changes cannot establish exact replay equality and correctly
|
|
21
|
+
remain observations rather than verified event state.
|
|
22
|
+
|
|
23
|
+
## Commit boundary
|
|
24
|
+
|
|
25
|
+
Creation, parent admission, activation, resume clearing, suspension, release,
|
|
26
|
+
handoff and terminal settlement capture their fact in the transaction that
|
|
27
|
+
changes the row. Parking and the guarded status CAS are one transaction. A lost
|
|
28
|
+
CAS rolls the park back, preserving an earlier committed waiting row. Resume
|
|
29
|
+
clears the waiting row before capturing the running fact and before executing
|
|
30
|
+
work. Engine-state is the outer transaction and the journal write transaction
|
|
31
|
+
is inside it, matching deferred completion's state-first lock order. The memory
|
|
32
|
+
state adapter holds its own gate: taking the journal writer first can deadlock against a
|
|
33
|
+
state-first fiber waiting for that writer. The memory state gate is released
|
|
34
|
+
at SQL commit before post-commit journal work; publication failures after
|
|
35
|
+
commit cannot undo either committed boundary.
|
|
36
|
+
|
|
37
|
+
Cancellation records the actual `cancel_requested_at_ms` only when a guarded
|
|
38
|
+
request changes a live row. Repeat requests, missing rows and terminal rows
|
|
39
|
+
invent no new intent. Lineage cancellation reads membership, updates live rounds
|
|
40
|
+
and records each changed round in one native transaction. Descendant and inherited
|
|
41
|
+
requests use the same producer. A completed predecessor does not acquire a fake
|
|
42
|
+
request timestamp just because its successor is cancelled.
|
|
43
|
+
|
|
44
|
+
The Node and Bun host capture the native journal, run store and engine state
|
|
45
|
+
before `AgentSession` selects the separate control journal. Its direct
|
|
46
|
+
cancellation callback executes in the captured host context, outside any caller's
|
|
47
|
+
control SQL transaction. The native commit precedes the control receipt; the two
|
|
48
|
+
databases are not one distributed transaction. A later control write failure
|
|
49
|
+
cannot undo already accepted native intent, which remains visible in the native
|
|
50
|
+
observation and copied facts. Low-level `RunStore` calls and standalone legacy
|
|
51
|
+
`AgentSession.requestCancel` do not promise this event contract.
|
|
52
|
+
|
|
53
|
+
## Replay and migration
|
|
54
|
+
|
|
55
|
+
`ExecutionFact.fold` in `@smthrs/journal` is browser safe and pure. New creation
|
|
56
|
+
facts establish a `created` baseline. A first fact for an older row, an unknown
|
|
57
|
+
producer version, an explicit omission, or a generation boundary cannot invent
|
|
58
|
+
the missing prefix. A later complete fact establishes a `legacy` baseline.
|
|
59
|
+
If a low-level/corrupt row cannot encode a valid observation, the writer records
|
|
60
|
+
`{ version: 1, unavailable: "invalid-observation" }`. Existing invalid-round or
|
|
61
|
+
corruption handling can still settle the execution; this marker never creates
|
|
62
|
+
verified coverage and does not normalize malformed ancestry into invented facts.
|
|
63
|
+
The exposed sequence/generation range names the current round's native stream;
|
|
64
|
+
root and current are both compared, and either legacy baseline makes the logical
|
|
65
|
+
view's baseline legacy. Numeric sequence holes alone are not omissions: rolled-back SQL journal
|
|
66
|
+
reservations can leave them without losing a committed event.
|
|
67
|
+
|
|
68
|
+
The native supervisor authenticates a wrapper through its native flow, approved
|
|
69
|
+
plan and root ancestry, then the bridge writes a separate `control.engine.bound`
|
|
70
|
+
fact. It never binds a control run by trusting an input `runId` field. Existing
|
|
71
|
+
`control.engine.event` payloads and producer identities are unchanged. The bridge
|
|
72
|
+
walks both durable spawn edges and native trampoline membership; a handoff is not
|
|
73
|
+
a spawn edge. A legacy adapter without the lineage port cannot establish coverage
|
|
74
|
+
for a missing latest round.
|
|
75
|
+
|
|
76
|
+
Gateway run reads and subscriptions use the same control fold and native fold.
|
|
77
|
+
`lifecycleProvenance` continues to describe control replay and whether lifecycle
|
|
78
|
+
was engine observed. The additive `executionProvenance` separately identifies
|
|
79
|
+
native `events`, `legacy-observation` or `unverified-observation`. Native facts are
|
|
80
|
+
compared against a coherent observation of both the requested root and latest
|
|
81
|
+
round. The root retains ancestry and round identity; the current round supplies
|
|
82
|
+
status and waiting. A missing binding, gap, unsupported version or mismatch keeps
|
|
83
|
+
an honest observed fallback. Bridge lag is possible because this is a read-side
|
|
84
|
+
copy between databases, not a distributed snapshot.
|
|
85
|
+
|
|
86
|
+
This stream verifies the semantic run/approval view. It does not rebuild every
|
|
87
|
+
execution table: action outcomes, clocks, deferred values and resolver credentials
|
|
88
|
+
retain their existing native authorities. [Native call facts](./call-facts.md)
|
|
89
|
+
now use the owning action transaction and durable journal as their outbox.
|
|
90
|
+
Other agent trace records still use a best-effort channel.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Ownership and fencing"
|
|
3
|
+
description: "How one engine claims a run, how every durable write is fenced on an OwnerId, and how a run is reclaimed from an owner that stopped heartbeating."
|
|
4
|
+
sidebar:
|
|
5
|
+
order: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Two processes can open the same database. Nothing in SQLite stops the second
|
|
9
|
+
one from driving a run the first one is already driving, and nothing in the
|
|
10
|
+
first one notices. Ownership is the answer: exactly one incarnation owns a run
|
|
11
|
+
at a time, every durable write it makes is conditioned on still being that
|
|
12
|
+
owner, and a run whose owner went away can be taken over on evidence rather
|
|
13
|
+
than on a guess.
|
|
14
|
+
|
|
15
|
+
## The OwnerId
|
|
16
|
+
|
|
17
|
+
An `OwnerId` is a triple: the `hostId` the composition declares, a `pid`, and a
|
|
18
|
+
fresh `nonce`. `OwnerIdentity` mints it, once per incarnation:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { OwnerIdentity } from "@smthrs/engine-store"
|
|
22
|
+
|
|
23
|
+
const identity = OwnerIdentity.layer
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The default reads a process id off `globalThis` where the platform has one, and
|
|
27
|
+
draws an incarnation number from `Random` where it does not, so a browser tab
|
|
28
|
+
can mint a token even though it cannot execute durable flows. The nonce is a
|
|
29
|
+
UUIDv4 from the injected `Crypto` service. `layerConstant(owner)` pins the whole
|
|
30
|
+
token, which is what a test wants, and what a host that already holds a lease
|
|
31
|
+
from somewhere else wants.
|
|
32
|
+
|
|
33
|
+
The nonce is what makes the token an incarnation rather than a machine. A
|
|
34
|
+
process that restarts on the same host with the same pid mints a different
|
|
35
|
+
token, so its writes are correctly refused against runs the previous
|
|
36
|
+
incarnation still owns.
|
|
37
|
+
|
|
38
|
+
## What fencing means in practice
|
|
39
|
+
|
|
40
|
+
The engine claims a run before driving it, and from then on every durable write
|
|
41
|
+
carries the owner:
|
|
42
|
+
|
|
43
|
+
- Run state transitions go through the run store, which asks the journal's
|
|
44
|
+
consensus strategy whether the owner still holds the run inside the same
|
|
45
|
+
write transaction. A stale owner gets `FenceLost`.
|
|
46
|
+
- Attempt lifecycle writes pass the owner to the journal, which fences the
|
|
47
|
+
append. A reclaimed owner fails with `fence_lost` and self-interrupts rather
|
|
48
|
+
than appending.
|
|
49
|
+
- `DurableEngineState.park` and `scheduleClock` take the owner, so a process
|
|
50
|
+
that no longer runs a run cannot park it or arm a timer against it.
|
|
51
|
+
- Terminal transitions additionally assert `{ cancelRequested: "absent" }`
|
|
52
|
+
inside the same compare-and-swap, so a cancellation that arrives after the
|
|
53
|
+
last poll turns finalize into a cancellation rather than a `completed` write.
|
|
54
|
+
|
|
55
|
+
The consequence is that a zombie process is harmless. It can hold a live fiber
|
|
56
|
+
and a live database handle, and every write it attempts against a reclaimed run
|
|
57
|
+
is refused by the row it is writing to.
|
|
58
|
+
|
|
59
|
+
## The lease, and the evidence to break it
|
|
60
|
+
|
|
61
|
+
An owner heartbeats while it drives. `isAlive` on `EngineStore.Options` decides
|
|
62
|
+
whether a run whose lease has expired may be stolen; answering `true` refuses
|
|
63
|
+
the takeover.
|
|
64
|
+
|
|
65
|
+
The default is `Ownership.leaseLiveness(Ownership.heartbeatStaleAfter)`: the
|
|
66
|
+
owner counts as alive while its persisted `heartbeat_at_ms` is younger than the
|
|
67
|
+
staleness cutoff, and gone once it is not. That is the weakest honest answer,
|
|
68
|
+
and the only evidence every host has. It is also enough: a process killed with
|
|
69
|
+
SIGKILL stops heartbeating, so a fresh process reclaims its runs with no
|
|
70
|
+
application code at all.
|
|
71
|
+
|
|
72
|
+
A deployment that knows more supplies its own check and refuses the takeover
|
|
73
|
+
for longer. A `process.kill(pid, 0)` probe is one such check;
|
|
74
|
+
`Ownership.sameHostPidProbe` is the shipped version. Guard any pid read with
|
|
75
|
+
`Ownership.sameHostIncarnation`, because a pid names a process only inside its
|
|
76
|
+
own host's namespace. A supplied check receives the recorded owner and a
|
|
77
|
+
`LivenessContext` of `{ claimant, heartbeatAtMs, nowMs }`.
|
|
78
|
+
|
|
79
|
+
## The journal says which answer was used
|
|
80
|
+
|
|
81
|
+
Every arbitration is recorded, so a takeover is auditable after the fact:
|
|
82
|
+
|
|
83
|
+
| Record | Meaning |
|
|
84
|
+
| ---------------------------------------------------------------------- | -------------------------------------------------------------- |
|
|
85
|
+
| `steal-refused-owner-alive` with `evidence: "lease-fresh"` | The lease was still inside the staleness window. |
|
|
86
|
+
| `steal-refused-owner-alive` with `evidence: "probe"` | The supplied `isAlive` check answered for the owner. |
|
|
87
|
+
| `stolen-and-activated` with `evidence: "lease-expired"` | The lease had expired and no check refused it. |
|
|
88
|
+
| `stolen-and-activated` with `evidence: "same-host-pid-dead"` | A same-host probe found the process gone. |
|
|
89
|
+
| `stolen-and-activated` with `evidence: "cross-host-unreachable-stale"` | The owner was on another host and unreachable past the window. |
|
|
90
|
+
|
|
91
|
+
A refusal is journaled once, not once per sweep tick. The record is addressed
|
|
92
|
+
by the run, the refused owner, the lease it was refused against, and the
|
|
93
|
+
evidence that refused it, and it carries source sequence 0, so the journal's
|
|
94
|
+
first-writer admission collapses every repeat about an unchanged lease into one
|
|
95
|
+
record. The evidence is part of the address because one lease can be refused
|
|
96
|
+
twice for different reasons: a wake arriving while the owner is still pulsing
|
|
97
|
+
is refused by the lease, and the same owner, alive but stalled past the window,
|
|
98
|
+
is refused by the probe. Both records stand.
|
|
99
|
+
|
|
100
|
+
## Backoff, so arbitration keeps moving
|
|
101
|
+
|
|
102
|
+
The driver stops re-probing a run it was just refused. Each refusal defers that
|
|
103
|
+
run for two heartbeat ticks, doubling per consecutive refusal against the same
|
|
104
|
+
lease up to `heartbeatStaleAfter`. The stale-running sweep reads past exactly
|
|
105
|
+
the rows it is going to skip, so its batch of 64 keeps advancing. Without that,
|
|
106
|
+
the oldest stale rows sort first every second and a run behind them is never
|
|
107
|
+
arbitrated at all.
|
|
108
|
+
|
|
109
|
+
A deferral is forgotten as soon as its row leaves the stale window: the owner
|
|
110
|
+
resumed heartbeating, the run was stolen, or the run settled. A fresh stall
|
|
111
|
+
under a new lease is therefore probed on the first tick that sees it, rather
|
|
112
|
+
than waiting out a backoff it did not earn.
|
|
113
|
+
|
|
114
|
+
## Restoring a backup resets the fence
|
|
115
|
+
|
|
116
|
+
A restored database still carries the owner tokens that were live when the
|
|
117
|
+
backup was taken. `DisasterRecovery.fence` clears every pending claim and
|
|
118
|
+
suspends every run that was `running`, in one serialized write transaction, so
|
|
119
|
+
a surviving pre-backup owner fails its compare-and-swap immediately and the
|
|
120
|
+
restored runs are claimable without waiting out the staleness cutoff. See
|
|
121
|
+
[Back up and restore the store](../guides/back-up-and-restore.md).
|
|
122
|
+
|
|
123
|
+
## Related
|
|
124
|
+
|
|
125
|
+
- [Reclaim runs from a dead host](../guides/reclaim-runs-from-a-dead-host.md):
|
|
126
|
+
the task-shaped version of this page.
|
|
127
|
+
- [Attempts and replay](./attempts-and-replay.md): what a reclaiming process
|
|
128
|
+
does with the attempt rows the previous owner left behind.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Step boundaries"
|
|
3
|
+
description: "The declared read and write sets of a step, what prepare, settle, and replayOutputs each measure, and why only whole-tree evidence may enter the shared cache."
|
|
4
|
+
sidebar:
|
|
5
|
+
order: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
A step declares which files it reads and which it writes. `StepBoundary` is the
|
|
9
|
+
service that measures that declaration against reality: before the step runs,
|
|
10
|
+
after it runs, and again when a later replay has to reproduce its outputs on a
|
|
11
|
+
workspace that never executed anything.
|
|
12
|
+
|
|
13
|
+
The declaration itself is `FileBoundary`, from
|
|
14
|
+
[`@smthrs/flow`](/api/flow)'s `Action` namespace: a `readSet`, a `writeSet`,
|
|
15
|
+
optional `removes`, and a `boundaryMode` of `hard` or `expected`.
|
|
16
|
+
|
|
17
|
+
## The three calls
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
interface Service {
|
|
21
|
+
readonly prepare: (descriptor: FileBoundary) => Effect<PreparedBoundary, UnsupportedBoundary, Crypto>
|
|
22
|
+
readonly settle: (prepared: PreparedBoundary) => Effect<BoundaryEvidence, SettleError, Crypto>
|
|
23
|
+
readonly replayOutputs: (evidence: BoundaryEvidence) => Effect<void, ReplayError, Crypto>
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`prepare` measures the declared read set's real digests and returns a
|
|
28
|
+
`PreparedBoundary` carrying the descriptor plus a `readSnapshot`. The declared
|
|
29
|
+
digests in the descriptor are caller metadata folded into the step key; the
|
|
30
|
+
snapshot is the evidence that they still describe reality.
|
|
31
|
+
|
|
32
|
+
`settle` measures the writes afterwards and turns them into
|
|
33
|
+
`BoundaryEvidence`: the declared outputs (as a replayable payload), a
|
|
34
|
+
`diffIdentity` naming the post-state, and two optional honest flags,
|
|
35
|
+
`wholeTreeWritesVerified` and `hermeticReadsVerified`.
|
|
36
|
+
|
|
37
|
+
`replayOutputs` reproduces those outputs from the evidence.
|
|
38
|
+
|
|
39
|
+
## Hard mode refuses, expected mode records
|
|
40
|
+
|
|
41
|
+
The same observation produces a refusal in `hard` mode and a `BoundaryDeviation`
|
|
42
|
+
in `expected` mode:
|
|
43
|
+
|
|
44
|
+
| Observation | Hard mode | Expected mode |
|
|
45
|
+
| ---------------------------------------------------------------------- | -------------------------- | ------------------------------------ |
|
|
46
|
+
| Wrote outside the declared write set | `UndeclaredWrite` | `ExpectedSetDeviation` |
|
|
47
|
+
| Did not produce a declared output, and did not declare it as a removal | `MissingDeclaredOutput` | `MissingDeclaredOutput` deviation |
|
|
48
|
+
| Left a declared removal in place | `SurvivingDeclaredRemoval` | `SurvivingDeclaredRemoval` deviation |
|
|
49
|
+
|
|
50
|
+
The two absence cases exist for a specific reason. Recording `digest: null` as
|
|
51
|
+
valid evidence caches the claim "this file should not exist", which
|
|
52
|
+
`replayOutputs` then acts on by deleting the path on a workspace that never ran
|
|
53
|
+
the step. A step that crashed after declaring its writes would poison the cache
|
|
54
|
+
with an eraser. Declaring a path in `removes` is how a deliberate deletion says
|
|
55
|
+
so, and it is the only thing that makes an absence legitimate.
|
|
56
|
+
|
|
57
|
+
A deviation of any variant bars the evidence from the shared cache, so an
|
|
58
|
+
unexplained absence never reaches another host either way. Deviations go to
|
|
59
|
+
[`Reconciliation`](../guides/drive-a-plan.md), which answers with a verdict.
|
|
60
|
+
|
|
61
|
+
## Bounded host measurement
|
|
62
|
+
|
|
63
|
+
`prepare` and `settle` use the kernel's optional guarded batch capability when
|
|
64
|
+
the host provides it. Enumeration batches directory and stat requests while
|
|
65
|
+
retaining the plan's glob matcher, dotfile behavior, pruning, sorted output,
|
|
66
|
+
and entry budget. Hosts without batching use the existing operations with at
|
|
67
|
+
most four in flight.
|
|
68
|
+
|
|
69
|
+
Read digests are SHA-256 of the original file bytes. Tree-artifact and diff
|
|
70
|
+
identities still use the same canonical key inputs and absence sentinels, so
|
|
71
|
+
batching introduces no persisted key or evidence migration. The declaration
|
|
72
|
+
snapshot stays immutable, and all measurements use the same guarded filesystem
|
|
73
|
+
whose root descriptor identity is pinned at composition.
|
|
74
|
+
|
|
75
|
+
Settlement first obtains digest/size measurements, then groups content reads
|
|
76
|
+
by both path count and the host's response-byte budget. A change between the
|
|
77
|
+
two measurements refuses settlement. Inline decisions and artifact spills
|
|
78
|
+
remain in sorted path order, preserving the aggregate inline budget and the
|
|
79
|
+
resulting manifest. Helper errors retain their original cause through
|
|
80
|
+
`UnsupportedBoundary`. Losing the workspace root fails the boundary instead
|
|
81
|
+
of turning every file into an absence.
|
|
82
|
+
|
|
83
|
+
Batching does not freeze the workspace, attest whole-tree writes, or change
|
|
84
|
+
cache admission. Each helper measures through checked descriptors; later
|
|
85
|
+
verification still has to consume fresh measurements through that boundary.
|
|
86
|
+
|
|
87
|
+
## Inline, or spilled by digest
|
|
88
|
+
|
|
89
|
+
Outputs are recorded by content digest, never inlined without bound. Two limits
|
|
90
|
+
on `FileSystemOptions` decide:
|
|
91
|
+
|
|
92
|
+
- `maxInlineBytes`, the largest single output carried inline in the evidence.
|
|
93
|
+
Defaults to 1 MiB.
|
|
94
|
+
- `maxTotalInlineBytes`, the largest aggregate inline payload one settle may
|
|
95
|
+
fold into its evidence. Defaults to 8 MiB. A per-output bound alone still let
|
|
96
|
+
a wide write set multiply many individually small payloads into an unbounded
|
|
97
|
+
evidence row.
|
|
98
|
+
|
|
99
|
+
Anything past either bound is handed to the `ArtifactStore` and recorded by
|
|
100
|
+
digest reference only. `referencedDigests(evidence)` names exactly those
|
|
101
|
+
digests: the set a shared tier must hold before the evidence's cache entry
|
|
102
|
+
becomes observable there, and the set a replay on a fresh host has to fetch.
|
|
103
|
+
|
|
104
|
+
The blob mechanics, content addressing, atomic publication, digest
|
|
105
|
+
verification, and dedupe, belong to [`@smthrs/artifacts`](/api/artifacts). What
|
|
106
|
+
stays here is the policy that decides which outputs become blobs at all.
|
|
107
|
+
|
|
108
|
+
## Why the production boundary cannot claim the whole tree by itself
|
|
109
|
+
|
|
110
|
+
`StepBoundary.layer` is the filesystem-backed boundary over the kernel
|
|
111
|
+
`FileSystem` seam and the artifact store. It measures declared paths. It cannot
|
|
112
|
+
see a write elsewhere in the tree, so it never claims
|
|
113
|
+
`wholeTreeWritesVerified` on its own, and a composition with a boundary but no
|
|
114
|
+
sandbox keeps the honest outcome: run-local results only.
|
|
115
|
+
|
|
116
|
+
The whole-tree proof comes from running the body somewhere else. That is
|
|
117
|
+
[`WorkspaceSandbox`](./workspace-transactions.md): the transaction is the tree,
|
|
118
|
+
so a write outside the declared set is a map comparison rather than an
|
|
119
|
+
inference, and the engine sets the flag structurally.
|
|
120
|
+
|
|
121
|
+
`StepBoundary.layerTest(options)` is deterministic and supports
|
|
122
|
+
explicit `failure` or `deviation` fixtures, replay, and `readSnapshot` assertions, but it does not
|
|
123
|
+
enforce a real sandbox. Its `wholeTreeWriteDetection` default of `true` is a
|
|
124
|
+
fixture, not a proof.
|
|
125
|
+
|
|
126
|
+
## Replay refusals a caller can act on
|
|
127
|
+
|
|
128
|
+
`replayOutputs` distinguishes three failures on purpose:
|
|
129
|
+
|
|
130
|
+
- `MissingArtifact`: the bytes are simply not on this host. A shared artifact
|
|
131
|
+
tier can repair it, so `ArtifactSync.hydrate` fetches and the dispatch
|
|
132
|
+
retries the replay exactly once before falling through to a real execution.
|
|
133
|
+
- `BoundaryCorruption`: the bytes are here and no longer hash to their recorded
|
|
134
|
+
digest. That is an integrity violation, not a transient failure.
|
|
135
|
+
- `UnsupportedBoundary`: the host could not honour the boundary at all. It is
|
|
136
|
+
the catch-all, and it carries the refusing host or store failure whole in
|
|
137
|
+
`cause` rather than flattened into the message.
|
|
138
|
+
|
|
139
|
+
## Related
|
|
140
|
+
|
|
141
|
+
- [Workspace transactions](./workspace-transactions.md): where the whole-tree
|
|
142
|
+
proof actually comes from.
|
|
143
|
+
- [Cache admission](./cache-admission.md): the full list of conditions a record
|
|
144
|
+
must meet before another run may use it.
|
|
145
|
+
- [Share a cache across machines](../guides/share-a-cache-across-machines.md):
|
|
146
|
+
publishing the digests this evidence references.
|
|
147
|
+
|
|
148
|
+
Test filesystem classification with `StepBoundary.layer` over an in-memory `FileSystem` and `ArtifactStore`. `layerTest` returns supplied settlement evidence or failure verbatim; it does not classify changed paths, missing outputs, or surviving removals.
|