How google-research/harness2 works
Harness² refines agent harnesses against benchmark tasks, then carries adopted harnesses and evidence-supported lessons into later tasks. The main workflow selects tasks, runs Propose–Probe–Compose recursion through an executor, selects a result, and supports separate judging and reporting. The graph also preserves the documented benchmark, recursion-mode, executor, and setup capabilities. Some implementations are unsampled; links for those capabilities rely on the README rather than claims of source inspection.
Main entry points: schedule.py Task scheduler · recursion.py Recursion engine · run_sweep.py Run CLI · base.py Executor interface
Components 19
Run orchestration
- Run CLI
harness2/cli/run_sweep.py - Task scheduler
harness2/core/schedule.py - Configuration
harness2/config.py
Harness refinement
- Recursion engine
harness2/core/recursion.py - Refinement prompts
harness2/core/prompts.py - Model proposer
harness2/core/proposer.py - Task context
harness2/core/context.py - Harness tree
harness2/core/tree.py - Candidate selection
harness2/core/selection.py - Experience library
harness2/core/library.py - Evidence ledger
harness2/core/ledger.py
Execution and benchmarks
- Executor interface
harness2/substrate/base.py - OpenCode executor
harness2/substrate/opencode.py - Codex executor
harness2/substrate/codex.py - Benchmark adapters
harness2/benchmarks
Results and setup
- Benchmark judging
harness2/core/judge.py - Run reporting
harness2/core/report.py - Benchmark setup
harness2/install.py
Other components
- Operator
Connections 20
- Operator → Run CLI: starts run
README.md - Run CLI → Task scheduler: runs tasks
harness2/cli/run_sweep.py - Run CLI → Configuration: loads settings
harness2/cli/run_sweep.py - Task scheduler → Recursion engine: refines harness
README.md - Recursion engine → Model proposer: requests proposals
harness2/core/recursion.py - Recursion engine → Refinement prompts: builds prompts
harness2/core/recursion.py - Recursion engine → Task context: builds context
harness2/core/recursion.py - Recursion engine → Harness tree: updates harness
harness2/core/recursion.py - Task scheduler → Candidate selection: selects candidate
harness2/core/schedule.py - Task scheduler → Experience library: reuses lessons
harness2/core/schedule.py - Task scheduler → Evidence ledger: records evidence
- Task scheduler → Benchmark adapters: loads benchmark
harness2/cli/_common.py - Recursion engine → Executor interface: runs probes
README.md - Executor interface → OpenCode executor: supports executor
harness2/substrate/opencode.py - Executor interface → Codex executor: supports executor
harness2/substrate/codex.py - Benchmark adapters → OpenCode executor: launches runs
- Benchmark adapters → Codex executor: launches runs
- Operator → Benchmark setup: installs benchmark
README.md - Operator → Benchmark judging: judges results
README.md - Operator → Run reporting: views results
README.md