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 (advisory context recovery only, not test synthesis)
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.3.tar.gz (529.5 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.3-py3-none-any.whl (155.7 kB view details)

Uploaded Python 3

File details

Details for the file logomesh-0.1.3.tar.gz.

File metadata

  • Download URL: logomesh-0.1.3.tar.gz
  • Upload date:
  • Size: 529.5 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.3.tar.gz
Algorithm Hash digest
SHA256 44a8a2771e6b126ba1bf7fbc898cd57157f8a5ceee69876028a470ff2068adac
MD5 dfdf326ba1a33392bdb964f8b935269e
BLAKE2b-256 a3479b3815e7670370c522e6f54acfb6e1ff65cfa6aa0c8d1e4b5f7f60d4254d

See more details on using hashes here.

File details

Details for the file logomesh-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: logomesh-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 155.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c5f7be6ad5ccf3fa59df92449dba7b8220bf0112a4beea0648f8a64dcab9735b
MD5 38ba75e82f36c5404f738dff21093cbb
BLAKE2b-256 cb8de2af61ea51e152e60023f5ffd91927cc0bf8dff1cc2ce370f1d32f621f4d

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