Delivered:
machine()builder with full fluent API- Guards and actions as constrained JS functions
- TypeScript generics for type-safe context
- AST/IR representation (MachineAST)
- JS → TLA+ compiler (tokenizer, parser, code generator)
- TLA+ spec generation from MachineAST
- TLC integration with auto-download
- Structured VerifyResult with violation traces
- 74 unit tests
Delivered:
concurrent()builder with.instances(),.shared(),.interaction()- Multi-process TLA+ generation with indexed variables
- Fairness conditions (weak/strong)
- Tests with worker pool spec
Delivered:
- BFS-based coverage strategy (covers all transitions)
- Violation strategy (extracts TLC counterexamples)
- JSON trace serialization/deserialization
- Targeted path finding for hard-to-reach transitions
Delivered:
stateproof()Vitest pluginstateproofCLI with check, generate, mermaid, diff subcommands- CI-friendly output
Delivered:
generateRuntimeCode()— standalone TypeScript from specscreateRuntime()— executable state machinesdiffSpecs()— spec comparisontoMermaidStateDiagram()— state diagramsviolationToMermaidSequence()— counterexample diagramstraceToMermaidSequence()— trace diagrams
The compilation pipeline is specified using stateproof itself:
- CompilationPipeline spec with 7 states, 8 transitions, 2 invariants
- Tests verify the spec, TLA+ generation, runtime, and test generation