feat: state machine - #115
Merged
Merged
Conversation
…-once effects Trax.Effect.StateMachine is a pure, total snapshot state-machine engine — the C# half of a cross-language contract where snapshots are language-neutral JSON, illegal (state, context) pairs are unrepresentable, and guards/reducers are named code rather than serialized expressions. Every operation returns a typed result and never throws. Trax.Effect.StateMachine.Persistence adds a user-scoped jsonb store with app-managed optimistic concurrency, the FE-drives/BE-validates draft service (fast + guarded committed-state autosave, idempotent advance replay), and a generic exactly-once effect primitive: claim the intent before the effect, with a lease + fence token and a reclaim sweeper so a dead runner can't wedge a key and a revived one can't double-complete. SnapshotEffectRunner wires it so N concurrent sends deliver once and a crash-retry replays the receipt. Verified against real Postgres, including the exact concurrency counts and a fault-injection test for effect-ran-but-state-never-committed. The demo turnstile mutation trains live in the test project, out of any production-scanned assembly.
… guard branch) A 3-state, guard-branched checkout machine (Cart -> Review -> Paid) over a multi-key context, mirrored in C# and TypeScript and driven by one shared fixture set. This is the case the turnstile can't exercise: multi-key canonicalization (RFC 8785 ordinal key sort) is now proven on both engines via a shared wire-handoff, and the guarded Pay branch agrees across languages.
Fluent Machine authoring, generic stateMachine GraphQL mutations behind a machine registry, snapshot persistence with a lease and fence exactly-once effect runner, AddTraxStateMachines discovery, and a gated stress suite. Also adds a dependency-direction guard to the Meta suite.
Fluent Machine authoring, generic stateMachine GraphQL mutations behind a machine registry, snapshot persistence with a lease and fence exactly-once effect runner, AddTraxStateMachines discovery, and a gated stress suite. Also adds a dependency-direction guard to the Meta suite.
|
This PR is included in version 1.44.0 |
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.
No description provided.