Skip to content

feat(state-machine): declarative rule/reducer vocabulary + IR export - #122

Merged
Theauxm merged 2 commits into
mainfrom
feat/sm-declarative-ir-codegen
Aug 12, 2026
Merged

feat(state-machine): declarative rule/reducer vocabulary + IR export#122
Theauxm merged 2 commits into
mainfrom
feat/sm-declarative-ir-codegen

Conversation

@Theauxm

@Theauxm Theauxm commented Aug 12, 2026

Copy link
Copy Markdown
Member

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.

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.
…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.
@Theauxm
Theauxm merged commit 12d6af7 into main Aug 12, 2026
3 checks passed
@Theauxm
Theauxm deleted the feat/sm-declarative-ir-codegen branch August 12, 2026 15:00
@github-actions

Copy link
Copy Markdown

This PR is included in version 1.47.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