Thank you for helping improve OpenRath. This document matches the current repo layout and tool chain. For day-to-day work, treat contributions as small, verifiable steps: clarify scope, implement, then run the checks below before opening a pull request.
- Session-first: chunk tables, loops, and sandbox backends should stay easy to reason about.
- Composable APIs: workflows and agent parameters should feel natural to combine (PyTorch-like ergonomics without copying PyTorch).
- Focused changes: avoid drive-by refactors and unrelated formatting in the same PR as a feature or fix.
- Design before large moves: session graph semantics, tool wiring, and major public surfaces deserve a short design note or issue thread before big diffs.
Requirements: Python 3.10–3.13 (see requires-python in pyproject.toml).
We use uv for environments.
# Runtime + dev tools (ruff, mypy, pytest)
uv sync --group devAfter cloning, initialize the documentation submodule if you did not use --recurse-submodules:
git submodule update --init --recursiveOptional groups:
# Editable install with OpenSandbox extras (for backend work)
uv sync --group dev --extra opensandbox
# Sphinx + extensions (for documentation edits)
uv sync --group dev --group docsRun Python tools through uv run … so they use the synced environment.
These commands are what maintainers expect to pass on a typical PR (library code, tests, and examples):
uv run ruff check src tests example
uv run ruff format --check src tests example
uv run mypy src
uv run pytestNotes:
mypyis run onsrc/only (package API surface). If you change typing at boundaries, keepsrcclean.ruff checkincludesexample/: scripts underexample/are part of the reviewed surface.ruff format --checkverifies formatting without modifying files; runuv run ruff format src tests exampleto apply fixes.pytestruns the full tree. Many tests run offline; some are conditional (see below).
| Kind | When they run | What you need |
|---|---|---|
| Default unit & conformance | Always (unless skipped internally) | Nothing special |
live_llm / integration |
Skip if OPENAI_API_KEY is unset or very short |
Valid OPENAI_API_KEY; sometimes OPENAI_DEFAULT_MODEL / base URL per test docstrings |
opensandbox |
Skip if no server on localhost:8080 (configurable via OPENSANDBOX_TEST_HOST / PORT) |
Running OpenSandbox stack; see tests/conftest.py and repo scripts under scripts/ |
Do not commit secrets. Use environment variables or local-only config.
If you change docs/, build HTML locally:
uv sync --group dev --group docs
uv run sphinx-build -M html docs/source docs/_buildStart a local HTTP server for the built docs:
uv run python -m http.server 8000 --directory docs/_build/htmlThen preview them at http://127.0.0.1:8000/.
src/rath/ Installable package (wheel maps here via hatch)
tests/ pytest tree (unit, integration, conformance, examples checks)
example/ Runnable demos and CLI entry points (also ruff-clean)
assets/readme/ README and example-facing images (independent of docs submodule)
docs/ Sphinx + MyST sources (git submodule: OpenRath-Docs)
pyproject.toml Metadata, dependencies, dependency groups
- Scope: One PR should solve one problem (or one tightly related cluster).
- Tests: Add or update tests for behavior changes; keep fast tests deterministic without network when possible.
- Public behavior: Update
README.md, user-facing docstrings, ordocs/when CLI or semantics change. - Style: Prefer clear names and short module docstrings over long inline chatter. Keep
pragma: no coverlines purposeful and explained. - Examples: If you touch
example/, run entry points mentally (or briefly) and ensure new env vars are documented in the relevantREADME.mdthere.
- Describe motivation, what changed, and how you verified it (commands run).
- Link related issues when applicable.
- Call out breaking changes, follow-ups, or known limitations explicitly.
By contributing, you agree your contributions are licensed under the BSD 3-Clause License in this repository (LICENSE).