Skip to main content

Stochology (stochology)

PyPI version Python versions License: MIT

The Theory and Ethics of Aim for judgment and decision-making under structural uncertainty when action must precede the outcome.

stochology provides high-performance Python bindings (via PyO3 and pure Rust) to the core mathematical operators, sequential agent–world–institution simulation environments, and empirical verification laboratories of the Stochology framework.


The Nuclear Triad of Aim

Stochology organizes judgment under uncertainty into three non-substitutable safeguards:

$$M_{\mathrm{Leontief}} = \min(S_{\mathrm{epi}},, S_{\mathrm{vital}},, S_{\mathrm{gov}})$$

  1. Filter I · Epistemic Margin ($S_{\mathrm{epi}}$) (stochology.epistemic): Manski–Lee partial identification bounds, Meng big-data paradox ($\rho_{R,Y}$), cluster design effects ($\mathrm{DEFF}$), multiverse analysis, and agnotology detection.
  2. Filter II · Vital Margin ($S_{\mathrm{vital}}$) (stochology.vital): Hill heavy-tail index ($\alpha$), Jensen shortfall ($\Delta_J$), Kingman queueing basin, and non-ergodic survival criteria ($\mathrm{TTS}{\mathrm{survival}} \ge \mathrm{TTR}{\mathrm{recovery}}$).
  3. Filter III · Institutional Governance ($S_{\mathrm{gov}}$) (stochology.governance): Goodhart performativity audits, CRPS decompositions, verifiable temporal commitments (TemporalVault), and algedonic channel verification.

Removing any single axis triggers structural collapse (Collapse Propositions 1, 2, and 3).


Installation

pip install stochology

For interactive Jupyter notebook laboratories with visualization support:

pip install "stochology[notebooks]"

Quickstart

import stochology as st

# 1. Simulate the Sequential Agent-World-Institution Loop
env = st.engine.CommunityReserveEnv(seed=2026)
print(f"Initial reserve: {env.reserve}")

# 2. Access canonical operators and indicators
lab5 = st.labs.chapter(5)
print(f"Danish fire tail index (Hill alpha): {lab5['danish_tail_alpha']:.4f}")

# 3. Test triadic integrity and collapse propositions
agent = st.engine.StochologicalAgent()
report = agent.evaluate_integrity()
print(f"Triadic status: {report.status}")

Architectural Invariants

  1. Pure Rust Foundation: The underlying mathematical core (crates/stochology and crates/stochology-cli) is implemented in pure Rust (std only, zero external dependencies) with deterministic SplitMix64 pseudo-random generators (DEFAULT_SEED = 2026).
  2. Deterministic & Bitwise Replicable: Notebooks and laboratory scripts carry zero wall-clock reads and zero network access, guaranteeing bit-for-bit reproducibility.
  3. Sealed Datasets: stochology.datasets reads sealed empirical datasets validated against cryptographic SHA256SUMS manifests.

Layout & Local Development

When working directly within the source repository:

src/
├── Cargo.toml                standalone crate `stochology-py` (_core cdylib)
├── pyproject.toml            maturin configuration
├── rust/                     PyO3 bindings to Rust core
├── stochology/               public Python surface & typed stubs (py.typed)
├── tests/                    pytest parity and contract verification suite
└── scripts/run_notebooks.py  headless execution gate for notebooks/

Development Setup

uv sync --directory src
uv run --directory src maturin develop --release
uv run --directory src pytest

Full gate from repository root:

./scripts/verify.sh --with-python

Metadata

Release files for stochology 0.1.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 stochology 0.1.0
File Size Uploaded Provenance Actions
stochology-0.1.0.tar.gz 418.6 kB Without provenance Details for stochology-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for stochology 0.1.0
File Actions
stochology-0.1.0-cp313-abi3-win_amd64.whl CPython 3.13 abi3 Windows x86-64 Details for stochology-0.1.0-cp313-abi3-win_amd64.whl
stochology-0.1.0-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.13 abi3 Linux glibc 2.17+ x86-64 Details for stochology-0.1.0-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
stochology-0.1.0-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.13 abi3 Linux glibc 2.17+ ARM64 Details for stochology-0.1.0-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
stochology-0.1.0-cp313-abi3-macosx_11_0_arm64.whl CPython 3.13 abi3 macOS 11.0+ ARM64 Details for stochology-0.1.0-cp313-abi3-macosx_11_0_arm64.whl
stochology-0.1.0-cp313-abi3-macosx_10_12_x86_64.whl CPython 3.13 abi3 macOS 10.12+ x86-64 Details for stochology-0.1.0-cp313-abi3-macosx_10_12_x86_64.whl

Total release size: 3.7 MB

Release files / stochology-0.1.0.tar.gz

Download URL stochology-0.1.0.tar.gz
Size 418.6 kB
Tags Source
SHA-256 checksum
How to use checksums
956eccda03b476bda9f94e0fd69bc51cf6fc2c8ee6ceeb05dc1c07ec3c4e6b76
BLAKE2b-256 checksum
How to use checksums
f8e7523f484f02e03888e792bbf6a4db967f2f3b7ce051deaec15d29f08bc1fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / stochology-0.1.0-cp313-abi3-win_amd64.whl

Download URL stochology-0.1.0-cp313-abi3-win_amd64.whl
Size 627.8 kB
Tags CPython 3.13 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b203cafd9078bd99bffb80a2c4531b73927db361c2892900f76d39062fddbc6c
BLAKE2b-256 checksum
How to use checksums
65677cbab87c56b39aefb0ab4e6f63fac380718dff66a57bcee0f725579965c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / stochology-0.1.0-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL stochology-0.1.0-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 690.2 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
0b00cbb7aa07591abe13c65576ba8a199c76bb01ef48485376c00b70df434686
BLAKE2b-256 checksum
How to use checksums
683d19cedcff6c1f31aa96bff4fba93d8715327c4176773ebff24f2b9d0e7644
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / stochology-0.1.0-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL stochology-0.1.0-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 640.3 kB
Tags CPython 3.13 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
f1914069f045d382131ada2ac3a06301ef77369523fd56f707d5199b038b6fc7
BLAKE2b-256 checksum
How to use checksums
6c876128514af89e03cf495dc2b4b53012b1372196330bf41ee094aca23718fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / stochology-0.1.0-cp313-abi3-macosx_11_0_arm64.whl

Download URL stochology-0.1.0-cp313-abi3-macosx_11_0_arm64.whl
Size 618.9 kB
Tags CPython 3.13 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3a0b21cdd3d6a8431259951ebda58303dbb4da63a6a0400a52693c156b95bb44
BLAKE2b-256 checksum
How to use checksums
72257688da4c95f731fcfc0c91d4180ca6bb35a1a16a6d2b8f204e9182ce0234
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / stochology-0.1.0-cp313-abi3-macosx_10_12_x86_64.whl

Download URL stochology-0.1.0-cp313-abi3-macosx_10_12_x86_64.whl
Size 654.5 kB
Tags CPython 3.13 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
671a5338fdd345e835a91909372c2a3cfbdd5cbe2a624483fe83cdd72e413b46
BLAKE2b-256 checksum
How to use checksums
8594f50ac21fabf4fb1b9f4264507db3c8e4c633457b1bea57de0e07fb6e74bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for stochology 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

6 release files No provenance

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