TLA+ Model Check
SkillAI & modelsRun TLA+ model checker on thread dispatch spec. Triggers: "run tla", "check tla", "model check", "verify threads", "tla+", "check dispatch".
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the TLA+ Model Check skill
What this skill tells your AI
The instructions your AI receives, as published by joelreymont/pz in .claude/skills/tla/SKILL.md and read by ahel’s review.
Run TLC on docs/tla/ThreadDispatch.tla to verify thread dispatch invariants.
When to Run
- After modifying thread dispatch, file ownership, join/cancel, or budget logic in EPISODES-PLAN.md
- After changing Thread/Episode data model
- After modifying any resolved decision that affects concurrency
Command
/opt/homebrew/opt/openjdk/bin/java -XX:+UseParallelGC \
-cp ~/tools/tla2tools.jar tlc2.TLC \
docs/tla/ThreadDispatch.tla \
-config docs/tla/ThreadDispatch.cfg \
-workers auto
Run from project root. Expected: ~3-4M states, <3 minutes, exit code 0.
Interpreting Results
- No errors, exit 0: all invariants and temporal properties hold.
- Deadlock reached: a state has no successor. Check if it's a valid terminal state (orch_state="done", round=MaxRounds) or a real bug.
- Invariant violated: TLC prints the violating state trace. Read the trace to find which property broke and in which state transition.
- Temporal property violated: liveness failure — a thread never completes, join never terminates, or cancel never propagates. The counterexample trace shows the lasso (cycle).
Updating the Spec
When the episodes plan changes:
- Update
ThreadDispatch.tlato match new design decisions - Run TLC to verify
- If state space explodes (>10M states or >5 min), reduce constants in
.cfg(fewer threads/files/rounds) — the properties are symmetry-invariant
Verified Properties
Safety (invariants):
FileOwnershipDisjoint: no two concurrent threads share filesBudgetNonNegative: no thread overspendsGlobalBudgetNonNegative: total budget never negativeToolMaskValid: no privilege escalationDepthOneEnforced: no sub-thread spawningFileLocksConsistent: locks match ownershipEpisodesFromCompleted: episodes only from done/failed threadsJoinCompleteness: orchestrator done only after all episodes collected
Liveness (temporal):
ThreadProgress: running threads eventually completeJoinTermination: join always terminatesCancelResponsiveness: aborted threads eventually fail
Signals
- GitHub stars
- 95
- Forks
- 8
- Last commit
- Apr 2026
Advanced
- Catalog kind
- skill
- Gateway key
tla- Source
- github.com/joelreymont/pz