[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116153":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":17,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":9,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":13,"lastSyncTime":27,"discoverSource":28},116153,"everystate","mattzcarey\u002Feverystate","mattzcarey","lightening fast, formal verification engine",null,"Rust",204,13,2,5,0,65,17,69.94,"MIT License",false,"main",[],"2026-11-19 07:11:49","2026-11-22 12:11:16","# everystate\n\nA TLA+ model checker with no Java dependency, written in Rust. It reads ordinary `.tla` specs and\nTLC `.cfg` files, checks every reachable state, and reports results in TLC's format.\n\n```text\n> use everystate's formal verification skill to find race conditions in my amazing software\n\n⏺ Write(Store.tla)\n  \u002F\u002F ... models load() and save() from store.ts\n\n⏺ Bash(npx everystate Store.tla)\n\n  Error: Invariant NoLostUpdates is violated.\n  State 2: \u003CLoad(\"a\")>   a read 0\n  State 3: \u003CLoad(\"b\")>   b read 0\n  State 4: \u003CSave(\"a\")>   memory = 1\n  State 5: \u003CSave(\"b\")>   memory = 1\n\n⏺ Found a race. Two overlapping requests both load before either saves,\n  so one update is lost. Fix: make load-and-save atomic.\n```\n\n(Condensed. The spec is [`examples\u002FStore.tla`](examples\u002FStore.tla); the skill is\n[`skills\u002Fformal-verification`](skills\u002Fformal-verification\u002FSKILL.md).)\n\n- Safety and liveness checking, fairness, symmetry, `VIEW`, `ALIAS`.\n- TLC-compatible text output, exit codes, `-tool` framing and `-dump`.\n- Random simulation (`-simulate`) for models too large to enumerate, with seeded, reproducible runs.\n- Trace conformance (`everystate conform`): check a log of the real system against the spec.\n- Parallel search (`-workers N`) with results identical to one worker.\n- A PlusCal translator (`everystate pcal`) with the Java translator's output, byte for byte.\n- The standard and community modules are built in.\n- One native binary, or WebAssembly for Node, Bun and workers.\n\n## Install\n\n```sh\nnpm install -g everystate     # prebuilt binary for Linux, macOS and Windows\nbrew install mattzcarey\u002Ftap\u002Feverystate\ncargo install everystate      # or build from source\n```\n\n## Example\n\n`examples\u002FCounter.tla`:\n\n```tla\n---- MODULE Counter ----\nEXTENDS Naturals\nVARIABLE n\n\nInit == n = 0\nNext == n \u003C 5 \u002F\\ n' = n + 1\nSpec == Init \u002F\\ [][Next]_n\n\nTypeOK   == n \\in 0..5\nNeverFour == n \u002F= 4\n====\n```\n\n`examples\u002FCounter.cfg`:\n\n```\nSPECIFICATION Spec\nINVARIANT TypeOK\nINVARIANT NeverFour\nCHECK_DEADLOCK FALSE\n```\n\n```sh\neverystate examples\u002FCounter.tla\n```\n\n```\nError: Invariant NeverFour is violated.\nError: The behavior up to this point is:\nState 1: \u003CInitial predicate>\nn = 0\n\nState 2: \u003CNext line 6, col 9 to line 6, col 27 of module Counter>\nn = 1\n...\nState 5: \u003CNext line 6, col 9 to line 6, col 27 of module Counter>\nn = 4\n\n5 states generated, 5 distinct states found, 0 states left on queue.\n```\n\nExit status is 12, as with TLC.\n\n### For scripts and agents\n\n```sh\neverystate -json examples\u002FCounter.tla\n```\n\n```json\n{\"status\":\"invariant\",\"name\":\"NeverFour\",\"generated\":5,\"distinct\":5,\"queue\":0,\"depth\":5,\n \"trace\":[{\"action\":null,\"state\":{\"n\":\"0\"}},{\"action\":\"Next\",\"state\":{\"n\":\"1\"}}, ...]}\n```\n\n### From JavaScript (WebAssembly)\n\nThe npm package also exports the engine compiled to WebAssembly:\n\n```ts\nimport { check } from 'everystate';\n\nconst { result } = check({\n  root: 'Counter',\n  modules: { Counter: tlaSource },\n  config: 'SPECIFICATION Spec\\nINVARIANT NeverFour\\nCHECK_DEADLOCK FALSE',\n});\nresult.status;   \u002F\u002F 'invariant'\nresult.name;     \u002F\u002F 'NeverFour'\n```\n\n`checkAsync` runs the same check in a worker with a large stack, for deeply recursive specs.\nThe WebAssembly build is about 2x slower than native and cannot use the file-based community\noperators.\n\n## Multiple workers\n\n`-workers N` (or `-workers auto`, one per core) searches on N threads in the native binary. State\ncounts, depth, verdict and the counterexample are the same as with one worker. Operators whose\neffect depends on exploration order (`Print`, `TLCSet`\u002F`TLCGet` registers, `RandomElement`,\nIOUtils, ...) are evaluated by the sequential search; if they occur repeatedly the run continues\nwith one worker and says so. Liveness checking, simulation and `conform` run on one thread, and\nthe WebAssembly build is single-threaded.\n\n## Simulation\n\nWhen a model is too large to enumerate, `everystate -simulate num=10000 Spec.tla` generates random\nbehaviours of up to `-depth` steps (default 100) and checks invariants, action properties, deadlock\nand temporal properties on each, printing TLC's simulation output. A pass means only that no\ngenerated behaviour violates a property. Without `num=` it runs until it finds an error, as TLC\ndoes; with `-json` it stops after 1000 behaviours. Every run prints its seed; pass it back with\n`-seed` to repeat the run exactly. From JavaScript:\n`check({ root, modules, config, simulate: { traces: 10000, seed: 1 } })`.\n\nTwo differences from TLC: a deadlock is reported only for a state with no successor (TLC's\nsimulator also reports one when a `CONSTRAINT` excludes every successor), and a state predicate\ngiven as `PROPERTY` is checked on the initial states (TLC's simulator skips it). Random choices\ndiffer from Java TLC's, so the same seed gives a different run there.\n\n## PlusCal\n\n`everystate pcal` translates the PlusCal algorithm in a module with the output of the Java\ntranslator (`pcal.trans` 1.12): the same TLA+, layout and checksums, the same `.old` backup and\n`.cfg` handling, the same options (`-wf`, `-sf`, `-wfNext`, `-nof`, `-termination`, `-label`,\n`-labelRoot`, `-lineWidth`, ... and the `PlusCal options (...)` line), in p-syntax and c-syntax.\n\n```tla\n---- MODULE Transfer ----\nEXTENDS Naturals, TLC\n\n(* --algorithm transfer\nvariables alice = 10, bob = 10, money \\in 1..20;\nbegin\n  Withdraw: alice := alice - money;\n  Deposit:  bob := bob + money;\n  Check:    assert alice >= 0;\nend algorithm *)\n====\n```\n\n```sh\neverystate pcal Transfer.tla     # writes the translation into Transfer.tla, and Transfer.cfg\neverystate Transfer.tla          # \"Failure of assertion at line 9, column 13.\"\n```\n\nWhen a module is model-checked and its algorithm or translation no longer matches the checksums\nin the `\\* BEGIN TRANSLATION` line, everystate prints TLC's warning; `everystate pcal --check\nFile.tla` reports the same without checking a model. From JavaScript,\n`translatePlusCal(source, options)` translates the text of a module. `-spec` and `-myspec` are not\nsupported. `npm run conformance:pcal` compares the translator with the Java one.\n\n## Check the code against the model\n\nA pass verifies the model. To check that the running code behaves like it, log what the code does\nand ask whether that run is a behaviour of the spec:\n\n```sh\neverystate conform -trace run.jsonl Charge.tla\n```\n\n```\n{\"state\": {\"sent\": 0, \"charges\": 0}}\n{\"action\": \"Send\", \"state\": {\"sent\": 1}}\n{\"action\": \"Handle\", \"state\": {\"charges\": 2}}\n```\n\nEach line is a step: optionally the action, and whichever variables the code knows. The report\nnames the first line the spec does not allow, what it expected, and which steps were possible\nthere. Exit status 0 conforms, 20 does not (21 bad trace, 22 limit reached). `-hidden N` allows\nunlogged steps, `-stutter` snapshots, `-behavior` prints a full matching behaviour, `-json`\nstructured output. From JavaScript: `conform({ root, modules, config, trace })`. Details are in\nthe [skill](skills\u002Fformal-verification\u002FSKILL.md).\n\n## Agent skill\n\n[`skills\u002Fformal-verification`](skills\u002Fformal-verification\u002FSKILL.md) teaches a coding agent to\nmodel-check a design with everystate: choose the promise, model the steps, run the check, see it\nfail, report the counterexample in the code's words. It comes with a worked example\n(`example\u002FCharge.tla`). Copy the folder into your agent's skills directory, for example\n`.claude\u002Fskills\u002F`.\n\n## Options\n\n```\neverystate [options] SPEC[.tla]\n  -config FILE     configuration file (default: SPEC.cfg)\n  -deadlock        do not check for deadlock\n  -json            one JSON result object\n  -tool            TLC's machine-readable message framing\n  -dump dot,actionlabels FILE   write the state graph\n```\n\nExit status: 0 success, 10 assumption, 11 deadlock, 12 safety, 13 liveness, 150 parse error,\n151 config error.\n\nEnvironment: actions and invariants are compiled before the search, and a cache of local steps\nreuses work between states that agree on what a step reads (a fixed-size table, 32 MB per worker,\n`EVERYSTATE_STEP_CACHE_MB`; used only where it measures faster during the run). Results are the\nsame either way. `EVERYSTATE_STEP_CACHE=off` turns the cache off; `EVERYSTATE_EVAL=tree` uses the\ntree-walking interpreter alone.\n\n## How it is checked\n\nReal TLC is the reference (details in [CONFORMANCE.md](CONFORMANCE.md)):\n\n- [tlaplus\u002FExamples](https:\u002F\u002Fgithub.com\u002Ftlaplus\u002FExamples), models up to 5 s: 122 of 122 match on\n  result and exact state counts.\n- TLC's own `test-model` suite, run side by side with `tla2tools.jar`: 383 of 414 match.\n- pstack `statechart` corpus: 33 of 33 outputs byte-identical.\n\nFaster than single-worker Java TLC on all 12 benchmark models (1.3x to 5.7x), with near-instant\nstart-up: [BENCHMARK.md](BENCHMARK.md).\n\n## Not supported\n\nDisk-backed state storage (everything is in memory, so a few\nmillion distinct states is the practical limit), Java module overrides, labels and subexpression selectors, and TLAPS proof checking (proofs\nare parsed and skipped).\n\n## Development\n\n```sh\nnpm run build      # native binary and wasm\u002Feverystate.wasm\nnpm test           # WASM API, pretty-printer and community-module tests\n```\n\nReleases use [changesets](.changeset\u002FREADME.md): add one with `npx changeset` in your pull request,\nthen merge the \"Version Packages\" pull request that appears. That bumps `package.json` and\n`Cargo.toml`, and `.github\u002Fworkflows\u002Frelease.yml` builds the binaries and publishes to npm and\ncrates.io (trusted publishing, no tokens).\n\nAn earlier pure-TypeScript engine is in the git history at commit `e8c67ce` (npm `everystate@0.1.0`).\n\n## License\n\nMIT\n","everystate 是一个用 Rust 编写的轻量级、高性能 TLA+ 模型检查器，用于对并发与分布式系统进行形式化验证。它完全兼容 TLC 的输入（.tla 规约和 .cfg 配置），支持安全性\u002F活性检查、公平性、对称约简、VIEW\u002FALIAS 优化，并提供 TLC 格式输出、JSON 接口、随机仿真、日志符合性验证及并行状态搜索。无需 Java 运行时，单二进制可跨平台运行，也支持 WebAssembly 嵌入。适用于协议设计、微服务一致性建模、数据库事务逻辑验证等需严格保障正确性的系统工程场景。","2026-11-24 04:52:58","CREATED_QUERY"]