Skip to main content

Protocol specifications as Python code

Project description

Wunderspec

Wunderspec

PyPI Lint Build Run Examples Convert to TLA+

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
Wunderspec Flower

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.134.1
  • Source commit: c9ee963d884f34db1ae946b8dec869d9c7a80c76

See tests/README.md for the development test log captured at release time.

5. Latest Release Notes

Changes since public release v0.132.2.

  • When an @example property is checked but no witness state is found, run, check, fuzz, replay, with-tlc, and with-apalache now report the outcome as warning: No examples found … (previously the misleading success: …) and exit with the dedicated code 3. The exit-code scheme is now 0 = clean / no predicate, 1 = invariant violation, 2 = example found, 3 = example not found. Invariant checks are unaffected: holding an invariant is still success / exit 0.
  • Add per-action profiling to wunderspec run and check. By default they now print a compact fired/tried (pct%) table, sorted by action name, counting how many times each non-inline (@action(inline=False)) action was entered (tried) and completed without violating an assumption (fired). Actions whose fire rate is at or near 0% are highlighted in red when color is enabled. Pass --no-action-profiling to disable the accumulation and the table.
  • Improve wunderspec run trace coverage on specifications whose actions depend on hard-to-hit guards. Add --max-retries-per-step (default 30): the per-trace retry budget is --max-retries-per-step × --max-steps, and a trace is cut only when it reaches --max-steps or exhausts that budget. The earlier consecutive-failure cutoff, which abandoned still-progressing traces too early, has been removed. run now also prints Trace length statistics: max=…, min=…, average=… at the end.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wunderspec-0.134.1.tar.gz (4.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wunderspec-0.134.1-py3-none-any.whl (263.5 kB view details)

Uploaded Python 3

File details

Details for the file wunderspec-0.134.1.tar.gz.

File metadata

  • Download URL: wunderspec-0.134.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

Hashes for wunderspec-0.134.1.tar.gz
Algorithm Hash digest
SHA256 ba1d25ee85e898567c888b4c5bdf30b1bca9f3323b755d192fd28f3fd21107b8
MD5 6e887d6186ba181412dafe9ab56559f0
BLAKE2b-256 1322afd3f55788c6d0d3a69e28b299a382b42e66c66352dbc3259983c43c2eb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for wunderspec-0.134.1.tar.gz:

Publisher: publish.yml on wunderspec/wunderspec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wunderspec-0.134.1-py3-none-any.whl.

File metadata

  • Download URL: wunderspec-0.134.1-py3-none-any.whl
  • Upload date:
  • Size: 263.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wunderspec-0.134.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab9ffe72d6d8e33321a267d46e19cd972db77c2af204c90e306aa61e53559a2d
MD5 4c1b837759527aba4b22c3272442361a
BLAKE2b-256 a1478f30b3e539d330404c994f1c12fa64e6ecd53bbc81c2f0f3333260a900ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for wunderspec-0.134.1-py3-none-any.whl:

Publisher: publish.yml on wunderspec/wunderspec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page