Skip to main content

Reproduce Sentry crashes as failing pytest tests - sandbox execution, verified evidence

Project description

logomesh

PyPI License: MIT Status: Alpha

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:read scope (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

  1. Fetches the innermost in-app frame + locals from your Sentry event
  2. PII redaction runs before any data touches an LLM
  3. Builds a pytest deterministically from the captured locals
  4. Runs it in an airgapped Docker sandbox (128 MB, no network, nobody user)
  5. Verifies the sandbox raised the same exception type Sentry captured
  6. 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, NoneType mismatches, 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

logomesh-0.1.4.tar.gz (476.1 kB view details)

Uploaded Source

Built Distribution

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

logomesh-0.1.4-py3-none-any.whl (155.9 kB view details)

Uploaded Python 3

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

Hashes for logomesh-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2f9a9f075cd3c2b09c4aa3cd4578e68213d1b305afc5f1311fe4a290d2cfc73c
MD5 8c21a58871bf84ca5e8e37fcecd0ebb7
BLAKE2b-256 22c3ef8e43f94644d070a57b77dd47ebdf7dbeea2a56f715eac5daa0780b6796

See more details on using hashes here.

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

Hashes for logomesh-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ae2a1372c773752669898c57a274b88ebed809b915e08ce9cd1fe6b65ef5b905
MD5 46dd79d81b887fbf79ee804bad7b6cfa
BLAKE2b-256 8e890306f5a5919208f5a1f363bc8dfa55a870bb10c63bb181a59b79879bd202

See more details on using hashes here.

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