feat(state-machine): declarative rule/reducer vocabulary + IR export - #122
Merged
Conversation
Machines can be authored as data instead of anonymous delegates: guards and validators as Rule records, reducers as Reduction records, and per-state context schemas reflected from C# records. RuleEvaluator/ReductionEvaluator run that data through the existing engine, so behaviour is identical to the delegate path (both overloads coexist on the fluent builder). A declaratively authored machine exports a canonical IR via IrExporter that the TypeScript runtime interprets, so the hand-written frontend twin goes away. Renames the IEffect port to ISnapshotEffect so it stops reading like the core Trax.Effect abstractions; the exactly-once send binding is otherwise unchanged.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…N branches Adds the branches Codecov flagged on the new declarative layer: the \b \f \r short string escapes in the canonical writer, an out-of-range CompareOp (a total reject, not a throw), an object-typed schema field, and reflecting a complex property to object plus a nullable value type. The lines that stay uncovered are exhaustiveness guards on the closed (private-constructor) rule/reduction unions and JSON kinds that cannot occur, unreachable by construction.
|
This PR is included in version 1.47.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.
Machines can be authored as data instead of anonymous delegates: guards and validators as Rule records, reducers as Reduction records, and per-state context schemas reflected from C# records. RuleEvaluator/ReductionEvaluator run that data through the existing engine, so behaviour is identical to the delegate path (both overloads coexist on the fluent builder). A declaratively authored machine exports a canonical IR via IrExporter that the TypeScript runtime interprets, so the hand-written frontend twin goes away.
Renames the IEffect port to ISnapshotEffect so it stops reading like the core Trax.Effect abstractions; the exactly-once send binding is otherwise unchanged.