Table of Contents
- Setup
- Project Structure
- Prime CLI Plugin Export
- Running Tests
- Writing Tests
- Contributing
- Common Issues
- Environment Development
- Quick Reference
Setup
Prerequisites
- Python 3.13 recommended for CI parity with Ty checks
- uv package manager
Installation
Project Structure
Prime CLI Plugin Export
Verifiers exports a plugin consumed byprime so command behavior is sourced from verifiers modules.
Entry point:
api_version(current:1)- command modules:
eval_module(verifiers.cli.commands.eval)gepa_module(verifiers.cli.commands.gepa)install_module(verifiers.cli.commands.install)init_module(verifiers.cli.commands.init)setup_module(verifiers.cli.commands.setup)build_module(verifiers.cli.commands.build)
build_module_command(module_name, args)to construct subprocess invocation for a command module
- Add new prime-facing command logic under
verifiers/cli/commands/. - Export new command modules through
PrimeCLIPlugininverifiers/cli/plugins/prime.py. - Keep
verifiers/scripts/*as thin compatibility wrappers that call intoverifiers/cli.
Running Tests
Writing Tests
Test Structure
Using Mocks
The test suite provides aMockClient in conftest.py that implements the Client interface:
Guidelines
- Test both success and failure cases
- Use descriptive test names that explain what’s being tested
- Leverage existing fixtures from
conftest.py - Group related tests in test classes
- Keep tests fast - use mocks instead of real API calls
Contributing
Workflow
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make changes following existing patterns
- Add tests for new functionality
- Run tests:
uv run pytest tests/ - Run linting/format checks:
uv run ruff check --fix . && uv run ruff format --check verifiers tests - Run CI-parity type checks:
uv run ty check verifiers - Update docs if adding/changing public APIs
- Submit PR with clear description
Code Style
- Strict
ruffenforcement - all PRs must passruff check --fix .andruff format --check verifiers tests tymust pass viauv run ty check verifiersto mirror CI setup (Python 3.13 target)- Use type hints for function parameters and returns
- Write docstrings for public functions/classes
- Keep functions focused and modular
- Fail fast, fail loud - no defensive programming or silent fallbacks
PR Checklist
- Tests pass locally (
uv run pytest tests/) - Linting/format checks pass (
uv run ruff check --fix . && uv run ruff format --check verifiers tests) - Type checks pass (
uv run ty check verifiers) - Pre-commit hooks pass (
uv run pre-commit run --all-files) - Added tests for new functionality
- Updated documentation if needed
Common Issues
Import Errors
Integration Tests
Test Failures
Environment Development
Creating a New Environment Module
Environment Module Structure
Quick Reference
Essential Commands
CLI Tools
| Command | Description |
|---|---|
prime eval run | Run evaluations on environments |
prime env init | Initialize new environment from template |
prime env install | Install environment module |
prime lab setup | Set up training workspace |
prime eval tui | Terminal UI for browsing eval results |
prime rl run | Launch Hosted Training |
uv run prime-rl | Launch prime-rl training |
Project Guidelines
- Environments: Installable modules with
load_environment()function - Parsers: Extract structured data from model outputs
- Rubrics: Define multi-criteria evaluation functions
- Tests: Comprehensive coverage with mocks for external dependencies