Metadata-Version: 2.4
Name: logomesh
Version: 0.1.1
Summary: Reproduce Sentry crashes as failing pytest tests — sandbox execution, verified evidence
Project-URL: Repository, https://github.com/logomesh/logomesh-Dev
License: MIT
Keywords: crash-reproduction,debugging,pytest,sentry,testing
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.11
Requires-Dist: docker>=7.0.0
Requires-Dist: fastapi>=0.100.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: hypothesis>=6.0.0
Requires-Dist: langchain-core>=0.3
Requires-Dist: langchain-openai>=0.2
Requires-Dist: langgraph>=0.2
Requires-Dist: openai>=2.8.1
Requires-Dist: pydantic>=2.11.9
Requires-Dist: pyjwt[crypto]>=2.8.0
Requires-Dist: python-dotenv>=1.1.1
Requires-Dist: rank-bm25>=0.2.2
Requires-Dist: sentry-sdk[fastapi]>=2.0.0
Requires-Dist: uvicorn>=0.35.0
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.40.0; extra == 'anthropic'
Provides-Extra: capture
Provides-Extra: cloud
Requires-Dist: supabase>=2.30.0; extra == 'cloud'
Provides-Extra: embed
Requires-Dist: numpy>=1.24.0; extra == 'embed'
Requires-Dist: voyageai>=0.2.0; extra == 'embed'
Description-Content-Type: text/markdown

# logomesh

Paste a Sentry URL. Get a failing pytest back.

```bash
pip install logomesh
logomesh repro https://sentry.io/organizations/your-org/issues/12345678/
```

---

## What it does

Takes the innermost in-app frame from a Sentry crash, grabs whatever locals Sentry captured at crash time, builds a pytest that calls that function with those exact values, runs it in a Docker sandbox, and tells you if it still reproduces on your current branch.

If it does, you get a failing test you can paste into your repo. If it doesn't, you get a structured explanation of why it gave up.

---

## Requirements

- Python 3.11+
- Docker running locally
- A Sentry auth token (`Settings → API Keys`)
- An OpenAI API key (used for test synthesis fallback)

Set env vars:

```bash
export SENTRY_AUTH_TOKEN=sntryu_...
export OPENAI_API_KEY=sk-...
```

Or drop them in a `.env` file in your project root.

---

## Usage

```bash
# reproduce a crash
logomesh repro https://sentry.io/organizations/your-org/issues/12345678/

# reproduce + write a sealed audit artifact (SOC2 CC7.3 / PCI DSS 12.10.5)
logomesh repro https://sentry.io/organizations/your-org/issues/12345678/ --artifact

# reproduce + open a GitHub draft PR with the failing test attached
logomesh repro https://sentry.io/organizations/your-org/issues/12345678/ --draft-pr
```

---

## Example output

```
## logomesh found 1 issue

### Negative quantity bypasses checkout validation
Property:  Order total should always be ≥ 0
I called:  checkout(item_id=1, qty=-5)
Got:       Order created with total -$49.95
Location:  checkout.py, line 42
```

Silence means nothing reproduced cleanly. No false positives.

---

## What reproduces well

- Input validation bugs
- `NoneType` mismatches
- Decimal / type coercion errors
- Off-by-one, ordering, idempotency issues
- Anything where the inputs that crashed the call are in the Sentry frame

## What doesn't

- Race conditions (frame locals don't capture thread interleaving)
- Bugs that depend on live DB rows or Redis state not in the frame
- C extension crashes
- Distributed failures spanning services

When it can't reproduce cleanly, it says so with a reason instead of guessing.

---

## Sentry setup

Frame locals need to be enabled in your Sentry project for this to work:

`Project Settings → SDK Setup → Enable "Send default PII"` (or set `send_default_pii=True` in your SDK config)

---

## License

MIT
