Skip to content

feat: lightweight meta-benchmark harness (unify Environment/verify + metrics; OSWorld/BrowserGym stubs for phase 2)#266

Merged
abrichr merged 1 commit into
mainfrom
feat/meta-benchmark-harness
Jul 14, 2026
Merged

feat: lightweight meta-benchmark harness (unify Environment/verify + metrics; OSWorld/BrowserGym stubs for phase 2)#266
abrichr merged 1 commit into
mainfrom
feat/meta-benchmark-harness

Conversation

@abrichr

@abrichr abrichr commented Jul 14, 2026

Copy link
Copy Markdown
Member

What

Phase 1 of a lightweight meta-benchmark, built by consolidating the interfaces that already exist in openadapt-evals — not new infra, not an external harness. Grounded in a code audit + literature review that both concluded "extend openadapt-evals, ~80% reuse."

The repo has three parallel abstractions that each score success a different way:

  • BenchmarkAdapter (adapters/base.py) — reset/step/evaluate (WAA, mock, local)
  • TaskVerifierRegistry (evaluation/verifier_registry.py) — registered verifiers → VerificationResult
  • the flow-side EffectVerifier (openadapt-flow) — CONFIRMED/REFUTED/INDETERMINATE against a real system of record

This PR unifies them behind one Environment protocol whose verify() folds all three scoring paths into a single call, and one run_meta() that drives record→compile→replay(→heal)→verify and emits one JSONL row per (env, task, mode).

New package openadapt_evals/harness/ (lazy PEP-562 imports; no openadapt_flow at import time)

  • protocol.pyruntime_checkable Environment (reset/observe/act/verify/close) + MetaTask (extends openadapt_types.BenchmarkTask with demo/verifier/env).
  • adapters.pyBenchmarkAdapterEnvironment shim (any BenchmarkAdapterEnvironment, folding evaluate() + registry into verify()); MockMedAdapter (flow RestRecordVerifier) + OpenEMRAdapter (flow FhirEffectVerifier) wrapping the flow Playwright Backend. Heavy/live collaborators lazy + injectable/mockable.
  • runner.pyrun_meta(env, task, policy)MetaMetricsRow: replay_success (by the env's verifier, not self-report), structural_rung_rate, model_calls, effect_verdict, wall_ms, cost_usd. Policies wrap the existing replay (replay_runner), hybrid (HybridFlowAgent), and a generic agent driver.
  • inspect_export.py — portable Inspect eval-log JSON export + round-trip, without adopting inspect_ai as runtime.
  • external.pyOSWorldAdapter + BrowserGymAdapter phase-2 stubs: NotImplementedError + docstrings on how each env's native execution verifier wires into verify(). Nothing installed.

Metrics row schema (per env/task/mode)

env, task_id, mode, replay_success, structural_rung_rate, model_calls, effect_verdict, wall_ms, cost_usd (+ diagnostics: reported_success, verifier_score, verifier_source, num_steps, heal_count, structural_rung_counts, error).

Verification (targeted, fully mocked — no live Azure/VM/paid infra)

tests/test_harness_meta_benchmark.py12 pass: protocol conformance (runtime_checkable), run_meta row correctness (ground truth from verify(), not the policy's self-report), registry + native effect-verifier delegation, Inspect-log round-trip, clean NotImplementedError from the external stubs. Also verified: importing the package does not pull in openadapt_flow; ruff clean; related existing suites (test_verifier_registry, test_flow_replay_runner) still green.

Not in scope (phase 2)

Real OSWorld/BrowserGym wiring (install + native-verifier delegation), and live runs. Do not merge — review only.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CKrVJJy5jWVCkXAqgUqtqZ

…metrics)

Consolidate the three existing openadapt-evals abstractions -- BenchmarkAdapter
(adapters/base.py), TaskVerifierRegistry (evaluation/verifier_registry.py), and
the flow-side EffectVerifier -- behind ONE runtime_checkable Environment
protocol whose verify() folds all three scoring paths into a single call, plus
ONE run_meta() runner that emits one JSONL metrics row per (env, task, mode).

This is a consolidation over existing code (~80% reuse per the code audit +
literature review), not new infra and not an external harness.

New openadapt_evals/harness/ package (lazy PEP 562 imports; no openadapt_flow
pulled at import time):
- protocol.py: Environment protocol + MetaTask (extends openadapt_types
  BenchmarkTask with demo/verifier/env).
- adapters.py: BenchmarkAdapterEnvironment shim (any BenchmarkAdapter -> env,
  folding evaluate()+registry into verify()); MockMedAdapter + OpenEMRAdapter
  wrapping the flow Playwright Backend + RestRecordVerifier/FhirEffectVerifier
  (lazy + injectable/mockable).
- runner.py: run_meta() drives record->compile->replay(->heal)->verify and
  emits MetaMetricsRow (replay_success by the env verifier, structural_rung_rate,
  model_calls, effect_verdict, wall_ms, cost_usd). Policies wrap existing replay
  (replay_runner) + hybrid (HybridFlowAgent) + a generic agent driver.
- inspect_export.py: portable Inspect eval-log JSON export/round-trip (no
  inspect_ai runtime dependency).
- external.py: OSWorldAdapter + BrowserGymAdapter phase-2 stubs
  (NotImplementedError + wiring docstrings; nothing installed).

Verified with targeted, fully-mocked tests (12 pass): protocol conformance
(runtime_checkable), run_meta row correctness (ground truth from verify(), not
policy self-report), registry + native effect-verifier delegation, Inspect-log
round-trip, and clean NotImplementedError from the external stubs. No live
Azure/VM/paid infra exercised.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CKrVJJy5jWVCkXAqgUqtqZ
@abrichr abrichr merged commit ae9a8c7 into main Jul 14, 2026
1 check passed
@abrichr abrichr deleted the feat/meta-benchmark-harness branch July 14, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant