Thanks for your interest in ContextOps! We welcome contributions of all kinds: bug fixes, new features, docs, examples, benchmarks, and discussions.
git clone https://github.com/QuickLeopard/contextops.git
cd contextops
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest # 35 unit tests, <2s
python -m contextops_bench smoke # 10 prompts, <1scontextops/
├── contextops/ # the library (importable as `contextops`)
├── contextops_bench/ # the benchmark runner (script package)
├── docs/ # ACCEPTANCE.md and design docs
├── evals/ # sample datasets + prompts for demos
├── examples/ # runnable Python examples
└── tests/ # unit tests
- Python 3.10+ syntax (
X | Yunions,matchstatements when they help). rufffor linting (runruff check .).mypy --strictfor type-checking the public API (in CI).- All public functions have docstrings; all CLI commands have
--helptext.
Every change MUST come with tests:
- New optimizer logic → add to
tests/test_optimizer.py. - New eval / judge feature → add to
tests/test_v02_eval.py. - New bench feature → add to
tests/test_bench_unit.py. - Backwards-incompatible change → also add a regression test under
the appropriate file with a name like
test_v01_still_works.
Run the full suite before submitting a PR:
pytest
python -m contextops_bench smokeUse Conventional Commits:
feat:new featurefix:bug fixdocs:docs onlytest:test additions or fixesrefactor:no behaviour changebench:changes to the bench harness onlychore:tooling, CI, deps
Before opening a PR that targets a release, run through
docs/ACCEPTANCE.md. Every MUST criterion
touched by your change MUST still pass.
- Add the metric definition to
_METRICSincontextops/judge.py. - Add a unit test in
tests/test_v02_eval.pyexercising both the happy path and a judge that returns non-JSON. - Document it in
README.mdunder the metrics table. - Optionally add it to the default metrics list in
evaluate_ab().
- Implement a class with
PROVIDERstring attribute,complete()and optionallylist_models()methods incontextops_bench/clients.py. - Add the provider name to the
choices=list incontextops_bench/__main__.py:_add_common_args. - Add a unit test in
tests/test_bench_unit.py(at minimum: factory returns correct class, unknown name raisesValueError).
- Bump version in
pyproject.toml. - Add a section to
CHANGELOG.md. - Run full acceptance suite (
pytest, smoke bench, manual OpenRouter test if you have a key). - Tag:
git tag -a v0.X.Y -m "v0.X.Y". - Build & publish:
pip install build twine python -m build twine upload dist/* - Push the tag:
git push origin v0.X.Y.
This project follows the Contributor Covenant. Be kind, be patient, assume good faith.
By contributing, you agree that your contributions will be licensed under the MIT License.