@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,199 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Workspace transactions"
|
|
3
|
+
description: "The two-phase workspace sandbox: a body runs against an isolated tree and returns its writes, and a separate copy-back checks preconditions and applies them to the host."
|
|
4
|
+
sidebar:
|
|
5
|
+
order: 4
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
`WorkspaceSandbox` is a functional transaction over a filesystem. A sealed
|
|
9
|
+
action's body runs in an isolated workspace and returns its writes rather than
|
|
10
|
+
performing them. Applying those writes to the host is a separate call that
|
|
11
|
+
checks all preconditions before changing files and attempts in-process rollback
|
|
12
|
+
on failure. Filesystem copy-back is not crash-atomic.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
interface Service {
|
|
16
|
+
readonly execute: <Output, Error>(
|
|
17
|
+
execution: Execution<Output, Error>
|
|
18
|
+
) => Effect<ExecutionResult<Output>, Error | WorkspaceError, Crypto>
|
|
19
|
+
readonly materialize: <Output>(
|
|
20
|
+
accepted: Accepted<Output>
|
|
21
|
+
) => Effect<void, MaterializationConflict | WorkspaceError, Crypto>
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## execute never touches the host
|
|
26
|
+
|
|
27
|
+
The transaction is seeded with exactly the declared read set. An undeclared
|
|
28
|
+
file is simply not there, which is the strong enforcement tier: the body cannot
|
|
29
|
+
read what it did not declare because the bytes were never copied in. The
|
|
30
|
+
transaction is served through both the `Workspace` tag and a re-rooted Effect
|
|
31
|
+
`FileSystem`, so a body written against either surface is isolated.
|
|
32
|
+
|
|
33
|
+
At settlement the whole map is diffed. An execution whose observations
|
|
34
|
+
contradict its declaration comes back `Invalidated`, and that shape deliberately
|
|
35
|
+
carries provenance and violations only: there is no accessor for the candidate
|
|
36
|
+
output, the files, or the queued effects. An accepted execution comes back as
|
|
37
|
+
`Accepted`, carrying the `WorkflowResult`, the memo `CacheOutcome`, and, in
|
|
38
|
+
expected mode, the violations the declaration did not predict.
|
|
39
|
+
|
|
40
|
+
Seeding costs a copy of the declared reads. Re-rooting the body onto a bare
|
|
41
|
+
host tree instead would leave every undeclared file readable and reduce
|
|
42
|
+
enforcement to detection by diff after the fact, and the OS-level overlay that
|
|
43
|
+
would fix that is not reachable through Effect's `FileSystem` tag, so it could
|
|
44
|
+
not run in a browser. Bazel uses the same copy-in strategy for the same reason.
|
|
45
|
+
|
|
46
|
+
## materialize is the only host write
|
|
47
|
+
|
|
48
|
+
Copy-back is a compare-and-set on every `FileChange.beforeDigest`. If the base
|
|
49
|
+
moved, the whole bundle is refused with `MaterializationConflict` and nothing
|
|
50
|
+
lands. The engine answers that by retrying the attempt from a fresh base a bounded
|
|
51
|
+
number of times.
|
|
52
|
+
|
|
53
|
+
`beforeDigest` describes what is really on the host, not what was in the seed.
|
|
54
|
+
The `Host.baseline` seam is what supplies it, because "absent from the seed" is
|
|
55
|
+
emphatically not "absent from the host": a body writing a declared output it
|
|
56
|
+
never declared as a read is the ordinary case, and that file usually already
|
|
57
|
+
exists from a previous run. Treating the seed as the whole world made every such
|
|
58
|
+
copy-back a conflict the engine could only rebase into the same refusal.
|
|
59
|
+
|
|
60
|
+
Two more properties bind the write:
|
|
61
|
+
|
|
62
|
+
- Every copy-back host call (the lock, the preflight reads, each write,
|
|
63
|
+
directory creation, and removal, and every rollback call) is one
|
|
64
|
+
descriptor-relative request against the workspace root pinned when the
|
|
65
|
+
commit starts. The host resolves each path component with `O_NOFOLLOW`
|
|
66
|
+
from that root, so there is no gap between a check and a write for another
|
|
67
|
+
process to swap a symlink into. A symlink anywhere on a change's path, a
|
|
68
|
+
hard-linked file, or a root replaced mid-commit fails `materialize` with
|
|
69
|
+
`path_escapes_workspace`. That includes a symlink that stays inside the
|
|
70
|
+
root: the body writes the referent path itself.
|
|
71
|
+
- Digest checks and retained-byte resolution finish before any file change. The apply loop journals each target's pre-image before touching
|
|
72
|
+
it, including the target of a write that fails partway through. An apply
|
|
73
|
+
failure triggers an attempt to restore those files. Empty parent directories
|
|
74
|
+
can remain after rollback.
|
|
75
|
+
|
|
76
|
+
The filesystem host serializes preflight, apply, and rollback with
|
|
77
|
+
other cooperating commits. A semaphore is shared by workspace root in the
|
|
78
|
+
process. A `.smithers-workspace-lock` lease file under the root coordinates
|
|
79
|
+
separate processes, including callers using symlink aliases of the same root.
|
|
80
|
+
This path is reserved: bundles cannot materialize it or its children. The `.flows` engine state directory is reserved the same way, so no
|
|
81
|
+
write set, `**` glob, or `expected` boundary mode lets a step body replace the
|
|
82
|
+
engine database, its `-wal` and `-shm` siblings, or artifact objects kept
|
|
83
|
+
there. Add other state paths under the root with the `reservedPaths` option.
|
|
84
|
+
A write or removal that targets a reserved path or lies beneath one fails
|
|
85
|
+
`materialize` with `host_unavailable` before any file changes; a symlink alias
|
|
86
|
+
of one is refused with `path_escapes_workspace` like any other symlink. Names
|
|
87
|
+
match after NFKC normalization and case folding, so a spelling a
|
|
88
|
+
case-insensitive volume equates with a reserved path, such as `.FLOWS`, is
|
|
89
|
+
refused on every volume. An NTFS 8.3 short-name shape, such as `FLOWS~1`, is
|
|
90
|
+
refused wherever a reserved segment stands, because an NTFS volume with short
|
|
91
|
+
names on opens the long name through it.
|
|
92
|
+
Filesystem hosts must support exclusive `wx` file creation, `stat` with an
|
|
93
|
+
mtime, `utimes`, `rename`, and `remove`.
|
|
94
|
+
|
|
95
|
+
The lock is `@smthrs/artifacts/FileLease`, the same lease the artifact store
|
|
96
|
+
uses for its objects directory. The file holds a unique owner token, and the
|
|
97
|
+
holder refreshes its mtime while the commit runs:
|
|
98
|
+
|
|
99
|
+
| Bound | Value |
|
|
100
|
+
| ------------------------------ | ------------------------------ |
|
|
101
|
+
| Heartbeat interval | 10 seconds |
|
|
102
|
+
| Stale after | 60 seconds without a heartbeat |
|
|
103
|
+
| Acquisition deadline | 2 minutes |
|
|
104
|
+
| Retry interval while contended | 25 milliseconds |
|
|
105
|
+
|
|
106
|
+
A killed or crashed holder stops heartbeating, and the next committer reclaims
|
|
107
|
+
its lock a minute later. Reclaimers of one stale lock race for a `wx` claim
|
|
108
|
+
file first, so the lock is moved away at most once and a fresh lock is never
|
|
109
|
+
displaced. A committer that cannot take the lock within two minutes fails with
|
|
110
|
+
`commit_lock_timeout` instead of waiting forever; the deadline ends before
|
|
111
|
+
preflight starts, so it never interrupts an apply. A lock directory left by an
|
|
112
|
+
rc.1 build is reclaimed on the same 60-second bound.
|
|
113
|
+
|
|
114
|
+
The fence is bounded, not absolute. A holder whose host stalls past 60 seconds
|
|
115
|
+
(a suspended machine, a stopped debugger) is reaped while it still runs; its
|
|
116
|
+
heartbeat logs `Workspace commit lock was reclaimed while its holder was still
|
|
117
|
+
running`, and its commit continues unfenced.
|
|
118
|
+
|
|
119
|
+
Copy-back needs a host that can make those descriptor-relative requests. On
|
|
120
|
+
Node and Bun that is `@smthrs/platform-node`'s `AtomicFileSystem.layer`, which
|
|
121
|
+
`NodeHost` and `BunHost` already provide; an in-memory volume attests
|
|
122
|
+
isolation with `@smthrs/kernel/FileSystem`'s `withIsolatedFileSystem`; the
|
|
123
|
+
kernel-guarded `FileSystem.layer` rooted at the same workspace also qualifies.
|
|
124
|
+
`WorkspaceSandbox.layerFileSystem` and `StepSandbox.layer` fail to build with
|
|
125
|
+
`host_unavailable` over a plain path-based host such as
|
|
126
|
+
`NodeFileSystem.layer`, because a path-based check cannot keep a concurrent
|
|
127
|
+
symlink swap out of the write. Writers that ignore the advisory lock are not serialized.
|
|
128
|
+
|
|
129
|
+
The undo journal exists only in memory. A process crash can leave partial file
|
|
130
|
+
changes behind; the lock it held is reclaimed once stale. Rollback can also fail: the returned
|
|
131
|
+
compound cause preserves the original apply failure and a `WorkspaceError`
|
|
132
|
+
with code `host_unavailable` whose cause contains the rollback failure. Neither
|
|
133
|
+
case guarantees restoration. The caller owns host reconciliation before
|
|
134
|
+
resuming work: inspect affected paths and restore or accept their state.
|
|
135
|
+
Waiting for the lock is interruptible, and an interrupted waiter never removes
|
|
136
|
+
a lock it does not own.
|
|
137
|
+
|
|
138
|
+
## Queued effects are dispatched after copy-back, never inside it
|
|
139
|
+
|
|
140
|
+
A body that wants to send a message calls `Workspace.queueEffect`. The
|
|
141
|
+
transaction records it and sends nothing. A speculative send has already reached
|
|
142
|
+
the world when its execution turns out to be invalid, and reaches it twice when
|
|
143
|
+
a copy-back loses a race.
|
|
144
|
+
|
|
145
|
+
The optional `EffectDispatcher` stage runs after copy-back settles, deduplicated
|
|
146
|
+
by `QueuedEffect.idempotencyKey`, the same key an irreversible action must carry
|
|
147
|
+
before it may be retried at all. With no dispatcher provided the engine journals
|
|
148
|
+
what a transaction queued and sends nothing. The journal records
|
|
149
|
+
`diff-bundle-captured` and `copy-back-settled`.
|
|
150
|
+
|
|
151
|
+
## One transaction, two hosts
|
|
152
|
+
|
|
153
|
+
`makeHosted(host)` is the transaction. A `Host` supplies four things: `snapshot`
|
|
154
|
+
(the base), `baseline` (the host's digest for a path the transaction never
|
|
155
|
+
observed), `retain` (whether a produced file travels inline or by content
|
|
156
|
+
address), and `commit` (the serialized, preconditions-first apply), plus a `root`.
|
|
157
|
+
|
|
158
|
+
Two hosts ship:
|
|
159
|
+
|
|
160
|
+
- `makeMemory(initialFiles)` is deterministic and browser-safe. It seeds the
|
|
161
|
+
whole tree rather than the declared read set, so an undeclared read is
|
|
162
|
+
observable, which is what makes it the conformance implementation.
|
|
163
|
+
- `makeFileSystem(fs, path, artifacts, workspaceRoot, options)` and its layer
|
|
164
|
+
`layerFileSystem(options)` back the transaction with the kernel `FileSystem`,
|
|
165
|
+
the host `Path`, the kernel `Workspace` root, and the artifact store for products too large to
|
|
166
|
+
carry inline.
|
|
167
|
+
|
|
168
|
+
Because both are `makeHosted` over one `Host`, the transaction, the diff, the
|
|
169
|
+
violation check, and the provenance cannot drift between them.
|
|
170
|
+
|
|
171
|
+
## It is a determinism boundary, not a security boundary
|
|
172
|
+
|
|
173
|
+
A body that reaches the host through a service the transaction does not seed is
|
|
174
|
+
outside the transaction. Denying that ambient access is the VM and
|
|
175
|
+
`SandboxProvider` story in [`@smthrs/sandbox`](/api/sandbox). The transaction's
|
|
176
|
+
`FileSystem` surface is deliberately partial. `readDirectory` lists immediate
|
|
177
|
+
children and accepts `""`, `"."`, and the absolute workspace root as the root.
|
|
178
|
+
`exists` recognizes the root, files, and directories implied by visible file
|
|
179
|
+
paths. The root exists even when the transaction is empty; empty subdirectories
|
|
180
|
+
are not retained, and `makeDirectory` is a no-op. File reads, writes, and removals
|
|
181
|
+
require a non-root path. Paths containing `..` are refused. Directory probes
|
|
182
|
+
trace the visible files that establish their results for declaration checks.
|
|
183
|
+
A settled bundle is applied without a human diff-review gate, which is a known
|
|
184
|
+
limitation.
|
|
185
|
+
|
|
186
|
+
## StepSandbox is the scope-safe front door
|
|
187
|
+
|
|
188
|
+
`StepSandbox.Service` has one member, `open`, which yields a
|
|
189
|
+
`WorkspaceSandbox.Service` for one step or fails with `UnsupportedBoundary`.
|
|
190
|
+
`StepSandbox.layer` is the filesystem-backed one, `layerTest(initialFiles)` is
|
|
191
|
+
deterministic, and `layerNoop` fails closed for a host that cannot sandbox at
|
|
192
|
+
all, such as a browser.
|
|
193
|
+
|
|
194
|
+
## Related
|
|
195
|
+
|
|
196
|
+
- [Step boundaries](./step-boundaries.md): the declaration the transaction is
|
|
197
|
+
validated against.
|
|
198
|
+
- [Cache admission](./cache-admission.md): why the sandbox is what makes a
|
|
199
|
+
result shareable across runs.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Engine journal record names"
|
|
3
|
+
description: "The shared persisted event types and child-spawn kind used by engine writers and time-travel readers."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
[src/EventTypes.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/engine-store/src/EventTypes.ts)
|
|
7
|
+
|
|
8
|
+
Import `{ EventTypes }` from `@smthrs/engine-store/EventTypes` or the package
|
|
9
|
+
entry point. The object supplies the persisted record names shared by engine
|
|
10
|
+
writers and time-travel readers: `runDecision`, `attemptStarted`,
|
|
11
|
+
`snapshotIdentified`, `planRecorded`, `subgraphAppended`, `deferredCompleted`,
|
|
12
|
+
and `clockScheduled`. `childSpawnKind` identifies the effect inside a child-spawn
|
|
13
|
+
boundary. It is an effect kind, not a journal event type. Changing these values
|
|
14
|
+
requires migrating stored history.
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Back up and restore the store"
|
|
3
|
+
description: "Take a hot backup of a live engine database and its artifact blobs, verify it, restore it into a fresh directory, and fence the restored file so no pre-backup owner resurrects."
|
|
4
|
+
sidebar:
|
|
5
|
+
order: 7
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
`DisasterRecovery` captures a live store without stopping it, verifies a capture
|
|
9
|
+
against its own manifest, restores one into a fresh directory, and invalidates
|
|
10
|
+
the ownership fences the restored file still carries.
|
|
11
|
+
|
|
12
|
+
Back up the authoritative stores even when using the additive
|
|
13
|
+
[typed event contracts](https://journal.smithers.sh/concepts/state-event-authority/).
|
|
14
|
+
The demonstrated attempt projection rebuilds disclosed history, including from
|
|
15
|
+
a retained snapshot and suffix. It does not recover arbitrary private results,
|
|
16
|
+
all execution state, or live ownership fences. Current writers and retained
|
|
17
|
+
history keep their existing bytes until an explicit writer cutover and migration.
|
|
18
|
+
|
|
19
|
+
## Start from the reference script
|
|
20
|
+
|
|
21
|
+
A reference command-line entry point,
|
|
22
|
+
[`flows-backup.mjs`](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/engine-store/scripts/flows-backup.mjs),
|
|
23
|
+
is the operator front end these three operations were designed against. It is
|
|
24
|
+
not part of the published package, because the host layers are yours to choose:
|
|
25
|
+
copy it into your own project, or read the sections that follow and compose the
|
|
26
|
+
operations directly. It parses arguments and composes the Node host layers, and
|
|
27
|
+
nothing else. Once copied, it takes three commands:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
node flows-backup.mjs backup <database-file> <backup-directory> [objects-directory] [--max-file-size <bytes>]
|
|
31
|
+
node flows-backup.mjs verify <backup-directory> [--max-file-size <bytes>]
|
|
32
|
+
node flows-backup.mjs restore <backup-directory> <target-directory> [--max-file-size <bytes>]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`--max-file-size` sets `maxFileSizeBytes`, described below. Raise it when the
|
|
36
|
+
database file or a blob is larger than 512 MiB.
|
|
37
|
+
|
|
38
|
+
Its `restore` command calls `restoreAndFence`, so the restored file is fenced
|
|
39
|
+
before the command returns.
|
|
40
|
+
|
|
41
|
+
## Take a backup
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import * as NodeDatabase from "@smthrs/database/node/NodeDatabase"
|
|
45
|
+
import { DisasterRecovery } from "@smthrs/engine-store"
|
|
46
|
+
|
|
47
|
+
const capture = DisasterRecovery.backup({
|
|
48
|
+
directory: "./backups/2026-09-03",
|
|
49
|
+
objectsDirectory: "./.flows/objects",
|
|
50
|
+
snapshotDatabaseLayer: (databaseFile) => NodeDatabase.layer({ filename: databaseFile })
|
|
51
|
+
})
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The database is snapshotted first with `VACUUM INTO`, a read transaction under
|
|
55
|
+
WAL, so live writers are never blocked and the copy is one consistent point in
|
|
56
|
+
time. The artifact walk runs after it, so every digest the snapshot references
|
|
57
|
+
is captured, because publication always precedes reference. Blobs are
|
|
58
|
+
digest-verified as they are copied: a blob whose bytes no longer hash to its
|
|
59
|
+
address fails the backup loudly rather than capturing corruption. The manifest
|
|
60
|
+
is written last, so a partial backup is detectable by its absence. A failed
|
|
61
|
+
backup removes what it wrote, so you can retry into the same directory.
|
|
62
|
+
|
|
63
|
+
`snapshotDatabaseLayer` opens the frozen file so the backup can enumerate
|
|
64
|
+
artifact roots and migrations from that exact snapshot, independently of the
|
|
65
|
+
live connection. Open it without applying migrations.
|
|
66
|
+
|
|
67
|
+
**Pass `objectsDirectory` whenever the composition has a filesystem artifact
|
|
68
|
+
tier.** With it, the whole capture holds the cross-process artifact backup
|
|
69
|
+
lease, so a concurrent `ArtifactGc.gc` sweep cannot delete a blob between the
|
|
70
|
+
database snapshot and its copy. Without it, no lease is taken, the backup
|
|
71
|
+
carries no blobs, and a snapshot that references any artifact digest fails with
|
|
72
|
+
`snapshot_incomplete` rather than reporting success. Pass the same directory you
|
|
73
|
+
give `ArtifactStore.layerFileSystem`.
|
|
74
|
+
|
|
75
|
+
`FileSizeOptions.maxFileSizeBytes` bounds what backup, verify, and restore may
|
|
76
|
+
buffer for hashing or copying. It defaults to
|
|
77
|
+
`DisasterRecovery.defaultMaxFileSizeBytes`, which is 512 MiB. An oversized file
|
|
78
|
+
fails with the typed `io` code instead of reaching the host's allocation limit.
|
|
79
|
+
Each file is read whole into memory, so set the limit above your largest
|
|
80
|
+
database or blob and below the memory the host can spare.
|
|
81
|
+
|
|
82
|
+
## Verify a backup without restoring it
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
const check = DisasterRecovery.verify("./backups/2026-09-03")
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The manifest decodes, the database snapshot hashes to its recorded digest, and
|
|
89
|
+
every listed artifact blob is present and hashes to its address. Run it on a
|
|
90
|
+
schedule against your backup storage; a backup you have never read is a
|
|
91
|
+
hypothesis.
|
|
92
|
+
|
|
93
|
+
## Restore and fence
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
import { DurableWriter } from "@smthrs/database"
|
|
97
|
+
import * as Layer from "effect/Layer"
|
|
98
|
+
|
|
99
|
+
const restored = DisasterRecovery.restoreAndFence({
|
|
100
|
+
backupDirectory: "./backups/2026-09-03",
|
|
101
|
+
targetDirectory: "./.flows-restored",
|
|
102
|
+
databaseLayer: (databaseFile) =>
|
|
103
|
+
Layer.provideMerge(DurableWriter.layer(), NodeDatabase.layer({ filename: databaseFile }))
|
|
104
|
+
})
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Every byte is re-verified against the manifest as it is copied, so a backup that
|
|
108
|
+
rotted in storage is refused rather than restored. The target holds the database
|
|
109
|
+
file (`store.sqlite3`), an `objects` directory, and a `restored.json` marker, and
|
|
110
|
+
is a fresh store directory to compose `NodeDatabase.layer` and
|
|
111
|
+
`ArtifactStore.layerFileSystem` over.
|
|
112
|
+
|
|
113
|
+
`restore` alone leaves the pre-backup owner fences in place. Run
|
|
114
|
+
`DisasterRecovery.fence(manifest)` against the restored file before any engine
|
|
115
|
+
adopts it, or use `restoreAndFence`, which does both and returns a
|
|
116
|
+
`FencedRestoredStore`.
|
|
117
|
+
|
|
118
|
+
## What fencing does
|
|
119
|
+
|
|
120
|
+
The store's fence is `OwnerId` equality, so fence invalidation is the epoch
|
|
121
|
+
bump. In one serialized write transaction, every pending claim is cleared and
|
|
122
|
+
every run that was `running` at backup time is suspended with its owner and
|
|
123
|
+
heartbeat cleared. A surviving pre-backup owner then fails every fenced
|
|
124
|
+
operation against the restored store: `heartbeat` and `transitionOwned` report
|
|
125
|
+
`FenceLost`, and fenced journal appends fail `fence_lost`. The suspended runs
|
|
126
|
+
are claimable immediately, without waiting out the heartbeat staleness cutoff
|
|
127
|
+
and without liveness evidence.
|
|
128
|
+
|
|
129
|
+
`FenceSummary` reports `clearedClaims` and `suspendedRuns`.
|
|
130
|
+
|
|
131
|
+
Fencing requires every migration recorded in the manifest to remain applied
|
|
132
|
+
with the same ID and namespaced name. A missing or renamed historical entry
|
|
133
|
+
fails with `schema_mismatch` before ownership is cleared. Forward additions in
|
|
134
|
+
any installed block are compatible, including engine-store `3006` below an
|
|
135
|
+
existing plan `4003`. The current database layer applies migrations on open;
|
|
136
|
+
the manifest need not be a prefix of the globally ordered migration list.
|
|
137
|
+
|
|
138
|
+
In-flight attempt rows are deliberately untouched: attempt writes are fenced on
|
|
139
|
+
the run row's ownership, and the resuming engine adopts or retries them under
|
|
140
|
+
its own fresh owner.
|
|
141
|
+
|
|
142
|
+
## Failure codes
|
|
143
|
+
|
|
144
|
+
`DisasterRecoveryError` carries a stable `code` and the `method` that raised it:
|
|
145
|
+
|
|
146
|
+
| Code | Meaning |
|
|
147
|
+
| --------------------- | ------------------------------------------------------------- |
|
|
148
|
+
| `invalid_options` | An option cannot be admitted safely. |
|
|
149
|
+
| `not_empty` | A target or backup directory exists and is not empty. |
|
|
150
|
+
| `invalid_manifest` | The manifest is missing or does not decode. |
|
|
151
|
+
| `missing_file` | A file the manifest lists is absent. |
|
|
152
|
+
| `digest_mismatch` | The database snapshot does not hash to its recorded digest. |
|
|
153
|
+
| `artifact_corruption` | A blob does not hash to its address. |
|
|
154
|
+
| `snapshot_incomplete` | The snapshot references artifacts the capture could not take. |
|
|
155
|
+
| `schema_mismatch` | A recorded migration is missing or has a different name. |
|
|
156
|
+
| `io` | A host read or write refused, including an oversized file. |
|
|
157
|
+
| `sql` | The database refused; the dialect here is SQLite. |
|
|
158
|
+
|
|
159
|
+
## Related
|
|
160
|
+
|
|
161
|
+
- [Ownership and fencing](../concepts/ownership-and-fencing.md): why a restored
|
|
162
|
+
file needs a fence at all.
|
|
163
|
+
- [Collect unreferenced artifacts](./collect-unreferenced-artifacts.md): the
|
|
164
|
+
sweep the backup lease fences against.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Collect unreferenced artifacts"
|
|
3
|
+
description: "Run an explicit mark and sweep over the artifact store: the live roots, the grace bound, pinned digests, and why the collection is fail-safe rather than best-effort."
|
|
4
|
+
sidebar:
|
|
5
|
+
order: 6
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Boundary evidence spills large outputs to the artifact store by digest. When
|
|
9
|
+
the attempt rows and cache entries that referenced those blobs are deleted, the
|
|
10
|
+
blobs stay. `ArtifactGc` is the explicit pass that removes them.
|
|
11
|
+
|
|
12
|
+
Collection never runs automatically. `gc()` is a verb a caller invokes, and
|
|
13
|
+
[`smthrs gc`](/cli/gc) invokes it after its retention pass.
|
|
14
|
+
|
|
15
|
+
## Run a collection
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { ArtifactGc } from "@smthrs/engine-store"
|
|
19
|
+
import * as Effect from "effect/Effect"
|
|
20
|
+
|
|
21
|
+
const sweep = Effect.gen(function*() {
|
|
22
|
+
const gc = yield* ArtifactGc.ArtifactGc
|
|
23
|
+
return yield* gc.gc({ dryRun: true })
|
|
24
|
+
})
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`ArtifactGc.layer(options?)` provides the service and needs `SqlClient` and
|
|
28
|
+
[`@smthrs/artifacts`](/api/artifacts)'s `ArtifactSweep`.
|
|
29
|
+
`ArtifactGc.layerFileSystem(options?)` provides the filesystem sweep too and
|
|
30
|
+
needs `SqlClient` and `FileSystem`; give it the same `directory` and
|
|
31
|
+
`coordination` as the `ArtifactStore.layerFileSystem` it collects behind.
|
|
32
|
+
`MakeOptions.pageSize` sets how many rows one mark-phase page holds; it defaults
|
|
33
|
+
to 500.
|
|
34
|
+
|
|
35
|
+
`GcOptions` takes `graceMs`, `pins`, and `dryRun`. A `GcReport` comes back with
|
|
36
|
+
`scannedBlobs`, `liveDigests`, the `sweptDigests` list, `reclaimedBytes`,
|
|
37
|
+
`keptByGrace`, and the `dryRun` flag.
|
|
38
|
+
|
|
39
|
+
## Set the grace bound
|
|
40
|
+
|
|
41
|
+
`graceMs` is how recently a blob must have been written or freshened to survive
|
|
42
|
+
being unreferenced. It defaults to the installed policy's bound, then to
|
|
43
|
+
`ArtifactGc.defaultGraceMs`, which is 14 days, git's `gc.pruneExpire` default.
|
|
44
|
+
|
|
45
|
+
Each collection reads its start time before resolving policy pins or scanning
|
|
46
|
+
roots. The cutoff is `startTimeMs - graceMs` and stays fixed through inventory
|
|
47
|
+
and deletion. Only mtimes strictly before the cutoff are eligible; equality
|
|
48
|
+
is retained, including publications in the starting millisecond with zero
|
|
49
|
+
grace. The remove-side mtime fence uses the same cutoff, so a slow scan cannot
|
|
50
|
+
age a concurrent publication into eligibility.
|
|
51
|
+
|
|
52
|
+
The bound is deliberately far beyond any live attempt's duration. A blob spilled
|
|
53
|
+
by a running step is unreferenced until its attempt row finishes, and the grace
|
|
54
|
+
period is the only thing protecting it in that window.
|
|
55
|
+
|
|
56
|
+
## Install a policy
|
|
57
|
+
|
|
58
|
+
`ArtifactGcPolicy` carries the defaults a `gc()` call may omit. Explicit
|
|
59
|
+
`GcOptions` override the policy, and the policy overrides the built-in
|
|
60
|
+
defaults:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
const policy = ArtifactGc.layerPolicy({
|
|
64
|
+
graceMs: 7 * 24 * 60 * 60 * 1000,
|
|
65
|
+
pins: Effect.succeed([pinnedExportDigest])
|
|
66
|
+
})
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`pins` is the seam for references this composition's tables cannot see: an
|
|
70
|
+
external index, or an export a human wants kept. Each entry is a hex SHA-256
|
|
71
|
+
content address. It is an effect, resolved fresh on every collection, and its
|
|
72
|
+
digests are held live regardless of reachability.
|
|
73
|
+
Installing a policy configures collection; it never schedules it.
|
|
74
|
+
|
|
75
|
+
## What counts as a live root
|
|
76
|
+
|
|
77
|
+
The mark phase reads this package's own tables directly, because the package
|
|
78
|
+
composes every one of those migrations:
|
|
79
|
+
|
|
80
|
+
- Every row of `flows_step_cache`, through its boundary evidence.
|
|
81
|
+
- Every row of `flows_attempts`, through its boundary evidence and its
|
|
82
|
+
checkpoints. Digest-shaped strings in a checkpoint are retained
|
|
83
|
+
conservatively.
|
|
84
|
+
- The pins.
|
|
85
|
+
|
|
86
|
+
Every run present in `flows_runs` is a live root: there is no deleted state, and
|
|
87
|
+
the attempt table's foreign key guarantees each attempt's run exists, so the
|
|
88
|
+
scan is all attempt rows plus all cache entries, paged by primary key.
|
|
89
|
+
|
|
90
|
+
## The mark is fail-safe, not best-effort
|
|
91
|
+
|
|
92
|
+
A root row carrying boundary evidence this build cannot decode aborts the
|
|
93
|
+
collection with `mark_failed` rather than contributing nothing. Silently reading
|
|
94
|
+
such a row as "references no artifacts" is exactly how a live blob gets
|
|
95
|
+
collected. A metadata shape with no `boundary` key at all is the ordinary
|
|
96
|
+
foreign-evidence case, and yields the empty set.
|
|
97
|
+
|
|
98
|
+
## Why concurrent work is safe
|
|
99
|
+
|
|
100
|
+
The live set is computed before the inventory, so a root recorded during the
|
|
101
|
+
sweep can only be missed, never half seen. The blob such a root references is
|
|
102
|
+
protected anyway: a fresh publication carries a fresh mtime, a re-publication of
|
|
103
|
+
existing bytes freshens the blob's mtime, and the sweep's deletion is fenced on
|
|
104
|
+
that mtime. A crash mid-sweep deletes some garbage and no live blobs, and
|
|
105
|
+
re-running converges.
|
|
106
|
+
|
|
107
|
+
## Read the failures
|
|
108
|
+
|
|
109
|
+
`ArtifactGcError` carries one of three codes:
|
|
110
|
+
|
|
111
|
+
| Code | Meaning |
|
|
112
|
+
| ----------------- | -------------------------------------------------------------------------------------- |
|
|
113
|
+
| `invalid_options` | An option was outside its admissible range. |
|
|
114
|
+
| `mark_failed` | A root could not be scanned or its evidence could not be decoded. Nothing was deleted. |
|
|
115
|
+
| `sweep_failed` | The inventory or a deletion refused. |
|
|
116
|
+
|
|
117
|
+
## Order it after retention
|
|
118
|
+
|
|
119
|
+
Deleting run history removes roots; collecting artifacts removes the blobs
|
|
120
|
+
those roots kept alive. Run
|
|
121
|
+
[retention](./delete-old-run-history.md) first, then this pass, or the blobs
|
|
122
|
+
freed by retention wait for the next collection.
|
|
123
|
+
|
|
124
|
+
A backup taken while a collection runs would race the sweep. `DisasterRecovery`
|
|
125
|
+
takes the artifact backup lease for the whole capture when it is given an
|
|
126
|
+
`objectsDirectory`, so a concurrent sweep cannot delete a blob between the
|
|
127
|
+
database snapshot and its copy. See
|
|
128
|
+
[Back up and restore the store](./back-up-and-restore.md).
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Compose a durable engine"
|
|
3
|
+
description: "Wire EngineStore.layer: the services it requires, the ones it resolves optionally, what each option changes, and how to give engine bookkeeping its own repository."
|
|
4
|
+
sidebar:
|
|
5
|
+
order: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
`EngineStore.layer(options)` provides `FlowRuntime` and
|
|
9
|
+
`FlowEngine.SnapshotBoundary`. This guide covers what you have to provide
|
|
10
|
+
underneath it, what you may provide, and what each choice changes.
|
|
11
|
+
|
|
12
|
+
## Provide the required services
|
|
13
|
+
|
|
14
|
+
A composition failure is an unmet requirement in the layer's type, so a
|
|
15
|
+
composition that forgets one of these fails to compile. There is no run-time
|
|
16
|
+
composition error to handle.
|
|
17
|
+
|
|
18
|
+
| Service | From | Why |
|
|
19
|
+
| -------------------- | --------------------------------------- | -------------------------------------------------- |
|
|
20
|
+
| `Journal` | [`@smthrs/journal`](/api/journal) | Every engine decision is written here. |
|
|
21
|
+
| `RunStore` | [`@smthrs/run-store`](/api/run-store) | Run rows, claims, leases, cancellation. |
|
|
22
|
+
| `AttemptStore` | [`@smthrs/run-store`](/api/run-store) | Attempt rows. |
|
|
23
|
+
| `CacheStore` | [`@smthrs/step-cache`](/api/step-cache) | Recorded step results. |
|
|
24
|
+
| `DurableEngineState` | this package | Deferreds, clocks, waiting rows, the run DAG. |
|
|
25
|
+
| `OwnerIdentity` | this package | Mints the `OwnerId` this incarnation fences with. |
|
|
26
|
+
| `StepBoundary` | this package | Measures each step's declared read and write sets. |
|
|
27
|
+
| `Jj` | [`@smthrs/kernel`](/api/kernel) | Compensable snapshots for the snapshot boundary. |
|
|
28
|
+
| `Crypto` | `effect/Crypto` | Digests the step keys and mints the owner nonce. |
|
|
29
|
+
| `Scope` | `effect` | Registrations and active fibers are scoped. |
|
|
30
|
+
|
|
31
|
+
The [Quickstart](../quickstart.md) builds all of them over one SQLite file.
|
|
32
|
+
|
|
33
|
+
## Provide the optional services deliberately
|
|
34
|
+
|
|
35
|
+
Both halves of the isolated-execution lane are optional and are resolved at
|
|
36
|
+
composition time, because `actionExecute` runs on the engine's own fiber, which
|
|
37
|
+
does not carry the store's layer context. Anything a dispatch needs has to be
|
|
38
|
+
captured when the store is built and re-provided onto that fiber.
|
|
39
|
+
|
|
40
|
+
| Optional service | Absent | Present |
|
|
41
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
42
|
+
| `WorkspaceSandbox` | The body runs against the host directly; results stay run-local. | The body runs isolated, so evidence can claim the whole tree and results become shareable. |
|
|
43
|
+
| `EffectDispatcher` | The engine journals what a transaction queued and sends nothing. | Queued effects are dispatched after copy-back, deduplicated by idempotency key. |
|
|
44
|
+
| `StepSandbox` | No per-step isolated workspace is acquired. | Each step opens its own scoped workspace. |
|
|
45
|
+
| `WakeBus` | The composition builds a private bus. | Your own wake sources share one bus with the engine. |
|
|
46
|
+
| `ArtifactSync` | `makeLocal()`: publish is a no-op, hydrate reports nothing arrived. | Referenced blobs reach a shared tier before their cache entry does. |
|
|
47
|
+
| `CacheSync` | `makeLocal()`: a recorded entry is already everywhere it will be. | Durable local entries are published to a shared step-result tier. |
|
|
48
|
+
| `Inconsistency` | Conflicts are journaled and fail the dispatch (the strict default); provide `layerTolerant(owner)` to continue past them. | Cache conflicts and corrupt evidence are journaled. `layerStrict(owner)` fails; `layerTolerant(owner)` continues. |
|
|
49
|
+
| `Reconciliation` | Deviations and conflicts have no reader. | `layerDefault` answers them deterministically. |
|
|
50
|
+
| `Selection` | Everything is admitted. | Sinks may be deferred to a guess-free pass. |
|
|
51
|
+
|
|
52
|
+
## Set the options
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { EngineStore } from "@smthrs/engine-store"
|
|
56
|
+
import { Ownership } from "@smthrs/run-store"
|
|
57
|
+
|
|
58
|
+
const engine = EngineStore.layer({
|
|
59
|
+
owner: { hostId: "worker-a" },
|
|
60
|
+
journalSource: "worker-a-engine",
|
|
61
|
+
isAlive: Ownership.sameHostPidProbe
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`owner.hostId` is this engine's stable identity. Which host a store speaks for
|
|
66
|
+
is a composition decision, not a host fact, so the store asks you rather than
|
|
67
|
+
guessing.
|
|
68
|
+
|
|
69
|
+
`journalSource` is the source id every record this engine writes carries. Give
|
|
70
|
+
two engines over one database two different source ids so their records are
|
|
71
|
+
distinguishable.
|
|
72
|
+
|
|
73
|
+
`isAlive` decides whether a run whose lease expired may be stolen. Omit it and
|
|
74
|
+
the lease alone decides, which is enough to reclaim from a SIGKILL. Supply one
|
|
75
|
+
to refuse a takeover for longer. See
|
|
76
|
+
[Reclaim runs from a dead host](./reclaim-runs-from-a-dead-host.md).
|
|
77
|
+
|
|
78
|
+
`clockFireRetryPolicy` is the redispatch `Schedule` for a durable clock whose
|
|
79
|
+
fire failed. It defaults to exponential from 100ms capped at 30s, forever.
|
|
80
|
+
|
|
81
|
+
## Build the service instead of the layer
|
|
82
|
+
|
|
83
|
+
`EngineStore.make(options)` returns the `FlowRuntime` service itself, for a host
|
|
84
|
+
that composes it by hand rather than through a layer:
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
import * as Effect from "effect/Effect"
|
|
88
|
+
|
|
89
|
+
const runtime = Effect.gen(function*() {
|
|
90
|
+
const flowRuntime = yield* EngineStore.make({
|
|
91
|
+
owner: { hostId: "worker-a" },
|
|
92
|
+
journalSource: "worker-a-engine"
|
|
93
|
+
})
|
|
94
|
+
return flowRuntime
|
|
95
|
+
})
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`make` does not provide `FlowEngine.SnapshotBoundary`; `layer` does.
|
|
99
|
+
|
|
100
|
+
## Give engine bookkeeping a private repository
|
|
101
|
+
|
|
102
|
+
The engine uses `Jj` for two different purposes: the repository an action body
|
|
103
|
+
may reach, and the bookkeeping the snapshot boundary performs. A host that
|
|
104
|
+
guards action access wants those to be different services.
|
|
105
|
+
|
|
106
|
+
`EngineStore.layerWithPrivilegedJj(options, privilegedJj)` takes a second `Jj`
|
|
107
|
+
layer for engine bookkeeping and leaves the ambient `Jj` for action bodies:
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
const engine = EngineStore.layerWithPrivilegedJj(
|
|
111
|
+
{ owner: { hostId: "worker-a" }, journalSource: "worker-a-engine" },
|
|
112
|
+
privilegedJjLayer
|
|
113
|
+
)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Use `layer` when both roles may use the same repository access.
|
|
117
|
+
|
|
118
|
+
## Install the schema underneath
|
|
119
|
+
|
|
120
|
+
`Migrations.layer` runs journal, run store, step cache, this package's own
|
|
121
|
+
tables, and the plan store, in that order. It must complete before any durable
|
|
122
|
+
service is exposed, so provide it under the stores rather than beside them:
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import { DurableWriter } from "@smthrs/database"
|
|
126
|
+
import * as NodeDatabase from "@smthrs/database/node/NodeDatabase"
|
|
127
|
+
import { Migrations } from "@smthrs/engine-store"
|
|
128
|
+
import * as Layer from "effect/Layer"
|
|
129
|
+
|
|
130
|
+
const database = (filename: string) =>
|
|
131
|
+
Layer.provideMerge(
|
|
132
|
+
Migrations.layer,
|
|
133
|
+
Layer.provideMerge(DurableWriter.layer(), NodeDatabase.layer({ filename }))
|
|
134
|
+
)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The plan store's set comes last because its id block is the highest, and the
|
|
138
|
+
migrator decides what to run from a single high-water mark. See
|
|
139
|
+
[`@smthrs/database`](/api/database) for how namespaced sets compose without
|
|
140
|
+
colliding.
|
|
141
|
+
|
|
142
|
+
## Related
|
|
143
|
+
|
|
144
|
+
- [Quickstart](../quickstart.md): the whole composition, runnable.
|
|
145
|
+
- [Test against a durable store](./testing.md): the same composition with
|
|
146
|
+
`test/TestStores` doing the wiring.
|