Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7d0ec1d
feat(prompts): add Claude Code and command harness surfaces (#1)
3ae3ae Oct 19, 2026
6025224
feat: add layered settings, provider profiles and a suite registry (#2)
3ae3ae Oct 19, 2026
fdb6574
refactor: move the three benchmarks into a harness2-benchmarks plugin…
3ae3ae Oct 19, 2026
84e1254
feat: provider-aware improver channels, run events, spending limits (#4)
3ae3ae Oct 19, 2026
f690653
feat: Claude Code and command executors, native harness import/export…
3ae3ae Oct 19, 2026
41011be
feat: single harness2 command with subcommands (#6)
3ae3ae Oct 19, 2026
e9450ba
feat: built-in tasks suite for your own project tasks (#7)
3ae3ae Oct 19, 2026
1515038
test: end-to-end run of the CLI on the built-in tasks suite (#8)
3ae3ae Oct 19, 2026
ebda822
feat: interactive init, status, apply, chat and a human selector (#9)
3ae3ae Oct 19, 2026
0810260
docs: document harness2 as a general-purpose CLI (#10)
3ae3ae Oct 19, 2026
ca56c60
feat: consolidate a run into one project harness, and eval it (#12)
3ae3ae Oct 19, 2026
bdfbee8
chore: rename the distribution to harness2-cli, add CI, tidy commands…
3ae3ae Oct 19, 2026
2fbae48
feat: run on Claude and ChatGPT subscriptions through the installed C…
3ae3ae Oct 19, 2026
e0d9290
feat: build the run's final harness automatically (#15)
3ae3ae Oct 19, 2026
03d7060
feat: a guide for AI agents, and JSON from init and apply (#16)
3ae3ae Oct 19, 2026
d238082
feat: background runs, stop, and JSON errors for agent use (#17)
3ae3ae Oct 19, 2026
0cae0f7
docs: describe Harness² CLI; status shows whether a run is going (#18)
3ae3ae Oct 19, 2026
1dd141f
fix: clearer output found in a live run on a ChatGPT subscription (#19)
3ae3ae Oct 19, 2026
fc8231a
test: match the eval output changed in the previous commit (#20)
3ae3ae Oct 19, 2026
3a62c9e
test: skip the shell syntax check when that shell is not installed (#21)
3ae3ae Oct 19, 2026
9cc2c31
fix: keep personal Codex hooks and AGENTS.md out of subscription runs…
3ae3ae Oct 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
test:
name: Tests (Python ${{ matrix.python }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python }}
activate-environment: true
- name: Install
run: uv pip install -e . -e plugins/harness2-benchmarks
- name: Core tests
run: python -B -m unittest discover -s tests
- name: Plugin tests
run: python -B -m unittest discover -s plugins/harness2-benchmarks/tests

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
- run: uvx ruff check harness2 tests plugins
- run: uvx ruff format --check harness2 tests plugins
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
__pycache__/
*.py[cod]
*.egg-info/
.venv/
build/
dist/
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Changelog

All notable changes to Harness² CLI are documented here. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
[Semantic Versioning](https://semver.org/).

## [Unreleased]

The first release of Harness² CLI, a general-purpose version of
[google-research/harness2](https://github.com/google-research/harness2) (forked at
`1cfe254`). The method and its prompts are unchanged; everything around them is new.

### Added

- One `harness2` command with subcommands: `init`, `doctor`, `task`, `run`, `status`,
`stop`, `diff`, `eval`, `apply`, `judge`, `report`, `runs`, `config`, `chat`, `guide`, `login`,
`setup`, `demo`, `bridge`, `completion`.
- Your own tasks: `.harness2/tasks/<id>/task.md` with optional `task.toml`, run in a clean
git worktree of your repository or in a scratch directory, graded optionally by a `check`
command or a `rubric.md`.
- Claude Code and command executors. A project's own harness (CLAUDE.md, `.claude/skills`,
`.claude/agents`, `.claude/scripts`, hooks; or AGENTS.md, `.agents/`, `.codex/hooks.json`)
is imported as the starting harness.
- Subscriptions: `claude-login/<model>` runs on Claude Code's own login and
`chatgpt-login/<model>` on a Codex login kept for harness2 (`harness2 login codex`), with
personal settings, hooks, plugins and instructions kept out of the runs.
- Any model provider: Anthropic, OpenAI, OpenAI- or Anthropic-compatible servers, Vertex AI
and Bedrock, through provider profiles; `harness2 bridge` serves any of them to Codex.
- Layered settings: defaults, `~/.config/harness2/config.toml`, `.harness2/config.toml`,
profiles, `HARNESS2_<SECTION>__<KEY>` variables and flags, with `config show --origin`.
- One final harness per run, built from every task's adopted harness and lesson;
`harness2 eval` compares it with the starting harness, and `harness2 apply` writes it into
the project, keeping edits made since the run started.
- Run control: `--dry-run` call estimates, `--budget-usd` and `--max-calls` limits,
clean stops at a provider's usage limit, Ctrl-C and `harness2 stop` with resume,
`--detach` background runs, relocatable run directories, `events.jsonl`.
- Use by AI agents: `--json` for every command including errors, flags for every prompt,
and `harness2 guide` (also installable as a Claude Code skill).
- Interactive use: the `init` wizard, `status --watch`, `apply -i`, `--selector human`,
`harness2 chat`.
- CI on Linux and macOS with Python 3.12 and 3.13.

### Changed

- The distribution is `harness2-cli`; the command and the import package stay `harness2`.
- The agent CLIs are the ones installed on the system instead of pinned downloads.
- Codex harness scripts live in `.agents/scripts/`, so they never collide with a project's
`scripts/`.

### Removed

- The seven `harness2-*` scripts' old flags (`--bench`, `--substrate`); the script names
remain as aliases of the new subcommands.
- The Vertex-only configuration in `.env` from the core package. JobBench, LAB and
WorkBuddy-Bench moved, with that configuration, to the
[harness2-benchmarks plugin](plugins/harness2-benchmarks/).
82 changes: 49 additions & 33 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,49 @@
# How to contribute

We'd love to accept your patches and contributions to this project.

## Before you begin

### Sign our Contributor License Agreement

Contributions to this project must be accompanied by a
[Contributor License Agreement](https://cla.developers.google.com/about) (CLA).
You (or your employer) retain the copyright to your contribution; this simply
gives us permission to use and redistribute your contributions as part of the
project.

If you or your current employer have already signed the Google CLA (even if it
was for a different project), you probably don't need to do it again.

Visit <https://cla.developers.google.com/> to see your current agreements or to
sign a new one.

### Review our community guidelines

This project follows
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).

## Contribution process

### Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.
# Contributing

Issues and pull requests are welcome. Harness² CLI is an independent fork of
[google-research/harness2](https://github.com/google-research/harness2); changes here are
not sent upstream. Every pull request runs the tests and ruff in CI, and notable changes go
in [CHANGELOG.md](CHANGELOG.md) under "Unreleased".

## Development setup

```bash
uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install -e . -e plugins/harness2-benchmarks
python -B -m unittest discover -s tests
python -B -m unittest discover -s plugins/harness2-benchmarks/tests
ruff check harness2 tests plugins && ruff format --check harness2 tests plugins
```

The tests run offline: they use the deterministic demo adapter and small fake `claude` /
`codex` executables, never a real model. `harness2 demo` exercises the whole method locally
in a few seconds.

## Layout

| Path | Contents |
|---|---|
| `harness2/core/` | The method: recursion modes, prompts, evidence, selection, library, scheduler, events |
| `harness2/substrate/` | Executors (Claude Code, Codex, OpenCode, command): editable surfaces, native harness import/export, trajectory renderers |
| `harness2/suite.py`, `harness2/workspace.py` | The built-in `tasks` suite: tasks from `.harness2/tasks/`, rollouts in git worktrees or scratch directories |
| `harness2/settings.py`, `harness2/providers.py`, `harness2/registry.py` | Layered settings, provider profiles, suite discovery |
| `harness2/cli/` | The `harness2` command, one module per subcommand |
| `plugins/harness2-benchmarks/` | The paper's benchmarks as a separate distribution |
| `docs/` | User documentation |

A new suite is a module exposing `make_adapter(ctx)` (returning a
`harness2.core.spec.BenchmarkAdapter`) and, optionally, `check(ctx)`, `setup(argv)` and
`DESCRIPTION`, registered under the `harness2.suites` entry-point group. The benchmarks plugin
is a complete example.

## Conventions

- Keep changes small, and reuse what is already there before adding code. Prefer the
standard library; the core package has no runtime dependencies.
- New behaviour comes with an offline test.
- Text that a model reads (prompts in `harness2/core/prompts.py`, suite prompt profiles) is
part of the method: change it deliberately, and say why in the pull request.
- Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/)
(`feat:`, `fix:`, `refactor:`, `docs:`, `test:`).
- Run the tests and `ruff` before opening a pull request, and describe how you tested.
8 changes: 1 addition & 7 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
include README.md .env.example
recursive-include docs *.md
recursive-include scripts *.py *.sh
recursive-include harness2/third_party *
include dependencies/README.md dependencies/PINNED.md
include README.md LICENSE
global-exclude __pycache__ *.py[cod] *.log

recursive-include assets *.png
Loading
Loading