|
| 1 | +# Contributing to Veridrop |
| 2 | + |
| 3 | +Thanks for considering a contribution! This is an open-source project under |
| 4 | +AGPL-3.0 — your fixes and additions help the whole AI relay community. |
| 5 | + |
| 6 | +## Quick links |
| 7 | + |
| 8 | +- **Issues / bug reports**: [github.com/canarybyte/veridrop/issues](https://github.com/canarybyte/veridrop/issues) |
| 9 | +- **Live service**: [veridrop.org](https://veridrop.org) — useful for "this relay |
| 10 | + shows X but I expected Y" reports (paste the `/r/{job_id}` URL) |
| 11 | +- **Design docs**: [DESIGN.md](DESIGN.md) — architecture overview |
| 12 | +- **Detector design**: [DESIGN.md §3 / §6](DESIGN.md) — how each detector works |
| 13 | + |
| 14 | +## Setting up locally |
| 15 | + |
| 16 | +```bash |
| 17 | +git clone git@github.com:canarybyte/veridrop.git |
| 18 | +cd veridrop |
| 19 | + |
| 20 | +python3 -m venv venv |
| 21 | +./venv/bin/pip install -e ".[dev,web]" |
| 22 | + |
| 23 | +# Run the test suite (should be ~240 tests, all passing) |
| 24 | +./venv/bin/pytest tests/ -v |
| 25 | + |
| 26 | +# Boot the local web service (http://localhost:8000) |
| 27 | +VERIDROP_JOBS_DIR=/tmp/veridrop-dev ./venv/bin/uvicorn web.server:app --reload |
| 28 | +``` |
| 29 | + |
| 30 | +## What kinds of PRs are welcome |
| 31 | + |
| 32 | +| Type | Examples | Notes | |
| 33 | +|---|---|---| |
| 34 | +| 🐛 **Bug fixes** | False positives in long-context, edge cases in tokenizer estimation, broken UI states | Always include a regression test | |
| 35 | +| 🔬 **New detectors** | Cache-control honoring, image-input detection, system-fingerprint check | See [DESIGN.md §6.2](DESIGN.md) for `ActiveDetector` / `PassiveDetector` interfaces | |
| 36 | +| 🌐 **New protocols** | Anthropic Bedrock, Vertex AI native, Mistral, DeepSeek | Mirror the `protocols/anthropic/` structure; aim for ≥80% test coverage | |
| 37 | +| 📊 **Baseline data** | New official model baselines for `data/baselines/` | Run `bench.sh` against the official API; commit only the JSON output | |
| 38 | +| 📖 **Docs / FAQ** | New questions, translations, examples | Bilingual welcome (中文 + English) | |
| 39 | +| 🎨 **UI / UX** | Better mobile layout, accessibility, dark mode | Don't add JS frameworks — keep it vanilla | |
| 40 | + |
| 41 | +## What's NOT in scope |
| 42 | + |
| 43 | +- **Anti-relay tools**: Veridrop verifies relays, not bypasses them. Don't propose |
| 44 | + features that help users evade rate limits / account bans. |
| 45 | +- **Closed-source enterprise extensions**: Per AGPL-3.0, modifications running as |
| 46 | + a service must also be open-sourced. PRs adding closed-source hooks will be |
| 47 | + rejected. |
| 48 | +- **Affiliate / commission code**: Business-layer code lives in a separate |
| 49 | + private repo by design (see [README.md `项目治理`](README.md)). The public |
| 50 | + repo is for the trust path only — detection, scoring, transparency. |
| 51 | + |
| 52 | +## Code style |
| 53 | + |
| 54 | +- **Python**: PEP 8, but loose. Function comments explain *why*, not *what*. |
| 55 | + See existing code for tone — comments often note the bug-of-the-day or the |
| 56 | + gotcha being defended against. |
| 57 | +- **Tests**: pytest, async via `pytest-asyncio`. Mock external API calls; |
| 58 | + never make real upstream calls in unit tests. |
| 59 | +- **Detector pattern**: see `protocols/anthropic/detectors/identity.py` for |
| 60 | + the canonical small detector. Keep `run()` short; helpers go in |
| 61 | + `_underscored_helpers()` below the class. |
| 62 | +- **Commit messages**: imperative (`fix:`, `feat:`, `docs:` etc.). Bilingual |
| 63 | + is fine. |
| 64 | + |
| 65 | +## PR process |
| 66 | + |
| 67 | +1. **Open an issue first** if the change is non-trivial — saves both of us time |
| 68 | + if the design needs discussion. |
| 69 | +2. **One feature per PR**. Multiple unrelated changes get split or asked for splits. |
| 70 | +3. **Tests must pass** locally before pushing (`./venv/bin/pytest tests/`). |
| 71 | + CI will rerun them on push. |
| 72 | +4. **Update docs** if you changed user-facing behavior — README, FAQ, or |
| 73 | + in-code docstrings. |
| 74 | + |
| 75 | +## Reporting bugs |
| 76 | + |
| 77 | +Open an issue with: |
| 78 | + |
| 79 | +- **What you expected**: e.g. "I sent X to relay Y, expected `pass`" |
| 80 | +- **What happened**: e.g. "got `fail` with summary 'Z' — but Y is the |
| 81 | + official anthropic.com" |
| 82 | +- **The `/r/{job_id}` URL** if you ran on veridrop.org |
| 83 | +- **The full JSON** if you ran locally (`detect -o report.json`) |
| 84 | + |
| 85 | +Live data is the fastest path to a fix — half the bugs we've found this year |
| 86 | +came from someone running a real relay and noticing surprising output. |
| 87 | + |
| 88 | +## Security |
| 89 | + |
| 90 | +If you find a security vulnerability (e.g. a way the service could log API |
| 91 | +keys, an injection vector, etc.), please **do NOT open a public issue**. See |
| 92 | +[SECURITY.md](SECURITY.md) for responsible disclosure. |
| 93 | + |
| 94 | +## License |
| 95 | + |
| 96 | +By submitting a PR, you agree your contribution is licensed under |
| 97 | +**AGPL-3.0-or-later** — same as the rest of the project. We don't require |
| 98 | +a CLA. |
0 commit comments