Skip to content

feat: state machine - #115

Merged
Theauxm merged 5 commits into
mainfrom
feat/state-machine
Jul 31, 2026
Merged

feat: state machine#115
Theauxm merged 5 commits into
mainfrom
feat/state-machine

Conversation

@Theauxm

@Theauxm Theauxm commented Jul 31, 2026

Copy link
Copy Markdown
Member

No description provided.

Theauxm added 5 commits July 30, 2026 13:29
…-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.
@Theauxm
Theauxm merged commit 2ddce96 into main Jul 31, 2026
2 checks passed
@Theauxm
Theauxm deleted the feat/state-machine branch July 31, 2026 14:41
@github-actions

Copy link
Copy Markdown

This PR is included in version 1.44.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant