Skip to main content
v0 is considered deprecated and will be fully removed in a future release.
This guide covers setup, testing, and contributing to the verifiers package.

Table of Contents

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 by prime so command behavior is sourced from verifiers modules. Entry point:
The plugin exposes:
  • 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
Contributor guidance:
  • Add new prime-facing command logic under verifiers/cli/commands/.
  • Export new command modules through PrimeCLIPlugin in verifiers/cli/plugins/prime.py.
  • Keep verifiers/scripts/* as thin compatibility wrappers that call into verifiers/cli.

Running Tests

The test suite includes 380+ tests covering parsers, rubrics, environments, and utilities.

Writing Tests

Test Structure

Using Mocks

The test suite provides a MockClient in conftest.py that implements the Client interface:

Guidelines

  1. Test both success and failure cases
  2. Use descriptive test names that explain what’s being tested
  3. Leverage existing fixtures from conftest.py
  4. Group related tests in test classes
  5. Keep tests fast - use mocks instead of real API calls

Contributing

Workflow

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make changes following existing patterns
  4. Add tests for new functionality
  5. Run tests: uv run pytest tests/
  6. Install hooks once per clone: uv run pre-commit install
  7. Commit and push (hooks run automatically on each commit/push)
  8. Update docs if adding/changing public APIs
  9. Submit PR with clear description

Code Style

  • Strict ruff enforcement via pre-commit hooks
  • ty runs in the pre-push hook via uv run --python 3.13 ty check verifiers
  • 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/)
  • Pre-commit and pre-push hooks pass on latest commit/push
  • Added tests for new functionality
  • Updated documentation if needed

Contributor Practices

Public Surface

Treat public config, docs, starter examples, skills, and generated agent guidance as one surface. If a behavior changes for users, update all matching surfaces in the same patch. For TOML config, keep one shape across eval, GEPA, RL, and Hosted Training. Normalize old or alternate inputs at the loader boundary, then keep examples on the current golden path.

Validation By Change Type

  • Core runtime or shared config parsing: run the focused unit tests plus uv run pre-commit run --all-files.
  • Example environment behavior: run the focused tests and a real prime eval run smoke when credentials and endpoint access are available.
  • Environment packaging: exercise tests/v1/test_envs.py for the changed environment so a fresh venv installs the environment package and its dependencies.
  • Docs or agent guidance (AGENTS.md): edit the Markdown directly and keep it minimal.
  • Release prep: verify the version source, release notes commit range, uv build, and final worktree status.
  • PR/CI follow-up: inspect the live review thread, check run, or log before patching, then rerun the smallest check that proves the fix.

Downstream Checks

Before changing dependencies, optional extras, lockfiles, exported config fields, or upload/eval metadata, trace the consumers in prime-cli, prime-rl, Hosted Training, and public docs when they are in scope. Update the consumer or document the compatibility boundary rather than assuming transitive behavior remains safe.

Common Issues

Import Errors

Integration Tests

Test Failures

Environment Development

Creating a New Environment Module

Environment Module Structure

Quick Reference

Essential Commands

CLI Tools

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