Contributing
Guide to contributing to Triage Warden.
Getting Started
- Fork the repository
- Clone your fork
- Set up the development environment
- Create a branch for your changes
- Submit a pull request
Development Setup
Prerequisites
- Rust 1.75+
- Python 3.11+
- uv (Python package manager)
- SQLite (for development)
Initial Setup
# Clone repository
git clone https://github.com/your-username/triage-warden.git
cd triage-warden
# Install Rust dependencies
cargo build
# Install Python dependencies
cd python
uv sync
cd ..
# Run tests
cargo test
cd python && uv run pytest
Code Style
Rust
- Follow standard Rust conventions
- Run
cargo fmtbefore committing - Run
cargo clippyand fix warnings - Document public APIs with doc comments
Python
- Follow PEP 8
- Run
ruff checkandblackbefore committing - Type hints required (mypy strict mode)
- Docstrings for public functions
Pre-commit Hooks
Install pre-commit hooks:
# The project has pre-commit configured in .git/hooks
# It runs automatically on commit:
# - cargo fmt
# - cargo clippy
# - ruff
# - black
# - mypy
Pull Request Process
-
Create a branch
git checkout -b feature/my-feature -
Make changes
- Write code
- Add tests
- Update documentation
-
Run checks
cargo fmt && cargo clippy cargo test cd python && uv run pytest -
Commit
git commit -m "feat: add new feature" -
Push and create PR
git push origin feature/my-feature -
Address review feedback
Commit Messages
Follow conventional commits:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentationrefactor: Code refactoringtest: Adding testschore: Maintenance
Testing
Rust Tests
# Run all tests
cargo test
# Run specific crate tests
cargo test -p tw-api
# Run with output
cargo test -- --nocapture
Python Tests
cd python
uv run pytest
# Run specific tests
uv run pytest tests/test_agents.py
# With coverage
uv run pytest --cov=tw_ai
Integration Tests
# Start test server
cargo run --bin tw-api &
# Run integration tests
./scripts/integration-tests.sh
Documentation
- Update docs for API changes
- Add examples for new features
- Keep README.md current
Build docs locally:
cd docs-site
mdbook serve
Issue Reporting
When reporting issues:
- Search existing issues first
- Use issue templates
- Include:
- Version information
- Steps to reproduce
- Expected vs actual behavior
- Relevant logs
Questions
- Open a GitHub Discussion
- Check existing discussions first
- Tag appropriately
License
By contributing, you agree that your contributions will be licensed under the MIT License.