Skip to main content

Setrya

Two colleagues ask an internal AI assistant about a private policy. You revoke one user’s access and clear their cached answer. The assistant now gives that user only public information. Then a background job that started before the revocation puts the private answer back in the cache.

Setrya is an open-source Python SDK and CLI for testing that race before you ship. It records what the worker did and what your app served each user. A teammate can replay the result after the app shuts down.

Tests Offline qualification

Test your own endpoint · Record a pytest test · Test tenant offboarding

Test access revocation with two users

Install Setrya in a Python 3.11+ environment and replay a recorded access change. The package includes the evidence from a real Celery worker and HTTP endpoint using two synthetic accounts. You can run this offline after installation.

python -m pip install setrya
setrya demo access
What the endpoint served User who lost access Colleague who kept access
While the task was paused Public answer Private answer from cache
After the broken worker wrote · FAIL Private answer from the resumed task Private answer from cache
After the guarded worker rejected the write · PASS Public answer Private answer from cache

A third replay shows NOT TESTED when the serving path supplies too little evidence to identify the caller. To run a live drill against a disposable app, start with your own endpoint below or use the pgvector example.

Test your own endpoint

From your application checkout, generate the pytest test and connect its answer(caller, question) hook to your real HTTP route. Start with two signed-in synthetic users who can both read the private answer.

python -m pip install 'setrya[pytest]'
setrya init endpoint
python -m pytest -q -s -p setrya.pytest_plugin --setrya-reads-only tests/test_setrya_endpoint.py

That first run shows which caller, route, question and answer the app confirmed for each request. The race stays NOT TESTED until you connect the worker and run the test without --setrya-reads-only. If your app uses Celery and LangChain, install setrya[celery-langchain] and generate the test with setrya init endpoint --framework celery-langchain. Connect an endpoint · Connect a Celery worker

Run the refund-policy demo

Your team shortens the refund window from 30 days to 14. The support agent searches and gets the new policy. Then a worker resumes with the copy it read yesterday. The offline demo runs that race against a local SQLite FTS5 index.

python -m pip install setrya
setrya demo
Verdict What the support agent sees What the evidence shows
FAIL 30 days → 14 days → 30 days The old worker committed. The next search returned the old policy at rank 1.
PASS 30 days → 14 days The worker rejected its stale write. Final searches found the 14-day policy and the unrelated delivery policy.
NOT TESTED 30 days → 14 days The old worker committed and search still returned 14 days. The response didn’t establish that the index had seen the write.

Use the Python SDK in your tests

A drill names the caller, route, query, and passages that must appear or disappear. Run the bundled refund drill from Python with the core package.

from importlib.resources import as_file, files
from setrya.runner import run

drill = files("setrya.examples").joinpath("support-search", "drill.toml")
with as_file(drill) as path:
    result = run(path)
print(result.verdict.status.label)  # PASS

For your own application, an adapter supplies the worker checkpoint, write receipt, and search results. If pytest already drives your worker, install setrya[pytest] and use the setrya_record fixture to save those observations alongside your assertions. A PASS covers the callers, queries, and schedule you tested. Adapter guide · Record an existing pytest test · Verdict rules

Review the result in a pull request

Run the endpoint test from an application checkout that has both Git revisions.

setrya run-pr --endpoint --repo . --base origin/main --candidate HEAD \
  --output endpoint-review -- python -m pytest -q tests/test_setrya_endpoint.py

The PR check shows what the revoked user and the retained colleague received on each revision, what the delayed worker did, and how to replay the result. A candidate earns FIX VERIFIED when its evidence accounts for the read that failed on base. Keep the artifact on failing checks so the reviewer can inspect either run after teardown. For search and indexing drills, pass --drill with the trusted drill file. Endpoint CI recipe · Review an indexing change

Test tenant offboarding

A customer leaves, but a worker still holds a copy of their support summary. Run setrya offboarding demo --output offboarding-run to test whether the summary reappears and whether a retained tenant’s summary stays readable. The CI gate reports what the app served. A separate deletion receipt tracks one request and can still list open items, such as a backup awaiting expiry. Offboarding guide · Axiom migration

More drills and integrations

Contributing · Security policy · Apache 2.0 license

Metadata

Release files for setrya 0.15.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 setrya 0.15.0
File Size Uploaded Provenance Actions
setrya-0.15.0.tar.gz 259.4 kB With provenance Details for setrya-0.15.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for setrya 0.15.0
File Interpreter ABI Platform Actions
setrya-0.15.0-py3-none-any.whl Python 3 none any Details for setrya-0.15.0-py3-none-any.whl

Total release size: 480.5 kB

Release files / setrya-0.15.0.tar.gz

Download URL setrya-0.15.0.tar.gz
Size 259.4 kB
Tags Source
SHA-256 checksum
How to use checksums
86e6be75e1a47c501faed736f9828f205e30fcf62439d5a26e54d7caff04f776
BLAKE2b-256 checksum
How to use checksums
1226d81ab90c39fddd7e92e1162d603781b95d152dee98bfa424e7036346645f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / setrya-0.15.0-py3-none-any.whl

Download URL setrya-0.15.0-py3-none-any.whl
Size 221.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
228ddf6b83461d32ad8f75b8c5c87e77149eabca99645f5b8fc08c6b036dbc26
BLAKE2b-256 checksum
How to use checksums
efa7ed653d1233d7bc694b676291a0d0aba16cde7f17fc2735ea76620ff39f7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for setrya 0.15.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for setrya-0.15.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

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