Skip to content

feat(pstack): run the statechart skill's TLC with tla-ts in Node - #1151

Open
aidenybai wants to merge 1 commit into
cursor:mainfrom
aidenybai:statechart-tla-ts
Open

aidenybai wants to merge 1 commit into
cursor:mainfrom
aidenybai:statechart-tla-ts

Conversation

@aidenybai

@aidenybai aidenybai commented Nov 1, 2026 •

Copy link
Copy Markdown

Why

Statechart needs Java and mise to check a spec. To repro: on a machine without mise, unset JAVA and TLA2TOOLS, then run scripts/statechart on any spec. It fails with "Cannot find TLC: mise install failed".

This PR runs TLC with tla-ts instead, which reproduces TLC 1.7.4 in Node. Checks also take about half as long.

This started from poteto's original tweet.

What changed

By default, the skill installs tla-ts with npx and runs it in place of Java. Setting JAVA or TLA2TOOLS still runs Java, and so does a failed npx install.

Blast Radius

The first run still needs the network (for npx instead of mise). The skill installs the latest tla-ts, so a tla-ts release can change its output.

The npx lookup needs a POSIX shell, so #1147 (Windows) would need another lookup. #1017 edits the same lines of findTlc.

Speed

Spec States Java tla-ts
Checkout 17 3.02 s 1.24 s
Big 1,681 2.44 s 1.13 s
Huge 100,000 2.35 s 1.15 s

These are medians of 5 runs with tla-ts cached. A first run with an empty npm cache took 1.4 s.

Verification

All 63 corpus and edge-case specs give identical output with Java and tla-ts (exit status, stdout, stderr, chart, report, and TLC output). A fake java on PATH was never called.

The pstack suite passes except the symlink launcher test, which also fails on main on macOS.

The skill runs TLC with tla-ts through npx by default, so it needs neither
Java nor mise. tla-ts reproduces TLC 1.7.4 without its jar. JAVA or
TLA2TOOLS still runs TLC with Java, and so does a failed npx install.
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