TLA PreCheck is a TypeScript DSL and compiler that lets you define state machines with formal verification via TLA+ model checking. Version 0.1.7, pre-release. It translates a single specification into a TLA+ spec for mathematical correctness proofs, a TypeScript interpreter for runtime, typed function bindings for development, and Postgres DDL for database constraint enforcement. Key differentiator: it proves the generated code and spec produce identical state graphs, catching invariant violations at build time. Targets developers building reliable distributed systems, agents, or workflow engines who want to replace scattered if/else guards with verifiable state machines. Requires Node.js 18+ and the TLA+ tools (TLC model checker).
npm install tla-precheckNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines a minimal state machine with one action, then shows how to generate code.
Pin to exact version and test upgrades.
Install tlaplus-community-tools from GitHub releases or via package manager.
Upgrade Node.js to 18+.
Manually run generated SQL files or integrate with migration tool.
Install tlaplus-community-tools and ensure 'tlc' binary is in PATH.
Ensure package.json has 'type': 'module' or run with --input-type=module.