Contributing¶
Thank you for your interest in contributing to Distillery. This guide covers environment setup, code style, testing, and the pull request process.
Prerequisites¶
- Python 3.11 or later
piporuvfor dependency managementgit
Setup¶
Verify:
Code Style¶
Ruff¶
Mypy¶
All code must pass mypy --strict. Use Protocol rather than abstract base classes — this keeps dependencies minimal and interfaces composable.
Testing¶
Distillery uses pytest with pytest-asyncio (auto mode).
pytest tests/ -v # full suite
pytest tests/ -m unit # unit tests only
pytest tests/ -m integration # integration tests only
pytest tests/store/ -v # specific module
Test Markers¶
| Marker | Description |
|---|---|
unit |
Fast, isolated tests with no external dependencies |
integration |
Tests that interact with DuckDB or the file system |
slow |
Long-running tests (excluded from fast CI runs) |
All new features must include tests. PRs that reduce coverage will not be merged. CI enforces an 80% coverage threshold.
Test Fixtures¶
Key fixtures in tests/conftest.py:
make_entry()— factory forEntryobjectsmock_embedding_provider— mock for embedding callsdeterministic_embedding_provider— 8-dimensional registry for controlled similarity testingstore— async in-memory DuckDB store
Commit Conventions¶
Distillery follows Conventional Commits.
Types¶
| Type | When to use |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation only |
test |
Adding or fixing tests |
refactor |
Code change that is not a fix or feature |
chore |
Build process, dependency updates, tooling |
Scopes¶
store, mcp, embedding, classification, config, skills, cli, auth, feeds
Examples¶
feat(store): add DuckDB vector search with cosine similarity
fix(mcp): handle missing embedding provider in distillery_recall
docs: update CONTRIBUTING.md with new test markers
test(classification): add integration tests for DeduplicationChecker
Pull Request Process¶
-
Branch from
main: -
Keep commits focused — one logical change per commit
-
Ensure CI passes — lint, type checking, and tests must all be green
-
Include tests — new features need tests; bug fixes need regression tests
-
Update CHANGELOG.md — add an entry under
[Unreleased] -
Open a PR against
mainwith a clear title following Conventional Commits format
Architecture Overview¶
See Architecture for the full system design. New contributors should start with:
src/distillery/models.py— theEntrydata modelsrc/distillery/store/protocol.py— the store interface
License¶
Apache 2.0. By submitting a contribution, you agree that your changes will be licensed under the same terms.