Skip to content

Latest commit

 

History

History
134 lines (99 loc) · 7.02 KB

CONTRIBUTING.md

File metadata and controls

134 lines (99 loc) · 7.02 KB

Contributing to Hermit

Contributions can add learning methods, adapter designs, task integrations, host exporters, tests, or documentation. Start with the developer guide and choose the interface for your change.

Set Up

Hermit core requires Python 3.12+ and Git. From a checkout:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[test]'

Benchmark data, agent CLIs, and model credentials depend on the integration. The installation guide lists the requirements.

Verify a Change

Run the tests the change needs and the offline training walkthrough:

python -m pytest --changed
hermit check --config docs/_examples/first_training/run.yaml
hermit train --config docs/_examples/first_training/run.yaml
hermit eval --config docs/_examples/first_training/run.yaml --adapter final

The tests are in groups (tests/README.md): tests/core/ for the framework and tests/methods/<name>/ for each method. --changed runs the groups whose files the branch changed since origin/main (--base names another ref), with uncommitted and untracked files: the core group for every change but documentation, a method's group for its own files, and every group for a shared layer every method is built on (the Base Agents, the acting agents, the Evolver base classes, the Trainer, the sandbox, the hosts' deployment, the test helpers). The header says which groups ran and why. Some methods' tests need the method's dependency group (gepa, skillopt, harness2, rrsi; pip 25.1+) and skip without it:

python -m pip install -e '.[test]' --group all
python -m pytest tests/methods/optimizers

The method tests use scripted models and need no model credentials. The complete suite (tests/ and the examples' own tests under examples/*/utils/tests/) is:

python -m pytest

Tests marked integration run an agent CLI installed on the machine (codex, claude, dsh, hermes) and depend on its release; they run only with --integration.

A pull request that adds or changes tests also answers the test checklist: where a test goes, how it is named and documented, what it asserts, and what it may touch.

A pull request that adds or changes a method or a dataset and starts a process or changes what a sandbox shows also answers the sandbox checklist: it reuses the framework's sandbox, states why for anything that cannot, and treats a change to the sandbox itself as a core change agreed with the core team first.

A pull request that adds a benchmark or changes how its tasks are written or read also answers the benchmark checklist: task directories in Harbor's format, answers and tests kept out of the tasks the agent and the learner read (the judge's feedback shows what the benchmark's protocol allows), what each task asks of its environment declared, and parity for a moved benchmark.

GitHub Actions (.github/workflows/tests.yml) runs python -m pytest --changed against the base branch on every pull request, and the complete suite on main, daily and on demand, on Ubuntu with bubblewrap. Tests whose dependencies it does not install (agent CLIs, AgentDyn, prepared benchmark data) skip there, as they do locally.

Sandbox and MWM integration tests require Linux, bubblewrap, and usable namespaces; some tests do not yet skip automatically when those prerequisites are absent. On macOS, run the applicable core tests and identify the Linux checks that remain unverified. See sandbox configuration for the execution boundaries. CI and platform-test organization are tracked separately for follow-up work.

For documentation changes:

python -m pip install -r docs/requirements.txt
bash docs/build.sh

The build fails on warnings and excludes local design drafts. bash docs/serve.sh starts a local preview that includes those drafts.

Optional file checks:

python -m pip install pre-commit
pre-commit run --all-files

The hooks check TOML, YAML, merge-conflict markers, and newly added large files. They do not reformat code.

Do not commit generated training or evaluation data, per-task results, trajectories, logs, checkpoints, or per-run adapter snapshots. Keep these artifacts in ignored local directories. Include reproducible recipes, reusable configurations, and aggregate results in the documentation and PR description instead.

Suggested review workflow

Contributors are encouraged to review their changes iteratively, both before opening a PR and after updating it. Existing validation and review requirements still apply.

  1. Review the complete change. Use the general and all applicable task-specific checklists. Inspect the implementation, relevant callers, tests and documentation.
  2. Verify findings before fixing them. Confirm suspected problems against the current code. Fix actionable issues, and explain concerns that are rejected or accepted as design tradeoffs.
  3. Validate the fixes. Run the affected checks and update documentation, experiment records and the PR description where needed.
  4. Review again when useful. Repeat the review–fix–verify cycle while it continues to uncover actionable issues. A fresh agent session can provide an independent perspective.
  5. Continue after opening the PR. Run the post-PR audit and repeat the cycle after substantive fixes or new review feedback. Make clear which version each review covers.

Use judgment to decide when the change is ready. A useful stopping point is when the latest review finds no new actionable issues, earlier findings have been addressed or explained, and remaining limitations are disclosed. There is no prescribed number of review rounds.

Propose a Change

For bugs, include a small reproducer, the framework version or commit, platform, and relevant configuration. Remove credentials and private task data from shared logs. Use private reporting for vulnerabilities.

For pull requests, describe the resulting behavior, affected interfaces, and validation. Keep documentation, commands, and defaults consistent. Report external requirements and unverified platform-specific checks.

Documentation-only pull requests must be discussed with the core team first. Open an issue, agree on the change there, and link it in the pull request. Pull requests without that discussion will be closed.

A pull request that reproduces a published learning method follows Reproduce a published method and completes the general and method-specific checklists linked from its PR section.

Use the existing task, adapter, and Evolver interfaces where possible. For the contracts and extension examples, see task integration, adapter customization, and custom Evolvers.