Protocol specifications as Python code
Project description
Wunderspec
Wunderspec is a Python DSL for writing and checking executable specifications.
Distributed systems often fail due to unforeseen issues: message reordering, race condition, stale observations, retry behavior, crashes and restarts, network outages, vibe code. Adding more example tests is often not enough to find these bugs before they make it to production. Specifications written in Wunderspec surface these issues early, so that teams find design flaws before they become production incidents.
This is the open-core distribution.
:clipboard: Wunderspec in 5 minutes: the Wunderspec in Five Minutes gives you a quick overview of the core concepts.
:clipboard: Cheatsheet: the Wunderspec cheatsheet summarizes the DSL and CLI in a few pages — keep it open while you work.
:bulb: Using Quint? Try this command:
uv tool install wunderspec wunderspec convert --from=spec.qnt --to=spec.py --main=main
1. Wunderspec in Action
Follow Bob in his Wunderspec adventure. There, Bob writes a specification of a write-ahead log, finds a bug, replays the counterexample and fixes the specification.
2. Installation
Using uv:
uv tool install wunderspec
After installation, the CLI is available:
wunderspec --help
If you want to add Wunderspec as a dependency, just type:
uv add wunderspec
uv sync
3. Features
This open-core package includes the features marked ✅ in the Open Core column. Premium-only command names stay visible for discoverability, but those commands are not included in this package.
| Feature | Open Core | Premium |
|---|---|---|
| Symbolic expression evaluator | ✅ | ✅ |
wunderspec lint |
✅ | ✅ |
wunderspec run |
✅ | ✅ |
wunderspec replay |
✅ | ✅ |
wunderspec convert |
✅ | ✅ |
wunderspec check |
✅ | ✅ |
wunderspec with-tlc |
✅ | ✅ |
wunderspec with-apalache |
✅ | ✅ |
wunderspec fuzz |
❌ | ✅ |
wunderspec rust |
❌ | ✅ |
wunderspec lean |
❌ | ✅ |
4. Release Provenance
- Release tag:
v0.136.1 - Source commit:
6ef37ade3f08676708e0127d20ba14e313abbbb2
See tests/README.md for the development test log captured at release time.
5. Latest Release Notes
Changes since public release v0.134.1.
- Add
--coverage NAMEtowunderspec with-apalache, passing the generated TLA+ operator for the selected@coveragefunction as--view=<Oper>forcheckandsimulate. - Allow
wunderspec with-apalache --max-steps 0to check initial states. - Write Apalache output to an
apalache.logfile while it runs, report the log path, and add--verboseto stream the log to the terminal immediately. - Require
default=...for collection-formMaxandMin, e.g.Max(s, default=0). The default is the reduce seed, so empty collections no longer need a separate size guard orCHOOSE-based seed. - Render collection-form
MaxandMinreducers as TLAPS-friendlyCHOOSEexpressions in generated TLA+ while keeping reducer-based interpreter evaluation. - Add TLA+ labels to
wunderspec convertoutput for@invariantand@exampleoperators, including nested predicate calls by default. Use@invariant(inline=True)or@example(inline=True)to inline nested predicate calls instead. - Preserve definition docstrings when converting Wunderspec to TLA+ by emitting
them as
\*comments immediately before the generated operator definitions. - Allow generator-form
Forall,Exists,SetIf,Set, andMapcalls to passname=for readable TLA+ binder names while preserving internal unique binder identities. - Short-circuit interpreter evaluation of
Implies(False, rhs), so the right side is not evaluated when the antecedent is false. - Add
MaxandMinbuiltins. They take either several integers (Max(a, b, c)) or a single set or list of integers (Max(s)). Both are syntactic sugar — the multi-argument form expands to nestedIteand the collection form folds withreduce— so they work in the interpreter, TLC, and Apalache.Max(s)/Min(s)over an empty collection are undefined and raise, mirroringCHOOSEover an empty set; guard withIte(s.size == 0, default, Max(s))when you need a fallback.
6. License
Wunderspec is distributed under the Functional Source License, Version 1.1, with an Apache 2.0 future license (FSL-1.1-ALv2). See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wunderspec-0.136.1.tar.gz.
File metadata
- Download URL: wunderspec-0.136.1.tar.gz
- Upload date:
- Size: 4.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f30980b5bbe619269ad9f387526c87d127c8c56047812dfdca0cc74cf5b6cae3
|
|
| MD5 |
6053040eb611c5cf69865ab5c3bcc087
|
|
| BLAKE2b-256 |
97d4b43eecc40945980d485bf72ba7a5a23dd275cb61704730cc94259b3ac968
|
Provenance
The following attestation bundles were made for wunderspec-0.136.1.tar.gz:
Publisher:
publish.yml on wunderspec/wunderspec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wunderspec-0.136.1.tar.gz -
Subject digest:
f30980b5bbe619269ad9f387526c87d127c8c56047812dfdca0cc74cf5b6cae3 - Sigstore transparency entry: 2067555134
- Sigstore integration time:
-
Permalink:
wunderspec/wunderspec@9d701c9fe08ffa018ae68cd01b5c24b66a9e2290 -
Branch / Tag:
refs/tags/v0.136.1 - Owner: https://github.com/wunderspec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9d701c9fe08ffa018ae68cd01b5c24b66a9e2290 -
Trigger Event:
push
-
Statement type:
File details
Details for the file wunderspec-0.136.1-py3-none-any.whl.
File metadata
- Download URL: wunderspec-0.136.1-py3-none-any.whl
- Upload date:
- Size: 270.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ca7b9718964a0adf794eda4cbc19a017a1893e647c98c8deb4bcd1edd1916c7
|
|
| MD5 |
9b5f6ee7d6b7f4a9b1c3f717016ed427
|
|
| BLAKE2b-256 |
33267c1c03d65676064446fc506d6ee9d994bb38739b8df13e0c40263d216897
|
Provenance
The following attestation bundles were made for wunderspec-0.136.1-py3-none-any.whl:
Publisher:
publish.yml on wunderspec/wunderspec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wunderspec-0.136.1-py3-none-any.whl -
Subject digest:
9ca7b9718964a0adf794eda4cbc19a017a1893e647c98c8deb4bcd1edd1916c7 - Sigstore transparency entry: 2067555263
- Sigstore integration time:
-
Permalink:
wunderspec/wunderspec@9d701c9fe08ffa018ae68cd01b5c24b66a9e2290 -
Branch / Tag:
refs/tags/v0.136.1 - Owner: https://github.com/wunderspec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9d701c9fe08ffa018ae68cd01b5c24b66a9e2290 -
Trigger Event:
push
-
Statement type: