Skip to main content

Deterministic Scenario Engine

Generate test scenarios, not just test records.

Deterministic Scenario Engine (DSE) creates reproducible, state-consistent business histories and deterministic scenario suites with ground truth for testing. The source-tree distribution version is 2.2.0. Distribution release identity and deterministic compatibility identity are separate: ENGINE_VERSION remains 1.0.0 and DSL version remains 1. For authoritative public-release availability and history, see PyPI and GitHub Releases.

Why it exists

Fake-data libraries and random record generators produce values; fixtures often describe isolated records. Scenario Engine executes histories: each committed step sees a consistent state, produces traceable state changes and artifacts, and advances an explicit logical clock. The same scenario and execution context can be replayed byte-for-byte, while invariants, controlled faults, and an oracle make expected behavior explicit.

Core capabilities

  • DSL 1 parsing, compilation, and deterministic execution
  • addressed randomness and logical IDs that do not depend on a shared stream
  • current state plus append-only committed history and artifacts
  • whole-step atomicity
  • explicit external inputs, resource DAG resolution, validators, and constraints
  • subflows, ordered branches, and bounded repeat
  • invariants, deterministic fault injection, provenance, and oracle evaluation
  • canonical result bytes and a ReproducibilityManifest for exact replay
  • an explicit, versioned plugin boundary and a reference ecommerce plugin pack
  • a JSON-file adapter
  • optional pytest, SQLAlchemy Core, Hypothesis, and Schemathesis integrations
  • secure, explicit local-file composition with namespaced modules
  • ordered Cartesian matrices with stable case IDs and original indexes
  • immutable ordered batch plans and worker-independent results
  • structured, redacted inspect/explain evidence and typed RFC 6901 semantic diff
  • validated scenario-definition structural diff with canonical semantic addresses
  • self-contained, deterministic offline HTML trace views of local result evidence
  • scenario CLI for local and CI workflows, including bounded local evidence export, verification, and lossless migration
  • explicit immutable Domain Pack registries and pure Oracle Assertions
  • canonical evidence bundles, ordered JSON/JSONL export, compatibility reports, explicit adapters, closed lossless migrations, and fixture-directory export

Release 2.2.0 adds first-class run → replay artifacts and fail-closed replay diagnostics, actionable human and machine-readable errors, author-time scaffolding, scenario-definition diff, conservative impact analysis, offline trace views, and an installed compatibility-fixture export. See the 2.2.0 release notes.

Core execution does not require a database, network service, plugin, or property testing framework. See security assumptions and non-goals. Neither Phase 2 nor Phase 3 adds hidden discovery, network, randomness, wall-clock, or ambient environment semantics. The historical Phase 2 contract is frozen in the Phase 2 public contract; the additive evidence surface is frozen in the Phase 3 public contract.

Installation

Supported Python versions are 3.11, 3.12, 3.13, and 3.14.

Install the published package and use its scenario entry point:

python3 -m pip install deterministic-scenario-engine
scenario --help

Install only the named optional integrations you need:

python3 -m pip install 'deterministic-scenario-engine[pytest]'
python3 -m pip install 'deterministic-scenario-engine[sqlalchemy]'
python3 -m pip install 'deterministic-scenario-engine[hypothesis]'
python3 -m pip install 'deterministic-scenario-engine[schemathesis]'

Installing the current checkout with python3 -m pip install . is a source-development-only alternative.

Minimal quickstart

The canonical installed-package workflows start by creating a complete portable DSL file under /tmp/dse-demo; they do not require a source checkout or files from this repository. The guide covers validate, run → replay, inspect/explain, both diff commands, conservative impact analysis, export → verify, the static trace viewer, scaffold → validate, and the human/machine diagnostic contract.

Determinism contract

Generation derives from semantic ExecutionAddress values, not consumption of a mutable global random stream. Exact replay requires the same canonical scenario, explicit inputs, algorithms/plugins, and recorded execution context. Unsupported cross-version replay fails explicitly. See the determinism model, reproducibility guide, and normative compatibility contract.

The installed public compatibility corpus can be discovered with scenario --help and exported without a source checkout using scenario compatibility-fixtures export --out /absolute/path.

Canonical command workflows

Use the quickstart as the single canonical workflow document. In particular, scenario diff compares execution artifacts, while scenario diff-definition structurally compares validated scenario definitions. scenario impact is a separate, conservative static may-impact analysis. scenario trace-view creates one self-contained offline HTML file from supported result/evidence.

Documentation

Status

Distribution release identity and deterministic engine compatibility are separate contracts. This source tree reports distribution version 2.2.0; generated core manifests retain ENGINE_VERSION 1.0.0 and DSL 1. PyPI and GitHub Releases are the authoritative sources for public-release availability and history. The project is licensed under Apache-2.0.

Metadata

Release files for deterministic-scenario-engine 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deterministic-scenario-engine 2.2.0
File Size Uploaded Provenance Actions
deterministic_scenario_engine-2.2.0.tar.gz 337.1 kB Without provenance Details for deterministic_scenario_engine-2.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for deterministic-scenario-engine 2.2.0
File Interpreter ABI Platform Actions
deterministic_scenario_engine-2.2.0-py3-none-any.whl Python 3 none any Details for deterministic_scenario_engine-2.2.0-py3-none-any.whl

Total release size: 538.6 kB

Release files / deterministic_scenario_engine-2.2.0.tar.gz

Download URL deterministic_scenario_engine-2.2.0.tar.gz
Size 337.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4b0d87bdbaf6b64a012800d9ec316ec9a7cde42c4aa5707cf58461e513107199
BLAKE2b-256 checksum
How to use checksums
5899396370f75159fd04d83e1820aa2bda338cdefb971288bcebd585f1301bb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / deterministic_scenario_engine-2.2.0-py3-none-any.whl

Download URL deterministic_scenario_engine-2.2.0-py3-none-any.whl
Size 201.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7fe8e5b8abd1250d480f759e86a3725526cf02a9f1e18a9b160eddcf3fd8fa57
BLAKE2b-256 checksum
How to use checksums
54fa83e60ccb542a186ec8a9a9e19e60ffbec6fcbb7a17c349b4df81b21356c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for deterministic-scenario-engine 2.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page