Contributing to tracesage¶
Thanks for considering a contribution. tracesage is intentionally lean — we want every line to pull its weight.
Setup¶
git clone https://github.com/kjgpta/tracesage.git
cd tracesage
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev,langchain]"
Running the tests¶
# Unit + integration (default — what CI runs)
pytest tests/ --ignore=tests/stress
# Stress (slow, run manually)
pytest tests/stress/ -m slow
# Single layer
pytest tests/test_database.py -v
Code style¶
ruff check src/ tests/ tools/must pass.- Type-hint public functions.
- Pydantic v2.
from __future__ import annotationsat file top.- See
CLAUDE.mdfor the full convention list.
Architecture¶
src/tracesage/— package sourcesrc/tracesage/adapters/— framework adapters (LangChain; MCP attribution helper)src/tracesage/storage/— pluggable storage backends (SQLite + blob store)src/tracesage/server/— FastAPI routes, WebSocket, authsrc/tracesage/ui/— vanilla JS + a custom SVG graph renderer (no framework)src/tracesage/pytest_plugin.py— thetracesage_capturefixturetests/— unit + integration;tests/stress/— slow tests (excluded from CI)examples/—getting_started/(no-key demos),mcp/, and theshowcase/gallerytools/— bench, crash-recovery, other ops scripts
Pull requests¶
- One concern per PR.
- Add a regression test if you're fixing a bug.
- If you're adding a feature, document it in
docs/. - Run
pytest tests/ --ignore=tests/stressandruff checkbefore pushing.
Adding a framework adapter¶
See the extending guide. The adapter pattern is documented; follow LangChain's adapter as a reference.
Reporting bugs¶
Please include:
- Python version
- OS
- Minimal reproducible snippet
- What you expected vs what happened