Repository navigation
Version Packages - #285
Open
github-actions[bot] wants to merge 1 commit into
Open
Version Packages#285github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
github-actions
Bot
force-pushed
the
changeset-release/main
branch
26 times, most recently
from
November 25, 2026 05:52
126df9f to
5ef513c
Compare
github-actions
Bot
force-pushed
the
changeset-release/main
branch
from
November 25, 2026 06:17
5ef513c to
07cf4a4
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@typeonce/effect-machine-devtools@0.48.0
Minor Changes
c2fb21b: Three names now say the same thing on every host. Behavior does not change.
Machine.EnqueueMachine.CommandsRuntimeSnapshotstatus"error""failed"type: "process"ofMachine.invocationDefinitionstype: "logic"MachineDocument.Invocationtype: "process"type: "logic"Machine.Commandsis the type of thecommandsargument of a transition, so the type now has the name of the value. A failed machine reads"failed"onLocalMachine,AtomMachine, andClusterMachine, asMachineFailedErrorand the rejection reason"MachineFailed"already did. Replacesnapshot.status === "error"withsnapshot.status === "failed". A local snapshot still carries theCause, and a Cluster snapshot the failure as text. A state that invokes aLogicis now listed as"logic", the name of the module, instead of"process". Export saved machine documents and static sites again.0a4ba8b: The keep-alive request of a
ClusterMachineis now held for as long as its work runs or its timers wait. It is not replaced periodically, so no crash can fall into the gap of a replacement.ClusterMachineneedseffect4.1.5 or later for this. Earlier versions answer the keep-alive request of a Cluster entity after about ten minutes, and a machine whose work runs longer would not come up again after a crash. The packages still accept every stableeffect4.x, so a project that usesClusterMachinehas to install 4.1.5 or later itself, together with matching@effect/*packages.937a477: Names that mean something else in Effect Workflow or Effect Cluster are renamed. Behavior does not change, but stored Cluster checkpoints need a migration.
An
Activityof Effect Workflow runs once and its result is recorded. The work a state invokes is not recorded, so it is now called an invocation everywhere:Machine.activityDefinitionsMachine.invocationDefinitionsMachine.Machine.ActivityDefinitionMachine.Machine.InvocationDefinitionInspection.ActivityInspection.ProgramInvocationInspection.ActivityStartedand its_tagInspection.ProgramInvocationStartedInspection.ActivityStoppedand its_tagInspection.ProgramInvocationStoppedactivityof both recordsinvocationInspection.Causation:{ _tag: "Activity", activitySessionId }{ _tag: "ProgramInvocation", invocationSessionId }MachineDocument.ActivityMachineDocument.InvocationMachineDocument.State:activityIdsinvocationIdsMachineDocument.MachineDocument:activitiesinvocations"<state>:activity:<n>"in a machine document"<state>:invocation:<n>"MachineDocument.schemaVersionis now4. Export saved documents and static sites again.A
MachineIdof Effect Cluster names the runner that generates an id. A checkpoint stores the id of a machine definition, and now says so:ClusterMachine.Checkpoint:machineIddefinitionIdClusterMachine.RejectionReason:"MachineIdMismatch""DefinitionIdMismatch"machineIdofClusterMachinedefinitionIdStop the instances of the previous version, then rename
machineIdtodefinitionIdin every stored checkpoint and keep its value. A checkpoint that still hasmachineIdis rejected as"DefinitionIdMismatch". Deploy clients together with runners: neither version decodes aRejectedreply, stored or sent, that has the other version's reason.Logic.Scopesat next to Effect'sScopein the same signatures and meant something else. The capabilities given toLogicare renamed:Logic.ScopeLogic.InitialContextLogic.ContextLogic.RunContextLogic.AddressLogic.EndpointChildAddresskeeps its name: it is the typed id a parent uses to reach a child, which is what an address is in Effect Cluster.Logic.Endpointis the object that sends to and stops a process.Patch Changes
@typeonce/effect-machine@0.48.0
Minor Changes
c2fb21b: Three names now say the same thing on every host. Behavior does not change.
Machine.EnqueueMachine.CommandsRuntimeSnapshotstatus"error""failed"type: "process"ofMachine.invocationDefinitionstype: "logic"MachineDocument.Invocationtype: "process"type: "logic"Machine.Commandsis the type of thecommandsargument of a transition, so the type now has the name of the value. A failed machine reads"failed"onLocalMachine,AtomMachine, andClusterMachine, asMachineFailedErrorand the rejection reason"MachineFailed"already did. Replacesnapshot.status === "error"withsnapshot.status === "failed". A local snapshot still carries theCause, and a Cluster snapshot the failure as text. A state that invokes aLogicis now listed as"logic", the name of the module, instead of"process". Export saved machine documents and static sites again.d3cfffd: Let work act on the child machines of its state on Cluster.
Machine.sendToandMachine.stopChildwith the descriptor of a child machine now require a new capability,Machine.ChildMachineRuntime, instead ofMachine.MachineRuntime.LocalMachine,AtomMachine, andClusterMachineprovide it, so a Cluster machine whose invoked work sends to the child of its state, or stops it, now compiles and runs.On Cluster, the work acts on the child that runs when it acts, through a persisted request saved outside the transaction of a step, and ignores a child that does not run, as a local host does.
Machine.spawn, andMachine.sendToandMachine.stopChildwith a child address, still requireMachine.MachineRuntime, which only a local host provides.Migration: a helper typed as requiring
Machine.MachineRuntimethat callsMachine.sendToorMachine.stopChildwith a child descriptor still compiles, but a type that expects the result of such a call to require exactlyMachine.MachineRuntimenow seesMachine.ChildMachineRuntime.LocalMachine.RequiredServicesremoves both.0879f49: Run child machines on Cluster.
ClusterMachine.makenow accepts a machine whose states invoke a child machine. Each child runs as an entity of its own, of typeType/childId, which the layer of the parent registers with the same version. Each activation of the state starts a new child,entityId/childId/revision. The step that enters the state saves the start of the child with its input, and the step that exits it saves its stop, both in the transaction of the step's checkpoint, so a child runs exactly while its state is stored.enqueue.sendTowith the descriptor of a child sends to the child that runs, and drops the event when none does. A child'sparentis the target of its parent. A child that ends tells its parent, which applies its output as the end of the invocation. A child that fails fails its parent, also when the parent declaresonFailure. A machine that fails or ends stops its children.A child is type checked as its own Cluster machine: a child that invokes a Stream or a
Logic, or requiresMachine.MachineRuntime, still makes its parent refused, and the error names what the child uses.New public types:
ClusterMachine.Checkpoint.Progress.Child,ClusterMachine.Checkpoint.Status.Stopped, and the"stopped"status of a read snapshot.joinof a stopped machine fails withMachineFailedError.Migration: machines now send to each other through a new
deliverrequest instead ofsend. Nobody waits for its answer, so the target treats it as a local machine treats an event sent to it: an event that the target cannot apply, such as one whose transition throws, now fails the target, where before it was rejected and dropped. Code that matches onCheckpoint.Statusor the read status must handleStoppedand"stopped".7011422: Give a Cluster parent the snapshots of its child machines.
A state that invokes a child machine with
onSnapshotnow runs on Cluster instead of being rejected asUnsupportedProcessLocal. Each step of the child that plans its initial state or takes a transition, and leaves it active, saves its encoded snapshot as a persisted request to its parent in the transaction of its checkpoint. The parent applies it once, as a snapshot of the invocation, while it runs that child. A transition on a snapshot that cannot be applied fails the parent. A child whose parent declares noonSnapshotfor it sends no snapshot.61f50c9:
ClusterMachine.makeno longer compiles for a machine that Cluster cannot run: one whose states invoke a Stream, aLogic, or a child machine, or whose work requiresMachine.MachineRuntime. These machines compiled before, and then rejected every request or failed while running. The error lists everything to replace:When the compiler refuses a machine, replace the listed work with an Effect or a timer, or run the machine with
LocalMachineorAtomMachine. A source that is registered and never invoked is accepted. Machines whose requirements areanyare still checked at run time only.The requirements of a machine,
Machine.Machine.Services, now say what its host must support. How a machine is written does not change, and neither does whatLocalMachineandAtomMachinerequire.Machine.InvocationSupport<"Stream" | "Logic" | "Child">is required once for each of these kinds that a state, or a child machine it invokes, invokes.Machine.MachineRuntimeis required only when the invoked work uses it, instead of by every machine that invokes work.Update a machine type that names
Machine.MachineRuntimein its requirements to match.LocalMachine.RequiredServicesremoves all of these requirements, so use it instead ofExclude<R, Machine.MachineRuntime>.06cbe55: Expose Cluster
Entitytuning options,shardGrouprouting, and a transactionalonCommithook onClusterMachine.ClusterMachine.makenow accepts an optionalshardGroup?: (entityId: EntityId) => stringoption, annotating both the entity and any invoked child entities withClusterSchema.ShardGroup.ClusterMachine.toLayernow acceptsLayerOptions<M, RE, RC>, forwarding Effect Cluster'sEntity.toLayeroptions (maxIdleTime,concurrency,mailboxCapacity,mailboxMetrics,disableFatalDefects,defectRetryPolicy,spanAttributes) to the entity and its children.LayerOptions.onCommitandCommitEvent<M>, which run inside the sameMessageStoragetransaction immediately after each checkpoint commit (active, done, or failed) so SQL read-model projections and audit tables commit or roll back atomically with the checkpoint.0cb797e:
ClusterMachineruns the effects invoked by active states. An entity starts the work once the state that owns it is stored, applies the result as a step of its own, and is kept alive while work should run. After a crash, Cluster brings the entity up on another runner without a request, and the work of the stored state starts again.Work runs at least once and must be safe to repeat. Input mappers run again on recovery, with
Machine.InitialEvent, and results are never stored: only the state they lead to is. Work that ends in a way the model does not handle fails the machine. The failure is stored with the last state, and later requests are rejected with the new reason"MachineFailed". Streams, process logic, and child machines are still rejected.To migrate a
Storageimplementation, renameloadtoloadForRequest, add aload(address)that returns only the checkpoint, and deduplicate only requests incommit:Checkpoint.requestIdis nowCheckpoint.origin, andCheckpoint.statusis new. Give checkpoints stored before this changeorigin: { _tag: "Request", requestId }andstatus: { _tag: "Active", invocations: {} }. A checkpoint loaded without a status is rejected as"InvalidCheckpoint".0a4ba8b: The keep-alive request of a
ClusterMachineis now held for as long as its work runs or its timers wait. It is not replaced periodically, so no crash can fall into the gap of a replacement.ClusterMachineneedseffect4.1.5 or later for this. Earlier versions answer the keep-alive request of a Cluster entity after about ten minutes, and a machine whose work runs longer would not come up again after a crash. The packages still accept every stableeffect4.x, so a project that usesClusterMachinehas to install 4.1.5 or later itself, together with matching@effect/*packages.0dd0880:
ClusterMachinekeeps one live machine instance in memory per active entity. The checkpoint is loaded and decoded once, not for every request, and storage remains the truth: memory is loaded again after a failure, a passivation, or a conflict. A request redelivered to a live entity can run its resolvers again before storage recognizes it, so resolvers must stay free of effects.ClusterMachine.Checkpointhas a newrevision, andStorage.commitmust refuse a stale write with the newCommitResult.RevisionConflict. This stops an entity that lost its shard from overwriting a newer checkpoint. A conflicted request is applied once more to the stored state, and then rejected with the new reason"RevisionConflict".To migrate a
Storageimplementation, persistcheckpoint.revision, and letcommitreturnDuplicatefirst, thenRevisionConflictunless the revision is exactly one more than the stored one, where no stored checkpoint counts as0.Give checkpoints stored before this change revision
1. A checkpoint loaded without a positive integer revision is rejected as"InvalidCheckpoint". Stop instances of the previous version before migrating, because they neither assign nor check revisions.8765c7b: Add
ClusterMachine.Client, a client for one Cluster machine that takes whatsendof a local reference takes. Create it from the adapter, asEntity.clientdoes:It accepts events built by the constructors of
Machine.events, which the raw entity client refused. An event that its schema refuses is rejected as"InvalidEvent"before it is sent, and the machine goes on, instead of a defect in the caller. Rejections, including those of the machine, fail the effect withClusterMachine.Rejected, now a yieldable error; Cluster failures such as a full mailbox areClusterMachine.ClientErrors.ClusterMachine.RejectionReasongains"InvalidEvent".5867725: Add
ClusterMachineProxyto@typeonce/effect-machine/clusterto exposeClusterMachineadapters over anyeffect/rpctransport, including Web Workers,SharedWorker, Node worker threads, WebSockets, and HTTP.When a Cluster runner and its SQL database live in another thread or process — such as a browser Web Worker running
SingleRunnerwithSqlMachineStorage— callers on the main thread have neitherShardingnorClusterMachine.Storage.ClusterMachineProxyderives prefixedsend,snapshot, andchangesRPCs and gives callers a typedClusterMachineProxy.Clientwithsend,snapshot,changes, andjoin:Compose multiple Cluster machines onto one worker or server with
ClusterMachineProxy.toRpcGroup(A).merge(ClusterMachineProxy.toRpcGroup(B))andClusterMachineProxy.layerHandlers.52bb1cd: Support
enqueue.stop(Child)in synchronous transitions and per-entity startup input viaclient.start(...input)onClusterMachineandClusterMachineProxy.enqueue.stop(Child)with aChildMachinedescriptor now stops the running child entity in the same transaction as the parent checkpoint, settles its invocation progress so it does not restart while its state remains active, and ignores a child that is not running. Passing a localChildAddressstill rejects asUnsupportedProcessLocal.ClusterMachine.ClientandClusterMachineProxy.Clientnow exposestart(...input)(andClusterMachineProxy.toRpcGroupadds${Type}.start), allowing each entity instance to be initialized with its own schema-validated input or to commit its initial state before receiving an event.ClusterMachine.makenow accepts omitting the static defaultinputfor machines that declareinput, requiringclient.start(input)before sending events (or continuing to auto-start onsendwhen a default input is supplied), and enforces that declaredinputschemas have JSON-compatible encoded representations.587a086:
ClusterMachineruns the timers invoked by active states. The step that enters a state stores when its timers are due, and the entity is kept alive until they fire. An entity that comes up again, on any runner, waits only for the time that remains, and fires a timer whose time has passed at once.LocalMachine.resumestill starts the full duration again.The duration of a timer is evaluated after its step is planned and before the step is stored. A redelivered request can evaluate it again, so input mappers and timer sources must stay free of effects. An entity stays in memory while a timer waits, however long that is. Streams, process logic, and child machines are still rejected.
A
Storageimplementation needs no change as long as it storesCheckpointwhole: due times are instatus.invocations, andorigincan be the new{ _tag: "Timers" }, whichcommittreats as any origin that is not a request. Checkpoints stored before this change need nothing beyondstatus: { _tag: "Active", invocations: {} }. A state that was stored before the machine declared one of its timers is given a due time when its entity comes up. A state stored with a timer the machine no longer declares is rejected as"InvalidCheckpoint", so migrate it.500fefd: Let Cluster machines send to each other.
ClusterMachine.makereturns an adapter withtarget(entityId), aClusterMachine.Targetthat names the entity of that machine by its type and id, as Cluster addresses it. On Cluster,selfis the target of the machine's own entity.An event that a step sends with
enqueue.sendTois saved as a persisted request to the target in theMessageStoragetransaction of the step's checkpoint, so it is sent only when the step is stored, and the target applies it once. Work sends withsendof a target, through the client of the target. The event is checked against the input events of the target at compile time.Migration: work that read
self.sessionIdor calledself.sendfailed the machine before. It now reads the address of the entity,Type/entityId, and sends to the entity. A step that sends to a target that is not aClusterMachine.Target, such as a child, andenqueue.stop, are still rejected asUnsupportedProcessLocal.2f691d4: Store Cluster machines durably in SQL with
SqlMachineStorage, from@typeonce/effect-machine/cluster.It provides
ClusterMachine.Storageover theSqlClientthatSqlMessageStorageuses. A step of a machine runs in the transaction ofMessageStorage, and its commit joins it, so the checkpoint, the events the step emits, and the reply are stored together or not at all.layer,layerWith, andmakerun the migrations, which create<prefix>_checkpointsand<prefix>_requests(prefixcluster_machineby default).layerMigrationsandlayerStorageseparate migrating from running. PostgreSQL and SQLite are supported.ClusterMachine.checkStoragechecks that aStorageof your own keeps the contract machines rely on: fields stored unchanged,DuplicatebeforeRevisionConflictbeforeCommitted, nothing written by a rejected commit, commits without a request never duplicates, entities kept apart, one winner between concurrent commits, and, given thewithTransactionofMessageStorage, rollback with it. It fails withClusterMachine.StorageCheckFailure, naming the scenario.17fb064: A state that picks its work by a condition, such as
invoke: { src: ready ? "load" : "wait" }, now carries the requirements of every source it can pick. Before, the choice resolved to nothing, so its services and the kinds of work that not every host runs were dropped from the machine's type.Some machines now require a service they were silently missing, and
ClusterMachine.makenow refuses at compile time a machine whose state can pick a Stream, logic, or a child machine by a condition, instead of failing when that work starts.3bc5fa1: The machine model and its in-memory host are now separate modules.
Machinedeclares, plans, and encodes a machine, and depends on no host. The newLocalMachineruns it in memory, next toAtomMachineandClusterMachine. How a machine is written and how it runs do not change.Import
LocalMachinefrom@typeonce/effect-machineand replace the moved names:Machine.start,Machine.prepare, andMachine.resumeareLocalMachine.start,LocalMachine.prepare, andLocalMachine.resume.Machine.PreparedandMachine.InspectionareLocalMachine.PreparedandLocalMachine.Inspection.Machine.ExecutionServicesisLocalMachine.RequiredServices.Machine.MachineRefnow promises only what every host's reference provides. Processing an event in the sender's turn is documented as a guarantee ofLocalMachine.start. The service behindMachine.MachineRuntimecontains onlyspawn,sendTo, andstopChild, and child descriptors hold only an id and a machine.3f8a5bb: Let a Cluster machine leave memory while a long timer waits.
A timer that waits longer than
DurableClock.InMemoryThreshold(one minute by default, as for workflow sleeps) no longer keeps its entity alive. The step that stores its due time also saves, in the sameMessageStoragetransaction, a message to the entity that Cluster delivers at that time throughDeliverAt. The entity may be passivated, and the message brings it back when the timer is due, on whichever runner owns it then. The path, id, and due time of the timer name the message, so the message of a wait that ended is ignored, and saving it twice is a duplicate. A timer that never ends saves no message and keeps nothing alive. A long wait stored by an earlier version gets its message the next time its entity comes up. Shorter timers stay in memory as before. The checkpoint format is unchanged.A long timer of an entity that left memory fires up to one
entityMessagePollIntervalafter it is due.4154f9e: Read a Cluster machine from outside its entity.
A
ClusterMachine.Clientnow hassnapshot,changes, andjoin, as a local reference does. They read the machine fromClusterMachine.Storageand never ask the entity, so a read works from any process that reaches the store, whichever runner owns the entity, and whether or not it is in memory. Reading does not wake the entity or keep it alive.ClusterMachine.Snapshotisactive,donewith the output, orfailedwith the text of the failure, each with its revision. The view is narrower than a localMachineRef: reads see committed checkpoints only,changesreads again after eachreadInterval(a new option ofClusterMachine.make, one second by default) and may skip checkpoints committed between two reads, a failure is text rather than aCause, and there is nostoppedstatus.Reads require
ClusterMachine.Storage. A checkpoint of another definition or version, or one the machine cannot hold, fails the read withClusterMachine.ReadError.1f967e4: The types of
LocalMachine,AtomMachine, andClusterMachinenow say only what can happen. Transitions, actions, and initial states are synchronous, so the types that described effects inside them are removed. Runtime behavior does not change.Most were always
never, so delete the mention:Machine.ActionError,Machine.ActionServices, andMachine.ActionRequirement. ReplaceMachine.PlanningServices<R>withR.Machine.Machine.InitialErrorandMachine.Machine.InitialServices, with theInitialEandInitialRtype parameters ofMachine.Machine,Machine.Definition,Machine.make, and every API generic over a machine. Delete the seventh and eighth type arguments of a written-outMachine.Machine<...>, and the fourth and fifth ofMachine.Definition<...>.EandRtype parameters ofMachine.Machine.HandlerContext,HandlerResult,InitialResult, andStateActionResult, and theRequirementstype parameter ofMachineTest.Microstep. Delete these arguments. AHandlerContextthat still passesnever, nevercompiles with another meaning.The others described values that no API produces or accepts:
Machine.RuntimeandMachine.Runtime.Requirement. Handlers raise and emit events withMachine.Commands.Machine.Machine.AnyStateConfig,StateConfig,ChoiceStateConfig, andEventHandlerMap. UseMachine.Machine.StateHandler.Machine.Machine.InvokeOwnedandInvokeSource. UseMachine.Machine.Invocation.Machine.Machine.EventTransitionReturn,EventHandlerReturn,AlwaysReturn,DoneReturn,ChoiceReturn, andInvokeOutcomeReturn. They have no replacement.LocalMachine.RequiredServices<R>, which replacesMachine.ExecutionServices<R>, only removes the requirements that a local machine provides. The errors of a machine whose requirements areanyare listed exactly instead of asunknown.937a477: Names that mean something else in Effect Workflow or Effect Cluster are renamed. Behavior does not change, but stored Cluster checkpoints need a migration.
An
Activityof Effect Workflow runs once and its result is recorded. The work a state invokes is not recorded, so it is now called an invocation everywhere:Machine.activityDefinitionsMachine.invocationDefinitionsMachine.Machine.ActivityDefinitionMachine.Machine.InvocationDefinitionInspection.ActivityInspection.ProgramInvocationInspection.ActivityStartedand its_tagInspection.ProgramInvocationStartedInspection.ActivityStoppedand its_tagInspection.ProgramInvocationStoppedactivityof both recordsinvocationInspection.Causation:{ _tag: "Activity", activitySessionId }{ _tag: "ProgramInvocation", invocationSessionId }MachineDocument.ActivityMachineDocument.InvocationMachineDocument.State:activityIdsinvocationIdsMachineDocument.MachineDocument:activitiesinvocations"<state>:activity:<n>"in a machine document"<state>:invocation:<n>"MachineDocument.schemaVersionis now4. Export saved documents and static sites again.A
MachineIdof Effect Cluster names the runner that generates an id. A checkpoint stores the id of a machine definition, and now says so:ClusterMachine.Checkpoint:machineIddefinitionIdClusterMachine.RejectionReason:"MachineIdMismatch""DefinitionIdMismatch"machineIdofClusterMachinedefinitionIdStop the instances of the previous version, then rename
machineIdtodefinitionIdin every stored checkpoint and keep its value. A checkpoint that still hasmachineIdis rejected as"DefinitionIdMismatch". Deploy clients together with runners: neither version decodes aRejectedreply, stored or sent, that has the other version's reason.Logic.Scopesat next to Effect'sScopein the same signatures and meant something else. The capabilities given toLogicare renamed:Logic.ScopeLogic.InitialContextLogic.ContextLogic.RunContextLogic.AddressLogic.EndpointChildAddresskeeps its name: it is the typed id a parent uses to reach a child, which is what an address is in Effect Cluster.Logic.Endpointis the object that sends to and stops a process.ed66256: Each run of invoked work now owns its own
ScopeonLocalMachineandAtomMachine, as it already did onClusterMachine. The scope closes when the work ends or its state is left, so resources acquired withEffect.acquireReleaseorEffect.addFinalizerare released with the run instead of piling up until the machine stops.An Effect and a Stream get a new scope for every run. Logic gets one from its
initialthrough the end of itsrun. A timer acquires nothing, and a child machine's own work follows the same rule.1935ee9: Add
Machine.InvocationEvent, the lifecycle event of a step caused by invoked work. When the output, typed failure, stream element, or child snapshot of an invocation leads to a transition, theentry,exit,always, and input-mapper callbacks of that step receive it as theirevent. It names the invoking state and invocation and what was reported:Machine.Machine.LifecycleEventnow includesMachine.InvocationEvent, so code that treated every event other thanInitialEventas a declared event must also handle it. Before, such callbacks received an undocumented internal object. A machine restarted byClusterMachinepassesInitialEventto the input mapper of restarted work.Patch Changes
ClusterMachine.makeunder the module's path, as its other identifiers are:~effect/cluster/ClusterMachine/UnsupportedProcessLocaland~effect/cluster/ClusterMachine/NonJsonEncoded, instead of~effect/ClusterMachine/....ClusterMachinerefuses Streams andLogic: their progress lives only in memory, so work that Cluster runs again after a crash or a move would apply elements twice or lose a process's state. The docs ofMachine.InvocationSupportnow say that Cluster runs child machines, and the modeling guide namesMachine.ChildMachineRuntime.Entity.KeepAliveHandler. A machine whose work runs or whose timer waits now callsEntity.keepAlivewhenever the host supports it through a handler or through the latch of aShardingrunner, instead of only through the latch. Before, such a host logged that it could not keep the machine alive, and its work was not recovered after a crash.@typeonce/effect-machine-react@0.48.0
Minor Changes
0a4ba8b: The keep-alive request of a
ClusterMachineis now held for as long as its work runs or its timers wait. It is not replaced periodically, so no crash can fall into the gap of a replacement.ClusterMachineneedseffect4.1.5 or later for this. Earlier versions answer the keep-alive request of a Cluster entity after about ten minutes, and a machine whose work runs longer would not come up again after a crash. The packages still accept every stableeffect4.x, so a project that usesClusterMachinehas to install 4.1.5 or later itself, together with matching@effect/*packages.Patch Changes
@typeonce/oxlint-plugin-effect-machine@0.48.0
No changes in this release.