Reproduce Sentry crashes as failing pytest tests - sandbox execution, verified evidence
Project description
logomesh
Paste a Sentry URL. Get a failing pytest back.
pip install logomesh
logomesh repro https://sentry.io/organizations/your-org/issues/12345678/
Why logomesh
- Deterministic test synthesis — no LLM touches the test bytes. The pytest comes from a pure function of your frame locals.
- Verified reproduction — the sandbox must raise the same exception type Sentry captured. If it doesn't, it refuses to ship.
- Runs on your machine — your Sentry token, your Docker, your repo. Nothing phones home.
- PII redaction built in — strips card numbers, emails, JWTs, API keys, and sensitive field names before anything hits an LLM.
- Audit-ready — every artifact carries
llm_in_evidence_path: false, a SHA-256 stamp, and SOC2/PCI control mapping.
Requirements
- Python 3.11+
- Docker running locally
- Sentry auth token with
event:readscope (Settings → API Keys) - OpenAI API key (powers the agent — context recovery, dep pinning, source resolution, retries)
export SENTRY_AUTH_TOKEN=sntryu_...
export OPENAI_API_KEY=sk-...
Or drop them in a .env file in your project root.
Usage
logomesh repro <sentry-url> # reproduce a crash
logomesh repro <url> --no-llm # deterministic only, skip LLM
logomesh repro <url> --artifact # emit SOC2/PCI audit artifact
logomesh repro <url> --draft-pr # open GitHub draft PR with failing test
logomesh repro <url> --json # machine-readable output
logomesh repro <url> --repo /path/to/repo # point at local repo (default: cwd)
logomesh repro <url> --timeout 120 # wall-clock timeout in seconds
Supported Sentry URL formats:
https://sentry.io/organizations/{org}/issues/{id}/
https://sentry.io/issues/{id}/
https://{org}.sentry.io/issues/{id}/
Example output
✓ Reproduced: ZeroDivisionError at billing/calc.py:18
division by zero
rate = total / count
✗ Cannot reproduce ValueError at checkout.py:42
The synthesized test passed against the current branch.
Either the bug is fixed, or the captured locals are insufficient.
How it works
- Fetches the innermost in-app frame + locals from your Sentry event
- PII redaction runs before any data touches an LLM
- Builds a pytest deterministically from the captured locals
- Runs it in an airgapped Docker sandbox (128 MB, no network,
nobodyuser) - Verifies the sandbox raised the same exception type Sentry captured
- Emits the failing test — or a structured reason it couldn't reproduce
A LangGraph agent handles context recovery, dep pinning, source resolution, and retries. It's advisory — it never writes the test or the artifact.
Full architecture details → GitHub
What reproduces well
- Input validation bugs,
NoneTypemismatches, type coercion errors - Off-by-one, ordering, idempotency issues
- Anything where the crash inputs are captured in the Sentry frame
What doesn't
- Race conditions, distributed failures, live DB/Redis state not in the frame
- C extension crashes, timezone/DST edge cases (sandbox runs
TZ=UTC)
When it can't reproduce, it says so with a structured reason. Never guesses.
Sentry setup
Frame locals must be enabled:
sentry_sdk.init(dsn="...", send_default_pii=True)
Or: Project Settings → SDK Setup → Enable "Send default PII"
License
MIT
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
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 logomesh-0.1.4.tar.gz.
File metadata
- Download URL: logomesh-0.1.4.tar.gz
- Upload date:
- Size: 476.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f9a9f075cd3c2b09c4aa3cd4578e68213d1b305afc5f1311fe4a290d2cfc73c
|
|
| MD5 |
8c21a58871bf84ca5e8e37fcecd0ebb7
|
|
| BLAKE2b-256 |
22c3ef8e43f94644d070a57b77dd47ebdf7dbeea2a56f715eac5daa0780b6796
|
File details
Details for the file logomesh-0.1.4-py3-none-any.whl.
File metadata
- Download URL: logomesh-0.1.4-py3-none-any.whl
- Upload date:
- Size: 155.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae2a1372c773752669898c57a274b88ebed809b915e08ce9cd1fe6b65ef5b905
|
|
| MD5 |
46dd79d81b887fbf79ee804bad7b6cfa
|
|
| BLAKE2b-256 |
8e890306f5a5919208f5a1f363bc8dfa55a870bb10c63bb181a59b79879bd202
|